Commit 9d92451b authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#478 Heat has also been adapted.

parent a69ba1ba
......@@ -19,28 +19,28 @@ transient = {
timeMax = 2
}
-- variable
variable = {
-- Name of the variable considered.
-- Expected format: {"VALUE1", "VALUE2", ...}
variable = {"temperature"},
-- Whether each variable is scalar or vectorial.
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'scalar', 'vectorial'})
nature = {"scalar"},
-- degreeOfExactness.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
degreeOfExactness = { 5 },
-- Type of finite element.
-- Expected format: {"VALUE1", "VALUE2", ...}
typeOfFiniteElement = { "P1" }
-- Unknown1: heat.
Unknown1 = {
-- Name of the unknown (used for displays in output).
-- Expected format: "VALUE"
name = "temperature",
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'scalar', 'vectorial'})
nature = "scalar",
-- Temporary data to choose which quadrature rule to use.
-- Expected format: VALUE
degree_of_exactness = 5,
-- Shape function label
-- Expected format: "VALUE"
shape_function_label = "P1"
}
-- BoundaryCondition
BoundaryCondition = {
-- 0:Pseudo-elimination, 2:penalisation
......@@ -175,6 +175,56 @@ Domain3 = {
-- FiniteElementSpace1
FiniteElementSpace1 = {
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: VALUE
god_of_dof_index = 1,
-- Index of the domain onto which the finite element space is defined. This domain must be unidimensional.
-- Expected format: VALUE
domain_index = 1,
-- List of all unknowns defined in the finite element space. Unknowns here must be defined in this file as
-- an 'Unknown' block; expected name/identifier is the name given there.
-- Expected format: {"VALUE1", "VALUE2", ...}
unknown_list = {"temperature"}
}
-- FiniteElementSpace2
FiniteElementSpace2 = {
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: VALUE
god_of_dof_index = 1,
-- Index of the domain onto which the finite element space is defined. This domain must be unidimensional.
-- Expected format: VALUE
domain_index = 2,
-- List of all unknowns defined in the finite element space. Unknowns here must be defined in this file as
-- an 'Unknown' block; expected name/identifier is the name given there.
-- Expected format: {"VALUE1", "VALUE2", ...}
unknown_list = {"temperature"}
}
-- FiniteElementSpace3
FiniteElementSpace3 = {
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: VALUE
god_of_dof_index = 1,
-- Index of the domain onto which the finite element space is defined. This domain must be unidimensional.
-- Expected format: VALUE
domain_index = 3,
-- List of all unknowns defined in the finite element space. Unknowns here must be defined in this file as
-- an 'Unknown' block; expected name/identifier is the name given there.
-- Expected format: {"VALUE1", "VALUE2", ...}
unknown_list = {"temperature"}
}
-- Petsc
Petsc = {
-- Absolute tolerance
......
......@@ -6,11 +6,13 @@ Import(['env', 'all_libs', 'HappyHeartLibrary', 'HappyHeartProgram'])
core_src = Split('''
InputParameter/BoundaryCondition.cpp
InputParameter/Diffusion.cpp
InputParameter/FElt/Private/FEltSpace.cpp
InputParameter/FElt/Private/Unknown.cpp
InputParameter/Fluid.cpp
InputParameter/Force.cpp
InputParameter/InitialCondition.cpp
InputParameter/Geometry/Private/Mesh.cpp
InputParameter/Geometry/Private/Domain.cpp
InputParameter/Geometry/Private/Mesh.cpp
InputParameter/InitialCondition.cpp
InputParameter/Miscellaneous.cpp
InputParameter/Petsc.cpp
InputParameter/Result.cpp
......
......@@ -90,9 +90,9 @@ RefFiniteElement/Private/ShapeFunctionAtQuadraturePoint.cpp
RefFiniteElement/RefFElt.cpp
RefFiniteElement/RefFEltInLocalNumbering.cpp
RefFiniteElement/RefFEltSpace.cpp
Unknown/EnumUnknown.cpp
Unknown/Private/UnknownFactory.cpp
Unknown/Unknown.cpp
Unknown/UnknownComponent.cpp
Unknown/UnknownManager.cpp
''')
......
......@@ -6,8 +6,8 @@ Import(['env', 'all_libs', 'HappyHeartLibrary', 'HappyHeartProgram'])
geometry_src = Split('''
Coords.cpp
DomainManager.cpp
Domain.cpp
DomainManager.cpp
Exceptions/Coords.cpp
Exceptions/Format/Ensight.cpp
Exceptions/Format/Format.cpp
......@@ -16,6 +16,7 @@ Exceptions/GeometricElt.cpp
GeometricElements/Hexahedron20.cpp
GeometricElements/Hexahedron27.cpp
GeometricElements/Hexahedron8.cpp
GeometricElements/IOFormat.cpp
GeometricElements/Point1.cpp
GeometricElements/Quadrangle4.cpp
GeometricElements/Quadrangle8.cpp
......@@ -26,14 +27,13 @@ GeometricElements/Tetrahedron10.cpp
GeometricElements/Tetrahedron4.cpp
GeometricElements/Triangle3.cpp
GeometricElements/Triangle6.cpp
GeometricElements/IOFormat.cpp
GeometricElt.cpp
GeometricElt_free_functions.cpp
GeometricMeshRegionManager.cpp
GeometricMeshRegion.cpp
GeometricMeshRegion_Connectivity.cpp
GeometricMeshRegion__Ensight.cpp
GeometricMeshRegion__Medit.cpp
GeometricMeshRegion_Connectivity.cpp
GeometricMeshRegionManager.cpp
GeometricReferenceElements/Hexahedron20.cpp
GeometricReferenceElements/Hexahedron27.cpp
GeometricReferenceElements/Hexahedron8.cpp
......@@ -75,14 +75,13 @@ Interfaces/Vertex.cpp
Interfaces/Volume.cpp
LocalCoords.cpp
MeshLabel.cpp
Private/DomainHelper.cpp
Private/Exceptions/GeometricEltFactory.cpp
Private/Exceptions/GeometricEltList.cpp
Private/GeometricEltFactory.cpp
Private/GeometricEltList.cpp
Private/DomainHelper.cpp
Private/MeshLevelInterfaceList.cpp
RefGeomElt.cpp
''')
RefGeomElt.cpp''')
geometry_lib = HappyHeartLibrary(env, 'happy_heart_geometry', geometry_src, all_libs)
......
......@@ -13,6 +13,8 @@
# include "Core/InputParameterList.hpp"
# include "Core/InputParameter/Geometry/Domain.hpp"
# include "Core/InputParameter/FElt/FEltSpace.hpp"
# include "Core/InputParameter/FElt/Unknown.hpp"
# include "FormulationSolver/Crtp/VolumicAndSurfacicSource.hpp"
......
......@@ -13,6 +13,8 @@
# include "Core/InputParameterList.hpp"
# include "Core/InputParameter/Geometry/Domain.hpp"
# include "Core/InputParameter/FElt/FEltSpace.hpp"
# include "Core/InputParameter/FElt/Unknown.hpp"
namespace HappyHeart
......@@ -43,7 +45,21 @@ namespace HappyHeart
neumann = 2,
robin = 3
};
enum class FEltSpaceIndex
{
higher_dimension = 1,
neumann = 2,
robin = 3
};
enum class UnknownIndex
{
temperature = 1
};
using InputParameterTuple = std::tuple
......@@ -51,45 +67,71 @@ namespace HappyHeart
InputParameter::Transient::TimeStep,
InputParameter::Transient::Time,
InputParameter::Transient::TimeMax,
InputParameter::Variable::Variable,
InputParameter::Variable::Nature,
InputParameter::Variable::DegreeOfExactness,
InputParameter::Variable::TypeOfFiniteElement,
InputParameter::Unknown::Name<EnumUnderlyingType(UnknownIndex::temperature)>,
InputParameter::Unknown::Nature<EnumUnderlyingType(UnknownIndex::temperature)>,
InputParameter::Unknown::DegreeOfExactness<EnumUnderlyingType(UnknownIndex::temperature)>,
InputParameter::Unknown::ShapeFunctionLabel<EnumUnderlyingType(UnknownIndex::temperature)>,
InputParameter::BoundaryCondition::EssentialBoundaryConditionsMethod,
InputParameter::BoundaryCondition::Component,
InputParameter::BoundaryCondition::Variable,
InputParameter::BoundaryCondition::BCValue,
InputParameter::BoundaryCondition::NumLabel,
InputParameter::BoundaryCondition::Label,
InputParameter::Mesh::Mesh<EnumUnderlyingType(MeshIndex::mesh)>,
InputParameter::Mesh::Format<EnumUnderlyingType(MeshIndex::mesh)>,
InputParameter::Mesh::Dimension<EnumUnderlyingType(MeshIndex::mesh)>,
InputParameter::Domain::MeshIndex<EnumUnderlyingType(DomainIndex::higher_dimension)>,
InputParameter::Domain::DimensionList<EnumUnderlyingType(DomainIndex::higher_dimension)>,
InputParameter::Domain::MeshLabelList<EnumUnderlyingType(DomainIndex::higher_dimension)>,
InputParameter::Domain::GeomEltTypeList<EnumUnderlyingType(DomainIndex::higher_dimension)>,
InputParameter::Domain::MeshIndex<EnumUnderlyingType(DomainIndex::neumann)>,
InputParameter::Domain::DimensionList<EnumUnderlyingType(DomainIndex::neumann)>,
InputParameter::Domain::MeshLabelList<EnumUnderlyingType(DomainIndex::neumann)>,
InputParameter::Domain::GeomEltTypeList<EnumUnderlyingType(DomainIndex::neumann)>,
InputParameter::Domain::MeshIndex<EnumUnderlyingType(DomainIndex::robin)>,
InputParameter::Domain::DimensionList<EnumUnderlyingType(DomainIndex::robin)>,
InputParameter::Domain::MeshLabelList<EnumUnderlyingType(DomainIndex::robin)>,
InputParameter::Domain::GeomEltTypeList<EnumUnderlyingType(DomainIndex::robin)>,
InputParameter::FEltSpace::GodOfDofIndex<EnumUnderlyingType(FEltSpaceIndex::higher_dimension)>,
InputParameter::FEltSpace::DomainIndex<EnumUnderlyingType(FEltSpaceIndex::higher_dimension)>,
InputParameter::FEltSpace::UnknownList<EnumUnderlyingType(FEltSpaceIndex::higher_dimension)>,
InputParameter::FEltSpace::GodOfDofIndex<EnumUnderlyingType(FEltSpaceIndex::neumann)>,
InputParameter::FEltSpace::DomainIndex<EnumUnderlyingType(FEltSpaceIndex::neumann)>,
InputParameter::FEltSpace::UnknownList<EnumUnderlyingType(FEltSpaceIndex::neumann)>,
InputParameter::FEltSpace::GodOfDofIndex<EnumUnderlyingType(FEltSpaceIndex::robin)>,
InputParameter::FEltSpace::DomainIndex<EnumUnderlyingType(FEltSpaceIndex::robin)>,
InputParameter::FEltSpace::UnknownList<EnumUnderlyingType(FEltSpaceIndex::robin)>,
InputParameter::Petsc::AbsoluteTolerance,
InputParameter::Petsc::GmresRestart,
InputParameter::Petsc::MaxIteration,
InputParameter::Petsc::Preconditioner,
InputParameter::Petsc::RelativeTolerance,
InputParameter::Petsc::Solver,
InputParameter::Result::OutputDirectory,
InputParameter::Diffusion::Density,
InputParameter::Diffusion::DiffusionTensor,
InputParameter::Diffusion::TransferCoefficient,
InputParameter::Force::TransientSource<EnumUnderlyingType(ForceIndexList::volumic_source)>,
InputParameter::Force::TransientSource<EnumUnderlyingType(ForceIndexList::neumann_boundary_condition)>,
InputParameter::Force::TransientSource<EnumUnderlyingType(ForceIndexList::robin_boundary_condition)>,
InputParameter::InitialCondition::Value
>;
......
......@@ -79,38 +79,23 @@ namespace HappyHeart
FiniteEltSpace::vector_unique_ptr buf;
{
auto& domain =
DomainManager::CreateOrGetInstance().Create<EnumUnderlyingType(DomainIndex::higher_dimension)>(input_parameter_data);
auto&& felt_space_ptr = FiniteEltSpace::Create<EnumUnderlyingType(FEltSpaceIndex::higher_dimension)>(god_of_dof_ptr,
input_parameter_data);
auto felt_space_ptr = std::make_unique<FiniteEltSpace>(god_of_dof_ptr,
domain,
god_of_dof.GetUnknownManager());
buf.emplace_back(std::move(felt_space_ptr));
}
{
auto& domain =
DomainManager::CreateOrGetInstance().Create<EnumUnderlyingType(DomainIndex::neumann)>(input_parameter_data);
auto felt_space_ptr = std::make_unique<FiniteEltSpace>(god_of_dof_ptr,
domain,
god_of_dof.GetUnknownManager());
auto&& felt_space_ptr = FiniteEltSpace::Create<EnumUnderlyingType(FEltSpaceIndex::neumann)>(god_of_dof_ptr,
input_parameter_data);
buf.emplace_back(std::move(felt_space_ptr));
}
{
auto& domain =
DomainManager::CreateOrGetInstance().Create<EnumUnderlyingType(DomainIndex::robin)>(input_parameter_data);
auto felt_space_ptr = std::make_unique<FiniteEltSpace>(god_of_dof_ptr,
domain,
god_of_dof.GetUnknownManager());
auto&& felt_space_ptr = FiniteEltSpace::Create<EnumUnderlyingType(FEltSpaceIndex::robin)>(god_of_dof_ptr,
input_parameter_data);
buf.emplace_back(std::move(felt_space_ptr));
}
......
......@@ -102,6 +102,60 @@ namespace HappyHeart
void Finalize();
public:
/*!
* \brief List here the list of domain unique ids that might be considered in the model.
*
* A domain unique id is the figure that appears in the block name in the input parameter file,
* for instance 5 for Domain5.
*
* The expected syntax here is:
* \code
* using DomainTuple = std::tuple
* <
* std::integral_constant<unsigned int, *unique id1*>,
* std::integral_constant<unsigned int, *unique id2*>,
* ...
* >;
* \endcode
*
* The reason of this somewhat complicated syntax is that some of the computation is dealt with at compile
* time.
*/
using DomainTuple = std::tuple
<
std::integral_constant<unsigned int, EnumUnderlyingType(DomainIndex::higher_dimension)>,
std::integral_constant<unsigned int, EnumUnderlyingType(DomainIndex::neumann)>,
std::integral_constant<unsigned int, EnumUnderlyingType(DomainIndex::robin)>
>;
/*!
* \brief List here the list of unknown unique ids that might be considered in the model.
*
* An unknown unique id is the figure that appears in the block name in the input parameter file,
* for instance 5 for Unknown5.
*
* The expected syntax here is:
* \code
* using UnknownTuple = std::tuple
* <
* std::integral_constant<unsigned int, *unique id1*>,
* std::integral_constant<unsigned int, *unique id2*>,
* ...
* >;
* \endcode
*
* The reason of this somewhat complicated syntax is that some of the computation is dealt with at compile
* time.
*/
using UnknownTuple = std::tuple
<
std::integral_constant<unsigned int, EnumUnderlyingType(UnknownIndex::temperature)>
>;
private:
......
......@@ -59,7 +59,7 @@ namespace HappyHeart
const auto& felt_space_dim_N_minus_1_Neumann = god_of_dof.GetFiniteEltSpace(EnumUnderlyingType(FiniteEltSpaceIndexList::neumann_finite_elt_space));
const auto& felt_space_dim_N_minus_1_Robin = god_of_dof.GetFiniteEltSpace(EnumUnderlyingType(FiniteEltSpaceIndexList::robin_finite_elt_space));
const auto& unknown_list = felt_space_dim_N.GetUnknownManager().GetUnknownList(); // only temperature in it for our case
const auto& unknown_list = UnknownManager::GetInstance().GetUnknownList(); // only temperature in it for our case
// \todo See #199: extraction of unknowns should be way more graceful!
assert(unknown_list.size() == 1);
......@@ -205,7 +205,7 @@ namespace HappyHeart
const auto& god_of_dof = this->GetGodOfDof(0);
const auto& felt_space_dim_N = god_of_dof.GetFiniteEltSpace(0);
const auto& unknown_list = felt_space_dim_N.GetUnknownManager().GetUnknownList(); // only temperature in it for our case
const auto& unknown_list = UnknownManager::GetInstance().GetUnknownList(); // only temperature in it for our case
assert(unknown_list.size() == 1);
auto temperature_ptr = unknown_list[0];
......
......@@ -5,24 +5,24 @@ Import('env')
third_party_src_keep_warnings = Split('''
Wrappers/Lm5/Lm5.cpp
Wrappers/Mpi/Exceptions/Mpi.cpp
Wrappers/Mpi/Mpi.cpp
Wrappers/Mpi/MacroEncapsulation/Op.cpp
Wrappers/Mpi/MacroEncapsulation/Comm.cpp
Wrappers/Mpi/MacroEncapsulation/Op.cpp
Wrappers/Mpi/Mpi.cpp
Wrappers/Parmetis/Exceptions/Parmetis.cpp
Wrappers/Parmetis/Parmetis.cpp
Wrappers/Petsc/Exceptions/Petsc.cpp
Wrappers/Petsc/Matrix/Matrix.cpp
Wrappers/Petsc/Matrix/MatrixPattern.cpp
Wrappers/Petsc/Petsc.cpp
Wrappers/Petsc/Print.cpp
Wrappers/Petsc/Snes.cpp
Wrappers/Petsc/Vector/Vector.cpp
Wrappers/Petsc/Vector/AccessVectorContent.cpp
Wrappers/Petsc/Vector/Private/VectorHelper.cpp
Wrappers/Petsc/Vector/Vector.cpp
Wrappers/Petsc/Viewer.cpp
Wrappers/Petsc/Print.cpp
Wrappers/Seldon/Seldon.cpp
Wrappers/Seldon/HappyHeartPetscVector.cpp
Wrappers/Seldon/MatrixOperations.cpp
Wrappers/Seldon/Seldon.cpp
''')
third_party_src_filter_out_warnings = Split('''
......
......@@ -5,7 +5,9 @@ Import('env', 'all_libs', 'HappyHeartLibrary')
utilities_src_and_obj = Split('''
CommandLineOptions/CommandLineOptions.cpp
Containers/BoolArray.cpp
Environment/EnvironmentVariable.cpp
Exceptions/Exception.cpp
Exceptions/Factory.cpp
Exceptions/PrintAndAbort.cpp
......@@ -13,13 +15,13 @@ Filesystem/File.cpp
Filesystem/Folder.cpp
InputParameterList/Exceptions/InputParameterList.cpp
InputParameterList/ExtendedOps.cpp
InputParameterList/Private/InputParameter.cpp
InputParameterList/Private/BaseHelper.cpp
InputParameterList/Private/InputParameter.cpp
main_header_guards.cpp
Singleton/Exceptions/Singleton.cpp
String/EmptyString.cpp
String/String.cpp
CommandLineOptions/CommandLineOptions.cpp
TimeKeep/TimeKeep.cpp
Environment/EnvironmentVariable.cpp
''')
third_party_build_directory = os.path.join(env['CURRENT_BUILD_INTERMEDIATE_DIR'], 'ThirdParty')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment