Go to the documentation of this file.
3 #ifndef DUNE_ISTL_SCALARPRODUCTS_HH
4 #define DUNE_ISTL_SCALARPRODUCTS_HH
12 #include <dune/common/exceptions.hh>
51 typedef typename FieldTraits<field_type>::real_type
real_type;
66 #if DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE
68 DUNE_THROW(Dune::Exception,
"It is necessary to implement the category method in a derived classes, in the future this method will pure virtual.");
90 typedef typename FieldTraits<field_type>::real_type
real_type;
122 template<
class X,
class C>
131 typedef typename FieldTraits<field_type>::real_type
real_type;
150 communication.dot(x,y,result);
159 return communication.norm(x);
172 communication.copyOwnerToAll(x,x);
190 template<
class X,
class C>
201 typedef typename FieldTraits<field_type>::real_type
real_type;
223 communication.dot(x,y,result);
232 return communication.norm(x);
258 template<
class X,
class Comm>
265 std::make_shared<SeqScalarProduct<X>>();
268 std::make_shared<NonoverlappingSchwarzScalarProduct<X,Comm>>(comm);
271 std::make_shared<OverlappingSchwarzScalarProduct<X,Comm>>(comm);
273 DUNE_THROW(InvalidStateException,
"unknown solver category");
C communication_type
The type of the communication object.
Definition: scalarproducts.hh:206
X::field_type field_type
The type of the range.
Definition: scalarproducts.hh:129
FieldTraits< field_type >::real_type real_type
Definition: scalarproducts.hh:201
virtual SolverCategory::Category category() const
Category of the scalar product (see SolverCategory::Category)
Definition: scalarproducts.hh:163
Category
Definition: solvercategory.hh:21
std::shared_ptr< ScalarProduct< X > > createScalarProduct(const Comm &comm, SolverCategory::Category category)
Choose the approriate scalar product for a solver category.
Definition: scalarproducts.hh:259
NonoverlappingSchwarzScalarProduct(const communication_type &com)
Constructor.
Definition: scalarproducts.hh:139
@ sequential
Category for sequential solvers.
Definition: solvercategory.hh:23
Nonoverlapping Scalar Product with communication object.
Definition: scalarproducts.hh:123
virtual real_type norm(const X &x)
Norm of a right-hand side vector. The vector must be consistent on the interior+border partition.
Definition: scalarproducts.hh:157
virtual real_type norm(const X &x)
Norm of a right-hand side vector. The vector must be consistent on the interior+border partition.
Definition: scalarproducts.hh:230
X domain_type
export types
Definition: scalarproducts.hh:88
virtual field_type dot(const X &x, const X &y)=0
Dot product of two vectors. It is assumed that the vectors are consistent on the interior+border part...
FieldTraits< field_type >::real_type real_type
The real-type of the range.
Definition: scalarproducts.hh:131
FieldTraits< field_type >::real_type real_type
Definition: scalarproducts.hh:90
virtual SolverCategory::Category category() const =0
Category of the scalar product (see SolverCategory::Category)
Default implementation for the scalar case.
Definition: scalarproducts.hh:84
virtual field_type dot(const X &x, const X &y)
Dot product of two vectors. In the complex case, the first argument is conjugated....
Definition: scalarproducts.hh:96
void make_consistent(X &x) const
make additive vector consistent
Definition: scalarproducts.hh:170
@ overlapping
Category for overlapping solvers.
Definition: solvercategory.hh:27
Scalar product for overlapping schwarz methods.
Definition: scalarproducts.hh:191
X domain_type
The type of the domain.
Definition: scalarproducts.hh:127
X domain_type
The type of the vector to compute the scalar product on.
Definition: scalarproducts.hh:198
Base class for scalar product and norm computation.
Definition: scalarproducts.hh:46
X domain_type
export types, they come from the derived class
Definition: scalarproducts.hh:49
X::field_type field_type
The field type used by the vector type domain_type.
Definition: scalarproducts.hh:200
virtual field_type dot(const X &x, const X &y)
Dot product of two vectors. It is assumed that the vectors are consistent on the interior+border part...
Definition: scalarproducts.hh:220
virtual SolverCategory::Category category() const
Category of the scalar product (see SolverCategory::Category)
Definition: scalarproducts.hh:110
C communication_type
The type of the communication object.
Definition: scalarproducts.hh:133
@ nonoverlapping
Category for non-overlapping solvers.
Definition: solvercategory.hh:25
virtual ~ScalarProduct()
every abstract base class has a virtual destructor
Definition: scalarproducts.hh:75
Definition: allocator.hh:7
virtual SolverCategory::Category category() const
Category of the scalar product (see SolverCategory::Category)
Definition: scalarproducts.hh:236
FieldTraits< field_type >::real_type real_type
Definition: scalarproducts.hh:51
OverlappingSchwarzScalarProduct(const communication_type &com)
Constructor needs to know the grid.
Definition: scalarproducts.hh:212
virtual real_type norm(const X &x)=0
Norm of a right-hand side vector. The vector must be consistent on the interior+border partition.
This file implements a vector space as a tensor product of a given vector space. The number of compon...
virtual real_type norm(const X &x)
Norm of a right-hand side vector. The vector must be consistent on the interior+border partition.
Definition: scalarproducts.hh:104
virtual field_type dot(const X &x, const X &y)
Dot product of two vectors. It is assumed that the vectors are consistent on the interior+border part...
Definition: scalarproducts.hh:147
X::field_type field_type
Definition: scalarproducts.hh:89
X::field_type field_type
Definition: scalarproducts.hh:50