Loading...
Searching...
No Matches
Dune::GridGlue::ContactMerge< dimworld, T > Class Template Referenceabstract

Merge two codimension-1 surfaces that may be a positive distance apart. More...

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

Inheritance diagram for Dune::GridGlue::ContactMerge< dimworld, T >:

## Public Types

enum | ProjectionType { OUTER_NORMAL , CLOSEST_POINT }
| Type of the projection, closest point or outer normal projection. More...
typedef T | ctype
| the numeric type used in this interface
typedef Dune::FieldVector< T, dimworld > | WorldCoords
| the coordinate type used in this interface
typedef Dune::FieldVector< T, dim > | LocalCoords
| the coordinate type used in this interface
using | Grid1Coords
| Type used for local coordinates on the grid1 side.
using | Grid2Coords
| Type used for local coordinates on the grid2 side.
using | IntersectionList

## Public Member Functions

| ContactMerge (const T allowedOverlap=T(0), std::function< WorldCoords(WorldCoords)> domainDirections=nullptr, std::function< WorldCoords(WorldCoords)> targetDirections=nullptr, ProjectionType type=OUTER_NORMAL)
| Construct merger given overlap and possible projection directions.
| ContactMerge (const T allowedOverlap, ProjectionType type)
| Construct merger given overlap and type of the projection.
void | setSurfaceDirections (std::function< WorldCoords(WorldCoords)> domainDirections, std::function< WorldCoords(WorldCoords)> targetDirections)
| Set surface direction functions.
void | setOverlap (T overlap)
| Set the allowed overlap of the surfaces.
T | getOverlap () const
| Get the allowed overlap of the surfaces.
void | minNormalAngle (T angle)
| set minimum angle in radians between normals at `x` and `Φ(x)`
T | minNormalAngle () const
| get minimum angle in radians between normals at `x` and `Φ(x)`
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
virtual 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)=0
| builds the merged grid
void | clear () override
std::shared_ptr< IntersectionList > | intersectionList () 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
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
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>")

## Public Attributes

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

## Protected Types

typedef StandardMerge< T, dimworld-1, dimworld-1, dimworld >::SimplicialIntersection | SimplicialIntersection
using | IntersectionListProvider
| The computed intersections.
using | RemoteSimplicialIntersection

## Protected Member Functions

void | build (const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, const std::vector< unsigned int > &grid1Elements, const std::vector< Dune::GeometryType > &grid1ElementTypes, const std::vector< Dune::FieldVector< T, dimworld > > &grid2Coords, const std::vector< unsigned int > &grid2Elements, const std::vector< Dune::GeometryType > &grid2ElementTypes) override
| builds the merged grid
void | computeCyclicOrder (const std::vector< std::array< LocalCoords, 2 > > &polytopeCorners, const LocalCoords &center, std::vector< int > &ordering) const
| Order the corners of the intersection polytope in cyclic order.
void | setupNodalDirections (const std::vector< WorldCoords > &coords1, const std::vector< unsigned int > &elements1, const std::vector< Dune::GeometryType > &elementTypes1, const std::vector< WorldCoords > &coords2, const std::vector< unsigned int > &elements2, const std::vector< Dune::GeometryType > &elementTypes2)
| Setup the direction vectors containing the directions for each vertex.
void | computeOuterNormalField (const std::vector< WorldCoords > &coords, const std::vector< unsigned int > &elements, const std::vector< Dune::GeometryType > &elementTypes, std::vector< WorldCoords > &normals)
| If no direction field was specified compute the outer normal field.
void | removeDoubles (std::vector< std::array< LocalCoords, 2 > > &polytopeCorners)
| Remove all multiples.

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.

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.

## Protected Attributes

bool | valid
std::shared_ptr< IntersectionListProvider > | intersectionListProvider_
std::shared_ptr< IntersectionList > | intersectionList_
std::vector< std::vector< unsigned int > > | grid1ElementCorners_
| Temporary internal data.
std::vector< std::vector< unsigned int > > | grid2ElementCorners_
std::vector< std::vector< int > > | elementNeighbors1_
std::vector< std::vector< int > > | elementNeighbors2_

## Detailed Description

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

Merge two codimension-1 surfaces that may be a positive distance apart.

Template Parameters

  dimworld | Dimension of the world coordinates.
  T | Type used for coordinates

## Member Typedef Documentation

## ctype

template<int dimworld, typename T = double>

typedef T Dune::GridGlue::ContactMerge< dimworld, T >::ctype

the numeric type used in this interface

## Grid1Coords

using Dune::GridGlue::StandardMerge< double, grid1Dim, grid2Dim, dimworld >::Grid1Coords

inherited

Type used for local coordinates on the grid1 side.

## Grid2Coords

using Dune::GridGlue::StandardMerge< double, grid1Dim, grid2Dim, dimworld >::Grid2Coords

