example_toroidal_pipe Program

Uses

  • program~~example_toroidal_pipe~~UsesGraph program~example_toroidal_pipe example_toroidal_pipe module~forcad forcad program~example_toroidal_pipe->module~forcad module~forcad_kinds forcad_kinds module~forcad->module~forcad_kinds module~forcad_nurbs_curve forcad_nurbs_curve module~forcad->module~forcad_nurbs_curve module~forcad_nurbs_surface forcad_nurbs_surface module~forcad->module~forcad_nurbs_surface module~forcad_nurbs_volume forcad_nurbs_volume module~forcad->module~forcad_nurbs_volume module~forcad_nurbs_curve->module~forcad_kinds fordebug fordebug module~forcad_nurbs_curve->fordebug module~forcad_utils forcad_utils module~forcad_nurbs_curve->module~forcad_utils module~forcad_nurbs_surface->module~forcad_kinds module~forcad_nurbs_surface->fordebug module~forcad_nurbs_surface->module~forcad_utils module~forcad_nurbs_volume->module~forcad_kinds module~forcad_nurbs_volume->fordebug module~forcad_nurbs_volume->module~forcad_utils module~forcad_utils->module~forcad_kinds

Example program demonstrating how to sweep a straight, pipe-like NURBS volume onto a toroidal pipe (donut) with an optional progressive cross-section twist and a sinusoidal wobble in the global z-direction as it travels around the torus.

The program: Creates a straight pipe segment (ring extruded along ), Refines it along the axial direction (knot insertion + degree elevation), Maps the control points onto a torus of major radius R, Applies a cross-section twist of twist_turns full rotations over one loop, Superimposes a vertical wobble , Exports the resulting NURBS volume to VTK and displays it, Prints the approximate enclosed volume (Gaussian integration).


Calls

