21 #ifndef piecewise_constant_scalar_space_barycentric_hpp
22 #define piecewise_constant_scalar_space_barycentric_hpp
24 #include "../common/common.hpp"
26 #include "../grid/grid_view.hpp"
27 #include "scalar_space.hpp"
28 #include "../common/types.hpp"
29 #include "../fiber/constant_scalar_shapeset.hpp"
30 #include "../grid/grid_segment.hpp"
32 #include <tbb/mutex.h>
47 template <
typename BasisFunctionType>
51 typedef typename ScalarSpace<BasisFunctionType>::CoordinateType CoordinateType;
96 ElementVariant variant);
104 return PIECEWISE_CONSTANT_SCALAR_BARYCENTRIC;
110 std::vector<GlobalDofIndex>& dofs)
const;
112 const std::vector<GlobalDofIndex>& globalDofs,
113 std::vector<std::vector<LocalDof> >& localDofs)
const;
115 const std::vector<FlatLocalDofIndex>& globalDofs,
116 std::vector<LocalDof>& localDofs)
const;
119 arma::Mat<CoordinateType>& points)
const;
121 arma::Mat<CoordinateType>& normals)
const;
139 const char* fileName,
140 const std::vector<unsigned int>& clusterIdsOfGlobalDofs)
const;
142 const char* fileName,
143 const std::vector<unsigned int>& clusterIdsOfGlobalDofs,
144 DofType dofType)
const;
151 std::vector<std::vector<GlobalDofIndex> > m_local2globalDofs;
152 std::vector<std::vector<LocalDof> > m_global2localDofs;
153 std::vector<LocalDof> m_flatLocal2localDofs;
155 shared_ptr<const Grid> m_originalGrid;
156 mutable shared_ptr<Space<BasisFunctionType> > m_discontinuousSpace;
157 mutable tbb::mutex m_discontinuousSpaceMutex;
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.
Definition: piecewise_constant_scalar_space_barycentric.cpp:250
virtual bool isDiscontinuous() const
Return true if each basis function of this space extends over only a single element, false otherwise.
Definition: piecewise_constant_scalar_space_barycentric.cpp:81
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...
Definition: piecewise_constant_scalar_space_barycentric.cpp:387
virtual void getFlatLocalDofBoundingBoxes(std::vector< BoundingBox< CoordinateType > > &bboxes) const
Retrieve bounding boxes of local degrees of freedom ordered by their flat index.
Definition: piecewise_constant_scalar_space_barycentric.cpp:321
Base class for spaces of scalar-valued functions.
Definition: scalar_space.hpp:36
Function space.
Definition: assembled_potential_operator.hpp:35
virtual void getGlobalDofPositions(std::vector< Point3D< CoordinateType > > &positions) const
Retrieve the reference positions of global degrees of freedom.
Definition: piecewise_constant_scalar_space_barycentric.cpp:288
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...
Definition: piecewise_constant_scalar_space_barycentric.cpp:379
Bounding box with a reference point.
Definition: bounding_box.hpp:13
virtual void getGlobalDofInterpolationPoints(arma::Mat< CoordinateType > &points) const
Retrieve the interpolation points of the global degrees of freedom.
Definition: piecewise_constant_scalar_space_barycentric.cpp:271
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.
Definition: piecewise_constant_scalar_space_barycentric.cpp:260
Collection of shape functions defined on a reference element.
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:34
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 fre...
Definition: piecewise_constant_scalar_space_barycentric.cpp:280
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...
Definition: piecewise_constant_scalar_space_barycentric.cpp:337
shared_ptr< const Grid > grid() const
Shared pointer to the grid on which the functions from this space are defined.
Definition: space.hpp:183
Space of piecewise constant scalar functions.
Definition: piecewise_constant_scalar_space_barycentric.hpp:48
virtual int domainDimension() const
Dimension of the grid on which functions from this space are defined.
Definition: piecewise_constant_scalar_space_barycentric.cpp:87
Segment of a grid.
Definition: grid_segment.hpp:46
virtual void setElementVariant(const Entity< 0 > &element, ElementVariant variant)
Set the variant of element element to variant.
Definition: piecewise_constant_scalar_space_barycentric.cpp:154
virtual size_t flatLocalDofCount() const
Total number of local degrees of freedom on all elements.
Definition: piecewise_constant_scalar_space_barycentric.cpp:235
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 e...
Definition: piecewise_constant_scalar_space_barycentric.cpp:121
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 o...
Definition: piecewise_constant_scalar_space_barycentric.cpp:65
virtual bool isBarycentric() const
Return true if space is based on a barycentric refinement.
Definition: piecewise_constant_scalar_space_barycentric.hpp:76
virtual int codomainDimension() const
Dimension of the codomain of the functions.
Definition: piecewise_constant_scalar_space_barycentric.cpp:93
virtual const Fiber::Shapeset< BasisFunctionType > & shapeset(const Entity< 0 > &element) const
Reference to the shapeset attached to the specified element.
Definition: piecewise_constant_scalar_space_barycentric.cpp:100
virtual void getFlatLocalDofPositions(std::vector< Point3D< CoordinateType > > &positions) const
Retrieve the reference positions of local degrees of freedom ordered by their flat index...
Definition: piecewise_constant_scalar_space_barycentric.cpp:300
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...
Definition: piecewise_constant_scalar_space_barycentric.cpp:328
PiecewiseConstantScalarSpaceBarycentric(const shared_ptr< const Grid > &grid)
Constructor.
Definition: piecewise_constant_scalar_space_barycentric.cpp:44
Abstract wrapper of an entity of codimension 0.
Definition: entity.hpp:81
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. ...
Definition: piecewise_constant_scalar_space_barycentric.cpp:241
virtual void getGlobalDofBoundingBoxes(std::vector< BoundingBox< CoordinateType > > &bboxes) const
Retrieve bounding boxes of global degrees of freedom.
Definition: piecewise_constant_scalar_space_barycentric.cpp:312
virtual size_t globalDofCount() const
Number of global degrees of freedom.
Definition: piecewise_constant_scalar_space_barycentric.cpp:229
virtual ElementVariant elementVariant(const Entity< 0 > &element) const
Return the variant of element element.
Definition: piecewise_constant_scalar_space_barycentric.cpp:107
virtual SpaceIdentifier spaceIdentifier() const
Return the identifier of the space.
Definition: piecewise_constant_scalar_space_barycentric.hpp:103
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 barycentric...
Definition: piecewise_constant_scalar_space_barycentric.cpp:142