Loading...
Searching...
No Matches
virtualrefinement.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
#define DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
#include <vector>
#include <dune/common/fvector.hh>
#include "refinement.hh"
#include "type.hh"
namespace Dune
{
// //////////////////////////////////////////
//
// The virtual base class and its iterators
//
//
// Refinement
//
template<int dimension, class CoordType>
class VirtualRefinement
{
public:
template<int codimension>
struct Codim;
typedef typename Codim<dimension>::SubEntityIterator VertexIterator;
typedef typename Codim<0>::SubEntityIterator ElementIterator;
typedef FieldVector<CoordType, dimension> CoordVector;
typedef std::vector<int> IndexVector;
template<int codimension>
class SubEntityIteratorBack;
typedef SubEntityIteratorBack<dimension> VertexIteratorBack;
typedef SubEntityIteratorBack<0> ElementIteratorBack;
virtual int nVertices(Dune::RefinementIntervals tag) const = 0;
VertexIterator vBegin(Dune::RefinementIntervals tag) const;
VertexIterator vEnd(Dune::RefinementIntervals tag) const;
virtual int nElements(Dune::RefinementIntervals tag) const = 0;
ElementIterator eBegin(Dune::RefinementIntervals tag) const;
ElementIterator eEnd(Dune::RefinementIntervals tag) const;
virtual ~VirtualRefinement()
{}
protected:
virtual VertexIteratorBack *vBeginBack(Dune::RefinementIntervals tag) const = 0;
virtual VertexIteratorBack *vEndBack(Dune::RefinementIntervals tag) const = 0;
virtual ElementIteratorBack *eBeginBack(Dune::RefinementIntervals tag) const = 0;
virtual ElementIteratorBack *eEndBack(Dune::RefinementIntervals tag) const = 0;
};
template<int dimension, class CoordType>
template<int codimension>
struct VirtualRefinement<dimension, CoordType>::Codim
{
class SubEntityIterator;
};
// ////////////////////////
//
// The refinement builder
//
template<int dimension, class CoordType>
VirtualRefinement<dimension, CoordType> &
buildRefinement(GeometryType geometryType, GeometryType coerceTo);
} // namespace Dune
#include "virtualrefinement.cc"
#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
virtualrefinement.cc
This file contains the virtual wrapper around refinement.
refinement.hh
This file simply includes all Refinement implementations so you don't have to do them separately.
type.hh
A unique label for each type of element that can occur in a grid.
Dune
Definition affinegeometry.hh:22
Dune::buildRefinement
VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType geometryType, GeometryType coerceTo)
return a reference to the VirtualRefinement according to the parameters
Definition virtualrefinement.cc:504
Dune::RefinementIntervals
Holds the number of refined intervals per axis needed for virtual and static refinement.
Definition base.cc:94
Dune::GeometryType
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:114
Dune::VirtualRefinement::SubEntityIteratorBack
Definition virtualrefinement.cc:232
Dune::VirtualRefinement
VirtualRefinement base class.
Definition virtualrefinement.hh:283
Dune::VirtualRefinement::VertexIteratorBack
SubEntityIteratorBack< dimension > VertexIteratorBack
Definition virtualrefinement.hh:307
Dune::VirtualRefinement::eEndBack
virtual ElementIteratorBack * eEndBack(Dune::RefinementIntervals tag) const =0
Dune::VirtualRefinement::vBegin
VertexIterator vBegin(Dune::RefinementIntervals tag) const
Get an VertexIterator.
Definition virtualrefinement.cc:38
Dune::VirtualRefinement::eBegin
ElementIterator eBegin(Dune::RefinementIntervals tag) const
Get an ElementIterator.
Definition virtualrefinement.cc:54
Dune::VirtualRefinement::nElements
virtual int nElements(Dune::RefinementIntervals tag) const =0
Get the number of Elements.
Dune::VirtualRefinement::eEnd
ElementIterator eEnd(Dune::RefinementIntervals tag) const
Get an ElementIterator.
Definition virtualrefinement.cc:62
Dune::VirtualRefinement::ElementIterator
Codim< 0 >::SubEntityIterator ElementIterator
The ElementIterator of the VirtualRefinement.
Definition virtualrefinement.hh:290
Dune::VirtualRefinement::~VirtualRefinement
virtual ~VirtualRefinement()
Destructor.
Definition virtualrefinement.hh:353
Dune::VirtualRefinement::vEnd
VertexIterator vEnd(Dune::RefinementIntervals tag) const
Get an VertexIterator.
Definition virtualrefinement.cc:46
Dune::VirtualRefinement::CoordVector
FieldVector< CoordType, dimension > CoordVector
The CoordVector of the VirtualRefinement.
Definition virtualrefinement.hh:297
Dune::VirtualRefinement::nVertices
virtual int nVertices(Dune::RefinementIntervals tag) const =0
Get the number of Vertices.
Dune::VirtualRefinement::IndexVector
std::vector< int > IndexVector
The IndexVector of the VirtualRefinement.
Definition virtualrefinement.hh:303
Dune::VirtualRefinement::VertexIterator
Codim< dimension >::SubEntityIterator VertexIterator
The VertexIterator of the VirtualRefinement.
Definition virtualrefinement.hh:288
Dune::VirtualRefinement::vEndBack
virtual VertexIteratorBack * vEndBack(Dune::RefinementIntervals tag) const =0
Dune::VirtualRefinement::ElementIteratorBack
SubEntityIteratorBack< 0 > ElementIteratorBack
Definition virtualrefinement.hh:308
Dune::VirtualRefinement::eBeginBack
virtual ElementIteratorBack * eBeginBack(Dune::RefinementIntervals tag) const =0
Dune::VirtualRefinement::vBeginBack
virtual VertexIteratorBack * vBeginBack(Dune::RefinementIntervals tag) const =0
Dune::VirtualRefinement::Codim
codim database of VirtualRefinement
Definition virtualrefinement.hh:367