forcad_utils Module

This module contains parameters, functions and subroutines that are used in the library.


Used by

  • module~~forcad_utils~~UsedByGraph module~forcad_utils forcad_utils module~forcad forcad module~forcad->module~forcad_utils 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_utils module~forcad_nurbs_surface->module~forcad_utils module~forcad_nurbs_volume->module~forcad_utils proc~compute_dtgc_bspline_1d compute_dTgc_bspline_1d proc~compute_dtgc_bspline_1d->module~forcad_utils proc~compute_dtgc_bspline_2d compute_dTgc_bspline_2d proc~compute_dtgc_bspline_2d->module~forcad_utils proc~compute_dtgc_bspline_3d compute_dTgc_bspline_3d proc~compute_dtgc_bspline_3d->module~forcad_utils proc~compute_dtgc_nurbs_1d compute_dTgc_nurbs_1d proc~compute_dtgc_nurbs_1d->module~forcad_utils proc~compute_dtgc_nurbs_2d compute_dTgc_nurbs_2d proc~compute_dtgc_nurbs_2d->module~forcad_utils proc~compute_dtgc_nurbs_3d compute_dTgc_nurbs_3d proc~compute_dtgc_nurbs_3d->module~forcad_utils proc~compute_tgc_bspline_1d compute_Tgc_bspline_1d proc~compute_tgc_bspline_1d->module~forcad_utils proc~compute_tgc_bspline_2d compute_Tgc_bspline_2d proc~compute_tgc_bspline_2d->module~forcad_utils proc~compute_tgc_bspline_3d compute_Tgc_bspline_3d proc~compute_tgc_bspline_3d->module~forcad_utils proc~compute_tgc_nurbs_1d compute_Tgc_nurbs_1d proc~compute_tgc_nurbs_1d->module~forcad_utils proc~compute_tgc_nurbs_2d compute_Tgc_nurbs_2d proc~compute_tgc_nurbs_2d->module~forcad_utils proc~compute_tgc_nurbs_3d compute_Tgc_nurbs_3d proc~compute_tgc_nurbs_3d->module~forcad_utils proc~compute_xg_bspline_1d compute_Xg_bspline_1d proc~compute_xg_bspline_1d->module~forcad_utils proc~compute_xg_bspline_2d compute_Xg_bspline_2d proc~compute_xg_bspline_2d->module~forcad_utils proc~compute_xg_bspline_3d compute_Xg_bspline_3d proc~compute_xg_bspline_3d->module~forcad_utils proc~compute_xg_nurbs_1d compute_Xg_nurbs_1d proc~compute_xg_nurbs_1d->module~forcad_utils proc~compute_xg_nurbs_2d compute_Xg_nurbs_2d proc~compute_xg_nurbs_2d->module~forcad_utils proc~compute_xg_nurbs_3d compute_Xg_nurbs_3d proc~compute_xg_nurbs_3d->module~forcad_utils proc~nearest_point_help_1d nearest_point_help_1d proc~nearest_point_help_1d->module~forcad_utils proc~nearest_point_help_2d nearest_point_help_2d proc~nearest_point_help_2d->module~forcad_utils proc~nearest_point_help_3d nearest_point_help_3d proc~nearest_point_help_3d->module~forcad_utils program~example_put_to_nurbs example_put_to_nurbs program~example_put_to_nurbs->module~forcad_utils program~example_put_to_nurbs->module~forcad program~example1_curve example1_curve program~example1_curve->module~forcad program~example3_surface example3_surface program~example3_surface->module~forcad program~example3_volume example3_volume program~example3_volume->module~forcad program~example_nurbs_curve example_nurbs_curve program~example_nurbs_curve->module~forcad program~example_nurbs_surface example_nurbs_surface program~example_nurbs_surface->module~forcad program~example_nurbs_volume example_nurbs_volume program~example_nurbs_volume->module~forcad program~example_ppm1 example_ppm1 program~example_ppm1->module~forcad program~example_ppm2 example_ppm2 program~example_ppm2->module~forcad program~example_ppm3 example_ppm3 program~example_ppm3->module~forcad program~nearest_point_1d nearest_point_1d program~nearest_point_1d->module~forcad program~nearest_point_2d nearest_point_2d program~nearest_point_2d->module~forcad program~nearest_point_2d_bench nearest_point_2d_bench program~nearest_point_2d_bench->module~forcad program~nearest_point_3d nearest_point_3d program~nearest_point_3d->module~forcad program~shape_c_1d shape_C_1d program~shape_c_1d->module~forcad program~shape_c_2d shape_C_2d program~shape_c_2d->module~forcad program~shape_c_3d shape_C_3d program~shape_c_3d->module~forcad program~shape_circle shape_circle program~shape_circle->module~forcad program~shape_half_circle shape_half_circle program~shape_half_circle->module~forcad program~shape_half_ring_2d shape_half_ring_2d program~shape_half_ring_2d->module~forcad program~shape_half_ring_3d shape_half_ring_3d program~shape_half_ring_3d->module~forcad program~shape_hexahedron shape_hexahedron program~shape_hexahedron->module~forcad program~shape_ring_2d shape_ring_2d program~shape_ring_2d->module~forcad program~shape_ring_3d shape_ring_3d program~shape_ring_3d->module~forcad program~shape_tetragon shape_tetragon program~shape_tetragon->module~forcad

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: rk = kind(1.0d0)

