wenoof_smoothness_indicators.F90 Source File

Abstract smoothness indicator object.

This File Depends On

sourcefile~~wenoof_smoothness_indicators.f90~~EfferentGraph sourcefile~wenoof_smoothness_indicators.f90 wenoof_smoothness_indicators.F90 sourcefile~penf.f90 penf.F90 sourcefile~penf.f90->sourcefile~wenoof_smoothness_indicators.f90 sourcefile~wenoof_base_object.f90 wenoof_base_object.f90 sourcefile~wenoof_base_object.f90->sourcefile~wenoof_smoothness_indicators.f90 sourcefile~penf_b_size.f90 penf_b_size.F90 sourcefile~penf_b_size.f90->sourcefile~penf.f90 sourcefile~penf_stringify.f90 penf_stringify.F90 sourcefile~penf_b_size.f90->sourcefile~penf_stringify.f90 sourcefile~penf_global_parameters_variables.f90 penf_global_parameters_variables.F90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf.f90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf_b_size.f90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf_stringify.f90 sourcefile~penf_stringify.f90->sourcefile~penf.f90
Help

Files Dependent On This One

sourcefile~~wenoof_smoothness_indicators.f90~~AfferentGraph sourcefile~wenoof_smoothness_indicators.f90 wenoof_smoothness_indicators.F90 sourcefile~wenoof.f90 wenoof.f90 sourcefile~wenoof_smoothness_indicators.f90->sourcefile~wenoof.f90 sourcefile~wenoof_objects_factory.f90 wenoof_objects_factory.f90 sourcefile~wenoof_smoothness_indicators.f90->sourcefile~wenoof_objects_factory.f90 sourcefile~wenoof_interpolator_js.f90 wenoof_interpolator_js.f90 sourcefile~wenoof_smoothness_indicators.f90->sourcefile~wenoof_interpolator_js.f90 sourcefile~wenoof_interpolator.f90 wenoof_interpolator.F90 sourcefile~wenoof_smoothness_indicators.f90->sourcefile~wenoof_interpolator.f90 sourcefile~wenoof_smoothness_indicators_js.f90 wenoof_smoothness_indicators_js.f90 sourcefile~wenoof_smoothness_indicators.f90->sourcefile~wenoof_smoothness_indicators_js.f90 sourcefile~sin_reconstruction.f90 sin_reconstruction.f90 sourcefile~wenoof.f90->sourcefile~sin_reconstruction.f90 sourcefile~wenoof_objects_factory.f90->sourcefile~wenoof_interpolator.f90 sourcefile~wenoof_interpolator_js.f90->sourcefile~wenoof.f90 sourcefile~wenoof_interpolator.f90->sourcefile~wenoof.f90 sourcefile~wenoof_interpolator.f90->sourcefile~wenoof_interpolator_js.f90 sourcefile~wenoof_smoothness_indicators_js.f90->sourcefile~wenoof.f90 sourcefile~wenoof_smoothness_indicators_js.f90->sourcefile~wenoof_objects_factory.f90 sourcefile~wenoof_smoothness_indicators_js.f90->sourcefile~wenoof_interpolator_js.f90
Help


Source Code

!< Abstract smoothness indicator object.
module wenoof_smoothness_indicators
!< Abstract smoothness indicator object.

use penf, only : I_P, R_P
use wenoof_base_object

implicit none
private
public :: smoothness_indicators
public :: smoothness_indicators_constructor

type, extends(base_object_constructor) :: smoothness_indicators_constructor
  !< Abstract smoothness indicators object constructor.
  integer(I_P) :: S = 0 !< Stencils dimension.
endtype smoothness_indicators_constructor

type, extends(base_object) :: smoothness_indicators
  !< Abstract smoothness indicator object.
  real(R_P), allocatable :: si(:,:) !< Smoothness indicators [1:2,0:S-1].
  contains
    ! deferred public methods
    procedure, pass(self) :: compute     !< Compute smoothness indicators.
    procedure, nopass     :: description !< Return smoothness indicators string-description.
    ! public methods
    procedure, pass(self) :: create  !< Createte smoothness indicators.
    procedure, pass(self) :: destroy !< Destroy smoothness indicators.
endtype smoothness_indicators

contains
  ! deferred public methods
  pure subroutine compute(self, S, stencil, f1, f2, ff)
  !< Compute smoothness indicators.
  class(smoothness_indicators), intent(inout) :: self                !< Smoothness indicators.
  integer(I_P),                 intent(in)    :: S                   !< Number of stencils used.
  real(R_P),                    intent(in)    :: stencil(1:, 1 - S:) !< Stencil used for the interpolation, [1:2, 1-S:-1+S].
  integer(I_P),                 intent(in)    :: f1, f2, ff          !< Faces to be computed.

#ifndef DEBUG
  ! error stop in pure procedure is a F2015 feature not yet supported in debug mode
  error stop 'smoothness_indicators%compute to be implemented by your concrete smoothness indicators object'
#endif
  endsubroutine compute

  pure function description() result(string)
  !< Return smoothness indicators string-description.
  character(len=:), allocatable  :: string !< String-description.

#ifndef DEBUG
  ! error stop in pure procedure is a F2015 feature not yet supported in debug mode
  error stop 'smoothness_indicators%description to be implemented by your concrete smoothness indicators object'
#endif
  endfunction description

  ! public methods
  pure subroutine create(self, constructor)
  !< Create smoothness indicators.
  class(smoothness_indicators),   intent(inout) :: self        !< Smoothness indicators.
  class(base_object_constructor), intent(in)    :: constructor !< Smoothness indicators constructor.

  call self%destroy
  select type(constructor)
  class is(smoothness_indicators_constructor)
    allocate(self%si(1:2, 0:constructor%S - 1))
  class default
    ! @TODO add error handling
  endselect
  self%si = 0._R_P
  endsubroutine create

  elemental subroutine destroy(self)
  !< Destroy smoothness indicators.
  class(smoothness_indicators), intent(inout) :: self !< Smoothness indicators.

  if (allocated(self%si)) deallocate(self%si)
  endsubroutine destroy
endmodule wenoof_smoothness_indicators