Commit 2ee7450e authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1022 Interpolation holder: add interpolation fluid velocity on solid -> fluid...

#1022 Interpolation holder: add interpolation fluid velocity on solid -> fluid monolithic. It doesn't work at the moment, due to the fact fluid velocity is P1b and interpolator used (FromVertexMatching) works currently only for P1.
parent bfa652bb
......@@ -2015,6 +2015,34 @@ InitVertexMatchingInterpolator14 = {
} -- InitVertexMatchingInterpolator14
-- Fluid velocity
InitVertexMatchingInterpolator15 = {
-- Finite element space for which the dofs index will be associated to each vertex.
-- Expected format: VALUE
finite_element_space = 10,
-- Numbering subsetfor which the dofs index will be associated to each vertex.
-- Expected format: "VALUE"
numbering_subset = 10
} -- InitVertexMatchingInterpolator15
-- Fluid velocity on solid
InitVertexMatchingInterpolator25 = {
-- Finite element space for which the dofs index will be associated to each vertex.
-- Expected format: VALUE
finite_element_space = 20,
-- Numbering subsetfor which the dofs index will be associated to each vertex.
-- Expected format: "VALUE"
numbering_subset = 25
} -- InitVertexMatchingInterpolator25
PenalizationPorosity = {
......
......@@ -2007,6 +2007,34 @@ InitVertexMatchingInterpolator14 = {
} -- InitVertexMatchingInterpolator14
-- Fluid velocity on solid
InitVertexMatchingInterpolator15 = {
-- Finite element space for which the dofs index will be associated to each vertex.
-- Expected format: VALUE
finite_element_space = 10,
-- Numbering subsetfor which the dofs index will be associated to each vertex.
-- Expected format: "VALUE"
numbering_subset = 10
} -- InitVertexMatchingInterpolator15
-- Fluid velocity on solid
InitVertexMatchingInterpolator25 = {
-- Finite element space for which the dofs index will be associated to each vertex.
-- Expected format: VALUE
finite_element_space = 20,
-- Numbering subsetfor which the dofs index will be associated to each vertex.
-- Expected format: "VALUE"
numbering_subset = 25
} -- InitVertexMatchingInterpolator25
PenalizationPorosity = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
......
......@@ -272,9 +272,6 @@ namespace HappyHeart
decltype(auto) interpolator_holder = this->GetInterpolatorHolder();
std::cout << "COMPUTE T21; DO REUSE = "
<< (do_reuse_matrix == Wrappers::Petsc::DoReuseMatrix::yes ? "yes" : "no") << std::endl;
switch(do_recompute_block)
{
case DoRecomputeBlock::no:
......@@ -285,7 +282,6 @@ namespace HappyHeart
t21_on_solid_mesh.ZeroEntries(__FILE__, __LINE__);
{
// T21 SHOULD BE ON SOLID MESH!
GlobalMatrixWithCoefficient matrix_with_coeff(t21_on_solid_mesh, 1.);
GetT21Operator().Assemble(std::make_tuple(std::ref(matrix_with_coeff)));
}
......@@ -303,7 +299,10 @@ namespace HappyHeart
// Now do the transfert toward the monolithic matrix.
decltype(auto) monolithic_to_mass =
interpolator_holder.GetMatrixMonolithicToFluidmassOnFluid();
interpolator_holder.GetMatrixMonolithicToFluidmassOnSolid();
decltype(auto) monolithic_to_velocity =
interpolator_holder.GetMatrixMonolithicToFluidVelocityOnSolid();
auto& work_var = GetNonCstIntermediateT21Monolithic();
......@@ -313,7 +312,7 @@ namespace HappyHeart
__FILE__, __LINE__,
do_reuse_matrix);
Wrappers::Petsc::MatTransposeMatMult(monolithic_to_mass,
Wrappers::Petsc::MatTransposeMatMult(monolithic_to_velocity,
work_var,
t21_in_monolithic,
__FILE__, __LINE__,
......@@ -339,9 +338,6 @@ namespace HappyHeart
__FILE__, __LINE__);
}
} // namespace NewtonFixedPointNS
......
......@@ -157,13 +157,16 @@ namespace HappyHeart
solid_velocity = 21, // \todo #820 Rename!
fluid_mass = 12,
solid_mass = 22, // \todo #820 Rename!
fluid_mass_on_solid = 22, // \todo #820 Rename!
fluid_pressure = 13,
fluid_pressure_on_solid = 23,
solid_displacement = 24,
solid_displacement_on_fluid = 14
solid_displacement_on_fluid = 14,
fluid_velocity = 15,
fluid_velocity_on_solid = 25
};
......@@ -245,13 +248,14 @@ namespace HappyHeart
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_porosity)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::solid_velocity)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::solid_velocity_on_fluid)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::solid_mass)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_mass_on_solid)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_mass)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_pressure)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_pressure_on_solid)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::solid_displacement)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::solid_displacement_on_fluid)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_velocity)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_velocity_on_solid)>,
InputParameter::PoromechanicsNS::InternalFriction,
InputParameter::PoromechanicsNS::PenalizationPorosity,
......
......@@ -32,15 +32,19 @@ namespace HappyHeart
{
using type = NonConformInterpolatorNS::FromVertexMatching;
fluidmass_solid_to_fluid_ =
std::make_unique<type>(input_parameter_data,
EnumUnderlyingType(InitVertexMatchingInterpolator::solid_mass),
EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_mass));
std::make_unique<type>(input_parameter_data,
EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_mass_on_solid),
EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_mass));
fluidmass_fluid_to_solid =
std::make_unique<type>(input_parameter_data,
EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_mass),
EnumUnderlyingType(InitVertexMatchingInterpolator::solid_mass));
std::make_unique<type>(input_parameter_data,
EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_mass),
EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_mass_on_solid));
fluid_velocity_fluid_to_solid =
std::make_unique<type>(input_parameter_data,
EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_velocity),
EnumUnderlyingType(InitVertexMatchingInterpolator::fluid_velocity_on_solid));
}
decltype(auto) unknown_manager = UnknownManager::GetInstance();
......@@ -224,23 +228,39 @@ namespace HappyHeart
decltype(auto) source_numbering_subset =
solid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_mass_on_solid));
matrix_fluidmass_on_solid_to_monolithic_ =
matrix_fluid_mass_on_solid_to_monolithic_ =
std::make_unique<GlobalMatrix>(target_numbering_subset, source_numbering_subset);
Wrappers::Petsc::MatMatMult(GetMatrixFluidmassOnFluidToMonolithic(),
GetFluidmassSolidToFluid().GetInterpolationMatrix(),
*matrix_fluidmass_on_solid_to_monolithic_,
*matrix_fluid_mass_on_solid_to_monolithic_,
__FILE__, __LINE__);
// And now the revert matrix.
matrix_monolithic_to_fluidmass_on_solid_ =
matrix_monolithic_to_fluid_mass_on_solid_ =
std::make_unique<GlobalMatrix>(source_numbering_subset, target_numbering_subset);
Wrappers::Petsc::MatMatMult(GetMatrixFluidmassFluidToSolid(),
GetMatrixMonolithicToFluidmassOnFluid(),
*matrix_monolithic_to_fluidmass_on_solid_,
*matrix_monolithic_to_fluid_mass_on_solid_,
__FILE__, __LINE__);
}
{
decltype(auto) target_numbering_subset =
fluid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_monolithic));
decltype(auto) source_numbering_subset =
solid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_velocity_on_solid));
matrix_monolithic_to_fluid_velocity_on_solid_ =
std::make_unique<GlobalMatrix>(source_numbering_subset, target_numbering_subset);
Wrappers::Petsc::MatMatMult(GetMatrixFluidVelocityFluidToSolid(),
GetMatrixMonolithicToFluidVelocityOnFluid(),
*matrix_monolithic_to_fluid_velocity_on_solid_,
__FILE__, __LINE__);
}
......
......@@ -89,6 +89,12 @@ namespace HappyHeart
* into a monolithic vector defined on fluid mesh.
*/
const GlobalMatrix& GetMatrixFluidVelocityOnFluidToMonolithic() const noexcept;
/*!
* \brief Constant accessor to the matrix that transforms a velocity expressed on the solid mesh
* into a monolithic vector defined on fluid mesh.
*/
const GlobalMatrix& GetMatrixFluidVelocityOnSolidToMonolithic() const noexcept;
///@}
......@@ -118,6 +124,13 @@ namespace HappyHeart
* into a fluid velocity expressed on the fluid mesh.
*/
const GlobalMatrix& GetMatrixMonolithicToFluidVelocityOnFluid() const noexcept;
/*!
* \brief Constant accessor to the matrix that transforms a monolithic vector defined on fluid mesh
* into a fluid velocity expressed on the solid mesh.
*/
const GlobalMatrix& GetMatrixMonolithicToFluidVelocityOnSolid() const noexcept;
///@}
......@@ -153,6 +166,9 @@ namespace HappyHeart
//! Interpolation matrix that performs: fluid mass on fluid mesh -> fluid mass on solid mesh.
const GlobalMatrix& GetMatrixFluidmassFluidToSolid() const noexcept;
//! Interpolation matrix that performs: fluid velocity on fluid mesh -> fluid velocity on solid mesh.
const GlobalMatrix& GetMatrixFluidVelocityFluidToSolid() const noexcept;
///@}
......@@ -253,6 +269,9 @@ namespace HappyHeart
//! Interpolator fluid mass on fluid mesh -> fluid mass on solid mesh.
const NonConformInterpolatorNS::FromVertexMatching& GetFluidmassFluidToSolid() const noexcept;
//! Interpolator fluid velocity on fluid mesh -> fluid velocity on solid mesh.
const NonConformInterpolatorNS::FromVertexMatching& GetFluidVelocityFluidToSolid() const noexcept;
///@}
......@@ -322,8 +341,14 @@ namespace HappyHeart
* \brief Matrix that transforms a monolithic vector defined on fluid mesh into a fluid mass
* expressed on the solid mesh.
*/
GlobalMatrix::unique_ptr matrix_monolithic_to_fluidmass_on_solid_ = nullptr;
GlobalMatrix::unique_ptr matrix_monolithic_to_fluid_mass_on_solid_ = nullptr;
/*!
* \brief Matrix that transforms a monolithic vector defined on fluid mesh into a fluid velocity
* expressed on the solid mesh.
*/
GlobalMatrix::unique_ptr matrix_monolithic_to_fluid_velocity_on_solid_ = nullptr;
///@}
......@@ -339,7 +364,7 @@ namespace HappyHeart
* \brief Matrix that transforms a fluid mass expressed on the solid mesh
* into a monolithic vector defined on fluid mesh.
*/
GlobalMatrix::unique_ptr matrix_fluidmass_on_solid_to_monolithic_ = nullptr;
GlobalMatrix::unique_ptr matrix_fluid_mass_on_solid_to_monolithic_ = nullptr;
/*!
* \brief Matrix that transforms a pressure expressed on the solid mesh
......@@ -347,6 +372,7 @@ namespace HappyHeart
*/
GlobalMatrix::unique_ptr matrix_pressure_on_solid_to_monolithic_ = nullptr;
///@}
......@@ -376,6 +402,9 @@ namespace HappyHeart
//! Interpolator solid displacement on solid mesh -> solid displacement on fluid mesh.
NonConformInterpolatorNS::FromVertexMatching::const_unique_ptr solid_displacement_solid_2_fluid_ = nullptr;
//! Interpolator fluid velocity on fluid mesh -> fluid velocity on solid mesh.
NonConformInterpolatorNS::FromVertexMatching::const_unique_ptr fluid_velocity_fluid_to_solid = nullptr;
///@}
......
......@@ -22,8 +22,8 @@ namespace HappyHeart
inline const GlobalMatrix& InterpolatorHolder::GetMatrixFluidmassOnSolidToMonolithic() const noexcept
{
assert(!(!matrix_fluidmass_on_solid_to_monolithic_));
return *matrix_fluidmass_on_solid_to_monolithic_;
assert(!(!matrix_fluid_mass_on_solid_to_monolithic_));
return *matrix_fluid_mass_on_solid_to_monolithic_;
}
......@@ -32,8 +32,7 @@ namespace HappyHeart
return GetFluidmassOnFluidToMonolithic().GetInterpolationMatrix();
}
inline const GlobalMatrix& InterpolatorHolder::GetMatrixFluidVelocityOnFluidToMonolithic() const noexcept
{
return GetFluidVelocityOnFluidToMonolithic().GetInterpolationMatrix();
......@@ -42,8 +41,8 @@ namespace HappyHeart
inline const GlobalMatrix& InterpolatorHolder::GetMatrixMonolithicToFluidmassOnSolid() const noexcept
{
assert(!(!matrix_monolithic_to_fluidmass_on_solid_));
return *matrix_monolithic_to_fluidmass_on_solid_;
assert(!(!matrix_monolithic_to_fluid_mass_on_solid_));
return *matrix_monolithic_to_fluid_mass_on_solid_;
}
......@@ -59,6 +58,13 @@ namespace HappyHeart
}
inline const GlobalMatrix& InterpolatorHolder::GetMatrixMonolithicToFluidVelocityOnSolid() const noexcept
{
assert(!(!matrix_monolithic_to_fluid_velocity_on_solid_));
return *matrix_monolithic_to_fluid_velocity_on_solid_;
}
inline const GlobalMatrix& InterpolatorHolder::GetMatrixFluidmassSolidToFluid() const noexcept
{
return GetFluidmassSolidToFluid().GetInterpolationMatrix();
......@@ -101,6 +107,12 @@ namespace HappyHeart
{
return GetFluidmassFluidToSolid().GetInterpolationMatrix();
}
inline const GlobalMatrix& InterpolatorHolder::GetMatrixFluidVelocityFluidToSolid() const noexcept
{
return GetFluidVelocityFluidToSolid().GetInterpolationMatrix();
}
inline const ConformInterpolatorNS::SubsetOrSuperset& InterpolatorHolder
......@@ -135,6 +147,14 @@ namespace HappyHeart
}
inline const NonConformInterpolatorNS::FromVertexMatching& InterpolatorHolder
::GetFluidVelocityFluidToSolid() const noexcept
{
assert(!(!fluid_velocity_fluid_to_solid));
return *fluid_velocity_fluid_to_solid;
}
inline const GlobalMatrix& InterpolatorHolder
::GetVelocityNullifierOutOfRobinInterface() const noexcept
{
......
......@@ -166,9 +166,6 @@ namespace HappyHeart
// Fill the interpolation matrix.
std::vector<PetscScalar> one { 1. };
assert(non_zero_pattern_per_line.size() == Nprocessor_wise_target_dof);
assert(non_zero_pattern_per_line.size() == Nprocessor_wise_target_dof);
assert(target_processor_to_program_wise.size() == Nprocessor_wise_target_dof);
......
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