OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
iniphase.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!|| iniphase ../starter/source/initial_conditions/inivol/iniphase.F
25!||--- called by ------------------------------------------------------
26!|| inifill ../starter/source/initial_conditions/inivol/inifill.F
27!||--- uses -----------------------------------------------------
28!||====================================================================
29 SUBROUTINE iniphase(N2D ,NUMELS ,NUMELTG ,NUMELQ ,
30 . NUMNOD ,NGROUP ,
31 . IXS ,IPART_ ,IPHASE ,IDP ,
32 . KVOL ,NUPARAM ,UPARAM ,NTRACE ,
33 . ITAGNSOL ,ISOLNOD ,PART_FILL ,NBIP ,
34 . NBSUBMAT ,MLW ,ELBUF_TAB ,NG , MULTI_FVM,
35 . IXQ ,IXTG ,ITYP ,NEL )
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE elbufdef_mod
40 USE multi_fvm_mod
41 USE constant_mod , ONLY : nine_over_10
42C-----------------------------------------------
43C I m p l i c i t T y p e s
44C-----------------------------------------------
45#include "implicit_f.inc"
46C-----------------------------------------------
47C D u m m y A r g u m e n t s
48C-----------------------------------------------
49 INTEGER,INTENT(IN) :: N2D !< 2d/3d flag
50 INTEGER,INTENT(IN) :: NUMELS, NUMELTG, NUMELQ, NUMNOD, NGROUP !array sizes
51 INTEGER,INTENT(IN) :: NBSUBMAT
52 INTEGER IXS(NIXS,NUMELS),IPART_(*),IPHASE(NBSUBMAT+1,*),IDP,NUPARAM
53 INTEGER ITAGNSOL(NUMNOD)
54 INTEGER :: NBIP(NBSUBMAT,NEL) !< number of internal points
55 INTEGER :: NTRACE !< maximum number of internal points (NBIP <= NTRACE, default 7*7*7)
56 INTEGER ISOLNOD,PART_FILL(*)
57 INTEGER,INTENT(IN) :: IXQ(NIXQ,NUMELQ) !< quad connectivity buffer
58 INTEGER,INTENT(IN) :: IXTG(NIXTG,NUMELTG) !< triangles connectivity buffer
59 INTEGER, INTENT(IN) :: ITYP !< elem types of the current group (quad, triangles, hexa,)
60 my_real kvol(nbsubmat,nel) !< volume fractions
61 my_real uparam(nuparam)
62 INTEGER,INTENT(IN) :: MLW !< material law (type)
63 INTEGER,INTENT(IN) :: NG !< current elem group
64 TYPE(elbuf_struct_), TARGET, DIMENSION(NGROUP), INTENT(IN) :: ELBUF_TAB
65 TYPE (MULTI_FVM_STRUCT), INTENT(IN) :: MULTI_FVM
66 INTEGER, INTENT(IN) :: NEL !< number of elements in the group
67C-----------------------------------------------
68C L o c a l V a r i a b l e s
69C-----------------------------------------------
70 INTEGER :: I,K,J !< loop and temporary integers
71 INTEGER :: IMAT !< submat identifier (in 1:NBSUBMAT)
72 INTEGER :: IX(4) !< working array for shell nodes
73 my_real :: AV(NBSUBMAT) !< working array for volume fractions
74 TYPE(G_BUFEL_) ,POINTER :: GBUF !< global elem buffer
75 TYPE(L_BUFEL_) ,POINTER :: LBUF !< local elem buffer (submaterials)
76C-----------------------------------------------
77C---
78C FILL ELEMENTS INPUT PHASES
79C---
80 av(1:nbsubmat) = zero
81
82 IF(mlw==51)THEN
83 !when using LAW51 nbsubmat=4
84 av(1) = uparam(4)
85 av(2) = uparam(5)
86 av(3) = uparam(6)
87 av(4) = uparam(46)
88 ELSE
89 gbuf => elbuf_tab(ng)%GBUF
90 DO i=1,multi_fvm%NBMAT
91 lbuf => elbuf_tab(ng)%BUFLY(i)%LBUF(1,1,1)
92 av(i) = lbuf%VOL(1) / gbuf%VOL(1) !same value for idx=1,NEL then idx=1 here.
93 ENDDO
94 ENDIF
95C
96 DO i=1,nel
97 IF(ipart_(i) /= 0) THEN
98 IF (ipart_(i) /= idp .AND. part_fill(ipart_(i)) == 0) THEN
99 kvol(1:nbsubmat,i) = av(1:nbsubmat)
100 part_fill(ipart_(i)) = 1
101 ELSEIF (ipart_(i) == idp) THEN
102 imat=maxloc(av(1:nbsubmat),1) ! The default phase is the one that is most prevalent.
103 iphase(1,i) = imat
104 iphase(nbsubmat+1,i) = 1 !number of present submaterials
105 kvol(imat,i) = zero
106 IF (nbip(imat,i) == 0) THEN
107 nbip(imat,i) = ntrace
108 ENDIF
109 IF (isolnod == 8) THEN
110 DO k=2,9
111 j = ixs(k,i)
112 IF(itagnsol(j) == 0)itagnsol(j) = 1
113 END DO
114 ELSEIF (isolnod == 4) THEN
115 ix(1) =ixs(2,i)
116 ix(2) =ixs(4,i)
117 ix(3) =ixs(7,i)
118 ix(4) =ixs(6,i)
119 DO k=1,4
120 j = ix(k)
121 IF(itagnsol(j) == 0)itagnsol(j) = 1
122 END do!next K
123 ELSEIF(ityp == 7 .AND. n2d > 0)THEN
124 IF(itagnsol(ixtg(2,i)) == 0)itagnsol(ixtg(2,i)) = 1
125 IF(itagnsol(ixtg(3,i)) == 0)itagnsol(ixtg(3,i)) = 1
126 IF(itagnsol(ixtg(4,i)) == 0)itagnsol(ixtg(4,i)) = 1
127 ELSEIF(ityp == 2)THEN
128 IF(itagnsol(ixq(2,i)) == 0)itagnsol(ixq(2,i)) = 1
129 IF(itagnsol(ixq(3,i)) == 0)itagnsol(ixq(3,i)) = 1
130 IF(itagnsol(ixq(4,i)) == 0)itagnsol(ixq(4,i)) = 1
131 IF(itagnsol(ixq(5,i)) == 0)itagnsol(ixq(5,i)) = 1
132 endif!ISOLNOD
133 part_fill(idp) = 1
134 END if!(IPART_(I) /= IDP )
135 ENDIF !IF(IPART(I) /= 0)
136 END do!next I
137C-----
138 RETURN
139 END
#define my_real
Definition cppsort.cpp:32
if(complex_arithmetic) id
subroutine iniphase(n2d, numels, numeltg, numelq, numnod, ngroup, ixs, ipart_, iphase, idp, kvol, nuparam, uparam, ntrace, itagnsol, isolnod, part_fill, nbip, nbsubmat, mlw, elbuf_tab, ng, multi_fvm, ixq, ixtg, ityp, nel)
Definition iniphase.F:36