SetAbstractBCParam
Set the parameter for initiating the AbstractBC_
.
Interface
- ܀ Interface
- ܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE SetAbstractBCParam(param, prefix, &
& name, idof, nodalValueType, isNormal, isTangent, &
& useExternal, isUserFunction)
TYPE(ParameterList_), INTENT(INOUT) :: param
CHARACTER(*), INTENT(IN) :: prefix
CHARACTER(*), OPTIONAL, INTENT(IN) :: name
!! name of boundary condition
!! default is AbstractBC
INTEGER(I4B), OPTIONAL, INTENT(IN) :: idof
!! degree of freedom number
!! default is 0
INTEGER(I4B), OPTIONAL, INTENT(IN) :: nodalValueType
!! Space, Time, SpaceTime, Constant
!! default is -1
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: isUserFunction
!! set true when userfucntion is used; default is false
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: isNormal
!! default is false
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: isTangent
!! default is false
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: useExternal
!! default is false
END SUBROUTINE SetAbstractBCParam
END INTERFACE
prefix
You can get prefix
by calling GetPrefix method.
idof
Degree of freedom number.
nodalValueType
Type of boundary condition. It can take following values:
Constant
=> It means boundary condition is constant in space and timeSpace
=> It means boundary condition changes in space direction, but constant in time directionTime
=> It means boundary condition changes in time direction, but constant in space directionSpaceTime
=> It means boundary condition changes in both space and time directions
isUserFunction
If the boundary condition is specified through UserFunction, then it isUserFunction
should be set to .TRUE.
.
isNormal
In vector variable problem when the normal component is given, then you can set isNormal
to .TRUE.
isTangent
In vector variable problem when the tangent component is given, then you can set isTangent
to .TRUE.
useExternal
When the boundary condition is stored outside the AbstractBC_
.
Initiate an instance of DirichletBC
.
!> author: Vikas Sharma, Ph. D.
! date: 2023-11-27
! summary: Initiate an instance of DirichletBC
!
!# Introduction
!
! Initiate an instance of DirichletBC for
! Constant boundary condition
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE(DirichletBC_) :: obj
TYPE(MeshSelection_) :: boundary
TYPE(ParameterList_) :: param
TYPE(Domain_) :: dom
TYPE(HDF5File_) :: domainfile
CHARACTER(*), PARAMETER :: domainfilename = "./mesh3D.h5"
INTEGER(I4B) :: bottom = 1, top = 2, left = 3, right = 4, &
& front = 5, behind = 6, nsd
INTEGER(I4B), ALLOCATABLE :: nodeNum(:)
REAL(DFP), ALLOCATABLE :: nodalValue(:, :)
CALL FPL_Init; CALL param%Initiate()
CALL domainfile%Initiate(filename=domainfilename, mode="READ")
CALL domainfile%OPEN()
CALL dom%Initiate(domainfile, group="")
nsd = dom%GetNSD()
! We call Set SetAbstractBCParam to set the parameter for boundary condition
CALL SetAbstractBCParam(param=param, prefix=obj%GetPrefix(), &
& name="ZeroBC", idof=1, nodalValueType=Constant)
! We call SetMeshSelectionParam to set the parameter for boundary condition
CALL SetMeshSelectionParam(param=param, prefix=boundary%GetPrefix(), &
& isSelectionByMeshID=.TRUE.)
CALL boundary%Initiate(param)
CALL boundary%Add(dom=dom, dim=nsd - 1, meshID=[top])
CALL boundary%Set()
CALL boundary%Display("boundary")
CALL obj%Initiate(param=param, boundary=boundary, dom=dom)
CALL obj%Set(constantNodalValue=0.0_DFP)
CALL obj%Display("dbc"//CHAR_LF)
CALL obj%Get(nodeNum=nodeNum, nodalValue=nodalValue)
CALL Display(nodeNum, "nodeNum", advance="NO")
CALL Display(nodalValue, "nodalValue", advance="YES")
CALL domainfile%DEALLOCATE()
CALL dom%DEALLOCATE()
CALL param%DEALLOCATE(); CALL FPL_Finalize
END PROGRAM main