OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
func_slope.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!|| func_slope ../starter/source/tools/curve/func_slope.F
25!||--- called by ------------------------------------------------------
26!|| law111_upd ../starter/source/materials/mat/mat111/law111_upd.F
27!|| law158_upd ../starter/source/materials/mat/mat158/law158_upd.F
28!|| law58_upd ../starter/source/materials/mat/mat058/law58_upd.F
29!|| law77_upd ../starter/source/materials/mat/mat077/law77_upd.F
30!|| law88_upd ../starter/source/materials/mat/mat088/law88_upd.F
31!|| law90_upd ../starter/source/materials/mat/mat090/law90_upd.F
32!||--- uses -----------------------------------------------------
33!|| message_mod ../starter/share/message_module/message_mod.F
34!|| table_mod ../starter/share/modules1/table_mod.F
35!||====================================================================
36 SUBROUTINE func_slope(IDN,FAC,NPC,PLD,STIFFMIN,STIFFMAX,STIFFINI,STIFFAVG)
37C-----------------------------------------------
38C M o d u l e s
39C-----------------------------------------------
40 USE message_mod
41 USE table_mod
42C-----------------------------------------------
43C I m p l i c i t T y p e s
44C-----------------------------------------------
45#include "implicit_f.inc"
46C-----------------------------------------------
47C D u m m y A r g u m e n t s
48C-----------------------------------------------
49 INTEGER IDN,NPC(*)
50 my_real pld(*),fac,stiffmin,stiffmax,stiffini,stiffavg
51C-----------------------------------------------
52 INTENT(IN) :: npc,pld,idn
53 INTENT(OUT) :: stiffmax,stiffini,stiffavg
54C-----------------------------------------------
55C L o c a l V a r i a b l e s
56C-----------------------------------------------
57 INTEGER I,J,K,ID,NP1,NP2,K1,PN1,PN2,COUNT
58 my_real dydx,dx,dy
59C=======================================================================
60 ! COMPUTE MAXIMUM SLOPE AND INITIAL SLOPE OF FUNCTION
61C=======================================================================
62 pn1 = npc(idn)
63 pn2 = npc(idn+1)
64 stiffini = zero
65 stiffavg = zero
66 stiffmax = zero
67 stiffmin = ep20
68 count = 0
69 DO j = pn1,pn2-4,2
70 count = count + 1
71 dx = pld(j+2) - pld(j)
72 dy = pld(j+3) - pld(j+1)
73 dydx = fac*dy/dx
74 stiffmax = max(stiffmax,dydx)
75 stiffmin = min(stiffmin,dydx)
76 stiffavg = stiffavg + dydx
77 IF(pld(j+2)== zero )THEN
78 dx = pld(j+2) - pld(j)
79 dy = pld(j+3) - pld(j+1)
80 stiffini = max(stiffini, fac*dy/dx)
81 ELSEIF(pld(j) == zero) THEN
82 dx = pld(j+2) - pld(j)
83 dy = pld(j+3) - pld(j+1)
84 stiffini = max(stiffini, fac*dy/dx)
85 ELSEIF(pld(pn1) >= zero) THEN
86 dx = pld(pn1+2) - pld(pn1 )
87 dy = pld(pn1+3) - pld(pn1 + 1)
88 stiffini = max(stiffini, fac*dy/dx)
89 ENDIF
90 ENDDO
91 stiffavg = stiffavg / count
92c-----------
93 RETURN
94 END
95C=======================================================================
96!||====================================================================
97!|| unify_x ../starter/source/tools/curve/func_slope.f
98!||--- uses -----------------------------------------------------
99!|| message_mod ../starter/share/message_module/message_mod.F
100!|| table_mod ../starter/share/modules1/table_mod.F
101!||====================================================================
102 SUBROUTINE unify_x(IDN1,IDN2,NPC,PLD,NPOINT,LEN1,LEN2,XUNI,NPTNEW)
103C-----------------------------------------------
104C M o d u l e s
105C-----------------------------------------------
106 USE message_mod
107 USE table_mod
108C-----------------------------------------------
109C I m p l i c i t T y p e s
110C-----------------------------------------------
111#include "implicit_f.inc"
112C-----------------------------------------------
113C D u m m y A r g u m e n t s
114C-----------------------------------------------
115 INTEGER IDN1,IDN2,IDN,NPOINT,LEN1,LEN2,
116 . NPTNEW,NPC(*)
117 my_real
118 . pld(*),xuni(npoint)
119C-----------------------------------------------
120 INTENT(IN) :: npc,pld
121C-----------------------------------------------
122C L o c a l V a r i a b l e s
123C-----------------------------------------------
124 INTEGER I,J,K,ID,NP1,NP2,K1,PN1,PN2
125 my_real
126 . ec , et
127c=======================================================================
128 !IDN1 = IFUNC(1) ! uni C
129 !IDN2 = IFUNC(2) ! uni T
130 i = 0
131 j = 0
132 ec = pld(npc(idn1) )
133 et = pld(npc(idn2) )
134 DO k = 1,npoint
135 IF(i == 2*len1 .AND. j == 2*len2 )THEN
136 EXIT
137 ELSE
138 IF ((ec < et.AND.i<2*len1) .OR. j >= 2*len2)THEN
139 xuni(k) = ec
140 i = i + 2
141 ec = pld(npc(idn1)+ i )
142 ELSEIF ((ec > et.AND.j<2*len2) .OR. i >= 2*len1)THEN
143 xuni(k) = et
144 j = j + 2
145 et = pld(npc(idn2)+ j )
146 ELSEIF (ec == et)THEN
147 xuni(k) = et
148 i = i + 2
149 j = j + 2
150 ec = pld(npc(idn1)+ i )
151 et = pld(npc(idn2)+ j )
152 ENDIF
153 ENDIF
154 ENDDO
155 nptnew = k
156c-----------
157 RETURN
158 END
159
#define my_real
Definition cppsort.cpp:32
subroutine unify_x(idn1, idn2, npc, pld, npoint, len1, len2, xuni, nptnew)
Definition func_slope.F:103
subroutine func_slope(idn, fac, npc, pld, stiffmin, stiffmax, stiffini, stiffavg)
Definition func_slope.F:37
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21
program starter
Definition starter.F:39