Commit b990f698 authored by Praetorius, Simon's avatar Praetorius, Simon

corrected bug in convection-diffusion when assigning a FieldVector<1> to a FieldVector<N>

parent 04e259ab
Pipeline #1634 passed with stage
in 47 minutes and 16 seconds
......@@ -104,7 +104,7 @@ namespace AMDiS
jacobian.mv(shapeGradients[i][0], gradients[i]);
const auto A = localFctA(local);
WorldVector b; b = localFctB(local);
WorldVector b = makeB(localFctB(local));
const auto c = localFctC(local);
IF_CONSTEXPR(conserving) {
......@@ -194,6 +194,21 @@ namespace AMDiS
[] (auto) { return 0; });
}
template <class T, int N>
static FieldVector<T,dow> makeB(FieldVector<T,N> const& b) { return b; }
template <class T, int N>
static FieldVector<T,dow> makeB(FieldVector<T,N>&& b) { return std::move(b); }
template <class T>
static FieldVector<T,dow> makeB(FieldVector<T,1> const& b) { return {T(b)}; }
template <class T>
static FieldVector<T,dow> makeB(FieldVector<T,1>&& b) { return {T(b)}; }
template <class T, std::enable_if_t<std::is_arithmetic<T>::value, int> = 0>
static FieldVector<T,dow> makeB(T b) { return {b}; }
private:
GridFctA gridFctA_;
GridFctB gridFctB_;
......
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