Commit 24b01992 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#820 Initial value of mixtVariables before Newton loop is now correct.

parent 997dc1b1
......@@ -66,12 +66,23 @@ namespace HappyHeart
corrected_values,
__FILE__, __LINE__);
// \todo #820 Sequence could probably be computed more efficiently (VelSHalfVhfZeroedOutOfRobinInterface
// is probably not required publicly in the process; we could probably compute directly contrib to monolithic
// from the original VelSHalfVhf.
auto& vel_contrib_on_vel_ns = variable_holder.GetVelSHalfVhfZeroedOutOfRobinInterface();
auto& vel_contrib_on_monolithic = variable_holder.GetNonCstWorkFluidMonolithic();
Wrappers::Petsc::MatMult(interpolator_holder.GetExpandVelocity().GetInterpolationMatrix(),
vel_contrib_on_vel_ns,
vel_contrib_on_monolithic,
__FILE__, __LINE__);
Wrappers::Petsc::AXPY(1.,
vel_contrib_on_monolithic,
corrected_values,
__FILE__, __LINE__);
variable_holder.template DevPrint<DevPhase::newton_fp>(variable_holder.GetVelSHalfVhf(),
"dirichlet_just_before_newton_fp_loop");
variable_holder.template DevPrint<DevPhase::newton_fp>(corrected_values,
"mixtVariables_just_before_newton_fp_loop");
corrected_values.UpdateGhosts(__FILE__, __LINE__);
}
......
......@@ -120,6 +120,11 @@ namespace HappyHeart
velSHalfVhf_zeroed_out_of_robin_interface_ = std::make_unique<GlobalVector>(GetVelSHalfVhf());
}
{
work_fluid_monolithic_ = std::make_unique<GlobalVector>(fluid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_mass_velocity_pressure)));
AllocateGlobalVector(fluid_god_of_dof, GetNonCstWorkFluidMonolithic());
}
}
......
......@@ -162,6 +162,9 @@ namespace HappyHeart
//! Non constant accessor to the \#820 [DEV] Vector defined on fluid velocity numbering subset.
GlobalVector& GetNonCstWorkFluidVelocity() const noexcept;
//! Non constant accessor to the \#820 [DEV] Vector defined on monolithic numbering subset.
GlobalVector& GetNonCstWorkFluidMonolithic() const noexcept;
//! Debug indexes...
unsigned int implicit_loop_index = 0u;
......@@ -233,6 +236,9 @@ namespace HappyHeart
//! \#820 [DEV] Vector defined on fluid velocity numbering subset.
mutable GlobalVector::unique_ptr work_fluid_velocity_ = nullptr;
//! \#820 [DEV] Vector defined on fluid monolithic numbering subset.
mutable GlobalVector::unique_ptr work_fluid_monolithic_ = nullptr;
};
......
......@@ -181,6 +181,13 @@ namespace HappyHeart
}
inline GlobalVector& VariableHolder::GetNonCstWorkFluidMonolithic() const noexcept
{
assert(!(!work_fluid_monolithic_));
return *work_fluid_monolithic_;
}
} // namespace PoromechanicsNS
......
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