dune-grid-glue  2.7.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Related Functions | List of all members
Dune::GridGlue::GridGlue Class 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 instead = GridView< 0 >
 
using instead = Grid< 0 >
 
using instead = GridPatch< 0 >
 
using instead = GridView< 1 >
 
using instead = Grid< 1 >
 
using instead = GridPatch< 1 >
 
typedef unsigned int IndexType
 
typedef PromotionTraits< typename GridView< 0 >::ctype, typename GridView< 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 instead = GridElement< 0 >
 
using instead = GridVertex< 0 >
 
using instead = GridElement< 1 >
 
using instead = GridVertex< 1 >
 
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 instead = IntersectionIterator< 0 >
 
using instead = IntersectionIterator< 1 >
 

Public Member Functions

 DUNE_DEPRECATED_MSG ("please use griddim<0>() instead") static const expr auto grid0dim
 dimension of the grid 0 extractor More...
 
 DUNE_DEPRECATED_MSG ("please use griddim<0>() instead") static const expr auto domdim
 
 DUNE_DEPRECATED_MSG ("please use griddimworld<0>() instead") static const expr auto grid0dimworld
 world dimension of the grid 0 extractor More...
 
 DUNE_DEPRECATED_MSG ("please use griddimworld<0>() instead") static const expr auto domdimworld
 
 DUNE_DEPRECATED_MSG ("please use griddim<1>() instead") static const expr auto grid1dim
 dimension of the grid 1 extractor More...
 
 DUNE_DEPRECATED_MSG ("please use griddim<1>() instead") static const expr auto tardim
 
 DUNE_DEPRECATED_MSG ("please use griddimworld<1>() instead") static const expr auto grid1dimworld
 world dimension of the grid 1 extractor More...
 
 DUNE_DEPRECATED_MSG ("please use griddimworld<1>() instead") static const expr auto tardimworld
 
 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 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

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

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

The type used for coordinate vectors.

◆ ctype

typedef PromotionTraits<typename GridView<0>::ctype, typename GridView<1>::ctype>::PromotedType Dune::GridGlue::GridGlue::ctype

The type used for coordinates.

◆ Grid

template<int side>
using Dune::GridGlue::GridGlue::Grid = typename GridView<side>::Grid

Grid type of grid side

◆ GridElement

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

type of grid elements on side side

◆ GridPatch

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

coupling patch of grid side

◆ GridVertex

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

type of grid vertices on side side

◆ GridView

template<int side>
using Dune::GridGlue::GridGlue::GridView = typename GridPatch<side>::GridView

GridView of grid side

◆ IndexSet

Type of remote intersection indexSet.

◆ IndexType

◆ instead [1/12]

◆ instead [2/12]

◆ instead [3/12]

◆ instead [4/12]

◆ instead [5/12]

◆ instead [6/12]

◆ instead [7/12]

◆ instead [8/12]

◆ instead [9/12]

◆ instead [10/12]

◆ instead [11/12]

◆ instead [12/12]

◆ Intersection

Type of remote intersection objects.

◆ IntersectionIterator

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

Type of the iterator that iterates over remove intersections.

◆ Merger

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

Instance of a Merger.

Constructor & Destructor Documentation

◆ GridGlue()

Dune::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

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()

void Dune::GridGlue::GridGlue::build ( )

◆ communicate()

template<class DataHandleImp , class DataTypeImp >
void Dune::GridGlue::GridGlue::communicate ( Dune::GridGlue::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)

◆ DUNE_DEPRECATED_MSG() [1/8]

Dune::GridGlue::GridGlue::DUNE_DEPRECATED_MSG ( "please use griddim<0>() instead ) const

◆ DUNE_DEPRECATED_MSG() [2/8]

Dune::GridGlue::GridGlue::DUNE_DEPRECATED_MSG ( "please use griddim<0>() instead ) const

dimension of the grid 0 extractor

◆ DUNE_DEPRECATED_MSG() [3/8]

Dune::GridGlue::GridGlue::DUNE_DEPRECATED_MSG ( "please use griddim<1>() instead ) const

dimension of the grid 1 extractor

◆ DUNE_DEPRECATED_MSG() [4/8]

Dune::GridGlue::GridGlue::DUNE_DEPRECATED_MSG ( "please use griddim<1>() instead ) const

◆ DUNE_DEPRECATED_MSG() [5/8]

Dune::GridGlue::GridGlue::DUNE_DEPRECATED_MSG ( "please use griddimworld<0>() instead ) const

◆ DUNE_DEPRECATED_MSG() [6/8]

Dune::GridGlue::GridGlue::DUNE_DEPRECATED_MSG ( "please use griddimworld<0>() instead ) const

world dimension of the grid 0 extractor

◆ DUNE_DEPRECATED_MSG() [7/8]

Dune::GridGlue::GridGlue::DUNE_DEPRECATED_MSG ( "please use griddimworld<1>() instead ) const

world dimension of the grid 1 extractor

◆ DUNE_DEPRECATED_MSG() [8/8]

Dune::GridGlue::GridGlue::DUNE_DEPRECATED_MSG ( "please use griddimworld<1>() instead ) const

◆ extractGrid()

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

◆ getIntersection()

Intersection Dune::GridGlue::GridGlue::getIntersection ( int  i) const
inline

◆ griddim()

template<int side>
static constexpr auto Dune::GridGlue::GridGlue::griddim ( )
inlinestaticconstexpr

◆ griddimworld()

template<int side>
static constexpr auto Dune::GridGlue::GridGlue::griddimworld ( )
inlinestaticconstexpr

◆ gridView()

template<int P>
const GridView<P>& Dune::GridGlue::GridGlue::gridView ( ) const
inline

getter for the GridView of patch P

Returns
the object

◆ ibegin()

template<int I = 0>
IntersectionIterator<I> Dune::GridGlue::GridGlue::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<int I = 0>
IntersectionIterator<I> Dune::GridGlue::GridGlue::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()

IndexSet Dune::GridGlue::GridGlue::indexSet ( ) const
inline

◆ mergePatches()

void Dune::GridGlue::GridGlue::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<int P>
const GridPatch<P>& Dune::GridGlue::GridGlue::patch ( ) const
inline
Todo:
Please doc me!

◆ size()

size_t Dune::GridGlue::GridGlue::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>())) { ... }

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

constexpr int Dune::GridGlue::GridGlue::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.


The documentation for this class was generated from the following files:
Dune::GridGlue::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:19
Dune::GridGlue::GridGlue::intersections
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
Dune::GridGlue::GridGlue
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:40
Dune::GridGlue::Reverse
Definition: rangegenerators.hh:13