Dune-Fufem 2.11-git
Loading...
Searching...
No Matches

Encapsulate a part of a grid boundary. More...

#include <dune/fufem/boundarypatch.hh>

Inheritance diagram for BoundaryPatch< GV >:
Inheritance graph

Public Types

using iterator = typename Base::iterator
 
using GridView = GV
 

Public Member Functions

 BoundaryPatch (const GridView &gridView, bool initialValue=false)
 Constructor for a given grid view.
 
template<int blocksize>
 BoundaryPatch (const GridView &gridView, const Dune::BitSetVector< blocksize > &vertices)
 Construct boundary patch from given vertices.
 
 BoundaryPatch ()=default
 
 BoundaryPatch (const BoundaryPatch &)=default
 
 BoundaryPatch (BoundaryPatch &&)=default
 
BoundaryPatchoperator= (const BoundaryPatch &)=default
 
BoundaryPatchoperator= (BoundaryPatch &&)=default
 
void setup (const GridView &gridView, bool insertAllBoundaryFaces=false)
 Setup for a given grid view.
 
template<int blocksize>
void setup (const GridView &gridView, const Dune::BitSetVector< blocksize > &vertices)
 Setup for a given grid view and a bitfield.
 
void clear ()
 Clear the boundary patch, but don't disconnect it from the GridView.
 
void getFaces (Dune::BitSetVector< 1 > &faces) const
 
int numFaces () const
 Returns the number of faces in the surface.
 
void addFace (const IntersectionIterator &nIt)
 Add a boundary face to the patch.
 
void addFace (const Intersection &nIt)
 Add a boundary face to the patch.
 
void addFace (const Element &en, int fIdx)
 Add a boundary face to the patch.
 
template<class InsertionProperty >
void insertFacesByProperty (const InsertionProperty &property)
 Insert boundary faces filtered by an insertion property.
 
bool contains (const IntersectionIterator &nIt) const
 Return true if the BoundaryPatch contains a certain boundary face.
 
bool containsVertex (size_t v) const
 
GridView::Grid::ctype area () const
 Returns the area of the boundary patch.
 
void getVertices (Dune::BitSetVector< 1 > &vertices) const
 
const Dune::BitSetVector< 1 > * getVertices () const
 
void getPatchBoundaryVertices (Dune::BitSetVector< 1 > &patchBoundary) const
 Get the vertices which are on the boundary of the boundary patch.
 
void getPatchBoundaryEdges (Dune::BitSetVector< 1 > &patchBoundaryEdges) const
 Get the edges which are on the boundary of the boundary patch.
 
int numVertices () const
 Returns the number of vertices in the surface.
 
void getNormals (std::vector< Dune::FieldVector< double, dim > > &normals) const
 Return vertex unit normals.
 
std::vector< Dune::FieldVector< double, dim > > getNormals () const
 Return vertex unit normals.
 
std::vector< Dune::FieldVector< double, dim > > getLocalNormals () const
 Return vertex unit normals corr. to local indices.
 
void makeGlobalToLocal (std::vector< int > &globalToLocal) const
 
std::vector< int > makeGlobalToLocal () const
 
BoundaryPatch< GridViewaddPatch (const BoundaryPatch< GridView > &patch)
 Adds another patch in the sense that afterwards this patch contains all the vertices included in any one of the two patches.
 
BoundaryPatch< GridViewintersect (const BoundaryPatch< GridView > &patch)
 Determines the overlap of this boundary patch and another by reducing this patch to the common vertices.
 
void setGridView (const GridView &gridView)
 Set the grid view and initialize the patch.
 
void insertFace (const Element &element, int faceIndex)
 Insert a boundary face into the patch.
 
void insertFace (const Intersection &intersection)
 Insert a boundary face into the patch.
 
iterator begin () const
 Return iterator pointing to first boundary patch face.
 
iterator end () const
 Return iterator pointing after last boundary patch face.
 
std::size_t size () const
 Returns the number of faces in the surface.
 
bool contains (const Element &element, int faceIndex) const
 Return true if the BoundaryPatch contains a certain boundary face.
 
template<class IntersectionType >
bool contains (const IntersectionType &intersection) const
 Return true if the BoundaryPatch contains a certain boundary face.
 
bool contains (const Element &element, int subEntity, int codim) const
 Return true if the BoundaryPatch contains a certain subentity in some face.
 
bool containsFaceOf (const Element &e) const
 Return true if the BoundaryPatch contains a face of given element.
 