program~~example_toroidal_pipe~~CallsGraph program~example_toroidal_pipe example_toroidal_pipe proc~create~2 nurbs_volume%create program~example_toroidal_pipe->proc~create~2 proc~elevate_degree~2 nurbs_volume%elevate_degree program~example_toroidal_pipe->proc~elevate_degree~2 proc~export_xc~2 nurbs_volume%export_Xc program~example_toroidal_pipe->proc~export_xc~2 proc~export_xg~2 nurbs_volume%export_Xg program~example_toroidal_pipe->proc~export_xg~2 proc~export_xth_in_xg~2 nurbs_volume%export_Xth_in_Xg program~example_toroidal_pipe->proc~export_xth_in_xg~2 proc~insert_knots~2 nurbs_volume%insert_knots program~example_toroidal_pipe->proc~insert_knots~2 proc~map_to_torus_sinez map_to_torus_sineZ program~example_toroidal_pipe->proc~map_to_torus_sinez proc~set_ring~2 nurbs_volume%set_ring program~example_toroidal_pipe->proc~set_ring~2 proc~show~2 nurbs_volume%show program~example_toroidal_pipe->proc~show~2 interface~compute_xg~2 compute_Xg proc~create~2->interface~compute_xg~2 interface~ndgrid ndgrid proc~create~2->interface~ndgrid proc~is_rational~2 nurbs_volume%is_rational proc~create~2->proc~is_rational~2 set set proc~create~2->set none~get_knot~2 nurbs_volume%get_knot proc~elevate_degree~2->none~get_knot~2 none~set~2 nurbs_volume%set proc~elevate_degree~2->none~set~2 proc~elevate_degree_a_5_9 elevate_degree_A_5_9 proc~elevate_degree~2->proc~elevate_degree_a_5_9 proc~elevate_degree~2->proc~is_rational~2 proc~cmp_elem_xc_vis~2 nurbs_volume%cmp_elem_Xc_vis proc~export_xc~2->proc~cmp_elem_xc_vis~2 proc~export_vtk_legacy export_vtk_legacy proc~export_xc~2->proc~export_vtk_legacy proc~export_xc~2->set proc~cmp_elem_xg_vis~2 nurbs_volume%cmp_elem_Xg_vis proc~export_xg~2->proc~cmp_elem_xg_vis~2 proc~export_xg~2->proc~export_vtk_legacy proc~export_xg~2->set proc~export_xth_in_xg~2->interface~compute_xg~2 interface~unique unique proc~export_xth_in_xg~2->interface~unique proc~export_xth_in_xg~2->proc~export_vtk_legacy proc~export_xth_in_xg~2->proc~is_rational~2 proc~export_xth_in_xg~2->set interface~compute_multiplicity compute_multiplicity proc~insert_knots~2->interface~compute_multiplicity proc~insert_knots~2->none~get_knot~2 proc~findspan findspan proc~insert_knots~2->proc~findspan proc~insert_knot_a_5_1 insert_knot_A_5_1 proc~insert_knots~2->proc~insert_knot_a_5_1 proc~insert_knots~2->proc~is_rational~2 s_loc s_loc proc~insert_knots~2->s_loc proc~insert_knots~2->set proc~map_to_torus_sinez->none~get_knot~2 none~get_nc~2 nurbs_volume%get_nc proc~map_to_torus_sinez->none~get_nc~2 none~get_wc~2 nurbs_volume%get_Wc proc~map_to_torus_sinez->none~get_wc~2 none~get_xc~2 nurbs_volume%get_Xc proc~map_to_torus_sinez->none~get_xc~2 proc~map_to_torus_sinez->none~set~2 proc~map_to_torus_sinez->proc~is_rational~2 proc~set_ring~2->none~set~2 proc~compute_multiplicity1 compute_multiplicity1 interface~compute_multiplicity->proc~compute_multiplicity1 proc~compute_multiplicity2 compute_multiplicity2 interface~compute_multiplicity->proc~compute_multiplicity2 proc~compute_xg_bspline_3d compute_Xg_bspline_3d interface~compute_xg~2->proc~compute_xg_bspline_3d proc~compute_xg_bspline_3d_1point compute_Xg_bspline_3d_1point interface~compute_xg~2->proc~compute_xg_bspline_3d_1point proc~compute_xg_nurbs_3d compute_Xg_nurbs_3d interface~compute_xg~2->proc~compute_xg_nurbs_3d proc~compute_xg_nurbs_3d_1point compute_Xg_nurbs_3d_1point interface~compute_xg~2->proc~compute_xg_nurbs_3d_1point proc~ndgrid2 ndgrid2 interface~ndgrid->proc~ndgrid2 proc~ndgrid3 ndgrid3 interface~ndgrid->proc~ndgrid3 proc~unique_integer unique_integer interface~unique->proc~unique_integer proc~unique_real unique_real interface~unique->proc~unique_real proc~get_knot_all~2 nurbs_volume%get_knot_all none~get_knot~2->proc~get_knot_all~2 proc~get_knoti~2 nurbs_volume%get_knoti none~get_knot~2->proc~get_knoti~2 proc~get_nc_all~2 nurbs_volume%get_nc_all none~get_nc~2->proc~get_nc_all~2 proc~get_nc_dir~2 nurbs_volume%get_nc_dir none~get_nc~2->proc~get_nc_dir~2 proc~get_wc_all~2 nurbs_volume%get_Wc_all none~get_wc~2->proc~get_wc_all~2 proc~get_wci~2 nurbs_volume%get_Wci none~get_wc~2->proc~get_wci~2 proc~get_xc_all~2 nurbs_volume%get_Xc_all none~get_xc~2->proc~get_xc_all~2 proc~get_xcid~2 nurbs_volume%get_Xcid none~get_xc~2->proc~get_xcid~2 proc~get_xci~2 nurbs_volume%get_Xci none~get_xc~2->proc~get_xci~2 proc~set1~2 nurbs_volume%set1 none~set~2->proc~set1~2 proc~set2~2 nurbs_volume%set2 none~set~2->proc~set2~2 proc~set3~2 nurbs_volume%set3 none~set~2->proc~set3~2 proc~set4~2 nurbs_volume%set4 none~set~2->proc~set4~2 interface~elemconn_c0 elemConn_C0 proc~cmp_elem_xc_vis~2->interface~elemconn_c0 proc~cmp_elem_xg_vis~2->interface~elemconn_c0 proc~elevate_degree_a_5_9->interface~compute_multiplicity proc~bincoeff bincoeff proc~elevate_degree_a_5_9->proc~bincoeff proc~cmp_elemconn_c0_l cmp_elemConn_C0_L interface~elemconn_c0->proc~cmp_elemconn_c0_l proc~cmp_elemconn_c0_s cmp_elemConn_C0_S interface~elemconn_c0->proc~cmp_elemconn_c0_s proc~cmp_elemconn_c0_v cmp_elemConn_C0_V interface~elemconn_c0->proc~cmp_elemconn_c0_v proc~factln factln proc~bincoeff->proc~factln interface~kron kron proc~compute_xg_bspline_3d->interface~kron proc~basis_bspline basis_bspline proc~compute_xg_bspline_3d->proc~basis_bspline proc~compute_xg_bspline_3d_1point->interface~kron proc~compute_xg_bspline_3d_1point->proc~basis_bspline proc~cmp_tgc_3d cmp_Tgc_3d proc~compute_xg_nurbs_3d->proc~cmp_tgc_3d proc~compute_xg_nurbs_3d_1point->interface~kron proc~compute_xg_nurbs_3d_1point->proc~basis_bspline proc~get_nc_dir~2->interface~compute_multiplicity proc~set1~2->set proc~cmp_degree~2 nurbs_volume%cmp_degree proc~set1~2->proc~cmp_degree~2 proc~cmp_nc~2 nurbs_volume%cmp_nc proc~set1~2->proc~cmp_nc~2 proc~set2~2->set proc~set2~2->proc~cmp_nc~2 proc~compute_knot_vector compute_knot_vector proc~set2~2->proc~compute_knot_vector proc~set3~2->set proc~set3~2->proc~cmp_degree~2 proc~set4~2->set proc~kron3 kron3 interface~kron->proc~kron3 proc~kron_t1_t1 kron_t1_t1 interface~kron->proc~kron_t1_t1 proc~kron_t1_t2 kron_t1_t2 interface~kron->proc~kron_t1_t2 proc~cmp_degree~2->set proc~get_multiplicity~2 nurbs_volume%get_multiplicity proc~cmp_degree~2->proc~get_multiplicity~2 proc~cmp_nc~2->interface~compute_multiplicity proc~cmp_nc~2->set proc~cmp_tgc_3d->interface~kron proc~cmp_tgc_3d->proc~basis_bspline proc~repelem repelem proc~compute_knot_vector->proc~repelem proc~get_multiplicity~2->interface~compute_multiplicity

