OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
cr_spline_point_proj.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!|| cr_spline_point_proj ../common_source/tools/interpolation/cr_spline_point_proj.F
25!||--- called by ------------------------------------------------------
26!|| detcord ../starter/source/initial_conditions/detonation/detcord.F
27!||--- calls -----------------------------------------------------
28!|| cr_spline_interpol ../common_source/tools/interpolation/cr_spline_interpol.F
29!|| cr_spline_knots ../common_source/tools/interpolation/cr_spline_knots.F
30!||====================================================================
31 SUBROUTINE cr_spline_point_proj(LOCAL_PT,Z,ALPHA,Zh,h,T)
32C-----------------------------------------------
33C D e s c r i p t i o n
34C-----------------------------------------------
35 !COMPUTE PROJECTION ZH ON A GIVEN POINT Z ALONG THE SPLINE INTERPOLATION
36 ! INPUT - LOCAL_PT : 4 control points P0,P1,P2,P3
37 ! INPUT - Z : TEST POINt to project
38 ! INPUT - ALPHA : CCR SPLINE PARAMETER
39 ! OUTPUT - Zh : projected point
40 ! OUTPUT - H : distance from spline
41 ! OUTPUT - T : position [0,1] on SPLINE [T1,T2]
42C-----------------------------------------------
43C I m p l i c i t T y p e s
44C-----------------------------------------------
45#include "implicit_f.inc"
46C-----------------------------------------------
47C D u m m y A r g u m e n t s
48C-----------------------------------------------
49 my_real,INTENT(IN) :: local_pt(4,3),z(3),alpha
50 my_real,INTENT(INOUT) :: zh(3),h
51C-----------------------------------------------
52C L o c a l V a r i a b l e s
53C-----------------------------------------------
54 my_real :: knots(4),c(3),c_d(3),c_dd(3),t
55 my_real :: f,f_d
56 INTEGER :: ITER
57C-----------------------------------------------
58C S o u r c e L i n e s
59C-----------------------------------------------
60 t = 0.5
61 CALL cr_spline_knots(local_pt, knots, alpha)
62 DO iter=1,20
63 CALL cr_spline_interpol(local_pt,knots,t,c,c_d,c_dd)
64 f = dot_product(c(1:3)-z(1:3), c_d(1:3))
65 f_d = dot_product(c_d(1:3), c_d(1:3)) + dot_product(c(1:3)-z(1:3), c_dd(1:3))
66 IF(f_d /= 0.)THEN
67 t=t-f/f_d
68 ELSE
69 IF(f == 0.)EXIT
70 print *, "/DFS/DETCORD : error, convergence issue"
71 stop 220022
72 ENDIF
73 IF(t<0.)t=1e-10
74 IF(t>1.)t=1.-1e-10
75 ENDDO
76 CALL cr_spline_interpol(local_pt,knots,t,c,c_d,c_dd)
77 zh(1:3) = c(1:3)
78 h=sqrt(dot_product(c(1:3)-z(1:3),c(1:3)-z(1:3)))
79 END SUBROUTINE cr_spline_point_proj
#define my_real
Definition cppsort.cpp:32
subroutine cr_spline_interpol(pts, knots, t, c, c_d, c_dd)
subroutine cr_spline_knots(pts, knots, alpha)
subroutine cr_spline_point_proj(local_pt, z, alpha, zh, h, t)
#define alpha
Definition eval.h:35