const GridViewgridView () const
 Return reference to the carrier grid view.
 
bool isInitialized () const
 Check if BoundaryPatch is initialized.
 
bool operator== (const BoundaryPatch &other) const
 Compare with another BoundaryPatch on the same GridView.
 

Protected Types

using Base = typename Dune::Fufem::BoundaryPatch< GV >
 
using Element = typename Base::Element
 
using Intersection = typename Base::Intersection
 
using IntersectionIterator = typename GV::IntersectionIterator
 
using Mapper = typename Dune::MultipleCodimMultipleGeomTypeMapper< GV >
 

Protected Member Functions

void makeVertices () const
 

Protected Attributes

Dune::BitSetVector< 1 > vertices_
 
bool verticesAreUpToDate_ = false
 
Dune::BitSetVector< 1 > faces_
 
std::optional< GridViewgridView_
 
std::optional< Mappermapper_
 

Static Protected Attributes

static const int dim = GV::dimension
 

Detailed Description

template<class GV>
class BoundaryPatch< GV >

Encapsulate a part of a grid boundary.

Template Parameters
GridViewThe grid view on which this boundary patch lives

Member Typedef Documentation

◆ Base

template<class GV >
using BoundaryPatch< GV >::Base = typename Dune::Fufem::BoundaryPatch<GV>
protected

◆ Element

template<class GV >
using BoundaryPatch< GV >::Element = typename Base::Element
protected

◆ GridView

template<class GV >
using BoundaryPatch< GV >::GridView = GV

◆ Intersection

template<class GV >
using BoundaryPatch< GV >::Intersection = typename Base::Intersection
protected

◆ IntersectionIterator

template<class GV >
using BoundaryPatch< GV >::IntersectionIterator = typename GV::IntersectionIterator
protected

◆ iterator

template<class GV >
using BoundaryPatch< GV >::iterator = typename Base::iterator

◆ Mapper

template<class GV >
using Dune::Fufem::BoundaryPatch< GV >::Mapper = typename Dune::MultipleCodimMultipleGeomTypeMapper<GV>
protectedinherited

Constructor & Destructor Documentation

◆ BoundaryPatch() [1/5]

template<class GV >
BoundaryPatch< GV >::BoundaryPatch ( const GridView gridView,
bool  initialValue = false 
)
inline

Constructor for a given grid view.

Parameters
gridViewThe grid view
initialValueIf true: BoundaryPatch contains all boundary faces

◆ BoundaryPatch() [2/5]

template<class GV >
template<int blocksize>
BoundaryPatch< GV >::BoundaryPatch ( const GridView gridView,
const Dune::BitSetVector< blocksize > &  vertices 
)
inline

Construct boundary patch from given vertices.

Parameters
gridViewThe grid view
verticesA vector of which any bit component is set if the corresponding vertex belongs to the patch.

◆ BoundaryPatch() [3/5]

template<class GV >
BoundaryPatch< GV >::BoundaryPatch ( )
default

◆ BoundaryPatch() [4/5]

template<class GV >
BoundaryPatch< GV >::BoundaryPatch ( const BoundaryPatch< GV > &  )
default

◆ BoundaryPatch() [5/5]

template<class GV >
BoundaryPatch< GV >::BoundaryPatch ( BoundaryPatch< GV > &&  )
default

Member Function Documentation

◆ addFace() [1/3]

template<class GV >
void BoundaryPatch< GV >::addFace ( const Element en,
int  fIdx 
)
inline

Add a boundary face to the patch.

◆ addFace() [2/3]

template<class GV >
void BoundaryPatch< GV >::addFace ( const Intersection nIt)
inline

Add a boundary face to the patch.

◆ addFace() [3/3]

template<class GV >
void BoundaryPatch< GV >::addFace ( const IntersectionIterator nIt)
inline

Add a boundary face to the patch.

◆ addPatch()

template<class GV >
BoundaryPatch< GridView > BoundaryPatch< GV >::addPatch ( const BoundaryPatch< GridView > &  patch)
inline

Adds another patch in the sense that afterwards this patch contains all the vertices included in any one of the two patches.

Parameters
patchPatch to be added

◆ area()

template<class GV >
GridView::Grid::ctype BoundaryPatch< GV >::area ( ) const
inline

Returns the area of the boundary patch.

◆ begin()

template<class GV >
iterator Dune::Fufem::BoundaryPatch< GV >::begin ( ) const
inlineinherited

