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

#482 Heat also adapted.

parent 79f1c4b9
......@@ -101,7 +101,7 @@ Domain1 = {
-- 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, {1, 2, 3})
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 2 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
......@@ -127,7 +127,7 @@ Domain2 = {
-- 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, {1, 2, 3})
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 1 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
......
......@@ -96,6 +96,85 @@ Mesh1 = {
dimension = 1
}
-- Domain1 - The 1D elements.
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; 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.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 1 },
-- 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 = { }
}
-- Domain2 - Neumann boundary conditions.
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; at most one value is exxpected 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 = { 0 },
-- 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 = { 1 },
-- 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 = { }
}
-- Domain3 - Robin boundary conditions.
Domain3 = {
-- 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 exxpected 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 = { 0 },
-- 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 = { 2 },
-- 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 = { }
}
-- Petsc
Petsc = {
-- Absolute tolerance
......@@ -167,12 +246,7 @@ force1 = {
--
transient_source = function (component, x, y, z, t)
return 0.*x + 0.*y + 0.*z + 0.*t + 0.;
end,
-- List of mesh labels upon which the force is applied. Leave empty in case of a volumic force.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
label_list = {}
end
}
-- force
......@@ -186,12 +260,7 @@ force2 = {
--
transient_source = function (component, x, y, z, t)
return 0.*x + 0.*y + 0.*z + 0.*t + 0.;
end,
-- List of mesh labels upon which the force is applied. Leave empty in case of a volumic force.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
label_list = {1}
end
}
-- force
......@@ -205,12 +274,7 @@ force3 = {
--
transient_source = function (component, x, y, z, t)
return 0.*x + 0.*y + 0.*z + 0.*t + 0.;
end,
-- List of mesh labels upon which the force is applied. Leave empty in case of a volumic force.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
label_list = {2}
end
}
-- InitialCondition
......
......@@ -100,7 +100,7 @@ Domain1 = {
-- 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, {1, 2, 3})
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 2 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
......@@ -126,7 +126,7 @@ Domain2 = {
-- 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, {1, 2, 3})
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 1 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
......
......@@ -100,7 +100,7 @@ Domain1 = {
-- 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, {1, 2, 3})
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 3 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
......@@ -126,7 +126,7 @@ Domain2 = {
-- 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, {1, 2, 3})
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 2 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
......
......@@ -103,7 +103,7 @@ Domain1 = {
-- 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, {1, 2, 3})
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 3 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
......@@ -129,7 +129,7 @@ Domain2 = {
-- 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, {1, 2, 3})
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { 2 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
......
......@@ -1418,7 +1418,7 @@
BE9D3EB617CC89CB0047D4F2 /* BaseHelper.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = BaseHelper.hpp; sourceTree = "<group>"; };
BE9D3EB717CC96370047D4F2 /* Force.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Force.hpp; sourceTree = "<group>"; };
BE9EBD0B1AADDBAD001B8FC8 /* demo_input_hyperelasticity_3d.lua */ = {isa = PBXFileReference; lastKnownFileType = text; name = demo_input_hyperelasticity_3d.lua; path = Data/Lua/demo_input_hyperelasticity_3d.lua; sourceTree = SOURCE_ROOT; };
BE9EBD0D1AADE038001B8FC8 /* demo_input_heat.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = demo_input_heat.lua; path = Data/Lua/demo_input_heat.lua; sourceTree = SOURCE_ROOT; };
BE9EBD0D1AADE038001B8FC8 /* demo_input_heat_1d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = demo_input_heat_1d.lua; path = Data/Lua/demo_input_heat_1d.lua; sourceTree = SOURCE_ROOT; };
BE9F687E17B7C01200CAAA8F /* BoundaryCondition.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = BoundaryCondition.hpp; sourceTree = "<group>"; };
BE9F688017B7C03500CAAA8F /* Petsc.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Petsc.hpp; sourceTree = "<group>"; };
BE9F688217B7C09500CAAA8F /* Solid.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Solid.hpp; sourceTree = "<group>"; };
......@@ -4123,7 +4123,7 @@
children = (
BE4C55C31A8517E500C22AE2 /* SConscript */,
BE4478881AA7415000665010 /* main.cpp */,
BE9EBD0D1AADE038001B8FC8 /* demo_input_heat.lua */,
BE9EBD0D1AADE038001B8FC8 /* demo_input_heat_1d.lua */,
BEF282901A850E2800857342 /* InputParameterList.hpp */,
BEF282921A850E2800857342 /* Model.cpp */,
BEF282931A850E2800857342 /* Model.hpp */,
......
......@@ -77,7 +77,7 @@ namespace HappyHeart
const std::string& DimensionList::Constraint()
{
static std::string ret("ops_in(v, {1, 2, 3})");
static std::string ret("ops_in(v, {0, 1, 2, 3})");
return ret;
}
......
......@@ -12,6 +12,7 @@
# include "Utilities/Containers/EnumClass.hpp"
# include "Core/InputParameterList.hpp"
# include "Core/InputParameter/Geometry/Domain.hpp"
namespace HappyHeart
......@@ -48,6 +49,18 @@ namespace HappyHeart
InputParameter::Mesh::Mesh<1>,
InputParameter::Mesh::Format<1>,
InputParameter::Mesh::Dimension<1>,
InputParameter::Domain::MeshIndex<1>,
InputParameter::Domain::DimensionList<1>,
InputParameter::Domain::MeshLabelList<1>,
InputParameter::Domain::GeomEltTypeList<1>,
InputParameter::Domain::MeshIndex<2>,
InputParameter::Domain::DimensionList<2>,
InputParameter::Domain::MeshLabelList<2>,
InputParameter::Domain::GeomEltTypeList<2>,
InputParameter::Domain::MeshIndex<3>,
InputParameter::Domain::DimensionList<3>,
InputParameter::Domain::MeshLabelList<3>,
InputParameter::Domain::GeomEltTypeList<3>,
InputParameter::Petsc::AbsoluteTolerance,
InputParameter::Petsc::GmresRestart,
InputParameter::Petsc::MaxIteration,
......@@ -59,11 +72,8 @@ namespace HappyHeart
InputParameter::Diffusion::DiffusionTensor,
InputParameter::Diffusion::TransferCoefficient,
InputParameter::Force::TransientSource<EnumUnderlyingType(ForceIndexList::volumic_source)>,
InputParameter::Force::LabelList<EnumUnderlyingType(ForceIndexList::volumic_source)>,
InputParameter::Force::TransientSource<EnumUnderlyingType(ForceIndexList::neumann_boundary_condition)>,
InputParameter::Force::LabelList<EnumUnderlyingType(ForceIndexList::neumann_boundary_condition)>,
InputParameter::Force::TransientSource<EnumUnderlyingType(ForceIndexList::robin_boundary_condition)>,
InputParameter::Force::LabelList<EnumUnderlyingType(ForceIndexList::robin_boundary_condition)>,
InputParameter::InitialCondition::Value
>;
......
......@@ -6,6 +6,8 @@
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "Geometry/DomainManager.hpp"
#include "ModelInstances/Heat/Model.hpp"
......@@ -25,12 +27,10 @@ namespace HappyHeart
void Model::SupplInitialize(const InputParameterList& input_parameter_data)
{
variational_formulation_ = std::make_unique<VariationalFormulation>(MpiHappyHeart(),
GetOutputDirectory(),
GetTransientParameters(),
GetGeometricMeshRegionList(),
GetGeometricMeshRegionIndexList(),
GetGodOfDofList());
auto& formulation = this->GetNonCstVariationalFormulation();
......@@ -61,16 +61,15 @@ namespace HappyHeart
// \todo 289
// At the moment, create one GodOfDof per mesh (later on might be less than that...)
const auto& geometric_mesh_region_list = this->GetGeometricMeshRegionList();
for (const auto& geometric_mesh_region_ptr : geometric_mesh_region_list)
const auto& geometric_mesh_region_index_list = this->GetGeometricMeshRegionIndexList();
for (auto index : geometric_mesh_region_index_list)
{
assert(!(!geometric_mesh_region_ptr));
const auto& geometric_mesh_region = *geometric_mesh_region_ptr;
auto& geometric_mesh_region = this->GetNonCstGeometricMeshRegion(index);
auto god_of_dof_ptr = std::make_shared<GodOfDof>(mpi,
input_parameter_data,
*geometric_mesh_region_ptr);
geometric_mesh_region);
auto& god_of_dof = *god_of_dof_ptr;
......@@ -80,45 +79,31 @@ namespace HappyHeart
FiniteEltSpace::vector_unique_ptr buf;
{
Domain dimension_N ({ geometric_mesh_region.GetDimension() });
auto& domain = DomainManager::CreateOrGetInstance().Create<1>(input_parameter_data);
auto felt_space_ptr = std::make_unique<FiniteEltSpace>(god_of_dof_ptr,
dimension_N,
domain,
god_of_dof.GetUnknownManager());
buf.emplace_back(std::move(felt_space_ptr));
}
{
namespace IPL = Utilities::InputParameterListNS;
namespace Force = InputParameter::Force;
auto label_list = IPL::Extract<Force::LabelList<EnumUnderlyingType(ForceIndexList::neumann_boundary_condition)>>::Value(input_parameter_data);
Domain dimension_N_minus_1_Neumann (geometric_mesh_region,
{ geometric_mesh_region.GetDimension() - 1u },
std::move(label_list));
auto& domain = DomainManager::CreateOrGetInstance().Create<2>(input_parameter_data);
auto felt_space_ptr = std::make_unique<FiniteEltSpace>(god_of_dof_ptr,
dimension_N_minus_1_Neumann,
domain,
god_of_dof.GetUnknownManager());
buf.emplace_back(std::move(felt_space_ptr));
}
{
namespace IPL = Utilities::InputParameterListNS;
namespace Force = InputParameter::Force;
auto label_list = IPL::Extract<Force::LabelList<EnumUnderlyingType(ForceIndexList::robin_boundary_condition)>>::Value(input_parameter_data);
Domain dimension_N_minus_1_Robin (geometric_mesh_region,
{ geometric_mesh_region.GetDimension() - 1u },
std::move(label_list));
auto& domain = DomainManager::CreateOrGetInstance().Create<3>(input_parameter_data);
auto felt_space_ptr = std::make_unique<FiniteEltSpace>(god_of_dof_ptr,
dimension_N_minus_1_Robin,
domain,
god_of_dof.GetUnknownManager());
buf.emplace_back(std::move(felt_space_ptr));
}
......
......@@ -24,12 +24,12 @@ namespace HappyHeart
VariationalFormulation::VariationalFormulation(const Wrappers::Mpi& mpi,
const std::string& output_directory,
const TransientParameters& transient_parameters,
const GeometricMeshRegion::vector_unique_ptr& mesh_list,
const std::vector<unsigned int>& mesh_index_list,
const GodOfDof::vector_shared_ptr& god_of_dof_list)
: Parent(mpi,
output_directory,
transient_parameters,
mesh_list,
mesh_index_list,
god_of_dof_list)
{ }
......@@ -222,7 +222,7 @@ namespace HappyHeart
const auto& felt_list_per_type = felt_space_dim_N.GetFEltListPerRefFeltSpace();
const unsigned int mesh_dimension = GetGeometricMeshRegion(0).GetDimension();
const unsigned int mesh_dimension = GetGeometricMeshRegion(1).GetDimension();
for (const auto& pair : felt_list_per_type)
{
......
......@@ -59,7 +59,7 @@ namespace HappyHeart
explicit VariationalFormulation(const Wrappers::Mpi& mpi,
const std::string& output_directory,
const TransientParameters& transient_parameters,
const GeometricMeshRegion::vector_unique_ptr& mesh_list,
const std::vector<unsigned int>& mesh_index_list,
const GodOfDof::vector_shared_ptr& god_of_dof_list);
//! Destructor.
......
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