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

#820 Add new vector that stores result of first solve + vector previously computed.

parent 3cd28939
......@@ -555,6 +555,12 @@ namespace HappyHeart
//! Non constant accessor to the load state correction (see Freefem script).
GlobalVector& GetNonCstDirichletLoadStateCorrection() noexcept;
//! Constant accessor to the deltaMixtVariables ( odo #820 Rename and comment!).
const GlobalVector& GetDeltaMixtVariables() const noexcept;
//! Non constant accessor to the deltaMixtVariables ( odo #820 Rename and comment!).
GlobalVector& GetNonCstDeltaMixtVariables() noexcept;
///@}
......@@ -945,6 +951,9 @@ namespace HappyHeart
//! Load state correction (see Freefem script).
GlobalVector::unique_ptr dirichlet_load_state_correction_ = nullptr;
//! deltaMixtVariables (\todo #820 Rename and comment!)
GlobalVector::unique_ptr delta_mixt_variables_ = nullptr;
};
......
......@@ -272,6 +272,30 @@ namespace HappyHeart
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
decltype(auto) delta_mixt_variables = GetNonCstDeltaMixtVariables();
// \todo #820 Swap!
delta_mixt_variables.Copy(parent::GetSystemSolution(numbering_subset),
__FILE__, __LINE__);
Wrappers::Petsc::AXPY(1.,
robin_vector,
delta_mixt_variables,
__FILE__, __LINE__);
{
const auto filename = parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(differential::yes)
+ "deltaMixtVariables_with_dirichletFunctionMixtVariables_" + GetIterationTag() + ".m";
delta_mixt_variables.View(parent::MpiHappyHeart(),
filename,
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
......
......@@ -680,6 +680,22 @@ namespace HappyHeart
return const_cast<GlobalVector&>(GetDirichletLoadStateCorrection());
}
template<class HyperelasticLawT>
inline const GlobalVector& VariationalFormulation<HyperelasticLawT>::GetDeltaMixtVariables() const noexcept
{
assert(!(!delta_mixt_variables_));
return *delta_mixt_variables_;
}
template<class HyperelasticLawT>
inline GlobalVector& VariationalFormulation<HyperelasticLawT>::GetNonCstDeltaMixtVariables() noexcept
{
return const_cast<GlobalVector&>(GetDeltaMixtVariables());
}
} // namespace InnerLoopNS
......
......@@ -69,6 +69,7 @@ namespace HappyHeart
solid_differential_velocity_ = std::make_unique<GlobalVector>(parent::GetSystemSolution(numbering_subset));
non_homogeneous_robin_vector_ = std::make_unique<GlobalVector>(parent::GetSystemSolution(numbering_subset));
dirichlet_load_state_correction_ = std::make_unique<GlobalVector>(parent::GetSystemSolution(numbering_subset));
delta_mixt_variables_ = std::make_unique<GlobalVector>(parent::GetSystemSolution(numbering_subset));
solid_differential_velocity_on_robin_interface_ =
std::make_unique<GlobalVector>(god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_velocity_on_robin_interface)));
......
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