BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
blocked_boundary_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_blocked_boundary_operator_hpp
22 #define bempp_blocked_boundary_operator_hpp
23 
24 #include "../common/common.hpp"
25 #include "../common/shared_ptr.hpp"
26 
27 #include "blocked_operator_structure.hpp"
28 #include "transposition_mode.hpp"
29 
30 #include <vector>
31 
32 namespace Bempp
33 {
34 
36 template <typename BasisFunctionType> class Space;
37 template <typename ResultType> class DiscreteBoundaryOperator;
38 template <typename BasisFunctionType, typename ResultType> class BoundaryOperator;
39 template <typename BasisFunctionType, typename ResultType> class GridFunction;
45 template <typename BasisFunctionType, typename ResultType>
47 {
48 public:
63 
69  size_t row, size_t column) const;
72  bool isEmpty(size_t row, size_t column) const;
73 
75  size_t rowCount() const;
77  size_t columnCount() const;
78 
80  size_t totalGlobalDofCountInDomains() const;
82  size_t totalGlobalDofCountInRanges() const;
86 
100  shared_ptr<const DiscreteBoundaryOperator<ResultType> > weakForm() const;
101 
104  shared_ptr<const Space<BasisFunctionType> > domain(size_t column) const;
107  shared_ptr<const Space<BasisFunctionType> > range(size_t row) const;
110  shared_ptr<const Space<BasisFunctionType> > dualToRange(size_t row) const;
111 
114  void apply(const TranspositionMode trans,
115  const std::vector<GridFunction<BasisFunctionType, ResultType> >& x_in,
116  std::vector<GridFunction<BasisFunctionType, ResultType> >& y_inout,
117  ResultType alpha, ResultType beta) const;
118 
119 private:
121  shared_ptr<const DiscreteBoundaryOperator<ResultType> >
122  constructWeakForm() const;
123 
124 private:
126  std::vector<shared_ptr<const Space<BasisFunctionType> > > m_domains;
127  std::vector<shared_ptr<const Space<BasisFunctionType> > > m_ranges;
128  std::vector<shared_ptr<const Space<BasisFunctionType> > > m_dualsToRanges;
129  mutable shared_ptr<const DiscreteBoundaryOperator<ResultType> > m_weakForm;
131 };
132 
144 template <typename BasisFunctionType, typename ResultType>
145 std::vector<GridFunction<BasisFunctionType, ResultType> > operator*(
147  const std::vector<GridFunction<BasisFunctionType, ResultType> >& funs);
148 
149 } // namespace Bempp
150 
151 #endif
size_t totalGlobalDofCountInDomains() const
Return total number of global degrees of freedom in all domains.
Definition: blocked_boundary_operator.cpp:156
size_t columnCount() const
Return number of block columns.
Definition: blocked_boundary_operator.cpp:149
BoundaryOperator< BasisFunctionType, ResultType > block(size_t row, size_t column) const
Return the operator from row row and column column.
Definition: blocked_boundary_operator.cpp:129
size_t rowCount() const
Return number of block rows.
Definition: blocked_boundary_operator.cpp:143
Helper class used in construction of blocked boundary operators.
Definition: blocked_operator_structure.hpp:43
size_t totalGlobalDofCountInDualsToRanges() const
Return total number of global degrees of freedom in all duals to ranges.
Definition: blocked_boundary_operator.cpp:176
size_t totalGlobalDofCountInRanges() const
Return total number of global degrees of freedom in all ranges.
Definition: blocked_boundary_operator.cpp:166
void apply(const TranspositionMode trans, const std::vector< GridFunction< BasisFunctionType, ResultType > > &x_in, std::vector< GridFunction< BasisFunctionType, ResultType > > &y_inout, ResultType alpha, ResultType beta) const
Set y_inout := alpha * A * x_in + beta * y_inout, where A is this operator.
Definition: blocked_boundary_operator.cpp:223
shared_ptr< const Space< BasisFunctionType > > dualToRange(size_t row) const
Return the function space dual to the range of all the operators from row row of this blocked operato...
Definition: blocked_boundary_operator.cpp:215
Boundary operator consisting of multiple blocks arranged in a matrix.
Definition: blocked_boundary_operator.hpp:46
TranspositionMode
Enumeration determining how a discrete boundary operator is transformed before being applied...
Definition: transposition_mode.hpp:37
Operator acting on functions defined on a surface.
Definition: boundary_operator.hpp:63
shared_ptr< const Space< BasisFunctionType > > domain(size_t column) const
Return the function space being the domain of all the operators from column column of this blocked op...
Definition: blocked_boundary_operator.cpp:197
Function defined on a grid.
Definition: assembled_potential_operator.hpp:34
shared_ptr< const Space< BasisFunctionType > > range(size_t row) const
Return the function space being the range of all the operators from row row of this blocked operator...
Definition: blocked_boundary_operator.cpp:206
shared_ptr< const DiscreteBoundaryOperator< ResultType > > weakForm() const
Return the weak form of this boundary operator.
Definition: blocked_boundary_operator.cpp:186
BlockedBoundaryOperator(const BlockedOperatorStructure< BasisFunctionType, ResultType > &structure)
Constructor.
Definition: blocked_boundary_operator.cpp:36
bool isEmpty(size_t row, size_t column) const
Return whether the block in row row and column column is empty.
Definition: blocked_boundary_operator.cpp:136