Commit 4453f0e2 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#879 [WIP] Replace fluid by solid in PorosityVarf. Explicit and implicit code...

#879 [WIP] Replace fluid by solid in PorosityVarf. Explicit and implicit code have been commented for the time being.
parent 5a9cba91
......@@ -25,8 +25,8 @@ namespace HappyHeart
void Model<SolidVariationalFormulationPolicyT>::Forward()
{
UpdatePorosity();
GetNonCstExplicitStepVariationalFormulation().Perform();
GetNonCstImplicitStepFluidVarf().Perform();
// GetNonCstExplicitStepVariationalFormulation().Perform();
// GetNonCstImplicitStepFluidVarf().Perform();
}
......
......@@ -60,7 +60,8 @@ namespace HappyHeart
template<class SolidVariationalFormulationPolicyT>
inline const ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None, 2u>::type& Model<SolidVariationalFormulationPolicyT>
inline const ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None, 2u>::type&
Model<SolidVariationalFormulationPolicyT>
::GetPorosity() const noexcept
{
assert(!(!porosity_));
......@@ -69,7 +70,8 @@ namespace HappyHeart
template<class SolidVariationalFormulationPolicyT>
inline const ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None, 2u>::type& Model<SolidVariationalFormulationPolicyT>
inline const ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None, 2u>::type&
Model<SolidVariationalFormulationPolicyT>
::GetPorosityPreviousTimeIteration() const noexcept
{
assert(!(!porosity_prev_time_it_));
......
......@@ -57,8 +57,8 @@ namespace HappyHeart
// Ordering is extremely important here!
InitParameters(input_parameter_data);
InitVariationalFormulations(input_parameter_data);
InitializeMassOperator();
// InitVariationalFormulations(input_parameter_data);
// InitializeMassOperator();
}
......@@ -163,23 +163,23 @@ namespace HappyHeart
decltype(auto) fluid_density = GetFluidDensity();
decltype(auto) fluid_god_of_dof = parent::GetGodOfDof(EnumUnderlyingType(MeshIndex::fluid));
decltype(auto) fluid_mesh = fluid_god_of_dof.GetGeometricMeshRegion();
decltype(auto) solid_god_of_dof = parent::GetGodOfDof(EnumUnderlyingType(MeshIndex::solid));
decltype(auto) solid_mesh = solid_god_of_dof.GetGeometricMeshRegion();
decltype(auto) unknown_manager = UnknownManager::GetInstance();
{
const auto& numbering_subset =
fluid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::porosity));
solid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::porosity_on_solid));
DirichletBoundaryCondition::vector_shared_ptr empty_bc_list;
porosity_varf_ = std::make_unique<PorosityVariationalFormulation>(mpi,
numbering_subset,
time_manager,
fluid_god_of_dof,
solid_god_of_dof,
GetFluidMassParameter(),
fluid_density,
GetSolidOnFluidMesh());
GetSolidDisplacement());
porosity_varf_->Init(input_parameter_data);
}
......@@ -189,26 +189,26 @@ namespace HappyHeart
// Beware: porosity_ must be defined after porosity_varf_.
// \todo #820 That's why it's not done within InitParameters; if kept this way comments should
// point it out.
const auto& unknown = unknown_manager.GetUnknown(EnumUnderlyingType(UnknownIndex::porosity));
decltype(auto) felt_space_dim = fluid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fluid));
decltype(auto) felt_space_dim_minus_1 = fluid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::inlet_border));
const auto& porosity_varf = GetPorosityVariationalFormulation();
using type = ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None, 2u>::type;
porosity_ = std::make_unique<type>("Porosity",
fluid_mesh,
felt_space_dim,
felt_space_dim_minus_1,
unknown,
porosity_varf.GetSystemSolution(porosity_varf.GetNumberingSubset()));
porosity_prev_time_it_ = std::make_unique<type>("Porosity from previous time iteration",
fluid_mesh,
felt_space_dim,
felt_space_dim_minus_1,
unknown,
porosity_varf.GetPorosityPreviousTimeIteration());
// const auto& unknown = unknown_manager.GetUnknown(EnumUnderlyingType(UnknownIndex::porosity));
// decltype(auto) felt_space_dim = solid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::solid));
// decltype(auto) felt_space_dim_minus_1 = solid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::inlet_border));
// const auto& porosity_varf = GetPorosityVariationalFormulation();
//
// using type = ParameterAtDof<ParameterNS::Type::scalar, ParameterNS::TimeDependencyNS::None, 2u>::type;
//
// porosity_ = std::make_unique<type>("Porosity",
// solid_mesh,
// felt_space_dim,
// felt_space_dim_minus_1,
// unknown,
// porosity_varf.GetSystemSolution(porosity_varf.GetNumberingSubset()));
//
// porosity_prev_time_it_ = std::make_unique<type>("Porosity from previous time iteration",
// solid_mesh,
// felt_space_dim,
// felt_space_dim_minus_1,
// unknown,
// porosity_varf.GetPorosityPreviousTimeIteration());
}
}
......
......@@ -27,7 +27,7 @@ namespace HappyHeart
const GodOfDof& god_of_dof,
const ParameterAtDof<ParameterNS::Type::scalar>::type& fluid_mass,
const ScalarParameter<>& fluid_density,
const Private::SolidOnFluidMesh& solid_on_fluid_mesh)
const GlobalVector& solid_displacement)
: parent(mpi,
time_manager,
god_of_dof,
......@@ -35,7 +35,7 @@ namespace HappyHeart
numbering_subset_(numbering_subset),
fluid_mass_(fluid_mass),
fluid_density_(fluid_density),
solid_on_fluid_mesh_(solid_on_fluid_mesh)
solid_displacement_(solid_displacement)
{ }
......@@ -93,9 +93,6 @@ namespace HappyHeart
std::make_unique<GlobalVector>(GetSystemRhs(numbering_subset));
}
}
......@@ -107,7 +104,7 @@ namespace HappyHeart
rhs.ZeroEntries(__FILE__, __LINE__);
GlobalVectorWithCoefficient vector(rhs, 1.);
GetPorosity().Assemble(std::make_tuple(std::ref(vector)), GetSolidOnFluidMesh().GetCurrentDisplacement());
GetPorosity().Assemble(std::make_tuple(std::ref(vector)), GetSolidDisplacement());
}
......@@ -126,7 +123,7 @@ namespace HappyHeart
const auto& porosity_unknown =
unknown_manager.GetUnknown(EnumUnderlyingType(UnknownIndex::porosity));
const auto& felt_space = god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fluid));
const auto& felt_space = god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::solid));
{
namespace GVO = ::HappyHeart::GlobalVariationalOperatorNS;
......@@ -165,11 +162,6 @@ namespace HappyHeart
}
const Private::SolidOnFluidMesh& PorosityVariationalFormulation::GetSolidOnFluidMesh() const noexcept
{
return solid_on_fluid_mesh_;
}
} // namespace PoromechanicsNS
......
......@@ -33,26 +33,7 @@ namespace HappyHeart
namespace PoromechanicsNS
{
// ============================
// Forward declarations.
// ============================
namespace Private
{
class SolidOnFluidMesh;
} // namespace Private
// ============================
// End of forward declarations.
// ============================
class PorosityVariationalFormulation
: public HappyHeart::VariationalFormulation
......@@ -87,14 +68,18 @@ namespace HappyHeart
/// \name Special members.
///@{
//! Constructor.
/*!
* \brief Constructor.
*
* \param[in] solid_displacement Current solid displacement (on solid mesh).
*/
explicit PorosityVariationalFormulation(const Wrappers::Mpi& mpi,
const NumberingSubset& numbering_subset,
const TimeManager& time_manager,
const GodOfDof& god_of_dof,
const ParameterAtDof<ParameterNS::Type::scalar>::type& fluid_mass,
const ScalarParameter<>& fluid_density,
const Private::SolidOnFluidMesh& solid_on_fluid_mesh);
const GlobalVector& solid_displacement);
//! Destructor.
~PorosityVariationalFormulation() = default;
......@@ -182,9 +167,9 @@ namespace HappyHeart
//! Porosity of the previous time iteration.
GlobalVector& GetNonCstPorosityPreviousTimeIteration() noexcept;
//! Constant accessor to the object which keeps track on solid displacement and velocity on fluid mesh.
const Private::SolidOnFluidMesh& GetSolidOnFluidMesh() const noexcept;
//! Constant accessor to the current solid displacement (on solid mesh).
const GlobalVector& GetSolidDisplacement() const noexcept;
///@}
......@@ -223,9 +208,9 @@ namespace HappyHeart
//! Porosity of the previous time iteration.
GlobalVector::unique_ptr porosity_previous_time_iteration_ = nullptr;
//! Object which keeps track on solid displacement and velocity on fluid mesh.
const Private::SolidOnFluidMesh& solid_on_fluid_mesh_;
//! Current solid displacement (on solid mesh).
const GlobalVector& solid_displacement_;
};
......
......@@ -84,6 +84,12 @@ namespace HappyHeart
{
return const_cast<GlobalVector&>(GetPorosityPreviousTimeIteration());
}
inline const GlobalVector& PorosityVariationalFormulation::GetSolidDisplacement() const noexcept
{
return solid_displacement_;
}
} // 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