OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
h3d_create_fvmbag_centroids.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!|| h3d_create_fvmbag_centroids ../engine/source/output/h3d/h3d_build_fortran/h3d_create_fvmbag_centroids.F
25!||--- called by ------------------------------------------------------
26!|| genh3d ../engine/source/output/h3d/h3d_results/genh3d.F
27!||--- calls -----------------------------------------------------
28!|| c_h3d_create_nodes ../engine/source/output/h3d/h3d_build_cpp/c_h3d_create_nodes.cpp
29!||--- uses -----------------------------------------------------
30!|| fvbag_mod ../engine/share/modules/fvbag_mod.F
31!|| groupdef_mod ../common_source/modules/groupdef_mod.F
32!||====================================================================
33 SUBROUTINE h3d_create_fvmbag_centroids(MONVOL,VOLMON, FVDATA, NFVBAG, SMONVOL, SVOLMON, AIRBAGS_NODE_ID_SHIFT)
34C-----------------------------------------------
35C D e s c r i p t i o n
36C-----------------------------------------------
37C This suroutine generates orphan nodes entities located at polyhedra centroids
38C (Visualization purpose)
39C-----------------------------------------------
40C P r e - C o n d i t i o n s
41C-----------------------------------------------
42C none
43C-----------------------------------------------
44C M o d u l e s
45C-----------------------------------------------
46 USE fvbag_mod , only:fvbag_data !data structure definition
47 USE groupdef_mod , only:group_
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51#include "implicit_f.inc"
52C-----------------------------------------------
53C C o m m o n B l o c k s
54C-----------------------------------------------
55#include "com01_c.inc"
56#include "com04_c.inc"
57#include "com08_c.inc"
58#include "vect01_c.inc"
59#include "param_c.inc"
60#include "inter22.inc"
61C-----------------------------------------------
62C D u m m y A r g u m e n t s
63C-----------------------------------------------
64 INTEGER,INTENT(IN) :: NFVBAG, SMONVOL, SVOLMON
65 INTEGER,INTENT(IN) :: AIRBAGS_NODE_ID_SHIFT
66 my_real,INTENT(IN) :: volmon(svolmon)
67 INTEGER,INTENT(IN) :: MONVOL(SMONVOL)
68 TYPE(fvbag_data), INTENT(IN) :: FVDATA(NFVBAG)
69C-----------------------------------------------
70C L o c a l V a r i a b l e s
71C-----------------------------------------------
72 INTEGER :: K1 !< index shift for MONVOL ARRAY
73 INTEGER :: NN, II !< loop
74 INTEGER :: ITYP !< monvol type (refer to read_monvol.F)
75 INTEGER :: IH3D_FLAG !< flag for H3D output
76 INTEGER :: NNODES !< number of centroids
77 INTEGER :: IFV !< FVMBAG identifier in [1, NFVBAG] where NFVBAG <= NVOLU
78 INTEGER :: nodeID !< node identifier (internal)
79 INTEGER :: NPOLH !< number of polyhedra for a given airbag
80 my_real :: value_x !< polyhedron centroid X-value
81 my_real :: value_y !< polyhedron centroid Y-value
82 my_real :: value_z !< polyhedron centroid Z-value
83
84 INTEGER, ALLOCATABLE,DIMENSION(:) :: ITAB_FVMBAG,TAGNOD_FVMBAG
85 my_real, ALLOCATABLE,DIMENSION(:,:) :: xyz_fvmbag,disp_fvmbag
86 INTEGER :: ILEN
87
88C-----------------------------------------------
89C S o u r c e L i n e s
90C-----------------------------------------------
91
92
93 !loop over all airbags, skip ones which are not FVMBAG (no internal mesh)
94 ! then generate H3D (orphan) nodes at centroids
95 k1=1
96 nnodes = 0
97 DO nn=1,nvolu
98 ityp=monvol(k1-1+2)
99 IF (ityp == 6.OR.ityp == 8 .OR. ityp == 11) THEN ! /MONVOL/FVMBAG, or FVMBAG1, or FVMBAG2
100 ih3d_flag = monvol(k1-1 +75) !GRNOD internal identifier in [1:NGRNOD]
101 ifv = monvol(k1-1 +45)
102 !check if grnod_id was provided, otherwise skip
103 IF(ih3d_flag == 1 .AND. ifv /= 0)THEN
104 npolh = fvdata(ifv)%NPOLH
105
106 IF(npolh > 0)THEN ! if there are any polyhedron
107
108 ALLOCATE(itab_fvmbag(npolh))
109 ALLOCATE(tagnod_fvmbag(npolh))
110 ALLOCATE(xyz_fvmbag(3,npolh))
111 ALLOCATE(disp_fvmbag(3,npolh))
112
113 DO ii=1, fvdata(ifv)%NPOLH !loop over polyhedra composing the airbag mesh
114
115 xyz_fvmbag(1,ii) = zero
116 xyz_fvmbag(2,ii) = zero
117 xyz_fvmbag(3,ii) = zero
118
119 disp_fvmbag(1,ii) = zero! -FVDATA(IFV)%CENTROID_POLH(1,II)
120 disp_fvmbag(2,ii) = zero! -FVDATA(IFV)%CENTROID_POLH(2,II)
121 disp_fvmbag(3,ii) = zero! -FVDATA(IFV)%CENTROID_POLH(3,II)
122
123 itab_fvmbag(ii) = airbags_node_id_shift + nnodes + ii
124 tagnod_fvmbag(ii) = 1
125
126 enddo! next I (next polyhedron)
127
128 CALL c_h3d_create_nodes(itab_fvmbag,npolh,xyz_fvmbag,tagnod_fvmbag,disp_fvmbag)
129
130 DEALLOCATE(itab_fvmbag)
131 DEALLOCATE(tagnod_fvmbag)
132 DEALLOCATE(xyz_fvmbag)
133 DEALLOCATE(disp_fvmbag)
134 nnodes = nnodes + fvdata(ifv)%NPOLH
135
136 ENDIF !NNODES>0
137
138 ENDIF !IH3D_FLAG>0
139
140 ENDIF ! ITYP
141 k1=k1+nimv
142 ENDDO !next NN
143
144 RETURN
145 END
void c_h3d_create_nodes(int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
#define my_real
Definition cppsort.cpp:32
subroutine h3d_create_fvmbag_centroids(monvol, volmon, fvdata, nfvbag, smonvol, svolmon, airbags_node_id_shift)