Commit 57f5a1dc authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#723 FSI/Newton: introduce a new vector to store a quantity that wasn't kept...

#723 FSI/Newton: introduce a new vector to store a quantity that wasn't kept correctly during the imolicit differential calls. Not enough to solve my bug though.
parent f3b68b29
......@@ -240,6 +240,7 @@ namespace HappyHeart
{
velFromSr_on_interface = 0,
p2_vel_on_interface,
vel_last_implicit_solution,
Nvector
};
......
......@@ -77,6 +77,11 @@ namespace HappyHeart
std::move(bc_list),
*explicit_step_variational_formulation_);
GetNonCstVectorPtr<Fluid::vel_last_implicit_solution>() =
std::make_unique<GlobalVector>(numbering_subset);
HappyHeart::AllocateGlobalVector(god_of_dof, GetNonCstVector<Fluid::vel_last_implicit_solution>());
auto& formulation = this->GetNonCstImplicitStepFluidVariationalFormulation();
formulation.Init(input_parameter_data);
}
......@@ -195,7 +200,8 @@ namespace HappyHeart
const auto& fluid_numbering_subset = god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid));
const auto& fluid_on_interface_numbering_subset =
god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_on_interface));
ConformInterpolatorNS::SubsetOrSuperset fsi_2_fluid(fsi_felt_space,
fluid_on_interface_numbering_subset,
fluid_felt_space,
......@@ -235,7 +241,7 @@ namespace HappyHeart
differential_solid_solver_ = InitSolver<EnumUnderlyingType(SolverIndex::main_solver)>(mpi, input_parameter_data);
dH_solver_ = InitSolver<EnumUnderlyingType(SolverIndex::dh_solver)>(mpi, input_parameter_data);
{
const auto& disp = GetVector<Solid::dispSr>();
......@@ -344,6 +350,32 @@ namespace HappyHeart
std::cout << "DISPLACEMENT EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " << dispSr.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl; // OK
}
{
const auto& implicit_step_formulation = GetImplicitStepFluidVariationalFormulation();
const auto& interpolation_matrix = implicit_step_formulation.GetTowardVelocityInterpolator().GetInterpolationMatrix();
auto& explicit_step_formulation = GetNonCstExplicitStepVariationalFormulation();
Wrappers::Petsc::MatMult(interpolation_matrix,
GetVector<Fluid::vel_last_implicit_solution>(),
explicit_step_formulation.GetNonCstPreviousFluidVelocity(),
__FILE__, __LINE__);
std::cout << "================ AT THE END OF TIME ITERATION:\n";
{
const auto& dispSr = explicit_step_formulation.GetNonCstPreviousFluidVelocity();
const PetscReal evaluation_state_min = dispSr.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = dispSr.Max(__FILE__, __LINE__).second;
std::cout << "OLD VEL ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " << dispSr.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl; // OK
}
}
......
......@@ -355,7 +355,23 @@ namespace HappyHeart
Wrappers::Petsc::AssertNumericValues(implicit_step_fluid_formulation.GetSystemRhs(numbering_subset), __FILE__, __LINE__);
Wrappers::Petsc::AssertNumericValues(implicit_step_fluid_formulation.GetSystemSolution(numbering_subset), __FILE__, __LINE__);
#endif // NDEBUG
}
if (is_differential == differential::no)
{
std::cout << "SIZES = " << GetNonCstVector<Fluid::vel_last_implicit_solution>().GetProgramWiseSize(__FILE__, __LINE__)
<< "\t"
<< implicit_step_fluid_formulation.GetSystemSolution(numbering_subset).GetProgramWiseSize(__FILE__, __LINE__)
<< std::endl;
GetNonCstVector<Fluid::vel_last_implicit_solution>().Copy(implicit_step_fluid_formulation.GetSystemSolution(numbering_subset),
__FILE__, __LINE__);
}
else
std::cout << "DIFFERENTIAL CASE" << std::endl;
}
}
......
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