MODgvec_sBase Module

Module ** sBase **

1D basis in radial coordinate "s". Contains sbase type definition and associated routines


Uses

  • module~~modgvec_sbase~~UsesGraph module~modgvec_sbase MODgvec_sBase module~modgvec_globals MODgvec_Globals module~modgvec_sbase->module~modgvec_globals module~modgvec_sgrid MODgvec_sGrid module~modgvec_sbase->module~modgvec_sgrid module~sll_m_bsplines sll_m_bsplines module~modgvec_sbase->module~sll_m_bsplines module~sll_m_spline_interpolator_1d sll_m_spline_interpolator_1d module~modgvec_sbase->module~sll_m_spline_interpolator_1d module~sll_m_spline_matrix sll_m_spline_matrix module~modgvec_sbase->module~sll_m_spline_matrix iso_fortran_env iso_fortran_env module~modgvec_globals->iso_fortran_env module~modgvec_sgrid->module~modgvec_globals module~sll_m_bsplines_base sll_m_bsplines_base module~sll_m_bsplines->module~sll_m_bsplines_base module~sll_m_bsplines_non_uniform sll_m_bsplines_non_uniform module~sll_m_bsplines->module~sll_m_bsplines_non_uniform module~sll_m_bsplines_uniform sll_m_bsplines_uniform module~sll_m_bsplines->module~sll_m_bsplines_uniform module~sll_m_working_precision sll_m_working_precision module~sll_m_bsplines->module~sll_m_working_precision module~sll_m_spline_interpolator_1d->module~sll_m_spline_matrix module~sll_m_boundary_condition_descriptors sll_m_boundary_condition_descriptors module~sll_m_spline_interpolator_1d->module~sll_m_boundary_condition_descriptors module~sll_m_spline_interpolator_1d->module~sll_m_bsplines_base module~sll_m_spline_1d sll_m_spline_1d module~sll_m_spline_interpolator_1d->module~sll_m_spline_1d module~sll_m_spline_interpolator_1d->module~sll_m_working_precision module~sll_m_spline_matrix_banded sll_m_spline_matrix_banded module~sll_m_spline_matrix->module~sll_m_spline_matrix_banded module~sll_m_spline_matrix_base sll_m_spline_matrix_base module~sll_m_spline_matrix->module~sll_m_spline_matrix_base module~sll_m_spline_matrix_dense sll_m_spline_matrix_dense module~sll_m_spline_matrix->module~sll_m_spline_matrix_dense module~sll_m_spline_matrix->module~sll_m_working_precision module~sll_m_bsplines_base->module~sll_m_working_precision module~sll_m_bsplines_non_uniform->module~sll_m_bsplines_base module~sll_m_bsplines_non_uniform->module~sll_m_working_precision module~sll_m_bsplines_uniform->module~sll_m_bsplines_base module~sll_m_bsplines_uniform->module~sll_m_working_precision module~sll_m_spline_1d->module~sll_m_bsplines_base module~sll_m_spline_1d->module~sll_m_working_precision module~sll_m_spline_matrix_banded->iso_fortran_env module~sll_m_spline_matrix_banded->module~sll_m_spline_matrix_base module~sll_m_spline_matrix_banded->module~sll_m_working_precision module~sll_m_spline_matrix_base->module~sll_m_working_precision module~sll_m_spline_matrix_dense->iso_fortran_env module~sll_m_spline_matrix_dense->module~sll_m_spline_matrix_base module~sll_m_spline_matrix_dense->module~sll_m_working_precision

