OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
table_values_2d.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!|| table_values_2d ../starter/source/materials/tools/table_values_2d.F
25!||--- called by ------------------------------------------------------
26!|| func_table_copy ../starter/source/materials/tools/func_table_copy.F90
27!|| law70_table ../starter/source/materials/mat/mat070/law70_table.F
28!||====================================================================
29 SUBROUTINE table_values_2d(LEN,NPTF,XI,YI,XF,YF)
30C-----------------------------------------------
31C D e s c r i p t i o n
32C-----------------------------------------------
33c use common abscissa vector to calculate new interpolated function values
34c NPTF >= LEN
35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38 implicit none
39C-----------------------------------------------
40C I n c l u d e F i l e s
41C-----------------------------------------------
42#include "my_real.inc"
43C-----------------------------------------------
44C D u m m y A r g u m e n t s
45C-----------------------------------------------
46 INTEGER ,INTENT(IN) :: LEN ! length of input X vector
47 INTEGER ,INTENT(IN) :: NPTF ! length of output X vector
48 my_real ,DIMENSION(LEN) ,INTENT(IN) :: xi ! initial X coordinates
49 my_real ,DIMENSION(LEN) ,INTENT(IN) :: yi ! initial Y values
50 my_real ,DIMENSION(NPTF) ,INTENT(IN) :: xf ! output X coordinates
51 my_real ,DIMENSION(NPTF) ,INTENT(OUT) :: yf ! output function values
52C-----------------------------------------------
53C L o c a l V a r i a b l e s
54C-----------------------------------------------
55 INTEGER :: IPT,IDX,IPTM1
56 my_real :: x1,x2,y1,y2,deri
57c=======================================================================
58 IF (nptf >= len) THEN
59 idx = 1
60 x1 = xi(idx)
61 y1 = yi(idx)
62 x2 = xi(idx+1)
63 y2 = yi(idx+1)
64 deri = (y2 - y1) / (x2 - x1)
65 DO ipt = 1,nptf
66 IF (xf(ipt) >= x2 .and. idx+1 < len) THEN
67 idx = idx + 1
68 x1 = x2
69 y1 = y2
70 x2 = xi(idx+1)
71 y2 = yi(idx+1)
72 deri = (y2 - y1) / (x2 - x1)
73 END IF
74 yf(ipt) = y1 + deri * (xf(ipt) - x1)
75 END DO
76 ELSE
77 idx = 1
78 x1 = xi(1)
79 y1 = yi(1)
80 x2 = xi(2)
81 y2 = yi(2)
82 deri = (y2 - y1) / (x2 - x1)
83 yf(1) = y1
84 iptm1 = 1
85 DO ipt = 2,len
86 IF (idx < nptf) THEN ! NPTF is the length of XF last IDX is updated bellow
87 IF (xf(idx+1) >= xi(iptm1) .and. xf(idx+1) <= xi(ipt) ) THEN ! XF(IDX+1) - the new X - must be between lower and upper bound of XI
88 ! IPTM1 is the lower bound of previous used IPT
89 idx = idx + 1
90 x1 = xi(iptm1)
91 y1 = yi(iptm1)
92 x2 = xi(ipt)
93 y2 = yi(ipt)
94 deri = (y2 - y1) / (x2 - x1)
95 yf(idx) = y1 + deri * (xf(idx) - x1)
96 iptm1 = ipt
97 ENDIF
98 END IF
99 END DO
100 END IF
101c-----------
102 RETURN
103 END SUBROUTINE table_values_2d
#define my_real
Definition cppsort.cpp:32
subroutine table_values_2d(len, nptf, xi, yi, xf, yf)