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

#880 Porosity: fix parallel issues in PorosityParameter. Some remaining in SolidOnFluidMesh...

parent 6a6301bd
......@@ -8,6 +8,8 @@
// Copyright © 2016 Inria. All rights reserved.
//
#include "ThirdParty/Wrappers/Petsc/Matrix/MatrixOperations.hpp"
#include "FiniteElement/FiniteElementSpace/GodOfDofManager.hpp"
#include "FiniteElement/FiniteElementSpace/Private/DofProgramWiseIndexListPerVertexCoordIndexManager.hpp"
......@@ -66,9 +68,10 @@ namespace HappyHeart
auto& underlying_vector = GetNonCstOnFluidMeshVector();
AllocateGlobalVector(god_of_dof, underlying_vector);
// \todo #820 Works only because same underlying mesh and same shape function!
on_fluid_mesh_vector_previous_time_iteration_ = std::make_unique<GlobalVector>(underlying_vector);
underlying_vector.Copy(solution_porosity_varf, __FILE__, __LINE__);
auto& vector_prev_time_iteration = GetNonCstOnFluidMeshVectorPreviousTimeIteration();
vector_prev_time_iteration.Copy(underlying_vector, __FILE__, __LINE__);
on_fluid_mesh_ =
std::make_unique<fluid_param_at_dof_type>("Porosity on fluid mesh",
......@@ -85,7 +88,7 @@ namespace HappyHeart
felt_space,
felt_space_dim_minus_1,
unknown,
GetNonCstOnFluidMeshVectorPreviousTimeIteration());
vector_prev_time_iteration);
}
......@@ -118,12 +121,13 @@ namespace HappyHeart
GetNonCstOnFluidMeshVectorPreviousTimeIteration().Copy(on_fluid_vector,
__FILE__, __LINE__);
const auto& from_solid_to_fluid =
GetFromSolidToFluid().GetInterpolationMatrix();
// \todo #820 Works only because same mesh and same shape function at the moment; the former won't
// hold indefinitely (an interpolator will be required at this point).
on_fluid_vector.Copy(GetSolutionPorosityVarf(), __FILE__, __LINE__);
Wrappers::Petsc::MatMult(from_solid_to_fluid,
GetSolutionPorosityVarf(),
on_fluid_vector,
__FILE__, __LINE__);
}
......
......@@ -115,7 +115,6 @@ namespace HappyHeart
//! Constant accessor to the solution of the PorosityVariationalFormulation.
const GlobalVector& GetSolutionPorosityVarf() const noexcept;
//! Non constant accessor to the porosity parameter on the solid mesh.
ParameterAtDof<ParameterNS::Type::scalar>::type& GetNonCstOnSolidMesh() noexcept;
......@@ -131,19 +130,20 @@ namespace HappyHeart
//! Non constant accessor to the underlying global vector for porosity on fluid mesh.
GlobalVector& GetNonCstOnFluidMeshVector() noexcept;
/*!
* \brief Constant accessor to the underlying global vector for porosity on fluid mesh from previous
* time iteration.
*/
const GlobalVector& GetOnFluidMeshVectorPreviousTimeIteration() const noexcept;
/*!
* \brief Non constant accessor to the underlying global vector for porosity on fluid mesh from
* previous time iteration.
*/
GlobalVector& GetNonCstOnFluidMeshVectorPreviousTimeIteration() noexcept;
//! Constant accessor to the interpolator solid -> fluid for porosity unknown.
const NonConformInterpolatorNS::FromVertexMatching& GetFromSolidToFluid() const noexcept;
///@}
......@@ -169,9 +169,8 @@ namespace HappyHeart
//! Underlying global vector for porosity on fluid mesh from previous time iteration.
GlobalVector::unique_ptr on_fluid_mesh_vector_previous_time_iteration_ = nullptr;
//! Interpolator to transform porosity from solid \a GodOfDof to the fluid one.
NonConformInterpolatorNS::FromVertexMatching::unique_ptr from_solid_to_fluid_ = nullptr;
//! Interpolator solid -> fluid for porosity unknown.
NonConformInterpolatorNS::FromVertexMatching::const_unique_ptr from_solid_to_fluid_ = nullptr;
};
......
......@@ -101,7 +101,12 @@ namespace HappyHeart
}
inline const NonConformInterpolatorNS::FromVertexMatching& PorosityParameter
::GetFromSolidToFluid() const noexcept
{
assert(!(!from_solid_to_fluid_));
return *from_solid_to_fluid_;
}
......
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