FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
mesh_part.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8// includes, FEAT
9#include <kernel/geometry/factory.hpp>
10#include <kernel/geometry/conformal_mesh.hpp>
11#include <kernel/geometry/structured_mesh.hpp>
12#include <kernel/geometry/index_calculator.hpp>
13#include <kernel/geometry/attribute_set.hpp>
14#include <kernel/geometry/intern/simple_target_refiner.hpp>
15#include <kernel/geometry/intern/standard_target_refiner.hpp>
16#include <kernel/geometry/intern/structured_target_refiner.hpp>
17#include <kernel/geometry/intern/standard_attrib_refiner.hpp>
18#include <kernel/geometry/intern/standard_index_refiner.hpp>
19#include <kernel/geometry/intern/standard_vertex_refiner.hpp>
20#include <kernel/geometry/intern/index_set_filler.hpp>
21#include <kernel/geometry/intern/target_set_computer.hpp>
22
23// includes, system
24#include <map>
25#include <array>
26#include <memory>
27
28namespace FEAT
29{
30 namespace Geometry
31 {
88 template<typename MeshType_>
90 {
91 public:
93 typedef MeshType_ MeshType;
95 typedef typename MeshType::ShapeType ShapeType;
97 typedef typename MeshType::IndexSetHolderType ParentIndexSetHolderType;
99 typedef IndexSetHolder<ShapeType> IndexSetHolderType;
101 typedef TargetSetHolder<ShapeType> TargetSetHolderType;
103 static constexpr int shape_dim = ShapeType::dimension;
104
114 template<int cell_dim_, int face_dim_>
115 struct IndexSet
116 {
117 static_assert(cell_dim_ <= shape_dim, "invalid cell dimension");
118 static_assert(face_dim_ < cell_dim_, "invalid face/cell dimension");
119 static_assert(face_dim_ >= 0, "invalid face dimension");
120
123 <
125 <
127 face_dim_
128 >::count
130 }; // struct IndexSet<...>
131
133 typedef typename MeshType::VertexSetType::CoordType AttributeDataType;
136
138 typedef std::map<String, std::unique_ptr<AttributeSetType>> AttributeSetContainer;
140 typedef typename AttributeSetContainer::iterator AttributeSetIterator;
142 typedef typename AttributeSetContainer::const_iterator AttributeSetConstIterator;
144 typedef typename AttributeSetContainer::reverse_iterator AttributeSetReverseIterator;
145
155 template<int cell_dim_>
157 {
160 }; // struct TargetSet<...>
161
162 protected:
164 std::array<Index, shape_dim + 1> _num_entities;
166 std::unique_ptr<IndexSetHolderType> _index_set_holder;
171
172 public:
183 explicit MeshPart(const Index num_entities[], bool create_topology = false) :
185 _target_set_holder(num_entities),
187 {
188 for(std::size_t i(0); i <= shape_dim; ++i)
189 _num_entities[i] = num_entities[i];
190
191 if(create_topology)
192 _index_set_holder.reset(new IndexSetHolderType(num_entities));
193 }
194
201 explicit MeshPart(Factory<MeshPart>& factory) :
203 _target_set_holder(Intern::NumEntitiesWrapper<shape_dim>(factory).num_entities),
205 {
206 // Compute entity counts
207 Intern::NumEntitiesWrapper<shape_dim>::apply(factory, _num_entities);
208
209 // Fill target sets
210 factory.fill_target_sets(_target_set_holder);
211
212 // Fill index sets
213 factory.fill_index_sets(_index_set_holder);
214
215 // Fill attribute sets
216 factory.fill_attribute_sets(_mesh_attributes);
217 }
218
220 MeshPart(MeshPart&& other) = default;
221
224
226 MeshPart(const MeshPart& other) = delete;
227
229 MeshPart& operator=(const MeshPart&) = delete;
230
232 virtual ~MeshPart()
233 {
234 // unique_ptr takes care of everything
235 }
236
243 void clone(const MeshPart& other)
244 {
245 this->_num_entities = other._num_entities;
246
247 if(other._index_set_holder)
248 {
249 if(this->_index_set_holder)
250 this->_index_set_holder->clone(*other._index_set_holder);
251 else
252 this->_index_set_holder.reset(new IndexSetHolderType(other._index_set_holder->clone()));
253 }
254 else if(this->_index_set_holder)
255 {
256 this->_index_set_holder.reset();
257 }
258
259 this->_target_set_holder.clone(other._target_set_holder);
260
261 this->_mesh_attributes.clear();
262
263 for(auto it = other._mesh_attributes.begin(); it != other._mesh_attributes.end(); ++it)
264 this->add_attribute(std::unique_ptr<AttributeSetType>(new AttributeSetType(it->second->clone())), it->first);
265 }
266
269 {
270 MeshPart mp(this->_num_entities.data(), this->_index_set_holder.get() != nullptr);
271 if(this->_index_set_holder)
272 mp._index_set_holder->clone(*this->_index_set_holder);
273 mp._target_set_holder.clone(this->_target_set_holder);
274 for(auto it = this->_mesh_attributes.begin(); it != this->_mesh_attributes.end(); ++it)
275 mp.add_attribute(std::unique_ptr<AttributeSetType>(new AttributeSetType(it->second->clone())), it->first);
276 return mp;
277 }
278
280 std::size_t bytes() const
281 {
282 std::size_t my_bytes(0);
283
284 for(const auto& it : _mesh_attributes)
285 {
286 if(it.second != nullptr)
287 my_bytes += it.second->bytes();
288 }
289
290 my_bytes += _target_set_holder.bytes();
291 my_bytes += (_index_set_holder ? _index_set_holder->bytes() : std::size_t(0));
292
293 return my_bytes;
294 }
295
297 bool has_topology() const
298 {
299 return _index_set_holder.operator bool();
300 }
301
311 Index get_num_entities(int dim) const
312 {
313 XASSERT(dim >= 0);
314 XASSERT(dim <= shape_dim);
315 return _num_entities[std::size_t(dim)];
316 }
317
329 {
330 AttributeSetIterator it(_mesh_attributes.find(identifier));
331 return (it != _mesh_attributes.end()) ? (*it).second.get() : nullptr;
332 }
333
335 const AttributeSetType* find_attribute(const String& identifier) const
336 {
337 AttributeSetConstIterator it(_mesh_attributes.find(identifier));
338 return (it != _mesh_attributes.end()) ? (*it).second.get(): nullptr;
339 }
340
347 {
348 return _mesh_attributes;
349 }
350
357 {
358 return int(_mesh_attributes.size());
359 }
360
374 virtual bool add_attribute(std::unique_ptr<AttributeSetType> attribute, const String& identifier)
375 {
376 XASSERTM(bool(attribute), "cannot add empty attribute set");
377 // note: unique_ptr needs to be moved here, otherwise emplace tries to copy instead
378 return _mesh_attributes.emplace(identifier, std::move(attribute)).second;
379 }
380
393 template<int cell_dim_, int face_dim_>
395 {
396 XASSERTM(has_topology(), "Requested index_set of MeshPart without topology!");
397 return _index_set_holder->template get_index_set_wrapper<cell_dim_>().template get_index_set<face_dim_>();
398 }
399
401 template<int cell_dim_, int face_dim_>
403 {
404 XASSERTM(has_topology(), "Requested index_set of MeshPart without topology!");
405 return _index_set_holder->template get_index_set_wrapper<cell_dim_>().template get_index_set<face_dim_>();
406 }
407
409
411 IndexSetHolderType* get_topology()
412 {
413 return _index_set_holder.get();
414 }
415
417 const IndexSetHolderType* get_topology() const
418 {
419 return _index_set_holder.get();
420 }
422
432 template<int cell_dim_>
434 {
435 static_assert(cell_dim_ >= 0, "invalid cell dimension");
436 static_assert(cell_dim_ <= shape_dim, "invalid cell dimension");
437 return _target_set_holder.template get_target_set<cell_dim_>();
438 }
439
441 template<int cell_dim_>
443 {
444 static_assert(cell_dim_ >= 0, "invalid cell dimension");
445 static_assert(cell_dim_ <= shape_dim, "invalid cell dimension");
446 return _target_set_holder.template get_target_set<cell_dim_>();
447 }
448
454 TargetSetHolderType& get_target_set_holder()
455 {
456 return _target_set_holder;
457 }
458
460 const TargetSetHolderType& get_target_set_holder() const
461 {
462 return _target_set_holder;
463 }
465
472 static String name()
473 {
474 return "MeshPart<...>";
475 }
476
483 void permute(const MeshPermutation<ShapeType>& mesh_perm)
484 {
485 this->_target_set_holder.permute_map(mesh_perm.get_inv_perms());
486 }
487
503 template<int end_dim_, int current_dim_ = ShapeType::dimension>
505 {
506 Intern::template TargetSetComputer<end_dim_, current_dim_>::bottom_to_top(_target_set_holder, parent_ish);
507
508 // Update num_entities information from the possibly modified _target_set_holder
509 for(int i(end_dim_); i <= current_dim_; ++i)
510 _num_entities[std::size_t(i)] = _target_set_holder.get_num_entities(i);
511 }
512
528 template<int end_dim_, int current_dim_ = 0>
530 {
531 Intern::template TargetSetComputer<end_dim_, current_dim_>::top_to_bottom(_target_set_holder, parent_ish);
532
533 // Update num_entities information from the possibly modified _target_set_holder
534 for(int i(current_dim_); i <= end_dim_; ++i)
535 _num_entities[std::size_t(i)] = _target_set_holder.get_num_entities(i);
536 }
537
548 {
549 if(_index_set_holder == nullptr)
551
552 Intern::IndexSetFiller<ShapeType::dimension>::fill_ish(
554
555 // build redundant index sets
557 }
558 }; // class MeshPart<ConformalMesh<Shape_>>
559
565 template<typename MeshType_>
566 class Factory< MeshPart<MeshType_> >
567 {
568 public:
570 typedef typename MeshType_::ShapeType ShapeType;
574 typedef typename MeshType_::VertexSetType::CoordType AttributeDataType;
581
582 public:
584 virtual ~Factory()
585 {
586 }
587
597 virtual Index get_num_entities(int dim) = 0;
598
605 virtual void fill_attribute_sets(AttributeSetContainer& attribute_set_holder) = 0;
606
613 virtual void fill_index_sets(std::unique_ptr<IndexSetHolderType>& index_set_holder) = 0;
614
621 virtual void fill_target_sets(TargetSetHolderType& target_set_holder) = 0;
622
629 {
630 return MeshPartType(*this);
631 }
632
638 std::unique_ptr<MeshPartType> make_unique()
639 {
640 return std::unique_ptr<MeshPartType>(new MeshPartType(*this));
641 }
642 }; // class Factory<MeshPart<...>>
643
645 namespace Intern
646 {
647 template<typename ParentMesh_>
648 struct TargetSetRefineParentWrapper;
649 }
651
658 template<typename ParentMesh_>
659 class StandardRefinery< MeshPart<ParentMesh_> > :
660 public Factory< MeshPart<ParentMesh_> >
661 {
662 public:
675
677 static constexpr int shape_dim = ShapeType::dimension;
678
679 protected:
683 const ParentMesh_* _parent_mesh;
687 Index _num_entities_coarse[shape_dim + 1];
689 Index _num_entities_fine[shape_dim + 1];
690
691 public:
704 explicit StandardRefinery(const MeshType& coarse_meshpart, const ParentMesh_& parent_mesh) :
705 _coarse_meshpart(coarse_meshpart),
706 _parent_mesh(&parent_mesh),
707 _parent_meshpart(nullptr)
708 {
709 // get number of entities in coarse mesh
710 for(int i(0); i <= shape_dim; ++i)
711 {
712 _num_entities_fine[i] = _num_entities_coarse[i] = coarse_meshpart.get_num_entities(i);
713 }
714
715 // calculate number of entities in fine mesh
716 Intern::EntityCountWrapper<Intern::StandardRefinementTraits, ShapeType>::query(_num_entities_fine);
717 }
718
731 explicit StandardRefinery(const MeshType& coarse_meshpart, const MeshPart<ParentMesh_>& parent_meshpart) :
732 _coarse_meshpart(coarse_meshpart),
733 _parent_mesh(nullptr),
734 _parent_meshpart(&parent_meshpart)
735 {
736 // get number of entities in coarse mesh
737 for(int i(0); i <= shape_dim; ++i)
738 {
739 _num_entities_fine[i] = _num_entities_coarse[i] = coarse_meshpart.get_num_entities(i);
740 }
741
742 // calculate number of entities in fine mesh
743 Intern::EntityCountWrapper<Intern::StandardRefinementTraits, ShapeType>::query(_num_entities_fine);
744 }
745
748 {
749 }
750
760 virtual Index get_num_entities(int dim) override
761 {
762 return _num_entities_fine[dim];
763 }
764
771 virtual void fill_attribute_sets(AttributeSetContainer& attribute_container) override
772 {
773 // Attributes of shape dimension 0 only make sense if we have a mesh topology
774 if(!_coarse_meshpart.has_topology())
775 return;
776
777 // Iterate over the attributes in the coarse mesh
778 typename MeshType::AttributeSetConstIterator it(_coarse_meshpart.get_mesh_attributes().begin());
779 typename MeshType::AttributeSetConstIterator jt(_coarse_meshpart.get_mesh_attributes().end());
780
781 for(; it != jt; ++it)
782 {
783 // Create a new empty attribute of the desired size
784 std::unique_ptr<AttributeType> refined_attribute(new AttributeType(
785 get_num_entities(0), it->second->get_dimension()));
786
787 // Refine the attribute in the coarse mesh and write the result to the new attribute
788 Intern::StandardAttribRefineWrapper<ShapeType, AttributeType>
789 ::refine(*refined_attribute, *(it->second), *_coarse_meshpart.get_topology());
790
791 // Add the attribute to the corresponding set
792 XASSERTM(attribute_container.emplace(it->first, std::move(refined_attribute)).second, "Error refining attribute " + it->first);
793 }
794 }
795
802 virtual void fill_index_sets(std::unique_ptr<IndexSetHolderType>& index_set_holder) override
803 {
804 XASSERT(index_set_holder.get() == nullptr);
805
806 // Only create the topology for the refined mesh if the coarse mesh has a topology
807 if(!_coarse_meshpart.has_topology())
808 return;
809
810 index_set_holder.reset(new IndexSetHolderType(_num_entities_fine));
811
812 // refine indices
813 Intern::IndexRefineWrapper<ShapeType>::refine(
814 *index_set_holder, _num_entities_coarse, *_coarse_meshpart.get_topology());
815 }
816
823 virtual void fill_target_sets(TargetSetHolderType& target_set_holder) override
824 {
825 // We have to use a helper class here, because the target set refinement
826 // depends heavily on the underlying mesh type. For this, we first need
827 // to check whether our parent is the root mesh or another mesh-part.
828 if(_parent_mesh != nullptr)
829 {
830 // the parent is the root mesh
831 Intern::TargetSetRefineParentWrapper<ParentMesh_>::fill_target_sets(target_set_holder,
832 _coarse_meshpart.get_target_set_holder(), _coarse_meshpart.get_topology(), *_parent_mesh);
833 }
834 else if(_parent_meshpart != nullptr)
835 {
836 // the parent is a mesh-part
837 Intern::TargetSetRefineParentWrapper<ParentMesh_>::fill_target_sets(target_set_holder,
838 _coarse_meshpart.get_target_set_holder(), _coarse_meshpart.get_topology(), *_parent_meshpart);
839 }
840 else
841 XABORTM("no parent present");
842 }
843
844 }; // class StandardRefinery<MeshPart<...>,...>
845
847 namespace Intern
848 {
852 template<typename Shape_, int num_coords_, typename Coord_>
853 struct TargetSetRefineParentWrapper<ConformalMesh<Shape_, num_coords_, Coord_>>
854 {
855 static constexpr int shape_dim = Shape_::dimension;
856
857 // Note: This functions works for both mesh parents and mesh-part parents.
858 template<typename TargetSetHolderType_, typename IndexSetHolder_, typename Parent_>
859 static void fill_target_sets(
860 TargetSetHolderType_& target_set_holder,
861 const TargetSetHolderType_& coarse_target_set_holder,
862 const IndexSetHolder_* coarse_ish,
863 const Parent_& parent)
864 {
865 // get number of parent entities
866 Index num_entities_parent[shape_dim+1];
867 for(int i(0); i <= shape_dim; ++i)
868 num_entities_parent[i] = parent.get_num_entities(i);
869
870 if(coarse_ish != nullptr)
871 {
872 // The coarse mesh-part has a topology, so refine the target set to match.
873 // The parent must have a topology, too, which is non-trivial if the
874 // parent is a mesh-part itself.
875 const auto* parent_topo = parent.get_topology();
876 XASSERTM(parent_topo != nullptr, "mesh-part has topology, but parent doesn't");
877 Intern::TargetRefineWrapper<Shape_>::refine(target_set_holder,
878 num_entities_parent, coarse_target_set_holder, *coarse_ish, *parent_topo);
879 }
880 else
881 {
882 // The coarse mesh-part does not have a topology, stick to simple refinement
883 Intern::SimpleTargetRefineWrapper<Shape_>::refine(
884 target_set_holder, num_entities_parent, coarse_target_set_holder);
885 }
886 }
887 }; // // struct TargetSetRefineParentWrapper<ConformalMesh<...>>
888
892 template<int shape_dim_, int num_coords_, typename Coord_>
893 struct TargetSetRefineParentWrapper<StructuredMesh<shape_dim_, num_coords_, Coord_>>
894 {
895 typedef Shape::Hypercube<shape_dim_> ShapeType;
896
897 template<typename TargetSetHolderType_, typename IndexSetHolder_>
898 static void fill_target_sets(
899 TargetSetHolderType_& target_set_holder,
900 const TargetSetHolderType_& coarse_target_set_holder,
901 const IndexSetHolder_* coarse_ish,
902 const StructuredMesh<shape_dim_, num_coords_, Coord_>& parent)
903 {
904 // get number of coarse/fine parent slices
905 Index num_slices_c[shape_dim_], num_slices_f[shape_dim_];
906 for(int i(0); i < shape_dim_; ++i)
907 {
908 num_slices_c[i] = parent.get_num_slices(i);
909 num_slices_f[i] = Index(2) * num_slices_c[i];
910 }
911
912 if(coarse_ish != nullptr)
913 {
914 XABORTM("TargetSetRefineParentWrapper not implemented");
915 //Intern::TargetRefineWrapper<ShapeType>::refine(
916 //target_set_holder, num_entities_parent, coarse_target_set_holder, *coarse_ish, parent_ish);
917 }
918 else
919 {
920 Intern::StructuredTargetRefineWrapper<shape_dim_>::refine_simple(
921 target_set_holder, coarse_target_set_holder, num_slices_c, num_slices_f);
922 }
923 }
924
925 // Specialization for MeshPart<StructuredMesh<...>>
926 // Note: The topology of a MeshPart is always "conforming" (ie "unstructured"),
927 // therefore the implementation is identical to the class template specialization
928 // for ConformalMesh above.
929 template<typename TargetSetHolderType_, typename IndexSetHolder_>
930 static void fill_target_sets(
931 TargetSetHolderType_& target_set_holder,
932 const TargetSetHolderType_& coarse_target_set_holder,
933 const IndexSetHolder_* coarse_ish,
934 const MeshPart<StructuredMesh<shape_dim_, num_coords_, Coord_>>& parent)
935 {
936 // get number of parent entities
937 Index num_entities_parent[shape_dim_+1];
938 for(int i(0); i <= shape_dim_; ++i)
939 num_entities_parent[i] = parent.get_num_entities(i);
940
941 if(coarse_ish != nullptr)
942 {
943 // The coarse mesh-part has a topology, so refine the target set to match.
944 // The parent must have a topology, too, which is non-trivial if the
945 // parent is a mesh-part itself.
946 const auto* parent_topo = parent.get_topology();
947 XASSERTM(parent_topo != nullptr, "mesh-part has topology, but parent doesn't");
948 Intern::TargetRefineWrapper<ShapeType>::refine(target_set_holder,
949 num_entities_parent, coarse_target_set_holder, *coarse_ish, *parent_topo);
950 }
951 else
952 {
953 // The coarse mesh-part does not have a topology, stick to simple refinement
954 Intern::SimpleTargetRefineWrapper<ShapeType>::refine(
955 target_set_holder, num_entities_parent, coarse_target_set_holder);
956 }
957 }
958 }; // struct TargetSetRefineParentWrapper<StructuredMesh<...>>
959 } // namespace Intern
961
962#ifdef FEAT_EICKT
963 extern template class MeshPart<ConformalMesh<Shape::Simplex<2>, 2, Real>>;
964 extern template class MeshPart<ConformalMesh<Shape::Simplex<3>, 3, Real>>;
965 extern template class MeshPart<ConformalMesh<Shape::Hypercube<2>, 2, Real>>;
966 extern template class MeshPart<ConformalMesh<Shape::Hypercube<3>, 3, Real>>;
967
968 extern template class StandardRefinery<MeshPart<ConformalMesh<Shape::Simplex<2>, 2, Real>>>;
969 extern template class StandardRefinery<MeshPart<ConformalMesh<Shape::Simplex<3>, 3, Real>>>;
970 extern template class StandardRefinery<MeshPart<ConformalMesh<Shape::Hypercube<2>, 2, Real>>>;
971 extern template class StandardRefinery<MeshPart<ConformalMesh<Shape::Hypercube<3>, 3, Real>>>;
972#endif // FEAT_EICKT
973 } // namespace Geometry
974} // namespace FEAT
#define XABORTM(msg)
Abortion macro definition with custom message.
Definition: assertion.hpp:192
#define XASSERT(expr)
Assertion macro definition.
Definition: assertion.hpp:262
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Definition: assertion.hpp:263
Container for saving data related to mesh entities.
MeshPartType make()
Creates a new mesh part and returns it.
Definition: mesh_part.hpp:628
MeshPartType::AttributeSetContainer AttributeSetContainer
Mesh attribute holder type.
Definition: mesh_part.hpp:576
MeshType_::VertexSetType::CoordType AttributeDataType
Data type for attributes.
Definition: mesh_part.hpp:574
MeshPartType::IndexSetHolderType IndexSetHolderType
index set holder type
Definition: mesh_part.hpp:578
std::unique_ptr< MeshPartType > make_unique()
Creates a new mesh part on the heap and returns a unique pointer to it.
Definition: mesh_part.hpp:638
virtual Index get_num_entities(int dim)=0
Returns the number of entities.
MeshPartType::TargetSetHolderType TargetSetHolderType
target set holder type
Definition: mesh_part.hpp:580
virtual void fill_target_sets(TargetSetHolderType &target_set_holder)=0
Fills the target sets.
virtual void fill_attribute_sets(AttributeSetContainer &attribute_set_holder)=0
Fills the attribute sets.
virtual void fill_index_sets(std::unique_ptr< IndexSetHolderType > &index_set_holder)=0
Fills the index sets.
MeshPart< MeshType_ > MeshPartType
Mesh typedef.
Definition: mesh_part.hpp:572
MeshType_::ShapeType ShapeType
The shape type of the mesh.
Definition: mesh_part.hpp:570
Mesh Factory class template.
Definition: factory.hpp:33
Conformal Index-Set class template.
Definition: index_set.hpp:82
Class template for partial meshes.
Definition: mesh_part.hpp:90
AttributeSetContainer::iterator AttributeSetIterator
submesh node iterator type
Definition: mesh_part.hpp:140
MeshPart(MeshPart &&other)=default
move constructor
AttributeSetContainer::reverse_iterator AttributeSetReverseIterator
submesh node reverse-iterator type
Definition: mesh_part.hpp:144
static constexpr int shape_dim
Shape dimension.
Definition: mesh_part.hpp:103
AttributeSetType * find_attribute(const String &identifier)
Finds an Attribute by its identifier String and returns a pointer to it.
Definition: mesh_part.hpp:328
TargetSet< cell_dim_ >::Type & get_target_set()
Return the reference to a target set.
Definition: mesh_part.hpp:433
TargetSetHolderType _target_set_holder
The target sets of the mesh.
Definition: mesh_part.hpp:168
MeshPart(Factory< MeshPart > &factory)
Factory constructor.
Definition: mesh_part.hpp:201
MeshType::ShapeType ShapeType
Shape type.
Definition: mesh_part.hpp:95
int get_num_attributes() const
Returns the total number of Attributes in this MeshPart.
Definition: mesh_part.hpp:356
const AttributeSetContainer & get_mesh_attributes() const
Returns a const reference to the mesh attributes container.
Definition: mesh_part.hpp:346
void deduct_target_sets_from_bottom(const ParentIndexSetHolderType &parent_ish)
Deducts the target sets from bottom to top.
Definition: mesh_part.hpp:504
void deduct_topology(const ParentIndexSetHolderType &parent_ish)
Fills the mesh topology from parent information.
Definition: mesh_part.hpp:547
bool has_topology() const
Checks if this MeshPart has a mesh topology.
Definition: mesh_part.hpp:297
std::unique_ptr< IndexSetHolderType > _index_set_holder
The index sets of the mesh.
Definition: mesh_part.hpp:166
MeshType::IndexSetHolderType ParentIndexSetHolderType
Topology (aka IndexSetHolder) of parent mesh type.
Definition: mesh_part.hpp:97
MeshPart(const MeshPart &other)=delete
deleted copy constructor
MeshPart & operator=(const MeshPart &)=delete
deleted copy-assignment operator
TargetSetHolder< ShapeType > TargetSetHolderType
Target set holder type.
Definition: mesh_part.hpp:101
MeshPart(const Index num_entities[], bool create_topology=false)
Constructor.
Definition: mesh_part.hpp:183
AttributeSet< AttributeDataType > AttributeSetType
Type for mesh attributes.
Definition: mesh_part.hpp:135
AttributeSetContainer _mesh_attributes
The attribute sets of the mesh.
Definition: mesh_part.hpp:170
MeshType_ MeshType
parent Mesh type
Definition: mesh_part.hpp:93
std::array< Index, shape_dim+1 > _num_entities
Number of entities for each shape dimension.
Definition: mesh_part.hpp:164
static String name()
Returns the name of the class.
Definition: mesh_part.hpp:472
IndexSet< cell_dim_, face_dim_ >::Type & get_index_set()
Returns the reference to an index set.
Definition: mesh_part.hpp:394
IndexSetHolder< ShapeType > IndexSetHolderType
Index set holder type.
Definition: mesh_part.hpp:99
const AttributeSetType * find_attribute(const String &identifier) const
Finds an Attribute by its identifier String and returns a pointer to it.
Definition: mesh_part.hpp:335
AttributeSetContainer::const_iterator AttributeSetConstIterator
submesh node const-iterator type
Definition: mesh_part.hpp:142
Index get_num_entities(int dim) const
Returns the number of entities.
Definition: mesh_part.hpp:311
virtual ~MeshPart()
Virtual destructor.
Definition: mesh_part.hpp:232
MeshPart clone() const
Definition: mesh_part.hpp:268
const IndexSet< cell_dim_, face_dim_ >::Type & get_index_set() const
Returns the reference to an index set.
Definition: mesh_part.hpp:402
std::map< String, std::unique_ptr< AttributeSetType > > AttributeSetContainer
submesh node bin container type
Definition: mesh_part.hpp:138
MeshType::VertexSetType::CoordType AttributeDataType
Data type for attributes.
Definition: mesh_part.hpp:133
std::size_t bytes() const
Definition: mesh_part.hpp:280
const TargetSet< cell_dim_ >::Type & get_target_set() const
Return the reference to a target set.
Definition: mesh_part.hpp:442
virtual bool add_attribute(std::unique_ptr< AttributeSetType > attribute, const String &identifier)
Copies one attribute to this MeshPart's AttributeHolder.
Definition: mesh_part.hpp:374
void deduct_target_sets_from_top(const ParentIndexSetHolderType &parent_ish)
Deducts the target sets from top to bottom.
Definition: mesh_part.hpp:529
void clone(const MeshPart &other)
Clones another mesh part object into this object.
Definition: mesh_part.hpp:243
MeshPart & operator=(MeshPart &&other)=default
move-assignment operator
void permute(const MeshPermutation< ShapeType > &mesh_perm)
Applies a mesh permutation onto this mesh part's target sets.
Definition: mesh_part.hpp:483
Mesh permutation class template.
const PermArray & get_inv_perms() const
static void compute(IndexSetHolder< Shape_ > &index_set_holder)
Routine that does the actual work.
StandardRefinery(const MeshType &coarse_meshpart, const MeshPart< ParentMesh_ > &parent_meshpart)
Constructor.
Definition: mesh_part.hpp:731
virtual void fill_attribute_sets(AttributeSetContainer &attribute_container) override
Fills attribute sets where applicable.
Definition: mesh_part.hpp:771
StandardRefinery(const MeshType &coarse_meshpart, const ParentMesh_ &parent_mesh)
Constructor.
Definition: mesh_part.hpp:704
MeshType::TargetSetHolderType TargetSetHolderType
target set holder type
Definition: mesh_part.hpp:674
virtual Index get_num_entities(int dim) override
Returns the number of entities of the refined mesh.
Definition: mesh_part.hpp:760
virtual void fill_index_sets(std::unique_ptr< IndexSetHolderType > &index_set_holder) override
Fills the index sets.
Definition: mesh_part.hpp:802
MeshType::AttributeSetType AttributeType
Attribute set type.
Definition: mesh_part.hpp:668
virtual void fill_target_sets(TargetSetHolderType &target_set_holder) override
Fills the target sets.
Definition: mesh_part.hpp:823
MeshType::IndexSetHolderType IndexSetHolderType
index set holder type
Definition: mesh_part.hpp:672
const MeshType * _parent_meshpart
coarse parent mesh-part reference
Definition: mesh_part.hpp:685
MeshType::AttributeSetContainer AttributeSetContainer
index set holder type
Definition: mesh_part.hpp:670
const ParentMesh_ * _parent_mesh
coarse parent mesh reference
Definition: mesh_part.hpp:683
const MeshType & _coarse_meshpart
coarse mesh reference
Definition: mesh_part.hpp:681
Standard Refinery class template.
Definition: factory.hpp:58
Target set class.
Definition: target_set.hpp:27
String class implementation.
Definition: string.hpp:46
@ parent
indicates that the level is a parent level
@ other
generic/other permutation strategy
FEAT namespace.
Definition: adjactor.hpp:12
double Real
Real data type.
std::uint64_t Index
Index data type.
Index set type class template.
Definition: mesh_part.hpp:116
FEAT::Geometry::IndexSet< Shape::FaceTraits< typename Shape::FaceTraits< ShapeType, cell_dim_ >::ShapeType, face_dim_ >::count > Type
Index set type.
Definition: mesh_part.hpp:129
Target set type class template.
Definition: mesh_part.hpp:157
FEAT::Geometry::TargetSet Type
Target set type.
Definition: mesh_part.hpp:159
Face traits tag struct template.
Definition: shape.hpp:106