37 template <
class ScalarType,
class GV>
45 typedef typename GridView::Grid
Grid;
48 static int const dim = Grid::dimension;
49 static_assert(
dim==2,
"Morley elements implemented just for 2D problems.");
50 static int const dimw = Grid::template Codim<0>::Entity::Geometry::coorddimension;
67 typedef typename Grid::template Codim<0>::Entity
Cell;
77 , indexSet(gridView_.indexSet())
94 assert(cell.type().isSimplex());
95 return lagrangeShapeFunctionSet<typename Grid::ctype,dim,Scalar>(cell.type(),2);
100 return lagrangeShapeFunctionSet<typename Grid::ctype,dim,Scalar>(Dune::GeometryType(Dune::GeometryType::simplex,
dim),2);
136 static std::vector<IndexPair> dummy;
163 return indexSet.size(
dim-1) + indexSet.size(
dim);
194 ShapeFunctionSet const& sfs = lagrangeShapeFunctionSet<typename Grid::ctype,dim,Scalar>(cell.type(),2);
195 assert(sfs.
size() == 6);
197 auto const& refTriangle = Dune::ReferenceElements<typename Grid::ctype,dim>::simplex();
198 auto cellIndex = is.index(cell);
204 for (
auto edge=gv.ibegin(cell); edge!=gv.iend(cell); ++edge)
206 int const j = edge->indexInInside();
207 auto const xi = refTriangle.position(j,1);
212 auto normal = edge->centerUnitOuterNormal();
213 if (edge->neighbor() && is.index(edge->outside()) < cellIndex)
216 for (
int i=0; i<sfs.
size(); ++i)
229 for (
int j=0; j<3; ++j)
231 auto xi = refTriangle.position(j,2);
234 for (
int i=0; i<sfs.
size(); ++i)
240 K[j+3][i] = sfw.
value;
251 template <
class Matrix>
259 template <
int n,
int m>
262 assert(vs.size()==6);
263 std::vector<VariationalArg<Scalar,n,m>> phis(6);
265 for (
int i=0; i<6; ++i)
268 phis[i].derivative = 0;
272 for (
int j=0; j<6; ++j)
274 phis[i].value += K[j][i] * vs[j].value;
275 phis[i].derivative += K[j][i] * vs[j].derivative;
276 phis[i].hessian += K[j][i] * vs[j].hessian;
288 template <
class Matrix>
293 A.leftmultiply(Kinv);
297 operator Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,1,1>>()
const
299 std::cerr <<
"not implemented yet\n";
314 assert(indexSet.index(cell) ==index);
315 return Combiner(cell,gridView,indexSet);
327 globIdx.resize(indexSet.size(0));
328 sortedIdx.resize(globIdx.size());
330 size_t const ne = indexSet.size(1);
333 for (
auto const& cell: entities(gridView,Dune::Codim<0>()))
335 size_t const k = indexSet.index(cell);
336 std::vector<size_t>& gidx = globIdx[k];
339 sortedIdx[k].resize(gidx.size());
341 for (
int i=0; i<3; ++i)
343 gidx[i] = indexSet.subIndex(cell,i,1);
344 sortedIdx[k][i] = std::make_pair(gidx[i],i);
346 gidx[i+3] = indexSet.subIndex(cell,i,2) + ne;
347 sortedIdx[k][i+3] = std::make_pair(gidx[i+3],i+3);
350 std::sort(sortedIdx[k].begin(),sortedIdx[k].end());
360 std::vector<std::vector<std::size_t>> globIdx;
365 std::vector<std::vector<IndexPair>> sortedIdx;
A container of Lagrange shape functions of order Ord on the unit simplex of grid dimension....
A combiner class implementing a matrix mapping a subset of global degrees of freedom (those given by...
void rightTransform(Matrix &A) const
In-place computation of .
void leftPseudoInverse(Matrix &A) const
In-place computation of .
Combiner(Cell const &cell, GridView const &gv, IndexSet const &is)
void rightTransform(std::vector< VariationalArg< Scalar, n, m > > &vs) const
In-place computation of row vectors .
Degrees of freedom manager for Morley nonconforming elements.
RangeView< std::vector< size_t >::const_iterator > GlobalIndexRange
void update()
(Re)computes the internal data.
std::vector< IndexPair >::const_iterator SortedIndexIterator
size_t size() const
Returns the number of global degrees of freedom managed.
GlobalIndexRange globalIndices(Cell const &cell) const
MorleyMapper(GridView const &gridView_)
Constructs a MorleyMapper for a given grid view.
LagrangeSimplexShapeFunctionSet< typename Grid::ctype, dim, ScalarType > ShapeFunctionSetImplementation
Combiner combiner(Cell const &cell, size_t index) const
int maxOrder() const
Returns the maximal polynomial order of shape functions encountered in any cell.
GlobalIndexRange globalIndices(size_t n) const
Returns a const sequence containing the global indices of the shape functions associated to this cell...
static bool const globalSupport
Whether the ansatz functions have global support (i.e. lead to dense matrices).
ShapeFunctionSet const & shapefunctions(Cell const &cell) const
LagrangeShapeFunctionSetContainer< typenameGrid::ctype, dim, Scalar >::value_type ShapeFunctionSet
GridView::IndexSet IndexSet
SortedIndexRange sortedIndices(size_t n) const
Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index o...
ScalarConverter< Cell, Scalar > Converter
The converter type.
std::pair< size_t, int > IndexPair
SortedIndexRange sortedIndices(Cell const &cell) 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.
static int const continuity
Grid::template Codim< 0 >::Entity Cell
ShapeFunctionSet const & shapefunctions(size_t) const
RangeView< SortedIndexIterator > SortedIndexRange
GlobalIndexRange initGlobalIndexRange() const
Returns an empty range just for initialization purposes, since RangeView is not default constructible...
DEPRECATED. Use boost::iterator_range instead.
A Converter for scalar shape functions that do not change their value under transformation from refer...
Dune::FieldMatrix< Scalar, 1, 1 > global(Dune::FieldMatrix< Scalar, 1, 1 > const &sf) const
Applies the transformation to shape function value.
void setLocalPosition(Dune::FieldVector< typename Cell::Geometry::ctype, dim > const &xi)
A set of shape functions.
virtual int size() const
Number of shape functions in the set.
FEFunctionSpace and FunctionSpaceElement and the like.
define Lagrange type shape functions for simplicial elements of arbitrary dimension and order
typename GetScalar< Type >::type ScalarType
Extracts the scalar field type from linear algebra data types.
A class that stores values, gradients, and Hessians of evaluated shape functions.
Dune::FieldMatrix< Scalar, components, dim > derivative
The shape function's spatial derivative, a components x dim matrix.
ValueType value
The shape function's value, a vector of dimension components