Skip to main content

GetMaxNodeToElements

Retrieves the maximum number of elements connected to any node in the mesh.

Interface​

MODULE FUNCTION GetMaxNodeToElements(obj) RESULT(ans)
CLASS(AbstractMesh_), INTENT(INOUT) :: obj
INTEGER(I4B) :: ans
END FUNCTION GetMaxNodeToElements

Arguments​

  • obj (AbstractMesh_, input/output): The mesh object. May be modified if node-to-elements mapping needs to be initiated.

Returns​

  • ans (INTEGER): The maximum number of elements connected to any node in the mesh.

Description​

This function returns the maximum number of elements connected to any node in the mesh. If the node-to-elements mapping has not been initiated, it will be initiated first.

This information is useful for pre-allocating arrays when working with node-to-element relationships.

Example​

INTEGER(I4B) :: maxElements
maxElements = mesh%GetMaxNodeToElements()
! Now maxElements contains the maximum number of elements connected to any node