OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
h3d_update_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_update_fvmbag_centroids ../engine/source/output/h3d/h3d_build_fortran/h3d_update_fvmbag_centroids.F
25!||--- called by ------------------------------------------------------
26!|| genh3d ../engine/source/output/h3d/h3d_results/genh3d.F
27!||--- calls -----------------------------------------------------
28!|| c_h3d_update_fvmbag_nodes ../engine/source/output/h3d/h3d_build_cpp/c_h3d_update_fvmbag_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_update_fvmbag_centroids(H3DTITLE,LEN_H3DTITLE,IH3D,MONVOL,VOLMON, NFVBAG, SMONVOL, SVOLMON,
34 . FVDATA_P, AIRBAGS_NODE_ID_SHIFT)
35C-----------------------------------------------
36C D e s c r i p t i o n
37C-----------------------------------------------
38C This suroutine updates orphan nodes entities located at polyhedra centroids
39C (Visualization purpose)
40C-----------------------------------------------
41C P r e - C o n d i t i o n s
42C-----------------------------------------------
43C none
44C-----------------------------------------------
45C M o d u l e s
46C-----------------------------------------------
48 USE groupdef_mod , only:group_
49C-----------------------------------------------
50C I m p l i c i t T y p e s
51C-----------------------------------------------
52#include "implicit_f.inc"
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56#include "com01_c.inc"
57#include "com04_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, AIRBAGS_NODE_ID_SHIFT
65 my_real,INTENT(IN) :: volmon(svolmon)
66 INTEGER,INTENT(IN) :: MONVOL(SMONVOL)
67 CHARACTER*80,INTENT(IN):: H3DTITLE
68 INTEGER,INTENT(IN) :: LEN_H3DTITLE , IH3D
69 TYPE(fvbag_data),INTENT(IN) :: FVDATA_P(NFVBAG)
70C-----------------------------------------------
71C L o c a l V a r i a b l e s
72C-----------------------------------------------
73 INTEGER :: K1 !< index shift for MONVOL ARRAY
74 INTEGER :: NN, II !< loop
75 INTEGER :: ITYP !< monvol type (refer to read_monvol.F)
76 INTEGER :: IH3D_FLAG !< flag for H3D output
77 INTEGER :: NNODES !< number of centroids
78 INTEGER :: IFV !< FVMBAG identifier in [1, NFVBAG] where NFVBAG <= NVOLU
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 INTEGER :: ILEN !< loop upper bound
84
85 INTEGER, ALLOCATABLE,DIMENSION(:) :: ITAB_FVMBAG
86 my_real, ALLOCATABLE,DIMENSION(:,:) :: xyz_fvmbag,disp_fvmbag
87C-----------------------------------------------
88C S o u r c e L i n e s
89C-----------------------------------------------
90
91
92 !loop over all airbags, skip ones which are not FVMBAG (no internal mesh)
93 ! then generate H3D (orphan) nodes at centroids
94 k1=1
95 nnodes = 0
96 DO nn=1,nvolu
97 ityp=monvol(k1-1+2)
98 IF (ityp == 6.OR.ityp == 8 .OR. ityp == 11) THEN ! /MONVOL/FVMBAG, or FVMBAG1, or FVMBAG2
99 ih3d_flag = monvol(k1-1 +75) !GRNOD internal identifier in [1:NGRNOD]
100 ifv = monvol(k1-1 +45)
101 !check if grnod_id was provided, otherwise skip
102 IF(ih3d_flag == 1 .AND. ifv /= 0)THEN
103 npolh = fvdata_p(ifv)%NPOLH
104
105 IF(npolh > 0)THEN ! if there are any polyhedron
106
107 ALLOCATE(itab_fvmbag(npolh))
108 ALLOCATE(disp_fvmbag(3,npolh))
109
110 DO ii=1, fvdata_p(ifv)%NPOLH !loop over polyhedra composing the airbag mesh
111
112 disp_fvmbag(1,ii) = fvdata_p(ifv)%CENTROID_POLH(1,ii)
113 disp_fvmbag(2,ii) = fvdata_p(ifv)%CENTROID_POLH(2,ii)
114 disp_fvmbag(3,ii) = fvdata_p(ifv)%CENTROID_POLH(3,ii)
115
116 itab_fvmbag(ii) = airbags_node_id_shift+nnodes+ii
117 enddo! next I (next polyhedron)
118
119 CALL c_h3d_update_fvmbag_nodes(h3dtitle,len_h3dtitle,ih3d,itab_fvmbag,npolh,disp_fvmbag)
120
121 DEALLOCATE(itab_fvmbag)
122 DEALLOCATE(disp_fvmbag)
123 nnodes = nnodes + fvdata_p(ifv)%NPOLH
124
125 ENDIF !NNODES>0
126
127 ENDIF !IH3D_FLAG>0
128
129 ENDIF ! ITYP
130 k1=k1+nimv
131 ENDDO !next NN
132
133
134
135 !loop from NNODES +1 to AIRBAGS_TOTAL_FVM_IN_H3D : locate them to 0,0,0
136 ilen = airbags_total_fvm_in_h3d - nnodes
137 ALLOCATE(itab_fvmbag(ilen+1))
138 ALLOCATE(disp_fvmbag(3,ilen+1))
139
140 DO ii=1,ilen
141 itab_fvmbag(ii) = airbags_node_id_shift+nnodes+ii
142 disp_fvmbag(1,ii) = zero
143 disp_fvmbag(2,ii) = zero
144 disp_fvmbag(3,ii) = zero
145 ENDDO
146
147 CALL c_h3d_update_fvmbag_nodes(h3dtitle,len_h3dtitle,ih3d,itab_fvmbag,ilen,disp_fvmbag)
148
149 DEALLOCATE(itab_fvmbag)
150 DEALLOCATE(disp_fvmbag)
151
152
153 RETURN
154 END
void c_h3d_update_fvmbag_nodes(char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D)
#define my_real
Definition cppsort.cpp:32
subroutine h3d_update_fvmbag_centroids(h3dtitle, len_h3dtitle, ih3d, monvol, volmon, nfvbag, smonvol, svolmon, fvdata_p, airbags_node_id_shift)
integer airbags_total_fvm_in_h3d
Definition fvbag_mod.F:191