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

#820 dH implementation in progress.

parent 0cc9327c
......@@ -546,6 +546,13 @@ namespace HappyHeart
* velocity).
*/
GlobalMatrix& GetNonCstMonolithic2RobinVelocity() noexcept;
//! Constant accessor to the load state correction (see Freefem script).
const GlobalVector& GetDirichletLoadStateCorrection() const noexcept;
//! Non constant accessor to the load state correction (see Freefem script).
GlobalVector& GetNonCstDirichletLoadStateCorrection() noexcept;
///@}
......@@ -934,6 +941,8 @@ namespace HappyHeart
//! Differential velocity of the solid ('dispSdeltar' in dH function in Freefem script) on robin interface.
GlobalVector::unique_ptr solid_differential_velocity_on_robin_interface_ = nullptr;
//! Load state correction (see Freefem script).
GlobalVector::unique_ptr dirichlet_load_state_correction_ = nullptr;
};
......
......@@ -209,6 +209,25 @@ namespace HappyHeart
PETSC_VIEWER_ASCII_MATLAB);
}
auto& dirichlet_load_state_correction = GetNonCstDirichletLoadStateCorrection();
Wrappers::Petsc::MatMult(parent::GetSystemMatrix(numbering_subset, numbering_subset),
robin_vector,
dirichlet_load_state_correction,
__FILE__, __LINE__);
{
const auto filename = parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(differential::yes)
+ "dirichletLoadStateCorrection_" + GetIterationTag() + ".m";
dirichlet_load_state_correction.View(parent::MpiHappyHeart(),
filename,
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
// \todo #820 At the moment, I accept my norm is not the same as Bruno's; see what Petsc gives when
// SNES is applied (system_rhs's is what we got in hyperelastic model).
......
......@@ -665,6 +665,21 @@ namespace HappyHeart
return const_cast<GlobalMatrix&>(GetMonolithic2RobinVelocity());
}
template<class HyperelasticLawT>
inline const GlobalVector& VariationalFormulation<HyperelasticLawT>::GetDirichletLoadStateCorrection() const noexcept
{
assert(!(!dirichlet_load_state_correction_));
return *dirichlet_load_state_correction_;
}
template<class HyperelasticLawT>
inline GlobalVector& VariationalFormulation<HyperelasticLawT>::GetNonCstDirichletLoadStateCorrection() noexcept
{
return const_cast<GlobalVector&>(GetDirichletLoadStateCorrection());
}
} // namespace InnerLoopNS
......
......@@ -68,11 +68,13 @@ namespace HappyHeart
corrected_values_ = std::make_unique<GlobalVector>(parent::GetSystemSolution(numbering_subset));
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));
solid_differential_velocity_on_robin_interface_ =
std::make_unique<GlobalVector>(god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_velocity_on_robin_interface)));
AllocateGlobalVector(god_of_dof, GetNonCstSolidDifferentialVelocityOnRobinInterface());
decltype(auto) system_matrix = parent::GetSystemMatrix(numbering_subset, numbering_subset);
mass_matrix_ = std::make_unique<GlobalMatrix>(system_matrix);
......@@ -137,6 +139,8 @@ namespace HappyHeart
delta_fluid_mass_ = std::make_unique<GlobalVector>(GetWorkFluidMass());
{
decltype(auto) god_of_dof_manager = GodOfDofManager::GetInstance();
......
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