Commit 792e3451 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1022 Create a NewFluidPressure data which groups the newly defined parameters...

#1022 Create a NewFluidPressure data which groups the newly defined parameters at quadrature points for fluid pressure. This class should replace FluidPressure (and renamed that way at that moment...).
parent e7b5eb52
......@@ -1710,6 +1710,10 @@
BE97E3E21CC90FF600AB5FF8 /* Hexahedron27.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE97E3DC1CC90FF600AB5FF8 /* Hexahedron27.hpp */; };
BE97E3E31CC90FF600AB5FF8 /* Hexahedron8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE97E3DD1CC90FF600AB5FF8 /* Hexahedron8.cpp */; };
BE97E3E41CC90FF600AB5FF8 /* Hexahedron8.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE97E3DE1CC90FF600AB5FF8 /* Hexahedron8.hpp */; };
BE99AACD1DBF62F400ADBB1A /* NewFluidPressure.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE99AAC91DBF62F400ADBB1A /* NewFluidPressure.hpp */; };
BE99AACE1DBF62F400ADBB1A /* NewFluidPressure.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE99AACA1DBF62F400ADBB1A /* NewFluidPressure.hxx */; };
BE99AAD11DBF87AF00ADBB1A /* NewFluidPressureData.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE99AACF1DBF87AF00ADBB1A /* NewFluidPressureData.hpp */; };
BE99AAD21DBF87AF00ADBB1A /* NewFluidPressureData.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE99AAD01DBF87AF00ADBB1A /* NewFluidPressureData.hxx */; };
BE9B82731D816B3700BA174F /* TetrahedronP1Bubble.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE9B82711D816B3700BA174F /* TetrahedronP1Bubble.cpp */; };
BE9B82741D816B3700BA174F /* TetrahedronP1Bubble.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE9B82721D816B3700BA174F /* TetrahedronP1Bubble.hpp */; };
BE9B82841D81881E00BA174F /* Order0.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE9B827C1D81881E00BA174F /* Order0.hpp */; };
......@@ -6170,6 +6174,10 @@
BE97E3DC1CC90FF600AB5FF8 /* Hexahedron27.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Hexahedron27.hpp; sourceTree = "<group>"; };
BE97E3DD1CC90FF600AB5FF8 /* Hexahedron8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Hexahedron8.cpp; sourceTree = "<group>"; };
BE97E3DE1CC90FF600AB5FF8 /* Hexahedron8.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Hexahedron8.hpp; sourceTree = "<group>"; };
BE99AAC91DBF62F400ADBB1A /* NewFluidPressure.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = NewFluidPressure.hpp; path = Data/NewFluidPressure.hpp; sourceTree = "<group>"; };
BE99AACA1DBF62F400ADBB1A /* NewFluidPressure.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = NewFluidPressure.hxx; path = Data/NewFluidPressure.hxx; sourceTree = "<group>"; };
BE99AACF1DBF87AF00ADBB1A /* NewFluidPressureData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = NewFluidPressureData.hpp; path = Crtp/NewFluidPressureData.hpp; sourceTree = "<group>"; };
BE99AAD01DBF87AF00ADBB1A /* NewFluidPressureData.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = NewFluidPressureData.hxx; path = Crtp/NewFluidPressureData.hxx; sourceTree = "<group>"; };
BE9A3BBD1CEC5C3D00210EB8 /* Topology.doxygen */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; path = Topology.doxygen; sourceTree = "<group>"; };
BE9B82711D816B3700BA174F /* TetrahedronP1Bubble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TetrahedronP1Bubble.cpp; sourceTree = "<group>"; };
BE9B82721D816B3700BA174F /* TetrahedronP1Bubble.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TetrahedronP1Bubble.hpp; sourceTree = "<group>"; };
......@@ -9475,6 +9483,8 @@
BE15E40E1D6DC67E0046E1B2 /* FluidPressure.cpp */,
BE15E40F1D6DC67E0046E1B2 /* FluidPressure.hpp */,
BE15E4101D6DC67E0046E1B2 /* FluidPressure.hxx */,
BE99AAC91DBF62F400ADBB1A /* NewFluidPressure.hpp */,
BE99AACA1DBF62F400ADBB1A /* NewFluidPressure.hxx */,
BE15E4161D6DE6310046E1B2 /* Crtp */,
);
name = Data;
......@@ -12484,6 +12494,8 @@
BE11CF171D785A590036837C /* FluidmassData.hxx */,
BE2509961D7879C700664130 /* FluidPressureData.hpp */,
BE2509971D7879C700664130 /* FluidPressureData.hxx */,
BE99AACF1DBF87AF00ADBB1A /* NewFluidPressureData.hpp */,
BE99AAD01DBF87AF00ADBB1A /* NewFluidPressureData.hxx */,
BE2509981D7879C700664130 /* FluidVelocityData.hpp */,
BE2509991D7879C700664130 /* FluidVelocityData.hxx */,
BE25099A1D7879C700664130 /* MonolithicData.hpp */,
......@@ -13112,9 +13124,13 @@
BE71B9171DB75AE5005DCB59 /* VariationalFormulation.hxx in Headers */,
BE71B9101DB75AE5005DCB59 /* DifferentialDarcy.hpp in Headers */,
BE71B9241DB75AE5005DCB59 /* HybridVector.hpp in Headers */,
BE99AACE1DBF62F400ADBB1A /* NewFluidPressure.hxx in Headers */,
BE71B9311DB75AE5005DCB59 /* HybridVector.hxx in Headers */,
BE71B93B1DB75AE5005DCB59 /* VariationalFormulation.hxx in Headers */,
BE99AACD1DBF62F400ADBB1A /* NewFluidPressure.hpp in Headers */,
BE99AAD11DBF87AF00ADBB1A /* NewFluidPressureData.hpp in Headers */,
BE71B9351DB75AE5005DCB59 /* T21.hxx in Headers */,
BE99AAD21DBF87AF00ADBB1A /* NewFluidPressureData.hxx in Headers */,
BE71B93C1DB75AE5005DCB59 /* VariationalFormulationAccessors.hxx in Headers */,
BE71B9391DB75AE5005DCB59 /* T33.hxx in Headers */,
BE71B9411DB75AE5005DCB59 /* VariationalFormulation.hpp in Headers */,
//! \file
//
//
// NewFluidPressureData.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 01/09/16.
// Copyright © 2016 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_CRTP_x_NEW_FLUID_PRESSURE_DATA_HPP_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_CRTP_x_NEW_FLUID_PRESSURE_DATA_HPP_
# include <type_traits>
# include "Utilities/Miscellaneous.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Data/NewFluidPressure.hpp"
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace Crtp
{
/*!
* \brief Crtp to give FluidPressure data access to a class (typically a VariationalFormulation).
*/
template
<
class DerivedT,
class HyperelasticLawT,
Utilities::Access AccessT
>
class NewFluidPressureData
{
public:
//! \copydoc doxygen_hide_alias_self
using self = NewFluidPressureData<DerivedT, HyperelasticLawT, AccessT>;
//! Alias to hyperelastic law type.
using hyperelastic_law_type = HyperelasticLawT;
//! Alias to the class which access is provided.
using data = DataNS::NewFluidPressure<hyperelastic_law_type>;
//! Alias to fluid mass reference.
using data_reference =
std::conditional_t
<
AccessT == Utilities::Access::read_and_write,
data&,
const data&
>;
public:
/// \name Special members.
///@{
//! Constructor.
explicit NewFluidPressureData(data_reference data);
//! Destructor.
~NewFluidPressureData() = default;
//! Copy constructor.
NewFluidPressureData(const NewFluidPressureData&) = delete;
//! Move constructor.
NewFluidPressureData(NewFluidPressureData&&) = delete;
//! Copy affectation.
NewFluidPressureData& operator=(const NewFluidPressureData&) = delete;
//! Move affectation.
NewFluidPressureData& operator=(NewFluidPressureData&&) = delete;
///@}
//! Constant accessor to data.
const data& GetNewFluidPressureData() const noexcept;
//! Non constant accessor to data.
template<Utilities::Access BogusAccessT = AccessT>
std::enable_if_t
<
BogusAccessT == Utilities::Access::read_and_write,
data&
>
GetNonCstNewFluidPressureData() noexcept;
private:
/*!
* \brief Reference to the data object to which present Crtp gives access.
*
* This reference is non constant if AccessT == Utilities::Access::read_and_write.
*
* The object is managed by Model.
*/
data_reference data_;
};
} // namespace Crtp
} // namespace PoromechanicsNS
} // namespace HappyHeart
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/NewFluidPressureData.hxx"
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_CRTP_x_NEW_FLUID_PRESSURE_DATA_HPP_
//! \file
//
//
// NewFluidPressureData.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 01/09/16.
// Copyright © 2016 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_CRTP_x_NEW_FLUID_PRESSURE_DATA_HXX_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_CRTP_x_NEW_FLUID_PRESSURE_DATA_HXX_
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace Crtp
{
template
<
class DerivedT,
class HyperelasticLawT,
Utilities::Access AccessT
>
NewFluidPressureData<DerivedT, HyperelasticLawT, AccessT>::NewFluidPressureData(data_reference data)
: data_(data)
{ }
template
<
class DerivedT,
class HyperelasticLawT,
Utilities::Access AccessT
>
const typename NewFluidPressureData<DerivedT, HyperelasticLawT, AccessT>::data&
NewFluidPressureData<DerivedT, HyperelasticLawT, AccessT>::GetNewFluidPressureData() const noexcept
{
return data_;
}
template
<
class DerivedT,
class HyperelasticLawT,
Utilities::Access AccessT
>
template<Utilities::Access BogusAccessT>
std::enable_if_t
<
BogusAccessT == Utilities::Access::read_and_write,
typename NewFluidPressureData<DerivedT, HyperelasticLawT, AccessT>::data&
>
NewFluidPressureData<DerivedT, HyperelasticLawT, AccessT>::GetNonCstNewFluidPressureData() noexcept
{
return const_cast<data&>(GetNewFluidPressureData());
}
} // namespace Crtp
} // namespace PoromechanicsNS
} // namespace HappyHeart
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_CRTP_x_NEW_FLUID_PRESSURE_DATA_HXX_
//! \file
//
//
// NewFluidPressure.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 25/10/16.
// Copyright © 2016 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_DATA_x_NEW_FLUID_PRESSURE_HPP_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_DATA_x_NEW_FLUID_PRESSURE_HPP_
# include "ModelInstances/UnderDevelopment/Poromechanics/InputParameterList.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Parameter/UpdatePressureAtQuadPt.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/CauchyGreenAccess.hpp"
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace DataNS
{
template<class HyperelasticLawT>
class NewFluidPressure
: public ::HappyHeart::PoromechanicsNS::Crtp::CauchyGreenAccess<NewFluidPressure<HyperelasticLawT>>
{
public:
//! Alias to pressure parameter.
using pressure_parameter_type =
ParameterAtQuadraturePoint<::HappyHeart::ParameterNS::Type::scalar>;
//! Alias to pressure parameter operator.
using pressure_parameter_operator_type =
GlobalParameterOperatorNS::UpdatePressureAtQuadPt<HyperelasticLawT>;
//! \copydoc doxygen_hide_alias_self
using self = NewFluidPressure<HyperelasticLawT>;
//! Alias to unique pointer.
using unique_ptr = std::unique_ptr<self>;
//! Class name.
static const std::string& ClassName();
public:
/// \name Special members.
///@{
//! Constructor.
explicit NewFluidPressure(const HyperelasticLawT& hyperelastic_law,
const cauchy_green_tensor_type& cauchy_green_tensor,
const TimeManager& time_manager);
//! Destructor.
~NewFluidPressure() = default;
//! Copy constructor.
NewFluidPressure(const NewFluidPressure&) = delete;
//! Move constructor.
NewFluidPressure(NewFluidPressure&&) = delete;
//! Copy affectation.
NewFluidPressure& operator=(const NewFluidPressure&) = delete;
//! Move affectation.
NewFluidPressure& operator=(NewFluidPressure&&) = delete;
///@}
public:
//! Operator which updates pressure parameter on solid mesh.
pressure_parameter_operator_type& GetNonCstUpdatePressureParamOnSolid() noexcept;
//! Operator which updates pressure parameter on solid mesh.
pressure_parameter_operator_type& GetNonCstUpdatePressureParamOnFluid() noexcept;
//! Hyperelastic law.
const HyperelasticLawT& GetHyperelasticLaw() const noexcept;
private:
//! Pressure parameter.
typename pressure_parameter_type::unique_ptr pressure_parameter_on_solid_ = nullptr;
//! Operator which updates pressure parameter.
typename pressure_parameter_operator_type::unique_ptr update_pressure_param_on_solid_ = nullptr;
//! Pressure parameter.
typename pressure_parameter_type::unique_ptr pressure_parameter_on_fluid_ = nullptr;
//! Operator which updates pressure parameter.
typename pressure_parameter_operator_type::unique_ptr update_pressure_param_on_fluid_ = nullptr;
//! Hyperelastic law.
const HyperelasticLawT& hyperelastic_law_;
};
} // namespace DataNS
} // namespace PoromechanicsNS
} // namespace HappyHeart
# include "ModelInstances/UnderDevelopment/Poromechanics/Data/NewFluidPressure.hxx"
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_DATA_x_NEW_FLUID_PRESSURE_HPP_
//! \file
//
//
// NewFluidPressure.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 25/10/16.
// Copyright © 2016 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_DATA_x_NEW_FLUID_PRESSURE_HXX_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_DATA_x_NEW_FLUID_PRESSURE_HXX_
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace DataNS
{
template<class HyperelasticLawT>
const std::string& NewFluidPressure<HyperelasticLawT>::ClassName()
{
static std::string ret("Fluid pressure - new scheme");
return ret;
}
template<class HyperelasticLawT>
NewFluidPressure<HyperelasticLawT>::NewFluidPressure(const HyperelasticLawT& a_hyperelastic_law,
const cauchy_green_tensor_type& cauchy_green_tensor,
const TimeManager& time_manager)
: ::HappyHeart::PoromechanicsNS::Crtp::CauchyGreenAccess<self>(cauchy_green_tensor),
hyperelastic_law_(a_hyperelastic_law)
{
decltype(auto) god_of_dof_manager = GodOfDofManager::GetInstance();
decltype(auto) solid_god_of_dof =
god_of_dof_manager.GetGodOfDof(EnumUnderlyingType(MeshIndex::solid));
decltype(auto) fluid_god_of_dof =
god_of_dof_manager.GetGodOfDof(EnumUnderlyingType(MeshIndex::fluid));
decltype(auto) solid_felt_space =
solid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::solid));
pressure_parameter_on_solid_ =
std::make_unique<pressure_parameter_type>("Fluid pressure on solid",
solid_god_of_dof.GetGeometricMeshRegion(),
solid_felt_space.GetQuadratureRulePerTopology(),
0.,
time_manager);
decltype(auto) unknown_manager = UnknownManager::GetInstance();
decltype(auto) solid_displacement_unknown =
unknown_manager.GetUnknown(EnumUnderlyingType(UnknownIndex::solid_displacement));
decltype(auto) hyperelastic_law = GetHyperelasticLaw();
update_pressure_param_on_solid_ =
std::make_unique<pressure_parameter_operator_type>(solid_felt_space,
solid_displacement_unknown,
*pressure_parameter_on_solid_,
hyperelastic_law,
this->GetCauchyGreenTensor());
decltype(auto) fluid_felt_space =
fluid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fluid));
pressure_parameter_on_fluid_ =
std::make_unique<pressure_parameter_type>("Fluid pressure on fluid",
fluid_god_of_dof.GetGeometricMeshRegion(),
fluid_felt_space.GetQuadratureRulePerTopology(),
0.,
time_manager);
update_pressure_param_on_fluid_ =
std::make_unique<pressure_parameter_operator_type>(fluid_felt_space,
solid_displacement_unknown,
*pressure_parameter_on_fluid_,
hyperelastic_law,
this->GetCauchyGreenTensor()); // \todo #1022 Probably another one...
}
template<class HyperelasticLawT>
const HyperelasticLawT& NewFluidPressure<HyperelasticLawT>::GetHyperelasticLaw() const noexcept
{
return hyperelastic_law_;
}
template<class HyperelasticLawT>
typename NewFluidPressure<HyperelasticLawT>::pressure_parameter_operator_type&
NewFluidPressure<HyperelasticLawT>::GetNonCstUpdatePressureParamOnSolid() noexcept
{
assert(!(!update_pressure_param_on_solid_));
return *update_pressure_param_on_solid_;
}
template<class HyperelasticLawT>
typename NewFluidPressure<HyperelasticLawT>::pressure_parameter_operator_type&
NewFluidPressure<HyperelasticLawT>::GetNonCstUpdatePressureParamOnFluid() noexcept
{
assert(!(!update_pressure_param_on_fluid_));
return *update_pressure_param_on_fluid_;
}
} // namespace DataNS
} // namespace PoromechanicsNS
} // namespace HappyHeart
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_DATA_x_NEW_FLUID_PRESSURE_HXX_
......@@ -114,7 +114,7 @@ namespace HappyHeart
decltype(auto) new_velocity = velocity_solution.GetValue(quad_pt, geom_elt);
decltype(auto) velSHalfVhf_value = velSHalfVhf.GetValue(quad_pt, geom_elt);
const auto new_pressure = pressure_solution.GetValue(quad_pt, geom_elt);
// const auto new_pressure = pressure_solution.GetValue(quad_pt, geom_elt);
const auto density_value = density.GetValue(quad_pt, geom_elt);
......
......@@ -30,6 +30,7 @@
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/MonolithicData.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/PorosityData.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/FluidPressureData.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/NewFluidPressureData.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/SolidDisplacementData.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/ImplicitStep/ImplicitStepFluid/NewtonFixedPoint/VariationalFormulation.hpp"
......@@ -80,6 +81,12 @@ namespace HappyHeart
VariationalFormulation<SolidVariationalFormulationPolicyT>,
Utilities::Access::read_only
>,
public ::HappyHeart::PoromechanicsNS::Crtp::NewFluidPressureData
<
VariationalFormulation<SolidVariationalFormulationPolicyT>,
typename SolidVariationalFormulationPolicyT::hyperelastic_law_type,
Utilities::Access::read_and_write
>,
public ::HappyHeart::PoromechanicsNS::Crtp::PorosityData
<
VariationalFormulation<SolidVariationalFormulationPolicyT>,
......@@ -97,10 +104,15 @@ namespace HappyHeart
>,
public Crtp::CauchyGreenAccess<VariationalFormulation<SolidVariationalFormulationPolicyT>>
{
private:
//! Alias to self.
using self = VariationalFormulation<SolidVariationalFormulationPolicyT>;
//! Alias to hyperelastic law.
using hyperelastic_law_type = typename SolidVariationalFormulationPolicyT::hyperelastic_law_type;
//! Alias to the parent class.
using parent = HappyHeart::VariationalFormulation
......@@ -109,9 +121,6 @@ namespace HappyHeart
EnumUnderlyingType(SolverIndex::iterative)
>;
//! Alias to hyperelastic law.
using hyperelastic_law_type = typename SolidVariationalFormulationPolicyT::hyperelastic_law_type;
//! Friendship to parent class, so this one can access private methods defined below through CRTP.
friend parent;
......@@ -152,6 +161,15 @@ namespace HappyHeart
using fluid_pressure_data_parent =
::HappyHeart::PoromechanicsNS::Crtp::FluidPressureData<self, Utilities::Access::read_only>;
//! Alias to fluid pressure data crtp.
using new_fluid_pressure_data_parent =
::HappyHeart::PoromechanicsNS::Crtp::NewFluidPressureData