Skip to main content

GetNNE

The GetNNE method returns the number of nodes in a specific element of the mesh. This is useful for determining the size of arrays needed for element-based operations.

Interface

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

Syntax

numNodes = mesh%GetNNE(globalElement, [islocal])

Parameters

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

Return Value

TypeDescription
INTEGER(I4B)Number of nodes in the element

Description

GetNNE returns the number of nodes in a specified element. This is an important property as different element types and orders have different numbers of nodes. The method can be used to allocate arrays of appropriate size for element-based operations.

Example Usage

TYPE(Mesh_) :: mesh
INTEGER(I4B) :: elemNum, numNodes
REAL(DFP), ALLOCATABLE :: nodalValues(:)

! Initialize mesh, elemNum...

! Get the number of nodes in the element
numNodes = mesh%GetNNE(elemNum)

! Allocate an array for nodal values
ALLOCATE (nodalValues(numNodes))

! Use the array for element operations