BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
piecewise_linear_scalar_space.hpp
1 // Copyright (C) 2011-2012 by the BEM++ Authors
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 // THE SOFTWARE.
20 
21 #ifndef bempp_piecewise_linear_scalar_space_hpp
22 #define bempp_piecewise_linear_scalar_space_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "../grid/grid_view.hpp"
27 #include "scalar_space.hpp"
28 #include "../common/types.hpp"
29 #include "../fiber/linear_scalar_shapeset.hpp"
30 
31 #include <map>
32 #include <memory>
33 #include <tbb/mutex.h>
34 
35 namespace Bempp
36 {
37 
39 class GridView;
44 template <typename BasisFunctionType>
45 class PiecewiseLinearScalarSpace : public ScalarSpace<BasisFunctionType>
46 {
47 public:
48  typedef typename Space<BasisFunctionType>::CoordinateType CoordinateType;
49  typedef typename Space<BasisFunctionType>::ComplexType ComplexType;
50 
51  explicit PiecewiseLinearScalarSpace(const shared_ptr<const Grid>& grid);
52  virtual ~PiecewiseLinearScalarSpace();
53 
54  virtual int domainDimension() const;
55  virtual int codomainDimension() const;
56 
63  virtual ElementVariant elementVariant(const Entity<0>& element) const;
64  virtual void setElementVariant(const Entity<0>& element,
65  ElementVariant variant);
66 
68  const Entity<0>& element) const;
69 
71  arma::Mat<CoordinateType>& points) const;
73  arma::Mat<CoordinateType>& normals) const;
74 
75 private:
81 };
82 
83 } // namespace Bempp
84 
85 #endif
virtual const Fiber::Shapeset< BasisFunctionType > & shapeset(const Entity< 0 > &element) const
Reference to the shapeset attached to the specified element.
Definition: piecewise_linear_scalar_space.cpp:63
Fiber::ScalarTraits< BasisFunctionType >::ComplexType ComplexType
Equivalent to std::complex&lt;CoordinateType&gt;.
Definition: space.hpp:93
virtual void setElementVariant(const Entity< 0 > &element, ElementVariant variant)
Set the variant of element element to variant.
Definition: piecewise_linear_scalar_space.cpp:98
virtual int codomainDimension() const
Dimension of the codomain of the functions.
Definition: piecewise_linear_scalar_space.cpp:56
Base class for spaces of scalar-valued functions.
Definition: scalar_space.hpp:36
Fiber::ScalarTraits< BasisFunctionType >::RealType CoordinateType
Type used to represent coordinates.
Definition: space.hpp:91
Space of continuous, piecewise linear scalar functions.
Definition: piecewise_linear_scalar_space.hpp:45
virtual ElementVariant elementVariant(const Entity< 0 > &element) const
Return the variant of element element.
Definition: piecewise_linear_scalar_space.cpp:81
Collection of shape functions defined on a reference element.
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:34
virtual void getGlobalDofInterpolationPoints(arma::Mat< CoordinateType > &points) const
Retrieve the interpolation points of the global degrees of freedom.
Definition: piecewise_linear_scalar_space.cpp:109
shared_ptr< const Grid > grid() const
Shared pointer to the grid on which the functions from this space are defined.
Definition: space.hpp:183
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_linear_scalar_space.cpp:118
virtual int domainDimension() const
Dimension of the grid on which functions from this space are defined.
Definition: piecewise_linear_scalar_space.cpp:50
Abstract wrapper of an entity of codimension 0.
Definition: entity.hpp:81
Shapeset composed of the linear nodal functions.
Definition: linear_scalar_shapeset.hpp:69