Return iterator pointing to first boundary patch face.

◆ clear()

template<class GV >
void BoundaryPatch< GV >::clear ( )
inline

Clear the boundary patch, but don't disconnect it from the GridView.

◆ contains() [1/4]

template<class GV >
bool Dune::Fufem::BoundaryPatch< GV >::contains ( const Element element,
int  faceIndex 
) const
inlineinherited

Return true if the BoundaryPatch contains a certain boundary face.

The behaviour is undefined, if element is not contained in the underlying GridView.

◆ contains() [2/4]

template<class GV >
bool Dune::Fufem::BoundaryPatch< GV >::contains ( const Element element,
int  subEntity,
int  codim 
) const
inlineinherited

Return true if the BoundaryPatch contains a certain subentity in some face.

The behaviour is undefined, if element is not contained in the underlying GridView.

◆ contains() [3/4]

template<class GV >
bool BoundaryPatch< GV >::contains ( const IntersectionIterator nIt) const
inline

Return true if the BoundaryPatch contains a certain boundary face.

◆ contains() [4/4]

template<class GV >
template<class IntersectionType >
bool Dune::Fufem::BoundaryPatch< GV >::contains ( const IntersectionType &  intersection) const
inlineinherited

Return true if the BoundaryPatch contains a certain boundary face.

The behaviour is undefined, if intersection.inside() is not contained in the underlying GridView.

◆ containsFaceOf()

template<class GV >
bool Dune::Fufem::BoundaryPatch< GV >::containsFaceOf ( const Element e) const
inlineinherited

Return true if the BoundaryPatch contains a face of given element.

It is guaranteed that the method returns true if and only if the BoundaryPatch contains at least one face of the element.

◆ containsVertex()

template<class GV >
bool BoundaryPatch< GV >::containsVertex ( size_t  v) const
inline

◆ end()

template<class GV >
iterator Dune::Fufem::BoundaryPatch< GV >::end ( ) const
inlineinherited

Return iterator pointing after last boundary patch face.

◆ getFaces()

template<class GV >
void BoundaryPatch< GV >::getFaces ( Dune::BitSetVector< 1 > &  faces) const
inline

◆ getLocalNormals()

template<class GV >
std::vector< Dune::FieldVector< double, dim > > BoundaryPatch< GV >::getLocalNormals ( ) const
inline

Return vertex unit normals corr. to local indices.

◆ getNormals() [1/2]

template<class GV >
std::vector< Dune::FieldVector< double, dim > > BoundaryPatch< GV >::getNormals ( ) const
inline

Return vertex unit normals.

◆ getNormals() [2/2]

template<class GV >
void BoundaryPatch< GV >::getNormals ( std::vector< Dune::FieldVector< double, dim > > &  normals) const
inline

Return vertex unit normals.

ATTENTION: This will only work correctly if unitOuterNormal is constant along intersections. See the internal documentation for details.

◆ getPatchBoundaryEdges()

template<class GV >
void BoundaryPatch< GV >::getPatchBoundaryEdges ( Dune::BitSetVector< 1 > &  patchBoundaryEdges) const
inline

Get the edges which are on the boundary of the boundary patch.

ATTENTION: Don't use this method, until you're absolutely sure that the internals work correctly for your grid implementation! It does not work for general grids. See the internal documentation for details.

◆ getPatchBoundaryVertices()

template<class GV >
void BoundaryPatch< GV >::getPatchBoundaryVertices ( Dune::BitSetVector< 1 > &  patchBoundary) const
inline

Get the vertices which are on the boundary of the boundary patch.

ATTENTION: Don't use this method, until you're absolutely sure that the internals work correctly for your grid implementation! It does not work for general grids. See the internal documentation for details.

◆ getVertices() [1/2]

template<class GV >
const Dune::BitSetVector< 1 > * BoundaryPatch< GV >::getVertices ( ) const
inline

◆ getVertices() [2/2]

template<class GV >
void BoundaryPatch< GV >::getVertices ( Dune::BitSetVector< 1 > &  vertices) const
inline

◆ gridView()

template<class GV >
const GridView & Dune::Fufem::BoundaryPatch< GV >::gridView ( ) const
inlineinherited

Return reference to the carrier grid view.

◆ insertFace() [1/2]

template<class GV >
void Dune::Fufem::BoundaryPatch< GV >::insertFace ( const Element element,
int  faceIndex 
)
inlineinherited

