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