OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
read_pch_file.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!|| read_pch_file ../starter/source/constraints/fxbody/read_pch_file.F
25!||--- called by ------------------------------------------------------
26!|| hm_read_fxb1 ../starter/source/constraints/fxbody/hm_read_fxb.F
27!|| hm_setfxrbyon ../starter/source/constraints/fxbody/hm_setfxrbyon.F
28!||--- calls -----------------------------------------------------
29!|| ancmsg ../starter/source/output/message/message.F
30!|| fxrline ../starter/source/constraints/fxbody/hm_read_fxb.F
31!|| usr2sys ../starter/source/system/sysfus.F
32!||--- uses -----------------------------------------------------
33!|| message_mod ../starter/share/message_module/message_mod.F
34!||====================================================================
35 SUBROUTINE read_pch_file(FLAG,MATRIX,ITAG,MATRIX_ADD,CPT_STIFF,
36 . CPT_MASS,ITABM1,PCH_FILE,ID,TITR)
37C-----------------------------------------------
38C M o d u l e s
39C-----------------------------------------------
41 USE message_mod
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 ID,ITABM1(*),ITAG(*),MATRIX_ADD(4,*), CPT_STIFF,CPT_MASS,FLAG
51 my_real matrix(*)
52 CHARACTER PCH_FILE*100
53 CHARACTER(LEN=NCHARTITLE) :: TITR
54C-----------------------------------------------
55C L o c a l V a r i a b l e s
56C-----------------------------------------------
57 INTEGER I,REF,IFO,TIN,TOUT,POLAR,NCOL,DUM,ID_NOD1,ID_NOD2,J,ISTOP
58 my_real rell
59 CHARACTER DEBUT*8,NAME*8,MATRIX_TYPE*16,NWLINE*100,MESS*40
60
61 INTEGER :: LEN_TMP_NAME,I_ERR
62 CHARACTER(len=2148) :: TMP_NAME
63C-----------------------------------------------
64C E x t e r n a l F u n c t i o n s
65C-----------------------------------------------
66 INTEGER USR2SYS
67 DATA mess/'FLEXIBLE BODY DEF - READ OF PCH FILE '/
68C=======================================================================
69C
70C FLAG = 0 -> PREREADING FOR NODES DETECTION AND NUMBERING (SETRFXBYON.F)
71C FLAG = 1 -> READING OF NODES AND MATRIX (LECFXB1.F)
72C
73 ref = 71
74 i_err = 0
75C
76 len_tmp_name = infile_name_len+len_trim(pch_file)
77 tmp_name=infile_name(1:infile_name_len)//pch_file(1:len_trim(pch_file))
78 OPEN(unit=ref,file=tmp_name(1:len_tmp_name),
79 . access='SEQUENTIAL',form='FORMATTED',status='UNKNOWN')
80C
81 CALL fxrline(ref,nwline,id,titr)
82 READ(nwline,'((A,A,5I8,I16))') debut,name,dum,ifo,tin,tout,polar,ncol
83C
84 IF ((ifo == 6).AND.(tin < 3)) THEN
85C
86C------- Symmetric matrix - real (no imaginary part) -----------
87C
88C Reading of a new block --
89 DO WHILE (i_err == 0)
90C
91 istop=0
92 DO WHILE (istop==0)
93 READ(ref,'(A)',END=100) nwline
94 IF (nwline(1:5)=='DMIG ') THEN
95 READ(nwline,'((A,A,5I8,I16))') debut,name,dum,ifo,tin,tout,polar,ncol
96 ELSEIF ((nwline(1:1)/='#').AND.((nwline(1:1)/='$')).AND.((len_trim(nwline)/=0))) THEN
97 istop=1
98 ENDIF
99 ENDDO
100C
101 READ(nwline,'((A,A,2I16))') debut,matrix_type,id_nod1,i
102 id_nod1=usr2sys(id_nod1,itabm1,mess,id)
103 IF (id_nod1 /= 0) THEN
104 itag(id_nod1) = 1
105 ELSE
106 RETURN
107 ENDIF
108C
109 CALL fxrline(ref,nwline,id,titr)
110C
111 IF (adjustl(matrix_type) == 'KAAX') THEN
112 DO WHILE (nwline(1:1) == '*')
113 READ(nwline,'((A,I16,I16,F16.3))') debut,id_nod2,j,rell
114 cpt_stiff = cpt_stiff + 1
115 id_nod2=usr2sys(id_nod2,itabm1,mess,id)
116 IF (id_nod2 /= 0) THEN
117 itag(id_nod2) = 1
118 IF (flag == 1) THEN
119 matrix(cpt_stiff-1) = rell
120 matrix_add(1,cpt_stiff-1) = id_nod1
121 matrix_add(2,cpt_stiff-1) = id_nod2
122 matrix_add(3,cpt_stiff-1) = i
123 matrix_add(4,cpt_stiff-1) = j
124 ENDIF
125 ELSE
126 RETURN
127 ENDIF
128 READ(ref,'(A)',iostat=i_err,END=100) nwline
129 END DO
130C
131 ELSEIF (adjustl(matrix_type) == 'MAAX') THEN
132 DO WHILE (nwline(1:1) == '*')
133 READ(nwline,'((A,I16,I16,F16.3))') debut,id_nod2,j,rell
134 cpt_mass = cpt_mass + 1
135 id_nod2=usr2sys(id_nod2,itabm1,mess,id)
136 IF (id_nod2 /= 0) THEN
137 IF (flag == 1) THEN
138 matrix(cpt_mass-1) = rell
139 matrix_add(1,cpt_mass-1) = id_nod1
140 matrix_add(2,cpt_mass-1) = id_nod2
141 matrix_add(3,cpt_mass-1) = i
142 matrix_add(4,cpt_mass-1) = j
143 ENDIF
144 ELSE
145 RETURN
146 ENDIF
147 READ(ref,'(A)',iostat=i_err,END=100) nwline
148 END DO
149C
150 ELSEIF ((adjustl(matrix_type)=='BAAX').OR.(adjustl(matrix_type)=='PAX').OR.adjustl(matrix_type)=='K4AAX') THEN
151C-- Input not compatible
152 i_err = 1
153 IF (flag == 0) THEN
154 CALL ancmsg(msgid=1738,
155 . msgtype=msgerror,
156 . anmode=aninfo_blind_1,
157 . i1=id,
158 . c1=titr,
159 . c2=adjustl(matrix_type))
160 ENDIF
161C
162 ENDIF
163C
164 backspace(ref)
165C
166 END DO
167C
168100 CONTINUE
169C
170 ENDIF
171C
172 CLOSE(unit=ref,status='KEEP')
173C
174 RETURN
175C
176 END SUBROUTINE read_pch_file
#define my_real
Definition cppsort.cpp:32
subroutine fxrline(ific, nwline, id, titr)
initmumps id
integer infile_name_len
character(len=infile_char_len) infile_name
integer, parameter nchartitle
subroutine read_pch_file(flag, matrix, itag, matrix_add, cpt_stiff, cpt_mass, itabm1, pch_file, id, titr)
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:889
integer function usr2sys(iu, itabm1, mess, id)
Definition sysfus.F:160