apply boundary conditions at axis and edge, via solving the Lagrange multiplier problem: x_new=x_old & A*x_new = d
| 0 A | |lambda| | d | | | | | = | | | A^T I | | xnew | | xold |
| Type | Intent | Optional | 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 |
SUBROUTINE sBase_applyBCtoDOF_LGM(sf ,DOFs,BC_Type,BC_val) ! MODULES USE MODgvec_linalg, ONLY: SOLVE 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):: r(0:sf%deg) !=================================================================================================================================== 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,m-dependent r(:) = DOFs(1:deg+1) r(:) = MATMUL(sf%R_axis(:,:,tBCaxis),r(:)) DOFs(1:deg+1)= SOLVE(sf%AR_axis(:,:,tBCaxis),r(:)) 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 r(:) = DOFs(nB-deg:nB) r(:) = MATMUL(sf%R_edge(:,:,tBCedge),r(:)) DOFs(nB-deg:nB)= SOLVE(sf%AR_edge(:,:,tBCedge),r(:)) END SELECT !tBCedge END ASSOCIATE END SUBROUTINE sbase_applyBCtoDOF_LGM