OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
fixtemp.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!|| fixtemp ../engine/source/constraints/thermic/fixtemp.f
25!||--- called by ------------------------------------------------------
26!|| resol ../engine/source/engine/resol.F
27!||--- calls -----------------------------------------------------
28!|| vinter ../engine/source/tools/curve/vinter.F
29!|| vinter_mixed ../engine/source/tools/curve/vinter_mixed.F90
30!|| vinter_smooth ../engine/source/tools/curve/vinter_smooth.F
31!||--- uses -----------------------------------------------------
32!|| glob_therm_mod ../common_source/modules/mat_elem/glob_therm_mod.F90
33!|| python_funct_mod ../common_source/modules/python_mod.F90
34!|| redef3_mod ../engine/source/elements/spring/redef3.F90
35!|| sensor_mod ../common_source/modules/sensor_mod.F90
36!|| vinter_mixed_mod ../engine/source/tools/curve/vinter_mixed.F90
37!||====================================================================
38 SUBROUTINE fixtemp(PYTHON,IBFT ,VAL , TEMP ,NPC ,TF ,
39 . NSENSOR,SENSOR_TAB,GLOB_THERM,snpc)
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE redef3_mod, only: get_python_funct_id
44 USE sensor_mod
45 use glob_therm_mod
46 USE python_funct_mod
47 USE vinter_mixed_mod
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51#include "implicit_f.inc"
52C-----------------------------------------------
53C G l o b a l P a r a m e t e r s
54C-----------------------------------------------
55#include "mvsiz_p.inc"
56C-----------------------------------------------
57C C o m m o n B l o c k s
58C-----------------------------------------------
59#include "com01_c.inc"
60#include "com04_c.inc"
61#include "com08_c.inc"
62#include "param_c.inc"
63#include "parit_c.inc"
64C-----------------------------------------------
65C D u m m y A r g u m e n t s
66C-----------------------------------------------
67 type(python_) :: PYTHON
68 type (glob_therm_) ,intent(inout) :: glob_therm
69 INTEGER ,INTENT(IN) :: NSENSOR
70 INTEGER NPC(*)
71 INTEGER IBFT(GLOB_THERM%NIFT,*)
72 my_real :: temp(*),tf(*)
73 my_real :: val(glob_therm%LFACTHER,*)
74 integer, intent(in) :: SNPC
75 TYPE (SENSOR_STR_) ,DIMENSION(NSENSOR) ,INTENT(IN) :: SENSOR_TAB
76C-----------------------------------------------
77C L o c a l V a r i a b l e s
78C-----------------------------------------------
79 INTEGER I,N,L,II, NN,ISENS,IC, IDEB, ISMOOTH
80 INTEGER ILENC(MVSIZ), IPOSC(MVSIZ), IADC(MVSIZ)
81 INTEGER INDEX(MVSIZ)
82 my_real fac, facx, startt, stopt, ts
83 my_real yc(mvsiz), tsc(mvsiz), dydxc(mvsiz)
84 integer :: pyid
85 logical :: any_python_func
86C-----------------------------------------------
87 ideb = 0
88 ismooth = 0
89C
90 DO nn=1,glob_therm%NFXTEMP,nvsiz
91 ic = 0
92 IF (nsensor > 0) THEN
93 DO ii = 1, min(glob_therm%NFXTEMP - ideb,nvsiz)
94 n = ii+ideb
95 startt = val(1,n)
96 stopt = val(2,n)
97C
98 isens = ibft(3,n)
99 IF (isens == 0)THEN
100 ts = tt*glob_therm%THEACCFACT - startt
101 ELSE
102 startt = startt + sensor_tab(isens)%TSTART
103 stopt = stopt + sensor_tab(isens)%TSTART
104 ts = tt*glob_therm%THEACCFACT -(startt + sensor_tab(isens)%TSTART)
105 ENDIF
106C
107 IF(tt*glob_therm%THEACCFACT < startt) cycle
108 IF(tt*glob_therm%THEACCFACT > stopt) cycle
109 facx = val(3,n)
110 i=iabs(ibft(1,n))
111 ic = ic + 1
112 index(ic)= n
113C TSC(IC) = (TS+DT2)*FACX
114 tsc(ic) = ts*facx
115 ENDDO
116 ELSE
117C sans aucun sensor
118 DO ii = 1, min(glob_therm%NFXTEMP-ideb,nvsiz)
119 n = ii+ideb
120 startt = val(1,n)
121 stopt = val(2,n)
122 IF (tt*glob_therm%THEACCFACT < startt) cycle
123 IF (tt*glob_therm%THEACCFACT > stopt) cycle
124 facx = val(3,n)
125 i=iabs(ibft(1,n))
126 ic = ic + 1
127 index(ic) = n
128 ts = tt*glob_therm%THEACCFACT - startt
129 tsc(ic) = ts*facx
130 ENDDO
131 ENDIF
132C
133 ideb = ideb + min(glob_therm%NFXTEMP-ideb,nvsiz)
134C
135 any_python_func = .false.
136 IF(ncycle == 0)THEN
137 DO ii=1,ic
138 n = index(ii)
139 l = ibft(2,n)
140 IF (l > 0) ismooth = npc(2*nfunct+l+1)
141 iposc(ii) = 0
142 pyid = get_python_funct_id(nfunct,l,npc,snpc)
143 if(pyid > 0) then
144 iadc(ii) =-pyid
145 ilenc(ii) =-pyid
146 any_python_func = .true.
147 else
148 iadc(ii) = npc(l) / 2 + 1
149 ilenc(ii) = npc(l+1) / 2 - iadc(ii) - iposc(ii)
150 endif
151 ENDDO
152 ELSE
153 DO ii=1,ic
154 n = index(ii)
155 l = ibft(2,n)
156 IF (l > 0) ismooth = npc(2*nfunct+l+1)
157 iposc(ii) = ibft(4,n)
158 pyid = get_python_funct_id(nfunct,l,npc,snpc)
159 if(pyid > 0) then
160 iadc(ii) =-pyid
161 ilenc(ii) =-pyid
162 any_python_func = .true.
163 else
164 iadc(ii) = npc(l) / 2 + 1
165 ilenc(ii) = npc(l+1) / 2 - iadc(ii) - iposc(ii)
166 endif
167 ENDDO
168 ENDIF
169
170 if(any_python_func) then
171 call vinter_mixed(python,tf,iadc,iposc,ilenc,ic,tsc,dydxc,yc)
172 else
173 IF (ismooth == 0) THEN
174 CALL vinter(tf,iadc,iposc,ilenc,ic,tsc,dydxc,yc)
175 ELSE
176 CALL vinter_smooth(tf,iadc,iposc,ilenc,ic,tsc,dydxc,yc)
177 ENDIF ! IF (ISMOOTH == 0)
178 ENDIF ! if(any_python_func)
179C
180 IF(ivector == 0) THEN
181 DO ii=1,ic
182 n = index(ii)
183 ibft(4,n) = iposc(ii)
184 fac = val(4,n)
185 yc(ii) = yc(ii) * fac
186 i=iabs(ibft(1,n))
187 temp(i) = yc(ii)
188 ENDDO
189 ELSE
190C partie vectorielle
191#include "vectorize.inc"
192 DO ii=1,ic
193 n = index(ii)
194 ibft(4,n) = iposc(ii)
195 fac = val(4,n)
196 yc(ii) = yc(ii) * fac
197 i=iabs(ibft(1,n))
198 temp(i) = yc(ii)
199 ENDDO
200 ENDIF
201C
202 ENDDO !NN=1,NFXTEMP
203C
204 RETURN
205 END
#define my_real
Definition cppsort.cpp:32
subroutine fixtemp(python, ibft, val, temp, npc, tf, nsensor, sensor_tab, glob_therm, snpc)
Definition fixtemp.F:40
#define min(a, b)
Definition macros.h:20
subroutine vinter(tf, iad, ipos, ilen, nel, x, dydx, y)
Definition vinter.F:72
subroutine vinter_smooth(tf, iad, ipos, ilen, nel0, x, dydx, y)