dune-grid-glue  2.7.0
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Dune::GridGlue::ConformingMerge< dim, dimworld, T > Class Template Referenceabstract

Implementation of the Merger concept for conforming interfaces. More...

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

Inheritance diagram for Dune::GridGlue::ConformingMerge< 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...
 
using Grid1Coords = typename Base::Grid1Coords
 Type used for local coordinates on the grid1 side. More...
 
using Grid2Coords = typename Base::Grid2Coords
 Type used for local coordinates on the grid2 side. More...
 
using IntersectionList = typename Base::IntersectionList
 

Public Member Functions

 ConformingMerge (T tolerance=default_tolerance)
 
void build (const std::vector< Dune::FieldVector< double, dimworld > > &grid1_Coords, const std::vector< unsigned int > &grid1_elements, const std::vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< double, dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, const std::vector< Dune::GeometryType > &grid2_element_types) override
 builds the merged grid More...
 
virtual 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)=0
 builds the merged grid More...
 
void clear () override
 
std::shared_ptr< IntersectionListintersectionList () const final
 
void enableFallback (bool fallback)
 
void enableBruteForce (bool bruteForce)
 
unsigned int nSimplices () const
 get the number of simplices in the merged grid The indices are then in 0..nSimplices()-1 More...
 
template<int n>
unsigned int parents (unsigned int idx) const
 
template<int n>
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...
 
template<int n>
auto 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...
 

Static Public Attributes

static constexpr T default_tolerance = 1e-4
 

Protected Types

using IntersectionListProvider = SimplicialIntersectionListProvider< grid1Dim, grid2Dim >
 The computed intersections. More...
 
using RemoteSimplicialIntersection = SimplicialIntersection
 

Protected Member Functions

virtual void computeIntersections (const Dune::GeometryType &grid1ElementType, const std::vector< Dune::FieldVector< double, dimworld > > &grid1ElementCorners, std::bitset<(1<< grid1Dim)> &neighborIntersects1, unsigned int grid1Index, const Dune::GeometryType &grid2ElementType, const std::vector< Dune::FieldVector< double, dimworld > > &grid2ElementCorners, std::bitset<(1<< grid2Dim)> &neighborIntersects2, unsigned int grid2Index, std::vector< SimplicialIntersection > &intersections)=0
 Compute the intersection between two overlapping elements. More...
 
bool computeIntersection (unsigned int candidate0, unsigned int candidate1, const std::vector< Dune::FieldVector< double, dimworld > > &grid1Coords, const std::vector< Dune::GeometryType > &grid1_element_types, std::bitset<(1<< grid1Dim)> &neighborIntersects1, const std::vector< Dune::FieldVector< double, dimworld > > &grid2Coords, const std::vector< Dune::GeometryType > &grid2_element_types, std::bitset<(1<< grid2Dim)> &neighborIntersects2, bool insert=true)
 Compute the intersection between two overlapping elements. More...
 

Protected Attributes

bool valid
 
std::shared_ptr< IntersectionListProviderintersectionListProvider_
 
std::shared_ptr< IntersectionListintersectionList_
 
std::vector< std::vector< unsigned int > > grid1ElementCorners_
 Temporary internal data. More...
 
std::vector< std::vector< unsigned int > > grid2ElementCorners_
 
std::vector< std::vector< int > > elementNeighbors1_
 
std::vector< std::vector< int > > elementNeighbors2_
 

Detailed Description

template<int dim, int dimworld, typename T = double>
class Dune::GridGlue::ConformingMerge< dim, dimworld, T >

Implementation of the Merger concept for conforming interfaces.

Template Parameters
dimGrid dimension of the coupling grids. Must be the same for both sides
dimworldDimension of the world coordinates.
TType used for coordinates

Member Typedef Documentation

◆ ctype

template<int dim, int dimworld, typename T = double>
typedef T Dune::GridGlue::ConformingMerge< dim, dimworld, T >::ctype

the numeric type used in this interface

◆ Grid1Coords

using Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::Grid1Coords = typename Base::Grid1Coords
inherited

Type used for local coordinates on the grid1 side.

◆ Grid2Coords

using Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::Grid2Coords = typename Base::Grid2Coords
inherited

Type used for local coordinates on the grid2 side.

◆ IntersectionList

using Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::IntersectionList = typename Base::IntersectionList
inherited

◆ IntersectionListProvider

using Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::IntersectionListProvider = SimplicialIntersectionListProvider<grid1Dim, grid2Dim>
protectedinherited

The computed intersections.

◆ LocalCoords

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

the coordinate type used in this interface

◆ RemoteSimplicialIntersection

using Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::RemoteSimplicialIntersection = SimplicialIntersection
protectedinherited

◆ WorldCoords

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

the coordinate type used in this interface

Constructor & Destructor Documentation

◆ ConformingMerge()

