OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
dersonebasisfun.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!|| dersonebasisfun ../starter/source/elements/ige3d/dersonebasisfun.F
25!||--- called by ------------------------------------------------------
26!|| ig3donederiv ../starter/source/elements/ige3d/ig3donederiv.F
27!||====================================================================
28 SUBROUTINE dersonebasisfun(IDXI, PXI, XI, KXI, DERS1, DERS2)
29C--------------------------------------------------------------------------------------------------------
30C
31C This subroutine calculates B-spline function and derivate of B-spline function
32C Assembling B spline functions for NURBS is outside this subroutine
33C
34C--------------------------------------------------------------------------------------------------------
35C VAR | SIZE | TYP | RW | DEFINITION
36C--------------------------------------------------------------------------------------------------------
37C IDXI | 1 | I | R | ELEMENT INDEX IN KNOT VECTOR IN XI DIRECTION
38C PXI | 1 | I | R | POLYNOMIAL INTERPOLATION DEGREE IN XI DIRECTION
39C XI | 1 | F | R | COUNTER PARAMETER VALUE (WHERE THE FUNCTION AND DERIVATE ARE CALCULATED)
40C--------------------------------------------------------------------------------------------------------
41C KXI | NKXI | F | R | (FULL) KNOT VECTOR IN XI DIRECTION FOR THE CURRENT PATCH (GROUP)
42C--------------------------------------------------------------------------------------------------------
43C DERS1 | PXI+1 | F | W | INTERPOLATION FUNCTION
44C DERS2 | PXI+1 | F | W | DERIVATE OF INTERPOLATION FUNCTION
45C--------------------------------------------------------------------------------------------------------
46C Implicite Types
47C--------------------------------------------------------------------------------------------------------
48#include "implicit_f.inc"
49C--------------------------------------------------------------------------------------------------------
50C Dummy Arguments
51C--------------------------------------------------------------------------------------------------------
52 INTEGER PXI, IDXI
53 my_real,
54 . INTENT(IN) :: xi
55 my_real,
56 . DIMENSION(*), INTENT(IN) :: kxi
57 my_real ders1, ders2
58C--------------------------------------------------------------------------------------------------------
59C Local variables
60C--------------------------------------------------------------------------------------------------------
61 INTEGER J, JJ, K, NDERS
62 my_real saved, temp, aleft, right
63 my_real, DIMENSION(2) :: ders
64 my_real, DIMENSION(PXI+1,PXI+1) :: andu
65 my_real, DIMENSION(PXI+1) :: nd
66
67 nders=1
68 andu(:,:)=zero
69
70 DO j=0,pxi
71 IF ((xi>=kxi(idxi+j)).AND.(xi<kxi(idxi+j+1))) THEN
72 andu(j+1,1) = one
73 ELSE
74 andu(j+1,1) = zero
75 ENDIF
76 ENDDO
77
78 DO k=1,pxi
79 IF (andu(1,k) == 0) THEN
80 saved = zero
81 ELSE
82 saved = ((xi-kxi(idxi))*andu(1,k))/(kxi(idxi+k)-kxi(idxi))
83 ENDIF
84 DO j=0,pxi-k
85 aleft = kxi(idxi+j+1)
86 right = kxi(idxi+j+k+1)
87 IF (andu(j+2,k) == 0) THEN
88 andu(j+1,k+1) = saved
89 saved = zero
90 ELSE
91 temp = andu(j+2,k)/(right-aleft)
92 andu(j+1,k+1) = saved+(right-xi)*temp
93 saved = (xi-aleft)*temp
94 ENDIF
95 ENDDO
96 ENDDO
97
98 ders(1) = andu(1,pxi+1)
99
100CCC ERREUR A PARTIR DE LA
101
102 DO k=1,nders
103 DO j=1,k+1
104 nd(j) = andu(j,pxi-k+1)
105 ENDDO
106 DO jj=1,k
107 IF (nd(1) == 0) THEN
108 saved = zero
109 ELSE
110 saved = nd(1)/(kxi(idxi+pxi-k+jj)-kxi(idxi))
111 ENDIF
112 DO j=1,k-jj+1
113 aleft = kxi(idxi+j)
114 right = kxi(idxi+j+pxi+jj-1)
115c RIGHT = KXI(IDXI+J+PXI+JJ+1)
116 IF (nd(j+1) == 0) THEN
117 nd(j) = (pxi-k+jj)*saved
118 saved = zero
119 ELSE
120 temp = nd(j+1)/(right-aleft)
121 nd(j) = (pxi-k+jj)*(saved-temp)
122 saved = temp
123 ENDIF
124 ENDDO
125 ENDDO
126 ders(2) = nd(1)
127 ENDDO
128
129 ders1 = ders(1)
130 ders2 = ders(2)
131
132 RETURN
133 END
#define my_real
Definition cppsort.cpp:32
subroutine dersonebasisfun(idxi, pxi, xi, kxi, ders1, ders2)