Commit 27c29972 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#723 FSI/Newton: compute the term SoF - Identity.

parent 7258c849
......@@ -207,6 +207,20 @@ namespace HappyHeart
//! Solid displacement before SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
GlobalVector& GetNonCstSolidDisplacementBeforeSoF() noexcept;
//! Solid displacement after SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
const GlobalVector& GetSolidDisplacementAfterSoF() const noexcept;
//! Solid displacement after SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
GlobalVector& GetNonCstSolidDisplacementAfterSoF() noexcept;
//! Evolution of solid displacement in the latest SoF computation.
const GlobalVector& GetSolidDisplacementEvolutionInSoF() const noexcept;
//! Evolution of solid displacement in the latest SoF computation.
GlobalVector& GetNonCstSolidDisplacementEvolutionInSoF() noexcept;
//! Solid displacement before SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
const GlobalVector& GetSolidDisplacementBeforeSoFOnInterface() const noexcept;
......@@ -235,6 +249,8 @@ namespace HappyHeart
GlobalVector::unique_ptr solid_displacement_before_SoF_on_interface_ = nullptr;
GlobalVector::unique_ptr solid_displacement_after_SoF_ = nullptr;
GlobalVector::unique_ptr solid_displacement_evolution_in_SoF_ = nullptr;
GlobalVector::unique_ptr solid_velocity_on_interface_ = nullptr;
GlobalVector::unique_ptr p2_solid_velocity_on_interface_ = nullptr;
......
......@@ -119,6 +119,8 @@ namespace HappyHeart
auto& solid_displacement_before_SoF = GetNonCstSolidDisplacementBeforeSoF();
HappyHeart::AllocateGlobalVector(god_of_dof, solid_displacement_before_SoF);
solid_displacement_evolution_in_SoF_ = std::make_unique<GlobalVector>(solid_displacement_before_SoF);
solid_displacement_before_SoF_on_interface_ =
std::make_unique<GlobalVector>(solid_numbering_subset_on_interface);
......
......@@ -98,7 +98,38 @@ namespace HappyHeart
return const_cast<GlobalVector&>(GetSolidDisplacementBeforeSoF());
}
template<class SolidVariationalFormulationPolicyT>
const GlobalVector& Model<SolidVariationalFormulationPolicyT>::GetSolidDisplacementAfterSoF() const noexcept
{
assert(!(!solid_displacement_after_SoF_));
return *solid_displacement_after_SoF_;
}
template<class SolidVariationalFormulationPolicyT>
GlobalVector& Model<SolidVariationalFormulationPolicyT>::GetNonCstSolidDisplacementAfterSoF() noexcept
{
return const_cast<GlobalVector&>(GetSolidDisplacementAfterSoF());
}
template<class SolidVariationalFormulationPolicyT>
const GlobalVector& Model<SolidVariationalFormulationPolicyT>::GetSolidDisplacementEvolutionInSoF() const noexcept
{
assert(!(!solid_displacement_evolution_in_SoF_));
return *solid_displacement_evolution_in_SoF_;
}
template<class SolidVariationalFormulationPolicyT>
GlobalVector& Model<SolidVariationalFormulationPolicyT>::GetNonCstSolidDisplacementEvolutionInSoF() noexcept
{
return const_cast<GlobalVector&>(GetSolidDisplacementEvolutionInSoF());
}
template<class SolidVariationalFormulationPolicyT>
const GlobalVector& Model<SolidVariationalFormulationPolicyT>::GetSolidDisplacementBeforeSoFOnInterface() const noexcept
{
......
......@@ -44,6 +44,10 @@ namespace HappyHeart
ImplicitSolidStep(output_dir);
UpdateSolidDisplacementAfterSoF();
// do
// {
......@@ -252,14 +256,24 @@ namespace HappyHeart
void Model<SolidVariationalFormulationPolicyT>
::UpdateSolidDisplacementAfterSoF()
{
auto& solid_displacement_after_SoF = *solid_displacement_after_SoF_;
auto& solid_displacement_after_SoF = GetNonCstSolidDisplacementAfterSoF();
const auto& solid_variational_formulation = SolidVariationalFormulationPolicyT::GetVariationalFormulation();
solid_displacement_after_SoF.Copy(solid_variational_formulation.GetSystemSolution(solid_variational_formulation.GetNumberingSubset()),
__FILE__, __LINE__);
const auto& mpi = parent::MpiHappyHeart();
auto& solid_displacement_evolution_in_SoF = GetNonCstSolidDisplacementEvolutionInSoF();
solid_displacement_evolution_in_SoF.Copy(solid_displacement_after_SoF, __FILE__, __LINE__);
Wrappers::Petsc::AXPY(-1.,
GetSolidDisplacementBeforeSoF(),
solid_displacement_evolution_in_SoF,
__FILE__, __LINE__);
// const auto& mpi = parent::MpiHappyHeart();
// solid_displacement_after_SoF.template
// Print<MpiScale::processor_wise>(mpi, aitken_output_dir + "solid_displacement_after_SoF.hhdata", __FILE__, __LINE__);
......
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