KASKADE 7 development version
nedelecspace.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the library KASKADE 7 */
4/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5/* */
6/* Copyright (C) 2002-2016 Zuse Institute Berlin */
7/* */
8/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9/* see $KASKADE/academic.txt */
10/* */
11/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
13#ifndef NEDELECSPACE_HH
14#define NEDELECSPACE_HH
15
16#include <numeric>
17
18#include "fem/combiner.hh"
19#include "fem/functionspace.hh"
21#include "fem/views.hh"
22
23//---------------------------------------------------------------------
24namespace Kaskade
25{
26
27
39 template <class GridView>
41 {
42 typedef typename GridView::template Codim<0>::Entity Cell;
43 static int const dim = GridView::dimension;
44
45 public:
47
48 VectorialConverterBase(Cell const& cell): cell_(&cell) {}
49
50 void moveTo(Cell const& cell) { cell_ = &cell; }
51
53 {
54 assert(cell_);
55 assert(cell_->geometry().affine()); // works only with affine geometries (and hence constant C) - otherwise the spatial derivatives are wrong!
56 Btinv = cell_->geometry().jacobianInverseTransposed(x);
57 update();
58 }
59
61 template <class Scalar>
63 {
64 return C * sf;
65 }
66
68 template <class Scalar>
70 {
72 // global value: C*phi
73 phi.value = Btinv * sf.first;
74
75 // global derivative: C*dphi*inv(B)
76 phi.gradient = C * sf.second * transpose(Btinv);
77
78 return phi;
79 }
80
84 template <class Scalar>
86 {
88 // global value: C*phi
89 phi.value = C * sf.value;
90
91 // global derivative: C*dphi*inv(B)
92 if (deriv >= 1)
93 phi.gradient = C * sf.gradient * transpose(Btinv);
94
95 assert(deriv<2 && "not yet implemented"); // not yet implemented
96
97 return phi;
98 }
99
103 template <class Scalar>
105 {
107 solve(C,loc,glob);
108 return loc;
109 }
110
111
112 protected:
116 virtual void update() = 0;
117
118 // Solves Ax=b. Correct :) implementation of LU decomposition.
119 // Should use Dune version, which is, however, buggy in some versions.
123 {
124 typedef typename GridView::ctype real;
125
126 for (int i=0; i<dim-1; ++i) {
127 // column pivoting
128 real max = std::abs(A[i][i]);
129 int midx = i;
130 for (int k=i+1; k<dim; ++k)
131 if (std::abs(A[k][i])>max) {
132 max = std::abs(A[k][i]);
133 midx = k;
134 }
135 // swap rows
136 for (int j=i; j<dim; ++j)
137 std::swap(A[i][j],A[midx][j]);
138 std::swap(b[i],b[midx]);
139 // perform elimination
140 for (int k=i+1; k<dim; ++k) {
141 real p = A[k][i]/A[i][i];
142 for (int j=i; j<dim; ++j)
143 A[k][j] -= p*A[i][j];
144 b[k] -= p*b[i];
145 }
146 }
147 // backsubstitution
148 for (int i=dim-1; i>=0; --i) {
149 for (int k=i+1; k<dim; ++k)
150 b[i] -= A[i][k]*b[k];
151 b[i] /= A[i][i];
152 }
153 x = b;
154 }
155
156
157 Cell const* cell_;
158 Dune::FieldMatrix<typename GridView::ctype,dim,dim> Btinv; // contains TRANSPOSED inverse jacobian
160 };
161
162 //--------------------------------------------------------------------------------------
163
176 template <class GridView>
178 {
179 public:
180 HcurlConverter() = default;
181
182 HcurlConverter(typename GridView::template Codim<0>::Entity const& cell): VectorialConverterBase<GridView>(cell) {}
183
184 private:
185 virtual void update()
186 {
187 this->C = this->Btinv;
188 }
189 };
190
191 //--------------------------------------------------------------------------------------
192
205 template <class GridView>
206 class HdivConverter: public VectorialConverterBase<GridView>
207 {
208 public:
209 HdivConverter() = default;
210
211 HdivConverter(typename GridView::template Codim<0>::Entity const& cell): VectorialConverterBase<GridView>(cell) {}
212
213 private:
214 virtual void update()
215 {
216 auto& C = this->C;
217 C = this->Btinv;
218 C.invert(); // C = B^T
219 C *= this->Btinv.determinant(); // C = B^T * det(B^{-T}) = B^T / det(B^T)
220 }
221 };
222
223 //--------------------------------------------------------------------------------------
224 //--------------------------------------------------------------------------------------
225
233 template <class ScalarType, class GV>
235 {
236 public:
238
239 typedef GV GridView;
240 typedef typename GridView::Grid Grid;
241 typedef typename GridView::IndexSet IndexSet;
242
243 static int const dim = Grid::dimension;
244
248 static bool const globalSupport = false;
249
251 static int const continuity = -1;
253
254 typedef std::pair<size_t,int> IndexPair;
255 typedef std::vector<IndexPair>::const_iterator SortedIndexIterator;
257
258 typedef typename Grid::template Codim<0>::Entity Cell;
260
265 HdivMapper(GridView const& gridView_, int order_):
266 gridView(gridView_), indexSet(gridView_.indexSet()), order(order_),
267 sfs(hdivShapeFunctionSet<typename Grid::ctype,dim,Scalar>(Dune::GeometryType(Dune::GeometryType::simplex),order))
268 {
269 auto const& simplex = Dune::ReferenceElements<typename Grid::ctype,dim>::simplex();
270 update();
271 }
272
273 virtual ~HdivMapper() {}
274
281 ShapeFunctionSet const& shapefunctions(Cell const& cell, bool /* contained */) const
282 {
283 assert(cell.type().isSimplex());
284 return sfs;
285 }
286
287 ShapeFunctionSet const& shapefunctions(size_t /* n */) const
288 {
289 return sfs;
290 }
291
295 int maxOrder() const
296 {
297 return order;
298 }
299
304 {
305 return GlobalIndexRange(globIdx[0].begin(),globIdx[0].end());
306 }
307
313 {
314 return globalIndices(indexSet.index(cell));
315 }
316
322 {
323 return GlobalIndexRange(globIdx[n].begin(),globIdx[n].end());
324 }
325
330 {
331 static std::vector<IndexPair> dummy; // empty
332 return SortedIndexRange(dummy.begin(),dummy.end());
333 }
334
339 {
340 return sortedIndices(indexSet().index(cell));
341 }
342
347 {
348 return SortedIndexRange(sortedIdx[n].begin(),sortedIdx[n].end());
349 }
350
354 size_t size() const { return nDof; }
355
360
369 class Combiner: public DiagonalCombiner<Scalar> {
370 public:
378 Combiner(Cell const& cell, GridView const& gv, IndexSet const& is, size_t index, ShapeFunctionSet const& sfs)
380 {
381 // First compute the global indices of the neighboring cells for face orientation. If the
382 // neighbor has lower index, we flip our face functions.
383 Scalar faceOrient[dim+1]; // we have dim+1 faces in a simplex
384 for (auto fi=gv.ibegin(cell); fi!=gv.iend(cell); ++fi) // and the same number of intersections in conforming grids
385 if (fi->neighbor())
386 faceOrient[fi->indexInInside()] = is.index(*(fi->outside()))>index? 1.0: -1.0;
387 else
388 faceOrient[fi->indexInInside()] = 1.0;
389
390 // Assign an orientation to all shape functions depending on which face (if any) they are associated with.
391 for (int i=0; i<orient.size(); ++i)
392 {
393 auto loc = sfs[i].location();
394 int codim = std::get<1>(loc);
395 if (codim>0)
396 this->orient[i] = faceOrient[std::get<2>(loc)]; // face shape function: look up the face number
397 else
398 this->orient[i] = 1.0; // cell shape functions: orientation doesn't matter
399 }
400 }
401 };
402
408 Combiner combiner(Cell const& cell, size_t index) const
409 {
410 assert(indexSet.index(cell)==index);
411 return Combiner(cell,gridView,indexSet,index,shapefunctions(cell,true));
412 }
413
423 void update() {
424 // Precompute and cache all the global indices. First allocate the
425 // memory needed to prevent frequent reallocation.
426 globIdx.resize(indexSet.size(0));
427
428 // Compute the number of cell-local and face functions.
429 int nCellSf = 0;
430 int nFaceSf = 0;
431 for (int i=0; i<sfs.size(); ++i)
432 if (std::get<1>(sfs[i].location()) == 0) // codim 0 -> cell function
433 ++nCellSf;
434 else
435 ++nFaceSf;
436
437 nCellF = indexSet.size(0) * nCellSf;
438 size_t const nFaceF = indexSet.size(1) * nFaceSf;
439 nDof = nCellF + nFaceF;
440
441 // We sort the ansatz functions first cell local functions then face functions. This way,
442 // the matrix gets an arrow shape. Within each cell and face, the shape functions are sorted
443 // according to their local number and their globally unique local number, respectively.
444 // Step through all cells.
445 auto end = gridView.template end<0>() ;
446 for (auto ci=gridView.template begin<0>(); ci!=end; ++ci)
447 {
448 size_t const cellIdx = indexSet.index(*ci);
449 auto& gidx = globIdx[cellIdx];
450 auto const& sf = shapefunctions(*ci);
451
452 GlobalBarycentricPermutation<dim> gbp(indexSet,*ci);
453
454 // Allocate needed memory. The number of local ansatz functions the number of vectorial
455 // shape functions.
456 gidx.resize(sf.size());
457 sortedIdx[cellIdx].resize(gidx.size());
458 for (int i=0; i<gidx.size(); ++i)
459 {
460 int nominalOrder, codim, entity, indexInEntity;
461 std::tie(nominalOrder,codim,entity,indexInEntity) = sf[i].location();
462 if (codim == 0) // codim 0 -> cell function
463 {
464 gidx[i] = cellIdx*nCellSf + indexInEntity;
465 }
466 else // codim 1 -> face function
467 {
468 // obtain the permutation to globally unique numbering and the barycentric coordinates of
469 // the shape function's location to be permuted.
470 std::array<int,dim> pi = gbp.barycentricSubsetPermutation(entity);
471 std::array<int,dim+1> bc = barycentric(SimplexLagrangeDetail::tupleIndex(order,sf[i].location()),order);
472 std::array<int,dim> subBc;
473 for (int i=0; i<dim; ++i)
474 subBc[i] = bc[pi[i]];
475
476 // get local sequence number of (permuted) shape function's nodal point within the subentity.
477 int k = SimplexLagrangeDetail::local(&subBc[0],dim-1,order);
478
479 size_t faceIdx = indexSet.subIndex(*ci,entity,1);
480 gidx[i] = nCellF + faceIdx*nFaceSf + k;
481 }
482 sortedIdx[cellIdx][i] = std::make_pair(gidx[i],i);
483 }
484 std::sort(sortedIdx[cellIdx].begin(),sortedIdx[cellIdx].end());
485 }
486 }
487
488 private:
489 GridView gridView;
490 IndexSet const& indexSet;
491 int order;
492
493 size_t nCellF; // number of cell-local ansatz functions
494 size_t nDof;
495
496 // contains the diagonal of K
497 std::vector<Scalar> orient;
498 // For each cell, this vector contains a collection with global
499 // indices of each shape function on the cell. Note that up to their
500 // sign, global shape functions and global ansatz functions
501 // coincide.
502 std::vector<std::vector<size_t> > globIdx;
503
504 // In sortedIdx, for each cell there is a vector of (global index, local index) pairs, sorted ascendingly
505 // by the global index. This could be computed outside on demand, but the sorting takes time and may be
506 // amortized over multiple assembly passes/matrix blocks if cached here.
507 std::vector<std::vector<IndexPair> > sortedIdx;
508
509 ShapeFunctionSet const& sfs;
510 };
511
512 //--------------------------------------------------------------------------------------
513 //--------------------------------------------------------------------------------------
514
522 template <class ScalarType, class GV>
524 {
525 public:
526 typedef ScalarType RT __attribute__((deprecated));
528
529
530 typedef GV GridView;
531 typedef typename GridView::Grid Grid;
532 typedef typename GridView::IndexSet IndexSet;
533
534 static int const dim = Grid::dimension;
535
539 static bool const globalSupport = false;
540
542 static int const continuity = -1;
544
545 typedef std::pair<size_t,int> IndexPair;
546 typedef std::vector<IndexPair>::const_iterator SortedIndexIterator;
548
549 typedef typename Grid::template Codim<0>::Entity Cell;
551
556 NedelecMapper(GridView const& gridView_, bool /* unused */):
557 gridView(gridView_), indexSet(gridView_.indexSet())
558 {
559 Dune::ReferenceElement<typename Grid::ctype,dim> const &simplex = Dune::ReferenceElements<typename Grid::ctype,dim>::simplex();
560 // Dune::ReferenceSimplex<typename Grid::ctype,dim> simplex;
561
562 vertexIndex_.reserve(simplex.size(dim-1));
563
564 for (int e=0; e<simplex.size(dim-1); ++e)
565 vertexIndex_.push_back(std::make_pair(simplex.subEntity(e,dim-1,0,dim),
566 simplex.subEntity(e,dim-1,1,dim)));
567 update();
568 }
569
570 virtual ~NedelecMapper() {}
571
572 ShapeFunctionSet const& shapefunctions(Cell const& cell) const
573 {
574 assert(cell.type().isSimplex());
575 return nedelecShapeFunctionSet<typename Grid::ctype,dim,Scalar>(cell.type(),1);
576 }
577
578 ShapeFunctionSet const& shapefunctions(size_t n) const
579 {
580 assert(cell.type().isSimplex());
581 return nedelecShapeFunctionSet<typename Grid::ctype,dim,Scalar>(Dune::GeometryType(Dune::GeometryType::simplex,dim),1);
582 }
583
589 {
590 return GlobalIndexRange(globIdx[0].begin(),globIdx[0].end());
591 }
592
599 {
600 return globalIndices(indexSet.index(cell));
601 }
602
609 {
610 return GlobalIndexRange(globIdx[n].begin(),globIdx[n].end());
611 }
612
617 {
618 static std::vector<IndexPair> dummy; // empty
619 return SortedIndexRange(dummy.begin(),dummy.end());
620 }
621
626 {
627 return sortedIndices(indexSet().index(cell));
628 }
629
634 {
635 return SortedIndexRange(sortedIdx[n].begin(),sortedIdx[n].end());
636 }
637
641 size_t size() const { return indexSet.size(dim-1); }
642
647
648
657 class Combiner {
658 public:
662 Combiner(Cell const& cell, IndexSet const& is, std::vector<std::pair<int,int> > const& vertexIndex)
663 : orient(vertexIndex.size())
664 {
665 // first compute the global indices of cell (i.e. simplex) vertices.
666 int globalVertexIndex[dim+1];
667 for (int i=0; i<=dim; ++i)
668 globalVertexIndex[i] = is.subIndex(cell,i,dim);
669
670 // induce a global orientation based on the numbering of vertices
671 // edge points locally from locally lower to locally higher index
672 // edge points globally from globally lower index to globally higher index
673 for (int i=0; i<vertexIndex.size(); ++i) {
674 int p0 = vertexIndex[i].first;
675 int p1 = vertexIndex[i].second;
676 orient[i] = globalVertexIndex[p0]<globalVertexIndex[p1]? 1: -1;
677 }
678 }
679
684 template <class Matrix>
685 void rightTransform(Matrix& A) const {
686 // multiply from right -> modify columns
687 assert(A.M()==orient.size());
688 for (int i=0; i<A.N(); ++i)
689 for (int j=0; j<A.M(); ++j)
690 A[i][j] *= orient[j];
691 }
692
694 template <int n, int m>
695 void rightTransform(std::vector<VariationalArg<Scalar,n,m> >& v) const {
696 assert(v.size()==orient.size());
697 for (int i=0; i<v.size(); ++i) {
698 v[i].value *= orient[i];
699 v[i].gradient *= orient[i];
700 }
701 }
702
707 template <class Matrix>
708 void leftPseudoInverse(Matrix& A) const {
709 // Since K^{-1} = K, this is simple...
710 // multiply from left -> modify rows
711 assert(A.N()==orient.size());
712 for (int i=0; i<A.N(); ++i)
713 for (int j=0; j<A.M(); ++j)
714 A[i][j] *= orient[i];
715 }
716
719 operator Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,1,1> >() const
720 {
721 int n = orient.size();
722 Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,1,1> > K(n,n,Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,1,1> >::random);
723 for (int i=0; i<n; ++i)
724 K.incrementrowsize(i);
725 K.endrowsizes();
726 for (int i=0; i<n; ++i)
727 K.addindex(i,i);
728 K.endindices();
729 for (int i=0; i<n; ++i)
730 *K[i].begin() = orient[i];
731 return K;
732 }
733
734 private:
735 // contains the diagonal of K
736 std::vector<Scalar> orient;
737 };
738
744 Combiner combiner(Cell const& cell, size_t index) const
745 {
746 assert(indexSet.index(cell)==index);
747 return Combiner(cell,indexSet,vertexIndex_);
748 }
749
755 void update() {
756 // Precompute and cache all the global indices. First allocate the
757 // memory needed to prevent frequent reallocation.
758 globIdx.resize(indexSet.size(0));
759
760 // Step through all cells.
761 // typedef typename IndexSet::template Codim<0>::template Partition<Dune::All_Partition>::Iterator CellIterator;
762
763 typedef typename GridView::template Codim<0>::Iterator CellIterator;
764
765 CellIterator end = gridView.template end<0>() ;
766
767 // CellIterator end = indexSet.template end<0,Dune::All_Partition>();
768 for (CellIterator ci=gridView.template begin<0>(); ci!=end; ++ci) {
769 size_t const k = indexSet.index(*ci);
770 std::vector<size_t>& gidx = globIdx[k];
771 ShapeFunctionSet const& sf = shapefunctions(*ci);
772 // Allocate needed memory.
773 gidx.resize(sf.size());
774 sortedIdx[k].resize(gidx.size());
775 for (int i=0; i<gidx.size(); ++i)
776 {
777 gidx[i] = indexSet.subIndex(*ci,std::get<2>(sf[i].location()),dim-1);
778 sortedIdx[k][i] = std::make_pair(gidx[i],i);
779 }
780 std::sort(sortedIdx[k].begin(),sortedIdx[k].end());
781 }
782 }
783
784 private:
785 GridView gridView;
786 IndexSet const& indexSet;
787
788 // For each cell, this vector contains a collection with global
789 // indices of each shape function on the cell. Note that up to their
790 // sign, global shape functions and global ansatz functions
791 // coincide.
792 std::vector<std::vector<size_t> > globIdx;
793
794 // In sortedIdx, for each cell there is a vector of (global index, local index) pairs, sorted ascendingly
795 // by the global index. This could be computed outside on demand, but the sorting takes time and may be
796 // amortized over multiple assembly passes/matrix blocks if cached here.
797 std::vector<std::vector<IndexPair> > sortedIdx;
798
799 // For each edge in the reference simplex, this array contains the
800 // local vertex indices of the start and end points of the edge.
801 std::vector<std::pair<int,int> > vertexIndex_;
802 };
803} // end of namespace Kaskade
804
805
806
807#endif
A base class for implementing combiners with diagonal structure.
Definition: combiner.hh:35
std::vector< Scalar > orient
Definition: combiner.hh:106
A class for computing permutations of local vertex numbers of simplex subentities to a globally uniqu...
std::array< int, dimension+1-codim > barycentricSubsetPermutation(int e) const
Computes a permutation of barycentric coordinates to globally unique ordering.
A class mapping local vectorial shape function values and gradients to global shape function values a...
HcurlConverter(typename GridView::template Codim< 0 >::Entity const &cell)
A class mapping local vectorial shape function values and gradients to global shape function values a...
HdivConverter(typename GridView::template Codim< 0 >::Entity const &cell)
A class implementing a matrix mapping a subset of global degrees of freedom (those given by globalIn...
Combiner(Cell const &cell, GridView const &gv, IndexSet const &is, size_t index, ShapeFunctionSet const &sfs)
Degrees of freedom manager for H(div) conforming elements.
Grid::template Codim< 0 >::Entity Cell
GridView::Grid Grid
GlobalIndexRange globalIndices(Cell const &cell) const
Returns a const sequence containing the global indices of the shape functions associated to this cell...
RangeView< std::vector< size_t >::const_iterator > GlobalIndexRange
SortedIndexRange sortedIndices(Cell const &cell) const
Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index o...
SortedIndexRange sortedIndices(size_t n) const
Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index o...
size_t size() const
Returns the number of global degrees of freedom managed.
static SortedIndexRange initSortedIndexRange()
Returns an empty range just for initialization, since RangeView is not default constructible.
HdivShapeFunctionSetContainer< typenameGrid::ctype, dim, Scalar >::value_type ShapeFunctionSet
ShapeFunctionSet const & shapefunctions(size_t) const
static bool const globalSupport
Whether the ansatz functions have global support (i.e. lead to dense matrices).
void update()
(Re)computes the internal data.
HdivConverter< GridView > Converter
A class mapping local shape function values and derivatives to global shape function values and deriv...
std::pair< size_t, int > IndexPair
static int const continuity
HdivMapper(GridView const &gridView_, int order_)
Constructs an HdivMapper for a given grid view.
GridView::IndexSet IndexSet
int maxOrder() const
Returns the maximal polynomial order of shape functions encountered in any cell.
GlobalIndexRange initGlobalIndexRange() const
Returns an empty range just for initialization purposes, since RangeView is not default constructible...
ShapeFunctionSet const & shapefunctions(Cell const &cell, bool) const
Returns the set of shape functions defined on this cell.
GlobalIndexRange globalIndices(size_t n) const
Returns a const sequence containing the global indices of the shape functions associated to the cell ...
RangeView< SortedIndexIterator > SortedIndexRange
Combiner combiner(Cell const &cell, size_t index) const
Returns a combiner for the given cell.
std::vector< IndexPair >::const_iterator SortedIndexIterator
static int const dim
A class implementing a matrix mapping a subset of global degrees of freedom (those given by globalIn...
void rightTransform(std::vector< VariationalArg< Scalar, n, m > > &v) const
In-place computation of row vectors .
void leftPseudoInverse(Matrix &A) const
In-place computation of .
Combiner(Cell const &cell, IndexSet const &is, std::vector< std::pair< int, int > > const &vertexIndex)
void rightTransform(Matrix &A) const
In-place computation of .
Degrees of freedom manager for Nedelec edge elements.
std::vector< IndexPair >::const_iterator SortedIndexIterator
void update()
(Re)computes the internal data.
static int const dim
GlobalIndexRange globalIndices(size_t n) const
Grid::template Codim< 0 >::Entity Cell
static bool const globalSupport
Whether the ansatz functions have global support (i.e. lead to dense matrices).
SortedIndexRange sortedIndices(Cell const &cell) const
Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index o...
ScalarType RT __attribute__((deprecated))
std::pair< size_t, int > IndexPair
static int const continuity
Combiner combiner(Cell const &cell, size_t index) const
RangeView< std::vector< size_t >::const_iterator > GlobalIndexRange
NedelecShapeFunctionSetContainer< typenameGrid::ctype, dim, Scalar >::value_type ShapeFunctionSet
HcurlConverter< Grid > Converter
A class mapping local shape function values and derivatives to global shape function values and deriv...
GlobalIndexRange initGlobalIndexRange() const
NedelecMapper(GridView const &gridView_, bool)
Constructs a NedelecMapper for a given grid view. The second parameter is unused and only specified f...
GlobalIndexRange globalIndices(Cell const &cell) const
GridView::IndexSet IndexSet
ShapeFunctionSet const & shapefunctions(size_t n) const
RangeView< SortedIndexIterator > SortedIndexRange
SortedIndexRange sortedIndices(size_t n) const
Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index o...
static SortedIndexRange initSortedIndexRange()
Returns an empty range just for initialization, since RangeView is not default constructible.
ShapeFunctionSet const & shapefunctions(Cell const &cell) const
DEPRECATED. Use boost::iterator_range instead.
Definition: views.hh:25
virtual int size() const
Number of shape functions in the set.
A class mapping local vectorial shape function values and gradients to global shape function values a...
Definition: nedelecspace.hh:41
Dune::FieldMatrix< Scalar, dim, 1 > global(Dune::FieldMatrix< Scalar, dim, 1 > const &sf) const
Applies the transformation to shape function value.
Definition: nedelecspace.hh:62
virtual void update()=0
Redefine this to set .
VariationalArg< Scalar, dim, dim > global(VariationalArg< Scalar, dim, dim > const &sf, int deriv) const
Applies the transformation to shape function value, derivative, and Hessian, returning a filled Vari...
Definition: nedelecspace.hh:85
void moveTo(Cell const &cell)
Definition: nedelecspace.hh:50
void solve(Dune::FieldMatrix< typename GridView::ctype, dim, dim > A, Dune::FieldVector< typename GridView::ctype, dim > &x, Dune::FieldVector< typename GridView::ctype, dim > b) const
VectorialConverterBase(Cell const &cell)
Definition: nedelecspace.hh:48
void setLocalPosition(Dune::FieldVector< typename GridView::ctype, dim > const &x)
Definition: nedelecspace.hh:52
Dune::FieldMatrix< Scalar, dim, 1 > local(Dune::FieldMatrix< Scalar, dim, 1 > const &glob) const
Applies the inverse transform to global shape function values, giving the local shape function value...
Dune::FieldMatrix< typename GridView::ctype, dim, dim > Btinv
VariationalArg< Scalar, dim, dim > global(std::pair< Dune::FieldVector< Scalar, dim >, Dune::FieldMatrix< Scalar, dim, dim > > const &sf) const
Applies the transformation to shape function value and derivative.
Definition: nedelecspace.hh:69
Dune::FieldMatrix< typename GridView::ctype, dim, dim > C
FEFunctionSpace and FunctionSpaceElement and the like.
Dune::FieldVector< CoordType, dim+1 > barycentric(Dune::FieldVector< CoordType, dim > const &x)
Computes the barycentric coordinates of a point in the unit simplex.
Definition: barycentric.hh:32
Dune::FieldVector< T, n > max(Dune::FieldVector< T, n > x, Dune::FieldVector< T, n > const &y)
Componentwise maximum.
Definition: fixdune.hh:110
typename GetScalar< Type >::type ScalarType
Extracts the scalar field type from linear algebra data types.
T transpose(T x)
HdivShapeFunctionSetContainer< ctype, dimension, T >::value_type const & hdivShapeFunctionSet(Dune::GeometryType type, int order)
Returns a Hdiv shape function set for given reference element type and given polynomial order....
A class that stores values, gradients, and Hessians of evaluated shape functions.
ValueType value
The shape function's value, a vector of dimension components