OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
find_dt_for_targeted_added_mass.F File Reference
#include "implicit_f.inc"
#include "com01_c.inc"
#include "com04_c.inc"
#include "task_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine find_dt_for_targeted_added_mass (ms, stifn, dtsca, igrp_usr, target_dt, percent_addmass, percent_addmass_old, totmas, weight, igrnod, icnds10)

Function/Subroutine Documentation

◆ find_dt_for_targeted_added_mass()

subroutine find_dt_for_targeted_added_mass ( ms,
stifn,
dtsca,
integer igrp_usr,
target_dt,
percent_addmass,
percent_addmass_old,
totmas,
integer, dimension(*) weight,
type (group_), dimension(ngrnod) igrnod,
integer, dimension(3,*) icnds10 )

Definition at line 38 of file find_dt_for_targeted_added_mass.F.

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,*)
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
#define my_real
Definition cppsort.cpp:32
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