3 #ifndef DUNE_DUAL_P1_LOCALBASIS_HH
4 #define DUNE_DUAL_P1_LOCALBASIS_HH
6 #include <dune/common/fvector.hh>
7 #include <dune/common/fmatrix.hh>
28 template<
class D,
class R,
int dim,
bool faceDualT=false>
46 std::vector<typename Traits::RangeType>& out)
const
49 std::vector<typename Traits::RangeType> p1Values(
size());
53 for (
int i=0; i<dim; i++) {
55 p1Values[i+1] = in[i];
61 for (
int i=0; i<=dim; i++) {
62 out[i] = (dim+!
faceDual)*p1Values[i];
63 for (
int j=0; j<i; j++)
64 out[i] -= p1Values[j];
66 for (
int j=i+1; j<=dim; j++)
67 out[i] -= p1Values[j];
74 std::vector<typename Traits::JacobianType>& out)
const
77 std::vector<typename Traits::JacobianType> p1Jacs(
size());
79 for (
int i=0; i<dim; i++)
82 for (
int i=0; i<dim; i++)
83 for (
int j=0; j<dim; j++)
84 p1Jacs[i+1][0][j] = (i==j);
89 for (
size_t i=0; i<=dim; i++) {
91 out[i][0].axpy(dim+!faceDual,p1Jacs[i][0]);
93 for (
size_t j=0; j<i; j++)
94 out[i][0] -= p1Jacs[j][0];
96 for (
int j=i+1; j<=dim; j++)
97 out[i][0] -= p1Jacs[j][0];
Dual Lagrange shape functions on the simplex.
Definition: dualp1localbasis.hh:29
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: dualp1localbasis.hh:73
unsigned int size() const
number of shape functions
Definition: dualp1localbasis.hh:39
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:14
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: dualp1localbasis.hh:45
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:37
LocalBasisTraits< D, dim, Dune::FieldVector< D, dim >, R, 1, Dune::FieldVector< R, 1 >, Dune::FieldMatrix< R, 1, dim > > Traits
export type traits for function signature
Definition: dualp1localbasis.hh:36
unsigned int order() const
Polynomial order of the shape functions.
Definition: dualp1localbasis.hh:102
D DomainType
domain type
Definition: localbasis.hh:49
static const bool faceDual
Determines if the basis is only biorthogonal on adjacent faces.
Definition: dualp1localbasis.hh:33