Commit 9fd13d0d authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#820 Reactivate the computation of relative and absolute norm in the loop in...

#820 Reactivate the computation of relative and absolute norm in the loop in Forward(). Currently it doesn't work yet as I have not yet modified the values of displacement and velocity for the next loop, resulting in the same computation repeated endlessly.
parent e6bf12b8
......@@ -23,7 +23,8 @@ namespace HappyHeart
template<class SolidVariationalFormulationPolicyT>
void Model<SolidVariationalFormulationPolicyT>::Forward()
{
// decltype(auto) mpi = parent::MpiHappyHeart();
decltype(auto) mpi = parent::MpiHappyHeart();
UpdatePorosity();
auto& explicit_step_varf = GetNonCstExplicitStepVariationalFormulation();
......@@ -40,9 +41,11 @@ namespace HappyHeart
while (absolute_error > 1.e-10 && relative_error > 1.e-6 && iteration_index < 1u) // \todo #820 Should not remain hardcoded!
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...
{
std::cout << "ABSOLUTE ERROR = " << absolute_error << " REL = " << relative_error << std::endl;
{
decltype(auto) solid_varf = SolidVariationalFormulationPolicyT::GetVariationalFormulation();
decltype(auto) numbering_subset = solid_varf.GetNumberingSubset();
......@@ -97,21 +100,22 @@ namespace HappyHeart
delta_displacement,
__FILE__, __LINE__);
{
variable_holder.template DevPrint<DevPhase::none>(delta_displacement,
"disp_delta_after_dH");
}
// \todo #820 Adapt following block to poro case (it was directly lifted from FSI!);
{
// const double norm = Wrappers::Petsc::NormL2(mpi, delta_displacement, __FILE__, __LINE__);
//
// if (iteration_index == 0u)
// absolute_error = norm;
// else
// {
// assert(absolute_error > 1.e-10); // \todo #744 Should be here exactly same condition as in the while.
//
// relative_error = norm / absolute_error;
// }
const double norm = Wrappers::Petsc::NormL2(mpi, delta_displacement, __FILE__, __LINE__);
if (iteration_index == 0u)
absolute_error = norm;
else
{
assert(absolute_error > 1.e-10); // \todo #744 Should be here exactly same condition as in the while.
relative_error = norm / absolute_error;
}
}
++iteration_index;
......@@ -238,8 +242,8 @@ namespace HappyHeart
implicit_step_varf.PerformDifferential();
// We can't take directly the internal pointer of a wrapped vector which pattern would be similar to input_displ_vector
// : residual computation is wrong if we do.
// We can't take directly the internal pointer of a wrapped vector which pattern would be similar to
// input_displ_vector: residual computation is wrong if we do.
auto error_code = VecCopy(implicit_step_varf.GetInnerLoopVarf().GetDeltaDisplacement().Internal(),
petsc_output_vector);
......
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