Used by

  • module~~modgvec_sbase~~UsedByGraph module~modgvec_sbase MODgvec_sBase module~modgvec_base MODgvec_base module~modgvec_base->module~modgvec_sbase module~modgvec_readstate_vars MODgvec_ReadState_Vars module~modgvec_readstate_vars->module~modgvec_sbase module~modgvec_readstate_vars->module~modgvec_base proc~readstatefilefromascii ReadStateFileFromASCII proc~readstatefilefromascii->module~modgvec_sbase proc~readstatefilefromascii->module~modgvec_base proc~readstatefilefromascii->module~modgvec_readstate_vars module~modgvec_gvec_to_jorek_vars MODgvec_gvec_to_jorek_Vars module~modgvec_gvec_to_jorek_vars->module~modgvec_base module~modgvec_mhd3d_vars MODgvec_MHD3D_Vars module~modgvec_mhd3d_vars->module~modgvec_base module~modgvec_py_state MODgvec_py_state module~modgvec_py_state->module~modgvec_base module~modgvec_transform_sfl MODgvec_Transform_SFL module~modgvec_transform_sfl->module~modgvec_base proc~applyprecond ApplyPrecond proc~applyprecond->module~modgvec_base proc~buildtransform_sfl t_transform_sfl%BuildTransform_SFL proc~buildtransform_sfl->module~modgvec_base proc~eval_prof_r eval_prof_r proc~eval_prof_r->module~modgvec_readstate_vars proc~evaluate_base_list_stz_all evaluate_base_list_stz_all proc~evaluate_base_list_stz_all->module~modgvec_base proc~evaluate_base_list_tz evaluate_base_list_tz proc~evaluate_base_list_tz->module~modgvec_base proc~evaluate_base_list_tz_all evaluate_base_list_tz_all proc~evaluate_base_list_tz_all->module~modgvec_base proc~evaluate_base_select evaluate_base_select proc~evaluate_base_select->module~modgvec_base proc~evaluate_base_tens evaluate_base_tens proc~evaluate_base_tens->module~modgvec_base proc~evaluate_base_tens_all evaluate_base_tens_all proc~evaluate_base_tens_all->module~modgvec_base proc~finalize_readstate Finalize_ReadState proc~finalize_readstate->module~modgvec_readstate_vars proc~get_boozer get_boozer proc~get_boozer->module~modgvec_base proc~get_boozer->module~modgvec_mhd3d_vars proc~get_boozer_sinterp t_sfl_boozer%Get_Boozer_sinterp proc~get_boozer_sinterp->module~modgvec_base proc~get_field Get_Field proc~get_field->module~modgvec_readstate_vars proc~get_field->module~modgvec_gvec_to_jorek_vars proc~get_integration_points get_integration_points proc~get_integration_points->module~modgvec_base proc~get_integration_points_num get_integration_points_num proc~get_integration_points_num->module~modgvec_base proc~gvec_to_jorek_prepare gvec_to_jorek_prepare proc~gvec_to_jorek_prepare->module~modgvec_base proc~gvec_to_jorek_prepare->module~modgvec_readstate_vars proc~gvec_to_jorek_prepare->module~modgvec_gvec_to_jorek_vars proc~init_base Init_Base proc~init_base->module~modgvec_base proc~init_base->module~modgvec_readstate_vars proc~init_base->module~modgvec_gvec_to_jorek_vars proc~init_gvec_to_jorek init_gvec_to_jorek proc~init_gvec_to_jorek->module~modgvec_readstate_vars proc~init_gvec_to_jorek->module~modgvec_gvec_to_jorek_vars proc~initmhd3d t_functional_mhd3d%InitMHD3D proc~initmhd3d->module~modgvec_base proc~initmhd3d->module~modgvec_mhd3d_vars proc~lambda_solve Lambda_solve proc~lambda_solve->module~modgvec_base proc~readstate ReadState proc~readstate->module~modgvec_readstate_vars proc~readstate->module~modgvec_mhd3d_vars proc~restartfromstate RestartFromState proc~restartfromstate->module~modgvec_base proc~restartfromstate->module~modgvec_readstate_vars proc~restartfromstate->module~modgvec_mhd3d_vars proc~select_base select_base proc~select_base->module~modgvec_base proc~select_base->module~modgvec_mhd3d_vars proc~select_base_dofs select_base_dofs proc~select_base_dofs->module~modgvec_base proc~select_base_dofs->module~modgvec_mhd3d_vars proc~transform_angles_3d Transform_Angles_3d proc~transform_angles_3d->module~modgvec_base proc~transform_angles_sinterp Transform_Angles_sinterp proc~transform_angles_sinterp->module~modgvec_base proc~transform_sfl_init t_transform_sfl%transform_SFL_init proc~transform_sfl_init->module~modgvec_base program~gvec_post GVEC_POST program~gvec_post->module~modgvec_readstate_vars program~gvec_post->module~modgvec_mhd3d_vars module~modgvec_gvec_to_castor3d_vars MODgvec_gvec_to_castor3d_Vars module~modgvec_gvec_to_castor3d_vars->module~modgvec_transform_sfl module~modgvec_gvec_to_gene_vars MODgvec_gvec_to_gene_Vars module~modgvec_gvec_to_gene_vars->module~modgvec_transform_sfl module~modgvec_gvec_to_hopr_vars MODgvec_gvec_to_hopr_vars module~modgvec_gvec_to_hopr_vars->module~modgvec_transform_sfl proc~addboundaryperturbation AddBoundaryPerturbation proc~addboundaryperturbation->module~modgvec_mhd3d_vars proc~analyze Analyze proc~analyze->module~modgvec_mhd3d_vars proc~applybc_fstrong ApplyBC_Fstrong proc~applybc_fstrong->module~modgvec_mhd3d_vars proc~buildprecond BuildPrecond proc~buildprecond->module~modgvec_mhd3d_vars proc~evalaux EvalAux proc~evalaux->module~modgvec_mhd3d_vars proc~evalenergy EvalEnergy proc~evalenergy->module~modgvec_mhd3d_vars proc~evalforce EvalForce proc~evalforce->module~modgvec_mhd3d_vars proc~evaluate_hmap evaluate_hmap proc~evaluate_hmap->module~modgvec_mhd3d_vars proc~evaluate_hmap_only evaluate_hmap_only proc~evaluate_hmap_only->module~modgvec_mhd3d_vars proc~evaluate_hmap_only_pw evaluate_hmap_only_pw proc~evaluate_hmap_only_pw->module~modgvec_mhd3d_vars proc~evaluate_hmap_pw evaluate_hmap_pw proc~evaluate_hmap_pw->module~modgvec_mhd3d_vars proc~evaluate_jac_h_derivs evaluate_jac_h_derivs proc~evaluate_jac_h_derivs->module~modgvec_mhd3d_vars proc~evaluate_jac_h_derivs_pw evaluate_jac_h_derivs_pw proc~evaluate_jac_h_derivs_pw->module~modgvec_mhd3d_vars proc~evaluate_metric_derivs evaluate_metric_derivs proc~evaluate_metric_derivs->module~modgvec_mhd3d_vars proc~evaluate_profile evaluate_profile proc~evaluate_profile->module~modgvec_mhd3d_vars proc~evaluate_rho2_profile evaluate_rho2_profile proc~evaluate_rho2_profile->module~modgvec_mhd3d_vars proc~finalize_gvec_to_jorek finalize_gvec_to_jorek proc~finalize_gvec_to_jorek->module~modgvec_gvec_to_jorek_vars proc~finalizemhd3d t_functional_mhd3d%FinalizeMHD3D proc~finalizemhd3d->module~modgvec_mhd3d_vars proc~finalizemhd3d_evalfunc FinalizeMHD3D_EvalFunc proc~finalizemhd3d_evalfunc->module~modgvec_mhd3d_vars proc~get_cla_gvec_to_jorek get_CLA_gvec_to_jorek proc~get_cla_gvec_to_jorek->module~modgvec_gvec_to_jorek_vars proc~gvec_to_jorek_writetofile_ascii gvec_to_jorek_writeToFile_ASCII proc~gvec_to_jorek_writetofile_ascii->module~modgvec_gvec_to_jorek_vars proc~init Init proc~init->module~modgvec_mhd3d_vars proc~init_boozer init_boozer proc~init_boozer->module~modgvec_mhd3d_vars proc~init_la_from_solution Init_LA_from_Solution proc~init_la_from_solution->module~modgvec_mhd3d_vars proc~initaverageaxis InitAverageAxis proc~initaverageaxis->module~modgvec_mhd3d_vars proc~initializemhd3d_evalfunc InitializeMHD3D_evalFunc proc~initializemhd3d_evalfunc->module~modgvec_mhd3d_vars proc~initprofilesgp InitProfilesGP proc~initprofilesgp->module~modgvec_mhd3d_vars proc~initsolution InitSolution proc~initsolution->module~modgvec_mhd3d_vars proc~initsolutionmhd3d t_functional_mhd3d%InitSolutionMHD3D proc~initsolutionmhd3d->module~modgvec_mhd3d_vars proc~minimizemhd3d t_functional_mhd3d%MinimizeMHD3D proc~minimizemhd3d->module~modgvec_mhd3d_vars proc~minimizemhd3d_descent MinimizeMHD3D_descent proc~minimizemhd3d_descent->module~modgvec_mhd3d_vars proc~rungvec rungvec proc~rungvec->module~modgvec_mhd3d_vars proc~writestatetoascii WriteStateToASCII proc~writestatetoascii->module~modgvec_mhd3d_vars

