OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
unify_abscissas_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!|| unify_abscissa_2d ../starter/source/materials/tools/unify_abscissas_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!||--- calls -----------------------------------------------------
29!||====================================================================
30 SUBROUTINE unify_abscissa_2d(NFUNC,LEN,LMAX,NPT,XI,XF)
31C-----------------------------------------------
32C D e s c r i p t i o n
33C-----------------------------------------------
34 ! create abscissa vector common to all input functions, in ascending order
35 ! and calculate new interpolated values of all functions
36c-------------------------------------------------------------
37 ! XI : INPUT - initial X coordinates of all functions
38 ! XF : OUTPUT - common abscissa coordinates
39 ! NPT : Input => Sum of all function point numbers
40 ! Output => Final length of common abscissa vector
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 ,INTENT(IN) :: NFUNC ! number of input functions
49 INTEGER ,INTENT(IN) :: LMAX ! max X length in input
50 INTEGER ,INTENT(INOUT) :: NPT ! length of X vector
51 INTEGER ,DIMENSION(NFUNC) ,INTENT(IN) :: LEN ! NPTS by function
52 my_real ,DIMENSION(LMAX,NFUNC) ,INTENT(IN) :: xi ! initial abscissa coordinates
53 my_real ,DIMENSION(NPT) ,INTENT(OUT) :: xf ! output abscissa vector
54C-----------------------------------------------
55C L o c a l V a r i a b l e s
56C-----------------------------------------------
57 INTEGER :: I,LTOT,LL,IDX,IERROR
58 my_real :: x1,x2,xc,y1,y2,dx,dx1,deri
59 my_real ,DIMENSION(:) ,ALLOCATABLE :: xtmp
60 INTEGER, DIMENSION(:), ALLOCATABLE :: PERM
61c=======================================================================
62 ltot = npt
63 ALLOCATE (perm(ltot))
64 ALLOCATE (xtmp(ltot))
65 xf(:) = zero
66 xtmp(:) = zero
67 idx = 0
68 DO i = 1,nfunc
69 ll = len(i)
70 xtmp(idx+1:idx+ll) = xi(1:ll,i)
71 idx = idx + ll
72 END DO
73c
74 CALL myqsort(ltot,xtmp,perm,ierror)
75c
76c create common abscissa vector XF
77c
78 npt = 1
79 xf(1) = xtmp(1)
80 DO i = 2,ltot
81 IF (xtmp(i) > xf(npt)) THEN
82 npt = npt + 1
83 xf(npt) = xtmp(i)
84 END IF
85 END DO
86c
87 DEALLOCATE (xtmp)
88 DEALLOCATE (perm)
89c-----------
90 RETURN
91 END SUBROUTINE unify_abscissa_2d
#define my_real
Definition cppsort.cpp:32
subroutine myqsort(n, a, perm, error)
Definition myqsort.F:51
subroutine unify_abscissa_2d(nfunc, len, lmax, npt, xi, xf)