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

#1022 Remove the operators that are no longer used with 2x2 monolithic matrix.

parent d181b982
//! \file
//
//
// PressureContribToRhs.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 03/02/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_GLOBAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HPP_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_GLOBAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HPP_
# include "Parameters/Parameter.hpp"
# include "Operators/GlobalVariationalOperator/GlobalVariationalOperator.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Data/SolidDisplacement.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/ImplicitStep/ImplicitStepFluid/NewtonFixedPoint/LocalVariationalOperatorInstances/PressureContribToRhs.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Parameter/UpdatePressureAtQuadPt.hpp"
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace ImplicitStepFluidNS
{
namespace NewtonFixedPointNS
{
namespace GlobalVariationalOperatorNS
{
/*!
* \brief Implementation of global PressureContribToRhs operator.
*
* \todo Improve the comment by writing its mathematical definition!
*/
template<class HyperelasticLawT>
class PressureContribToRhs final
: public GlobalVariationalOperator
<
PressureContribToRhs<HyperelasticLawT>,
LocalVariationalOperatorNS::PressureContribToRhs<HyperelasticLawT>
>
{
public:
//! \copydoc doxygen_hide_alias_self
using self = PressureContribToRhs<HyperelasticLawT>;
//! Alias to unique pointer.
using const_unique_ptr = std::unique_ptr<const self>;
//! Returns the name of the operator.
static const std::string& ClassName();
//! Convenient alias to pinpoint the GlobalVariationalOperator parent.
using parent = GlobalVariationalOperator
<
PressureContribToRhs,
LocalVariationalOperatorNS::PressureContribToRhs<HyperelasticLawT>
>;
//! Friendship to the parent class so that the CRTP can reach private methods defined below.
friend parent;
public:
/// \name Special members.
///@{
/*!
* \brief Constructor.
*
*/
explicit PressureContribToRhs(const FEltSpace& felt_space,
const Unknown& pressure_unknown,
const GlobalVector& current_solid_displacement,
const ScalarParameter<>& fluid_density,
GlobalParameterOperatorNS::UpdatePressureAtQuadPt<HyperelasticLawT, DataNS::TimeLabel2::new_value>& update_pressure_operator,
const QuadratureRulePerTopology* const quadrature_rule_per_topology = nullptr);
//! Destructor.
~PressureContribToRhs() = default;
//! Copy constructor.
PressureContribToRhs(const PressureContribToRhs&) = default;
//! Move constructor.
PressureContribToRhs(PressureContribToRhs&&) = default;
//! Copy affectation.
PressureContribToRhs& operator=(const PressureContribToRhs&) = default;
//! Move affectation.
PressureContribToRhs& operator=(PressureContribToRhs&&) = default;
///@}
/*!
* \brief Assemble into one or several vectors.
*
* \tparam LinearAlgebraTupleT A tuple that may include \a GlobalVectorWithCoefficient objects.
*
* \param[in] global_vector_with_coeff_tuple List of global vectors into which the operator is
* assembled. These vectors are assumed to be already properly allocated.
* \param[in] domain Domain upon which the assembling takes place. Beware: if this domain is not a subset
* of the finite element space, assembling can only occur in a subset of the domain defined in the finite
* element space; if current \a domain is not a subset of finite element space one, assembling will occur
* upon the intersection of both.
*
*/
template<class LinearAlgebraTupleT>
void Assemble(LinearAlgebraTupleT&& global_vector_with_coeff_tuple,
const Domain& domain = Domain()) const;
private:
//! Solid displacement extended unknown.
const ExtendedUnknown& GetSolidDisplacementUnknown() const noexcept;
//! Reference to current solid displacement.
const GlobalVector& GetCurrentSolidDisplacement() const noexcept;
//! Update pressure operator.
GlobalParameterOperatorNS::UpdatePressureAtQuadPt<HyperelasticLawT, DataNS::TimeLabel2::new_value>& GetNonCstUpdatePressureOperator() const noexcept;
private:
//! Reference to current solid displacement.
const GlobalVector& solid_current_displacement_;
//! Solid displacement extended unknown.
const ExtendedUnknown& solid_displacement_unknown_;
//! Update pressure operator.
GlobalParameterOperatorNS::UpdatePressureAtQuadPt<HyperelasticLawT, DataNS::TimeLabel2::new_value>& update_pressure_operator_;
};
} // namespace GlobalVariationalOperatorNS
} // namespace NewtonFixedPointNS
} // namespace ImplicitStepFluidNS
} // namespace PoromechanicsNS
} // namespace HappyHeart
# include "ModelInstances/UnderDevelopment/Poromechanics/ImplicitStep/ImplicitStepFluid/NewtonFixedPoint/GlobalVariationalOperatorInstances/PressureContribToRhs.hxx"
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_GLOBAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HPP_
//! \file
//
//
// PressureContribToRhs.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 03/02/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_GLOBAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HXX_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_GLOBAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HXX_
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace ImplicitStepFluidNS
{
namespace NewtonFixedPointNS
{
namespace GlobalVariationalOperatorNS
{
template<class HyperelasticLawT>
PressureContribToRhs<HyperelasticLawT>
::PressureContribToRhs(const FEltSpace& felt_space,
const Unknown& pressure_unknown,
const GlobalVector& current_solid_displacement,
const ScalarParameter<>& fluid_density,
GlobalParameterOperatorNS::UpdatePressureAtQuadPt<HyperelasticLawT, DataNS::TimeLabel2::new_value>& update_pressure_operator,
const QuadratureRulePerTopology* const quadrature_rule_per_topology)
: parent(felt_space,
pressure_unknown,
std::move(quadrature_rule_per_topology),
AllocateGradientFEltPhi::yes,
DoComputeProcessorWiseLocal2Global::yes, // \todo #820 See if no ok
fluid_density,
update_pressure_operator.GetPressureAtQuadPt()),
solid_current_displacement_(current_solid_displacement),
solid_displacement_unknown_(felt_space.GetExtendedUnknown(UnknownManager::GetInstance().GetUnknown(EnumUnderlyingType(UnknownIndex::solid_displacement)))),
update_pressure_operator_(update_pressure_operator)
{ }
template<class HyperelasticLawT>
const std::string& PressureContribToRhs<HyperelasticLawT>::ClassName()
{
static std::string name("PressureContribToRhs");
return name;
}
template<class HyperelasticLawT>
template<class LinearAlgebraTupleT>
inline void PressureContribToRhs<HyperelasticLawT>
::Assemble(LinearAlgebraTupleT&& linear_algebra_tuple,
const Domain& domain) const
{
GetNonCstUpdatePressureOperator().Update();
parent::AssembleImpl(std::move(linear_algebra_tuple),
domain);
}
template<class HyperelasticLawT>
const GlobalVector& PressureContribToRhs<HyperelasticLawT>
::GetCurrentSolidDisplacement() const noexcept
{
return solid_current_displacement_;
}
template<class HyperelasticLawT>
const ExtendedUnknown& PressureContribToRhs<HyperelasticLawT>::GetSolidDisplacementUnknown() const noexcept
{
return solid_displacement_unknown_;
}
template<class HyperelasticLawT>
GlobalParameterOperatorNS::UpdatePressureAtQuadPt<HyperelasticLawT, DataNS::TimeLabel2::new_value>&
PressureContribToRhs<HyperelasticLawT>
::GetNonCstUpdatePressureOperator() const noexcept
{
return update_pressure_operator_;
}
} // namespace GlobalVariationalOperatorNS
} // namespace NewtonFixedPointNS
} // namespace ImplicitStepFluidNS
} // namespace PoromechanicsNS
} // namespace HappyHeart
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_GLOBAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HXX_
//! \file
//
//
// PressureContribToRhs.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 03/02/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_LOCAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HXX_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_LOCAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HXX_
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace ImplicitStepFluidNS
{
namespace NewtonFixedPointNS
{
namespace LocalVariationalOperatorNS
{
template<class HyperelasticLawT>
PressureContribToRhs<HyperelasticLawT>
::PressureContribToRhs(const ExtendedUnknown::vector_const_shared_ptr& unknown_list,
elementary_data_type&& a_elementary_data,
const ScalarParameter<>& fluid_density,
const ParameterAtQuadraturePoint<::HappyHeart::ParameterNS::Type::scalar>& pressure_at_quad_pt)
: LinearLocalVariationalOperator(unknown_list, std::move(a_elementary_data)),
fluid_density_(fluid_density),
pressure_at_quad_pt_(pressure_at_quad_pt)
{
assert(unknown_list.size() == 1ul);
}
template<class HyperelasticLawT>
const std::string& PressureContribToRhs<HyperelasticLawT>::ClassName()
{
static std::string name("PressureContribToRhs");
return name;
}
template<class HyperelasticLawT>
void PressureContribToRhs<HyperelasticLawT>::ComputeEltArray()
{
auto& elementary_data = GetNonCstElementaryData();
const auto& infos_at_quad_pt_list = elementary_data.GetInformationsAtQuadraturePointList();
auto& vector_result = elementary_data.GetNonCstVectorResult();
const auto& geom_elt = elementary_data.GetCurrentGeomElt();
const auto& ref_felt = elementary_data.GetRefFElt(GetNthUnknown());
const auto Nnode = static_cast<std::size_t>(ref_felt.Nnode());
decltype(auto) pressure_at_quad_pt = GetPressureAtQuadPt();
for (const auto& infos_at_quad_pt : infos_at_quad_pt_list)
{
const auto& phi = infos_at_quad_pt.GetRefFEltPhi();
const auto& quad_pt = infos_at_quad_pt.GetQuadraturePoint();
const double hyperelastic_contrib = pressure_at_quad_pt.GetValue(quad_pt, geom_elt);
const double factor = - quad_pt.GetWeight()
* infos_at_quad_pt.GetAbsoluteValueJacobianDeterminant()
* hyperelastic_contrib;
for (auto node_index = 0ul; node_index < Nnode; ++node_index)
{
int dof_index = static_cast<int>(node_index);
vector_result(dof_index) += factor * phi(dof_index);
}
}
}
template<class HyperelasticLawT>
inline const ScalarParameter<>& PressureContribToRhs<HyperelasticLawT>::GetFluidDensity() const noexcept
{
return fluid_density_;
}
template<class HyperelasticLawT>
inline const ParameterAtQuadraturePoint<::HappyHeart::ParameterNS::Type::scalar>&
PressureContribToRhs<HyperelasticLawT>::GetPressureAtQuadPt() const noexcept
{
return pressure_at_quad_pt_;
}
} // namespace LocalVariationalOperatorNS
} // namespace NewtonFixedPointNS
} // namespace ImplicitStepFluidNS
} // namespace PoromechanicsNS
} // namespace HappyHeart
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_IMPLICIT_STEP_x_IMPLICIT_STEP_FLUID_x_NEWTON_FIXED_POINT_x_LOCAL_VARIATIONAL_OPERATOR_INSTANCES_x_PRESSURE_CONTRIB_TO_RHS_HXX_
......@@ -29,7 +29,6 @@
# include "ModelInstances/UnderDevelopment/Poromechanics/GlobalVariationalOperatorInstances/TransientSource.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/GlobalVariationalOperatorInstances/ScalarDivVectorial.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/ImplicitStep/ImplicitStepFluid/NewtonFixedPoint/GlobalVariationalOperatorInstances/T33.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/ImplicitStep/ImplicitStepFluid/NewtonFixedPoint/GlobalVariationalOperatorInstances/T21.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/ImplicitStep/ImplicitStepFluid/GlobalVariationalOperatorInstances/Darcy.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/ImplicitStep/ImplicitStepFluid/NewtonFixedPoint/GlobalVariationalOperatorInstances/HybridVector.hpp"
......@@ -153,9 +152,6 @@ namespace HappyHeart
//! Friendship to SnesInterface.
friend struct SolverNS::SnesInterface<self>;
//! Alias to t21 type.
using t21_type = GlobalVariationalOperatorNS::T21<HyperelasticLawT>;
//! Alias to fluid mass data crtp.
using fluid_mass_data_parent =
::HappyHeart::PoromechanicsNS::Crtp::FluidmassData<self, Utilities::Access::read_and_write>;
......@@ -275,13 +271,13 @@ namespace HappyHeart
//! Constant accessor to the darcy vector after Newton FP solve.
const GlobalVector& GetDarcyVector() const noexcept;
//! Constant accessor to the matrix obtained after convergence of Newton FP with block T21 updated.
//! Constant accessor to the matrix obtained after convergence of Newton FP
const GlobalMatrix& GetMonolithicMatrixAfterNewtonFP() const noexcept;
/*!
* \brief Constant accessor to the matrix obtained after convergence of Newton FP with block T21
* \brief Constant accessor to the matrix obtained after convergence of Newton FP
* updated and without Dirichlet condition in T33 block
*/
const GlobalMatrix& GetMonolithicMatrixAfterNewtonFPWithoutDirichlet() const noexcept;
......@@ -315,15 +311,14 @@ namespace HappyHeart
private:
/*!
* \brief Non constant accessor to the matrix obtained after convergence of Newton FP with block T21
* updated.
* \brief Non constant accessor to the matrix obtained after convergence of Newton FP
*/
GlobalMatrix& GetNonCstMonolithicMatrixAfterNewtonFP() noexcept;
/*!
* \brief Non constant accessor to the matrix obtained after convergence of Newton FP with block T21
* updated and without Dirichlet condition in T33 block
* \brief Non constant accessor to the matrix obtained after convergence of Newton FP
* without Dirichlet condition in T33 block
*/
GlobalMatrix& GetNonCstMonolithicMatrixAfterNewtonFPWithoutDirichlet() noexcept;
......@@ -411,9 +406,6 @@ namespace HappyHeart
//! Constant accessor to the mass operator for fluid pressure.
const ::HappyHeart::GlobalVariationalOperatorNS::Mass& GetMassOperatorFluidPressure() const noexcept;
//! Constant accessor to the t21 operator.
const GlobalVariationalOperatorNS::T21<HyperelasticLawT>& GetT21Operator() const noexcept;
//! Constant accessor to the mass div Velocity operator.
const scalar_div_vectorial_type& GetMassDivVelocity() const noexcept;
......@@ -619,8 +611,6 @@ namespace HappyHeart
//! Pressure div Velocity operator.
scalar_div_vectorial_type::const_unique_ptr pressure_div_velocity_ = nullptr;
//! T21 operator.
typename t21_type::const_unique_ptr t21_operator_ = nullptr;
///@}
......@@ -677,12 +667,12 @@ namespace HappyHeart
///@}
/*!
* \brief Matrix obtained after convergence of Newton FP with block T21 updated.
* \brief Matrix obtained after convergence of Newton FP
*/
GlobalMatrix::unique_ptr monolithic_matrix_after_newton_FP_ = nullptr;
/*!
* \brief Matrix obtained after convergence of Newton FP with block T21 updated and without
* \brief Matrix obtained after convergence of Newton FP without
* Dirichlet condition in T33 block.
*/
GlobalMatrix::unique_ptr monolithic_matrix_after_newton_FP_without_dirichlet_ = nullptr;
......
......@@ -359,6 +359,7 @@ namespace HappyHeart
"darcy");
// \todo #1022 Check in Bruno's note if contribution is to be added here.
{
DataNS::Monolithic::global_vector_temporary_manager work(monolithic_data);
auto& contribution = work.GetNonCstVector();
......
......@@ -208,27 +208,6 @@ namespace HappyHeart
decltype(auto) solid_displacement_data = this->GetSolidDisplacementData();
decltype(auto) new_fluid_pressure_data = this->GetNonCstNewFluidPressureData();
{
decltype(auto) god_of_dof_manager = GodOfDofManager::GetInstance();
decltype(auto) solid_god_of_dof =
god_of_dof_manager.GetGodOfDof(EnumUnderlyingType(MeshIndex::solid));
decltype(auto) solid_felt_space =
solid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::solid));
decltype(auto) hyperelastic_law = GetHyperelasticLaw();
t21_operator_ =
std::make_unique<t21_type>(solid_felt_space,