Loading...
Searching...
No Matches
pinfo.hh
Go to the documentation of this file.
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_AMG_PINFO_HH
#define DUNE_AMG_PINFO_HH
#include <dune/common/parallel/communication.hh>
#include <dune/common/enumset.hh>
#if HAVE_MPI
#include <dune/common/parallel/mpicommunication.hh>
#include <dune/common/parallel/mpitraits.hh>
#include <dune/common/parallel/remoteindices.hh>
#include <dune/common/parallel/interface.hh>
#include <dune/common/parallel/communicator.hh>
#endif
#include <dune/istl/solvercategory.hh>
namespace Dune
{
namespace Amg
{
class SequentialInformation
{
public:
typedef Communication<void*> MPICommunicator;
typedef EmptySet<int> CopyFlags;
typedef AllSet<int> OwnerSet;
SolverCategory::Category category () const {
return SolverCategory::sequential;
}
MPICommunicator communicator() const
{
return comm_;
}
int procs() const
{
return 1;
}
template<typename T>
T globalSum(const T& t) const
{
return t;
}
typedef int GlobalLookupIndexSet;
void buildGlobalLookup(std::size_t){}
void freeGlobalLookup(){}
const GlobalLookupIndexSet& globalLookup() const
{
return gli;
}
template<class V>
void copyOwnerToAll([[maybe_unused]] V& v, [[maybe_unused]] V& v1) const
{}
template<class V>
void project([[maybe_unused]] V& v) const
{}
template<class T1, class T2>
void dot (const T1& x, const T1& y, T2& result) const
{
result = x.dot(y);
}
template<class T1>
typename FieldTraits<typename T1::field_type>::real_type norm (const T1& x) const
{
return x.two_norm();
}
template<class T>
SequentialInformation(const Communication<T>&)
{}
SequentialInformation()
{}
SequentialInformation(const SequentialInformation&)
{}
private:
MPICommunicator comm_{};
GlobalLookupIndexSet gli{};
};
} // namespace Amg
} //namespace Dune
#endif
solvercategory.hh
Dune
Definition allocator.hh:11
Dune::Amg
Definition novlpschwarz.hh:256
Dune::Amg::SequentialInformation::SequentialInformation
SequentialInformation()
Definition pinfo.hh:89
Dune::Amg::SequentialInformation::globalSum
T globalSum(const T &t) const
Definition pinfo.hh:49
Dune::Amg::SequentialInformation::CopyFlags
EmptySet< int > CopyFlags
Definition pinfo.hh:31
Dune::Amg::SequentialInformation::dot
void dot(const T1 &x, const T1 &y, T2 &result) const
Definition pinfo.hh:74
Dune::Amg::SequentialInformation::OwnerSet
AllSet< int > OwnerSet
Definition pinfo.hh:32
Dune::Amg::SequentialInformation::copyOwnerToAll
void copyOwnerToAll(V &v, V &v1) const
Definition pinfo.hh:66
Dune::Amg::SequentialInformation::communicator
MPICommunicator communicator() const
Definition pinfo.hh:38
Dune::Amg::SequentialInformation::buildGlobalLookup
void buildGlobalLookup(std::size_t)
Definition pinfo.hh:56
Dune::Amg::SequentialInformation::project
void project(V &v) const
Definition pinfo.hh:70
Dune::Amg::SequentialInformation::MPICommunicator
Communication< void * > MPICommunicator
Definition pinfo.hh:30
Dune::Amg::SequentialInformation::SequentialInformation
SequentialInformation(const Communication< T > &)
Definition pinfo.hh:86
Dune::Amg::SequentialInformation::globalLookup
const GlobalLookupIndexSet & globalLookup() const
Definition pinfo.hh:60
Dune::Amg::SequentialInformation::SequentialInformation
SequentialInformation(const SequentialInformation &)
Definition pinfo.hh:92
Dune::Amg::SequentialInformation::norm
FieldTraits< typenameT1::field_type >::real_type norm(const T1 &x) const
Definition pinfo.hh:80
Dune::Amg::SequentialInformation::freeGlobalLookup
void freeGlobalLookup()
Definition pinfo.hh:58
Dune::Amg::SequentialInformation::GlobalLookupIndexSet
int GlobalLookupIndexSet
Definition pinfo.hh:54
Dune::Amg::SequentialInformation::category
SolverCategory::Category category() const
Definition pinfo.hh:34
Dune::Amg::SequentialInformation::procs
int procs() const
Definition pinfo.hh:43
Dune::SolverCategory::Category
Category
Definition solvercategory.hh:23
Dune::SolverCategory::sequential
@ sequential
Category for sequential solvers.
Definition solvercategory.hh:25