9#ifndef INCGdf4311acf6554f11919b7b1edfc5b3dd
10#define INCGdf4311acf6554f11919b7b1edfc5b3dd
12#include <lf/mesh/mesh.h>
14#include <boost/container/vector.hpp>
17#include "lf/base/lf_assert.h"
18#include "mesh_data_set.h"
47 [[nodiscard]] T& operator()(const
Entity& e) {
48 LF_ASSERT_MSG(
DefinedOn(e),
"MeshDataSet is not defined on this entity.");
53 LF_ASSERT_MSG(
DefinedOn(e),
"MeshDataSet is not defined on this entity.");
57 return mesh_->Contains(e);
68 const std::shared_ptr<const lf::mesh::Mesh>& mesh)
74 data_[codim].resize(
mesh_->NumEntities(codim));
87 class =
typename std::enable_if_t<std::is_convertible_v<X, T> &&
88 std::is_copy_constructible_v<X>>>
97 boost::container::vector<T>(
mesh_->NumEntities(codim), init_value);
103 std::shared_ptr<const lf::mesh::Mesh>
mesh_;
108 boost::container::vector<boost::container::vector<T>>
data_;
120 const std::shared_ptr<const lf::mesh::Mesh>& mesh) {
123 return std::shared_ptr<impl_t>(t);
133template <std::copy_constructible T>
135 const std::shared_ptr<const lf::mesh::Mesh>& mesh, T init_value) {
137 return std::make_shared<impl_t>(mesh, init_value);
Interface class representing a topological entity in a cellular complex
virtual unsigned Codim() const =0
The codimension of this entity w.r.t. the Mesh.dimMesh() of the owning mesh manager.
lf::base::size_type size_type
Assigns to every entity(all codims) in a mesh a value of type T
const T & operator()(const Entity &e) const override
Get the data stored with entity e.
Mesh::size_type size_type
bool DefinedOn(const Entity &e) const override
Does the dataset store information with this entity?
AllCodimMeshDataSet(const std::shared_ptr< const lf::mesh::Mesh > &mesh)
set up default-initialized data arrays
boost::container::vector< boost::container::vector< T > > data_
std::shared_ptr< const lf::mesh::Mesh > mesh_
AllCodimMeshDataSet(AllCodimMeshDataSet &&) noexcept=default
AllCodimMeshDataSet(const AllCodimMeshDataSet &)=delete
AllCodimMeshDataSet(const std::shared_ptr< const lf::mesh::Mesh > &mesh, X init_value)
Set up data array for entities and initialize it with a given value.
Interface that specifies how data is stored with an entity.
Contains helper functions and classes that all operate on the interface classes defined in lf::mesh.
std::shared_ptr< AllCodimMeshDataSet< T > > make_AllCodimMeshDataSet(const std::shared_ptr< const lf::mesh::Mesh > &mesh)
Create a new AllCodimMeshDataSet and Default initialize the data.