Variables

Type Attributes Name Initial
real(kind=rk), parameter :: Az = 0.1_rk

amplitude of vertical wobble

integer, parameter :: Nref = 30
real(kind=rk), parameter :: R = 1.00_rk

major radius

real(kind=rk), parameter :: center(3) = [0.0_rk, 0.0_rk, 0.0_rk]

center of the ring

integer :: i
real(kind=rk), parameter :: length = 1.0_rk

length of the pipe

integer, parameter :: nwaves_z = 6

number of sine waves per full loop

real(kind=rk), parameter :: phase_z = 0.1_rk

phase shift (radians)

real(kind=rk), parameter :: r1 = 0.12_rk

inner radius

real(kind=rk), parameter :: r2 = 0.20_rk

outer radius

type(nurbs_volume) :: ring

straight pipe segment

type(nurbs_volume) :: shape

toroidal pipe shape

real(kind=rk), parameter :: twist_turns = 1.0_rk

cross-section twist (turns over full loop)

real(kind=rk) :: volume

Subroutines

pure subroutine map_to_torus_sineZ(this, c, R, twist_turns, Az, nwaves_z, phase_z)

Map a straight pipe (ring extruded in ) onto a toroidal pipe with: • cross-section twist: , • vertical wobble: .

Read more…

Arguments

Type IntentOptional Attributes Name
type(nurbs_volume), intent(inout) :: this
real(kind=rk), intent(in) :: c(3)
real(kind=rk), intent(in) :: R
real(kind=rk), intent(in) :: twist_turns
real(kind=rk), intent(in) :: Az
integer, intent(in) :: nwaves_z
real(kind=rk), intent(in) :: phase_z