inherited

Type used for local coordinates on the grid2 side.

## IntersectionList

using Dune::GridGlue::StandardMerge< double, grid1Dim, grid2Dim, dimworld >::IntersectionList

inherited

## IntersectionListProvider

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

protected inherited

The computed intersections.

## LocalCoords

template<int dimworld, typename T = double>

typedef Dune::FieldVector<T, dim> Dune::GridGlue::ContactMerge< dimworld, T >::LocalCoords

the coordinate type used in this interface

## RemoteSimplicialIntersection

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

protected inherited

## SimplicialIntersection

template<int dimworld, typename T = double>

typedef StandardMerge<T,dimworld-1,dimworld-1,dimworld>::SimplicialIntersection Dune::GridGlue::ContactMerge< dimworld, T >::SimplicialIntersection

protected

## WorldCoords

template<int dimworld, typename T = double>

typedef Dune::FieldVector<T, dimworld> Dune::GridGlue::ContactMerge< dimworld, T >::WorldCoords

the coordinate type used in this interface

## Member Enumeration Documentation

## ProjectionType

template<int dimworld, typename T = double>

enum Dune::GridGlue::ContactMerge::ProjectionType

Type of the projection, closest point or outer normal projection.

Enumerator
OUTER_NORMAL |
CLOSEST_POINT |

## Constructor & Destructor Documentation

## ContactMerge() [1/2]

template<int dimworld, typename T = double>

Dune::GridGlue::ContactMerge< dimworld, T >::ContactMerge | ( | const T | allowedOverlap = T(0),
|  | std::function< WorldCoords(WorldCoords)> | domainDirections = nullptr,
|  | std::function< WorldCoords(WorldCoords)> | targetDirections = nullptr,
|  | ProjectionType | type = OUTER_NORMAL )

inline

Construct merger given overlap and possible projection directions.

Parameters

  allowedOverlap | Allowed overlap of the surfaces
  domainDirections | Projection direction field for the first surface that differ from the default normal field
  targetDirections | Projection direction field for the second surface that differ from the default normal field

## ContactMerge() [2/2]

template<int dimworld, typename T = double>

Dune::GridGlue::ContactMerge< dimworld, T >::ContactMerge | ( | const T | allowedOverlap,
|  | ProjectionType | type )

inline

Construct merger given overlap and type of the projection.

Parameters

  allowedOverlap | Allowed overlap of the surfacs
  type | Type of the projection

## Member Function Documentation

## build() [1/3]

template<int dimworld, typename T = double>

void Dune::GridGlue::ContactMerge< dimworld, T >::build | ( | const std::vector< Dune::FieldVector< T, dimworld > > & | grid1Coords,
|  | const std::vector< unsigned int > & | grid1Elements,
|  | const std::vector< Dune::GeometryType > & | grid1ElementTypes,
|  | const std::vector< Dune::FieldVector< T, dimworld > > & | grid2Coords,
|  | const std::vector< unsigned int > & | grid2Elements,
|  | const std::vector< Dune::GeometryType > & | grid2ElementTypes )

inline override protected

builds the merged grid

Note that the indices are used consequently throughout the whole class interface just like they are introduced here.

Parameters

  grid1_coords | the 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_elements | array with all grid1 elements represented as corner indices into `grid1_coords`
  grid1_element_types | array with the GeometryType of the elements listed grid1_elements
  grid2_coords | the 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_elements | just like with the grid1_elements and grid1_coords
  grid2_element_types | array with the GeometryType of the elements listed grid2_elements

## build() [2/3]

virtual void Dune::GridGlue::Merger< 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 )

pure virtual inherited

builds the merged grid

Note that the indices are used consequently throughout the whole class interface just like they are introduced here.

Parameters

  grid1_coords | the 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_elements | array with all grid1 elements represented as corner indices into `grid1_coords`
  grid1_element_types | array with the GeometryType of the elements listed grid1_elements
  grid2_coords | the 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_elements | just like with the grid1_elements and grid1_coords
  grid2_element_types | array with the GeometryType of the elements listed grid2_elements

## build() [3/3]

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 )

override inherited

builds the merged grid

Note that the indices are used consequently throughout the whole class interface just like they are introduced here.

Parameters

  grid1_coords | the 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_elements | array with all grid1 elements represented as corner indices into `grid1_coords`
  grid1_element_types | array with the GeometryType of the elements listed grid1_elements
  grid2_coords | the 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_elements | just like with the grid1_elements and grid1_coords
  grid2_element_types | array with the GeometryType of the elements listed grid2_elements

## clear()

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

inline override virtual inherited

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

## computeCyclicOrder()

template<int dimworld, typename T>

void Dune::GridGlue::ContactMerge< dimworld, T >::computeCyclicOrder | ( | const std::vector< std::array< LocalCoords, 2 > > & | polytopeCorners,
|  | const LocalCoords & | center,
|  | std::vector< int > & | ordering ) const

