ElementIDInterface

Extra integer IDs for all the elements of a mesh can be useful for handling complicated material assignment, performing specific calculations on groups of elements, etc. Often times, we do not want to use subdomain IDs for these tasks because subdomains are used by MOOSE for block-restricted operations. Many subdomains could introduce large penalty on run-time performance. Extra element IDs are identified with extra element ID names. Extra element IDs are part of the mesh and can be recovered during the mesh recovery. Please refer to MeshGenerator for how the extra element integer IDs are generated or imported.

The ElementIDInterface is designed for using extra element IDs in the mesh by MOOSE objects such as materials, user objects, aux kernels, DG kernels, interface kernels, IC (initial conditions), kernels, etc. The following table summarizes the interface functions provided by this interface:

MethodDescription
getElementIDIndexGets index of an element integer with an input parameter of the integer names
getElementIDIndexByNameGets index of an element integer with its name
getElementIDGets the constant reference of an element integer of the current element with an input parameter
getElementIDNeighborGets the constant reference of an element integer of the neighbor element with an input parameter
getElementIDByNameGets the constant reference of an element integer of the current element with the integer name
getElementIDNeighborByNameGets the constant reference of an element integer of the neighbor element with the integer name
hasElementIDWhether mesh has an element integer with a given name
maxElementIDGets the maximum element ID for an element integer with its index
minElementIDGets the minimum element ID for an element integer with its index
areElemIDsIdenticalWhether two element integers are identical for all elements
getAllElemIDsGets all the unique element IDs for an element integer with its index on the entire domain
getElemIDsOnBlocksGets all the unique element IDs for an extra element integer with its index on a set of subdomains
getElementIDGets an element integer for an element
getElemIDMappingGet the mapping from IDs of one extra element integer to another given the two integer names

Because MOOSE creates three copies of materials for the current element, element face and neighboring element face (Material), getElementID and getElementIDByName return the reference to either the current element ID or the neighbor element ID based on whether the current copy of material is for neighboring element or not. Correspondingly, directly calling getElementIDNeighbor and getElementIDNeighborByName is not allowed in Material.

It is noted that the element integer name subdomain_id is reserved by MOOSE for accessing subdomain IDs with this interface.