Commit b3714185 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1049 [DOES NOT COMPILE EVERYTHING] Move DomainManager outside of Internal namespace.

parent ab41a091
......@@ -162,6 +162,31 @@ Domain3 = {
}
Domain4 = {
-- 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; at most one value is expected here.
-- Expected format: {VALUE1}
-- Expected format: VALUE
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
-- labels. This parameter does not make sense if no mesh is defined for the domain.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_label_list = { },
-- List of geometric element types considered in the domain. Might be left empty if no restriction upon
-- these.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
}
EssentialBoundaryCondition1 = {
......
......@@ -160,6 +160,31 @@ Domain3 = {
}
Domain4 = {
-- 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; at most one value is expected here.
-- Expected format: {VALUE1}
-- Expected format: VALUE
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
-- labels. This parameter does not make sense if no mesh is defined for the domain.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_label_list = { },
-- List of geometric element types considered in the domain. Might be left empty if no restriction upon
-- these.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
}
EssentialBoundaryCondition1 = {
......
......@@ -387,7 +387,7 @@ Solid = {
-- How is given the Young modulus (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'constant', 'lua_function', 'piecewise_constant_by_domain'})
nature = "constant",
nature = "piecewise_constant_by_domain",
-- Value of the Young modulus in the case nature is 'constant'(and also initial value if nature is 'at_quadrature_point'; irrelevant otherwise).
-- Expected format: VALUE
......@@ -396,7 +396,7 @@ Solid = {
-- Domain indices of the parameter in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_id = { 1 },
piecewise_constant_domain_id = { 4 },
-- Value of the Young modulus in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
......@@ -419,7 +419,7 @@ Solid = {
-- How is given the Poisson coefficient (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'constant', 'lua_function', 'piecewise_constant_by_domain'})
nature = "constant",
nature = "piecewise_constant_by_domain",
-- Value of the Poisson coefficient in the case nature is 'constant'(and also initial value if nature is 'at_quadrature_point'; irrelevant otherwise).
-- Expected format: VALUE
......@@ -428,11 +428,11 @@ Solid = {
-- Domain indices of the parameter in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_id = {},
piecewise_constant_domain_id = { 4 },
-- Value of the Young modulus in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_value = {},
piecewise_constant_domain_value = { 0.3},
-- Value of the Poisson coefficient in the case nature is 'lua_function'(and also initial value if nature is 'at_quadrature_point'; irrelevant otherwise).
-- Expected format: Function in Lua language, for instance:
......@@ -453,7 +453,7 @@ Solid = {
-- How is given the kappa 1 (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'constant', 'lua_function', 'piecewise_constant_by_domain'})
nature = "constant",
nature = "piecewise_constant_by_domain",
-- Value of the kappa 1 in the case nature is 'constant'(and also initial value if nature is 'at_quadrature_point'; irrelevant otherwise).
-- Expected format: VALUE
......@@ -462,11 +462,11 @@ Solid = {
-- Domain indices of the parameter in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_id = {},
piecewise_constant_domain_id = { 4 },
-- Value of the Young modulus in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_value = {},
piecewise_constant_domain_value = { 500 },
-- Value of the kappa 1 in the case nature is 'lua_function'(and also initial value if nature is 'at_quadrature_point'; irrelevant otherwise).
-- Expected format: Function in Lua language, for instance:
......@@ -483,7 +483,7 @@ Solid = {
-- How is given the kappa 2 (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'constant', 'lua_function', 'piecewise_constant_by_domain'})
nature = "constant",
nature = "piecewise_constant_by_domain",
-- Value of the kappa 2 in the case nature is 'constant'(and also initial value if nature is 'at_quadrature_point'; irrelevant otherwise).
-- Expected format: VALUE
......@@ -492,11 +492,11 @@ Solid = {
-- Domain indices of the parameter in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_id = {},
piecewise_constant_domain_id = { 4 },
-- Value of the Young modulus in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_value = {},
piecewise_constant_domain_value = { 403346.1538461538 },
-- Value of the kappa 2 in the case nature is 'lua_function'(and also initial value if nature is 'at_quadrature_point'; irrelevant otherwise).
-- Expected format: Function in Lua language, for instance:
......@@ -513,7 +513,7 @@ Solid = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'ignore', 'constant', 'lua_function', 'at_quadrature_point', 'piecewise_constant_by_domain'})
nature = 'constant',
nature = 'piecewise_constant_by_domain',
-- Value of the volumic mass in the case nature is 'constant'(and also initial value if nature is
-- 'at_quadrature_point'; irrelevant otherwise).
......@@ -536,11 +536,11 @@ Solid = {
-- Domain indices of the parameter in the case nature is 'piecewise_constant_by_domain'. The various
-- domains given here must not intersect.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_id = {},
piecewise_constant_domain_id = { 4 },
-- Value of the parameter in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_value = {}
piecewise_constant_domain_value = { 1750000.0 }
}, -- HyperelasticBulk
......
......@@ -191,6 +191,42 @@ Domain3 = {
}
Domain4 = {
-- 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; at most one value is expected here.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
-- labels. This parameter does not make sense if no mesh is defined for the domain.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_label_list = { },
-- List of geometric element types considered in the domain. Might be left empty if no restriction upon
-- these. No constraint is applied at Ops level, as some geometric element types could be added after
-- generation of current input parameter file. Current list is below; if an incorrect value is put there it
-- will be detected a bit later when the domain object is built.
-- The known types when this file was generated are:
-- . Point1
-- . Segment2, Segment3
-- . Triangle3, Triangle6
-- . Quadrangle4, Quadrangle8, Quadrangle9
-- . Tetrahedron4, Tetrahedron10
-- . Hexahedron8, Hexahedron20, Hexahedron27.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { },
} -- Domain4
-- FiniteElementSpace1
FiniteElementSpace1 = {
-- Index of the god of dof into which the finite element space is defined.
......
......@@ -1075,6 +1075,9 @@
BE5ECE3219ACA52000C636A7 /* libGeometry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B4DD16D23573000E248D /* libGeometry.a */; };
BE5ECE3319ACA52000C636A7 /* libUtilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA8A379177AD4FE009436C9 /* libUtilities.a */; };
BE5ECE3619ACA52000C636A7 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC37E0617DDC0210021BFB7 /* Accelerate.framework */; };
BE60180B1DD45936000F7EB2 /* DomainManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE6018081DD45936000F7EB2 /* DomainManager.cpp */; };
BE60180C1DD45936000F7EB2 /* DomainManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE6018091DD45936000F7EB2 /* DomainManager.hpp */; };
BE60180D1DD45936000F7EB2 /* DomainManager.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE60180A1DD45936000F7EB2 /* DomainManager.hxx */; };
BE607CFE1B1DDA1E008017B9 /* SpatialFunction.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE607CFB1B1DDA1E008017B9 /* SpatialFunction.hpp */; };
BE607D031B1DE2E6008017B9 /* SpatialFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE607D001B1DE2E6008017B9 /* SpatialFunction.cpp */; };
BE607D051B1DE2E6008017B9 /* SpatialFunction.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE607D021B1DE2E6008017B9 /* SpatialFunction.hxx */; };
......@@ -1323,9 +1326,6 @@
BE8B692C1CC115B600312399 /* Domain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE8B69221CC115B600312399 /* Domain.cpp */; };
BE8B692D1CC115B600312399 /* Domain.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE8B69231CC115B600312399 /* Domain.hpp */; };
BE8B692E1CC115B600312399 /* Domain.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE8B69241CC115B600312399 /* Domain.hxx */; };
BE8B692F1CC115B600312399 /* DomainManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE8B69251CC115B600312399 /* DomainManager.cpp */; };
BE8B69301CC115B600312399 /* DomainManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE8B69261CC115B600312399 /* DomainManager.hpp */; };
BE8B69311CC115B600312399 /* DomainManager.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE8B69271CC115B600312399 /* DomainManager.hxx */; };
BE8B69321CC115B600312399 /* DomainHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE8B69291CC115B600312399 /* DomainHelper.cpp */; };
BE8B69331CC115B600312399 /* DomainHelper.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE8B692A1CC115B600312399 /* DomainHelper.hpp */; };
BE8B69341CC115B600312399 /* DomainHelper.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE8B692B1CC115B600312399 /* DomainHelper.hxx */; };
......@@ -5714,6 +5714,9 @@
BE5ECE2A19AC85EA00C636A7 /* VariationalFormulation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = VariationalFormulation.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
BE5ECE2B19AC85EA00C636A7 /* VariationalFormulation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = VariationalFormulation.hpp; sourceTree = "<group>"; };
BE5ECE2C19AC85EA00C636A7 /* VariationalFormulation.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = VariationalFormulation.hxx; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
BE6018081DD45936000F7EB2 /* DomainManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DomainManager.cpp; sourceTree = "<group>"; };
BE6018091DD45936000F7EB2 /* DomainManager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DomainManager.hpp; sourceTree = "<group>"; };
BE60180A1DD45936000F7EB2 /* DomainManager.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DomainManager.hxx; sourceTree = "<group>"; };
BE607CFB1B1DDA1E008017B9 /* SpatialFunction.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = SpatialFunction.hpp; path = Parameter/SpatialFunction.hpp; sourceTree = "<group>"; };
BE607D001B1DE2E6008017B9 /* SpatialFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SpatialFunction.cpp; path = Parameter/SpatialFunction.cpp; sourceTree = "<group>"; };
BE607D021B1DE2E6008017B9 /* SpatialFunction.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = SpatialFunction.hxx; path = Parameter/SpatialFunction.hxx; sourceTree = "<group>"; };
......@@ -5960,9 +5963,6 @@
BE8B69221CC115B600312399 /* Domain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = Domain.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
BE8B69231CC115B600312399 /* Domain.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Domain.hpp; sourceTree = "<group>"; };
BE8B69241CC115B600312399 /* Domain.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Domain.hxx; sourceTree = "<group>"; };
BE8B69251CC115B600312399 /* DomainManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DomainManager.cpp; sourceTree = "<group>"; };
BE8B69261CC115B600312399 /* DomainManager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DomainManager.hpp; sourceTree = "<group>"; };
BE8B69271CC115B600312399 /* DomainManager.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DomainManager.hxx; sourceTree = "<group>"; };
BE8B69291CC115B600312399 /* DomainHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DomainHelper.cpp; sourceTree = "<group>"; };
BE8B692A1CC115B600312399 /* DomainHelper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DomainHelper.hpp; sourceTree = "<group>"; };
BE8B692B1CC115B600312399 /* DomainHelper.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DomainHelper.hxx; sourceTree = "<group>"; };
......@@ -10491,6 +10491,9 @@
BE8B69211CC115B600312399 /* Domain */ = {
isa = PBXGroup;
children = (
BE6018081DD45936000F7EB2 /* DomainManager.cpp */,
BE6018091DD45936000F7EB2 /* DomainManager.hpp */,
BE60180A1DD45936000F7EB2 /* DomainManager.hxx */,
BE8B69221CC115B600312399 /* Domain.cpp */,
BE8B69231CC115B600312399 /* Domain.hpp */,
BE8B69241CC115B600312399 /* Domain.hxx */,
......@@ -10505,9 +10508,6 @@
BE8B69281CC115B600312399 /* Internal */ = {
isa = PBXGroup;
children = (
BE8B69251CC115B600312399 /* DomainManager.cpp */,
BE8B69261CC115B600312399 /* DomainManager.hpp */,
BE8B69271CC115B600312399 /* DomainManager.hxx */,
BE8B69291CC115B600312399 /* DomainHelper.cpp */,
BE8B692A1CC115B600312399 /* DomainHelper.hpp */,
BE8B692B1CC115B600312399 /* DomainHelper.hxx */,
......@@ -12632,6 +12632,7 @@
BEC527011CC58462000E9027 /* Coords.hpp in Headers */,
BE0513AC1CC7BE4F00A8F20D /* Point1.hpp in Headers */,
BE0513F11CC7C22600A8F20D /* LocalInterface.hpp in Headers */,
BE60180D1DD45936000F7EB2 /* DomainManager.hxx in Headers */,
BE168F121CC97F120090AC88 /* Quadrangle4.hpp in Headers */,
BEF251831CCCF17B00919552 /* TInterface.hpp in Headers */,
BE90E05B1A24915500CCAFDE /* ComputeInterfaceListInMesh.hpp in Headers */,
......@@ -12640,8 +12641,8 @@
BEBCEFCB1CFECBD000DE96C2 /* ComputeJacobian.hxx in Headers */,
BE0513DD1CC7BE4F00A8F20D /* TRefGeomElt.hpp in Headers */,
BE0486891CCAC1A900CB6A3A /* FreeFunctions.hpp in Headers */,
BE8B69301CC115B600312399 /* DomainManager.hpp in Headers */,
BE0513E61CC7BE4F00A8F20D /* RefGeomElt.hpp in Headers */,
BE60180C1DD45936000F7EB2 /* DomainManager.hpp in Headers */,
BE97E3A61CC906E500AB5FF8 /* Format.hpp in Headers */,
BE97E3AB1CC90D1E00AB5FF8 /* Point1.hpp in Headers */,
BEF251651CCCF0BD00919552 /* OrientedEdge.hxx in Headers */,
......@@ -12677,7 +12678,6 @@
BE45D8521AB1C7F000881FF0 /* VolumicAndSurfacicSource.hxx in Headers */,
BEAC91291CCF4A1A00C386C5 /* Ensight.hxx in Headers */,
BE0AD2741CC182AD0086EDF7 /* GeometricMeshRegion.hpp in Headers */,
BE8B69311CC115B600312399 /* DomainManager.hxx in Headers */,
BE04868A1CCAC1A900CB6A3A /* FreeFunctions.hxx in Headers */,
BE97E3D31CC90EE400AB5FF8 /* Quadrangle4.hpp in Headers */,
BE0513BC1CC7BE4F00A8F20D /* Quadrangle.hpp in Headers */,
......@@ -15349,11 +15349,11 @@
BE97E3C11CC90E4400AB5FF8 /* Triangle6.cpp in Sources */,
BEACD8F01CCC086500667B82 /* GeometricEltFactory.cpp in Sources */,
BEF251611CCCF0BD00919552 /* Face.cpp in Sources */,
BE60180B1DD45936000F7EB2 /* DomainManager.cpp in Sources */,
BE05139F1CC7BE4F00A8F20D /* Hexahedron8.cpp in Sources */,
BE97E3D21CC90EE400AB5FF8 /* Quadrangle4.cpp in Sources */,
BE97E3E31CC90FF600AB5FF8 /* Hexahedron8.cpp in Sources */,
BE8B692C1CC115B600312399 /* Domain.cpp in Sources */,
BE8B692F1CC115B600312399 /* DomainManager.cpp in Sources */,
BEC527051CC58462000E9027 /* CoordIndexes.cpp in Sources */,
BE0513A11CC7BE4F00A8F20D /* Hexahedron20.cpp in Sources */,
BE0513C71CC7BE4F00A8F20D /* Tetrahedron10.cpp in Sources */,
......@@ -64,11 +64,11 @@
<CommandLineArguments>
<CommandLineArgument
argument = "--input_parameters ${HOME}/Codes/HappyHeart/Data/Lua/demo_input_hyperelasticity.lua"
isEnabled = "YES">
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--input_parameters ${HOME}/Codes/HappyHeart/Data/Lua/demo_input_hyperelasticity_3d.lua"
isEnabled = "NO">
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
......
......@@ -21,7 +21,7 @@
# include "HappyHeart/Core/InputParameterData/InputParameterList.hpp"
# include "HappyHeart/Core/InputParameter/DirichletBoundaryCondition/DirichletBoundaryCondition.hpp"
# include "HappyHeart/Geometry/Domain/Internal/DomainManager.hpp"
# include "HappyHeart/Geometry/Domain/DomainManager.hpp"
# include "HappyHeart/FiniteElement/Unknown/UnknownManager.hpp"
# include "HappyHeart/FiniteElement/BoundaryConditions/DirichletBoundaryCondition.hpp"
......
......@@ -30,7 +30,7 @@ namespace HappyHeart
decltype(auto) is_mutable = ipl::ExtractParameter<typename DirichletBoundaryConditionSectionT::IsMutable>(section);
decltype(auto) may_overlap = ipl::ExtractParameter<typename DirichletBoundaryConditionSectionT::MayOverlap>(section);
const auto& domain = Internal::DomainNS::DomainManager::GetInstance().GetDomain(domain_id);
const auto& domain = DomainManager::GetInstance().GetDomain(domain_id);
const auto& unknown = UnknownManager::GetInstance().GetUnknown(unknown_name);
......
......@@ -16,7 +16,7 @@
# include "HappyHeart/Core/NumberingSubset/NumberingSubset.hpp"
# include "HappyHeart/Parameters/ParameterType.hpp"
# include "HappyHeart/Geometry/Domain/Internal/DomainManager.hpp"
# include "HappyHeart/Geometry/Domain/DomainManager.hpp"
# include "HappyHeart/FiniteElement/FiniteElementSpace/Internal/BreakCircularDependancy.hpp"
# include "HappyHeart/FiniteElement/FiniteElementSpace/Internal/FEltSpace.hpp"
......
......@@ -15,7 +15,7 @@
# include "HappyHeart/Core/InputParameter/FElt/FEltSpace.hpp"
# include "HappyHeart/Core/NumberingSubset/Internal/NumberingSubsetManager.hpp"
# include "HappyHeart/Geometry/Domain/Internal/DomainManager.hpp"
# include "HappyHeart/Geometry/Domain/DomainManager.hpp"
# include "HappyHeart/FiniteElement/Unknown/UnknownManager.hpp"
# include "HappyHeart/FiniteElement/Unknown/ExtendedUnknown.hpp"
......
......@@ -32,7 +32,7 @@ namespace HappyHeart
const auto domain_index = IPL::Extract<typename FEltSpaceNS::DomainIndex>::Value(input_parameter_data);
return Internal::DomainNS::DomainManager::GetInstance().GetNonCstDomain(domain_index);
return DomainManager::GetInstance().GetNonCstDomain(domain_index);
}
......
......@@ -106,7 +106,7 @@ namespace HappyHeart
using const_unique_ptr = std::unique_ptr<const Domain>;
//! Frienship to Domain manager, to allow it to create domain objects.
friend class Internal::DomainNS::DomainManager;
friend class DomainManager;
public:
......
//! \file
//
//
// DomainManager.cpp
// HappyHeart
//
// Created by Sebastien Gilles on 20/03/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "HappyHeart/Geometry/Domain/DomainManager.hpp"
namespace HappyHeart
{
const std::string& DomainManager::ClassName()
{
static std::string ret("DomainManager");
return ret;
}
DomainManager::DomainManager() = default;
void 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::const_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__);
}
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
//! \file
//
//
// DomainManager.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 20/03/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_GEOMETRY_x_DOMAIN_x_INTERNAL_x_DOMAIN_MANAGER_HPP_
# define HAPPY_HEART_x_GEOMETRY_x_DOMAIN_x_INTERNAL_x_DOMAIN_MANAGER_HPP_
# include "HappyHeart/Utilities/Singleton/Singleton.hpp"
# include "HappyHeart/Utilities/Containers/Tuple.hpp"
# include "HappyHeart/Core/InputParameter/Geometry/Domain.hpp"
# include "HappyHeart/Geometry/Domain/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:
//! Base type of Domain as input parameter (requested to identify domains in the input parameter data).
using input_parameter_type = InputParameter::BaseNS::Domain;
//! Name of the class (required for some Singleton-related errors).
static const std::string& ClassName();
/*!
* \brief Create a new Domain object from the data of the input parameter file.
*
*/
template<class DomainSectionT>
void Create(const DomainSectionT& section);
//! Fetch the domain object associated with \a unique_id unique identifier.
const Domain& GetDomain(unsigned int unique_id) const;
//! Fetch the domain region object associated with \a unique_id unique identifier.
Domain& GetNonCstDomain(unsigned int unique_id);
private:
/*!
* \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.
* \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.
*
*/
void 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);
private:
//! \name Singleton requirements.
///@{
//! Constructor.
DomainManager();
//! Friendship declaration to Singleton template class (to enable call to constructor).
friend class Utilities::Singleton<DomainManager>;
///@}
private:
//! Store the domain objects by their unique identifier.
std::unordered_map<unsigned int, Domain::const_unique_ptr> list_;
};
} // namespace HappyHeart
# include "HappyHeart/Geometry/Domain/DomainManager.hxx"
#endif // HAPPY_HEART_x_GEOMETRY_x_DOMAIN_x_INTERNAL_x_DOMAIN_MANAGER_HPP_
//! \file
//
//
// DomainManager.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 20/03/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_GEOMETRY_x_DOMAIN_x_INTERNAL_x_DOMAIN_MANAGER_HXX_
# define HAPPY_HEART_x_GEOMETRY_x_DOMAIN_x_INTERNAL_x_DOMAIN_MANAGER_HXX_
namespace HappyHeart
{
template<class DomainSectionT>
void DomainManager::Create(const DomainSectionT& section)
{
namespace ipl = Utilities::InputParameterListNS;
decltype(auto) mesh_index_list = ipl::ExtractParameter<typename DomainSectionT::MeshIndexList>(section);
decltype(auto) dimension_list = ipl::ExtractParameter<typename DomainSectionT::DimensionList>(section);
decltype(auto) mesh_label_list = ipl::ExtractParameter<typename DomainSectionT::MeshLabelList>(section);
decltype(auto) geometric_type_list = ipl::ExtractParameter<typename DomainSectionT::GeomEltTypeList>(section);
Create(section.GetUniqueId(), mesh_index_list, dimension_list, mesh_label_list, geometric_type_list);
}
inline Domain& DomainManager::GetNonCstDomain(unsigned int unique_id)
{
return const_cast<Domain&>(GetDomain(unique_id));
}
} // namespace HappyHeart
#endif // HAPPY_HEART_x_GEOMETRY_x_DOMAIN_x_INTERNAL_x_DOMAIN_MANAGER_HXX_