Loading...
Searching...
No Matches
Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld > Class Template Referenceabstract

Common base class for many merger implementations: produce pairs of entities that may intersect. More...

`#include <dune/grid-glue/merging/standardmerge.hh>`

Inheritance diagram for Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >:

## Public Types

typedef T | ctype
| the numeric type used in this interface
using | Grid1Coords = typename Base::Grid1Coords
| Type used for local coordinates on the grid1 side.
using | Grid2Coords = typename Base::Grid2Coords
| Type used for local coordinates on the grid2 side.
using | WorldCoords = typename Base::WorldCoords
| the coordinate type used in this interface
using | IntersectionList = typename Base::IntersectionList

## Public Member Functions

void | build (const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, const std::vector< unsigned int > &grid1_elements, const std::vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, const std::vector< Dune::GeometryType > &grid2_element_types) override
| builds the merged grid
void | clear () override
std::shared_ptr< IntersectionList > | intersectionList () const final
void | enableFallback (bool fallback)
void | enableBruteForce (bool bruteForce)
unsigned int | nSimplices () const
| get the number of simplices in the merged grid The indices are then in 0..nSimplices()-1
unsigned int | parents (unsigned int idx) const
unsigned int | parent (unsigned int idx, unsigned int parId=0) const
| get index of grid-n's parent simplex for given merged grid simplex
auto | parentLocal (unsigned int idx, unsigned int corner, unsigned int parId=0) const
| get the grid-n parent's simplex local coordinates for a particular merged grid simplex corner (parent's index can be obtained via "parent<n>")

## Public Attributes

unsigned int | counter
| Counts the number of times the computeIntersection method has been called.

## Protected Types

using | IntersectionListProvider = SimplicialIntersectionListProvider<grid1Dim, grid2Dim>
| The computed intersections.
using | SimplicialIntersection = typename IntersectionListProvider::SimplicialIntersection
using | RemoteSimplicialIntersection = SimplicialIntersection

## Protected Member Functions

| StandardMerge ()
virtual | ~StandardMerge ()=default

virtual void

computeIntersections (const Dune::GeometryType &grid1ElementType, const std::vector< Dune::FieldVector< T, dimworld > > &grid1ElementCorners, std::bitset<(1<< grid1Dim)> &neighborIntersects1, unsigned int grid1Index, const Dune::GeometryType &grid2ElementType, const std::vector< Dune::FieldVector< T, dimworld > > &grid2ElementCorners, std::bitset<(1<< grid2Dim)> &neighborIntersects2, unsigned int grid2Index, std::vector< SimplicialIntersection > &intersections)=0

| Compute the intersection between two overlapping elements.

bool

computeIntersection (unsigned int candidate0, unsigned int candidate1, const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, const std::vector< Dune::GeometryType > &grid1_element_types, std::bitset<(1<< grid1Dim)> &neighborIntersects1, const std::vector< Dune::FieldVector< T, dimworld > > &grid2Coords, const std::vector< Dune::GeometryType > &grid2_element_types, std::bitset<(1<< grid2Dim)> &neighborIntersects2, bool insert=true)

| Compute the intersection between two overlapping elements.

## Protected Attributes

bool | valid = false
std::shared_ptr< IntersectionListProvider > | intersectionListProvider_
std::shared_ptr< IntersectionList > | intersectionList_
std::vector< std::vector< unsigned int > > | grid1ElementCorners_
| Temporary internal data.
std::vector< std::vector< unsigned int > > | grid2ElementCorners_
std::vector< std::vector< int > > | elementNeighbors1_
std::vector< std::vector< int > > | elementNeighbors2_

## Detailed Description

template<class T, int grid1Dim, int grid2Dim, int dimworld>
class Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >

Common base class for many merger implementations: produce pairs of entities that may intersect.

Many merger algorithms consist of two parts: on the one hand there is a mechanism that produces pairs of elements that may intersect. On the other hand there is an algorithm that computes the intersection of two given elements. For the pairs-producing algorithm there appears to be a canonical choice, namely the algorithm by Gander and Japhet described in 'An Algorithm for Non-Matching Grid Projections with Linear Complexity, M.J. Gander and C. Japhet, Domain Decomposition Methods in Science and Engineering XVIII, pp. 185–192, Springer-Verlag, 2009.' This class implements this algorithm, calling a pure virtual function computeIntersection() to compute the intersection between two elements. Actual merger implementations can derive from this class and only implement computeIntersection().

