Skip to content
Snippets Groups Projects
Commit fa6bdcc0 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/convection_diffusion_bug' into 'develop'

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

See merge request spraetor/dune-amdis!75
parents 04e259ab b990f698
No related branches found
No related tags found
No related merge requests found
......@@ -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_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment