Dune Core Modules (2.4.2)

Front-end for the grid manager of the finite element toolbox UG. More...

#include <dune/grid/uggrid.hh>

Public Types

typedef UGGridFamily< dim > GridFamily
 type of the used GridFamily for this grid
 
typedef UG::DOUBLE ctype
 The type used to store coordinates.
 
Exported constants
enum  
 A constant that exports the template parameter dim.
 
enum  
 A constant that exports the template parameter dimworld.
 
Exported types
typedef Partition< All_Partition >::LevelGridView LevelGridView
 View types for All_Partition.
 
typedef Partition< All_Partition >::LeafGridView LeafGridView
 
typedef GridFamily::Traits::LeafIntersection LeafIntersection
 A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in the leaf view.
 
typedef GridFamily::Traits::LevelIntersection LevelIntersection
 A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in a level view.
 
typedef GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator
 A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an leaf element (entity of codimension 0) with other leaf elements.
 
typedef GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator
 A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an element (entity of codimension 0) with other elements on the same level.
 
typedef GridFamily::Traits::HierarchicIterator HierarchicIterator
 A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine, but not to modify, entities of codimension 0 that result from refinement of an entity of codimension 0.
 
typedef GridFamily::Traits::LevelIndexSet LevelIndexSet
 A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities on a grid level.
 
typedef GridFamily::Traits::LeafIndexSet LeafIndexSet
 A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities in the leaf grid.
 
typedef GridFamily::Traits::GlobalIdSet GlobalIdSet
 A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entities in the grid. The numbering is unique over all processes over which the grid is partitioned. The numbering is not necessarily consecutive.
 
typedef GridFamily::Traits::LocalIdSet LocalIdSet
 A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entities in the grid. The numbering is only unique in a single process and it is not necessarily consecutive.
 
typedef GridFamily::Traits::CollectiveCommunication CollectiveCommunication
 A type that is a model of Dune::CollectiveCommunication. It provides a portable way for collective communication on the set of processes used by the grid.
 

Public Member Functions

 UGGrid ()
 Default constructor. More...
 
 ~UGGrid ()
 Destructor.
 
int maxLevel () const
 
template<int codim>
Traits::template Codim< codim >::LevelIterator lbegin (int level) const
 Iterator to first entity of given codim on level.
 
template<int codim>
Traits::template Codim< codim >::LevelIterator lend (int level) const
 one past the end on this level
 
template<int codim, PartitionIteratorType PiType>
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator lbegin (int level) const
 Iterator to first entity of given codim on level.
 
template<int codim, PartitionIteratorType PiType>
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator lend (int level) const
 one past the end on this level
 
template<int codim>
Traits::template Codim< codim >::LeafIterator leafbegin () const
 Iterator to first leaf entity of given codim.
 
template<int codim>
Traits::template Codim< codim >::LeafIterator leafend () const
 one past the end of the sequence of leaf entities
 
template<int codim, PartitionIteratorType PiType>
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafbegin () const
 Iterator to first leaf entity of given codim.
 
template<int codim, PartitionIteratorType PiType>
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafend () const
 one past the end of the sequence of leaf entities
 
template<typename Seed >
DUNE_DEPRECATED_MSG("entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object.") typename Traits int size (int codim) const
 Create an EntityPointer from an EntitySeed. More...
 
int size (int level, GeometryType type) const
 number of entities per level and geometry type in this process
 
int size (GeometryType type) const
 number of leaf entities per geometry type in this process
 
size_t numBoundarySegments () const
 Return the number of boundary segments.
 
const Traits::GlobalIdSetglobalIdSet () const
 Access to the GlobalIdSet.
 
const Traits::LocalIdSetlocalIdSet () const
 Access to the LocalIdSet.
 
const Traits::LevelIndexSetlevelIndexSet (int level) const
 Access to the LevelIndexSets.
 
const Traits::LeafIndexSetleafIndexSet () const
 Access to the LeafIndexSet.
 
Traits::template Codim< codim >::LevelIterator DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin.") lbegin(int level) const
 Iterator to first entity of given codim on level for PartitionType All_Partition.
 
Traits::template Codim< codim >::LevelIterator DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end.") lend(int level) const
 one past the end on this level for PartitionType All_Partition
 
Traits::template Codim< codim >::template Partition< pitype >::LevelIterator DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin.") lbegin(int level) const
 Iterator to first entity of given codim on level.
 
Traits::template Codim< codim >::template Partition< pitype >::LevelIterator DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end.") lend(int level) const
 one past the end on this level
 
