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/.
23c SUBROUTINE DERSONEBASISFUN(IDXII, IDXI, PXI, XI, KXI, DERS1, DERS2)
24!||====================================================================
25!|| dersonebasisfun ../engine/source/elements/ige3d/dersonebasisfun.f
26!||--- called by ------------------------------------------------------
27!|| ig3donederiv ../engine/source/elements/ige3d/ig3donederiv.F
28!||====================================================================
29 SUBROUTINE dersonebasisfun(IDXI, PXI, XI, KXI, DERS1, DERS2)
30C--------------------------------------------------------------------------------------------------------
31C
32C This subroutine calculates B-spline function and derivate of B-spline function
33C Assembling B spline functions for NURBS is outside this subroutine
34C
35C--------------------------------------------------------------------------------------------------------
36C VAR | SIZE | TYP | RW | DEFINITION
37C--------------------------------------------------------------------------------------------------------
38C IDXI | 1 | I | R | ELEMENT INDEX IN KNOT VECTOR IN XI DIRECTION
39C PXI | 1 | I | R | POLYNOMIAL INTERPOLATION DEGREE IN XI DIRECTION
40C XI | 1 | F | R | COUNTER PARAMETER VALUE (WHERE THE FUNCTION AND DERIVATE ARE CALCULATED)
41C--------------------------------------------------------------------------------------------------------
42C KXI | NKXI | F | R | (FULL) KNOT VECTOR IN XI DIRECTION FOR THE CURRENT PATCH (GROUP)
43C--------------------------------------------------------------------------------------------------------
44C DERS1 | PXI+1 | F | W | INTERPOLATION FUNCTION
45C DERS2 | PXI+1 | F | W | DERIVATE OF INTERPOLATION FUNCTION
46C--------------------------------------------------------------------------------------------------------
47C Implicite Types
48C--------------------------------------------------------------------------------------------------------
49#include "implicit_f.inc"
50C--------------------------------------------------------------------------------------------------------
51C Dummy Arguments
52C--------------------------------------------------------------------------------------------------------
53 INTEGER PXI, IDXI!, IDXII
54 my_real,
55 . INTENT(IN) :: xi
56 my_real,
57 . DIMENSION(*), INTENT(IN) :: kxi
58 my_real ders1, ders2
59C--------------------------------------------------------------------------------------------------------
60C Local variables
61C--------------------------------------------------------------------------------------------------------
62 INTEGER J, JJ, K, NDERS
63 my_real saved, temp, aleft, right
64 my_real, DIMENSION(2) :: ders
65 my_real, DIMENSION(PXI+1,PXI+1) :: andu
66 my_real, DIMENSION(PXI+1) :: nd
67
68 nders=1
69 andu(:,:)=zero
70! ANDU(IDXII,1)=ONE
71
72 DO j=0,pxi
73 IF ((xi>=kxi(idxi+j)).AND.(xi<kxi(idxi+j+1))) THEN
74 andu(j+1,1) = one
75 ELSE
76 andu(j+1,1) = zero
77 ENDIF
78 ENDDO
79
80 DO k=1,pxi
81 IF (andu(1,k) == 0) THEN
82 saved = zero
83 ELSE
84 saved = ((xi-kxi(idxi))*andu(1,k))/(kxi(idxi+k)-kxi(idxi))
85 ENDIF
86 DO j=0,pxi-k
87 aleft = kxi(idxi+j+1)
88 right = kxi(idxi+j+k+1)
89 IF (andu(j+2,k) == 0) THEN
90 andu(j+1,k+1) = saved
91 saved = zero
92 ELSE
93 temp = andu(j+2,k)/(right-aleft)
94 andu(j+1,k+1) = saved+(right-xi)*temp
95 saved = (xi-aleft)*temp
96 ENDIF
97 ENDDO
98 ENDDO
99
100 ders(1) = andu(1,pxi+1)
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)