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

#820 Solid displacement explicitly introduced and updated at the end of the loop.

parent 9fd13d0d
......@@ -37,9 +37,9 @@ namespace HappyHeart
assert(!storage.empty() && "You probably forgot to call Init() method just after the constructor of "
"your variational formulation!");
auto it = std::find_if(storage.cbegin(),
storage.cend(),
NumberingSubsetNS::FindIfConditionForPair<GlobalMatrix::unique_ptr>(row_numbering_subset,
const auto it = std::find_if(storage.cbegin(),
storage.cend(),
NumberingSubsetNS::FindIfConditionForPair<GlobalMatrix::unique_ptr>(row_numbering_subset,
col_numbering_subset));
assert(it != storage.cend());
......
......@@ -34,10 +34,10 @@ namespace HappyHeart
{
const auto& storage = GetStorage();
auto it = std::find_if(storage.cbegin(),
storage.cend(),
NumberingSubsetNS::FindIfCondition<GlobalVector::unique_ptr>(numbering_subset)
);
const auto it = std::find_if(storage.cbegin(),
storage.cend(),
NumberingSubsetNS::FindIfCondition<GlobalVector::unique_ptr>(numbering_subset)
);
assert(it != storage.cend());
assert(!(!*it));
......
......@@ -182,7 +182,8 @@ namespace HappyHeart
//! Enum class to tag each GlobalVector related to the solid.
enum class SolidIndex : std::size_t
{
displacement_k0 = 0,
displacement = 0,
displacement_k0,
H0,
delta_displacement,
dH_input_vector,
......
......@@ -40,7 +40,9 @@ namespace HappyHeart
iteration_index = 0u;
auto& solid_displacement = GetNonCstVector<SolidIndex::displacement>();
while (absolute_error > 1.e-10 && relative_error > 1.e-6 && iteration_index < 3u) // \todo #820 Should not remain hardcoded!
// \todo #820 iteration index sup value is obviously temporary for dev purposes...
{
......@@ -51,7 +53,7 @@ namespace HappyHeart
decltype(auto) numbering_subset = solid_varf.GetNumberingSubset();
decltype(auto) sol = solid_varf.GetSystemSolution(numbering_subset);
// \todo #820 Swap...
GetNonCstVector<SolidIndex::displacement_k0>().Copy(sol, __FILE__, __LINE__);
GetNonCstVector<SolidIndex::displacement_k0>().Copy(solid_displacement, __FILE__, __LINE__);
}
auto& implicit_step_fluid_varf = GetNonCstImplicitStepFluidVarf();
......@@ -69,6 +71,9 @@ namespace HappyHeart
decltype(auto) numbering_subset = solid_varf.GetNumberingSubset();
decltype(auto) sol = solid_varf.GetSystemSolution(numbering_subset);
// \todo #820 Check but probably not that useful: relevant value
GetNonCstVector<SolidIndex::displacement>().Copy(sol, __FILE__, __LINE__);
variable_holder.template DevPrint<DevPhase::none>(sol,
"displacement_after_solid_solve");
......@@ -118,6 +123,21 @@ namespace HappyHeart
}
}
// dispSr[]=dispSrk0[]-dispDelta;
solid_displacement.Copy(GetVector<SolidIndex::displacement_k0>(),
__FILE__, __LINE__);
Wrappers::Petsc::AXPY(-1.,
delta_displacement,
solid_displacement,
__FILE__, __LINE__);
{
variable_holder.template DevPrint<DevPhase::none>(solid_displacement,
"solid_disp_after_dH");
}
++iteration_index;
}
}
......
......@@ -94,6 +94,7 @@ namespace HappyHeart
SolidVariationalFormulationPolicyT::GetVariationalFormulation();
decltype(auto) solution = solid_varf.GetSystemSolution(solid_varf.GetNumberingSubset());
GetNonCstVectorPtr<SolidIndex::displacement>() = std::make_unique<GlobalVector>(solution);
GetNonCstVectorPtr<SolidIndex::displacement_k0>() = std::make_unique<GlobalVector>(solution);
GetNonCstVectorPtr<SolidIndex::H0>() = std::make_unique<GlobalVector>(solution);
GetNonCstVectorPtr<SolidIndex::delta_displacement>() = std::make_unique<GlobalVector>(solution);
......
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