BEM++
2.0
|
Space of piecewise constant scalar functions. More...
#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/space/piecewise_constant_scalar_space_barycentric.hpp>
Public Member Functions | |
PiecewiseConstantScalarSpaceBarycentric (const shared_ptr< const Grid > &grid) | |
Constructor. More... | |
PiecewiseConstantScalarSpaceBarycentric (const shared_ptr< const Grid > &grid, const GridSegment &segment) | |
Constructor. More... | |
virtual shared_ptr< const Space< BasisFunctionType > > | discontinuousSpace (const shared_ptr< const Space< BasisFunctionType > > &self) const |
Return a shared pointer to an appropriate counterpart to this space, with basis functions extending only over single elements. More... | |
virtual bool | isDiscontinuous () const |
Return true if each basis function of this space extends over only a single element, false otherwise. | |
virtual bool | isBarycentric () const |
Return true if space is based on a barycentric refinement. | |
shared_ptr< const Space < BasisFunctionType > > | barycentricSpace (const shared_ptr< const Space< BasisFunctionType > > &self) const |
Return an equivalent space (in terms of global Dofs), but defined using local dofs on the barycentrically refined grid. | |
virtual int | domainDimension () const |
Dimension of the grid on which functions from this space are defined. | |
virtual int | codomainDimension () const |
Dimension of the codomain of the functions. More... | |
virtual ElementVariant | elementVariant (const Entity< 0 > &element) const |
Return the variant of element element . More... | |
virtual void | setElementVariant (const Entity< 0 > &element, ElementVariant variant) |
Set the variant of element element to variant . More... | |
virtual const Fiber::Shapeset < BasisFunctionType > & | shapeset (const Entity< 0 > &element) const |
Reference to the shapeset attached to the specified element. | |
virtual bool | spaceIsCompatible (const Space< BasisFunctionType > &other) const |
Return true if other is compatible to this space, i.e. the global dofs of the two spaces agree with each other. | |
virtual SpaceIdentifier | spaceIdentifier () const |
Return the identifier of the space. | |
virtual size_t | globalDofCount () const |
Number of global degrees of freedom. | |
virtual size_t | flatLocalDofCount () const |
Total number of local degrees of freedom on all elements. | |
virtual void | getGlobalDofs (const Entity< 0 > &element, std::vector< GlobalDofIndex > &dofs) const |
Map local degrees of freedom residing on an element to global degrees of freedom. More... | |
virtual void | global2localDofs (const std::vector< GlobalDofIndex > &globalDofs, std::vector< std::vector< LocalDof > > &localDofs) const |
Map global degrees of freedom to local degrees of freedom. More... | |
virtual void | flatLocal2localDofs (const std::vector< FlatLocalDofIndex > &globalDofs, std::vector< LocalDof > &localDofs) const |
Map flat indices of local degrees of freedom to local degrees of freedom. More... | |
virtual void | getGlobalDofInterpolationPoints (arma::Mat< CoordinateType > &points) const |
Retrieve the interpolation points of the global degrees of freedom. More... | |
virtual void | getNormalsAtGlobalDofInterpolationPoints (arma::Mat< CoordinateType > &normals) const |
Retrieve the unit vectors normal to the grid at the interpolation points of the global degrees of freedom. More... | |
virtual void | getGlobalDofPositions (std::vector< Point3D< CoordinateType > > &positions) const |
Retrieve the reference positions of global degrees of freedom. More... | |
virtual void | getFlatLocalDofPositions (std::vector< Point3D< CoordinateType > > &positions) const |
Retrieve the reference positions of local degrees of freedom ordered by their flat index. More... | |
virtual void | getGlobalDofBoundingBoxes (std::vector< BoundingBox< CoordinateType > > &bboxes) const |
Retrieve bounding boxes of global degrees of freedom. More... | |
virtual void | getFlatLocalDofBoundingBoxes (std::vector< BoundingBox< CoordinateType > > &bboxes) const |
Retrieve bounding boxes of local degrees of freedom ordered by their flat index. More... | |
virtual void | getGlobalDofNormals (std::vector< Point3D< CoordinateType > > &normals) const |
Retrieve the unit vectors normal to the grid at the positions of global degrees of freedom. More... | |
virtual void | getFlatLocalDofNormals (std::vector< Point3D< CoordinateType > > &normals) const |
Retrieve the unit vectors normal to the grid at the positions of global degrees of freedom. More... | |
virtual void | dumpClusterIds (const char *fileName, const std::vector< unsigned int > &clusterIdsOfGlobalDofs) const |
Write a VTK file showing the distribution of global or flat local degrees of freedom into clusters. More... | |
virtual void | dumpClusterIdsEx (const char *fileName, const std::vector< unsigned int > &clusterIdsOfGlobalDofs, DofType dofType) const |
Write a VTK file showing the distribution of global or flat local degrees of freedom into clusters. More... | |
![]() | |
ScalarSpace (const shared_ptr< const Grid > &grid) | |
ScalarSpace (const ScalarSpace &other) | |
Copy constructor. | |
ScalarSpace & | operator= (const ScalarSpace &other) |
Assignment operator. | |
virtual const CollectionOfShapesetTransformations & | basisFunctionValue () const |
Transformation mapping shape functions to basis functions. More... | |
virtual void | getGlobalDofInterpolationDirections (arma::Mat< CoordinateType > &directions) const |
Retrieve the interpolation directions of the global degrees of freedom. More... | |
![]() | |
Space (const shared_ptr< const Grid > &grid) | |
Constructor. More... | |
Space (const Space< BasisFunctionType > &other) | |
Copy Constructor. | |
virtual | ~Space () |
Destructor. | |
Space< BasisFunctionType > & | operator= (const Space< BasisFunctionType > &other) |
Assignment operator. | |
shared_ptr< GeometryFactory > | elementGeometryFactory () const |
Return the GeometryFactory associated with the mesh. | |
BEMPP_DEPRECATED void | assignDofs () |
Assign global degrees of freedom to local degrees of freedom. More... | |
BEMPP_DEPRECATED bool | dofsAssigned () const |
True if global degrees of freedom have been already assigned to local degrees of freedom, false otherwise. More... | |
virtual void | getGlobalDofs (const Entity< 0 > &element, std::vector< GlobalDofIndex > &dofs, std::vector< BasisFunctionType > &localDofWeights) const |
Map local degrees of freedom residing on an element to global degrees of freedom. More... | |
virtual bool | gridIsIdentical (const Space< BasisFunctionType > &other) const |
Return true if both spaces act on the same grid. | |
virtual void | global2localDofs (const std::vector< GlobalDofIndex > &globalDofs, std::vector< std::vector< LocalDof > > &localDofs, std::vector< std::vector< BasisFunctionType > > &localDofWeights) const |
shared_ptr< const Grid > | grid () const |
Shared pointer to the grid on which the functions from this space are defined. | |
virtual BEMPP_DEPRECATED const Fiber::Basis < BasisFunctionType > & | basis (const Entity< 0 > &element) const |
Reference to the shapeset attached to the specified element. More... | |
virtual BEMPP_DEPRECATED const CollectionOfBasisTransformations & | shapeFunctionValue () const |
Transformation mapping shape functions to basis functions. More... | |
unsigned int | level () const |
Return the grid level of the current space. | |
int | gridDimension () const |
Return the underlying grid dimension. | |
int | worldDimension () const |
Return the underlying world dimension. | |
const GridView & | gridView () const |
Return the grid view of the current space. | |
Private Member Functions | |
void | assignDofsImpl (const GridSegment &segment) |
Private Attributes | |
Fiber::ConstantScalarShapeset < BasisFunctionType > | m_shapeset |
std::vector< std::vector < GlobalDofIndex > > | m_local2globalDofs |
std::vector< std::vector < LocalDof > > | m_global2localDofs |
std::vector< LocalDof > | m_flatLocal2localDofs |
GridSegment | m_segment |
shared_ptr< const Grid > | m_originalGrid |
shared_ptr< Space < BasisFunctionType > > | m_discontinuousSpace |
tbb::mutex | m_discontinuousSpaceMutex |
Additional Inherited Members | |
![]() | |
template<typename BasisFunctionType > | |
void | getAllShapesets (const Space< BasisFunctionType > &space, std::vector< const Fiber::Shapeset< BasisFunctionType > * > &shapesets) |
Get pointers to Basis objects corresponding to all elements of the grid on which a function space is defined. More... | |
template<typename BasisFunctionType > | |
void BEMPP_DEPRECATED | getAllBases (const Space< BasisFunctionType > &space, std::vector< const Fiber::Basis< BasisFunctionType > * > &bases) |
Get pointers to Basis objects corresponding to all elements of the grid on which a function space is defined. More... | |
template<typename BasisFunctionType > | |
int | maximumShapesetOrder (const Space< BasisFunctionType > &space) |
Return the maximum polynomial order of the shapesets defined by space on the elements of the space's underlying grid. | |
Space of piecewise constant scalar functions.
|
explicit |
Constructor.
Construct a space of piecewise constant scalar functions defined on the barycentric refinement of the grid grid
.
An exception is thrown if grid
is a null pointer.
Bempp::PiecewiseConstantScalarSpaceBarycentric< BasisFunctionType >::PiecewiseConstantScalarSpaceBarycentric | ( | const shared_ptr< const Grid > & | grid, |
const GridSegment & | segment | ||
) |
Constructor.
Construct a space of piecewise constant scalar functions defined on the elements of the grid grid
belonging to the segment segment
.
An exception is thrown if grid
is a null pointer.
|
virtual |
Dimension of the codomain of the functions.
In other words, number of components of the values of the functions. (E.g. H1 space -> 1, H(curl) space on a 2D surface -> 2).
Implements Bempp::Space< BasisFunctionType >.
|
virtual |
Return a shared pointer to an appropriate counterpart to this space, with basis functions extending only over single elements.
Let denote the function space represented by this object, with
its basis functions.
If the functions are scalar-valued, discontinuousSpace() should return a shared pointer to an object representing a space
with basis functions
such that:
If the values of functions are vectors with
components, discontinuousSpace() should return a shared pointer to an object representing a space
of with scalar-valued basis functions
such that
[in] | self | This must be a shared pointer to *this . |
Implements Bempp::Space< BasisFunctionType >.
|
virtual |
Write a VTK file showing the distribution of global or flat local degrees of freedom into clusters.
[in] | fileName | Name of the VTK file to be created (without extension). |
[in] | clusterIdsOfGlobalDofs | Vector whose ith element contains the identifier of the cluster to which ith global degree of freedom has been assigned. |
This function generates a VTK file containing a single data series mapping the ``positions'' (see getGlobalDofPositions()) of global degrees of freedom to the identifiers of the clusters to which these degrees of freedom have been assigned. It is intended for debugging clustering algorithms.
Implements Bempp::Space< BasisFunctionType >.
|
virtual |
Write a VTK file showing the distribution of global or flat local degrees of freedom into clusters.
[in] | fileName | Name of the VTK file to be created (without extension). |
[in] | clusterIdsOfGlobalDofs | Vector whose ith element contains the identifier of the cluster to which ith degree of freedom has been assigned. |
[in] | dofType | Type of degrees of freedom (GLOBAL_DOFS or FLAT_LOCAL_DOFS). |
This function generates a VTK file containing a single data series mapping the ``positions'' (see getGlobalDofPositions() and getFlatLocalDofPositions()) of the chosen type of degrees of freedom to the identifiers of the clusters to which these degrees of freedom have been assigned. It is intended for debugging clustering algorithms.
This function supersedes dumpClusterIds().
Reimplemented from Bempp::Space< BasisFunctionType >.
References Bempp::GridView::vtkWriter().
|
virtual |
Return the variant of element element
.
Possible return values:
Implements Bempp::Space< BasisFunctionType >.
References Bempp::Entity< 0 >::type().
|
virtual |
Map flat indices of local degrees of freedom to local degrees of freedom.
[in] | flatLocalDofs | Vector containing flat indices of local degrees of freedom. |
[out] | localDofs | Vector whose i th element is the local degree of freedom with flat index given by flatLocalDofs[i] . |
Implements Bempp::Space< BasisFunctionType >.
|
virtual |
Retrieve bounding boxes of local degrees of freedom ordered by their flat index.
[out] | boundingBoxes | Vector whose ith element contains the bounding box the local degree of freedom with flat index i. |
Reimplemented from Bempp::Space< BasisFunctionType >.
|
virtual |
Retrieve the unit vectors normal to the grid at the positions of global degrees of freedom.
[out] | normals | Vector whose ith element contains the unit vector normal to the grid at the reference position of the local degree of freedom with flat index i. |
Reimplemented from Bempp::Space< BasisFunctionType >.
References Bempp::IndexSet::entityIndex(), Bempp::Entity< 0 >::geometry(), and Bempp::Geometry::getNormals().
|
virtual |
Retrieve the reference positions of local degrees of freedom ordered by their flat index.
[out] | positions | Vector whose ith element contains the coordinates of the point taken to be the ``reference position'' (in some sense) of the local degree of freedom with flat index i. |
Implements Bempp::Space< BasisFunctionType >.
|
virtual |
Retrieve bounding boxes of global degrees of freedom.
[out] | boundingBoxes | Vector whose ith element contains the bounding box of ith global degree of freedom. |
Reimplemented from Bempp::Space< BasisFunctionType >.
|
virtual |
Retrieve the interpolation points of the global degrees of freedom.
This function, along with getNormalsAtGlobalDofInterpolationPoints() and getGlobalDofInterpolationDirections(), can be used in the interpolation of functions in finite-dimensional function spaces represented with classes derived from Space. Let be a function space defined on grid
with a basis
of functions
(or
. We say that this basis is interpolatory if there exist points
and
-dimensional vectors
(
such that
For any appropriate function defined on
the numbers
can then be taken as the expansion coefficients in the basis
of its interpolation. ("Appropriate" means that if, for example, the space
is a space of functions tangential to the grid, then
should also be tangential to the grid.)
This function fills the 2D array points
whose (i, j)th element contains the ith coordinate of the interpolation point .
Reimplemented from Bempp::Space< BasisFunctionType >.
|
virtual |
Retrieve the unit vectors normal to the grid at the positions of global degrees of freedom.
[out] | normals | Vector whose ith element contains the unit vector normal to the grid at the reference position of ith global degree of freedom. |
Reimplemented from Bempp::Space< BasisFunctionType >.
|
virtual |
Retrieve the reference positions of global degrees of freedom.
[out] | positions | Vector whose ith element contains the coordinates of the point taken to be the "reference position" (in some sense) of ith global degree of freedom. |
Implements Bempp::Space< BasisFunctionType >.
|
virtual |
Map local degrees of freedom residing on an element to global degrees of freedom.
[in] | element | An element of the grid grid(). |
[out] | dofs | Vector whose ith element is the index of the global degrees of freedom to which the ith local degree of freedom residing on element contributes. A negative number means that a given local degree of freedom does not contribute to any global one. |
localDofWeights
. Reimplemented from Bempp::Space< BasisFunctionType >.
References Bempp::Mapper::entityIndex().
|
virtual |
Retrieve the unit vectors normal to the grid at the interpolation points of the global degrees of freedom.
This function fills the 2D array normals
whose (i, j)th element contains the ith component of the unit vector normal to the grid at the interpolation point defined in the documentation of getGlobalDofInterpolationPoints().
Reimplemented from Bempp::Space< BasisFunctionType >.
|
virtual |
Map global degrees of freedom to local degrees of freedom.
[in] | globalDofs | Vector containing indices of global degrees of freedom. |
[out] | localDofs | Vector whose i th element is the vector containing all the local degrees of freedom that are mapped to the global degree of freedom globalDofs[i] . |
Note that a local degree of freedom (LocalDof) is a combination of an EntityIndex and LocalDofIndex, as explained in its documentation.
Reimplemented from Bempp::Space< BasisFunctionType >.
|
virtual |
Set the variant of element element
to variant
.
The element variant determines the set of basis functions defined on the element (e.g. maximum polynomial order). Different subclasses of Space interpret the variant
argument in different ways; for more information, see the documentation of these subclasses.
Implements Bempp::Space< BasisFunctionType >.