Commit 53cfd748 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#723 FSI/Newton: fix an erroneous numbering subset in solid residual...

#723 FSI/Newton: fix an erroneous numbering subset in solid residual definition, and validate the output of differential of solid variational formulation.
parent 062040b2
......@@ -154,33 +154,6 @@ Unknown4 = {
}
-- BoundaryCondition (robin case)
--BoundaryCondition = {
-- 0:Pseudo-elimination, 2:penalisation
-- Expected format: VALUE
-- Constraint: v >= 0 and v < 3
-- essentialBoundaryConditionsMethod = 0,
-- Comp1, Comp2 or Comp3
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'Comp1', 'Comp2', 'Comp3', 'Comp12', 'Comp23', 'Comp13', 'Comp123'})
-- component = { 'Comp1'},
-- Variable name the boundary condition apply to
-- Expected format: {"VALUE1", "VALUE2", ...}
-- variable = { 'fluid_velocity'},
-- Variable value at this boundary.
-- Expected format: {VALUE1, VALUE2, ...}
-- value = { 1. },
-- Index of the domain onto which the boundary condition is defined.
-- Expected format: {VALUE1, VALUE2, ...}
-- domain_index = { 4 }
--}
EssentialBoundaryCondition1 = {
......
......@@ -236,6 +236,7 @@ namespace HappyHeart
//! Access to the linear solver used to solve the diffferential of the solid variational formulation.
Wrappers::Petsc::Snes& GetNonCstDifferentialSolidSolver() noexcept;
private:
......
......@@ -84,7 +84,7 @@ namespace HappyHeart
}
{
const auto& solid_numbering_subset = god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::solid_velocity));
const auto& solid_numbering_subset = god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::solid_displacement));
solid_residual_ = std::make_unique<GlobalVector>(solid_numbering_subset);
AllocateGlobalVector(god_of_dof, *solid_residual_);
......
......@@ -167,7 +167,7 @@ namespace HappyHeart
return *differential_solid_solver_;
}
} // namespace FSI_EINS
......
......@@ -49,11 +49,32 @@ namespace HappyHeart
UpdateFluidDirichletCondition(differential::yes);
ImplicitFluidStep(differential::yes);
auto& fluid_varf = GetNonCstImplicitStepFluidVariationalFormulation();
{
const auto& fluid_sol = fluid_varf.GetSystemSolution(fluid_varf.GetNumberingSubset());
const PetscReal evaluation_state_min = fluid_sol.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = fluid_sol.Max(__FILE__, __LINE__).second;
std::cout << "deltaVel EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " << fluid_sol.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl; // OK
}
const auto& differential_fluid_residual = fluid_varf.ComputeResidual();
{
const PetscReal evaluation_state_min = differential_fluid_residual.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = differential_fluid_residual.Max(__FILE__, __LINE__).second;
std::cout << "differential_fluid_residual EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " << differential_fluid_residual.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl; // opposite of the Freefem output
}
const auto& solid_varf = SolidVariationalFormulationPolicyT::GetVariationalFormulation();
const auto& solid_numbering_subset = solid_varf.GetNumberingSubset();
const auto& solid_tangent = solid_varf.GetSystemMatrix(solid_numbering_subset, solid_numbering_subset);
auto& solution = *solid_displacement_inside_dh_;
......@@ -63,16 +84,37 @@ namespace HappyHeart
solid_residual,
__FILE__, __LINE__);
{
const PetscReal evaluation_state_min = solid_residual.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = solid_residual.Max(__FILE__, __LINE__).second;
std::cout << "on solid residual EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " << solid_residual.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl; // opposite of the Freefem output
}
const auto& solid_tangent = solid_varf.GetSystemMatrix(solid_numbering_subset, solid_numbering_subset);
// solid_tangent.View(mpi,__FILE__, __LINE__);
const auto& god_of_dof = parent::GetGodOfDof(EnumUnderlyingType(MeshIndex::mesh));
auto& dirichlet_bc =
Private::DirichletBoundaryConditionManager::GetInstance().GetNonCstDirichletBoundaryCondition(EnumUnderlyingType(BoundaryConditionIndex::solid));
god_of_dof.ApplyBoundaryCondition(dirichlet_bc, solid_residual);
GetNonCstDifferentialSolidSolver().SolveLinear(solid_tangent, solid_tangent,
solid_residual,
solution,
__FILE__, __LINE__);
//solution.View(mpi, __FILE__, __LINE__);
const PetscReal evaluation_state_min = solution.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = solution.Max(__FILE__, __LINE__).second;
{
const PetscReal evaluation_state_min = solution.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = solution.Max(__FILE__, __LINE__).second;
std::cout << "EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max << std::endl;
std::cout << "diff solid solution EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " << solution.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl; // opposite of the Freefem output
}
......@@ -275,11 +317,6 @@ namespace HappyHeart
}
SolidVariationalFormulationPolicyT::Solve();
const auto& solid_variational_formulation = SolidVariationalFormulationPolicyT::GetVariationalFormulation();
// solid_variational_formulation.GetSystemSolution(solid_variational_formulation.GetNumberingSubset()).template
// Print<MpiScale::processor_wise>(mpi, aitken_output_dir + "implicit_step_solid_solution.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