Insert a boundary face into the patch.

◆ insertFace() [2/2]

template<class GV >
void Dune::Fufem::BoundaryPatch< GV >::insertFace ( const Intersection intersection)
inlineinherited

Insert a boundary face into the patch.

◆ insertFacesByProperty()

template<class GV >
template<class InsertionProperty >
void BoundaryPatch< GV >::insertFacesByProperty ( const InsertionProperty &  property)
inline

Insert boundary faces filtered by an insertion property.

Template Parameters
InsertionPropertya class providing bool operator()(Intersection)
Parameters
propertyAll boundary intersections with property(intersection)==true are inserted

◆ intersect()

template<class GV >
BoundaryPatch< GridView > BoundaryPatch< GV >::intersect ( const BoundaryPatch< GridView > &  patch)
inline

Determines the overlap of this boundary patch and another by reducing this patch to the common vertices.

Parameters
patchPatch to be intersected with

◆ isInitialized()

template<class GV >
bool Dune::Fufem::BoundaryPatch< GV >::isInitialized ( ) const
inlineinherited

Check if BoundaryPatch is initialized.

◆ makeGlobalToLocal() [1/2]

template<class GV >
std::vector< int > BoundaryPatch< GV >::makeGlobalToLocal ( ) const
inline

◆ makeGlobalToLocal() [2/2]

template<class GV >
void BoundaryPatch< GV >::makeGlobalToLocal ( std::vector< int > &  globalToLocal) const
inline

◆ makeVertices()

template<class GV >
void BoundaryPatch< GV >::makeVertices ( ) const
inlineprotected

◆ numFaces()

template<class GV >
int BoundaryPatch< GV >::numFaces ( ) const
inline

Returns the number of faces in the surface.

◆ numVertices()

template<class GV >
int BoundaryPatch< GV >::numVertices ( ) const
inline

Returns the number of vertices in the surface.

◆ operator=() [1/2]

template<class GV >
BoundaryPatch & BoundaryPatch< GV >::operator= ( BoundaryPatch< GV > &&  )
default

◆ operator=() [2/2]

template<class GV >
BoundaryPatch & BoundaryPatch< GV >::operator= ( const BoundaryPatch< GV > &  )
default

◆ operator==()

template<class GV >
bool Dune::Fufem::BoundaryPatch< GV >::operator== ( const BoundaryPatch< GV > &  other) const
inlineinherited

Compare with another BoundaryPatch on the same GridView.

The result behavior is undefined, if the patches live on different GridViews.

◆ setGridView()

template<class GV >
void Dune::Fufem::BoundaryPatch< GV >::setGridView ( const GridView gridView)
inlineinherited

Set the grid view and initialize the patch.

◆ setup() [1/2]

template<class GV >
void BoundaryPatch< GV >::setup ( const GridView gridView,
bool  insertAllBoundaryFaces = false 
)
inline

Setup for a given grid view.

Parameters
gridViewThe grid view
insertAllBoundaryFacesIf true: BoundaryPatch contains all boundary faces

◆ setup() [2/2]

template<class GV >
template<int blocksize>
void BoundaryPatch< GV >::setup ( const GridView gridView,
const Dune::BitSetVector< blocksize > &  vertices 
)
inline

Setup for a given grid view and a bitfield.

Parameters
gridViewThe grid view
verticesA vector of which any bit component is set if the corresponding vertex belongs to the patch.

◆ size()

template<class GV >
std::size_t Dune::Fufem::BoundaryPatch< GV >::size ( ) const
inlineinherited

Returns the number of faces in the surface.

Member Data Documentation

◆ dim

template<class GV >
const int Dune::Fufem::BoundaryPatch< GV >::dim = GV::dimension
staticprotectedinherited

◆ faces_

template<class GV >
Dune::BitSetVector<1> Dune::Fufem::BoundaryPatch< GV >::faces_
protectedinherited

◆ gridView_

template<class GV >
std::optional<GridView> Dune::Fufem::BoundaryPatch< GV >::gridView_
protectedinherited

◆ mapper_

template<class GV >
std::optional<Mapper> Dune::Fufem::BoundaryPatch< GV >::mapper_
protectedinherited

◆ vertices_

template<class GV >
Dune::BitSetVector<1> BoundaryPatch< GV >::vertices_
mutableprotected

◆ verticesAreUpToDate_

template<class GV >
bool BoundaryPatch< GV >::verticesAreUpToDate_ = false
mutableprotected

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