BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
l2_norm.hpp
Go to the documentation of this file.
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_l2_norm
22 #define bempp_l2_norm
23 
26 #include "../common/common.hpp"
27 #include "../common/scalar_traits.hpp"
28 
29 #include "evaluation_options.hpp"
30 #include "../fiber/quadrature_strategy.hpp"
31 
32 namespace Fiber
33 {
34 
36 template <typename ValueType> class Function;
39 } // namespace Fiber
40 
41 namespace Bempp
42 {
43 
45 class EvaluationOptions;
46 class GeometryFactory;
47 template <typename BasisFunctionType, typename ResultType> class GridFunction;
65 template <typename BasisFunctionType, typename ResultType>
66 typename ScalarTraits<BasisFunctionType>::RealType L2NormOfDifference(
67  const GridFunction<BasisFunctionType, ResultType>& gridFunction,
68  const Fiber::Function<ResultType>& refFunction,
70  BasisFunctionType, ResultType, GeometryFactory>& quadStrategy,
71  const EvaluationOptions& options = EvaluationOptions());
72 
90 template <typename BasisFunctionType, typename ResultType>
91 void estimateL2Error(
92  const GridFunction<BasisFunctionType, ResultType>& gridFunction,
93  const Fiber::Function<ResultType>& refFunction,
95  BasisFunctionType, ResultType, GeometryFactory>& quadStrategy,
96  const EvaluationOptions& options,
97  typename ScalarTraits<BasisFunctionType>::RealType& absError,
98  typename ScalarTraits<BasisFunctionType>::RealType& relError);
99 
106 template <typename BasisFunctionType, typename ResultType>
107 void estimateL2Error(
108  const GridFunction<BasisFunctionType, ResultType>& gridFunction,
109  const Fiber::Function<ResultType>& refFunction,
111  BasisFunctionType, ResultType, GeometryFactory>& quadStrategy,
112  typename ScalarTraits<BasisFunctionType>::RealType& absError,
113  typename ScalarTraits<BasisFunctionType>::RealType& relError);
114 
115 } // namespace Bempp
116 
117 #endif
Base class for quadrature strategies.
Definition: quadrature_strategy.hpp:242
Function to be used as a source term.
Definition: function.hpp:39