2 #ifndef DUNE_Q1_LOCALBASIS_HH
3 #define DUNE_Q1_LOCALBASIS_HH
5 #include <dune/common/fmatrix.hh>
22 template<
class D,
class R,
int dim>
37 std::vector<typename Traits::RangeType>& out)
const
41 for (
size_t i=0; i<
size(); i++) {
45 for (
int j=0; j<dim; j++)
47 out[i] *= (i & (1<<j)) ? in[j] : 1-in[j];
56 std::vector<typename Traits::JacobianType>& out)
const
61 for (
size_t i=0; i<
size(); i++) {
64 for (
int j=0; j<dim; j++) {
68 out[i][0][j] = (i & (1<<j)) ? 1 : -1;
70 for (
int k=0; k<dim; k++) {
74 out[i][0][j] *= (i & (1<<k)) ? in[k] : 1-in[k];