|
typedef UGGridFamily< dim > | GridFamily |
| type of the used GridFamily for this grid
|
|
typedef UGGridFamily< dim >::Traits | Traits |
|
typedef UG::DOUBLE | ctype |
| The type used to store coordinates.
|
|
typedef unsigned int | Rank |
| The type used for process ranks.
|
|
|
enum | { dimension =dim
} |
| A constant that exports the template parameter dim. More...
|
|
enum | { dimensionworld =dimworld
} |
| A constant that exports the template parameter dimworld. More...
|
|
|
typedef GridFamily::Traits::LeafGridView | LeafGridView |
| type of view for leaf grid
|
|
typedef GridFamily::Traits::LevelGridView | LevelGridView |
| type of view for level grid
|
|
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.
|
|
|
| UGGrid () |
| Default constructor.
|
|
| ~UGGrid () noexcept(false) |
| Destructor.
|
|
int | maxLevel () const |
|
template<typename Seed > |
Traits::template Codim< Seed::codimension >::Entity | entity (const Seed &seed) const |
| Create an Entity from an EntitySeed.
|
|
int | size (int level, int codim) const |
| Number of grid entities per level and codim.
|
|
int | size (int codim) const |
| number of leaf entities per codim in this process
|
|
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::GlobalIdSet & | globalIdSet () const |
| Access to the GlobalIdSet.
|
|
const Traits::LocalIdSet & | localIdSet () const |
| Access to the LocalIdSet.
|
|
const Traits::LevelIndexSet & | levelIndexSet (int level) const |
| Access to the LevelIndexSets.
|
|
const Traits::LeafIndexSet & | leafIndexSet () const |
| Access to the LeafIndexSet.
|
|
Traits::LevelGridView | levelGridView (int level) const |
| View for a grid level for All_Partition.
|
|
Traits::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.
|
|
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
|
|
|
bool | mark (int refCount, const typename Codim< 0 >::Entity &e) |
| Marks an entity to be refined/coarsened in a subsequent adapt.
|
|
int | getMark (const typename Codim< 0 >::Entity &e) const |
| returns adaptation mark for given entity
|
|
|
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.
|
|
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.
|
|
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.
|
|
bool | loadBalance (int minlevel=0) |
| Distributes this grid over the available nodes in a distributed machine.
|
|
bool | loadBalance (const std::vector< Rank > &targetProcessors, unsigned int fromLevel) |
| Distribute this grid over a distributed machine.
|
|
template<class DataHandle > |
bool | loadBalance (const std::vector< Rank > &targetProcessors, unsigned int fromLevel, DataHandle &dataHandle) |
| Distributes the grid over the processes of a parallel machine, and sends data along with it.
|
|
template<class DataHandle > |
void | communicate (DataHandle &dataHandle, InterfaceType iftype, CommunicationDirection dir, int level) const |
| The communication interface for all codims on a given level.
|
|
template<class DataHandle > |
void | communicate (DataHandle &dataHandle, InterfaceType iftype, CommunicationDirection dir) const |
| The communication interface for all codims on the leaf level.
|
|
const CollectiveCommunication< UGGrid > & | comm () const |
|
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.
|
|
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 >::Entity &e, const FieldVector< double, dim > &pos) |
| Sets a vertex to a new position.
|
|
void | globalRefine (int n) |
| Does uniform refinement.
|
|
void | saveState (const std::string &filename) const |
| Save entire grid hierarchy to disk.
|
|
void | loadState (const std::string &filename) |
| Read entire grid hierarchy from disk.
|
|
static void | setDefaultHeapSize (unsigned size) |
| Sets the default heap size.
|
|
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.dune.nosp@m.-proj.nosp@m.ect..nosp@m.org
For installation instructions see http://www.dune-project.org/external_libraries/install_ug.html .
template<int dim>
bool Dune::UGGrid< dim >::loadBalance |
( |
const std::vector< Rank > & |
targetProcessors, |
|
|
unsigned int |
fromLevel |
|
) |
| |
Distribute this grid over a distributed machine.
- Parameters
-
[in] | targetProcessors | For each leaf element the rank of the process the element shall be sent to |
[in] | fromLevel | The 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