dune-grid-glue  2.3.0
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
PSurfaceMerge< dim, dimworld, T > Class Template Reference

Standard implementation of the SurfaceMerge concept using the psurface library. More...

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

Inheritance diagram for PSurfaceMerge< dim, dimworld, T >:
Inheritance graph

Public Types

typedef T ctype
 the numeric type used in this interface More...
 
typedef Dune::FieldVector< T,
dimworld > 
WorldCoords
 the coordinate type used in this interface More...
 
typedef Dune::FieldVector< T, dim > LocalCoords
 the coordinate type used in this interface More...
 
typedef Dune::FieldVector< T,
grid1Dim > 
Grid1Coords
 the local coordinate type for the grid1 coordinates More...
 
typedef Dune::FieldVector< T,
grid2Dim > 
Grid2Coords
 the local coordinate type for the grid2 coordinates More...
 

Public Member Functions

 PSurfaceMerge (const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > *domainDirections, const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > *targetDirections)
 
 PSurfaceMerge (std::shared_ptr< const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > > domainDirections=nullptr, std::shared_ptr< const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > > targetDirections=nullptr)
 
void setSurfaceDirections (const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > *domainDirections, const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > *targetDirections)
 Set surface direction functions. More...
 
void setSurfaceDirections (std::shared_ptr< const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > > domainDirections, std::shared_ptr< const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > > targetDirections)
 
void build (const std::vector< Dune::FieldVector< ctype, dimworld > > &grid1_coords, const std::vector< unsigned int > &grid1_elements, const std::vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< ctype, dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, const std::vector< Dune::GeometryType > &grid2_element_types)
 builds the merged grid More...
 
unsigned int nSimplices () const
 get the number of simplices in the merged grid The indices are then in 0..nSimplices()-1 More...
 
void clear ()
 clear the internal state, so that we can run a new merging process More...
 
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 More...
 
bool simplexRefined (unsigned int idx, std::vector< unsigned int > &indices) const
 get the merged grid simplices refining a given grid-n simplex More...
 
GridTraits< n >::Coords 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>") More...
 

Public Attributes

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

Detailed Description

template<int dim, int dimworld, typename T = double>
class PSurfaceMerge< dim, dimworld, T >

Standard implementation of the SurfaceMerge concept using the psurface library.

Template Parameters
dimGrid dimension of the coupling grids. Must be the same for both sides
dimworldDimension of the world coordinates. Must be equal to dim or to dim+1
TType used for coordinates

Member Typedef Documentation

template<int dim, int dimworld, typename T = double>
typedef T PSurfaceMerge< dim, dimworld, T >::ctype

the numeric type used in this interface

typedef Dune::FieldVector<T , grid1Dim> Merger< T , grid1Dim, grid2Dim, dimworld >::Grid1Coords
inherited

the local coordinate type for the grid1 coordinates

typedef Dune::FieldVector<T , grid2Dim> Merger< T , grid1Dim, grid2Dim, dimworld >::Grid2Coords
inherited

the local coordinate type for the grid2 coordinates

template<int dim, int dimworld, typename T = double>
typedef Dune::FieldVector<T, dim> PSurfaceMerge< dim, dimworld, T >::LocalCoords

the coordinate type used in this interface

template<int dim, int dimworld, typename T = double>
typedef Dune::FieldVector<T, dimworld> PSurfaceMerge< dim, dimworld, T >::WorldCoords

the coordinate type used in this interface

Constructor & Destructor Documentation

template<int dim, int dimworld, typename T >
PSurfaceMerge< dim, dimworld, T >::PSurfaceMerge ( const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > *  domainDirections,
const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > *  targetDirections 
)
template<int dim, int dimworld, typename T >
PSurfaceMerge< dim, dimworld, T >::PSurfaceMerge ( std::shared_ptr< const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > >  domainDirections = nullptr,
std::shared_ptr< const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > >  targetDirections = nullptr 
)

Member Function Documentation

template<int dim, int dimworld, typename T >
void PSurfaceMerge< dim, dimworld, T >::build ( const std::vector< Dune::FieldVector< ctype, dimworld > > &  grid1_coords,
const std::vector< unsigned int > &  grid1_elements,
const std::vector< Dune::GeometryType > &  grid1_element_types,
const std::vector< Dune::FieldVector< ctype, dimworld > > &  grid2_coords,
const std::vector< unsigned int > &  grid2_elements,
const std::vector< Dune::GeometryType > &  grid2_element_types 
)
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_coordsthe 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_elementsarray with all grid1 elements represented as corner indices into grid1_coords
grid1_element_typesarray with the GeometryType of the elements listed grid1_elements
grid2_coordsthe 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_elementsjust like with the grid1_elements and grid1_coords
grid2_element_typesarray with the GeometryType of the elements listed grid2_elements

Implements Merger< T, dim, dim, dimworld >.

template<int dim, int dimworld, typename T = double>
void PSurfaceMerge< dim, dimworld, T >::clear ( )
inlinevirtual

clear the internal state, so that we can run a new merging process

Implements Merger< T, dim, dim, dimworld >.

template<int dim, int dimworld, typename T >
unsigned int PSurfaceMerge< dim, dimworld, T >::nSimplices ( ) const
inlinevirtual

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

Implements Merger< T, dim, dim, dimworld >.

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

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

Template Parameters
nspecify which grid
Parameters
idxindex of the merged grid simplex
Returns
index of the parent simplex
GridTraits<n>::Coords Merger< T , grid1Dim, grid2Dim, dimworld >::parentLocal ( unsigned int  idx,
unsigned int  corner,
unsigned int  parId = 0 
) const
inlineinherited

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
nspecify which grid
Parameters
idxthe index of the merged grid simplex
cornerthe index of the simplex' corner
Returns
local coordinates in grid-n grid1
unsigned int Merger< T , grid1Dim, grid2Dim, dimworld >::parents ( unsigned int  idx) const
inlineinherited

doc me

template<int dim, int dimworld, typename T >
void PSurfaceMerge< dim, dimworld, T >::setSurfaceDirections ( const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > *  domainDirections,
const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > *  targetDirections 
)
inline

Set surface direction functions.

The matching of the geometries offers the possibility to specify a function for the exact evaluation of domain surface normals. If no such function is specified (default) normals are interpolated.

Parameters
domainDirectionsthe new function for the outer normal of grid0 (domain) (or NULL to unset the function)
targetDirectionsthe new function for the outer normal of grid1 (domain) (or NULL to unset the function)
template<int dim, int dimworld, typename T >
void PSurfaceMerge< dim, dimworld, T >::setSurfaceDirections ( std::shared_ptr< const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > >  domainDirections,
std::shared_ptr< const PSURFACE_NAMESPACE DirectionFunction< psurfaceDimworld, ctype > >  targetDirections 
)
inline
bool Merger< T , grid1Dim, grid2Dim, dimworld >::simplexRefined ( unsigned int  idx,
std::vector< unsigned int > &  indices 
) const
inlineinherited

get the merged grid simplices refining a given grid-n simplex

Template Parameters
nspecify which grid (grid1/grid2: 0/1)
Parameters
idxindex of grid-n simplex
indiceswill be resized first and then filled with the refining simplices
Returns
TRUE <=> given simplex could be matched and is part of the merged grid

Member Data Documentation

unsigned int 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


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