Skip to content
Snippets Groups Projects

[WIP] Feature/solverfactory

Closed Christian Engwer requested to merge feature/solverfactory into master
3 files
+ 156
210
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 5
85
@@ -242,96 +242,16 @@ namespace Dune {
/** @} */
/**
* @addtogroup ISTL_SP
* @{
*/
/**
* \brief Nonoverlapping Scalar Product with communication object.
*
* Consistent vectors in interior and border are assumed.
*/
template<class X, class C>
class NonoverlappingSchwarzScalarProduct : public ScalarProduct<X>
{
public:
//! \brief The type of the domain.
typedef X domain_type;
//! \brief The type of the range
typedef typename X::field_type field_type;
//! \brief The real-type of the range
typedef typename FieldTraits<field_type>::real_type real_type;
//! \brief The type of the communication object
typedef C communication_type;
/*! \brief Constructor
* \param com The communication object for syncing owner and copy
* data points. (E.~g. OwnerOverlapCommunication )
*/
NonoverlappingSchwarzScalarProduct (const communication_type& com)
: communication(com)
{}
/*! \brief Dot product of two vectors.
It is assumed that the vectors are consistent on the interior+border
partition.
*/
virtual field_type dot (const X& x, const X& y)
{
field_type result;
communication.dot(x,y,result);
return result;
}
/*! \brief Norm of a right-hand side vector.
The vector must be consistent on the interior+border partition
*/
virtual real_type norm (const X& x)
{
return communication.norm(x);
}
//! Category of the scalar product (see SolverCategory::Category)
virtual SolverCategory::Category category() const
{
return SolverCategory::nonoverlapping;
}
/*! \brief make additive vector consistent
*/
void make_consistent (X& x) const
{
communication.copyOwnerToAll(x,x);
}
private:
const communication_type& communication;
};
template<class X, class C>
struct ScalarProductChooser<X,C,SolverCategory::nonoverlapping>
{
/** @brief The type of the scalar product for the nonoverlapping case. */
typedef NonoverlappingSchwarzScalarProduct<X,C> ScalarProduct;
/** @brief The type of the communication object to use. */
typedef C communication_type;
enum {
/** @brief The solver category. */
solverCategory=SolverCategory::nonoverlapping
};
static ScalarProduct* construct(const communication_type& comm)
{
return new ScalarProduct(comm);
}
};
namespace Amg
{
template<class T> class ConstructionTraits;
}
/**
* @addtogroup ISTL_Prec
* @{
*/
/**
* @brief Nonoverlapping parallel preconditioner.
*
Loading