Template Parameters

  T | The type used for coordinates (assumed to be the same for both grids)
  grid1Dim | Dimension of the grid1 grid
  grid2Dim | Dimension of the grid2 grid
  dimworld | Dimension of the world space where the coupling takes place

## Member Typedef Documentation

## ctype

template<class T, int grid1Dim, int grid2Dim, int dimworld>

typedef T Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::ctype

the numeric type used in this interface

## Grid1Coords

template<class T, int grid1Dim, int grid2Dim, int dimworld>

using Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::Grid1Coords = typename Base::Grid1Coords

Type used for local coordinates on the grid1 side.

## Grid2Coords

template<class T, int grid1Dim, int grid2Dim, int dimworld>

using Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::Grid2Coords = typename Base::Grid2Coords

Type used for local coordinates on the grid2 side.

## IntersectionList

template<class T, int grid1Dim, int grid2Dim, int dimworld>

using Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::IntersectionList = typename Base::IntersectionList

## IntersectionListProvider

template<class T, int grid1Dim, int grid2Dim, int dimworld>

using Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::IntersectionListProvider = SimplicialIntersectionListProvider<grid1Dim, grid2Dim>

protected

The computed intersections.

## RemoteSimplicialIntersection

template<class T, int grid1Dim, int grid2Dim, int dimworld>

using Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::RemoteSimplicialIntersection = SimplicialIntersection

protected

## SimplicialIntersection

template<class T, int grid1Dim, int grid2Dim, int dimworld>

using Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::SimplicialIntersection = typename IntersectionListProvider::SimplicialIntersection

protected

## WorldCoords

template<class T, int grid1Dim, int grid2Dim, int dimworld>

using Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::WorldCoords = typename Base::WorldCoords

the coordinate type used in this interface

## Constructor & Destructor Documentation

## StandardMerge()

template<class T, int grid1Dim, int grid2Dim, int dimworld>

Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::StandardMerge | ( |  | ) |

inline protected

## ~StandardMerge()

template<class T, int grid1Dim, int grid2Dim, int dimworld>

virtual Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::~StandardMerge | ( |  | ) |

protected virtual default

## Member Function Documentation

## build()

template<typename T, int grid1Dim, int grid2Dim, int dimworld>

void Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::build | ( | const std::vector< Dune::FieldVector< T, dimworld > > & | grid1_Coords,
|  | const std::vector< unsigned int > & | grid1_elements,
|  | const std::vector< Dune::GeometryType > & | grid1_element_types,
|  | const std::vector< Dune::FieldVector< T, dimworld > > & | grid2_coords,
|  | const std::vector< unsigned int > & | grid2_elements,
|  | const std::vector< Dune::GeometryType > & | grid2_element_types )

override virtual

builds the merged grid

Note that the indices are used consequently throughout the whole class interface just like they are introduced here.

Parameters

  grid1_coords | the grid1 vertices' coordinates ordered like e.g. in 3D x_0 y_0 z_0 x_1 y_1 ... y_(n-1) z_(n-1)
  grid1_elements | array with all grid1 elements represented as corner indices into `grid1_coords`
  grid1_element_types | array with the GeometryType of the elements listed grid1_elements
  grid2_coords | the grid2 vertices' coordinates ordered like e.g. in 3D x_0 y_0 z_0 x_1 y_1 ... y_(n-1) z_(n-1)
  grid2_elements | just like with the grid1_elements and grid1_coords
  grid2_element_types | array with the GeometryType of the elements listed grid2_elements

Implements Dune::GridGlue::Merger< T, grid1Dim, grid2Dim, dimworld >.

## clear()

template<class T, int grid1Dim, int grid2Dim, int dimworld>

void Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::clear | ( |  | ) |

inline override virtual

Implements Dune::GridGlue::Merger< T, grid1Dim, grid2Dim, dimworld >.

## computeIntersection()

template<typename T, int grid1Dim, int grid2Dim, int dimworld>

bool Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::computeIntersection | ( | unsigned int | candidate0,
|  | unsigned int | candidate1,
|  | const std::vector< Dune::FieldVector< T, dimworld > > & | grid1Coords,
|  | const std::vector< Dune::GeometryType > & | grid1_element_types,
|  | std::bitset<(1<< grid1Dim)> & | neighborIntersects1,
|  | const std::vector< Dune::FieldVector< T, dimworld > > & | grid2Coords,
|  | const std::vector< Dune::GeometryType > & | grid2_element_types,
|  | std::bitset<(1<< grid2Dim)> & | neighborIntersects2,
|  | bool | insert = true )

protected

