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

#723 FSI: Add a new accessor in Explicit formulation.

parent 5e7db41a
......@@ -191,7 +191,7 @@ namespace HappyHeart
{
const auto& mass_fluid_velocity = GetMassFluidVelocity();
const auto& previous_iteration = GetNonCstPreviousFluidVelocity();
const auto& previous_iteration = GetPreviousFluidVelocity();
Wrappers::Petsc::MatMult(mass_fluid_velocity, previous_iteration, residual_rhs, __FILE__, __LINE__);
......
......@@ -166,6 +166,8 @@ namespace HappyHeart
GlobalVector& GetNonCstPreviousFluidVelocity() noexcept;
const GlobalVector& GetPreviousFluidVelocity() const noexcept;
private:
......
......@@ -118,13 +118,20 @@ namespace HappyHeart
}
inline GlobalVector& ExplicitStepVariationalFormulation::GetNonCstPreviousFluidVelocity() noexcept
inline const GlobalVector& ExplicitStepVariationalFormulation::GetPreviousFluidVelocity() const noexcept
{
assert(!(!previous_fluid_velocity_));
return *previous_fluid_velocity_;
}
inline GlobalVector& ExplicitStepVariationalFormulation::GetNonCstPreviousFluidVelocity() noexcept
{
return const_cast<GlobalVector&>(GetPreviousFluidVelocity());
}
inline const GlobalMatrix& ExplicitStepVariationalFormulation::GetResidualMatrix() const noexcept
{
assert(!(!residual_matrix_));
......
......@@ -299,6 +299,27 @@ namespace HappyHeart
const auto& residual = explicit_step_formulation.ComputeResidual();
residual.template Print<MpiScale::processor_wise>(mpi, output_dir + "explicit_step_fluid_residual.hhdata",
__FILE__, __LINE__);
{
const auto& dispSdelta = explicit_step_formulation.GetSystemSolution(numbering_subset);
const PetscReal evaluation_state_min = dispSdelta.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = dispSdelta.Max(__FILE__, __LINE__).second;
std::cout << "Explicit solution EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " << dispSdelta.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl; // OK
}
{
const auto& dispSdelta = residual;
const PetscReal evaluation_state_min = dispSdelta.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = dispSdelta.Max(__FILE__, __LINE__).second;
std::cout << "Explicit residual EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " << dispSdelta.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl; // OK
}
}
......
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