Commit 1b2d1788 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1022 Poro: change a matrix into which operator is assembled. Runtime still...

#1022 Poro: change a matrix into which operator is assembled. Runtime still fails, but the conversion into the monolithic has not yet bee reformed, so it's not much of a surprise.
parent 0858d331
......@@ -515,7 +515,7 @@ namespace HappyHeart
//! Non constant accessor to the t21 on the non monolithic FEltSpace.
GlobalMatrix& GetNonCstT21OnFluidMesh() noexcept;
GlobalMatrix& GetNonCstT21OnSolidMesh() noexcept;
///@}
......@@ -682,7 +682,7 @@ namespace HappyHeart
GlobalMatrix::unique_ptr t12_block_ = nullptr;
//! T21 on the non monolithic \a FEltSpace.
GlobalMatrix::unique_ptr t21_on_fluid_mesh_ = nullptr;
GlobalMatrix::unique_ptr t21_on_solid_mesh_ = nullptr;
GlobalMatrix::unique_ptr t22_in_monolithic_ = nullptr;
......
......@@ -231,10 +231,10 @@ namespace HappyHeart
template<class HyperelasticLawT>
inline GlobalMatrix& VariationalFormulation<HyperelasticLawT>::GetNonCstT21OnFluidMesh() noexcept
inline GlobalMatrix& VariationalFormulation<HyperelasticLawT>::GetNonCstT21OnSolidMesh() noexcept
{
assert(!(!t21_on_fluid_mesh_));
return *t21_on_fluid_mesh_;
assert(!(!t21_on_solid_mesh_));
return *t21_on_solid_mesh_;
}
......
......@@ -278,18 +278,23 @@ namespace HappyHeart
break;
case DoRecomputeBlock::yes:
{
auto& t21_on_fluid_mesh = GetNonCstT21OnFluidMesh();
t21_on_fluid_mesh.ZeroEntries(__FILE__, __LINE__);
auto& t21_on_solid_mesh = GetNonCstT21OnSolidMesh();
t21_on_solid_mesh.ZeroEntries(__FILE__, __LINE__);
{
// T21 SHOULD BE ON SOLID MESH!
GlobalMatrixWithCoefficient matrix_with_coeff(t21_on_fluid_mesh, 1.);
GlobalMatrixWithCoefficient matrix_with_coeff(t21_on_solid_mesh, 1.);
GetT21Operator().Assemble(std::make_tuple(std::ref(matrix_with_coeff)));
}
# ifndef NDEBUG
AssertMatrixRespectPattern(god_of_dof, t21_on_fluid_mesh, __FILE__, __LINE__);
{
decltype(auto) solid_god_of_dof =
GodOfDofManager::GetInstance().GetGodOfDof(EnumUnderlyingType(MeshIndex::solid));
AssertMatrixRespectPattern(solid_god_of_dof, t21_on_solid_mesh, __FILE__, __LINE__);
}
# endif // NDEBUG
......@@ -299,7 +304,7 @@ namespace HappyHeart
auto& work_var = *intermediate_t21_monolithic_;
Wrappers::Petsc::MatMatMult(t21_on_fluid_mesh,
Wrappers::Petsc::MatMatMult(t21_on_solid_mesh,
monolithic_to_mass,
work_var,
__FILE__, __LINE__,
......
......@@ -80,6 +80,11 @@ namespace HappyHeart
{
decltype(auto) god_of_dof = parent::GetGodOfDof();
decltype(auto) god_of_dof_manager = GodOfDofManager::GetInstance();
decltype(auto) solid_god_of_dof =
god_of_dof_manager.GetGodOfDof(EnumUnderlyingType(MeshIndex::solid));
decltype(auto) numbering_subset =
god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_monolithic));
......@@ -101,9 +106,9 @@ namespace HappyHeart
std::make_unique<GlobalMatrix>(god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_mass)),
god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_velocity)));
t21_on_fluid_mesh_ =
std::make_unique<GlobalMatrix>(god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_velocity)),
god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_mass)));
t21_on_solid_mesh_ =
std::make_unique<GlobalMatrix>(solid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_velocity_on_solid)),
solid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_mass_on_solid)));
t22_block_ =
std::make_unique<GlobalMatrix>(god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_velocity)),
......@@ -111,15 +116,11 @@ namespace HappyHeart
AllocateGlobalMatrix(god_of_dof, GetNonCstT22Block());
AllocateGlobalMatrix(god_of_dof, GetNonCstT12Block());
AllocateGlobalMatrix(god_of_dof, *t21_on_fluid_mesh_);
AllocateGlobalMatrix(solid_god_of_dof, *t21_on_solid_mesh_);
{
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_mass_numbering_subset =
solid_god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_mass_on_solid));
......
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