5 #ifndef DUNE_ISTL_SCALARPRODUCTS_HH 6 #define DUNE_ISTL_SCALARPRODUCTS_HH 15 #include <dune/common/exceptions.hh> 16 #include <dune/common/shared_ptr.hh> 57 typedef typename FieldTraits<field_type>::real_type
real_type;
97 template<
class X,
class C>
108 typedef typename FieldTraits<field_type>::real_type
real_type;
121 : _communication(com), _category(cat)
142 _communication->dot(x,y,result);
151 return _communication->norm(x);
161 std::shared_ptr<const communication_type> _communication;
177 template<
class X,
class C>
199 template<
class X,
class C>
223 template<
class X,
class Comm>
230 std::make_shared<ScalarProduct<X>>();
233 std::make_shared<ParallelScalarProduct<X,Comm>>(comm,category);
241 template<
class X,
class Comm>
243 {
return makeScalarProduct<X>(stackobject_to_shared_ptr(comm), category); }
Base class for scalar product and norm computation.
Definition: scalarproducts.hh:52
virtual ~ScalarProduct()
every abstract base class has a virtual destructor
Definition: scalarproducts.hh:83
OverlappingSchwarzScalarProduct(std::shared_ptr< const C > comm)
Definition: scalarproducts.hh:203
Default implementation for the scalar case.
Definition: scalarproducts.hh:167
NonoverlappingSchwarzScalarProduct(std::shared_ptr< const C > comm)
Definition: scalarproducts.hh:181
std::shared_ptr< ScalarProduct< X > > createScalarProduct(const Comm &comm, SolverCategory::Category category)
Definition: scalarproducts.hh:242
std::shared_ptr< ScalarProduct< X > > makeScalarProduct(std::shared_ptr< const Comm > comm, SolverCategory::Category category)
Choose the appropriate scalar product for a solver category.
Definition: scalarproducts.hh:224
real_type norm(const X &x) const override
Norm of a right-hand side vector. The vector must be consistent on the interior+border partition...
Definition: scalarproducts.hh:149
FieldTraits< field_type >::real_type real_type
Definition: scalarproducts.hh:57
NonoverlappingSchwarzScalarProduct(const C &comm)
Definition: scalarproducts.hh:184
Scalar product for overlapping Schwarz methods.
Definition: scalarproducts.hh:200
Category for sequential solvers.
Definition: solvercategory.hh:25
ParallelScalarProduct(const communication_type &com, SolverCategory::Category cat)
Definition: scalarproducts.hh:130
virtual real_type norm(const X &x) const
Norm of a right-hand side vector. The vector must be consistent on the interior+border partition...
Definition: scalarproducts.hh:71
X::field_type field_type
Definition: scalarproducts.hh:56
ParallelScalarProduct(std::shared_ptr< const communication_type > com, SolverCategory::Category cat)
Definition: scalarproducts.hh:120
field_type dot(const X &x, const X &y) const override
Dot product of two vectors. It is assumed that the vectors are consistent on the interior+border part...
Definition: scalarproducts.hh:139
Categories for the solvers.
Definition: solvercategory.hh:21
C communication_type
The type of the communication object.
Definition: scalarproducts.hh:113
X::field_type field_type
The field type used by the vector type domain_type.
Definition: scalarproducts.hh:107
X domain_type
The type of the vector to compute the scalar product on.
Definition: scalarproducts.hh:105
This file implements a vector space as a tensor product of a given vector space. The number of compon...
virtual field_type dot(const X &x, const X &y) const
Dot product of two vectors. It is assumed that the vectors are consistent on the interior+border part...
Definition: scalarproducts.hh:63
SolverCategory::Category category() const override
Category of the scalar product (see SolverCategory::Category)
Definition: scalarproducts.hh:155
FieldTraits< field_type >::real_type real_type
Definition: scalarproducts.hh:108
Scalar product for overlapping Schwarz methods.
Definition: scalarproducts.hh:98
virtual SolverCategory::Category category() const
Category of the scalar product (see SolverCategory::Category)
Definition: scalarproducts.hh:77
Nonoverlapping Scalar Product with communication object.
Definition: scalarproducts.hh:178
Category
Definition: solvercategory.hh:23
Definition: allocator.hh:11
X domain_type
export types, they come from the derived class
Definition: scalarproducts.hh:55
OverlappingSchwarzScalarProduct(const C &comm)
Definition: scalarproducts.hh:206