#include <intersection.hh>
Template parameters are:
GridImp
Type that is a model of Dune::GridIntersectionImp
Class template that is a model of Dune::Intersection
Intersections are codimension 1 objects. These intersections are accessed via an Intersection. This allows the implementation of non-matching grids, as one face can now consist of several intersections. In a conforming mesh such an intersection corresponds to an entity of codimension 1 but in the general non-conforming case there will be no entity in the mesh that directly corresponds to the intersection. Thus, the Intersection describes these intersections implicitly.
The Intersection class template wraps an object of type IntersectionImp and forwards all member function calls to corresponding members of this class. In that sense Intersection defines the interface and IntersectionImp supplies the implementation.
The following holds for both the level and the leaf intersection : The intersection is started on a codimension 0 entity of the grid. If this entity belongs to the interior or the overlap region (see. ???) then the union of all intersections is identical to the boundary of the entity. On ghost elements the only stops on the border of the domain, i.e., only on the intersections with entities in the interior region. Depending on the boolean values returned by the methods boundary() and neighbor() one can detect the position of an intersection relative to the boundary. In general the method boundary() returns true if and only if the intersection is part of the physical boundary of the domain. The method neighbor() returns true only if the method outside() has a well defined return value.
The following cases are possible if the intersection is started on an entity in the interior or overlap region. More details are given below:
intersection | neighbor() | boundary() | outside() | |
1 | with inner, overlap or ghost entity | true | false | the neighbor entity |
2 | on domain boundary | false | true | undefined |
3 | on periodic boundary | true | true | Ghost-/Overlap cell (with transformed geometry) |
4 | on processor boundary | false if grid has no ghosts true otherwise | false | ghost entity (if it exists) |
The method intersectionGlobal returns a geometry mapping the intersection as a codim one structure to global coordinates. The methods intersectionSelfLocal and intersectionNeighborLocal return geometries mapping the intersection into the reference elements of the originating entity and the neighboring entity, respectively. The numberInSelf and numberInNeighbor methods return the codim one subentities which contain the intersection.
Public Types | |
enum | { dimension = dim } |
Export grid dimension. More... | |
enum | { dimensionworld = dimworld } |
Export dimension of world. More... | |
typedef GridImp::template Codim< 0 >::Entity | Entity |
Type of entity that this Intersection belongs to. | |
typedef GridImp::template Codim< 0 >::EntityPointer | EntityPointer |
Pointer to the type of entities that this Intersection belongs to. | |
typedef GridImp::template Codim< 1 >::Geometry | Geometry |
Codim 1 geometry returned by intersectionGlobal(). | |
typedef GridImp::template Codim< 1 >::LocalGeometry | LocalGeometry |
Codim 1 geometry returned by intersectionSelfLocal() and intersectionNeighborLocal(). | |
typedef GridImp::ctype | ctype |
define type used for coordinates in grid module | |
Public Member Functions | |
bool | boundary () const |
return true if intersection is with interior or exterior boundary (see the cases above) | |
int | boundaryId () const |
Identifier for boundary segment from macro grid. | |
bool | neighbor () const |
return true if intersection is shared with another element. | |
EntityPointer | inside () const |
return EntityPointer to the Entity on the inside of this intersection. That is the Entity where we started this . | |
EntityPointer | outside () const |
return EntityPointer to the Entity on the outside of this intersection. That is the neighboring Entity. | |
bool | conforming () const |
return true if intersection is conform. | |
const LocalGeometry & | intersectionSelfLocal () const |
geometrical information about this intersection in local coordinates of the inside() entity. | |
const LocalGeometry & | intersectionNeighborLocal () const |
geometrical information about this intersection in local coordinates of the outside() entity. | |
const Geometry & | intersectionGlobal () const |
geometrical information about this intersection in global coordinates. | |
GeometryType | type () const |
obtain the type of reference element for this intersection | |
int | numberInSelf () const |
Local number of codim 1 entity in the inside() Entity where intersection is contained in. | |
int | numberInNeighbor () const |
Local number of codim 1 entity in outside() Entity where intersection is contained in. | |
FieldVector< ctype, dimworld > | outerNormal (const FieldVector< ctype, dim-1 > &local) const |
Return an outer normal (length not necessarily 1). | |
FieldVector< ctype, dimworld > | integrationOuterNormal (const FieldVector< ctype, dim-1 > &local) const |
return outer normal scaled with the integration element | |
FieldVector< ctype, dimworld > | unitOuterNormal (const FieldVector< ctype, dim-1 > &local) const |
Return unit outer normal (length == 1). | |
Implementor interface | |
Intersection (const IntersectionImp< const GridImp > &i) | |
Intersection (const Intersection &i) | |
Protected Member Functions | |
ImplementationType & | getRealImp () |
return reference to the real implementation | |
const ImplementationType & | getRealImp () const |
return reference to the real implementation |
anonymous enum |
anonymous enum |
Dune::Intersection< GridImp, IntersectionImp >::Intersection | ( | const IntersectionImp< const GridImp > & | i | ) | [inline] |
Copy Constructor from IntersectionImp
Dune::Intersection< GridImp, IntersectionImp >::Intersection | ( | const Intersection< GridImp, IntersectionImp > & | i | ) | [inline] |
Copy constructor
int Dune::Intersection< GridImp, IntersectionImp >::boundaryId | ( | ) | const [inline] |
Identifier for boundary segment from macro grid.
One can attach a boundary Id to a boundary segment on the macro grid. This Id will also be used for all fragments of these boundary segments.
The numbering is defined as:
The way the Identifiers are attached to the grid may differ between the different grid implementations.
EntityPointer Dune::Intersection< GridImp, IntersectionImp >::outside | ( | ) | const [inline] |
return EntityPointer to the Entity on the outside of this intersection. That is the neighboring Entity.
bool Dune::Intersection< GridImp, IntersectionImp >::conforming | ( | ) | const [inline] |
return true if intersection is conform.
This method returns true, if
inside()->entity<1>(numberInSelf()) == outside()->entity<1>(numberInNeighbor()) || boundary()
const LocalGeometry& Dune::Intersection< GridImp, IntersectionImp >::intersectionSelfLocal | ( | ) | const [inline] |
const LocalGeometry& Dune::Intersection< GridImp, IntersectionImp >::intersectionNeighborLocal | ( | ) | const [inline] |
const Geometry& Dune::Intersection< GridImp, IntersectionImp >::intersectionGlobal | ( | ) | const [inline] |
geometrical information about this intersection in global coordinates.
This method returns a Geometry object that provides a mapping from local coordinates of the intersection to global (world) coordinates.
FieldVector<ctype, dimworld> Dune::Intersection< GridImp, IntersectionImp >::outerNormal | ( | const FieldVector< ctype, dim-1 > & | local | ) | const [inline] |
Return an outer normal (length not necessarily 1).
The returned vector may depend on local position within the intersection.
FieldVector<ctype, dimworld> Dune::Intersection< GridImp, IntersectionImp >::integrationOuterNormal | ( | const FieldVector< ctype, dim-1 > & | local | ) | const [inline] |
return outer normal scaled with the integration element
Return an outer normal (length not necessarily 1).
The returned vector may depend on local position within the intersection. The normal is scaled with the integration element of the intersection. This method is redundant but it may be more efficent to use this function rather than computing the integration element via intersectionGlobal().
FieldVector<ctype, dimworld> Dune::Intersection< GridImp, IntersectionImp >::unitOuterNormal | ( | const FieldVector< ctype, dim-1 > & | local | ) | const [inline] |
Return unit outer normal (length == 1).
The returned vector may depend on the local position within the intersection. It is scaled to have unit length.