3#ifndef DUNE_Q1_LOCALBASIS_HH
4#define DUNE_Q1_LOCALBASIS_HH
10#include <dune/localfunctions/common/localbasis.hh>
25 template<
class D,
class R,
int dim>
40 std::vector<typename Traits::RangeType>& out)
const
44 for (
size_t i=0; i<
size(); i++) {
48 for (
int j=0; j<dim; j++)
50 out[i] *= (i & (1<<j)) ? in[j] : 1-in[j];
59 std::vector<typename Traits::JacobianType>& out)
const
64 for (
size_t i=0; i<
size(); i++) {
67 for (
int j=0; j<dim; j++) {
71 out[i][0][j] = (i & (1<<j)) ? 1 : -1;
73 for (
int k=0; k<dim; k++) {
77 out[i][0][j] *= (i & (1<<k)) ? in[k] : 1-in[k];
94 std::vector<typename Traits::RangeType>& out)
const
98 if (totalOrder == 0) {
101 else if (totalOrder == 1) {
104 auto direction = std::distance(
order.begin(), std::find(
order.begin(),
order.end(), 1));
105 if (direction >= dim) {
110 for (std::size_t i = 0; i <
size(); ++i) {
114 out[i] = (i & (1<<direction)) ? 1 : -1;
116 for (
int k = 0; k < dim; ++k) {
119 out[i] *= (i & (1<<k)) ? in[k] : 1-in[k];
A dense n x m matrix.
Definition: fmatrix.hh:68
vector space out of a tensor product of fields.
Definition: fvector.hh:93
Default exception for dummy implementations.
Definition: exceptions.hh:261
Lagrange shape functions of order 1 on the reference cube.
Definition: q1localbasis.hh:27
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: q1localbasis.hh:58
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: q1localbasis.hh:39
unsigned int order() const
Polynomial order of the shape functions.
Definition: q1localbasis.hh:131
unsigned int size() const
number of shape functions
Definition: q1localbasis.hh:33
void partial(const std::array< unsigned int, dim > &order, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate partial derivatives of any order of all shape functions.
Definition: q1localbasis.hh:92
Default exception class for range errors.
Definition: exceptions.hh:252
Implements a matrix constructed from a given type representing a field and compile-time given number ...
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:331
Dune namespace.
Definition: alignedallocator.hh:10
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:32
D DomainType
domain type
Definition: localbasis.hh:43