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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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 |
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