OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
ale_element_size_computation.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!|| ale_element_size_computation ../starter/source/initial_conditions/inivol/ale_element_size_computation.F
25!||--- called by ------------------------------------------------------
26!|| init_inivol ../starter/source/initial_conditions/inivol/init_inivol.F90
27!||--- uses -----------------------------------------------------
28!||====================================================================
29 SUBROUTINE ale_element_size_computation(NPARG, NGROUP, NUMELS,NUMELTG,NUMELQ,NUMNOD,N2D,
30 . IPARG,IXS,IXQ,IXTG,
31 . ELEMENT_SIZE,MIN_MAX_POSITION,X,
32 . ALE_ELEMENT_NUMBER,ALE_NODE_NUMBER,LIST_ALE_NODE)
33!$COMMENT
34! ALE_ELEMENT_SIZE_COMPUTATION description
35! ALE_ELEMENT_SIZE_COMPUTATION computes the maximum element size
36! and the min / max position of nodes
37! the maximum element size & min / max position are used to defined the grid
38!
39! ALE_ELEMENT_SIZE_COMPUTATION organization :
40! - loop over the element group
41! - for each ALE element group, loop over the NEL elements
42! - compute the maximum element size
43! - compute the min/max node's positions & save the ale node id
44!$ENDCOMMENT
45 use element_mod , only :nixs,nixq,nixtg
46C-----------------------------------------------
47C I m p l i c i t T y p e s
48C-----------------------------------------------
49#include "implicit_f.inc"
50C-----------------------------------------------
51C G l o b a l P a r a m e t e r s
52C-----------------------------------------------
53#include "mvsiz_p.inc"
54C-----------------------------------------------
55C D u m m y A r g u m e n t s
56C-----------------------------------------------
57 INTEGER,INTENT(IN) :: NPARG, NGROUP, NUMELS,NUMELTG,NUMELQ,NUMNOD,N2D
58 INTEGER, INTENT(INOUT) :: ALE_ELEMENT_NUMBER ! number of ale element with material 51 or 151
59 INTEGER, INTENT(INOUT) :: ALE_NODE_NUMBER ! number of ale node
60 INTEGER, DIMENSION(NUMNOD), INTENT(INOUT) :: LIST_ALE_NODE ! list of ale node
61 INTEGER, DIMENSION(NPARG,NGROUP), INTENT(IN) :: IPARG ! group data
62 INTEGER, DIMENSION(NIXS,NUMELS),INTENT(IN), TARGET :: IXS ! solid data
63 INTEGER, DIMENSION(NIXQ,NUMELQ),INTENT(IN), TARGET :: IXQ ! quad data
64 INTEGER, DIMENSION(NIXTG,NUMELTG),INTENT(IN), TARGET :: IXTG ! triangle data
65 my_real, INTENT(INOUT) :: element_size ! max element size
66 my_real, DIMENSION(6), INTENT(INOUT) :: min_max_position ! min/max position
67 my_real, DIMENSION(3,NUMNOD), INTENT(IN) :: x ! position
68C-----------------------------------------------
69C L o c a l V a r i a b l e s
70C-----------------------------------------------
71 INTEGER :: I,J,K,NG
72 INTEGER :: MTN,NEL,NFT,ITY,ISOLNOD,INIVOL
73 INTEGER :: NODE_NUMBER,FIRST
74 INTEGER, DIMENSION(:,:), POINTER :: IX
75 INTEGER, DIMENSION(:), ALLOCATABLE :: TAG_ARRAY
76 my_real :: local_size
77 my_real, DIMENSION(3) :: max_node,min_node,distance
78 integer, target :: nothing(1,1) !< dummy for indirection
79C-----------------------------------------------
80 ALLOCATE(tag_array(numnod))
81 tag_array(1:numnod) = 0
82 ix => nothing
83 element_size = -one
84 min_max_position(1:3) = ep30
85 min_max_position(4:6) = -ep30
86 ale_element_number = 0
87 ale_node_number = 0
88 ! -----------------------
89 ! loop over the solid / quad / triangle elements with 51/151 material
90 DO ng=1,ngroup
91 mtn = iparg(1,ng) ! material law
92 nel = iparg(2,ng) ! number of element
93 nft = iparg(3,ng) ! adress of first element
94 ity = iparg(5,ng) ! type of element
95 isolnod = iparg(28,ng)
96 inivol = iparg(53,ng)
97 IF(inivol <= 0) cycle
98 IF(mtn /= 51 .AND. mtn /= 151) cycle
99 IF(n2d == 0 .AND. ity /= 1)THEN
100 cycle
101 ELSEIF(n2d > 0 .AND. ity/=7 .AND. ity /= 2)THEN
102 cycle
103 ENDIF
104 ! total number of ale element with material 51 or 151
105 ale_element_number = ale_element_number + nel
106
107 ! ---------------
108 ! depending on the king of element
109 IF(ity == 1) THEN
110 first = 1
111 node_number = 8
112 ix => ixs(1:node_number+1,nft+1:nft+nel)
113 ELSEIF(ity == 2) THEN
114 first = 2
115 node_number = 4
116 ix => ixq(1:node_number+1,nft+1:nft+nel)
117 ELSEIF(ity == 7) THEN
118 first = 2
119 node_number = 3
120 ix => ixtg(1:node_number+1,nft+1:nft+nel)
121 ELSE
122 first = -huge(first)
123 node_number = -huge(node_number)
124 ix => null()
125 ENDIF
126 ! ---------------
127
128 ! ---------------
129 ! loop over the elements of the group to compute
130 ! the max element size and the min/max position
131 DO j=1,nel
132 max_node(1:3) = -ep20
133 min_node(1:3) = ep20
134 ! ---------------
135 ! max element size
136 DO i=1,node_number
137 max_node(first:3) = max(max_node(first:3),x(first:3,ix(1+i,j)) )
138 min_node(first:3) = min(min_node(first:3),x(first:3,ix(1+i,j)) )
139 ENDDO
140 distance(first:3) = (abs(max_node(first:3)-min_node(first:3)))**2
141 local_size = sqrt( sum(distance(first:3)) )
142 element_size = max(element_size,local_size)
143 ! --------------
144 ! ---------------
145 ! min / max position & save the ALE node id
146 DO k=first,3
147 ! min / max position
148 DO i=1,node_number
149 min_max_position(k) = min(min_max_position(k),x(k,ix(1+i,j)))
150 min_max_position(3+k) = max(min_max_position(3+k),x(k,ix(1+i,j)))
151 IF(tag_array(ix(1+i,j))==0) THEN
152 tag_array(ix(1+i,j)) = 1
153 ale_node_number = ale_node_number + 1
154 list_ale_node(ale_node_number) = ix(1+i,j)
155 ENDIF
156 ENDDO
157 ENDDO
158 ! ---------------
159 ENDDO
160 ! ---------------
161 ENDDO
162
163 DEALLOCATE(tag_array)
164 ! -----------------------
165
166 RETURN
167 END SUBROUTINE ale_element_size_computation
subroutine ale_element_size_computation(nparg, ngroup, numels, numeltg, numelq, numnod, n2d, iparg, ixs, ixq, ixtg, element_size, min_max_position, x, ale_element_number, ale_node_number, list_ale_node)
#define my_real
Definition cppsort.cpp:32
end diagonal values have been computed in the(sparse) matrix id.SOL
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21
initmumps id