OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_preread_node.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/.
23C
24!||====================================================================
25!|| hm_preread_node ../starter/source/elements/reader/hm_preread_node.F
26!||--- called by ------------------------------------------------------
27!|| contrl ../starter/source/starter/contrl.F
28!||--- calls -----------------------------------------------------
29!|| ancmsg ../starter/source/output/message/message.F
30!|| auto_node_merge ../starter/source/elements/nodes/auto_node_merge.F
31!||--- uses -----------------------------------------------------
32!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
33!|| message_mod ../starter/share/message_module/message_mod.F
34!|| reader_old_mod ../starter/share/modules1/reader_old_mod.F90
35!|| submodel_mod ../starter/share/modules1/submodel_mod.F
36!||====================================================================
37 SUBROUTINE hm_preread_node(UNITAB,LSUBMODEL,NUMNUSR,IS_DYNA)
38C-----------------------------------------------
39C M o d u l e s
40C-----------------------------------------------
41 USE unitab_mod
42 USE message_mod
46 USE reader_old_mod , ONLY : line
47 USE user_id_mod , ONLY : id_limit
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 "com04_c.inc"
56#include "scr17_c.inc"
57C-----------------------------------------------
58C D u m m y A r g u m e n t s
59C-----------------------------------------------
60 TYPE (UNIT_TYPE_),INTENT(IN) :: UNITAB
61 TYPE(submodel_data),INTENT(IN):: LSUBMODEL(NSUBMOD)
62 INTEGER,INTENT(IN) :: NUMNUSR
63 INTEGER,INTENT(IN) :: IS_DYNA
64C-----------------------------------------------
65C L o c a l V a r i a b l e s
66C-----------------------------------------------
67 INTEGER :: N,I,J,STAT
68 INTEGER :: IFLAGUNIT, UID
69 my_real :: fac_l
70 INTEGER, DIMENSION(:), ALLOCATABLE :: SUB_NOD,UID_NOD
71 INTEGER, DIMENSION(:), ALLOCATABLE :: ITAB
72 my_real, DIMENSION(:,:), ALLOCATABLE :: x
73 real*8, DIMENSION(:,:), ALLOCATABLE :: hm_x
74 real*8, DIMENSION(:), ALLOCATABLE :: dmerge
75C-----------------------------------------------
76 fac_l = one
77C--------------------------------------------------
78C ALLOCS & INITS
79C--------------------------------------------------
80 ALLOCATE (itab(numnusr+numcnod),stat=stat)
81 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,msgtype=msgerror,c1='ITAB')
82 ALLOCATE (x(3,numnusr+numcnod),stat=stat)
83 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,msgtype=msgerror,c1='X')
84 ALLOCATE (sub_nod(numnusr+numcnod),stat=stat)
85 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,msgtype=msgerror,c1='SUB_NOD')
86 ALLOCATE (uid_nod(numnusr+numcnod),stat=stat)
87 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,msgtype=msgerror,c1='UID_NOD')
88 ALLOCATE (hm_x(3,numnusr+numcnod),stat=stat)
89 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,msgtype=msgerror,c1='HM_X')
90 ALLOCATE (dmerge(numcnod),stat=stat)
91 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,msgtype=msgerror,c1='DMERGE')
92 sub_nod(1:numnusr+numcnod) = 0
93 uid_nod(1:numnusr+numcnod) = 0
94 dmerge(1:numcnod) = zero
95C--------------------------------------------------
96C PRE-READING OF INPUT NODES IN HM STRUCTURE
97C--------------------------------------------------
98 CALL cpp_nodes_read(itab,hm_x,dmerge,sub_nod,uid_nod)
99C--------------------------------------------------
100C FILL OTHER STRUCTURES + CHECKS
101C--------------------------------------------------
102 uid = -1
103 n=0
104 DO i=1,numnusr+numcnod
105 n=n+1
106 x(1,n) = hm_x(1,n)
107 x(2,n) = hm_x(2,n)
108 x(3,n) = hm_x(3,n)
109C--------------------------------------------------
110 IF(sub_nod(n) /= 0)THEN
111 IF(uid_nod(n) == 0 .AND. lsubmodel(sub_nod(n))%UID /= 0) uid_nod(n) = lsubmodel(sub_nod(n))%UID
112 ENDIF
113 IF ( itab(n) > id_limit%GLOBAL )THEN
114 CALL ancmsg(msgid=509,anmode=aninfo,msgtype=msgerror,i1=itab(n),c1=line,c2='/NODE')
115 ENDIF
116C--------------------------------------------------
117C UNITS
118C--------------------------------------------------
119 IF(uid_nod(n) /= uid )THEN
120 uid = uid_nod(n)
121 iflagunit = 0
122 DO j=1,unitab%NUNITS
123 IF (unitab%UNIT_ID(j) == uid) THEN
124 fac_l = unitab%FAC_L(j)
125 iflagunit = 1
126 EXIT
127 ENDIF
128 ENDDO
129 IF (uid/=0 .AND. iflagunit==0 .AND. i <= numnusr)THEN
130 CALL ancmsg(msgid=643,anmode=aninfo,msgtype=msgerror,i1=uid,c1='/NODE')
131 ELSEIF (uid/=0 .AND. iflagunit==0 .AND. i > numnusr)THEN
132 CALL ancmsg(msgid=643,anmode=aninfo,msgtype=msgerror,i1=uid,c1='/CNODE')
133 ENDIF
134 ENDIF
135 x(1,n) = x(1,n)*fac_l
136 x(2,n) = x(2,n)*fac_l
137 x(3,n) = x(3,n)*fac_l
138 ENDDO
139 IF(ALLOCATED(sub_nod)) DEALLOCATE(sub_nod)
140 IF(ALLOCATED(uid_nod)) DEALLOCATE(uid_nod)
141 IF(ALLOCATED(hm_x)) DEALLOCATE(hm_x)
142 IF(ALLOCATED(dmerge)) DEALLOCATE(dmerge)
143C--------------------------------------------------
144C Check nodes within some tolerance (possibly merge nodes)
145C--------------------------------------------------
146 CALL auto_node_merge(is_dyna,numnusr,numcnod,numnod,itab,x)
147C--------------------------------
148 DEALLOCATE(itab,x)
149 RETURN
150C--------------------------------
151 END
subroutine auto_node_merge(is_dyna, numnusr, numcnod, numnod, itab, x)
#define my_real
Definition cppsort.cpp:32
subroutine hm_preread_node(unitab, lsubmodel, numnusr, is_dyna)
integer, parameter ncharfield
integer nsubmod
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
Definition message.F:895