OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
find_dt_for_targeted_added_mass.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| find_dt_for_targeted_added_mass ../engine/source/time_step/find_dt_for_targeted_added_mass.F
25!||--- called by ------------------------------------------------------
26!|| resol ../engine/source/engine/resol.F
27!||--- calls -----------------------------------------------------
28!|| find_dt_target ../common_source/tools/time_step/find_dt_target.F
29!|| myqsort ../common_source/tools/sort/myqsort.F
30!|| spmd_gather_dtnoda ../engine/source/mpi/generic/spmd_gather_dtnoda.F
31!|| spmd_glob_imax9 ../engine/source/mpi/generic/spmd_glob_imax9.F
32!|| spmd_glob_isum9 ../engine/source/mpi/interfaces/spmd_th.F
33!|| spmd_rbcast ../engine/source/mpi/generic/spmd_rbcast.F
34!||--- uses -----------------------------------------------------
35!|| groupdef_mod ../common_source/modules/groupdef_mod.F
36!|| message_mod ../engine/share/message_module/message_mod.F
37!||====================================================================
38 SUBROUTINE find_dt_for_targeted_added_mass(MS,STIFN,DTSCA,IGRP_USR,TARGET_DT,
39 . PERCENT_ADDMASS,PERCENT_ADDMASS_OLD,TOTMAS,WEIGHT,IGRNOD,
40 . ICNDS10)
41C-----------------------------------------------
42C A n a l y s e M o d u l e
43C-----------------------------------------------
44 USE groupdef_mod
45 USE message_mod
46C-----------------------------------------------
47C I m p l i c i t T y p e s
48C-----------------------------------------------
49#include "implicit_f.inc"
50C-----------------------------------------------
51C D u m m y A r g u m e n t s
52C-----------------------------------------------
53 INTEGER WEIGHT(*),IGRP_USR,ICNDS10(3,*)
54 my_real
55 . ms(*),stifn(*),target_dt,dtsca,percent_addmass,percent_addmass_old,totmas
56C-----------------------------------------------
57 TYPE (GROUP_) , DIMENSION(NGRNOD) :: IGRNOD
58C-----------------------------------------------
59C C o m m o n B l o c k s
60C-----------------------------------------------
61#include "com01_c.inc"
62#include "com04_c.inc"
63#include "task_c.inc"
64C-----------------------------------------------
65C L o c a l V a r i a b l e s
66C-----------------------------------------------
67 INTEGER I,N,COMPT,K,NVAL,SIZ,SIZG,SIZ_MAX,ND,IGROUP
68 INTEGER, DIMENSION(:),ALLOCATABLE :: TAGN
69 my_real, DIMENSION(:),ALLOCATABLE,TARGET ::
70 . dt2_l
71 my_real, DIMENSION(:),ALLOCATABLE ::
72 . stf_l,ms_l
73 my_real, DIMENSION(:),POINTER ::
74 . tmp
75 my_real sumk,summ,target_percent
76 INTEGER :: IERROR
77 INTEGER, DIMENSION(:), ALLOCATABLE :: PERM
78C=======================================================================
79C
80C--------------------------------------------------------------------------------------
81C DERIVED FROM ADD_MS_L_STAT in starter - computation of time step according to requested % of added mass
82C--------------------------------------------------------------------------------------
83C
84 siz = 0
85 ALLOCATE(tagn(numnod))
86 tagn(1:numnod) = 0
87C
88C--- Condensed nodes of TETRA10 are excluded
89 DO i=1,ns10e
90 nd = iabs(icnds10(1,i))
91 tagn(nd) = -1
92 ENDDO
93C
94 igroup = 0
95 IF (igrp_usr < 0) THEN
96 DO i=1,ngrnod
97 IF (-igrp_usr==igrnod(i)%ID) igroup = i
98 ENDDO
99 ELSE
100 igroup = igrp_usr
101 ENDIF
102C
103C--- Count and tag nodes to be taken into account for target_dt computation
104 IF (igroup > 0) THEN
105 DO i=1,igrnod(igroup)%NENTITY
106 n = igrnod(igroup)%ENTITY(i)
107 IF ((weight(n)==1).AND.(ms(n)/=zero).AND.(stifn(n)>em20).AND.(tagn(n)==0)) THEN
108 tagn(n) = 1
109 siz = siz + 1
110 ENDIF
111 ENDDO
112 ELSE
113 DO i=1,numnod
114 IF ((weight(i)==1).AND.(ms(i)/=zero).AND.(stifn(i)>em20).AND.(tagn(i)==0)) THEN
115 tagn(i) = 1
116 siz = siz + 1
117 ENDIF
118 ENDDO
119 ENDIF
120 sizg = siz
121 siz_max = siz
122C
123C--- Counstruction of arrays
124 IF (nspmd > 1) THEN
125 CALL spmd_glob_imax9(siz_max,1)
126 CALL spmd_glob_isum9(sizg,1)
127 IF (ispmd == 0) THEN
128 ALLOCATE(dt2_l(2*sizg),stf_l(sizg),ms_l(sizg))
129 siz = siz_max
130 ENDIF
131 CALL spmd_gather_dtnoda(tagn,stifn,ms,weight,siz,dt2_l,stf_l,ms_l)
132 ELSE
133 ALLOCATE(dt2_l(2*sizg),stf_l(sizg),ms_l(sizg))
134 compt = 0
135 DO i=1,numnod
136 IF (tagn(i) > 0) THEN
137 compt = compt + 1
138 dt2_l(compt) = ms(i)/stifn(i)
139 ms_l(compt) = ms(i)
140 stf_l(compt) = stifn(i)
141 ENDIF
142 ENDDO
143 ENDIF
144C
145 DEALLOCATE(tagn)
146C
147 IF (ispmd == 0) THEN
148C
149 tmp => dt2_l(sizg+1:sizg*2)
150 ALLOCATE( perm(sizg ))
151C
152C --- Sorting
153C
154 summ = zero
155 sumk = zero
156 DO i=1,sizg
157 tmp(i)=i
158 perm(i) = i
159 summ = summ + ms_l(i)
160 sumk = sumk + stf_l(i)
161 ENDDO
162
163 CALL myqsort(sizg,dt2_l,perm,ierror)
164 tmp(1:sizg) = perm(1:sizg)
165
166 DEALLOCATE( perm )
167C
168C----- determination of target time step
169C
170C in case of rst
171C
172C /MASS/RESET -> PERCENT_ADDMASS_OLD has to be reset
173 IF (imassi==1) percent_addmass_old = zero
174C
175 target_percent = max(zero,percent_addmass - percent_addmass_old)
176 percent_addmass_old = percent_addmass
177C
178 nval = 1
179 CALL find_dt_target(ms_l,stf_l,target_dt,target_percent,dt2_l,tmp,dtsca,totmas,nval,sizg)
180C
181 DEALLOCATE(dt2_l,stf_l,ms_l)
182C
183 ENDIF
184C
185 IF (nspmd > 1) CALL spmd_rbcast(target_dt,target_dt,1,1,0,2)
186C
187 RETURN
188 END
subroutine find_dt_for_targeted_added_mass(ms, stifn, dtsca, igrp_usr, target_dt, percent_addmass, percent_addmass_old, totmas, weight, igrnod, icnds10)
subroutine find_dt_target(ms, stifn, target_dt_tab, per_adm_tab, dt, tmp, dtsca, totmas, nval, nnod)
#define max(a, b)
Definition macros.h:21
subroutine myqsort(n, a, perm, error)
Definition myqsort.F:51
subroutine spmd_gather_dtnoda(tagn, stifn, ms, weight, num, dt2_l, stf_l, ms_l)
subroutine spmd_glob_imax9(v, len)
subroutine spmd_rbcast(tabi, tabr, n1, n2, from, add)
Definition spmd_rbcast.F:62
subroutine spmd_glob_isum9(v, len)
Definition spmd_th.F:523