Skip to main content

GetBoundaryElementData

Inheritence

This method is inherited from the AbstractMesh class.

GetBoundaryElementData

Returns boundary element data for a given element.

Interface

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

Description

This function returns the boundary element data for a specified element. If the element is a boundary element, the function returns the local facet numbers that coincide with the mesh boundary. If the element is not a boundary element, an array of zero size is returned.

Arguments

  • obj: The abstract mesh object.
  • globalElement: The global (or local) element number.
  • islocal: If present and true, globalElement is treated as a local element number.

Returns

  • ans: An array containing the local facet numbers that are on the boundary. If the element is not a boundary element, an array of size zero is returned.

Example

INTEGER(I4B), ALLOCATABLE :: boundaryFacets(:)
INTEGER(I4B) :: elemNum = 15

boundaryFacets = mesh%GetBoundaryElementData(elemNum)

IF (SIZE(boundaryFacets) > 0) THEN
PRINT*, "Element has boundary facets:", boundaryFacets
ELSE
PRINT*, "Element is not on the boundary"
END IF

Examples

Example 1

This example shows how to get the boundary data in the mesh.

PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Mesh_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
INTEGER( I4B ), ALLOCATABLE :: nptrs( : )

! Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh.

CALL meshfile%Initiate( FileName="./mesh.h5", MODE="READ" )
CALL meshfile%Open()
CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" )

! Now we get the boundary element data.
! Element number 515 is a boundary element, and one of its face concides
! with the mesh boundary.

CALL Display( obj%getConnectivity( 515 ), "cellNptrs=" )
nptrs = obj%GetBoundaryElementData( globalElement=515 )
CALL Display( nptrs, "Boundary element data for 515=")

! Now we get the boundary element data.
! Element number 316 is a boundary element, and one of its face concides with the mesh boundary.

CALL Display( obj%getConnectivity( 316 ), "cellNptrs=" )
nptrs = obj%GetBoundaryElementData( globalElement=316 )
CALL Display( nptrs, "Boundary element data for 316=")

CALL obj%Deallocate()
CALL meshfile%Close()
CALL meshfile%Deallocate()
END PROGRAM main