Commit 3a386a29 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#525 Heat adapted.

parent ecc30ffe
......@@ -33,7 +33,7 @@ namespace HappyHeart
const auto& god_of_dof = this->GetGodOfDof(EnumUnderlyingType(MeshIndex::mesh));
const auto& numbering_subset = god_of_dof.GetNumberingSubsetPtr(1);
const auto& numbering_subset = god_of_dof.GetNumberingSubset(1);
variational_formulation_ = std::make_unique<VariationalFormulation>(MpiHappyHeart(),
numbering_subset,
......@@ -51,10 +51,10 @@ namespace HappyHeart
else
formulation.SetStaticOrDynamic(VariationalFormulation::StaticOrDynamic::dynamic_case);
formulation.Init(input_parameter_data, {}, {});
formulation.Init(input_parameter_data);
// \todo #510 Extend properly this!
formulation.WriteSolution(this->GetTransientParameters(), *numbering_subset);
formulation.WriteSolution(this->GetTransientParameters(), numbering_subset);
}
......@@ -67,7 +67,7 @@ namespace HappyHeart
// Only Rhs is modified at each time iteration; compute it and solve the system.
formulation.ComputeDynamicSystemRhs();
const auto& numbering_subset = formulation.GetMonolithicNumberingSubset();
const auto& numbering_subset = formulation.GetNumberingSubset();
if (GetTransientParameters().GetIteration() == 1)
{
......@@ -86,7 +86,7 @@ namespace HappyHeart
{
// Update quantities for next iteration.
auto& formulation = this->GetNonCstVariationalFormulation();
const auto& numbering_subset = formulation.GetMonolithicNumberingSubset();
const auto& numbering_subset = formulation.GetNumberingSubset();
formulation.DebugPrintNorm(numbering_subset);
formulation.WriteSolution(this->GetTransientParameters(), numbering_subset);
......
......@@ -22,13 +22,13 @@ namespace HappyHeart
VariationalFormulation::VariationalFormulation(const Wrappers::Mpi& mpi,
const NumberingSubset::const_shared_ptr& numbering_subset,
const NumberingSubset& numbering_subset,
const TransientParameters& transient_parameters,
const GodOfDof& god_of_dof)
: Parent(mpi,
NumberingSubset::vector_const_shared_ptr{ numbering_subset },
transient_parameters,
god_of_dof)
god_of_dof),
numbering_subset_(numbering_subset)
{ }
......@@ -37,7 +37,7 @@ namespace HappyHeart
AssembleStaticOperators();
AssembleTransientOperators();
const auto& numbering_subset = GetMonolithicNumberingSubset();
const auto& numbering_subset = GetNumberingSubset();
ApplyEssentialBoundaryCondition<MatrixVectorNature::vector_and_matrix>(numbering_subset, numbering_subset);
SolveLinear<IsFactorized::no>(numbering_subset, numbering_subset);
......@@ -103,9 +103,13 @@ namespace HappyHeart
}
void VariationalFormulation::SupplAllocateMatricesAndVectors()
void VariationalFormulation::AllocateMatricesAndVectors()
{
const auto& numbering_subset = GetMonolithicNumberingSubset();
const auto& numbering_subset = GetNumberingSubset();
Parent::AllocateGlobalMatrix(numbering_subset, numbering_subset);
Parent::AllocateGlobalVector(numbering_subset);
const auto& system_matrix = GetSystemMatrix(numbering_subset, numbering_subset);
const auto& system_rhs = GetSystemRhs(numbering_subset);
......@@ -124,7 +128,7 @@ namespace HappyHeart
void VariationalFormulation::AssembleStaticOperators()
{
const auto& numbering_subset = GetMonolithicNumberingSubset();
const auto& numbering_subset = GetNumberingSubset();
const double diffusion_tensor = GetDiffusionTensor();
const double transfer_coefficient = GetTransferCoefficient();
......@@ -151,7 +155,7 @@ namespace HappyHeart
GetNonCstRobinLinearPartOperator().Assemble(transfer_coefficient, GetNonCstVectorCurrentRobin(), time);
GetNonCstVolumicSourceOperator().Assemble(1., GetNonCstVectorCurrentVolumicSource(), time);
auto& rhs = this->GetNonCstSystemRhs(GetMonolithicNumberingSubset());
auto& rhs = this->GetNonCstSystemRhs(GetNumberingSubset());
rhs.Copy(GetVectorCurrentVolumicSource(), __FILE__, __LINE__);
......@@ -180,7 +184,7 @@ namespace HappyHeart
void VariationalFormulation::ComputeDynamicMatrices()
{
const auto& numbering_subset = GetMonolithicNumberingSubset();
const auto& numbering_subset = GetNumberingSubset();
auto& system_matrix = this->GetNonCstSystemMatrix(numbering_subset, numbering_subset);
const auto& capacity_matrix = GetMatrixCapacity();
......@@ -195,7 +199,7 @@ namespace HappyHeart
void VariationalFormulation::InitializeTemperature(const InputParameterList& input_parameter_data)
{
const auto& numbering_subset = GetMonolithicNumberingSubset();
const auto& numbering_subset = GetNumberingSubset();
const auto& god_of_dof = this->GetGodOfDof();
const auto& felt_space_highest_dimension = god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::highest_dimension));
......@@ -265,7 +269,7 @@ namespace HappyHeart
{
AssembleTransientOperators();
const auto& numbering_subset = GetMonolithicNumberingSubset();
const auto& numbering_subset = GetNumberingSubset();
auto& rhs = this->GetNonCstSystemRhs(numbering_subset);
Wrappers::Petsc::MatMultAdd(GetMatrixCapacity(), GetSystemSolution(numbering_subset),
......
......@@ -57,7 +57,7 @@ namespace HappyHeart
//! Constructor.
explicit VariationalFormulation(const Wrappers::Mpi& mpi,
const NumberingSubset::const_shared_ptr& numbering_subset,
const NumberingSubset& numbering_subset,
const TransientParameters& transient_parameters,
const GodOfDof& god_of_dof);
......@@ -149,7 +149,7 @@ namespace HappyHeart
*
* There is a more generic accessor in the base class but is use is more unwieldy.
*/
const NumberingSubset& GetMonolithicNumberingSubset() const;
const NumberingSubset& GetNumberingSubset() const;
private:
......@@ -175,9 +175,9 @@ namespace HappyHeart
void SupplInit(const InputParameterDataT& input_parameter_data);
/*!
* \brief Allocate the global matrices and vectors specific to the heat problem.
* \brief Allocate the global matrices and vectors.
*/
void SupplAllocateMatricesAndVectors();
void AllocateMatricesAndVectors();
//! Define the pointer function required to calculate the function required by the non-linear problem.
Wrappers::Petsc::Snes::SNESFunction ImplementSnesFunction() const;
......@@ -334,6 +334,10 @@ namespace HappyHeart
//! Type of case to run read from the input parameter file.
StaticOrDynamic run_case_ = StaticOrDynamic::static_case;
//! Numbering subset covering the displacement in the main finite element space.
const NumberingSubset& numbering_subset_;
};
......
......@@ -189,9 +189,9 @@ namespace HappyHeart
}
inline const NumberingSubset& VariationalFormulation::GetMonolithicNumberingSubset() const
inline const NumberingSubset& VariationalFormulation::GetNumberingSubset() const
{
return Parent::GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::monolithic));
return numbering_subset_;
}
......
Supports Markdown
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