DUNE PDELab (git)

Dune::MultiLinearGeometryTraits< ct >::CornerStorage< mydim, cdim > Struct Template Reference

template specifying the storage for the corners More...

#include <dune/geometry/multilineargeometry.hh>

Detailed Description

template<class ct>
template<int mydim, int cdim>
struct Dune::MultiLinearGeometryTraits< ct >::CornerStorage< mydim, cdim >

template specifying the storage for the corners

Internally, the MultiLinearGeometry needs to store the corners of the geometry.

The corner storage may be chosen depending on geometry dimension and coordinate dimension. It is required to contain a type named Type, e.g.,

template< int mydim, int cdim >
{
typedef std::vector< FieldVector< ctype, cdim > > Type;
};
template specifying the storage for the corners
Definition: multilineargeometry.hh:129

By default, a std::vector of FieldVector is used.

Apart from being copy constructable and assignable, an const corner storage object corners must support the expressions begin(corners), end(corners), and subscription corners[i]. begin() and end() are looked up via ADL and in namespace std:

using std::begin;
using std::end;
// it is a const_iterator over the corners in Dune-ordering
auto it = begin(corners);
auto itend = end(corners);
while(it != itend) {
//...
}
// elements must be accessible by subscription, indexed in
// Dune-ordering
FieldVector<ctype, cdim> c1 = corners[1];

This means that all of the following qualify: FieldVector<ctype,cdim>[1<<mydim], std::array<FieldVector<ctype,cdim>,(1<<mydim)>, std::vector<FieldVector<ctype,cdim>>.

Note
The expression end(corners) isn't actually used by the implementation currently, but we require it anyway so we can add runtime checks for the container size when we feel like it.

It is also possible to use a std::reference_wrapper of a suitable container as the type for the corner storage. The implementation automatically calls corners.get() on internally stored std::reference_wrapper objects before applying begin(), end(), or subscription in that case.

Note
Using std::reference_wrapper of some container as the corner storage means that the geometry has no control over the lifetime of or the access to that container. When the lifetime of the container ends, or the container itself or its elements are modified, any geometry object that still references that container becomes invalid. The only valid operation on invalid geometry objects are destruction and assignment from another geometry. If invalidation happens concurrently with some operation (other than destruction or assignment) on the geometry, that is a race.
Template Parameters
mydimgeometry dimension
cdimcoordinate dimension

The documentation for this struct was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)