dune-grid-glue  2.3.0
Public Types | Public Member Functions | Protected Member Functions | Friends | 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

enum  { grid0dim = Grid0Patch::dim, domdim = Grid0Patch::dim, grid0dimworld = Grid0Patch::dimworld, domdimworld = Grid0Patch::dimworld }
 Dimension of the grid 0 extractor. More...
 
enum  { tardim = Grid1Patch::dim, grid1dim = Grid1Patch::dim, tardimworld = Grid1Patch::dimworld, grid1dimworld = Grid1Patch::dimworld }
 Dimension of the grid 1 extractor. More...
 
enum  { dimworld = ((int)Grid0Patch::dimworld > (int)Grid1Patch::dimworld) ? (int)Grid0Patch::dimworld : (int)Grid1Patch::dimworld }
 export the world dimension More...
 
typedef P0::GridView Grid0View
 GridView of grid 0 (aka domain grid) More...
 
typedef Grid0View::Grid Grid0
 Grid 0 type. More...
 
typedef Grid0 DomainGridType
 Grid 0 type. More...
 
typedef P0 Grid0Patch
 Coupling patch of grid 0. More...
 
typedef P1::GridView Grid1View
 GridView of grid 1 (aka target grid) More...
 
typedef Grid1View::Grid Grid1
 Grid 1 type. More...
 
typedef Grid1 TargetGridType
 Grid 1 type. More...
 
typedef P1 Grid1Patch
 Coupling patch of grid 1. More...
 
typedef unsigned int IndexType
 
typedef Grid0View::ctype ctype
 The type used for coordinates. More...
 
typedef Dune::FieldVector
< ctype, dimworld
Coords
 The type used for coordinate vectors. More...
 
typedef
Grid0View::Traits::template
Codim< 0 >::Entity 
Grid0Element
 The type of the Grid0 elements. More...
 
typedef
Grid0View::Traits::template
Codim< 0 >::Entity 
DomainElement
 The type of the Grid0 elements. More...
 
typedef
Grid0View::Traits::template
Codim< 0 >::EntityPointer 
Grid0ElementPtr
 Pointer type to Grid0 elements. More...
 
typedef
Grid0View::Traits::template
Codim< 0 >::EntityPointer 
DomainElementPtr
 Pointer type to Grid0 elements. More...
 
typedef
Grid0View::Traits::template
Codim< Grid0::dimension >
::Entity 
Grid0Vertex
 The type of the Grid0 vertices. More...
 
typedef
Grid0View::Traits::template
Codim< Grid0::dimension >
::Entity 
DomainVertex
 The type of the Grid0 vertices. More...
 
typedef
Grid0View::Traits::template
Codim< Grid0::dimension >
::EntityPointer 
Grid0VertexPtr
 Pointer type to Grid0 vertices. More...
 
typedef
Grid0View::Traits::template
Codim< Grid0::dimension >
::EntityPointer 
DomainVertexPtr
 Pointer type to Grid0 vertices. More...
 
typedef
Grid1View::Traits::template
Codim< 0 >::Entity 
Grid1Element
 The type of the Grid1 elements. More...
 
typedef
Grid1View::Traits::template
Codim< 0 >::Entity 
TargetElement
 The type of the Grid1 elements. More...
 
typedef
Grid1View::Traits::template
Codim< 0 >::EntityPointer 
Grid1ElementPtr
 Pointer type to Grid1 elements. More...
 
typedef
Grid1View::Traits::template
Codim< 0 >::EntityPointer 
TargetElementPtr
 Pointer type to Grid1 elements. More...
 
typedef
Grid1View::Traits::template
Codim< Grid1::dimension >
::Entity 
Grid1Vertex
 The type of the Grid1 vertices. More...
 
typedef
Grid1View::Traits::template
Codim< Grid1::dimension >
::Entity 
TargetVertex
 The type of the Grid1 vertices. More...
 
typedef
Grid1View::Traits::template
Codim< Grid1::dimension >
::EntityPointer 
Grid1VertexPtr
 Pointer type to Grid1 vertices. More...
 
typedef
Grid1View::Traits::template
Codim< Grid1::dimension >
::EntityPointer 
TargetVertexPtr
 Pointer type to Grid1 vertices. More...
 
