Loading...
Searching...
No Matches
Dune::MultiLinearGeometryTraits< ct >::CornerStorage< mydim, cdim > Struct Template Reference

template specifying the storage for the corners More...

`#include <dune/geometry/multilineargeometry.hh>`

## Public Types

typedef std::vector< FieldVector< ct, cdim > > | Type

## 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 >
struct CornerStorage
{
typedef std::vector< FieldVector< ctype, cdim > > Type;
};
Dune::MultiLinearGeometryTraits::CornerStorage
template specifying the storage for the corners
Definition multilineargeometry.hh:129
Dune::MultiLinearGeometryTraits::CornerStorage::Type
std::vector< FieldVector< ct, cdim > > Type
Definition multilineargeometry.hh:130

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);
FieldVector<ctype, cdim> c0 = *it;
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

  mydim | geometry dimension
  cdim | coordinate dimension

## Member Typedef Documentation

## Type

template<class ct>
template<int mydim, int cdim>

typedef std::vector< FieldVector< ct, cdim > > Dune::MultiLinearGeometryTraits< ct >::CornerStorage< mydim, cdim >::Type

The documentation for this struct was generated from the following file:

- multilineargeometry.hh