Traits::template Codim< codim >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin.") leafbegin() const
 Iterator to first entity of given codim on leaf grid for PartitionType All_Partition.
 
Traits::template Codim< codim >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end.") leafend() const
 one past the end on the leaf grid for PartitionType All_Partition
 
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin.") leafbegin() const
 Iterator to first entity of given codim on leaf grid.
 
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end.") leafend() const
 one past the end on the leaf level grid
 
Traits::template Partition< pitype >::LevelGridView levelGridView (int level) const
 View for a grid level.
 
Traits::template Partition< All_Partition >::LevelGridView levelGridView (int level) const
 View for a grid level for All_Partition.
 
Traits::template Partition< pitype >::LeafGridView leafGridView () const
 View for the leaf grid.
 
Traits::template Partition< All_Partition >::LeafGridView leafGridView () const
 View for the leaf grid for All_Partition.
 
bool mark (int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt. More...
 
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
 
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
 
bool loadBalance ()
 default implementation of load balance does nothing and returns false
 
Iterators
Codim< cd >::template Partition< pitype >::LevelIterator DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin and will be removed after Dune 2.4.") lbegin(int level) const
 Iterator to first entity of given codim on level.
 
Codim< cd >::template Partition< pitype >::LevelIterator DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end and will be removed after Dune 2.4.") lend(int level) const
 one past the end on this level
 
Codim< cd >::template Partition< pitype >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin and will be removed after Dune 2.4.") leafbegin() const
 Iterator to first entity of given codim on leaf grid.
 
Codim< cd >::template Partition< pitype >::LeafIterator DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end and will be removed after Dune 2.4.") leafend() const
 one past the end on the leaf level grid
 
Parallel data distribution and communication
 DUNE_DEPRECATED_MSG ("entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object.") typename Codim< EntitySeed
 obtain EntityPointer from EntitySeed. More...
 
const GridImp & asImp () const
 Barton-Nackman trick.
 
Adaptivity and grid refinement
bool mark (int refCount, const typename Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt. More...
 
int getMark (const typename Codim< 0 >::Entity &e) const
 returns adaptation mark for given entity More...
 
Size methods
int size (int level, int codim) const
 Return number of grid entities of a given codim on a given level in this process.
 

Static Protected Member Functions

static std::conditional< std::is_reference< InterfaceType >::value, typename std::add_lvalue_reference< typename ReturnImplementationType< typename std::remove_reference< InterfaceType >::type >::ImplementationType >::type, typename std::remove_const< typename ReturnImplementationType< typename std::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type getRealImplementation (InterfaceType &&i)
 return real implementation of interface class
 

Grid Refinement Methods

enum  RefinementType { LOCAL , COPY }
 The different forms of grid refinement that UG supports. More...
 
enum  ClosureType { GREEN , NONE }
 Decide whether to add a green closure to locally refined grid sections or not. More...
 
bool mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e)
 Mark element for refinement. More...
 
bool mark (const typename Traits::template Codim< 0 >::Entity &e, typename UG_NS< dim >::RefinementRule rule, int side=0)
 Mark method accepting a UG refinement rule. More...
 
int getMark (const typename Traits::template Codim< 0 >::Entity &e) const
 Query whether element is marked for refinement.
 
bool preAdapt ()
 returns true, if some elements might be coarsend during grid adaption, here always returns true
 
bool adapt ()
 Triggers the grid refinement process.
 
void postAdapt ()
 Clean up refinement markers.
 
unsigned int overlapSize (int codim) const
 Size of the overlap on the leaf level.
 
unsigned int ghostSize (int codim) const
 Size of the ghost cell layer on the leaf level.
 
unsigned int overlapSize (int level, int codim) const
 Size of the overlap on a given level.
 
unsigned int ghostSize (int level, int codim) const
 Size of the ghost cell layer on a given level.
 
template<class DataHandle >
bool loadBalance (DataHandle &dataHandle)
 Distributes the grid and some data over the available nodes in a distributed machine. More...
 
bool loadBalance (int minlevel=0)
 Distributes this grid over the available nodes in a distributed machine. More...
 
bool loadBalance (const std::vector< unsigned int > &targetProcessors, unsigned int fromLevel)
 Distribute this grid over a distributed machine. More...
 
template<class DataHandle >
bool loadBalance (const std::vector< unsigned int > &targetProcessors, unsigned int fromLevel, DataHandle &dataHandle)
 Distributes the grid over the processes of a parallel machine, and sends data along with it. More...
 
template<class DataHandle >
void communicate (DataHandle &dataHandle, InterfaceType iftype, CommunicationDirection dir, int level) const
 The communication interface for all codims on a given level. More...
 
template<class DataHandle >
void communicate (DataHandle &dataHandle, InterfaceType iftype, CommunicationDirection dir) const
 The communication interface for all codims on the leaf level. More...
 
const CollectiveCommunication< UGGrid > & comm () const
 
void getChildrenOfSubface (const typename Traits::template Codim< 0 >::EntityPointer &e, int elementSide, int maxl, std::vector< typename Traits::template Codim< 0 >::EntityPointer > &childElements, std::vector< unsigned char > &childElementSides) const
 Rudimentary substitute for a hierarchic iterator on faces. More...
 
void getChildrenOfSubface (const typename Traits::template Codim< 0 >::Entity &e, int elementSide, int maxl, std::vector< typename Traits::template Codim< 0 >::Entity > &childElements, std::vector< unsigned char > &childElementSides) const
 Rudimentary substitute for a hierarchic iterator on faces. More...
 
void setRefinementType (RefinementType type)
 Sets the type of grid refinement.
 
void setClosureType (ClosureType type)
 Sets the type of grid refinement closure.
 
void setPosition (const typename Traits::template Codim< dim >::EntityPointer &e, const FieldVector< double, dim > &pos)
 Sets a vertex to a new position. More...
 
void setPosition (const typename Traits::template Codim< dim >::Entity &e, const FieldVector< double, dim > &pos)
 Sets a vertex to a new position. More...
 
void globalRefine (int n)
 Does uniform refinement. More...
 
void saveState (const std::string &filename) const
 Save entire grid hierarchy to disk. More...
 
void loadState (const std::string &filename)
 Read entire grid hierarchy from disk. More...
 
static void setDefaultHeapSize (unsigned size)
 Sets the default heap size. More...
 

Detailed Description

template<int dim>
class Dune::UGGrid< dim >

Front-end for the grid manager of the finite element toolbox UG.

This is the implementation of the grid interface using the UG grid management system (http://www.iwr.uni-heidelberg.de/frame/iwrwikiequipment/software/ug). UG provides conforming grids in two and three space dimensions. The grids can be mixed, i.e. 2d grids can contain triangles and quadrilaterals and 3d grids can contain tetrahedra and hexahedra and also pyramids and prisms. The grid refinement rules are very flexible. Local adaptive red/green refinement is the default, but a special method in the UGGrid class allows you to directly access a number of anisotropic refinements rules. Last but not least, the UG grid manager is completely parallelized, and you can use boundaries parametrized by either analytical expressions or high-resolution piecewise linear surfaces.

To use this module you need the UG library. See the DUNE installation notes on how to obtain and install it.

In your Dune application, you can now instantiate objects of the type UGGrid<2> or UGGrid<3>. You can have more than one, if you choose. It is even possible to have 2d and 3d grids at the same time, even though the original UG system never intended to support this!

See the documentation for the factory class GridFactory<UGGrid<dimworld> > to learn how to create UGGrid objects.

Please send any questions, suggestions, or bug reports to the Dune mailing list dune@.nosp@m.list.nosp@m.s.dun.nosp@m.e-pr.nosp@m.oject.nosp@m..org

For installation instructions see http://www.dune-project.org/external_libraries/install_ug.html .

Member Enumeration Documentation

◆ ClosureType

template<int dim>
enum Dune::UGGrid::ClosureType

Decide whether to add a green closure to locally refined grid sections or not.

Enumerator
GREEN 

Standard red/green refinement.

NONE 

No closure, results in nonconforming meshes.

◆ RefinementType

template<int dim>
enum Dune::UGGrid::RefinementType

The different forms of grid refinement that UG supports.

Enumerator
LOCAL 

New level consists only of the refined elements and the closure.

COPY 

New level consists of the refined elements and the unrefined ones, too.

Constructor & Destructor Documentation

◆ UGGrid()

template<int dim>
Dune::UGGrid< dim >::UGGrid ( )

Default constructor.

Uses the default heapsize, which can be set using the static method setDefaultHeapSize().

Member Function Documentation

◆ comm()

template<int dim>
const CollectiveCommunication<UGGrid>& Dune::UGGrid< dim >::comm ( ) const
inline

the collective communication

◆ communicate() [1/4]

void Dune::GridDefaultImplementation< dim, dimworld, double , UGGridFamily< dim > >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir 
) const
inlineinherited

dummy communicate, doing nothing

◆ communicate() [2/4]

void Dune::GridDefaultImplementation< dim, dimworld, double , UGGridFamily< dim > >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const
inlineinherited

dummy communicate, doing nothing

◆ communicate() [3/4]

template<int dim>
template<class DataHandle >
void Dune::UGGrid< dim >::communicate ( DataHandle &  dataHandle,
InterfaceType  iftype,
CommunicationDirection  dir 
) const
inline

The communication interface for all codims on the leaf level.

Parameters
dataHandletype used to gather/scatter data in and out of the message buffer
iftypeone of the predefined interface types, throws error if it is not implemented
dirchoose between forward and backward communication

Implements a generic communication function sending an object of type P for each entity in the intersection of two processors. P has two methods gather and scatter that implement the protocol. Therefore P is called the "protocol class".

References Dune::className(), DUNE_THROW, and Dune::GridDefaultImplementation< dim, dim, double, UGGridFamily< dim > >::leafGridView().

◆ communicate() [4/4]

template<int dim>
template<class DataHandle >
void Dune::UGGrid< dim >::communicate ( DataHandle &  dataHandle,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const
inline

The communication interface for all codims on a given level.

Parameters
dataHandletype used to gather/scatter data in and out of the message buffer
iftypeone of the predefined interface types, throws error if it is not implemented
dirchoose between forward and backward communication
levelcommunicate for entities on the given level

Implements a generic communication function sending an object of type P for each entity in the intersection of two processors. P has two methods gather and scatter that implement the protocol. Therefore P is called the "protocol class".

References Dune::className(), DUNE_THROW, and Dune::GridDefaultImplementation< dim, dim, double, UGGridFamily< dim > >::levelGridView().

◆ DUNE_DEPRECATED_MSG()

Dune::Grid< dim, dimworld, double , UGGridFamily< dim > >::DUNE_DEPRECATED_MSG ( "entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object."  )
inlineinherited

obtain EntityPointer from EntitySeed.

Deprecated:
This method is deprecated and will be removed after the release of dune-grid 2.4. Please use entity() instead, which will directly return an Entity object that you can then store for later use. The EntityPointer concept in general is deprecated and will not be available after dune-grid 2.4 has been released.

obtain Entity from EntitySeed.

◆ getChildrenOfSubface() [1/2]

template<int dim>
void Dune::UGGrid< dim >::getChildrenOfSubface ( const typename Traits::template Codim< 0 >::Entity e,
int  elementSide,
int  maxl,
std::vector< typename Traits::template Codim< 0 >::Entity > &  childElements,
std::vector< unsigned char > &  childElementSides 
) const

Rudimentary substitute for a hierarchic iterator on faces.

Parameters
e,elementSideGrid face specified by an element and one of its sides
maxlThe finest level that should be traversed by the iterator
[out]childElementsFor each subface: element index, elementSide, and level
[out]childElementSidesIndices for transformation because Dune numbers the faces of several elements differently than UG

◆ getChildrenOfSubface() [2/2]

template<int dim>
void Dune::UGGrid< dim >::getChildrenOfSubface ( const typename Traits::template Codim< 0 >::EntityPointer e,
int  elementSide,
int  maxl,
std::vector< typename Traits::template Codim< 0 >::EntityPointer > &  childElements,
std::vector< unsigned char > &  childElementSides 
) const

Rudimentary substitute for a hierarchic iterator on faces.

Parameters
e,elementSideGrid face specified by an element and one of its sides
maxlThe finest level that should be traversed by the iterator
[out]childElementsFor each subface: element index, elementSide, and level
[out]childElementSidesIndices for transformation because Dune numbers the faces of several elements differently than UG
Deprecated:
This method is deprecated and will be removed after the release of Dune 2.4. Please use the corresponding method that uses entities instead of EntityPointers.

◆ getMark()

int Dune::Grid< dim, dimworld, double , UGGridFamily< dim > >::getMark ( const typename Codim< 0 >::Entity e) const
inlineinherited

returns adaptation mark for given entity

Parameters
[in]eEntity for which adaptation mark should be determined
Returns
int adaptation mark currently set for given Entity e

◆ globalRefine()

template<int dim>
void Dune::UGGrid< dim >::globalRefine ( int  n)

Does uniform refinement.

Parameters
nNumber of uniform refinement steps

◆ loadBalance() [1/4]

template<int dim>
bool Dune::UGGrid< dim >::loadBalance ( const std::vector< unsigned int > &  targetProcessors,
unsigned int  fromLevel 
)

Distribute this grid over a distributed machine.

Parameters
[in]targetProcessorsFor each leaf element the rank of the process the element shall be sent to
[in]fromLevelThe lowest level that gets redistributed (set to 0 when in doubt)

This method allows to (re-)distribute the grid controlled by an external grid repartitioning library. You need to get that library to assign a target rank to each interior element in the leaf grid. With this information in a std::vector, call this method, and UG will do the actual repartitioning. Each leaf element will be sent to the assigned target rank. For all other elements we look at where there children are being sent to. The parent is then sent to where most of its children are (Familienzusammenfuehrung).

The size of the input array targetProcessors is expected to be equal to the number of elements in the 'all'-partition, i.e., the number Interior elements plus the number of Ghost elements. To get the array entry corresponding to an Interior element, a MultipleCodimMultipleGeomTypeMapper with layout class MCMGElementLayout is used. Array entries corresponding to Ghost elements are ignored.

In some cases you may also want to leave the lowest levels on one process, to have them all together for multigrid coarse grid corrections. In that case, use the fromLevel parameter with a value other than zero, to redistribute only elements above a certain level.

The fromLevel argument is also needed to allow the compiler to distinguish this method from the loadBalance method with a single template DataHandle argument.

Note
In theory you can assign a target rank to any element on any level, and UG will magically transfer the element to that rank and make everything come out right. This is not supported by the UGGrid interface, because I didn't see a use case for it. If you do need it please ask on the Dune mailing list.
Returns
true

◆ loadBalance() [2/4]

template<int dim>
template<class DataHandle >
bool Dune::UGGrid< dim >::loadBalance ( const std::vector< unsigned int > &  targetProcessors,
unsigned int  fromLevel,
DataHandle &  dataHandle 
)
inline

Distributes the grid over the processes of a parallel machine, and sends data along with it.

Parameters
[in]targetProcessorsFor each leaf element the rank of the process the element shall be sent to
[in]fromLevelThe lowest level that gets redistributed (set to 0 when in doubt)
[in,out]dataHandleA data handle object that does the gathering and scattering of data
Template Parameters
DataHandleworks like the data handle for the communicate methods.
Returns
true

References Dune::GridDefaultImplementation< dim, dim, double, UGGridFamily< dim > >::leafGridView(), and Dune::GridDefaultImplementation< dim, dim, double, UGGridFamily< dim > >::loadBalance().

◆ loadBalance() [3/4]

template<int dim>
template<class DataHandle >
bool Dune::UGGrid< dim >::loadBalance ( DataHandle &  dataHandle)
inline

Distributes the grid and some data over the available nodes in a distributed machine.

Template Parameters
DataHandleworks like the data handle for the communicate methods.
Returns
True, if grid has changed, false otherwise

References Dune::GridDefaultImplementation< dim, dim, double, UGGridFamily< dim > >::leafGridView(), and Dune::GridDefaultImplementation< dim, dim, double, UGGridFamily< dim > >::loadBalance().

◆ loadBalance() [4/4]

template<int dim>
bool Dune::UGGrid< dim >::loadBalance ( int  minlevel = 0)

Distributes this grid over the available nodes in a distributed machine.

Bug:
The return value is always 'true'
Parameters
minlevelThe coarsest grid level that gets distributed

◆ loadState()

template<int dim>
void Dune::UGGrid< dim >::loadState ( const std::string &  filename)

Read entire grid hierarchy from disk.

Test implementation – not working!

◆ mark() [1/4]

template<int dim>
bool Dune::UGGrid< dim >::mark ( const typename Traits::template Codim< 0 >::Entity e,
typename UG_NS< dim >::RefinementRule  rule,
int  side = 0 
)

Mark method accepting a UG refinement rule.

Parameters
ePointer to the element to be marked for refinement
ruleOne of the UG refinement rules
sideIf rule==UG::D2::BLUE (one quadrilateral is split into two rectangles) you can choose the orientation of the cut by setting side==0 or side==1

The available values for RefinementRule are: (see the RefinementRule enum in ug/gm/gm.h)

2D

  • NO_REFINEMENT
  • COPY
  • RED
  • BLUE
  • COARSE
  • BISECTION_1
  • BISECTION_2_Q
  • BISECTION_2_T1
  • BISECTION_2_T2
  • BISECTION_3

3D

  • NO_REFINEMENT
  • COPY
  • RED
  • BLUE
  • COARSE
  • TETRA_RED_HEX
  • PRISM_BISECT_1_2
  • PRISM_QUADSECT
  • PRISM_BISECT_HEX0
  • PRISM_BISECT_HEX1
  • PRISM_BISECT_HEX2
  • PRISM_ROTATE_LEFT
  • PRISM_ROTATE_RGHT
  • PRISM_QUADSECT_HEXPRI0
  • PRISM_RED_HEX
  • PRISM_BISECT_0_1
  • PRISM_BISECT_0_2
  • PRISM_BISECT_0_3
  • HEX_BISECT_0_1
  • HEX_BISECT_0_2
  • HEX_BISECT_0_3
  • HEX_TRISECT_0
  • HEX_TRISECT_5
  • HEX_QUADSECT_0
  • HEX_QUADSECT_1
  • HEX_QUADSECT_2
  • HEX_BISECT_HEXPRI0
  • HEX_BISECT_HEXPRI1

◆ mark() [2/4]

bool Dune::Grid< dim, dimworld, double , UGGridFamily< dim > >::mark ( int  refCount,
const typename Codim< 0 >::Entity e 
)
inlineinherited

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity that should be marked
Returns
true if Entity was marked, false otherwise.

◆ mark() [3/4]

bool Dune::GridDefaultImplementation< dim, dimworld, double , UGGridFamily< dim > >::mark ( int  refCount,
const typename Traits ::template Codim< 0 >::Entity e 
)
inlineinherited

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity to Entity that should be refined
Returns
true if Entity was marked, false otherwise.
Note
  • default implementation is: return false; for grids with no adaptation.
  • for the grid programmer: this method is implemented as a template method, because the Entity type is not defined when the class is instantiated You won't need this trick in the implementation. In your implementation you should use it as
    bool mark( int refCount,
    typename Traits::template Codim<0>::Entity & e ).
    bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)
    Mark element for refinement.
    This template method will vanish due to the inheritance rules.

◆ mark() [4/4]

template<int dim>
bool Dune::UGGrid< dim >::mark ( int  refCount,
const typename Traits::template Codim< 0 >::Entity e 
)

Mark element for refinement.

Parameters
refCount
  • 1: mark for red refinement
  • -1: mark for coarsening
  • 0: delete a possible refinement mark
eElement to be marked
Returns
  • true, if element was marked
  • false, if nothing changed

◆ maxLevel()

template<int dim>
int Dune::UGGrid< dim >::maxLevel ( ) const

Return maximum level defined in this grid. Levels are numbered 0 ... maxlevel with 0 the coarsest level.

Referenced by Dune::UGGrid< dim >::levelIndexSet().

◆ saveState()

template<int dim>
void Dune::UGGrid< dim >::saveState ( const std::string &  filename) const

Save entire grid hierarchy to disk.

Test implementation – not working!

◆ setDefaultHeapSize()

template<int dim>
static void Dune::UGGrid< dim >::setDefaultHeapSize ( unsigned  size)
inlinestatic

Sets the default heap size.

UGGrid keeps an internal heap to allocate memory from, which must be specified on grid creation (at the latest). This sets the default heap size, which is used when no heap size is given to the constructor.

References Dune::UGGrid< dim >::size().

◆ setPosition() [1/2]

template<int dim>
void Dune::UGGrid< dim >::setPosition ( const typename Traits::template Codim< dim >::Entity e,
const FieldVector< double, dim > &  pos 
)

Sets a vertex to a new position.

Changing a vertex' position changes its position on all grid levels!

◆ setPosition() [2/2]

template<int dim>
void Dune::UGGrid< dim >::setPosition ( const typename Traits::template Codim< dim >::EntityPointer e,
const FieldVector< double, dim > &  pos 
)

Sets a vertex to a new position.

Changing a vertex' position changes its position on all grid levels!

Deprecated:
This method is deprecated and will be removed after the release of Dune 2.4. Please use the corresponding method that uses entities instead of EntityPointers.

◆ size()

template<int dim>
template<typename Seed >
DUNE_DEPRECATED_MSG ("entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object.") typename Traits int Dune::UGGrid< dim >::size ( int  codim) const
inline

Create an EntityPointer from an EntitySeed.

Create an Entity from an EntitySeed

Number of grid entities per level and codim number of leaf entities per codim in this process

References Dune::UGGrid< dim >::leafIndexSet().

Referenced by Dune::UGGrid< dim >::setDefaultHeapSize().


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 18, 22:30, 2024)