typedef ::Merger< ctype,
Grid0::dimension-Grid0Patch::codim,
Grid1::dimension-Grid1Patch::codim,
dimworld
Merger
 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...
 
typedef
Dune::GridGlue::IntersectionIterator
< P0, P1, 0, 1 > 
Grid0IntersectionIterator
 Type of the iterator that iterates over remove intersections. More...
 
typedef
Dune::GridGlue::IntersectionIterator
< P0, P1, 1, 0 > 
Grid1IntersectionIterator
 

Public Member Functions

 GridGlue (const Grid0Patch &gp0, const Grid1Patch &gp1, Merger *merger)
 constructor More...
 
 GridGlue (const std::shared_ptr< const Grid0Patch > gp0, const std::shared_ptr< const Grid1Patch > gp1, const std::shared_ptr< Merger > merger)
 
template<int P>
const GridGlueView< P0, P1, P >
::Patch & 
patch () const
 
template<int P>
const GridGlueView< P0, P1, P >
::Patch::GridView & 
gridView () const
 getter for the GridView of patch P More...
 
void build ()
 
template<int I>
GridGlueView< P0, P1, I >
::IntersectionIterator 
ibegin () const
 gets an iterator over all remote intersections in the merged grid between grid0 and grid1 More...
 
template<int I>
GridGlueView< P0, P1, I >
::IntersectionIterator 
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
 

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
 

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 >
 
struct GridGlueView< P0, P1, 0 >
 
struct GridGlueView< P0, P1, 1 >
 

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

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

The type used for coordinate vectors.

template<typename P0, typename P1>
typedef Grid0View::ctype Dune::GridGlue::GridGlue< P0, P1 >::ctype

The type used for coordinates.

Todo:
maybe use traits class to decide which has more precision (Grid0View::ctype or Grid1View::ctype) and then take this one
template<typename P0, typename P1>
typedef Grid0View::Traits::template Codim<0>::Entity Dune::GridGlue::GridGlue< P0, P1 >::DomainElement

The type of the Grid0 elements.

Deprecated:
please use Grid0Element
Deprecated:
template<typename P0, typename P1>
typedef Grid0View::Traits::template Codim<0>::EntityPointer Dune::GridGlue::GridGlue< P0, P1 >::DomainElementPtr

Pointer type to Grid0 elements.

Deprecated:
please use Grid0ElementPtr
Deprecated:
template<typename P0, typename P1>
typedef Grid0 Dune::GridGlue::GridGlue< P0, P1 >::DomainGridType

Grid 0 type.

Deprecated:
please use typede Grid0
Deprecated:
template<typename P0, typename P1>
typedef Grid0View::Traits::template Codim<Grid0::dimension>::Entity Dune::GridGlue::GridGlue< P0, P1 >::DomainVertex

The type of the Grid0 vertices.

Deprecated:
please use Grid0ElementPtr
Deprecated:
template<typename P0, typename P1>
typedef Grid0View::Traits::template Codim<Grid0::dimension>::EntityPointer Dune::GridGlue::GridGlue< P0, P1 >::DomainVertexPtr

Pointer type to Grid0 vertices.

Deprecated:
please use Grid0VertexPtr
Deprecated:
template<typename P0, typename P1>
typedef Grid0View::Grid Dune::GridGlue::GridGlue< P0, P1 >::Grid0

Grid 0 type.

template<typename P0, typename P1>
typedef Grid0View::Traits::template Codim<0>::Entity Dune::GridGlue::GridGlue< P0, P1 >::Grid0Element

The type of the Grid0 elements.

template<typename P0, typename P1>
typedef Grid0View::Traits::template Codim<0>::EntityPointer Dune::GridGlue::GridGlue< P0, P1 >::Grid0ElementPtr

Pointer type to Grid0 elements.

template<typename P0, typename P1>
typedef Dune::GridGlue::IntersectionIterator<P0,P1,0,1> Dune::GridGlue::GridGlue< P0, P1 >::Grid0IntersectionIterator

Type of the iterator that iterates over remove intersections.