protected

Order the corners of the intersection polytope in cyclic order.

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

protected inherited

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 )

protected pure virtual inherited

Compute the intersection between two overlapping elements.

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

## computeOuterNormalField()

template<int dimworld, typename T>

void Dune::GridGlue::ContactMerge< dimworld, T >::computeOuterNormalField | ( | const std::vector< WorldCoords > & | coords,
|  | const std::vector< unsigned int > & | elements,
|  | const std::vector< Dune::GeometryType > & | elementTypes,
|  | std::vector< WorldCoords > & | normals )

protected

If no direction field was specified compute the outer normal field.

## enableBruteForce()

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

inline inherited

## enableFallback()

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

inline inherited

## getOverlap()

template<int dimworld, typename T = double>

T Dune::GridGlue::ContactMerge< dimworld, T >::getOverlap | ( |  | ) | const

inline

Get the allowed overlap of the surfaces.

## intersectionList()

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

inline final virtual inherited

list of intersections

Note
  only valid after build() was called

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

## minNormalAngle() [1/2]

template<int dimworld, typename T = double>

T Dune::GridGlue::ContactMerge< dimworld, T >::minNormalAngle | ( |  | ) | const

inline

get minimum angle in radians between normals at `x` and `Φ(x)`

## minNormalAngle() [2/2]

template<int dimworld, typename T = double>

void Dune::GridGlue::ContactMerge< dimworld, T >::minNormalAngle | ( | T | angle | ) |

inline

set minimum angle in radians between normals at `x` and `Φ(x)`

## nSimplices()

unsigned int Dune::GridGlue::Merger< double, grid1Dim, grid2Dim, dimworld >::nSimplices | ( |  | ) | const

inline inherited

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

## parent()

unsigned int Dune::GridGlue::Merger< double, grid1Dim, grid2Dim, dimworld >::parent | ( | unsigned int | idx,
|  | unsigned int | parId = 0 ) const

inline inherited

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

Template Parameters

  n | specify which grid

Parameters

  idx | index of the merged grid simplex

Returns
  index of the parent simplex

## parentLocal()

auto Dune::GridGlue::Merger< double, grid1Dim, grid2Dim, dimworld >::parentLocal | ( | unsigned int | idx,
|  | unsigned int | corner,
|  | unsigned int | parId = 0 ) const

inline inherited

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

  n | specify which grid

Parameters

  idx | the index of the merged grid simplex
  corner | the index of the simplex' corner

Returns
  local coordinates in grid-n grid1

## parents()

unsigned int Dune::GridGlue::Merger< double, grid1Dim, grid2Dim, dimworld >::parents | ( | unsigned int | idx | ) | const

inline inherited

doc me

## removeDoubles()

template<int dimworld, typename T>

void Dune::GridGlue::ContactMerge< dimworld, T >::removeDoubles | ( | std::vector< std::array< LocalCoords, 2 > > & | polytopeCorners | ) |

protected

Remove all multiples.

## setOverlap()

template<int dimworld, typename T = double>

void Dune::GridGlue::ContactMerge< dimworld, T >::setOverlap | ( | T | overlap | ) |

inline

Set the allowed overlap of the surfaces.

## setSurfaceDirections()

template<int dimworld, typename T = double>

void Dune::GridGlue::ContactMerge< dimworld, T >::setSurfaceDirections | ( | std::function< WorldCoords(WorldCoords)> | domainDirections,
|  | std::function< WorldCoords(WorldCoords)> | 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

  value | the new function (or nullptr to unset the function)

## setupNodalDirections()

template<int dimworld, typename T>

void Dune::GridGlue::ContactMerge< dimworld, T >::setupNodalDirections | ( | const std::vector< WorldCoords > & | coords1,
|  | const std::vector< unsigned int > & | elements1,
|  | const std::vector< Dune::GeometryType > & | elementTypes1,
|  | const std::vector< WorldCoords > & | coords2,
|  | const std::vector< unsigned int > & | elements2,
|  | const std::vector< Dune::GeometryType > & | elementTypes2 )

protected

Setup the direction vectors containing the directions for each vertex.

## Member Data Documentation

## counter

unsigned int Dune::GridGlue::Merger< double, grid1Dim, grid2Dim, dimworld >::counter

inherited

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

Used temporarily to speed up the implementation

## elementNeighbors1_

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

protected inherited

## elementNeighbors2_

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

protected inherited

## grid1ElementCorners_

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

protected inherited

Temporary internal data.

## grid2ElementCorners_

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

protected inherited

## intersectionList_

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

protected inherited

## intersectionListProvider_

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

protected inherited

## valid

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

protected inherited

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

- contactmerge.hh
- contactmerge.cc