Interfaces

public interface compute_multiplicity

  • private pure function compute_multiplicity1(knot) result(multiplicity)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in), contiguous :: knot(:)

    Return Value integer, allocatable, (:)

  • private pure function compute_multiplicity2(knot, Xth) result(multiplicity)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in), contiguous :: knot(:)
    real(kind=rk), intent(in) :: Xth

    Return Value integer

public interface elemConn_C0

  • private pure function cmp_elemConn_C0_L(nnode, p) result(elemConn)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nnode
    integer, intent(in) :: p

    Return Value integer, allocatable, (:,:)

  • private pure function cmp_elemConn_C0_S(nnode1, nnode2, p1, p2) result(elemConn)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nnode1
    integer, intent(in) :: nnode2
    integer, intent(in) :: p1
    integer, intent(in) :: p2

    Return Value integer, allocatable, (:,:)

  • private pure function cmp_elemConn_C0_V(nnode1, nnode2, nnode3, p1, p2, p3) result(elemConn)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nnode1
    integer, intent(in) :: nnode2
    integer, intent(in) :: nnode3
    integer, intent(in) :: p1
    integer, intent(in) :: p2
    integer, intent(in) :: p3

    Return Value integer, allocatable, (:,:)

public interface elemConn_Cn

  • private pure subroutine cmp_elemConn_Cn_L(nnode, p, Xth, vecKnot_mul, elemConn)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nnode
    integer, intent(in) :: p
    real(kind=rk), intent(in), contiguous :: Xth(:)
    integer, intent(in), contiguous :: vecKnot_mul(:)
    integer, intent(out), allocatable :: elemConn(:,:)
  • private pure subroutine cmp_elemConn_Cn_S(nnode1, nnode2, p1, p2, Xth1, Xth2, vecKnot_mul1, vecKnot_mul2, elemConn)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nnode1
    integer, intent(in) :: nnode2
    integer, intent(in) :: p1
    integer, intent(in) :: p2
    real(kind=rk), intent(in), contiguous :: Xth1(:)
    real(kind=rk), intent(in), contiguous :: Xth2(:)
    integer, intent(in), contiguous :: vecKnot_mul1(:)
    integer, intent(in), contiguous :: vecKnot_mul2(:)
    integer, intent(out), allocatable :: elemConn(:,:)
  • private pure subroutine cmp_elemConn_Cn_V(nnode1, nnode2, nnode3, p1, p2, p3, Xth1, Xth2, Xth3, vecKnot_mul1, vecKnot_mul2, vecKnot_mul3, elemConn)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nnode1
    integer, intent(in) :: nnode2
    integer, intent(in) :: nnode3
    integer, intent(in) :: p1
    integer, intent(in) :: p2
    integer, intent(in) :: p3
    real(kind=rk), intent(in), contiguous :: Xth1(:)
    real(kind=rk), intent(in), contiguous :: Xth2(:)
    real(kind=rk), intent(in), contiguous :: Xth3(:)
    integer, intent(in), contiguous :: vecKnot_mul1(:)
    integer, intent(in), contiguous :: vecKnot_mul2(:)
    integer, intent(in), contiguous :: vecKnot_mul3(:)
    integer, intent(out), allocatable :: elemConn(:,:)

public interface ndgrid

  • private pure subroutine ndgrid2(X_dir1, X_dir2, Xt)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in), contiguous :: X_dir1(:)
    real(kind=rk), intent(in), contiguous :: X_dir2(:)
    real(kind=rk), intent(out), allocatable :: Xt(:,:)
  • private pure subroutine ndgrid3(X_dir1, X_dir2, X_dir3, Xt)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in), contiguous :: X_dir1(:)
    real(kind=rk), intent(in), contiguous :: X_dir2(:)
    real(kind=rk), intent(in), contiguous :: X_dir3(:)
    real(kind=rk), intent(out), allocatable :: Xt(:,:)

public interface unique

  • private pure function unique_integer(vec) result(output)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in), dimension(:), contiguous :: vec

    Return Value integer, dimension(:), allocatable

  • private pure function unique_real(vec) result(output)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in), dimension(:), contiguous :: vec

    Return Value real(kind=rk), dimension(:), allocatable


Functions

public pure function basis_bernstein(Xt, nc) result(B)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: Xt
integer, intent(in) :: nc

Return Value real(kind=rk), allocatable, (:)

public pure function basis_bspline(Xt, knot, nc, degree) result(B)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: Xt
real(kind=rk), intent(in), contiguous :: knot(:)
integer, intent(in) :: nc
integer, intent(in) :: degree

Return Value real(kind=rk), allocatable, (:)

public pure function basis_bspline_der(Xt, knot, nc, degree) result(dB)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: Xt
real(kind=rk), intent(in), contiguous :: knot(:)
integer, intent(in) :: nc
integer, intent(in) :: degree

Return Value real(kind=rk), allocatable, (:)

public pure function compute_knot_vector(Xth_dir, degree, continuity) result(knot)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: Xth_dir(:)
integer, intent(in) :: degree
integer, intent(in), contiguous :: continuity(:)

Return Value real(kind=rk), allocatable, (:)

public pure function findspan(n, degree, Xth, knot) result(s)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
integer, intent(in) :: degree
real(kind=rk), intent(in) :: Xth
real(kind=rk), intent(in), contiguous :: knot(:)

Return Value integer

public pure function hexahedron_Xc(L, nc) result(Xc)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: L(3)
integer, intent(in) :: nc(3)

Return Value real(kind=rk), allocatable, (:,:)

public pure function kron(u, v) result(w)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: u(:)
real(kind=rk), intent(in), contiguous :: v(:)

Return Value real(kind=rk), (size(u)*size(v))

public pure function rotation(alpha, beta, theta) result(R)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: alpha
real(kind=rk), intent(in) :: beta
real(kind=rk), intent(in) :: theta

Return Value real(kind=rk), dimension(3,3)

public pure function tetragon_Xc(L, nc) result(Xc)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: L(2)
integer, intent(in) :: nc(2)

Return Value real(kind=rk), allocatable, (:,:)

private pure function bincoeff(n, k) result(b)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
integer, intent(in) :: k

Return Value real(kind=rk)

private pure function cmp_elemConn_C0_L(nnode, p) result(elemConn)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nnode
integer, intent(in) :: p

Return Value integer, allocatable, (:,:)

private pure function cmp_elemConn_C0_S(nnode1, nnode2, p1, p2) result(elemConn)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nnode1
integer, intent(in) :: nnode2
integer, intent(in) :: p1
integer, intent(in) :: p2

Return Value integer, allocatable, (:,:)

private pure function cmp_elemConn_C0_V(nnode1, nnode2, nnode3, p1, p2, p3) result(elemConn)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nnode1
integer, intent(in) :: nnode2
integer, intent(in) :: nnode3
integer, intent(in) :: p1
integer, intent(in) :: p2
integer, intent(in) :: p3

Return Value integer, allocatable, (:,:)

private pure function compute_multiplicity1(knot) result(multiplicity)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: knot(:)

Return Value integer, allocatable, (:)

private pure function compute_multiplicity2(knot, Xth) result(multiplicity)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: knot(:)
real(kind=rk), intent(in) :: Xth

Return Value integer

private pure function factln(n) result(f)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Return Value real(kind=rk)

private pure elemental function isinf(x) result(output)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: x

Return Value logical

private pure elemental function isnan(x) result(output)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: x

Return Value logical

private pure function repelem(a, b) result(c)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: a(:)
integer, intent(in), contiguous :: b(:)

Return Value real(kind=rk), (sum(b))

