Commit 062040b2 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#723 FSI/Newton: invert a sign to follow same convention as Freefem's script.

parent 20e8feb7
......@@ -264,7 +264,7 @@ EssentialBoundaryCondition3 = {
Mesh1 = {
-- Path of the mesh file to use.
-- Expected format: "VALUE"
mesh = "${HOME}/Codes/HappyHeart/Data/Mesh/ThTotal2Dsmall.mesh",
mesh = "${HOME}/Codes/HappyHeart/Data/Mesh/ThTotal2D.mesh",
-- Format of the input mesh.
-- Expected format: "VALUE"
......
......@@ -45,6 +45,7 @@ namespace HappyHeart
UpdateSolidDisplacementAfterSoF();
UpdateFluidDirichletCondition(differential::yes);
ImplicitFluidStep(differential::yes);
auto& fluid_varf = GetNonCstImplicitStepFluidVariationalFormulation();
......@@ -54,7 +55,7 @@ namespace HappyHeart
const auto& solid_numbering_subset = solid_varf.GetNumberingSubset();
const auto& solid_tangent = solid_varf.GetSystemMatrix(solid_numbering_subset, solid_numbering_subset);
// auto& solid_residual = *solid_displacement_inside_dh_;
auto& solution = *solid_displacement_inside_dh_;
auto& solid_residual = GetNonCstSolidResidual();
Wrappers::Petsc::MatMultTranspose(GetInterpolationMatrixSolid2FluidVelocity(),
......@@ -62,10 +63,16 @@ namespace HappyHeart
solid_residual,
__FILE__, __LINE__);
// GetNonCstDifferentialSolidSolver().
GetNonCstDifferentialSolidSolver().SolveLinear(solid_tangent, solid_tangent,
solid_residual,
solution,
__FILE__, __LINE__);
// SOLVE LINEAR HERE!
solid_residual.View(mpi, __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;
std::cout << "EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max << std::endl;
......@@ -307,10 +314,10 @@ namespace HappyHeart
auto& solid_displacement_evolution_in_SoF = GetNonCstSolidDisplacementEvolutionInSoF();
solid_displacement_evolution_in_SoF.Copy(solid_displacement_after_SoF, __FILE__, __LINE__);
solid_displacement_evolution_in_SoF.Copy(GetSolidDisplacementBeforeSoF(), __FILE__, __LINE__);
Wrappers::Petsc::AXPY(-1.,
GetSolidDisplacementBeforeSoF(),
solid_displacement_after_SoF,
solid_displacement_evolution_in_SoF,
__FILE__, __LINE__);
......@@ -320,6 +327,12 @@ namespace HappyHeart
__FILE__, __LINE__);
const PetscReal evaluation_state_min = solid_displacement_evolution_in_SoF.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = solid_displacement_evolution_in_SoF.Max(__FILE__, __LINE__).second;
std::cout << "H0 EXTREMA ARE " << evaluation_state_min << " and " << evaluation_state_max
<< " on " <<solid_displacement_evolution_in_SoF.GetProgramWiseSize(__FILE__, __LINE__) << " elements." << std::endl;
// const auto& mpi = parent::MpiHappyHeart();
......
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