Loading...
Searching...
No Matches
GridGlue< P0, P1 > Class Template Reference

sequential adapter to couple two grids at specified close together boundaries More...

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

## Public Types

template<int side>
using | GridPatch = std::conditional_t<side == 0, P0, std::conditional_t<side == 1, P1, void>>
template<int side>
using | GridView = typename GridPatch<side>::GridView
template<int side>
using | Grid = typename GridView<side>::Grid
typedef unsigned int | IndexType
typedef PromotionTraits< typenameGridView< 0 >::ctype, typenameGridView< 1 >::ctype >::PromotedType | ctype
| The type used for coordinates.
typedef Dune::FieldVector< ctype, dimworld > | Coords
| The type used for coordinate vectors.
template<int side>
using | GridElement = typename GridView<side>::Traits::template Codim<0>::Entity
| type of grid elements on side `side`
template<int side>
using | GridVertex = typename GridView<side>::Traits::template Codim<Grid<side>::dimension>::Entity
| type of grid vertices on side `side`
typedef Dune::GridGlue::Merger< ctype, Grid< 0 >::dimension - GridPatch< 0 >::codim, Grid< 1 >::dimension - GridPatch< 1 >::codim, dimworld > | Merger
| Instance of a Merger.
typedef Dune::GridGlue::Intersection< P0, P1, 0, 1 > | Intersection
| Type of remote intersection objects.
typedef Dune::GridGlue::IntersectionIndexSet< P0, P1 > | IndexSet
| Type of remote intersection indexSet.
template<int side>
using | IntersectionIterator = Dune::GridGlue::IntersectionIterator<P0, P1, side, (side+1) % 2>
| Type of the iterator that iterates over remove intersections.

## Public Member Functions

| GridGlue (const std::shared_ptr< const GridPatch< 0 > > &gp0, const std::shared_ptr< const GridPatch< 1 > > &gp1, const std::shared_ptr< Merger > &merger)
| constructor
template<int P>
const GridPatch< P > & | patch () const
template<int P>
const GridView< P > & | gridView () const
| getter for the GridView of patch P
void | build ()
template<int I = 0>
IntersectionIterator< I > | ibegin () const
| gets an iterator over all remote intersections in the merged grid between grid0 and grid1
template<int I = 0>
IntersectionIterator< I > | iend () const
| gets the (general) end-iterator for grid glue iterations
template<class DataHandleImp, class DataTypeImp>
void | communicate (Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > &data, Dune::InterfaceType iftype, Dune::CommunicationDirection dir) const
| Communicate information on the MergedGrid of a GridGlue.
IndexSet | indexSet () const
Intersection | getIntersection (int i) const
size_t | size () const

## Static Public Member Functions

template<int side>
static constexpr auto | griddim ()
template<int side>
static constexpr auto | griddimworld ()

## Static Public Attributes

static constexpr auto | grid0dim = griddim<0>()
| dimension of the grid 0 extractor
static constexpr auto | domdim = griddim<0>()
static constexpr auto | grid0dimworld = griddimworld<0>()
| world dimension of the grid 0 extractor
static constexpr auto | domdimworld = griddimworld<0>()
static constexpr auto | grid1dim = griddim<1>()
| dimension of the grid 1 extractor
static constexpr auto | tardim = griddim<1>()
static constexpr auto | grid1dimworld = griddimworld<1>()
| world dimension of the grid 1 extractor
static constexpr auto | tardimworld = griddimworld<1>()
static constexpr int | dimworld = (int)griddimworld<0>() > (int)griddimworld<1>() ? (int)griddimworld<0>() : (int)griddimworld<1>()
| export the world dimension This is the maximum of the extractors' world dimensions.

## Protected Member Functions

void

mergePatches (const std::vector< Dune::FieldVector< ctype, dimworld > > &patch0coords, const std::vector< unsigned int > &patch0entities, const std::vector< Dune::GeometryType > &patch0types, const int patch0rank, const std::vector< Dune::FieldVector< ctype, dimworld > > &patch1coords, const std::vector< unsigned int > &patch1entities, const std::vector< Dune::GeometryType > &patch1types, const int patch1rank)

| after building the merged grid the intersection can be updated through this method (for internal use)
template<typename Extractor>
void | extractGrid (const Extractor &extractor, std::vector< Dune::FieldVector< ctype, dimworld > > &coords, std::vector< unsigned int > &faces, std::vector< Dune::GeometryType > &geometryTypes) const

## Friends

