3 #ifndef DUNE_PDELAB_COMMON_CROSSPRODUCT_HH
4 #define DUNE_PDELAB_COMMON_CROSSPRODUCT_HH
6 #include <dune/common/fvector.hh>
7 #include <dune/common/static_assert.hh>
26 template<
unsigned dimB_,
unsigned dimC_>
29 "CrossProduct cannot be used unspecialized");
32 static const unsigned dimA;
34 static const unsigned dimB;
36 static const unsigned dimC;
39 template<
typename AType,
typename BType,
typename CType>
60 static const unsigned dimA = 3;
62 static const unsigned dimB = 3;
64 static const unsigned dimC = 3;
67 template<
typename AType,
typename BType,
typename CType>
69 for(
unsigned i = 0; i < 3; ++i) {
72 A[i] = B[j]*C[k] - B[k]*C[j];
100 static const unsigned dimA = 1;
102 static const unsigned dimB = 2;
104 static const unsigned dimC = 2;
107 template<
typename AType,
typename BType,
typename CType>
109 A[0] = B[0]*C[1] - B[1]*C[0];
137 static const unsigned dimA = 2;
139 static const unsigned dimB = 2;
141 static const unsigned dimC = 1;
144 template<
typename AType,
typename BType,
typename CType>
175 static const unsigned dimA = 2;
177 static const unsigned dimB = 1;
179 static const unsigned dimC = 2;
182 template<
typename AType,
typename BType,
typename CType>
203 template<
typename T,
int dimB,
int dimC>
205 const FieldVector<T, dimC>& c,
214 template<
typename T,
int dimB,
int dimC>
215 FieldVector<T, CrossProduct<dimB, dimC>::dimA>
217 const FieldVector<T, dimC>& c) {
218 FieldVector<T, CrossProduct<dimB, dimC>::dimA> a;
226 #endif // DUNE_PDELAB_COMMON_CROSSPRODUCT_HH
static const unsigned dimA
dimension of
Definition: crossproduct.hh:32
CrossProduct(AType &A, const BType &B, const CType &C)
calculate cross product of B and C
Definition: crossproduct.hh:68
static const unsigned dimC
dimension of
Definition: crossproduct.hh:36
CrossProduct(AType &A, const BType &B, const CType &C)
calculate cross product of B and C
CrossProduct(AType &A, const BType &B, const CType &C)
calculate cross product of B and C
Definition: crossproduct.hh:145
static const unsigned dimB
dimension of
Definition: crossproduct.hh:34
CrossProduct(AType &A, const BType &B, const CType &C)
calculate cross product of B and C
Definition: crossproduct.hh:108
CrossProduct(AType &A, const BType &B, const CType &C)
calculate cross product of B and C
Definition: crossproduct.hh:183
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
Calculate cross product.
Definition: crossproduct.hh:27
void crossproduct(const FieldVector< T, dimB > &b, const FieldVector< T, dimC > &c, FieldVector< T,(CrossProduct< dimB, dimC >::dimA)> &a)
calculate crossproduct
Definition: crossproduct.hh:204