private pure function unique_integer(vec) result(output)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in), dimension(:), contiguous :: vec

Return Value integer, dimension(:), allocatable

private pure function unique_real(vec) result(output)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), dimension(:), contiguous :: vec

Return Value real(kind=rk), dimension(:), allocatable


Subroutines

public pure subroutine elevate_degree_A_5_9(t, knot, degree, Xcw, nc_new, knot_new, Xcw_new)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: t
real(kind=rk), intent(in), contiguous :: knot(:)
integer, intent(in) :: degree
real(kind=rk), intent(in), contiguous :: Xcw(:,:)
integer, intent(out) :: nc_new
real(kind=rk), intent(out), allocatable :: knot_new(:)
real(kind=rk), intent(out), allocatable :: Xcw_new(:,:)

public pure subroutine insert_knot_A_5_1(p, UP, Pw, u, k, s, r, nq, UQ, Qw)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: p
real(kind=rk), intent(in), contiguous :: UP(0:)
real(kind=rk), intent(in), contiguous :: Pw(0:,:)
real(kind=rk), intent(in) :: u
integer, intent(in) :: k
integer, intent(in) :: s
integer, intent(in) :: r
integer, intent(out) :: nq
real(kind=rk), intent(out), allocatable :: UQ(:)
real(kind=rk), intent(out), allocatable :: Qw(:,:)

public pure subroutine remove_knots_A_5_8(p, knot, Pw, u, r, s, num, t, knot_new, Pw_new)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: p
real(kind=rk), intent(in), contiguous :: knot(:)
real(kind=rk), intent(in), contiguous :: Pw(:,:)
real(kind=rk), intent(in) :: u
integer, intent(in) :: r
integer, intent(in) :: s
integer, intent(in) :: num
integer, intent(out) :: t
real(kind=rk), intent(out), allocatable :: knot_new(:)
real(kind=rk), intent(out), allocatable :: Pw_new(:,:)

private pure subroutine cmp_elemConn_Cn_L(nnode, p, Xth, vecKnot_mul, elemConn)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nnode
integer, intent(in) :: p
real(kind=rk), intent(in), contiguous :: Xth(:)
integer, intent(in), contiguous :: vecKnot_mul(:)
integer, intent(out), allocatable :: elemConn(:,:)

private pure subroutine cmp_elemConn_Cn_S(nnode1, nnode2, p1, p2, Xth1, Xth2, vecKnot_mul1, vecKnot_mul2, elemConn)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nnode1
integer, intent(in) :: nnode2
integer, intent(in) :: p1
integer, intent(in) :: p2
real(kind=rk), intent(in), contiguous :: Xth1(:)
real(kind=rk), intent(in), contiguous :: Xth2(:)
integer, intent(in), contiguous :: vecKnot_mul1(:)
integer, intent(in), contiguous :: vecKnot_mul2(:)
integer, intent(out), allocatable :: elemConn(:,:)

private pure subroutine cmp_elemConn_Cn_V(nnode1, nnode2, nnode3, p1, p2, p3, Xth1, Xth2, Xth3, vecKnot_mul1, vecKnot_mul2, vecKnot_mul3, elemConn)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nnode1
integer, intent(in) :: nnode2
integer, intent(in) :: nnode3
integer, intent(in) :: p1
integer, intent(in) :: p2
integer, intent(in) :: p3
real(kind=rk), intent(in), contiguous :: Xth1(:)
real(kind=rk), intent(in), contiguous :: Xth2(:)
real(kind=rk), intent(in), contiguous :: Xth3(:)
integer, intent(in), contiguous :: vecKnot_mul1(:)
integer, intent(in), contiguous :: vecKnot_mul2(:)
integer, intent(in), contiguous :: vecKnot_mul3(:)
integer, intent(out), allocatable :: elemConn(:,:)

private pure subroutine ndgrid2(X_dir1, X_dir2, Xt)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: X_dir1(:)
real(kind=rk), intent(in), contiguous :: X_dir2(:)
real(kind=rk), intent(out), allocatable :: Xt(:,:)

private pure subroutine ndgrid3(X_dir1, X_dir2, X_dir3, Xt)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: X_dir1(:)
real(kind=rk), intent(in), contiguous :: X_dir2(:)
real(kind=rk), intent(in), contiguous :: X_dir3(:)
real(kind=rk), intent(out), allocatable :: Xt(:,:)