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

#531 Add another static_assert to make sure a tuple is properly given as argument.

parent 0cdcc273
......@@ -21,6 +21,8 @@ namespace HappyHeart
template<class LinearAlgebraTupleT>
void Assembly531(const LinearAlgebraTupleT& linear_algebra_tuple)
{
static_assert(Utilities::IsSpecializationOf<std::tuple, LinearAlgebraTupleT>::value,
"Compilation error if LinearAlgebraTupleT is not a std::tuple.");
Impl::Recursivity<LinearAlgebraTupleT, 0, std::tuple_size<LinearAlgebraTupleT>::value>
::Assembly531(linear_algebra_tuple);
......
......@@ -114,7 +114,9 @@ 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, GlobalVector& global_vector, double time,
template<class LinearAlgebraTupleT>
void Assemble(LinearAlgebraTupleT&& global_vector_with_coeff_tuple,
double time,
const Domain& domain = Domain()) const;
......
......@@ -18,12 +18,14 @@ namespace HappyHeart
{
inline void TransientSource::Assemble(double coefficient,
GlobalVector& global_vector,
template<class LinearAlgebraTupleT>
inline void TransientSource::Assemble(LinearAlgebraTupleT&& global_vector_with_coeff_tuple,
double time,
const Domain& domain) const
{
return Parent::AssembleWithVariadicArguments(coefficient, global_vector, domain, time);
return Parent::Assemble531(std::move(global_vector_with_coeff_tuple),
domain,
time);
}
......
......@@ -202,18 +202,22 @@ namespace HappyHeart
{
if (newton_iteration == 0)
{
auto& force_vector = vm.GetNonCstForce();
auto time = transient_parameters.GetTime();
const auto time = transient_parameters.GetTime();
if (this->template IsOperatorActivated<ForceIndexList::volumic_force>())
this->template GetNonCstForceOperator<ForceIndexList::volumic_force>().Assemble(1.,
force_vector,
{
auto&& force_vector = GlobalVectorWithCoefficient(vm.GetNonCstForce(), 1.);
this->template GetNonCstForceOperator<ForceIndexList::volumic_force>().Assemble(std::move(force_vector),
time);
}
if (this->template IsOperatorActivated<ForceIndexList::surfacic_force>())
this->template GetNonCstForceOperator<ForceIndexList::surfacic_force>().Assemble(1.,
force_vector,
{
auto&& force_vector = GlobalVectorWithCoefficient(vm.GetNonCstForce(), 1.);
this->template GetNonCstForceOperator<ForceIndexList::surfacic_force>().Assemble(std::move(force_vector),
time);
}
}
}
else
......
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