Commit 5a6fe08c authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#482 Introduce as well a DomainManager; domain used in hyperelastic case are...

#482 Introduce as well a DomainManager; domain used in hyperelastic case are now properly created by this manager. Due to the very similar shape of GeometricMeshRegion and Domain managers; a CRTP should be introduced shortly.
parent 2d56dfc9
......@@ -93,9 +93,9 @@ Mesh1 = {
-- Domain1 - The 2D elements of the bar.
Domain1 = {
-- Index of the geometric mesh upon which the domain is defined (as defined in the present file). Might be
-- left empty if domain not limited to one mesh.
-- Expected format: VALUE
mesh_index = 1,
-- left empty if domain not limited to one mesh; at most one value is exxpected here.
-- Expected format: {VALUE1}
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
......@@ -118,9 +118,10 @@ Domain1 = {
-- Domain2 - The border upon which surfacic forces are applied.
Domain2 = {
-- Index of the geometric mesh upon which the domain is defined (as defined in the present file). Might be
-- left empty if domain not limited to one mesh.
-- left empty if domain not limited to one mesh; at most one value is exxpected here.
-- Expected format: {VALUE1}
-- Expected format: VALUE
mesh_index = 1,
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
......
......@@ -222,6 +222,9 @@
BE794E7B1ABC3231003D9F2D /* GeometricMeshRegionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE794E781ABC3231003D9F2D /* GeometricMeshRegionManager.cpp */; };
BE794E7C1ABC3231003D9F2D /* GeometricMeshRegionManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE794E791ABC3231003D9F2D /* GeometricMeshRegionManager.hpp */; };
BE794E7D1ABC3231003D9F2D /* GeometricMeshRegionManager.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE794E7A1ABC3231003D9F2D /* GeometricMeshRegionManager.hxx */; };
BE794E831ABC6FCC003D9F2D /* DomainManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE794E801ABC6FCC003D9F2D /* DomainManager.cpp */; };
BE794E841ABC6FCC003D9F2D /* DomainManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE794E811ABC6FCC003D9F2D /* DomainManager.hpp */; };
BE794E851ABC6FCC003D9F2D /* DomainManager.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE794E821ABC6FCC003D9F2D /* DomainManager.hxx */; };
BE86A9EE1A385C9B003B211D /* SegmentP2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE86A9EC1A385C9B003B211D /* SegmentP2.cpp */; };
BE86A9EF1A385C9B003B211D /* SegmentP2.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE86A9ED1A385C9B003B211D /* SegmentP2.hpp */; };
BE87A4EE1A6FEFF100E92902 /* InitHappyHeart.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE87A4EB1A6FEFF100E92902 /* InitHappyHeart.hpp */; };
......@@ -1364,6 +1367,9 @@
BE794E781ABC3231003D9F2D /* GeometricMeshRegionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeometricMeshRegionManager.cpp; sourceTree = "<group>"; };
BE794E791ABC3231003D9F2D /* GeometricMeshRegionManager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GeometricMeshRegionManager.hpp; sourceTree = "<group>"; };
BE794E7A1ABC3231003D9F2D /* GeometricMeshRegionManager.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GeometricMeshRegionManager.hxx; sourceTree = "<group>"; };
BE794E801ABC6FCC003D9F2D /* DomainManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DomainManager.cpp; sourceTree = "<group>"; };
BE794E811ABC6FCC003D9F2D /* DomainManager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DomainManager.hpp; sourceTree = "<group>"; };
BE794E821ABC6FCC003D9F2D /* DomainManager.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DomainManager.hxx; sourceTree = "<group>"; };
BE7A19EC183E4789002767FD /* Result.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Result.hpp; sourceTree = "<group>"; };
BE7BE12417575AB200508465 /* Coords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Coords.cpp; sourceTree = "<group>"; };
BE7BE12517575AB200508465 /* Coords.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Coords.hpp; sourceTree = "<group>"; };
......@@ -2637,6 +2643,9 @@
BEA9CB891A1E2532003A6276 /* GeometricMeshRegion_Connectivity.cpp */,
BE6576E41A1F41F800D9A8B7 /* GeometricMeshRegion_Connectivity.hpp */,
BE5BC2B716C00A0600232749 /* GeometricMeshRegion.hxx */,
BE794E801ABC6FCC003D9F2D /* DomainManager.cpp */,
BE794E811ABC6FCC003D9F2D /* DomainManager.hpp */,
BE794E821ABC6FCC003D9F2D /* DomainManager.hxx */,
BEBB8C26196FCB3E0053DA47 /* Domain.cpp */,
BEBB8C27196FCB3E0053DA47 /* Domain.hpp */,
BEBB8C28196FCB3E0053DA47 /* Domain.hxx */,
......@@ -4145,6 +4154,7 @@
BE90E0301A24915500CCAFDE /* Tetrahedron4.hpp in Headers */,
BE90E0231A24915500CCAFDE /* Helper.hxx in Headers */,
BE90E0491A24915500CCAFDE /* Medit.hpp in Headers */,
BE794E841ABC6FCC003D9F2D /* DomainManager.hpp in Headers */,
BE90DFC01A24915500CCAFDE /* Interface.hpp in Headers */,
BE90E03C1A24915500CCAFDE /* Hexahedron20.hpp in Headers */,
BE90E05E1A24915500CCAFDE /* GeometricEltFactory.hpp in Headers */,
......@@ -4253,6 +4263,7 @@
BE90E0601A24915500CCAFDE /* GeometricEltList.hpp in Headers */,
BE90E0611A24915500CCAFDE /* MeshFormatHelper.hpp in Headers */,
BE90DFF71A24915500CCAFDE /* Definitions.hpp in Headers */,
BE794E851ABC6FCC003D9F2D /* DomainManager.hxx in Headers */,
BE90E05C1A24915500CCAFDE /* MeshLevelInterfaceList.hxx in Headers */,
BE90E01F1A24915500CCAFDE /* Quadrangle.hpp in Headers */,
BE90E0241A24915500CCAFDE /* IOFormat.hpp in Headers */,
......@@ -5119,6 +5130,7 @@
BE90DFED1A24915500CCAFDE /* Quadrangle8.cpp in Sources */,
BE90E0291A24915500CCAFDE /* Segment3.cpp in Sources */,
BE90E0331A24915500CCAFDE /* Quadrangle4.cpp in Sources */,
BE794E831ABC6FCC003D9F2D /* DomainManager.cpp in Sources */,
BE90DFD61A24915500CCAFDE /* BuildInterfaceHelper.cpp in Sources */,
BE90DFBF1A24915500CCAFDE /* Interface.cpp in Sources */,
BE90DFDD1A24915500CCAFDE /* Point1.cpp in Sources */,
......
......@@ -37,8 +37,8 @@ namespace HappyHeart
const std::string& MeshIndex::Description()
{
static std::string ret("Index of the geometric mesh upon which the domain is defined (as defined "
"in the present file). Might be "
"left empty if domain not limited to one mesh.");
"in the present file). Might be left empty if domain not limited to one mesh; "
"at most one value is exxpected here.");
return ret;
}
......
......@@ -32,7 +32,7 @@ namespace HappyHeart
//! Helper class that defines non template static functions of namesake class in Domain namespace.
struct MeshIndex : public Utilities::InputParameterListNS::Private::InputParameter<unsigned int>
struct MeshIndex : public Utilities::InputParameterListNS::Private::InputParameter<std::vector<unsigned int>>
{
//! Name of the input parameter in Lua input file.
static const std::string& NameInFile();
......
......@@ -6,7 +6,7 @@
// Copyright (c) 2014 Inria. All rights reserved.
//
#include "Geometry/GeometricMeshRegion.hpp"
#include "Geometry/GeometricMeshRegionManager.hpp"
#include "Geometry/Domain.hpp"
#include "Geometry/GeometricElt.hpp"
#include "Geometry/Private/GeometricEltFactory.hpp"
......@@ -16,52 +16,45 @@ namespace HappyHeart
{
Domain::Domain()
: geometric_mesh_region_identifier_(Utilities::UninitializedIndex<unsigned int>())
{ }
Domain::Domain(std::vector<unsigned int>&& dimension)
: Domain()
const std::string Domain::ClassName()
{
SetDimensionList(std::move(dimension));
static std::string ret("Domain");
return ret;
}
Domain::Domain(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int>&& dimension)
: Domain(std::move(dimension))
{
SetGeometricMeshRegion(geometric_mesh_region);
}
Domain::Domain()
: UniqueIdParent(nullptr)
{ }
Domain::Domain(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int>&& dimension,
std::vector<std::string>&& geometric_type_list)
: Domain(geometric_mesh_region, std::move(dimension))
{
SetGeometricEltTypeList(std::move(geometric_type_list));
}
Domain::Domain(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int>&& dimension,
std::vector<unsigned int>&& mesh_label_list_kept)
: Domain(geometric_mesh_region, std::move(dimension))
Domain::Domain(const unsigned int unique_id,
const std::vector<unsigned int>& mesh_index,
const std::vector<unsigned int>& dimension_list,
const std::vector<unsigned int>& mesh_label_index_list,
const std::vector<std::string>& geometric_type_list)
: UniqueIdParent(unique_id)
{
SetLabelList(geometric_mesh_region, std::move(mesh_label_list_kept));
if (!mesh_index.empty())
{
SetConditionType(DomainNS::Criterion::geometric_mesh_region);
geometric_mesh_region_identifier_ = mesh_index.back();
}
if (!dimension_list.empty())
SetDimensionList(dimension_list);
if (!mesh_label_index_list.empty())
SetLabelList(mesh_label_index_list);
if (!geometric_type_list.empty())
SetGeometricEltTypeList(geometric_type_list);
}
Domain::Domain(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int>&& dimension,
std::vector<std::string>&& geometric_type_list,
std::vector<unsigned int>&& mesh_label_list_kept)
: Domain(geometric_mesh_region, std::move(dimension), std::move(geometric_type_list))
{
SetLabelList(geometric_mesh_region, std::move(mesh_label_list_kept));
}
bool Domain::IsGeometricEltInside(const GeometricElt& geometric_element) const
......@@ -94,18 +87,19 @@ namespace HappyHeart
}
void Domain::SetDimensionList(std::vector<unsigned int> dimension)
void Domain::SetDimensionList(const std::vector<unsigned int>& dimension_list)
{
dimension_ = std::move(dimension);
std::sort(dimension_.begin(), dimension_.end());
dimension_list_ = dimension_list;
std::sort(dimension_list_.begin(), dimension_list_.end());
SetConditionType(DomainNS::Criterion::dimension);
}
void Domain::SetGeometricEltTypeList(std::vector<std::string> name_list)
void Domain::SetGeometricEltTypeList(const std::vector<std::string>& name_list)
{
assert(!name_list.empty() && "Shouldn't have been called!");
{
geometric_type_list_.reserve(name_list.size());
......@@ -121,26 +115,33 @@ namespace HappyHeart
}
void Domain::SetGeometricMeshRegion(const GeometricMeshRegion& geometric_mesh_region)
void Domain::SetGeometricMeshRegion(const std::vector<unsigned int>& mesh_index_list)
{
assert(!mesh_index_list.empty() && "Shouldn't have been called!");
if (mesh_index_list.size() > 2ul)
throw Exception("A domain was defined with two or more meshes; it is not currently foreseen! "
"(currently either only one or no mesh restriction at all are accepted).",
__FILE__, __LINE__);
assert(geometric_mesh_region_identifier_ == Utilities::UninitializedIndex<unsigned int>()
&& "This private method should be called only once in the constructor!");
SetConditionType(DomainNS::Criterion::geometric_mesh_region);
assert(geometric_mesh_region_identifier_ == Utilities::UninitializedIndex<unsigned int>());
geometric_mesh_region_identifier_ = geometric_mesh_region.GetUniqueId();
geometric_mesh_region_identifier_ = mesh_index_list.back();
}
void Domain::SetLabelList(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int> label_index_list)
void Domain::SetLabelList(const std::vector<unsigned int>& label_index_list)
{
assert(!label_index_list.empty() && "Shouldn't have been called!");
assert(IsConstraintOn<DomainNS::Criterion::geometric_mesh_region>()
&& "As mesh labels are very closely related to a nesh, a mesh must be defined!");
assert("The geometric mesh region given here must be the same as the one which identifier has been given to the "
"constructor (usually I don't like such repetition but in this peculiar case involving two low-level "
"methods it can do..." && geometric_mesh_region.GetUniqueId() == GetGeometricMeshRegionIdentifier());
if (!IsConstraintOn<DomainNS::Criterion::geometric_mesh_region>())
throw Exception("As mesh labels are very closely related to a mesh, a mesh must be defined!",
__FILE__, __LINE__);
const auto& geometric_mesh_region =
GeometricMeshRegionManager::GetInstance().GetMesh(GetGeometricMeshRegionIdentifier());
const auto& label_list = geometric_mesh_region.GetLabelList();
const auto begin = label_list.cbegin();
......@@ -158,8 +159,8 @@ namespace HappyHeart
if (it != end)
mesh_label_list_.push_back(*it);
// \todo #201 Open question: should we throw here when a label asked in the constructor isn't actually
// found in the mesh?
std::cout << "[WARNING] Mesh label " << mesh_label_index_to_keep << " isn't actually present in the "
"mesh " << geometric_mesh_region.GetUniqueId() << '!' << std::endl;
}
std::sort(mesh_label_list_.begin(), mesh_label_list_.end(),
......
......@@ -28,6 +28,7 @@ namespace HappyHeart
// Forward.
class GeometricElt;
class RefGeomElt;
class DomainManager;
namespace DomainNS
......@@ -57,84 +58,80 @@ namespace HappyHeart
* The principle is that for each criterion (dimension, geometric element type, mesh labels at the moment)
* either Domain includes the list of all values supported, or there is an information inside a bitset that
* tells there are no constraints on this topic.
*
* Objects of this class can only be created through the DomainManager (except the Domain that impose absolutely
* no restriction).
*/
class Domain : public Crtp::UniqueId<Domain>
class Domain : public Crtp::UniqueId<Domain, UniqueIdNS::AssignationMode::manual, UniqueIdNS::DoAllowNoId::yes>
{
public:
//! Convenient alias.
using UniqueIdParent = Crtp::UniqueId<Domain, UniqueIdNS::AssignationMode::manual, UniqueIdNS::DoAllowNoId::yes>;
//! Alias for unique_ptr.
using unique_ptr = std::unique_ptr<Domain>;
//! Frienship to Domain manager, to allow it to create domain objects.
friend class DomainManager;
public:
//! Name of the class (required for some Singleton-related errors).
static const std::string ClassName();
/// \name Special members.
///@{
/*!
* \brief Default domain, where nothing is restricted.
*/
//! Default constructor that restricts nothing.
Domain();
/*!
* \brief Constructor that enforces constraint upon dimension.
*
*/
explicit Domain(std::vector<unsigned int>&& dimension);
/*!
* \brief Constructor that enforces constraint upon dimension only for a given mesh.
*
* \param[in] geometric_mesh_region GeometricMeshRegion upon which sub-domains might be defined.
*/
explicit Domain(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int>&& dimension);
private:
/*!
* \brief Constructor that enforces constraint upon dimension and mesh label.
* \brief Constructor from input parameter file.
*
* \param[in] geometric_mesh_region GeometricMeshRegion upon which sub-domains might be defined.
*/
explicit Domain(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int>&& dimension,
std::vector<unsigned int>&& mesh_label_list_kept);
/*!
* \brief Constructor that enforces constraint upon dimension and geometric element type.
* This constructor is intended to be used when constructing a domain from the input parameter file;
* otherwise it would have been structured differently to avoid many adjacent arguments with the exact
* same type.
*
* \param[in] geometric_mesh_region GeometricMeshRegion upon which sub-domains might be defined.
* \param[in] unique_id Identifier of the domain, that must be unique. It is in the input parameter file
* the figure that is in the block name, e.g. 1 for Domain1 = { .... }.
* \param[in] mesh_index There might be here one index, that indicates in which mesh the domain is defined.
* If the domain is not limited to one mesh, leave it empty.
* \param[in] dimension_list List of dimensions to consider. If empty, no restriction on dimension.
* \param[in] mesh_label_list List of mesh labels to consider. If empty, no restriction on it. This argument
* must mandatorily be empty if \a mesh_index is empty: a mesh label is closely related to one given mesh.
* \param[in] geometric_type_list List of geometric element types to consider in the domain. List of elements
* available is given by Private::GeometricEltFactory::GetNameList(); most if not all of them should been
* displayed in the comment in the input parameter file.
*/
explicit Domain(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int>&& dimension,
std::vector<std::string>&& geometric_type_list);
Domain(unsigned int unique_id,
const std::vector<unsigned int>& mesh_index,
const std::vector<unsigned int>& dimension_list,
const std::vector<unsigned int>& mesh_label_list,
const std::vector<std::string>& geometric_type_list);
public:
/*!
* \brief Constructor that enforces constraint upon dimension, mesh labels and geometric element type.
*
* \param[in] geometric_mesh_region GeometricMeshRegion upon which sub-domains might be defined.
* \param[in] mesh_label_list_kept List of mesh labels considered in the domain; their indexes are used here.
*/
explicit Domain(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int>&& dimension,
std::vector<std::string>&& geometric_type_list,
std::vector<unsigned int>&& mesh_label_list_kept);
//! Destructor.
~Domain() = default;
//! Copy constructor.
Domain(const Domain&) = default;
Domain(const Domain&) = delete;
//! Move constructor.
Domain(Domain&&) = default;
Domain(Domain&&) = delete;
//! Affectation.
Domain& operator=(const Domain&) = default;
//! Copy affectation.
Domain& operator=(const Domain&) = delete;
//! Affectation.
Domain& operator=(Domain&&) = default;
//! Move affectation.
Domain& operator=(Domain&&) = delete;
///@}
......@@ -208,11 +205,18 @@ namespace HappyHeart
///@{
//! Set the dimensions to consider in the domain.
void SetDimensionList(std::vector<unsigned int> dimension);
void SetDimensionList(const std::vector<unsigned int>& dimension);
//! Set the mesh onto which the domain is defined (if any).
void SetGeometricMeshRegion(const GeometricMeshRegion& geometric_mesh_region);
/*!
* \brief Set the mesh onto which the domain is defined (if any).
*
* \internal Argument is a vector for conveniency in Ops but at most one value is expected (and in case
* this method is called exactly one in fact...).
*/
void SetGeometricMeshRegion(const std::vector<unsigned int>& mesh_index);
/*!
* \brief Set the list of geometric element type to consider.
*
......@@ -220,7 +224,7 @@ namespace HappyHeart
* into something more efficient to use.
* The elements are ordered to fasten access through binary_search.
*/
void SetGeometricEltTypeList(std::vector<std::string> name_list);
void SetGeometricEltTypeList(const std::vector<std::string>& name_list);
/*!
* \brief Set label list.
......@@ -228,14 +232,9 @@ namespace HappyHeart
* This operation makes sense only when a mesh has been defined: there is little chance several mesh would share
* the same mesh labels... So SetGeometricMeshRegion() must have been called beforehand.
*
* \internal Currently integers are read and are converted into the appropriate MeshLabel objects;
* it might not stay this way when Domain is completely implemented.
*
*/
void SetLabelList(const GeometricMeshRegion& geometric_mesh_region,
std::vector<unsigned int> label_index_list);
void SetLabelList(const std::vector<unsigned int>& label_index_list);
///@}
......@@ -290,7 +289,7 @@ namespace HappyHeart
*
* Relevant only if DomainNS::Criterion::geometric_mesh_region is enforced.
*/
unsigned int geometric_mesh_region_identifier_;
unsigned int geometric_mesh_region_identifier_ = Utilities::UninitializedIndex<unsigned int>();
/*!
* \brief Dimensions consider inside the domain.
......@@ -299,7 +298,7 @@ namespace HappyHeart
*
* \internal This list is sort in increasing order.
*/
std::vector<unsigned int> dimension_;
std::vector<unsigned int> dimension_list_;
/*!
* \brief Mesh labels in the domain.
......
......@@ -17,7 +17,7 @@ namespace HappyHeart
inline const std::vector<unsigned int>& Domain::GetDimensionList() const
{
assert(IsConstraintOn<DomainNS::Criterion::dimension>());
return dimension_;
return dimension_list_;
}
......
//
// DomainManager.cpp
// HappyHeart
//
// Created by Sebastien Gilles on 20/03/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "Geometry/DomainManager.hpp"
namespace HappyHeart
{
const std::string& DomainManager::ClassName()
{
static std::string ret("DomainManager");
return ret;
}
DomainManager::DomainManager() = default;
Domain& DomainManager::Create(unsigned int unique_id,
const std::vector<unsigned int>& mesh_index,
const std::vector<unsigned int>& dimension_list,
const std::vector<unsigned int>& mesh_label_list,
const std::vector<std::string>& geometric_type_list)
{
// make_unique is not accepted here: it makes the code yell about private status of the constructor
// with both clang and gcc.
Domain* buf = new Domain(unique_id,
mesh_index,
dimension_list,
mesh_label_list,
geometric_type_list);
auto&& ptr = Domain::unique_ptr(buf);
assert(ptr->GetUniqueId() == unique_id);
auto&& pair = std::make_pair(unique_id, std::move(ptr));
auto insert_return_value = list_.insert(std::move(pair));
if (!insert_return_value.second)
throw Exception("Two geometric mesh region objects can't share the same unique identifier! (namely "
+ std::to_string(unique_id) + ").", __FILE__, __LINE__);
return *(insert_return_value.first->second);
}
const Domain& DomainManager::GetDomain(unsigned int unique_id) const
{
auto it = list_.find(unique_id);
assert(it != list_.cend());
assert(!(!(it->second)));
return *(it->second);
}
} // namespace HappyHeart
//
// DomainManager.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 20/03/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef __HappyHeart__DomainManager__HPP
# define __HappyHeart__DomainManager__HPP
# include "Utilities/Singleton/Singleton.hpp"
# include "Geometry/Domain.hpp"
namespace HappyHeart
{
/*!
* \brief This class is used to create and retrieve Domain objects.
*
* Domain objects get private constructor and can only be created through this class. In addition
* to their creation, this class keeps their address, so it's possible from instance to retrieve a
* Domain object given its unique id (which is the one that appears in the input parameter file).
*
*/
class DomainManager : public Utilities::Singleton<DomainManager>
{
public:
//! Name of the class (required for some Singleton-related errors).
static const std::string& ClassName();
/*!
* \brief Create a brand new Domain and returns a reference to it.
*
* \param[in] unique_id Identifier of the domain, that must be unique. It is in the input parameter file
* the figure that is in the block name, e.g. 1 for Domain1 = { .... }.
* \param[in] mesh_index There might be here one index, that indicates in which mesh the domain is defined.
* If the domain is not limited to one mesh, leave it empty.
* \param[in] dimension_list List of dimensions to consider. If empty, no restriction on dimension.