Variables

Type Visibility Attributes Name Initial
logical, private :: test_called = .FALSE.

Abstract Interfaces

abstract interface

  • private function i_fun_sbase_initDOF(sf, g_IP) result(DOFs)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    real(kind=wp), intent(in) :: g_IP(:)

    Return Value real(kind=wp), (1:sf%nBase)

abstract interface

  • private function i_fun_sbase_evalDOF_s(sf, x, deriv, DOFs) result(y)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    real(kind=wp), intent(in) :: x
    integer, intent(in) :: deriv
    real(kind=wp), intent(in) :: DOFs(:)

    Return Value real(kind=wp)

abstract interface

  • private function i_fun_sbase_evalDOF2D_s(sf, x, nd, deriv, DOFs) result(y)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    real(kind=wp), intent(in) :: x
    integer, intent(in) :: nd
    integer, intent(in) :: deriv
    real(kind=wp), intent(in) :: DOFs(1:sf%nBase,1:nd)

    Return Value real(kind=wp), (1:nd)

abstract interface

  • private function i_fun_sbase_evalDOF_base(sf, iElem, base_x, DOFs) result(y)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    integer, intent(in) :: iElem
    real(kind=wp), intent(in) :: base_x(0:sf%deg)
    real(kind=wp), intent(in) :: DOFs(:)

    Return Value real(kind=wp)

abstract interface

  • private function i_fun_sbase_evalDOF_GP(sf, deriv, DOFs) result(y_GP)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    integer, intent(in) :: deriv
    real(kind=wp), intent(in) :: DOFs(:)

    Return Value real(kind=wp), (sf%nGP)

abstract interface

  • private subroutine i_sub_sbase_init(sf, deg_in, continuity_in, grid_in, degGP_in)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(inout) :: sf
    integer, intent(in) :: deg_in
    integer, intent(in) :: continuity_in
    class(t_sGrid), intent(in), TARGET :: grid_in
    integer, intent(in) :: degGP_in

abstract interface

  • private subroutine i_sub_sbase_free(sf)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(inout) :: sf

abstract interface

  • private subroutine i_sub_sbase_copy(sf, tocopy)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(inout) :: sf
    class(c_sbase), intent(in) :: tocopy

abstract interface

  • private subroutine i_sub_sbase_compare(sf, tocompare, is_same, cond_out)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    class(c_sbase), intent(in) :: tocompare
    logical, intent(out), optional :: is_same
    logical, intent(out), optional :: cond_out(:)

