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

#531 Stokes also updated.

parent 38393025
......@@ -103,7 +103,8 @@ namespace HappyHeart
* for Assemble() method rather than figuring out what is a variadic method and which additional
* arguments are required (none for this specific operator).
*/
void Assemble(double coefficient, GlobalMatrix& global_matrix, const Domain& domain = Domain()) const;
template<class LinearAlgebraTupleT>
void Assemble(LinearAlgebraTupleT&& global_matrix_with_coeff, const Domain& domain = Domain()) const;
......
......@@ -43,16 +43,14 @@ namespace HappyHeart
}
template<class UnknownPolicyT>
inline void ScalarDivVectorial<UnknownPolicyT>::Assemble(double coefficient,
GlobalMatrix& global_matrix,
const Domain& domain) const
template<class LinearAlgebraTupleT>
inline void ScalarDivVectorial<UnknownPolicyT>
::Assemble(LinearAlgebraTupleT&& linear_algebra_tuple, const Domain& domain) const
{
return Parent::AssembleWithVariadicArguments(coefficient, global_matrix, domain);
return Parent::Assemble531(std::move(linear_algebra_tuple), domain);
}
......
......@@ -70,7 +70,7 @@ namespace HappyHeart
template<>
void ScalarDivVectorial::ComputeEltArray<MatrixVectorNature::matrix>(const double coefficient)
void ScalarDivVectorial::ComputeEltArray<MatrixVectorNature::matrix>()
{
auto& elementary_data = GetNonCstElementaryData();
......@@ -101,9 +101,8 @@ namespace HappyHeart
const BlockLocalVector phi_pressure_block = infos_at_quad_pt.GetFEltPhi(scalar_ref_felt);
const double factor = coefficient
* infos_at_quad_pt.GetQuadraturePoint().GetWeight()
* infos_at_quad_pt.GetJacobianDeterminant();
const double factor = infos_at_quad_pt.GetQuadraturePoint().GetWeight()
* infos_at_quad_pt.GetJacobianDeterminant();
for (unsigned int icoor = 0; icoor < dimension; ++icoor)
{
......
......@@ -84,10 +84,9 @@ namespace HappyHeart
*
* For current operator, only matrix makes sense; so only this specialization is actually defined.
*
* \param[in] coefficient Coefficient applied to the computed matrix.
*/
template<MatrixVectorNature MatrixVectorNatureT>
void ComputeEltArray(double coefficient);
void ComputeEltArray();
private:
......@@ -104,7 +103,7 @@ namespace HappyHeart
// Template method specialization.
template<>
void ScalarDivVectorial::ComputeEltArray<MatrixVectorNature::matrix>(double coefficient);
void ScalarDivVectorial::ComputeEltArray<MatrixVectorNature::matrix>();
......
......@@ -64,20 +64,32 @@ namespace HappyHeart
auto& system_matrix = GetNonCstSystemMatrix(velocity_numbering_subset, velocity_numbering_subset);
GetNonCstVelocityStiffnessOperator().Assemble(GetViscosity(), system_matrix);
{
GlobalMatrixWithCoefficient matrix_with_coeff(system_matrix, GetViscosity());
GetNonCstVelocityStiffnessOperator().Assemble(std::make_tuple(matrix_with_coeff));
}
GetNonCstPsiDivOperator().Assemble(-1., system_matrix);
GetNonCstPsiDivOperator().Assemble(std::make_tuple(GlobalMatrixWithCoefficient(system_matrix, -1.)));
// GetNonCstStabilizationOperator().Assemble(GetStabilizationFactor(), system_matrix);
auto& rhs = GetNonCstSystemRhs(velocity_numbering_subset);
auto time = GetTransientParameters().GetTime();
const auto time = GetTransientParameters().GetTime();
if (IsOperatorActivated<ForceIndexList::volumic_force>())
GetNonCstForceOperator<ForceIndexList::volumic_force>().Assemble(1., rhs, time);
{
auto&& force_vector = GlobalVectorWithCoefficient(rhs, 1.);
GetNonCstForceOperator<ForceIndexList::volumic_force>().Assemble(std::make_tuple(std::move(force_vector)),
time);
}
if (IsOperatorActivated<ForceIndexList::surfacic_force>())
GetNonCstForceOperator<ForceIndexList::surfacic_force>().Assemble(1., rhs, time);
{
auto&& force_vector = GlobalVectorWithCoefficient(rhs, 1.);
GetNonCstForceOperator<ForceIndexList::surfacic_force>().Assemble(std::make_tuple(std::move(force_vector)),
time);
}
}
......
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