GetConnectivity_
Interface
MODULE SUBROUTINE obj_GetConnectivity_(obj, ans, tsize, opt, globalElement, islocal)
CLASS(FEDOF_), INTENT(INOUT) :: obj
!! FEDOF object
INTEGER(I4B), INTENT(INOUT) :: ans(:)
!! connectivity of element
INTEGER(I4B), INTENT(OUT) :: tsize
!! total size of data written in con
CHARACTER(*), INTENT(IN) :: opt
!! opt = Vertex
!! opt = Edge
!! opt = Face
!! opt = Cell
!! opt = All
INTEGER(I4B), INTENT(IN) :: globalElement
!! Global element number
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: islocal
!! if islocal true then globalElement is local element number
END SUBROUTINE obj_GetConnectivity_
Description
The GetConnectivity_ method retrieves the connectivity (degrees of freedom) of a specified element and writes it into a provided array. This method allows for filtering the types of entities (vertices, edges, faces, cells) to include in the connectivity.
Parameters
obj- Input/Output,CLASS(FEDOF_), FEDOF object instanceans- Output,INTEGER(I4B)(:), pre-allocated array to store the connectivity informationtsize- Output,INTEGER(I4B), total size of data written to theansarrayopt- Input,CHARACTER(*), option specifying which entities to include:"Vertex"- Include only vertex DOFs"Edge"- Include only edge DOFs"Face"- Include only face DOFs"Cell"- Include only cell DOFs"All"- Include all DOFs (default)
globalElement- Input,INTEGER(I4B), global or local element numberislocal- Optional Input,LOGICAL(LGT), if true,globalElementis treated as a local element number
Implementation Details
The implementation follows these steps:
- Converts the global element number to a local element number if needed
- Gets the total entities (vertices, edges, faces, cells) for the element
- Retrieves the connectivity from the mesh for the specified element
- Processes each entity type (vertices, edges, faces, cells) and adds their DOFs to the
ansarray - Updates
tsizewith the total number of DOFs added
localElement = obj%mesh%GetLocalElemNumber(globalElement=globalElement, islocal=islocal)
ent = obj%mesh%GetTotalEntities(globalElement=localElement, islocal=yes)
CALL obj%mesh%GetConnectivity_(globalElement=localElement, islocal=yes, opt=opt, tsize=jj, ans=temp)
! Process vertices, edges, faces, and cells...
! For each entity, call the appropriate GetXXXDOF method and add to ans array
tsize = jj - 1
Usage Example
! Example to get connectivity for an element
INTEGER(I4B) :: conn(100), totalSize
TYPE(FEDOF_) :: myDOF
! Get all DOFs for element #5
CALL myDOF%GetConnectivity_(ans=conn, tsize=totalSize, opt="All", globalElement=5)
! Get only vertex DOFs for element #8
CALL myDOF%GetConnectivity_(ans=conn, tsize=totalSize, opt="Vertex", globalElement=8)
! Get only edge DOFs for element #3, using local numbering
CALL myDOF%GetConnectivity_(ans=conn, tsize=totalSize, opt="Edge", globalElement=3, islocal=.TRUE.)
Important Notes
- The
ansarray must be pre-allocated with sufficient size to hold all the requested DOFs - The
tsizereturn value indicates how many values were actually written toans - This method is often used internally by the functional variant
GetConnectivity
Related Methods
GetConnectivity- Function version that allocates and returns the connectivity arrayGetVertexDOF,GetEdgeDOF,GetFaceDOF,GetCellDOF- Methods for retrieving specific entity DOFsGetTotalDOF- Used to determine the required size for connectivity arrays
The GetConnectivity_ method provides a lower-level interface for retrieving connectivity information, offering more control over memory allocation compared to the functional GetConnectivity method.