abstract interface

  • private subroutine i_sub_sbase_change_base(sf, old_sBase, iterDim, old_data, sf_data)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    class(c_sbase), intent(in) :: old_sBase
    integer, intent(in) :: iterDim
    real(kind=wp), intent(in) :: old_data(:,:)
    real(kind=wp), intent(out) :: sf_data(:,:)

abstract interface

  • private subroutine i_sub_sBase_eval(sf, x, deriv, iElem, base_x)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf

    self

    real(kind=wp), intent(in) :: x
    integer, intent(in) :: deriv
    integer, intent(out) :: iElem
    real(kind=wp), intent(out) :: base_x(:)

abstract interface

  • private subroutine i_sub_sBase_applyBCtoDOF(sf, DOFs, BC_Type, BC_Val)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    real(kind=wp), intent(inout) :: DOFs(1:sf%nBase)
    integer, intent(in) :: BC_Type(2)
    real(kind=wp), intent(in) :: BC_Val(2)

abstract interface

  • private subroutine i_sub_sBase_applyBCtoRHS(sf, RHS, BC_Type)

    Arguments

    Type IntentOptional Attributes Name
    class(c_sbase), intent(in) :: sf
    real(kind=wp), intent(inout) :: RHS(1:sf%nBase)
    integer, intent(in) :: BC_Type(2)

Derived Types

type, private, ABSTRACT ::  c_sbase

Components

Type Visibility Attributes Name Initial
integer, public :: deg

input parameter: degree of Spline/polynomial

integer, public :: degGP

number of Gauss-points (degGP+1) per element >= deg

integer, public :: continuity

input parameter: full spline (=deg-1) or discontinuous (=-1)

integer, public :: nGP

global number of gausspoints = (degGP+1)*nElems

integer, public :: nGP_str

local number of gausspoints = (degGP+1)*nElems per MPI subdomain

integer, public :: nGP_end

local number of gausspoints = (degGP+1)*nElems per MPI subdomain

integer, public :: nbase

total number of degree of freedom / global basis functions

class(sll_c_spline_matrix), public, ALLOCATABLE :: mass

Type-Bound Procedures

procedure(i_sub_sbase_init), public, deferred :: init
procedure(i_sub_sbase_free), public, deferred :: free
procedure(i_sub_sbase_copy), public, deferred :: copy
procedure(i_sub_sbase_compare), public, deferred :: compare
procedure(i_sub_sbase_change_base), public, deferred :: change_base
procedure(i_sub_sBase_eval), public, deferred :: eval
procedure(i_fun_sbase_evalDOF_s), public, deferred :: evalDOF_s
procedure(i_fun_sbase_evalDOF2D_s), public, deferred :: evalDOF2D_s
procedure(i_fun_sbase_evalDOF_base), public, deferred :: evalDOF_base
procedure(i_fun_sbase_evalDOF_GP), public, deferred :: evalDOF_GP
procedure(i_fun_sbase_initDOF), public, deferred :: initDOF
procedure(i_sub_sBase_applyBCtoDOF), public, deferred :: applyBCtoDOF
procedure(i_sub_sBase_applyBCtoRHS), public, deferred :: applyBCtoRHS

type, public, extends(c_sbase) ::  t_sBase

Components

Type Visibility Attributes Name Initial
integer, public :: deg

input parameter: degree of Spline/polynomial

integer, public :: degGP

number of Gauss-points (degGP+1) per element >= deg

integer, public :: continuity

input parameter: full spline (=deg-1) or discontinuous (=-1)

integer, public :: nGP

global number of gausspoints = (degGP+1)*nElems

integer, public :: nGP_str

local number of gausspoints = (degGP+1)*nElems per MPI subdomain

integer, public :: nGP_end

local number of gausspoints = (degGP+1)*nElems per MPI subdomain

integer, public :: nbase

total number of degree of freedom / global basis functions

class(sll_c_spline_matrix), public, ALLOCATABLE :: mass
logical, public :: initialized = .FALSE.

set to true in init, set to false in free

class(t_sGrid), public, POINTER :: grid

pointer to grid

real(kind=wp), public, ALLOCATABLE :: xi_GP(:)

element local gauss point positions for interval [-1,1], size(0:degGP)

real(kind=wp), public, ALLOCATABLE :: w_GPloc(:)

element local gauss weights for interval [-1,1], size(0:degGP)

real(kind=wp), public, ALLOCATABLE :: w_GP(:)

global radial integration weight size((degGP+1)*nElems)

real(kind=wp), public, ALLOCATABLE :: s_GP(:)

global position of gauss points in s [0,1] , size((degGP+1)*nElems)

real(kind=wp), public, ALLOCATABLE :: s_IP(:)

position of interpolation points for initialization, size(nBase)

integer, public, ALLOCATABLE :: base_offset(:)

offset of 0:deg element local basis functions to global index of degree of freedom, allocated (1:nElems). iBase = offset(iElem)+j, j=0...deg

real(kind=wp), public, ALLOCATABLE :: base_GP(:,:,:)

basis functions, (0:degGP,0:deg,1:nElems),

