OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
cr_spline_length.F File Reference
#include "implicit_f.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine cr_spline_length (local_pt, alpha, t, len)

Function/Subroutine Documentation

◆ cr_spline_length()

subroutine cr_spline_length ( dimension(4,3), intent(in) local_pt,
intent(in) alpha,
intent(in) t,
intent(inout) len )

Definition at line 31 of file cr_spline_length.F.

32C-----------------------------------------------
33C D e s c r i p t i o n
34C-----------------------------------------------
35 !compute SPLINE length with third order method (SIMPSON)
36 ! INPUT - LOCAL_PT : 4 control points P0,P1,P2,P3
37 ! INPUT - ALPHA : CCR SPLINE PARAMETER
38 ! INPUT - T : position [0,1] on SPLINE [T1,T2]. 1.0 means full spline length
39 ! OUTPUT - LEN : length of the curve parametrised with t in [0,T] T<=1.0
40C-----------------------------------------------
41C I m p l i c i t T y p e s
42C-----------------------------------------------
43#include "implicit_f.inc"
44C-----------------------------------------------
45C D u m m y A r g u m e n t s
46C-----------------------------------------------
47 my_real,INTENT(IN) :: local_pt(4,3),alpha ,t
48 my_real,INTENT(INOUT) :: len
49C-----------------------------------------------
50C L o c a l V a r i a b l e s
51C-----------------------------------------------
52 my_real :: knots(4),c(3),c_d(3),c_dd(3),t_
53 my_real :: val(6),k(2)
54 INTEGER :: ITER,NITER
55C-----------------------------------------------
56C S o u r c e L i n e s
57C-----------------------------------------------
58 CALL cr_spline_knots(local_pt, knots, alpha)
59 len = 0.
60 niter=20
61 DO iter=1,niter-1
62 !first point
63 t_=t*(1.*iter-1.)/(niter-1.)
64 CALL cr_spline_interpol(local_pt,knots,t_,c,c_d,c_dd)
65 val(1)=sqrt(dot_product(c_d(1:3),c_d(1:3)))
66 k(1)=knots(2)+t_*(knots(3)-knots(2))
67 !middle point
68 t_=(1.*iter-1.)/(1.*niter-1.) + 0.5*1./(niter-1.)
69 t_=t_*t
70 CALL cr_spline_interpol(local_pt,knots,t_,c,c_d,c_dd)
71 val(2)=sqrt(dot_product(c_d(1:3),c_d(1:3)))
72 !last point
73 t_=t*(1.*iter)/(niter-1.)
74 CALL cr_spline_interpol(local_pt,knots,t_,c,c_d,c_dd)
75 val(3)=sqrt(dot_product(c_d(1:3),c_d(1:3)))
76 k(2)=knots(2)+t_*(knots(3)-knots(2))
77 !length
78 len = len+(k(2)-k(1))/6. * (val(1)+4.*val(2)+val(3))
79 ENDDO
#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)
#define alpha
Definition eval.h:35