forcad_utils Module

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


Uses

    • stdlib_quadrature
  • module~~forcad_utils~~UsesGraph module~forcad_utils forcad_utils stdlib_quadrature stdlib_quadrature module~forcad_utils->stdlib_quadrature

Used by


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 dyad

  • private pure function dyad_t1_t1(a, b) result(c)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

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

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

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 gauss_leg

  • private pure subroutine gauss_legendre_1D(interval, degree, Xksi, Wksi)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: interval(2)
    integer, intent(in) :: degree
    real(kind=rk), intent(out), allocatable :: Xksi(:)
    real(kind=rk), intent(out), allocatable :: Wksi(:)
  • private pure subroutine gauss_legendre_2D(interval1, interval2, degree, Xksi, Wksi)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: interval1(2)
    real(kind=rk), intent(in) :: interval2(2)
    integer, intent(in) :: degree(2)
    real(kind=rk), intent(out), allocatable :: Xksi(:,:)
    real(kind=rk), intent(out), allocatable :: Wksi(:)
  • private pure subroutine gauss_legendre_3D(interval1, interval2, interval3, degree, Xksi, Wksi)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: interval1(2)
    real(kind=rk), intent(in) :: interval2(2)
    real(kind=rk), intent(in) :: interval3(2)
    integer, intent(in) :: degree(3)
    real(kind=rk), intent(out), allocatable :: Xksi(:,:)
    real(kind=rk), intent(out), allocatable :: Wksi(:)

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 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 det(A) result(detA)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

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

Return Value real(kind=rk)

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 recursive function inv(A) result(A_inv)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

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

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 dyad_t1_t1(a, b) result(c)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

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

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

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 basis_bspline_2der(Xt, knot, nc, degree, d2B, dB, 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
real(kind=rk), intent(out), allocatable :: d2B(:)
real(kind=rk), intent(out), optional, allocatable :: dB(:)
real(kind=rk), intent(out), optional, allocatable :: B(:)

public pure subroutine basis_bspline_der(Xt, knot, nc, degree, dB, 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
real(kind=rk), intent(out), allocatable :: dB(:)
real(kind=rk), intent(out), optional, allocatable :: B(:)

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 gauss_legendre_1D(interval, degree, Xksi, Wksi)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: interval(2)
integer, intent(in) :: degree
real(kind=rk), intent(out), allocatable :: Xksi(:)
real(kind=rk), intent(out), allocatable :: Wksi(:)

private pure subroutine gauss_legendre_2D(interval1, interval2, degree, Xksi, Wksi)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: interval1(2)
real(kind=rk), intent(in) :: interval2(2)
integer, intent(in) :: degree(2)
real(kind=rk), intent(out), allocatable :: Xksi(:,:)
real(kind=rk), intent(out), allocatable :: Wksi(:)

private pure subroutine gauss_legendre_3D(interval1, interval2, interval3, degree, Xksi, Wksi)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: interval1(2)
real(kind=rk), intent(in) :: interval2(2)
real(kind=rk), intent(in) :: interval3(2)
integer, intent(in) :: degree(3)
real(kind=rk), intent(out), allocatable :: Xksi(:,:)
real(kind=rk), intent(out), allocatable :: Wksi(:)

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(:,:)