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"
56 [[nodiscard]] T& operator()(const
Entity& e) {
57 LF_ASSERT_MSG(
DefinedOn(e),
"MeshDataSet is not defined on this entity.");
62 LF_ASSERT_MSG(
DefinedOn(e),
"MeshDataSet is not defined on this entity.");
66 return mesh_->Contains(e);
77 const std::shared_ptr<const lf::mesh::Mesh>&
mesh)
83 data_[codim].resize(
mesh_->NumEntities(codim));
96 class =
typename std::enable_if_t<std::is_convertible_v<X, T> &&
97 std::is_copy_constructible_v<X>>>
106 boost::container::vector<T>(
mesh_->NumEntities(codim), init_value);
112 std::shared_ptr<const lf::mesh::Mesh>
mesh_;
117 boost::container::vector<boost::container::vector<T>>
data_;
129 const std::shared_ptr<const lf::mesh::Mesh>&
mesh) {
132 return std::shared_ptr<impl_t>(t);
142template <std::copy_constructible T>
144 const std::shared_ptr<const lf::mesh::Mesh>&
mesh, T init_value) {
146 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.
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.
Defines a set of interface classes that define a mesh manager and provides mesh-related tools that bu...