Todo:
Please doc me!
template<typename P0, typename P1>
typedef P0 Dune::GridGlue::GridGlue< P0, P1 >::Grid0Patch

Coupling patch of grid 0.

template<typename P0, typename P1>
typedef Grid0View::Traits::template Codim<Grid0::dimension>::Entity Dune::GridGlue::GridGlue< P0, P1 >::Grid0Vertex

The type of the Grid0 vertices.

template<typename P0, typename P1>
typedef Grid0View::Traits::template Codim<Grid0::dimension>::EntityPointer Dune::GridGlue::GridGlue< P0, P1 >::Grid0VertexPtr

Pointer type to Grid0 vertices.

template<typename P0, typename P1>
typedef P0::GridView Dune::GridGlue::GridGlue< P0, P1 >::Grid0View

GridView of grid 0 (aka domain grid)

template<typename P0, typename P1>
typedef Grid1View::Grid Dune::GridGlue::GridGlue< P0, P1 >::Grid1

Grid 1 type.

template<typename P0, typename P1>
typedef Grid1View::Traits::template Codim<0>::Entity Dune::GridGlue::GridGlue< P0, P1 >::Grid1Element

The type of the Grid1 elements.

template<typename P0, typename P1>
typedef Grid1View::Traits::template Codim<0>::EntityPointer Dune::GridGlue::GridGlue< P0, P1 >::Grid1ElementPtr

Pointer type to Grid1 elements.

template<typename P0, typename P1>
typedef Dune::GridGlue::IntersectionIterator<P0,P1,1,0> Dune::GridGlue::GridGlue< P0, P1 >::Grid1IntersectionIterator
Todo:
Please doc me!
template<typename P0, typename P1>
typedef P1 Dune::GridGlue::GridGlue< P0, P1 >::Grid1Patch

Coupling patch of grid 1.

template<typename P0, typename P1>
typedef Grid1View::Traits::template Codim<Grid1::dimension>::Entity Dune::GridGlue::GridGlue< P0, P1 >::Grid1Vertex

The type of the Grid1 vertices.

template<typename P0, typename P1>
typedef Grid1View::Traits::template Codim<Grid1::dimension>::EntityPointer Dune::GridGlue::GridGlue< P0, P1 >::Grid1VertexPtr

Pointer type to Grid1 vertices.

template<typename P0, typename P1>
typedef P1::GridView Dune::GridGlue::GridGlue< P0, P1 >::Grid1View

GridView of grid 1 (aka target grid)

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

Type of remote intersection indexSet.

template<typename P0, typename P1>
typedef unsigned int Dune::GridGlue::GridGlue< P0, P1 >::IndexType
template<typename P0, typename P1>
typedef Dune::GridGlue::Intersection<P0,P1,0,1> Dune::GridGlue::GridGlue< P0, P1 >::Intersection

Type of remote intersection objects.

template<typename P0, typename P1>
typedef ::Merger<ctype, Grid0::dimension - Grid0Patch::codim, Grid1::dimension - Grid1Patch::codim, dimworld> Dune::GridGlue::GridGlue< P0, P1 >::Merger

Instance of a Merger.

template<typename P0, typename P1>
typedef Grid1View::Traits::template Codim<0>::Entity Dune::GridGlue::GridGlue< P0, P1 >::TargetElement

The type of the Grid1 elements.

Deprecated:
please use Grid1Element
Deprecated:
template<typename P0, typename P1>
typedef Grid1View::Traits::template Codim<0>::EntityPointer Dune::GridGlue::GridGlue< P0, P1 >::TargetElementPtr

Pointer type to Grid1 elements.

Deprecated:
please use Grid1ElementPtr
Deprecated:
template<typename P0, typename P1>
typedef Grid1 Dune::GridGlue::GridGlue< P0, P1 >::TargetGridType

Grid 1 type.

Deprecated:
please use typede Grid0
Deprecated:
template<typename P0, typename P1>
typedef Grid1View::Traits::template Codim<Grid1::dimension>::Entity Dune::GridGlue::GridGlue< P0, P1 >::TargetVertex

The type of the Grid1 vertices.

Deprecated:
please use Grid1Vertex
Deprecated:
template<typename P0, typename P1>
typedef Grid1View::Traits::template Codim<Grid1::dimension>::EntityPointer Dune::GridGlue::GridGlue< P0, P1 >::TargetVertexPtr

