dune-grid-glue 2.9
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Related Functions | List of all members
Dune::GridGlue::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
 
using Grid0View = GridView< 0 >
 GridView of grid 0 (aka domain grid) More...
 
using Grid0 = Grid< 0 >
 Grid 0 type. More...
 
using Grid0Patch = GridPatch< 0 >
 Coupling patch of grid 0. More...
 
using Grid1View = GridView< 1 >
 GridView of grid 1 (aka target grid) More...
 
using Grid1 = Grid< 1 >
 Grid 1 type. More...
 
using Grid1Patch = GridPatch< 1 >
 Coupling patch of grid 1. More...
 
typedef unsigned int IndexType
 
typedef PromotionTraits< typenameGridView< 0 >::ctype, typenameGridView< 1 >::ctype >::PromotedType ctype
 The type used for coordinates. More...
 
typedef Dune::FieldVector< ctype, dimworldCoords
 The type used for coordinate vectors. More...
 
template<int side>
using GridElement = typename GridView< side >::Traits::template Codim< 0 >::Entity
 type of grid elements on side side More...
 
template<int side>
using GridVertex = typename GridView< side >::Traits::template Codim< Grid< side >::dimension >::Entity
 type of grid vertices on side side More...
 
using Grid0Element = GridElement< 0 >
 The type of the Grid0 elements. More...
 
using Grid0Vertex = GridVertex< 0 >
 The type of the Grid0 vertices. More...
 
using Grid1Element = GridElement< 1 >
 The type of the Grid1 elements. More...
 
using Grid1Vertex = GridVertex< 1 >
 The type of the Grid1 vertices. More...
 
typedef Dune::GridGlue::Merger< ctype, Grid< 0 >::dimension - GridPatch< 0 >::codim, Grid< 1 >::dimension - GridPatch< 1 >::codim, dimworldMerger
 Instance of a Merger. More...
 
typedef Dune::GridGlue::Intersection< P0, P1, 0, 1 > Intersection
 Type of remote intersection objects. More...
 
typedef Dune::GridGlue::IntersectionIndexSet< P0, P1 > IndexSet
 Type of remote intersection indexSet. More...
 
template<int side>
using IntersectionIterator = Dune::GridGlue::IntersectionIterator< P0, P1, side,(side+1) % 2 >
 Type of the iterator that iterates over remove intersections. More...
 
using Grid0IntersectionIterator = IntersectionIterator< 0 >
 
using Grid1IntersectionIterator = IntersectionIterator< 1 >
 

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 More...
 
template<int P>
const GridPatch< P > & patch () const
 
template<int P>
const GridView< P > & gridView () const
 getter for the GridView of patch P More...
 
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 More...
 
template<int I = 0>
IntersectionIterator< I > iend () const
 gets the (general) end-iterator for grid glue iterations More...
 
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. More...
 
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 More...
 
static constexpr auto domdim = griddim<0>()
 
static constexpr auto grid0dimworld = griddimworld<0>()
 world dimension of the grid 0 extractor More...
 
static constexpr auto domdimworld = griddimworld<0>()
 
static constexpr auto grid1dim = griddim<1>()
 dimension of the grid 1 extractor More...
 
static constexpr auto tardim = griddim<1>()
 
static constexpr auto grid1dimworld = griddimworld<1>()
 world dimension of the grid 1 extractor More...
 
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. More...
 

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) More...
 
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
 

Related Functions

(Note that these are not member functions.)

template<... >
IteratorRange<... > intersections (const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
 Iterate over all intersections of a GridGlue. More...
 

Detailed Description

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

sequential adapter to couple two grids at specified close together boundaries

Template Parameters
P0patch (extractor) to use for grid 0
P1patch (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

◆ Grid0

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid0 = Grid<0>

Grid 0 type.

◆ Grid0Element

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid0Element = GridElement<0>

The type of the Grid0 elements.

◆ Grid0IntersectionIterator

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid0IntersectionIterator = IntersectionIterator<0>
Todo:
Please doc me!

◆ Grid0Patch

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid0Patch = GridPatch<0>

Coupling patch of grid 0.

◆ Grid0Vertex

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid0Vertex = GridVertex<0>

The type of the Grid0 vertices.

◆ Grid0View

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid0View = GridView<0>

GridView of grid 0 (aka domain grid)

◆ Grid1

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid1 = Grid<1>

Grid 1 type.

◆ Grid1Element

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid1Element = GridElement<1>

The type of the Grid1 elements.

◆ Grid1IntersectionIterator

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid1IntersectionIterator = IntersectionIterator<1>
Todo:
Please doc me!

◆ Grid1Patch

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid1Patch = GridPatch<1>

Coupling patch of grid 1.

◆ Grid1Vertex

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid1Vertex = GridVertex<1>

The type of the Grid1 vertices.

◆ Grid1View

template<typename P0 , typename P1 >
using Dune::GridGlue::GridGlue< P0, P1 >::Grid1View = GridView<1>

GridView of grid 1 (aka target grid)

◆ 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

◆ 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
gp0the grid0 patch
gp1the grid1 patch
mergerThe 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
dataGridGlueDataHandle
iftypeInterface for which the Communication should take place
dirCommunication 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>
static constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::griddim ( )
inlinestaticconstexpr

◆ griddimworld()

template<typename P0 , typename P1 >
template<int side>
static constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::griddimworld ( )
inlinestaticconstexpr

◆ 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
Iselect 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
Iselect 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
patch0coordsthe 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)
patch0entitiesarray 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.
patch0typesarray with all patch0 entities types
patch0rankrank of the process where patch0 was extracted
patch1coordsthe 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)
patch1entitiesjust like with the patch0entities and patch0corners
patch1typesarray with all patch1 entities types
patch1rankrank 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 Function Documentation

◆ 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::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>())) { ... }
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:67
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
Definition: rangegenerators.hh:17

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
glueGridGlue to obtain the intersections from
reverseTag 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 >
constexpr int Dune::GridGlue::GridGlue< P0, P1 >::dimworld = (int)griddimworld<0>() > (int)griddimworld<1>() ? (int)griddimworld<0>() : (int)griddimworld<1>()
staticconstexpr

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

◆ domdim

template<typename P0 , typename P1 >
constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::domdim = griddim<0>()
staticconstexpr

◆ domdimworld

template<typename P0 , typename P1 >
constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::domdimworld = griddimworld<0>()
staticconstexpr

◆ grid0dim

template<typename P0 , typename P1 >
constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::grid0dim = griddim<0>()
staticconstexpr

dimension of the grid 0 extractor

◆ grid0dimworld

template<typename P0 , typename P1 >
constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::grid0dimworld = griddimworld<0>()
staticconstexpr

world dimension of the grid 0 extractor

◆ grid1dim

template<typename P0 , typename P1 >
constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::grid1dim = griddim<1>()
staticconstexpr

dimension of the grid 1 extractor

◆ grid1dimworld

template<typename P0 , typename P1 >
constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::grid1dimworld = griddimworld<1>()
staticconstexpr

world dimension of the grid 1 extractor

◆ tardim

template<typename P0 , typename P1 >
constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::tardim = griddim<1>()
staticconstexpr

◆ tardimworld

template<typename P0 , typename P1 >
constexpr auto Dune::GridGlue::GridGlue< P0, P1 >::tardimworld = griddimworld<1>()
staticconstexpr

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