BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
potential_operator.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_potential_operator_hpp
22 #define bempp_potential_operator_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "../fiber/quadrature_strategy.hpp"
27 #include "../common/scalar_traits.hpp"
28 #include "../common/shared_ptr.hpp"
29 
30 #include "../common/armadillo_fwd.hpp"
31 #include <memory>
32 
33 namespace Bempp
34 {
35 
37 class EvaluationOptions;
38 class EvaluationOptions;
39 class GeometryFactory;
40 class Grid;
41 template <typename BasisFunctionType, typename ResultType> class GridFunction;
42 template <typename ResultType> class InterpolatedFunction;
43 template <typename BasisFunctionType> class Space;
44 template <typename BasisFunctionType, typename ResultType>
45 class AssembledPotentialOperator;
46 
74 template <typename BasisFunctionType_, typename ResultType_>
76 {
77 public:
80  typedef BasisFunctionType_ BasisFunctionType;
82  typedef ResultType_ ResultType;
89 
91  virtual ~PotentialOperator() {}
92 
122  virtual std::auto_ptr<InterpolatedFunction<ResultType> > evaluateOnGrid(
124  const Grid& evaluationGrid,
125  const QuadratureStrategy& quadStrategy,
126  const EvaluationOptions& options) const = 0;
127 
158  virtual arma::Mat<ResultType> evaluateAtPoints(
160  const arma::Mat<CoordinateType>& evaluationPoints,
161  const QuadratureStrategy& quadStrategy,
162  const EvaluationOptions& options) const = 0;
163 
189  assemble(
190  const shared_ptr<const Space<BasisFunctionType> >& space,
191  const shared_ptr<const arma::Mat<CoordinateType> >& evaluationPoints,
192  const QuadratureStrategy& quadStrategy,
193  const EvaluationOptions& options) const = 0;
194 
199  virtual int componentCount() const = 0;
200 };
201 
202 } // namespace Bempp
203 
204 #endif
Traits of scalar types.
Definition: scalar_traits.hpp:40
Fiber::QuadratureStrategy< BasisFunctionType, ResultType, GeometryFactory > QuadratureStrategy
Type of the appropriate instantiation of Fiber::QuadratureStrategy.
Definition: potential_operator.hpp:88
Options controlling evaluation of potentials.
Definition: evaluation_options.hpp:44
Base class for quadrature strategies.
Definition: quadrature_strategy.hpp:242
Function space.
Definition: assembled_potential_operator.hpp:35
ResultType_ ResultType
Type of the values of the (components of the) potential.
Definition: potential_operator.hpp:82
virtual arma::Mat< ResultType > evaluateAtPoints(const GridFunction< BasisFunctionType, ResultType > &argument, const arma::Mat< CoordinateType > &evaluationPoints, const QuadratureStrategy &quadStrategy, const EvaluationOptions &options) const =0
Evaluate the potential of a given charge distribution at prescribed points.
Abstract wrapper of a grid.
Definition: grid.hpp:50
BasisFunctionType_ BasisFunctionType
Type of the values of the (components of the) basis functions into which functions acted upon by the ...
Definition: potential_operator.hpp:80
virtual int componentCount() const =0
Number of components of the values of the potential.
virtual std::auto_ptr< InterpolatedFunction< ResultType > > evaluateOnGrid(const GridFunction< BasisFunctionType, ResultType > &argument, const Grid &evaluationGrid, const QuadratureStrategy &quadStrategy, const EvaluationOptions &options) const =0
Evaluate the potential of a given charge distribution on a prescribed grid.
Function defined on a grid.
Definition: assembled_potential_operator.hpp:34
virtual ~PotentialOperator()
Destructor.
Definition: potential_operator.hpp:91
ScalarTraits< ResultType >::RealType CoordinateType
Type used to represent coordinates.
Definition: potential_operator.hpp:84
virtual AssembledPotentialOperator< BasisFunctionType, ResultType > assemble(const shared_ptr< const Space< BasisFunctionType > > &space, const shared_ptr< const arma::Mat< CoordinateType > > &evaluationPoints, const QuadratureStrategy &quadStrategy, const EvaluationOptions &options) const =0
Create and return an AssembledPotentialOperator object.
Potential operator.
Definition: potential_operator.hpp:75
Assembled potential operator.
Definition: assembled_potential_operator.hpp:50