23#ifndef VCL_MESH_COMPONENTS_MATERIAL_INDEX_H
24#define VCL_MESH_COMPONENTS_MATERIAL_INDEX_H
26#include "base/component.h"
27#include "base/predicates.h"
31template<
typename ParentElemType =
void,
bool OPT = false>
34 MaterialIndex<ParentElemType, OPT>,
35 CompId::MATERIAL_INDEX,
38 !std::is_same_v<ParentElemType, void>,
41 using Base = Component<
43 CompId::MATERIAL_INDEX,
46 !std::is_same_v<ParentElemType, void>,
57 if constexpr (!Base::IS_VERTICAL) {
108 template<
typename Element>
111 void serialize(std::ostream&
os)
const
116 void deserialize(std::istream& is)
161template<
typename ParentElemType,
bool OPT>
162template<
typename Element>
166 if (isMaterialIndexAvailableOn(e)) {
167 materialIndex() = e.materialIndex();
185bool isMaterialIndexAvailableOn(
const auto& element)
A class representing a box in N-dimensional space.
Definition box.h:46
The Element class.
Definition element.h:75
Definition material_index.h:40
void importFrom(const Element &e, bool=true)
Returns a reference to the material index.
Definition material_index.h:163
void init()
Initializes the material index to UINT_NULL.
Definition material_index.h:72
MaterialIndex()
Constructor that initializes the material index to UINT_NULL.
Definition material_index.h:55
uint & materialIndex()
Returns a reference to the material index.
Definition material_index.h:80
uint materialIndex() const
Returns the value of the material index.
Definition material_index.h:86
A concept that checks whether a type T (that should be a Element or a Mesh) has the MaterialIndex com...
Definition material_index.h:142
A concept that checks whether a type T (that should be a Element or a Mesh) has the MaterialIndex com...
Definition material_index.h:155
Evaluates to true if the type T is a component that is stored vertically in its element container,...
Definition component.h:74
constexpr uint UINT_NULL
The UINT_NULL value represent a null value of uint that is the maximum value that can be represented ...
Definition base.h:48