real(kind=wp), public, ALLOCATABLE :: base_ds_GP(:,:,:)

s derivative of basis functions, (0:degGP,0:deg,1:nElems)

real(kind=wp), public, ALLOCATABLE :: base_dsAxis(:,:)

all derivatives 1..deg of all basis functions at axis size(1:deg+1,0:deg)

real(kind=wp), public, ALLOCATABLE :: base_dsEdge(:,:)

all derivatives 1..deg of all basis functions at edge size(nBase-deg:nBase,0:deg)

integer, public, ALLOCATABLE :: nDOF_BC(:)

number of boundary dofs involved in bc of BC_TYPE, size(-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: A_Axis(:,:,:)

matrix to apply boundary conditions after interpolation (direct)

real(kind=wp), public, ALLOCATABLE :: invA_Axis(:,:,:)

inverse of A_Axis

real(kind=wp), public, ALLOCATABLE :: R_Axis(:,:,:)

matrix to apply boundary conditions for RHS (testfunction) size(1:deg+1,1:deg+1,-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: AR_Axis(:,:,:)

matrix to apply boundary conditions via LGM with identity size(1:deg+1,1:deg+1,-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: A_Edge(:,:,:)

matrix to apply boundary conditions after interpolation (direct)

real(kind=wp), public, ALLOCATABLE :: invA_Edge(:,:,:)

inverse of A_Edge

real(kind=wp), public, ALLOCATABLE :: R_Edge(:,:,:)

matrix to apply boundary conditions for RHS size(nBase-deg:nBase,nBase-deg:nBase,NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: AR_Edge(:,:,:)

matrix to apply boundary conditions via LGM with identity size(nBase-deg:nBase,nBase-deg:nBase,NBC_TYPES) possible Boundary conditions 1=BC_TYPE_OPEN : boundary left open 2=BC_TYPE_NEUMANN : 1st deriv fixed 3=BC_TYPE_DIRICHLET : sol fixed (typically used at edge) 4=BC_TYPE_SYMM : all odd derivs = 0 5=BC_TYPE_SYMMZERO : all even derivs & sol = 0 6=BC_TYPE_ANTISYMM : all odd derivs & sol = 0 <=0: m-dependent BC: 0, m=0: BC_TYPE_SYMM -1, m=1: BC_TYPE_ANTISYMM -2, m=2: BC_TYPE_SYMMZERO ... odd m<=deg: ANTISYMM + all derivatives 1,...,m-1 =0 ...even m<=deg: SYMMZERO + all derivatives 1,...,m-1 =0

Type-Bound Procedures

procedure, public :: init => sBase_init
procedure, public :: free => sBase_free
procedure, public :: copy => sBase_copy
procedure, public :: compare => sBase_compare
procedure, public :: change_base => sBase_change_base
procedure, public :: eval => sBase_eval
procedure, public :: evalDOF_s => sBase_evalDOF_s
procedure, public :: evalDOF2D_s => sBase_evalDOF2D_s
procedure, public :: evalDOF_base => sBase_evalDOF_base
procedure, public :: evalDOF_GP => sBase_evalDOF_GP
procedure, public :: initDOF => sBase_initDOF
procedure, public :: applyBCtoDOF => sBase_applyBCtoDOF_LGM
procedure, public :: applyBCtoRHS => sBase_applyBCtoRHS

type, private, extends(t_sBase) ::  t_sBase_disc

Components

Type Visibility Attributes Name Initial
integer, public :: deg

input parameter: degree of Spline/polynomial

integer, public :: degGP

number of Gauss-points (degGP+1) per element >= deg

integer, public :: continuity

input parameter: full spline (=deg-1) or discontinuous (=-1)

integer, public :: nGP

global number of gausspoints = (degGP+1)*nElems

integer, public :: nGP_str

local number of gausspoints = (degGP+1)*nElems per MPI subdomain

integer, public :: nGP_end

local number of gausspoints = (degGP+1)*nElems per MPI subdomain

integer, public :: nbase

total number of degree of freedom / global basis functions

class(sll_c_spline_matrix), public, ALLOCATABLE :: mass
logical, public :: initialized = .FALSE.

set to true in init, set to false in free

class(t_sGrid), public, POINTER :: grid

pointer to grid

real(kind=wp), public, ALLOCATABLE :: xi_GP(:)

element local gauss point positions for interval [-1,1], size(0:degGP)

real(kind=wp), public, ALLOCATABLE :: w_GPloc(:)

element local gauss weights for interval [-1,1], size(0:degGP)

real(kind=wp), public, ALLOCATABLE :: w_GP(:)

global radial integration weight size((degGP+1)*nElems)

real(kind=wp), public, ALLOCATABLE :: s_GP(:)

global position of gauss points in s [0,1] , size((degGP+1)*nElems)

real(kind=wp), public, ALLOCATABLE :: s_IP(:)

position of interpolation points for initialization, size(nBase)

integer, public, ALLOCATABLE :: base_offset(:)

offset of 0:deg element local basis functions to global index of degree of freedom, allocated (1:nElems). iBase = offset(iElem)+j, j=0...deg

real(kind=wp), public, ALLOCATABLE :: base_GP(:,:,:)

basis functions, (0:degGP,0:deg,1:nElems),

real(kind=wp), public, ALLOCATABLE :: base_ds_GP(:,:,:)

s derivative of basis functions, (0:degGP,0:deg,1:nElems)

real(kind=wp), public, ALLOCATABLE :: base_dsAxis(:,:)

all derivatives 1..deg of all basis functions at axis size(1:deg+1,0:deg)

real(kind=wp), public, ALLOCATABLE :: base_dsEdge(:,:)

all derivatives 1..deg of all basis functions at edge size(nBase-deg:nBase,0:deg)

integer, public, ALLOCATABLE :: nDOF_BC(:)

number of boundary dofs involved in bc of BC_TYPE, size(-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: A_Axis(:,:,:)

matrix to apply boundary conditions after interpolation (direct)

real(kind=wp), public, ALLOCATABLE :: invA_Axis(:,:,:)

inverse of A_Axis

real(kind=wp), public, ALLOCATABLE :: R_Axis(:,:,:)

matrix to apply boundary conditions for RHS (testfunction) size(1:deg+1,1:deg+1,-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: AR_Axis(:,:,:)

matrix to apply boundary conditions via LGM with identity size(1:deg+1,1:deg+1,-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: A_Edge(:,:,:)

matrix to apply boundary conditions after interpolation (direct)

real(kind=wp), public, ALLOCATABLE :: invA_Edge(:,:,:)

inverse of A_Edge

real(kind=wp), public, ALLOCATABLE :: R_Edge(:,:,:)

matrix to apply boundary conditions for RHS size(nBase-deg:nBase,nBase-deg:nBase,NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: AR_Edge(:,:,:)

matrix to apply boundary conditions via LGM with identity size(nBase-deg:nBase,nBase-deg:nBase,NBC_TYPES) possible Boundary conditions 1=BC_TYPE_OPEN : boundary left open 2=BC_TYPE_NEUMANN : 1st deriv fixed 3=BC_TYPE_DIRICHLET : sol fixed (typically used at edge) 4=BC_TYPE_SYMM : all odd derivs = 0 5=BC_TYPE_SYMMZERO : all even derivs & sol = 0 6=BC_TYPE_ANTISYMM : all odd derivs & sol = 0 <=0: m-dependent BC: 0, m=0: BC_TYPE_SYMM -1, m=1: BC_TYPE_ANTISYMM -2, m=2: BC_TYPE_SYMMZERO ... odd m<=deg: ANTISYMM + all derivatives 1,...,m-1 =0 ...even m<=deg: SYMMZERO + all derivatives 1,...,m-1 =0

real(kind=wp), public, ALLOCATABLE :: xiIP(:)

element local interpolation points in [-1,1] (continuity =-1) size(0:deg)

real(kind=wp), public, ALLOCATABLE :: wbaryIP(:)

barycentric weights for xiIP size(0:deg)

real(kind=wp), public, ALLOCATABLE :: DmatIP(:,:)

Nodal derivative matrix size(0:deg,0:deg)

Type-Bound Procedures

procedure, public :: init => sBase_init
procedure, public :: free => sBase_free
procedure, public :: copy => sBase_copy
procedure, public :: compare => sBase_compare
procedure, public :: change_base => sBase_change_base
procedure, public :: eval => sBase_eval
procedure, public :: evalDOF_s => sBase_evalDOF_s
procedure, public :: evalDOF2D_s => sBase_evalDOF2D_s
procedure, public :: evalDOF_base => sBase_evalDOF_base
procedure, public :: evalDOF_GP => sBase_evalDOF_GP
procedure, public :: initDOF => sBase_initDOF
procedure, public :: applyBCtoDOF => sBase_applyBCtoDOF_LGM
procedure, public :: applyBCtoRHS => sBase_applyBCtoRHS

type, private, extends(t_sBase) ::  t_sBase_spl

Components

Type Visibility Attributes Name Initial
integer, public :: deg

input parameter: degree of Spline/polynomial

integer, public :: degGP

number of Gauss-points (degGP+1) per element >= deg

integer, public :: continuity

input parameter: full spline (=deg-1) or discontinuous (=-1)

integer, public :: nGP

global number of gausspoints = (degGP+1)*nElems

integer, public :: nGP_str

local number of gausspoints = (degGP+1)*nElems per MPI subdomain

integer, public :: nGP_end

local number of gausspoints = (degGP+1)*nElems per MPI subdomain

integer, public :: nbase

total number of degree of freedom / global basis functions

class(sll_c_spline_matrix), public, ALLOCATABLE :: mass
logical, public :: initialized = .FALSE.

set to true in init, set to false in free

class(t_sGrid), public, POINTER :: grid

pointer to grid

real(kind=wp), public, ALLOCATABLE :: xi_GP(:)

element local gauss point positions for interval [-1,1], size(0:degGP)

real(kind=wp), public, ALLOCATABLE :: w_GPloc(:)

element local gauss weights for interval [-1,1], size(0:degGP)

real(kind=wp), public, ALLOCATABLE :: w_GP(:)

global radial integration weight size((degGP+1)*nElems)

real(kind=wp), public, ALLOCATABLE :: s_GP(:)

global position of gauss points in s [0,1] , size((degGP+1)*nElems)

real(kind=wp), public, ALLOCATABLE :: s_IP(:)

position of interpolation points for initialization, size(nBase)

integer, public, ALLOCATABLE :: base_offset(:)

offset of 0:deg element local basis functions to global index of degree of freedom, allocated (1:nElems). iBase = offset(iElem)+j, j=0...deg

real(kind=wp), public, ALLOCATABLE :: base_GP(:,:,:)

basis functions, (0:degGP,0:deg,1:nElems),

real(kind=wp), public, ALLOCATABLE :: base_ds_GP(:,:,:)

s derivative of basis functions, (0:degGP,0:deg,1:nElems)

real(kind=wp), public, ALLOCATABLE :: base_dsAxis(:,:)

all derivatives 1..deg of all basis functions at axis size(1:deg+1,0:deg)

real(kind=wp), public, ALLOCATABLE :: base_dsEdge(:,:)

all derivatives 1..deg of all basis functions at edge size(nBase-deg:nBase,0:deg)

integer, public, ALLOCATABLE :: nDOF_BC(:)

number of boundary dofs involved in bc of BC_TYPE, size(-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: A_Axis(:,:,:)

matrix to apply boundary conditions after interpolation (direct)

real(kind=wp), public, ALLOCATABLE :: invA_Axis(:,:,:)

inverse of A_Axis

real(kind=wp), public, ALLOCATABLE :: R_Axis(:,:,:)

matrix to apply boundary conditions for RHS (testfunction) size(1:deg+1,1:deg+1,-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: AR_Axis(:,:,:)

matrix to apply boundary conditions via LGM with identity size(1:deg+1,1:deg+1,-(deg+1):NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: A_Edge(:,:,:)

matrix to apply boundary conditions after interpolation (direct)

real(kind=wp), public, ALLOCATABLE :: invA_Edge(:,:,:)

inverse of A_Edge

real(kind=wp), public, ALLOCATABLE :: R_Edge(:,:,:)

matrix to apply boundary conditions for RHS size(nBase-deg:nBase,nBase-deg:nBase,NBC_TYPES)

real(kind=wp), public, ALLOCATABLE :: AR_Edge(:,:,:)

matrix to apply boundary conditions via LGM with identity size(nBase-deg:nBase,nBase-deg:nBase,NBC_TYPES) possible Boundary conditions 1=BC_TYPE_OPEN : boundary left open 2=BC_TYPE_NEUMANN : 1st deriv fixed 3=BC_TYPE_DIRICHLET : sol fixed (typically used at edge) 4=BC_TYPE_SYMM : all odd derivs = 0 5=BC_TYPE_SYMMZERO : all even derivs & sol = 0 6=BC_TYPE_ANTISYMM : all odd derivs & sol = 0 <=0: m-dependent BC: 0, m=0: BC_TYPE_SYMM -1, m=1: BC_TYPE_ANTISYMM -2, m=2: BC_TYPE_SYMMZERO ... odd m<=deg: ANTISYMM + all derivatives 1,...,m-1 =0 ...even m<=deg: SYMMZERO + all derivatives 1,...,m-1 =0

class(sll_c_bsplines), public, ALLOCATABLE :: bspl

contains bspline functions

type(sll_t_spline_interpolator_1d), public :: Interpol

spline interpolator

Type-Bound Procedures

procedure, public :: init => sBase_init
procedure, public :: free => sBase_free
procedure, public :: copy => sBase_copy
procedure, public :: compare => sBase_compare
procedure, public :: change_base => sBase_change_base
procedure, public :: eval => sBase_eval
procedure, public :: evalDOF_s => sBase_evalDOF_s
procedure, public :: evalDOF2D_s => sBase_evalDOF2D_s
procedure, public :: evalDOF_base => sBase_evalDOF_base
procedure, public :: evalDOF_GP => sBase_evalDOF_GP
procedure, public :: initDOF => sBase_initDOF
procedure, public :: applyBCtoDOF => sBase_applyBCtoDOF_LGM
procedure, public :: applyBCtoRHS => sBase_applyBCtoRHS

Functions

private function sBase_evalDOF_s(sf, x, deriv, DOFs) result(y)

simply evaluate function or derivative at point x

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

real(kind=wp), intent(in) :: x

point positions in [0,1]

integer, intent(in) :: deriv

derivative (=0: solution)

real(kind=wp), intent(in) :: DOFs(:)

array of all degrees of freedom

Return Value real(kind=wp)

private function sBase_evalDOF_base(sf, iElem, base_x, DOFs) result(y)

simply evaluate function with a base or base derivative evaluated at a point and its corresponding iElem use together with sBase_eval(x) => iElem,base

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

integer, intent(in) :: iElem

element where evaluation point

real(kind=wp), intent(in) :: base_x(0:sf%deg)

evaluation of base or its derivative in element iElem at a point position

real(kind=wp), intent(in) :: DOFs(:)

degrees of freedom

Return Value real(kind=wp)

private function sBase_evalDOF2D_s(sf, x, nd, deriv, DOFs) result(y)

simply evaluate function or derivative at point x, for multiple DOF vectors

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

real(kind=wp), intent(in) :: x

point positions in [0,1]

integer, intent(in) :: nd

number of DOF vectors

integer, intent(in) :: deriv

derivative (=0: solution)

real(kind=wp), intent(in) :: DOFs(1:sf%nBase,1:nd)

Return Value real(kind=wp), (1:nd)

private function sBase_evalDOF_GP(sf, deriv, DOFs) result(y_GP)

evaluate all degrees of freedom at all Gauss Points (deriv=0 solution, deriv=1 first derivative d/ds)

Read more…

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

integer, intent(in) :: deriv

only 0 or 1

real(kind=wp), intent(in) :: DOFs(:)

array of all degrees of freedom

Return Value real(kind=wp), (1:sf%nGP)

private function sBase_initDOF(sf, g_IP) result(DOFs)

take values interpolated at sf%s_IP positions and give back the degrees of freedom

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

real(kind=wp), intent(in) :: g_IP(:)

interpolation values at s_IP positions [0,1]

Return Value real(kind=wp), (1:sf%nBase)

result of interpolation


Subroutines

public subroutine sBase_new(sbase_in, deg_in, continuity_in, grid_in, degGP_in)

initialize the type sbase with polynomial degree, continuity ( -1: disc, 1: full) and number of gauss points per element

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(inout), ALLOCATABLE :: sbase_in
integer, intent(in) :: deg_in

polynomial degree

integer, intent(in) :: continuity_in
class(t_sGrid), intent(in), TARGET :: grid_in

grid information

integer, intent(in) :: degGP_in

gauss quadrature points: nGP=degGP+1

private subroutine sBase_init(sf, deg_in, continuity_in, grid_in, degGP_in)

initialize the type sbase with polynomial degree, continuity ( -1: disc, 1: full) and number of gauss points per element

Read more…

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(inout) :: sf

self

integer, intent(in) :: deg_in

polynomial degree

integer, intent(in) :: continuity_in
class(t_sGrid), intent(in), TARGET :: grid_in

grid information

integer, intent(in) :: degGP_in

gauss quadrature points: nGP=degGP+1 per elements

private subroutine sBase_alloc(sf)

allocate all variables in sbase

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(inout) :: sf

self

private subroutine sBase_free(sf)

finalize the type sBase

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(inout) :: sf

self

private subroutine sBase_copy(sf, tocopy)

copy onto sf <-- tocopy

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(inout) :: sf

self

class(c_sbase), intent(in) :: tocopy

private subroutine sBase_compare(sf, tocompare, is_same, cond_out)

compare sf with input sbase

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

class(c_sbase), intent(in) :: tocompare
logical, intent(out), optional :: is_same
logical, intent(out), optional :: cond_out(:)

private subroutine sBase_change_base(sf, old_sBase, iterDim, old_data, sf_data)

change data from old_sBase to self. using interpolations of the old data at the new interpolation points

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

class(c_sbase), intent(in) :: old_sBase

base of old_data

integer, intent(in) :: iterDim

iterate on first or second dimension or old_data/sf_data

real(kind=wp), intent(in) :: old_data(:,:)
real(kind=wp), intent(out) :: sf_data(:,:)

private subroutine sBase_eval(sf, x, deriv, iElem, base_x)

evaluate sbase at position x [0,1], NOT EFFICIENT!!

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

real(kind=wp), intent(in) :: x

position [0,1] where to evaluate

integer, intent(in) :: deriv
integer, intent(out) :: iElem
real(kind=wp), intent(out) :: base_x(:)

all basis functions (0:deg) evaluated

private subroutine sBase_applyBCtoDOF_STRONG(sf, DOFs, BC_Type, BC_Val)

apply strong boundary conditions at axis and edge Not used anymore, WAS FOUND TO BE NOT STABLE (OSCILLATORY) IN GENERAL, especially for BCs with only derivatives prescribed... new LGM method below is used now!

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

real(kind=wp), intent(inout) :: DOFs(1:sf%nBase)

DOFs with boundary conditions applied

integer, intent(in) :: BC_Type(2)

bc type on axis (1) and edge (2)

real(kind=wp), intent(in) :: BC_Val(2)

for dirichlet BC : value

private subroutine sBase_applyBCtoDOF_LGM(sf, DOFs, BC_Type, BC_Val)

apply boundary conditions at axis and edge, via solving the Lagrange multiplier problem: x_new=x_old & A*x_new = d

Read more…

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

real(kind=wp), intent(inout) :: DOFs(1:sf%nBase)

DOFs with boundary conditions applied

integer, intent(in) :: BC_Type(2)

bc type on axis (1) and edge (2)

real(kind=wp), intent(in) :: BC_Val(2)

for dirichlet BC : value

private subroutine sBase_applyBCtoRHS(sf, RHS, BC_Type)

apply strong boundary conditions at axis and edge for solution update

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(in) :: sf

self

real(kind=wp), intent(inout) :: RHS(sf%nBase)

DOFs with boundary conditions applied

integer, intent(in) :: BC_Type(2)

bc type on axis (1) and edge (2)

private subroutine sBase_test(sf)

test sbase variable

Arguments

Type IntentOptional Attributes Name
class(t_sBase), intent(inout) :: sf

self