Skip to main content

IsBoundaryElement

Inheritence

This method is inherited from the AbstractMesh class.

IsBoundaryElement

The IsBoundaryElement method checks if a specific element is a boundary element in the mesh.

Interface

INTERFACE
MODULE FUNCTION isBoundaryElement(obj, globalElement, islocal) &
& RESULT(ans)
CLASS(AbstractMesh_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: globalElement
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: islocal
LOGICAL(LGT) :: ans
END FUNCTION isBoundaryElement
END INTERFACE

Syntax

RESULT = mesh%IsBoundaryElement(globalElement, [islocal])

Parameters

ParameterTypeIntentDescription
objCLASS(AbstractMesh_)INThe mesh object
globalElementINTEGER(I4B)INGlobal or local element number to check
islocalLOGICAL(LGT)IN (optional)If true, globalElement is treated as a local element number

Return Value

TypeDescription
LOGICAL(LGT)True if the element is a boundary element

Description

IsBoundaryElement determines whether a specified element is a boundary element in the mesh. A boundary element is an element that has at least one face (in 3D) or edge (in 2D) on the boundary of the domain, or equivalently, an element that contains at least one boundary node.

Implementation Details

The method:

  1. Converts the global element number to a local element number if necessary
  2. Checks the boundary status from the element data

Example Usage

TYPE(Mesh_) :: mesh
INTEGER(I4B) :: elemNum
LOGICAL(LGT) :: isBoundary

! Initialize mesh, elemNum...

! Check if an element is on the boundary
isBoundary = mesh%IsBoundaryElement(elemNum)

IF (isBoundary) THEN
PRINT *, "Element", elemNum, "is on the boundary"
ELSE
PRINT *, "Element", elemNum, "is an internal element"
END IF