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