dune-geometry 3.0-git
Modules | Namespaces | Classes
Refinement
Collaboration diagram for Refinement:

Modules

 Refinement implementation for hypercubes
 
 Refinement implementation for triangulating hypercubes
 
 Refinement implementation for simplices
 
 Virtual Refinement
 

Namespaces

namespace  Dune::RefinementImp
 This namespace contains the implementation of Refinement.
 

Classes

class  Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension_ >
 Wrap each Refinement implementation to get a consistent interface. More...
 

Detailed Description

General

The Refinement system allows to temporarily refine a grid or single entities without changing the grid itself. You may want to do this because you want to write your data to a file and have to do subsampling, but want to continue the calculation with the unmodified grid afterwards.

What Refinement can do for you

template<unsigned topologyId, class CoordType,
unsigned coerceToId, int dimension>
class StaticRefinement
{
public:
enum { dimension };
template<int codimension>
struct codim
{
class SubEntityIterator;
};
typedef ImplementationDefined VertexIterator; // These are aliases for codim<codim>::SubEntityIterator
typedef ImplementationDefined ElementIterator;
typedef ImplementationDefined IndexVector; // These are FieldVectors
typedef ImplementationDefined CoordVector;
static int nVertices(int level);
static VertexIterator vBegin(int level);
static VertexIterator vEnd(int level);
static int nElements(int level);
static ElementIterator eBegin(int level);
static ElementIterator eEnd(int level);
}
static VertexIterator vEnd(int level)
Get a VertexIterator.
static ElementIterator eEnd(int level)
Get an ElementIterator.
Codim< 0 >::SubEntityIterator ElementIterator
The ElementIterator of the Refinement.
Definition base.cc:126
static ElementIterator eBegin(int level)
Get an ElementIterator.
static VertexIterator vBegin(int level)
Get a VertexIterator.
Codim< dimension >::SubEntityIterator VertexIterator
The VertexIterator of the Refinement.
Definition base.cc:124
typedef CoordVector
The CoordVector of the Refinement.
Definition base.cc:133
static int nVertices(int level)
Get the number of Vertices.
typedef IndexVector
The IndexVector of the Refinement.
Definition base.cc:140
static int nElements(int level)
Get the number of Elements.

The Iterators can do all the usual things that Iterators can do, except dereferencing. In addition, to do something useful, they support some additional methods:

template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
class VertexIterator
{
public:
typedef ImplementationDefined Refinement;
int index() const;
Refinement::CoordVector coords() const;
}
template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
class ElementIterator
{
public:
typedef ImplementationDefined Refinement;
int index() const;
// Coords of the center of mass of the element
Refinement::CoordVector coords() const;
Refinement::IndexVector vertexIndices() const;
}

How to use it

If you want to write a Refinement implementation for a particular geometry type, e.g. SquaringTheCircle (or a particular set of geometry types) here is how:

This is enough to integrate your implementation into the Refinement system. You probably want to include it into VirtualRefinement also.

Namespaces