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

#1022 Fluidmass: remove attributes that are finally not necessary.

parent 8cf30352
......@@ -63,8 +63,8 @@ namespace HappyHeart
current_value_[solid_index] = std::make_unique<GlobalVector>(new_value);
former_value_[solid_index] = std::make_unique<GlobalVector>(new_value);
new_minus_current_[solid_index] = std::make_unique<GlobalVector>(new_value);
current_minus_former_[solid_index] = std::make_unique<GlobalVector>(new_value);
new_minus_current_ = std::make_unique<GlobalVector>(new_value);
current_minus_former_ = std::make_unique<GlobalVector>(new_value);
delta_on_solid_ = std::make_unique<GlobalVector>(new_value);
}
......@@ -81,8 +81,6 @@ namespace HappyHeart
AllocateGlobalVector(fluid_god_of_dof, value);
former_value_[fluid_index] = std::make_unique<GlobalVector>(value);
new_minus_current_[fluid_index] = std::make_unique<GlobalVector>(value);
current_minus_former_[fluid_index] = std::make_unique<GlobalVector>(value);
global_vector_temporary_fluid_parent::InitGlobalVectorTemporary(value);
}
......@@ -115,41 +113,20 @@ namespace HappyHeart
fluid_mass_unknown,
GetFormer());
new_minus_current_as_param_[solid_index] =
new_minus_current_as_param_ =
std::make_unique<scalar_at_dof_type>("New - current fluid mass",
solid_mesh,
felt_space,
fluid_mass_unknown,
GetNewMinusCurrentOnSolid());
current_minus_former_as_param_[solid_index] =
current_minus_former_as_param_ =
std::make_unique<scalar_at_dof_type>("Current - former fluid mass",
solid_mesh,
felt_space,
fluid_mass_unknown,
GetCurrentMinusFormerOnSolid());
decltype(auto) fluid_mesh = fluid_god_of_dof.GetGeometricMeshRegion();
const auto& fluid_felt_space = fluid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fluid));
new_minus_current_as_param_[fluid_index] =
std::make_unique<scalar_at_dof_type>("New - current fluid mass on fluid",
fluid_mesh,
fluid_felt_space,
fluid_mass_unknown,
GetNewMinusCurrentOnFluid());
current_minus_former_as_param_[fluid_index] =
std::make_unique<scalar_at_dof_type>("Current - former fluid mass on fluid",
fluid_mesh,
fluid_felt_space,
fluid_mass_unknown,
GetCurrentMinusFormerOnFluid());
decltype(auto) inlet_border_felt_space
= solid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::solid_inlet_border));
......@@ -198,11 +175,10 @@ namespace HappyHeart
const GlobalVector& Fluidmass::GetNewMinusCurrentOnSolid() const noexcept
{
constexpr auto solid_index = EnumUnderlyingType(InternalMeshIndex::solid);
assert(!(!new_minus_current_[solid_index]));
assert(!(!new_minus_current_));
decltype(auto) new_value = GetNew();
auto& ret = *new_minus_current_[solid_index];
auto& ret = *new_minus_current_;
if (new_minus_current_on_solid_tag_ != GetValueTag())
{
......@@ -216,17 +192,16 @@ namespace HappyHeart
new_minus_current_on_solid_tag_ = GetValueTag();
}
return *new_minus_current_[solid_index];
return *new_minus_current_;
}
const GlobalVector& Fluidmass::GetCurrentMinusFormerOnSolid() const noexcept
{
constexpr auto solid_index = EnumUnderlyingType(InternalMeshIndex::solid);
assert(!(!current_minus_former_[solid_index]));
assert(!(!current_minus_former_));
decltype(auto) current_value = GetCurrent();
auto& ret = *current_minus_former_[solid_index];
auto& ret = *current_minus_former_;
if (current_minus_former_on_solid_tag_ != GetValueTag())
{
......@@ -240,52 +215,11 @@ namespace HappyHeart
current_minus_former_on_solid_tag_ = GetValueTag();
}
return *current_minus_former_[solid_index];
}
const GlobalVector& Fluidmass::GetNewMinusCurrentOnFluid() const noexcept
{
constexpr auto fluid_index = EnumUnderlyingType(InternalMeshIndex::fluid);
assert(!(!new_minus_current_[fluid_index]));
auto& ret = *new_minus_current_[fluid_index];
if (new_minus_current_on_fluid_tag_ != GetValueTag())
{
Wrappers::Petsc::MatMult(GetInterpolatorHolder().GetMatrixFluidmassSolidToFluid(),
GetNewMinusCurrentOnSolid(),
ret,
__FILE__, __LINE__);
new_minus_current_on_fluid_tag_ = GetValueTag();
}
return *new_minus_current_[fluid_index];
}
const GlobalVector& Fluidmass::GetCurrentMinusFormerOnFluid() const noexcept
{
constexpr auto fluid_index = EnumUnderlyingType(InternalMeshIndex::fluid);
assert(!(!current_minus_former_[fluid_index]));
auto& ret = *current_minus_former_[fluid_index];
if (current_minus_former_on_fluid_tag_ != GetValueTag())
{
Wrappers::Petsc::MatMult(GetInterpolatorHolder().GetMatrixFluidmassSolidToFluid(),
GetCurrentMinusFormerOnSolid(),
ret,
__FILE__, __LINE__);
current_minus_former_on_fluid_tag_ = GetValueTag();
}
return *current_minus_former_[fluid_index];
return *current_minus_former_;
}
} // namespace DataNS
......
......@@ -176,18 +176,7 @@ namespace HappyHeart
*/
void ReevaluateCurrentMinusFormerOnSolid() const noexcept;
/*!
* \brief Same as GetNewMinusCurrentOnFluid() except no value returned.
*/
void ReevaluateNewMinusCurrentOnFluid() const noexcept;
/*!
* \brief Same as GetCurrentMinusFormerOnFluid() except no value returned.
*/
void ReevaluateCurrentMinusFormerOnFluid() const noexcept;
//! Access to new fluid mass parameter at iteration {n + 1}.
const ParameterAtDof<ParameterNS::Type::scalar>& GetNewAsParam() const noexcept;
......@@ -203,13 +192,7 @@ namespace HappyHeart
//! Access to current minus former fluid mass parameter.
const ParameterAtDof<ParameterNS::Type::scalar>& GetCurrentMinusFormerOnSolidAsParam() const noexcept;
//! Access to new minus current fluid mass parameter.
const ParameterAtDof<ParameterNS::Type::scalar>& GetNewMinusCurrentOnFluidAsParam() const noexcept;
//! Access to current minus former fluid mass parameter.
const ParameterAtDof<ParameterNS::Type::scalar>& GetCurrentMinusFormerOnFluidAsParam() const noexcept;
/*!
* \brief Parameter that encapsulates current fluid_mass_vector on the inlet border.
*/
......@@ -262,20 +245,7 @@ namespace HappyHeart
//! Non constant accessor to projection onto fluid mesh value at iteration {n - 1}.
GlobalVector& GetNonCstFormerOnFluid() noexcept;
/*!
*\brief Constant accessor to the new minus current fluid mass expressed at dofs of the fluid mesh.
*
* The vector is automatically updated if need be.
*/
const GlobalVector& GetNewMinusCurrentOnFluid() const noexcept;
/*!
*\brief Constant accessor to the current minus former fluid mass expressed at dofs of the fluid mesh.
*
* The vector is automatically updated if need be.
*/
const GlobalVector& GetCurrentMinusFormerOnFluid() const noexcept;
///@}
//! Interpolator holder.
......@@ -319,11 +289,11 @@ namespace HappyHeart
//! Fluid mass expressed at dofs from iteration {n - 1}. . First value is for fluid mesh, the other for solid.
GlobalVector::array_unique_ptr<2> former_value_ = { { nullptr, nullptr } };
//! Difference new - current expressed at dofs. First value is for fluid mesh, the other for solid.
GlobalVector::array_unique_ptr<2> new_minus_current_ = { { nullptr, nullptr } };
//! Difference new - current expressed at dofs on solid mesh.
GlobalVector::unique_ptr new_minus_current_ = nullptr;
//! Difference current - former expressed at dofs. First value is for fluid mesh, the other for solid.
GlobalVector::array_unique_ptr<2> current_minus_former_ = { { nullptr, nullptr } };
//! Difference current - former expressed at dofs on solid mesh.
GlobalVector::unique_ptr current_minus_former_ = nullptr;
/*!
......@@ -343,22 +313,6 @@ namespace HappyHeart
mutable unsigned int new_minus_current_on_solid_tag_ = NumericNS::UninitializedIndex<unsigned int>();
/*!
* \brief Tag used to check whether the current_minus_former_on_fluid_ is up-to-date.
*
* If this tag is equal to GetValueTag(); current_minus_former_on_fluid_ already holds the correct value and doesn't
* need to be recomputed.
*/
mutable unsigned int current_minus_former_on_fluid_tag_ = NumericNS::UninitializedIndex<unsigned int>();
/*!
* \brief Tag used to check whether the new_minus_current_on_fluid_ is up-to-date.
*
* If this tag is equal to GetValueTag(); new_minus_current_on_fluid_ already holds the correct value and doesn't
* need to be recomputed.
*/
mutable unsigned int new_minus_current_on_fluid_tag_ = NumericNS::UninitializedIndex<unsigned int>();
//! Delta fluid mass (for dH computation).
GlobalVector::unique_ptr delta_on_solid_ = nullptr;
......@@ -383,10 +337,10 @@ namespace HappyHeart
ParameterAtDof<ParameterNS::Type::scalar>::array_unique_ptr<2> former_value_as_param_ = { { nullptr, nullptr } };
//! Parameter that encapsulates new minus current fluid_mass_vector, expressed on the solid mesh.
ParameterAtDof<ParameterNS::Type::scalar>::array_unique_ptr<2> new_minus_current_as_param_ = { { nullptr, nullptr } };
ParameterAtDof<ParameterNS::Type::scalar>::unique_ptr new_minus_current_as_param_ = nullptr;
//! Parameter that encapsulates new minus current fluid_mass_vector, expressed on the solid mesh.
ParameterAtDof<ParameterNS::Type::scalar>::array_unique_ptr<2> current_minus_former_as_param_ = { { nullptr, nullptr } };
ParameterAtDof<ParameterNS::Type::scalar>::unique_ptr current_minus_former_as_param_ = nullptr;
//! Parameter that encapsulates current fluid_mass_vector, expressed on the solid mesh.
ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None>::unique_ptr
......
......@@ -95,8 +95,8 @@ namespace HappyHeart
{
ReevaluateNewMinusCurrentOnSolid();
assert(!(!new_minus_current_as_param_[EnumUnderlyingType(InternalMeshIndex::solid)]));
return *new_minus_current_as_param_[EnumUnderlyingType(InternalMeshIndex::solid)];
assert(!(!new_minus_current_as_param_));
return *new_minus_current_as_param_;
}
......@@ -106,35 +106,12 @@ namespace HappyHeart
{
ReevaluateCurrentMinusFormerOnSolid();
assert(!(!current_minus_former_as_param_[EnumUnderlyingType(InternalMeshIndex::solid)]));
return *current_minus_former_as_param_[EnumUnderlyingType(InternalMeshIndex::solid)];
assert(!(!current_minus_former_as_param_));
return *current_minus_former_as_param_;
}
inline const ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None>&
Fluidmass
::GetNewMinusCurrentOnFluidAsParam() const noexcept
{
ReevaluateNewMinusCurrentOnFluid();
assert(!(!new_minus_current_as_param_[EnumUnderlyingType(InternalMeshIndex::fluid)]));
return *new_minus_current_as_param_[EnumUnderlyingType(InternalMeshIndex::fluid)];
}
inline const ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None>&
Fluidmass
::GetCurrentMinusFormerOnFluidAsParam() const noexcept
{
ReevaluateCurrentMinusFormerOnFluid();
assert(!(!current_minus_former_as_param_[EnumUnderlyingType(InternalMeshIndex::fluid)]));
return *current_minus_former_as_param_[EnumUnderlyingType(InternalMeshIndex::fluid)];
}
inline const GlobalVector& Fluidmass::GetDeltaOnSolid() const noexcept
{
assert(!(!delta_on_solid_));
......@@ -197,18 +174,6 @@ namespace HappyHeart
}
inline void Fluidmass::ReevaluateNewMinusCurrentOnFluid() const noexcept
{
decltype(auto) new_value = GetNewMinusCurrentOnFluid(); // lazy reevaluation may occur here.
static_cast<void>(new_value);
}
inline void Fluidmass::ReevaluateCurrentMinusFormerOnFluid() const noexcept
{
decltype(auto) new_value = GetCurrentMinusFormerOnFluid(); // lazy reevaluation may occur here.
static_cast<void>(new_value);
}
inline const InterpolatorHolder& Fluidmass::GetInterpolatorHolder() const noexcept
......
Supports Markdown
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