class | IntersectionData< P0, P1 >
class | Intersection< P0, P1, 0, 1 >
class | Intersection< P0, P1, 1, 0 >
class | IntersectionIterator< P0, P1, 0, 1 >
class | IntersectionIterator< P0, P1, 1, 0 >
class | IntersectionIndexSet< P0, P1 >

## Related Symbols

(Note that these are not member symbols.)
template<...>
IteratorRange<... > | intersections (const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
| Iterate over all intersections of a GridGlue.

## Detailed Description

template<typename P0, typename P1>
class GridGlue< P0, P1 >

sequential adapter to couple two grids at specified close together boundaries

Template Parameters

  P0 | patch (extractor) to use for grid 0
  P1 | patch (extractor) to use for grid 1

Todo
  adapt member names according to style guide

## Member Typedef Documentation

## Coords

template<typename P0, typename P1>

typedef Dune::FieldVector<ctype, dimworld> Dune::GridGlue::GridGlue< P0, P1 >::Coords

The type used for coordinate vectors.

## ctype

template<typename P0, typename P1>

typedef PromotionTraits<typenameGridView<0>::ctype,typenameGridView<1>::ctype>::PromotedType Dune::GridGlue::GridGlue< P0, P1 >::ctype

The type used for coordinates.

## Grid

template<typename P0, typename P1>
template<int side>

using Dune::GridGlue::GridGlue< P0, P1 >::Grid = typename GridView<side>::Grid

Grid type of grid `side`

## GridElement

template<typename P0, typename P1>
template<int side>

using Dune::GridGlue::GridGlue< P0, P1 >::GridElement = typename GridView<side>::Traits::template Codim<0>::Entity

type of grid elements on side `side`

## GridPatch

template<typename P0, typename P1>
template<int side>

using Dune::GridGlue::GridGlue< P0, P1 >::GridPatch = std::conditional_t<side == 0, P0, std::conditional_t<side == 1, P1, void>>

coupling patch of grid `side`

## GridVertex

template<typename P0, typename P1>
template<int side>

using Dune::GridGlue::GridGlue< P0, P1 >::GridVertex = typename GridView<side>::Traits::template Codim<Grid<side>::dimension>::Entity

type of grid vertices on side `side`

## GridView

template<typename P0, typename P1>
template<int side>

using Dune::GridGlue::GridGlue< P0, P1 >::GridView = typename GridPatch<side>::GridView

GridView of grid `side`

## IndexSet

template<typename P0, typename P1>

typedef Dune::GridGlue::IntersectionIndexSet<P0,P1> Dune::GridGlue::GridGlue< P0, P1 >::IndexSet

Type of remote intersection indexSet.

## IndexType

template<typename P0, typename P1>

typedef unsigned int Dune::GridGlue::GridGlue< P0, P1 >::IndexType

Todo

## Intersection

template<typename P0, typename P1>

typedef Dune::GridGlue::Intersection<P0,P1,0,1> Dune::GridGlue::GridGlue< P0, P1 >::Intersection

Type of remote intersection objects.

## IntersectionIterator

template<typename P0, typename P1>
template<int side>

using Dune::GridGlue::GridGlue< P0, P1 >::IntersectionIterator = Dune::GridGlue::IntersectionIterator<P0, P1, side, (side+1) % 2>

Type of the iterator that iterates over remove intersections.

## Merger

template<typename P0, typename P1>

typedef Dune::GridGlue::Merger<ctype, Grid<0>::dimension - GridPatch<0>::codim, Grid<1>::dimension - GridPatch<1>::codim, dimworld> Dune::GridGlue::GridGlue< P0, P1 >::Merger

Instance of a Merger.

## Constructor & Destructor Documentation

## GridGlue()

template<typename P0, typename P1>

Dune::GridGlue::GridGlue< P0, P1 >::GridGlue | ( | const std::shared_ptr< const GridPatch< 0 > > & | gp0,
|  | const std::shared_ptr< const GridPatch< 1 > > & | gp1,
|  | const std::shared_ptr< Merger > & | merger )

constructor

Initializes components but does not "glue" the surfaces. The surfaces are extracted from the grids here though.

Parameters

  gp0 | the grid0 patch
  gp1 | the grid1 patch
  merger | The merger object that is used to compute the merged grid. This class has to be a model of the SurfaceMergeConcept.

## Member Function Documentation

## build()

template<typename P0, typename P1>

void Dune::GridGlue::GridGlue< P0, P1 >::build | ( |  | ) |

## communicate()

template<typename P0, typename P1>
template<class DataHandleImp, class DataTypeImp>

void Dune::GridGlue::GridGlue< P0, P1 >::communicate | ( | Dune::GridGlue< P0, P1 >::CommDataHandle< DataHandleImp, DataTypeImp > & | data,
|  | Dune::InterfaceType | iftype,
|  | Dune::CommunicationDirection | dir ) const

Communicate information on the MergedGrid of a GridGlue.

Template parameter is a model of Dune::GridGlue::CommDataHandle

Parameters

  data | GridGlueDataHandle
  iftype | Interface for which the Communication should take place
  dir | Communication direction (Forward means grid0 to grid1, Backward is the reverse)

Todo

  fix mixed communication: seq->par use commSeq, par->seq use commPar

  add directed version communicate<FROM,TO, DH,DT>(data,iftype,dir)

## extractGrid()

template<typename P0, typename P1>
template<typename Extractor>

void Dune::GridGlue::GridGlue< P0, P1 >::extractGrid | ( | const Extractor & | extractor,
|  | std::vector< Dune::FieldVector< ctype, dimworld > > & | coords,
|  | std::vector< unsigned int > & | faces,
|  | std::vector< Dune::GeometryType > & | geometryTypes ) const

protected

## getIntersection()

template<typename P0, typename P1>

Intersection Dune::GridGlue::GridGlue< P0, P1 >::getIntersection | ( | int | i | ) | const

inline

## griddim()

template<typename P0, typename P1>
template<int side>

constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::griddim | ( |  | ) |

inline static constexpr

## griddimworld()

template<typename P0, typename P1>
template<int side>

constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::griddimworld | ( |  | ) |

inline static constexpr

## gridView()

template<typename P0, typename P1>
template<int P>

const GridView< P > & Dune::GridGlue::GridGlue< P0, P1 >::gridView | ( |  | ) | const

inline

getter for the GridView of patch P

Returns
  the object

## ibegin()

template<typename P0, typename P1>
template<int I = 0>

IntersectionIterator< I > Dune::GridGlue::GridGlue< P0, P1 >::ibegin | ( |  | ) | const

inline

gets an iterator over all remote intersections in the merged grid between grid0 and grid1

Template Parameters

  I | select inside grid I=0 or I=1

Returns
  the iterator

## iend()

template<typename P0, typename P1>
template<int I = 0>

IntersectionIterator< I > Dune::GridGlue::GridGlue< P0, P1 >::iend | ( |  | ) | const

inline

gets the (general) end-iterator for grid glue iterations

Template Parameters

  I | select inside grid I=0 or I=1

Returns
  the iterator

## indexSet()

template<typename P0, typename P1>

IndexSet Dune::GridGlue::GridGlue< P0, P1 >::indexSet | ( |  | ) | const

inline

## mergePatches()

template<typename P0, typename P1>

void Dune::GridGlue::GridGlue< P0, P1 >::mergePatches | ( | const std::vector< Dune::FieldVector< ctype, dimworld > > & | patch0coords,
|  | const std::vector< unsigned int > & | patch0entities,
|  | const std::vector< Dune::GeometryType > & | patch0types,
|  | const int | patch0rank,
|  | const std::vector< Dune::FieldVector< ctype, dimworld > > & | patch1coords,
|  | const std::vector< unsigned int > & | patch1entities,
|  | const std::vector< Dune::GeometryType > & | patch1types,
|  | const int | patch1rank )

protected

after building the merged grid the intersection can be updated through this method (for internal use)

Parameters

  patch0coords | the patch0 vertices' coordinates ordered like e.g. in 3D x_0 y_0 z_0 x_1 y_1 ... y_(n-1) z_(n-1)
  patch0entities | array with all patch0 entities represented as corner indices into `patch0coords`. Free of (potentially heterogeneous) block structure, the last component of one entity is immediately followed by the first component of the next entity here.
  patch0types | array with all patch0 entities types
  patch0rank | rank of the process where patch0 was extracted
  patch1coords | the patch2 vertices' coordinates ordered like e.g. in 3D x_0 y_0 z_0 x_1 y_1 ... y_(n-1) z_(n-1)
  patch1entities | just like with the patch0entities and patch0corners
  patch1types | array with all patch1 entities types
  patch1rank | rank of the process where patch1 was extracted

## patch()

template<typename P0, typename P1>
template<int P>

const GridPatch< P > & Dune::GridGlue::GridGlue< P0, P1 >::patch | ( |  | ) | const

inline

Todo
  Please doc me!

## size()

template<typename P0, typename P1>

size_t Dune::GridGlue::GridGlue< P0, P1 >::size | ( |  | ) | const

inline

## Friends And Related Symbol Documentation

## Intersection< P0, P1, 0, 1 >

template<typename P0, typename P1>

friend class Intersection< P0, P1, 0, 1 >

friend

## Intersection< P0, P1, 1, 0 >

template<typename P0, typename P1>

friend class Intersection< P0, P1, 1, 0 >

friend

## IntersectionData< P0, P1 >

template<typename P0, typename P1>

friend class IntersectionData< P0, P1 >

friend

## IntersectionIndexSet< P0, P1 >

template<typename P0, typename P1>

friend class IntersectionIndexSet< P0, P1 >

friend

## IntersectionIterator< P0, P1, 0, 1 >

template<typename P0, typename P1>

friend class IntersectionIterator< P0, P1, 0, 1 >

friend

## IntersectionIterator< P0, P1, 1, 0 >

template<typename P0, typename P1>

friend class IntersectionIterator< P0, P1, 1, 0 >

friend

## intersections()

template<...>

IteratorRange<... > intersections | ( | const GridGlue<... > & | glue,
|  | const Reverse<... > & | reverse = !reversed )

related

Iterate over all intersections of a GridGlue.

This function returns an object representing the range of intersections with respect to the GridGlue glue. Its main purpose is to enable iteration over these intersections by means of a range-based for loop:

// Iterate over all intersections of a GridGlue in various ways
using Dune::GridGlue::GridGlue;
using Dune::GridGlue::Reverse;
using Dune::GridGlue::reversed;
GridGlue<...> glue;
for (const auto& in : intersections(glue)) { ... }
for (const auto& in : intersections(glue, reversed)) { ... }
for (const auto& in : intersections(glue, !reversed)) { ... }
for (const auto& in : intersections(glue, Reversed<true>())) { ... }
Dune::GridGlue::GridGlue
sequential adapter to couple two grids at specified close together boundaries
Definition gridglue.hh:67
Dune::GridGlue::Reverse
Definition rangegenerators.hh:17
GridGlue::GridGlue
GridGlue(const std::shared_ptr< const GridPatch< 0 > > &gp0, const std::shared_ptr< const GridPatch< 1 > > &gp1, const std::shared_ptr< Merger > &merger)
constructor
Definition gridglue.cc:21
GridGlue::intersections
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.

The in- and outside of the intersection can be reversed by passing reversed as the second argument. The fourth form can be used in case a template parameter for reversal is required.

Since
  dune-common 2.4

Parameters

  glue | GridGlue to obtain the intersections from
  reverse | Tag to indicate reversal of in- and outside of intersections

Returns
  an unspecified object that is guaranteed to fulfill the interface of IteratorRange and that can be iterated over using a range-based for loop.

See also
  Dune::GridGlue::Intersection

## Member Data Documentation

## dimworld

template<typename P0, typename P1>

int Dune::GridGlue::GridGlue< P0, P1 >::dimworld = (int)griddimworld<0>() > (int)griddimworld<1>() ? (int)griddimworld<0>() : (int)griddimworld<1>()

static constexpr

export the world dimension This is the maximum of the extractors' world dimensions.

## domdim

template<typename P0, typename P1>

auto Dune::GridGlue::GridGlue< P0, P1 >::domdim = griddim<0>()

static constexpr

## domdimworld

template<typename P0, typename P1>

auto Dune::GridGlue::GridGlue< P0, P1 >::domdimworld = griddimworld<0>()

static constexpr

## grid0dim

template<typename P0, typename P1>

auto Dune::GridGlue::GridGlue< P0, P1 >::grid0dim = griddim<0>()

static constexpr

dimension of the grid 0 extractor

## grid0dimworld

template<typename P0, typename P1>

auto Dune::GridGlue::GridGlue< P0, P1 >::grid0dimworld = griddimworld<0>()

static constexpr

world dimension of the grid 0 extractor

## grid1dim

template<typename P0, typename P1>

auto Dune::GridGlue::GridGlue< P0, P1 >::grid1dim = griddim<1>()

static constexpr

dimension of the grid 1 extractor

## grid1dimworld

template<typename P0, typename P1>

auto Dune::GridGlue::GridGlue< P0, P1 >::grid1dimworld = griddimworld<1>()

static constexpr

world dimension of the grid 1 extractor

## tardim

template<typename P0, typename P1>

auto Dune::GridGlue::GridGlue< P0, P1 >::tardim = griddim<1>()

static constexpr

## tardimworld

template<typename P0, typename P1>

auto Dune::GridGlue::GridGlue< P0, P1 >::tardimworld = griddimworld<1>()

static constexpr

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

- gridglue.hh
- gridglue.cc
- rangegenerators.hh