Template Class element_data_mesh_competence_impl
Defined in File data_handler.hxx
Inheritance Relationships
Base Type
public t8_crtp_basic< TUnderlying >(Template Struct t8_crtp_basic)
Class Documentation
-
template<typename TUnderlying, T8MPISafeType TElementDataType>
class element_data_mesh_competence_impl : public t8_crtp_basic<TUnderlying> Handler for the element data of a mesh.
Use this competence if you want to manage element data for the elements of the mesh. Use the helper element_data_mesh_competence to get this competence with the correct template parameters form for the mesh. If you want to access the data not only in vector form but also directly for each element, you can combine this competence with the element_data_element_competence competence. In summary you can use the competences like this: mesh<element_competence_pack<element_data_element_competence>, mesh_competence_pack<element_data_mesh_competence<YourElementDataType>::template type>>; Some predefined competences are also defined in competence_pack.hxx.
- Template Parameters:
TUnderlying – Use the mesh class here.
TElementDataType – The element data type you want to use for each element of the mesh. The data type has to be MPI safe as the data for ghost elements will be exchanged via MPI.
Public Types
-
using ElementDataType = TElementDataType
Make Type of the element data publicly accessible.
Public Functions
-
inline void set_element_data(std::vector<TElementDataType> element_data)
Set the element data vector.
The vector should have the length of num_local_elements.
- Parameters:
element_data – [in] The element data vector to set with one entry of class TElementDataType for each local mesh element (excluding ghosts). The vector is moved, not copied.
-
inline const std::vector<TElementDataType> &get_element_data() const
Get the element data vector.
The element data of the local mesh elements can be set using set_element_data. If ghost entries should be filled, one should call exchange_ghost_data on each process first.
- Returns:
Element data vector with data of Type TElementDataType.
-
inline void exchange_ghost_data()
Exchange the element data for ghost elements between processes.
This routine has to be called on each process after setting the element data for all local elements.
Protected Attributes
-
std::vector<TElementDataType> m_element_data
Vector storing the (local) element data.