Compute the intersection between two overlapping elements.

Returns
  true if at least one intersection point was found

## computeIntersections()

template<class T, int grid1Dim, int grid2Dim, int dimworld>

virtual void Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::computeIntersections | ( | const Dune::GeometryType & | grid1ElementType,
|  | const std::vector< Dune::FieldVector< T, dimworld > > & | grid1ElementCorners,
|  | std::bitset<(1<< grid1Dim)> & | neighborIntersects1,
|  | unsigned int | grid1Index,
|  | const Dune::GeometryType & | grid2ElementType,
|  | const std::vector< Dune::FieldVector< T, dimworld > > & | grid2ElementCorners,
|  | std::bitset<(1<< grid2Dim)> & | neighborIntersects2,
|  | unsigned int | grid2Index,
|  | std::vector< SimplicialIntersection > & | intersections )

protected pure virtual

Compute the intersection between two overlapping elements.

The result is a set of simplices stored in the vector intersections.

## enableBruteForce()

template<class T, int grid1Dim, int grid2Dim, int dimworld>

void Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::enableBruteForce | ( | bool | bruteForce | ) |

inline

## enableFallback()

template<class T, int grid1Dim, int grid2Dim, int dimworld>

void Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::enableFallback | ( | bool | fallback | ) |

inline

## intersectionList()

template<class T, int grid1Dim, int grid2Dim, int dimworld>

std::shared_ptr< IntersectionList > Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::intersectionList | ( |  | ) | const

inline final virtual

list of intersections

Note
  only valid after build() was called

Implements Dune::GridGlue::Merger< T, grid1Dim, grid2Dim, dimworld >.

## nSimplices()

unsigned int Dune::GridGlue::Merger< T, grid1Dim, grid2Dim, dimworld >::nSimplices | ( |  | ) | const

inline inherited

get the number of simplices in the merged grid The indices are then in 0..nSimplices()-1

## parent()

unsigned int Dune::GridGlue::Merger< T, grid1Dim, grid2Dim, dimworld >::parent | ( | unsigned int | idx,
|  | unsigned int | parId = 0 ) const

inline inherited

get index of grid-n's parent simplex for given merged grid simplex

Template Parameters

  n | specify which grid

Parameters

  idx | index of the merged grid simplex

Returns
  index of the parent simplex

## parentLocal()

auto Dune::GridGlue::Merger< T, grid1Dim, grid2Dim, dimworld >::parentLocal | ( | unsigned int | idx,
|  | unsigned int | corner,
|  | unsigned int | parId = 0 ) const

inline inherited

get the grid-n parent's simplex local coordinates for a particular merged grid simplex corner (parent's index can be obtained via "parent<n>")

Template Parameters

  n | specify which grid

Parameters

  idx | the index of the merged grid simplex
  corner | the index of the simplex' corner

Returns
  local coordinates in grid-n grid1

## parents()

unsigned int Dune::GridGlue::Merger< T, grid1Dim, grid2Dim, dimworld >::parents | ( | unsigned int | idx | ) | const

inline inherited

doc me

## Member Data Documentation

## counter

unsigned int Dune::GridGlue::Merger< T, grid1Dim, grid2Dim, dimworld >::counter

inherited

Counts the number of times the computeIntersection method has been called.

Used temporarily to speed up the implementation

## elementNeighbors1_

template<class T, int grid1Dim, int grid2Dim, int dimworld>

std::vector<std::vector<int> > Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::elementNeighbors1_

protected

## elementNeighbors2_

template<class T, int grid1Dim, int grid2Dim, int dimworld>

std::vector<std::vector<int> > Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::elementNeighbors2_

protected

## grid1ElementCorners_

template<class T, int grid1Dim, int grid2Dim, int dimworld>

std::vector<std::vector<unsigned int> > Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::grid1ElementCorners_

protected

Temporary internal data.

## grid2ElementCorners_

template<class T, int grid1Dim, int grid2Dim, int dimworld>

std::vector<std::vector<unsigned int> > Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::grid2ElementCorners_

protected

## intersectionList_

template<class T, int grid1Dim, int grid2Dim, int dimworld>

std::shared_ptr<IntersectionList> Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::intersectionList_

protected

## intersectionListProvider_

template<class T, int grid1Dim, int grid2Dim, int dimworld>

std::shared_ptr<IntersectionListProvider> Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::intersectionListProvider_

protected

## valid

template<class T, int grid1Dim, int grid2Dim, int dimworld>

bool Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >::valid = false

protected

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

- standardmerge.hh