Init_RefinementIndicator2D_t Subroutine

public subroutine Init_RefinementIndicator2D_t(this, interp, nElem, refineThreshold, coarsenThreshold)

Allocate the indicator for an interpolant of degree interp%N and nElem elements and precompute the nodal->modal transform matrix from the interpolant control points.

Arguments

TypeIntentOptionalAttributesName
class(RefinementIndicator2D_t), intent(out) :: this
type(Lagrange), intent(in), target:: interp
integer, intent(in) :: nElem
real(kind=prec), intent(in) :: refineThreshold
real(kind=prec), intent(in) :: coarsenThreshold

Calls

proc~~init_refinementindicator2d_t~~CallsGraph proc~init_refinementindicator2d_t Init_RefinementIndicator2D_t proc~buildmodaltransform BuildModalTransform proc~init_refinementindicator2d_t->proc~buildmodaltransform proc~normalizedlegendre NormalizedLegendre proc~buildmodaltransform->proc~normalizedlegendre proc~invertmatrix InvertMatrix proc~buildmodaltransform->proc~invertmatrix

Called by

proc~~init_refinementindicator2d_t~~CalledByGraph proc~init_refinementindicator2d_t Init_RefinementIndicator2D_t proc~init_refinementindicator2d Init_RefinementIndicator2D proc~init_refinementindicator2d->proc~init_refinementindicator2d_t

Contents


Source Code

  subroutine Init_RefinementIndicator2D_t(this,interp,nElem,refineThreshold,coarsenThreshold)
    !! Allocate the indicator for an interpolant of degree interp%N and nElem elements and
    !! precompute the nodal->modal transform matrix from the interpolant control points.
    implicit none
    class(RefinementIndicator2D_t),intent(out) :: this
    type(Lagrange),intent(in),target :: interp
    integer,intent(in) :: nElem
    real(prec),intent(in) :: refineThreshold
    real(prec),intent(in) :: coarsenThreshold

    if(interp%N < 1) then
      print*,__FILE__,':',__LINE__, &
        ' : Error : RefinementIndicator2D requires interpolant degree N >= 1, got ',interp%N
      stop 1
    endif

    if(refineThreshold <= coarsenThreshold) then
      print*,__FILE__,':',__LINE__, &
        ' : Error : refineThreshold must be greater than coarsenThreshold.'
      stop 1
    endif

    this%N = interp%N
    this%nElem = nElem
    this%refineThreshold = refineThreshold
    this%coarsenThreshold = coarsenThreshold

    allocate(this%Pmodal(1:interp%N+1,1:interp%N+1))
    allocate(this%indicator(1:nElem))
    allocate(this%flag(1:nElem))

    call BuildModalTransform(interp%controlPoints,interp%N,this%Pmodal)

    this%indicator = 0.0_prec
    this%flag = SELF_AMR_KEEP

  endsubroutine Init_RefinementIndicator2D_t