Pointer type to Grid1 vertices.

Deprecated:
please use Grid1VertexPtr
Deprecated:

Member Enumeration Documentation

template<typename P0, typename P1>
anonymous enum

Dimension of the grid 0 extractor.

Enumerator
grid0dim 

Dimension of the grid 0 extractor.

domdim 
grid0dimworld 

World dimension of the grid 0 extractor.

domdimworld 
template<typename P0, typename P1>
anonymous enum

Dimension of the grid 1 extractor.

Enumerator
tardim 

Dimension of the grid 1 extractor.

grid1dim 
tardimworld 

World dimension of the grid 1 extractor.

grid1dimworld 
template<typename P0, typename P1>
anonymous enum

export the world dimension

Enumerator
dimworld 

export the world dimension : maximum of the two extractor world dimensions

Constructor & Destructor Documentation

template<typename P0 , typename P1 >
Dune::GridGlue::GridGlue< P0, P1 >::GridGlue ( const Grid0Patch gp0,
const Grid1Patch gp1,
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.
template<typename P0 , typename P1 >
Dune::GridGlue::GridGlue< P0, P1 >::GridGlue ( const std::shared_ptr< const Grid0Patch gp0,
const std::shared_ptr< const Grid1Patch gp1,
const std::shared_ptr< Merger merger 
)

Member Function Documentation

template<typename P0 , typename P1 >
void Dune::GridGlue::GridGlue< P0, P1 >::build ( )
Todo:
Use vector<struct> for message buffer and MultiVector to copy these

References CheckMPIStatus.

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
inline

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)

References Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp >::data, Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp >::dir, Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp >::gather(), Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp >::gridglue, Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp >::scatter(), Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp >::size(), and Dune::GridGlue::GridGlue< P0, P1 >::size().

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
template<typename P0, typename P1>
Intersection Dune::GridGlue::GridGlue< P0, P1 >::getIntersection ( int  i) const
inline
template<typename P0, typename P1>
template<int P>
const GridGlueView<P0,P1,P>::Patch::GridView& Dune::GridGlue::GridGlue< P0, P1 >::gridView ( ) const
inline

getter for the GridView of patch P

Returns
the object
template<typename P0, typename P1>
template<int I>
GridGlueView<P0,P1,I>::IntersectionIterator 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
template<typename P0, typename P1>
template<int I>
GridGlueView<P0,P1,I>::IntersectionIterator 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
template<typename P0, typename P1>
IndexSet Dune::GridGlue::GridGlue< P0, P1 >::indexSet ( ) const
inline
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; the entities are just written to this array one after another
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

References Dune::GridGlue::IntersectionData< P0, P1 >::grid0indices_, Dune::GridGlue::IntersectionData< P0, P1 >::grid0local_, Dune::GridGlue::IntersectionData< P0, P1 >::grid1indices_, and Dune::GridGlue::IntersectionData< P0, P1 >::grid1local_.

template<typename P0, typename P1>
template<int P>
const GridGlueView<P0,P1,P>::Patch& Dune::GridGlue::GridGlue< P0, P1 >::patch ( ) const
inline
Todo:
Please doc me!
template<typename P0, typename P1>
size_t Dune::GridGlue::GridGlue< P0, P1 >::size ( ) const
inline

Friends And Related Function Documentation

template<typename P0, typename P1>
friend struct GridGlueView< P0, P1, 0 >
friend
template<typename P0, typename P1>
friend struct GridGlueView< P0, P1, 1 >
friend
template<typename P0, typename P1>
friend class Intersection< P0, P1, 0, 1 >
friend
template<typename P0, typename P1>
friend class Intersection< P0, P1, 1, 0 >
friend
template<typename P0, typename P1>
friend class IntersectionData< P0, P1 >
friend
template<typename P0, typename P1>
friend class IntersectionIndexSet< P0, P1 >
friend
template<typename P0, typename P1>
friend class IntersectionIterator< P0, P1, 0, 1 >
friend
template<typename P0, typename P1>
friend class IntersectionIterator< P0, P1, 1, 0 >
friend

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