template<int dim, int dimworld, typename T = double>
Dune::GridGlue::ConformingMerge< dim, dimworld, T >::ConformingMerge ( tolerance = default_tolerance)
inline

Member Function Documentation

◆ build() [1/2]

template<class ctype , int grid1Dim, int grid2Dim, int dimworld>
virtual void Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >::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 
)
pure virtualinherited

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

Implemented in Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >.

◆ build() [2/2]

void Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::build ( const std::vector< Dune::FieldVector< double , dimworld > > &  grid1_Coords,
const std::vector< unsigned int > &  grid1_elements,
const std::vector< Dune::GeometryType > &  grid1_element_types,
const std::vector< Dune::FieldVector< double , dimworld > > &  grid2_coords,
const std::vector< unsigned int > &  grid2_elements,
const std::vector< Dune::GeometryType > &  grid2_element_types 
)
overrideinherited

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

◆ clear()

void Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::clear ( )
inlineoverridevirtualinherited

◆ computeIntersection()

bool Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::computeIntersection ( unsigned int  candidate0,
unsigned int  candidate1,
const std::vector< Dune::FieldVector< double , dimworld > > &  grid1Coords,
const std::vector< Dune::GeometryType > &  grid1_element_types,
std::bitset<(1<< grid1Dim)> &  neighborIntersects1,
const std::vector< Dune::FieldVector< double , dimworld > > &  grid2Coords,
const std::vector< Dune::GeometryType > &  grid2_element_types,
std::bitset<(1<< grid2Dim)> &  neighborIntersects2,
bool  insert = true 
)
protectedinherited

Compute the intersection between two overlapping elements.

Returns
true if at least one intersection point was found

◆ computeIntersections()

virtual void Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::computeIntersections ( const Dune::GeometryType &  grid1ElementType,
const std::vector< Dune::FieldVector< double , dimworld > > &  grid1ElementCorners,
std::bitset<(1<< grid1Dim)> &  neighborIntersects1,
unsigned int  grid1Index,
const Dune::GeometryType &  grid2ElementType,
const std::vector< Dune::FieldVector< double , dimworld > > &  grid2ElementCorners,
std::bitset<(1<< grid2Dim)> &  neighborIntersects2,
unsigned int  grid2Index,
std::vector< SimplicialIntersection > &  intersections 
)
protectedpure virtualinherited

Compute the intersection between two overlapping elements.

The result is a set of simplices stored in the vector intersections.

◆ enableBruteForce()

void Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::enableBruteForce ( bool  bruteForce)
inlineinherited

◆ enableFallback()

void Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::enableFallback ( bool  fallback)
inlineinherited

◆ intersectionList()

std::shared_ptr<IntersectionList> Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::intersectionList ( ) const
inlinefinalvirtualinherited

list of intersections

Note
only valid after build() was called

Implements Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >.

◆ nSimplices()

template<class ctype , int grid1Dim, int grid2Dim, int dimworld>
unsigned int Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >::nSimplices ( ) const
inlineinherited

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

◆ parent()

template<class ctype , int grid1Dim, int grid2Dim, int dimworld>
template<int n>
unsigned int Dune::GridGlue::Merger< ctype, 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

◆ parentLocal()

template<class ctype , int grid1Dim, int grid2Dim, int dimworld>
template<int n>
auto Dune::GridGlue::Merger< ctype, 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

◆ parents()

template<class ctype , int grid1Dim, int grid2Dim, int dimworld>
template<int n>
unsigned int Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >::parents ( unsigned int  idx) const
inlineinherited

doc me

Member Data Documentation

◆ counter

template<class ctype , int grid1Dim, int grid2Dim, int dimworld>
unsigned int Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >::counter
inherited

Counts the number of times the computeIntersection method has been called.

Used temporarily to speed up the implementation

◆ default_tolerance

template<int dim, int dimworld, typename T >
constexpr T Dune::GridGlue::ConformingMerge< dim, dimworld, T >::default_tolerance = 1e-4
staticconstexpr

◆ elementNeighbors1_

std::vector<std::vector<int> > Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::elementNeighbors1_
protectedinherited

◆ elementNeighbors2_

std::vector<std::vector<int> > Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::elementNeighbors2_
protectedinherited

◆ grid1ElementCorners_

std::vector<std::vector<unsigned int> > Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::grid1ElementCorners_
protectedinherited

Temporary internal data.

◆ grid2ElementCorners_

std::vector<std::vector<unsigned int> > Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::grid2ElementCorners_
protectedinherited

◆ intersectionList_

std::shared_ptr<IntersectionList> Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::intersectionList_
protectedinherited

◆ intersectionListProvider_

std::shared_ptr<IntersectionListProvider> Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::intersectionListProvider_
protectedinherited

◆ valid

bool Dune::GridGlue::StandardMerge< double , grid1Dim, grid2Dim, dimworld >::valid
protectedinherited

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