OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
addmaspart.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!|| addmaspart ../starter/source/tools/admas/addmaspart.F
25!||--- called by ------------------------------------------------------
26!|| initia ../starter/source/elements/initia/initia.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| fretitl2 ../starter/source/starter/freform.F
30!||--- uses -----------------------------------------------------
31!|| message_mod ../starter/share/message_module/message_mod.F
32!||====================================================================
33 SUBROUTINE addmaspart(IPART,IPMAS,PARTSAV,
34 . PART_AREA,PM,ADDEDMS,NOM_OPT,PARTSAV_PON)
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE message_mod
41C-----------------------------------------------
42C I m p l i c i t T y p e s
43C-----------------------------------------------
44#include "implicit_f.inc"
45C-----------------------------------------------
46C C o m m o n B l o c k s
47C-----------------------------------------------
48#include "scr17_c.inc"
49#include "com04_c.inc"
50#include "param_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER IPART(LIPART1,*)
55 my_real partsav(20,*),partsav_pon(*),part_area(*),pm(npropm,*),addedms(*)
56 INTEGER NOM_OPT(LNOPT1,*)
57 TYPE (ADMAS_) , DIMENSION(NODMAS) :: IPMAS
58C-----------------------------------------------
59C L o c a l V a r i a b l e s
60C-----------------------------------------------
61 INTEGER I,ID_MASS,IPA,IP,NMAS,KAD,II,IMID,ITYPE,IFLAG
62 my_real amas,msp,masst(nodmas),ratio,addmas
63 CHARACTER(LEN=NCHARTITLE) :: TITR
64C=======================================================================
65!---
66 masst(1:nodmas) = zero
67!
68 DO 10 i=1,nodmas
69 id_mass = ipmas(i)%ID
70 nmas = ipmas(i)%NPART
71 itype= ipmas(i)%TYPE
72 iflag= ipmas(i)%WEIGHT_FLAG
73 IF (itype /= 3 .and. itype /= 4 .and.
74 . itype /= 6 .and. itype /= 7) GOTO 10
75!
76 CALL fretitl2(titr,nom_opt(lnopt1-ltitr+1,i),ltitr)
77!
78! check for type 4 and 7 :
79! if AMAS (replacing mass) < MSP (structured mass of concerned parts or list of parts)
80 IF (itype == 4) THEN
81 msp = zero ! structured mass of liste of parts
82 amas = zero
83 DO ii = 1,nmas
84 ip = ipmas(i)%PARTID(ii)
85 msp = msp + partsav_pon(ip) ! structured mass (of list of parts)
86 amas = ipmas(i)%PART(ii)%RPMAS
87 ENDDO ! DO II = 1,NMAS
88 IF (amas > msp) THEN
89 addmas = amas - msp
90 DO ii =1,nmas
91 ip = ipmas(i)%PARTID(ii)
92 ipmas(i)%PART(ii)%RPMAS = addmas ! non structural mass to be added (distributed)
93 ENDDO ! DO II = KAD
94 ELSE
95 CALL ancmsg(msgid=1576,
96 . msgtype=msgerror,
97 . anmode=anstop,
98 . i1=id_mass,
99 . c1=ipmas(i)%TITLE,
100 . r1=msp-amas)
101 ENDIF ! IF (AMAS > MSP)
102 ELSEIF (itype == 7) THEN
103 DO ii = 1,nmas
104 ip = ipmas(i)%PARTID(ii)
105 msp = partsav_pon(ip) ! structured mass of part
106 amas = ipmas(i)%PART(ii)%RPMAS ! non structural mass to be added (distributed)
107 IF (amas > msp) THEN
108 addmas = amas - msp
109 ipmas(i)%PART(ii)%RPMAS = addmas ! non structural mass to be added (distributed)
110 ELSE
111 ipa = ipart(4,ip)
112 CALL ancmsg(msgid=877,
113 . msgtype=msgerror,
114 . anmode=anstop,
115 . i1=id_mass,
116 . c1=ipmas(i)%TITLE,
117 . r1=msp-amas,
118 . i2=ipa)
119 ENDIF ! IF (AMAS > MSP)
120 ENDDO ! DO II = 1,NMAS
121 ENDIF ! IF (ITYPE)
122!
123! PART MASS DISTRIBUTION :
124!
125 DO ii = 1,nmas
126 ip = ipmas(i)%PARTID(ii)
127 msp = partsav_pon(ip) ! ---> mass tag of PART
128 masst(i) = masst(i) + msp
129 ENDDO
130!---
131 DO ii = 1,nmas
132 ip = ipmas(i)%PARTID(ii)
133 msp = partsav_pon(ip) ! structured mass part
134 amas = ipmas(i)%PART(ii)%RPMAS ! added mass part
135!---
136 IF (itype == 3 .OR. itype == 4) THEN
137 ratio = msp / masst(i)
138 amas = amas * ratio
139 ipmas(i)%PART(ii)%RPMAS = amas
140 ELSEIF (itype == 6 .OR. itype == 7) THEN
141 ipmas(i)%PART(ii)%RPMAS = amas
142 ENDIF ! IF (ITYPE)
143!---
144 addedms(ip) = addedms(ip) + ipmas(i)%PART(ii)%RPMAS
145!---
146 ENDDO ! DO II = 1,NMAS
147!---
148 10 CONTINUE
149!---
150 RETURN
151 END
subroutine addmaspart(ipart, ipmas, partsav, part_area, pm, addedms, nom_opt, partsav_pon)
Definition addmaspart.F:35
#define my_real
Definition cppsort.cpp:32
integer, parameter nchartitle
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
subroutine fretitl2(titr, iasc, l)
Definition freform.F:804