BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
elementary_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_elementary_potential_operator_hpp
22 #define bempp_elementary_potential_operator_hpp
23 
24 #include "potential_operator.hpp"
25 
26 #include "../common/shared_ptr.hpp"
27 
28 namespace Fiber
29 {
30 
32 template <typename CoordinateType> class CollectionOfBasisTransformations;
33 template <typename CoordinateType> class CollectionOfShapesetTransformations;
34 template <typename KernelType> class CollectionOfKernels;
35 template <typename BasisFunctionType, typename KernelType, typename ResultType>
36 class KernelTrialIntegral;
37 template <typename ResultType> class EvaluatorForIntegralOperators;
38 template <typename ResultType> class LocalAssemblerForPotentialOperators;
41 } // namespace Bempp
42 
43 namespace Bempp
44 {
45 
47 template <typename ValueType> class DiscreteBoundaryOperator;
90 template <typename BasisFunctionType_, typename KernelType_, typename ResultType_>
92  public PotentialOperator<BasisFunctionType_, ResultType_>
93 {
95 public:
99  typedef KernelType_ KernelType;
101  typedef typename Base::ResultType ResultType;
128 
129  virtual std::auto_ptr<InterpolatedFunction<ResultType_> > evaluateOnGrid(
131  const Grid& evaluationGrid,
132  const QuadratureStrategy& quadStrategy,
133  const EvaluationOptions& options) const;
134 
135  virtual arma::Mat<ResultType_> evaluateAtPoints(
137  const arma::Mat<CoordinateType>& evaluationPoints,
138  const QuadratureStrategy& quadStrategy,
139  const EvaluationOptions& options) const;
140 
142  assemble(
143  const shared_ptr<const Space<BasisFunctionType> >& space,
144  const shared_ptr<const arma::Mat<CoordinateType> >& evaluationPoints,
145  const QuadratureStrategy& quadStrategy,
146  const EvaluationOptions& options) const;
147 
148  virtual int componentCount() const;
149 
150 private:
153  virtual const CollectionOfKernels& kernels() const = 0;
156  virtual const CollectionOfBasisTransformations&
157  trialTransformations() const = 0;
166  virtual const KernelTrialIntegral& integral() const = 0;
167 
169  std::auto_ptr<Evaluator> makeEvaluator(
171  const QuadratureStrategy& quadStrategy,
172  const EvaluationOptions& options) const;
173 
174  std::auto_ptr<LocalAssembler> makeAssembler(
175  const Space<BasisFunctionType>& space,
176  const arma::Mat<CoordinateType>& evaluationPoints,
177  const QuadratureStrategy& quadStrategy,
178  const EvaluationOptions& options) const;
179 
180  shared_ptr<DiscreteBoundaryOperator<ResultType_> > assembleOperator(
181  const Space<BasisFunctionType>& space,
182  const arma::Mat<CoordinateType>& evaluationPoints,
183  LocalAssembler& assembler,
184  const EvaluationOptions& options) const;
185 
186  std::auto_ptr<DiscreteBoundaryOperator<ResultType_> >
187  assembleOperatorInDenseMode(
188  const Space<BasisFunctionType>& space,
189  const arma::Mat<CoordinateType>& evaluationPoints,
190  LocalAssembler& assembler,
191  const EvaluationOptions& options) const;
192 
193  std::auto_ptr<DiscreteBoundaryOperator<ResultType_> >
194  assembleOperatorInAcaMode(
195  const Space<BasisFunctionType>& space,
196  const arma::Mat<CoordinateType>& evaluationPoints,
197  LocalAssembler& assembler,
198  const EvaluationOptions& options) const;
200 };
201 
202 } // namespace Bempp
203 
204 #endif
Fiber::CollectionOfShapesetTransformations< CoordinateType > CollectionOfShapesetTransformations
Type of the appropriate instantiation of Fiber::CollectionOfShapesetTransformations.
Definition: elementary_potential_operator.hpp:114
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
Base::ResultType ResultType
Type of the values of the (components of the) potential.
Definition: elementary_potential_operator.hpp:101
ResultType_ ResultType
Type of the values of the (components of the) potential.
Definition: potential_operator.hpp:82
virtual const KernelTrialIntegral & integral() const =0
Return an object representing the integral used to evaluate the potential of a charge distribution...
Abstract interface of a local assembler for potential operators.
Definition: local_assembler_for_potential_operators.hpp:54
Base::CoordinateType CoordinateType
Type used to represent coordinates.
Definition: elementary_potential_operator.hpp:103
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
Create and return an AssembledPotentialOperator object.
Definition: elementary_potential_operator.cpp:154
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
Base::BasisFunctionType BasisFunctionType
Type of the values of the (components of the) basis functions into which functions acted upon by the ...
Definition: elementary_potential_operator.hpp:97
Fiber::LocalAssemblerForPotentialOperators< ResultType > LocalAssembler
Type of the appropriate instantiation of Fiber::LocalAssemblerForPotentialOperators.
Definition: elementary_potential_operator.hpp:111
KernelType_ KernelType
Type of the values of the (components of the) kernel functions.
Definition: elementary_potential_operator.hpp:99
virtual int componentCount() const
Number of components of the values of the potential.
Definition: elementary_potential_operator.cpp:51
Function defined on a grid.
Definition: assembled_potential_operator.hpp:34
Definition: kernel_trial_integral.hpp:42
virtual const CollectionOfKernels & kernels() const =0
Return the collection of kernel functions occurring in the integrand of this operator.
Elementary potential operator.
Definition: elementary_potential_operator.hpp:91
Fiber::CollectionOfKernels< KernelType > CollectionOfKernels
Type of the appropriate instantiation of Fiber::CollectionOfKernels.
Definition: elementary_potential_operator.hpp:123
virtual std::auto_ptr< InterpolatedFunction< ResultType_ > > evaluateOnGrid(const GridFunction< BasisFunctionType, ResultType > &argument, const Grid &evaluationGrid, const QuadratureStrategy &quadStrategy, const EvaluationOptions &options) const
Evaluate the potential of a given charge distribution on a prescribed grid.
Definition: elementary_potential_operator.cpp:59
virtual const CollectionOfBasisTransformations & trialTransformations() const =0
Return the collection of transformations of the charge distribution that occur in the weak form of th...
Fiber::CollectionOfShapesetTransformations< CoordinateType > CollectionOfBasisTransformations
Type of the appropriate instantiation of Fiber::CollectionOfBasisTransformations. ...
Definition: elementary_potential_operator.hpp:120
ScalarTraits< ResultType >::RealType CoordinateType
Type used to represent coordinates.
Definition: potential_operator.hpp:84
Definition: evaluator_for_integral_operators.hpp:33
Potential operator.
Definition: potential_operator.hpp:75
Base::QuadratureStrategy QuadratureStrategy
Type of the appropriate instantiation of Fiber::QuadratureStrategy.
Definition: elementary_potential_operator.hpp:105
Assembled potential operator.
Definition: assembled_potential_operator.hpp:50
Fiber::KernelTrialIntegral< BasisFunctionType, KernelType, ResultType > KernelTrialIntegral
Type of the appropriate instantiation of Fiber::KernelTrialIntegral.
Definition: elementary_potential_operator.hpp:127
virtual arma::Mat< ResultType_ > evaluateAtPoints(const GridFunction< BasisFunctionType, ResultType > &argument, const arma::Mat< CoordinateType > &evaluationPoints, const QuadratureStrategy &quadStrategy, const EvaluationOptions &options) const
Evaluate the potential of a given charge distribution at prescribed points.
Definition: elementary_potential_operator.cpp:117
Fiber::EvaluatorForIntegralOperators< ResultType > Evaluator
Type of the appropriate instantiation of Fiber::EvaluatorForIntegralOperators.
Definition: elementary_potential_operator.hpp:108