sBase_applyBCtoDOF_STRONG Subroutine

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


Source Code

SUBROUTINE sBase_applyBCtoDOF_STRONG(sf ,DOFs,BC_Type,BC_val)
! MODULES
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
! INPUT VARIABLES
  CLASS(t_sbase), INTENT(IN   ) :: sf    !! self
  INTEGER       , INTENT(IN   ) :: BC_Type(2)           !! bc type on axis (1) and edge (2)
  REAL(wp)      , INTENT(IN   ) :: BC_Val(2)           !! for dirichlet BC : value
!-----------------------------------------------------------------------------------------------------------------------------------
! OUTPUT VARIABLES
  REAL(wp)      , INTENT(INOUT) :: DOFs(1:sf%nBase)  !! DOFs with boundary conditions applied
!-----------------------------------------------------------------------------------------------------------------------------------
! LOCAL VARIABLES
REAL(wp):: raxis(1:sf%deg+1),redge(sf%nBase-sf%deg:sf%nbase)
!===================================================================================================================================
  ASSOCIATE( tBCaxis => BC_TYPE(BC_AXIS)             &
            ,tBCedge => BC_TYPE(BC_EDGE)             &
            ,nDaxis  => sf%nDOF_BC(BC_Type(BC_AXIS)) & !number of dofs involved in BC axis
            ,nDedge  => sf%nDOF_BC(BC_Type(BC_EDGE)) & !number of dofs involved in BC edge
            ,nB      => sf%nBase                     &
            ,deg     => sf%deg                       )
  SELECT CASE(tBCaxis)
  CASE(BC_TYPE_OPEN)
    !do noting
  CASE(BC_TYPE_DIRICHLET)
    DOFs(1)=BC_Val(BC_AXIS)
  CASE DEFAULT !BC_TYPE_SYMM,BC_TYPE_SYMMZERO,BC_TYPE_ANTISYMM
    raxis(1:nDaxis)      =0.0_wp
    raxis(nDaxis+1:deg+1)= DOFs(nDaxis+1:deg+1)
    DOFs(1:deg+1)= MATMUL(sf%invA_axis(:,:,tBCaxis),raxis(:))
  END SELECT !tBCaxis

  SELECT CASE(tBCedge)
  CASE(BC_TYPE_OPEN)
    !do noting
  CASE(BC_TYPE_DIRICHLET)
    DOFs(nB)=BC_Val(BC_EDGE)
  CASE DEFAULT !BC_TYPE_SYMM,BC_TYPE_SYMMZERO,BC_TYPE_ANTISYMM
    redge(nB-deg:nB-nDedge) = DOFs(nB-deg:nB-nDedge)
    redge(nB-nDedge+1:nB)   = 0.0_wp
    DOFs(nB-deg:nB)=MATMUL(sf%invA_edge(:,:,tBCedge),redge(:))
  END SELECT !tBCedge
  END ASSOCIATE

END SUBROUTINE sbase_applyBCtoDOF_STRONG