Loading...
Searching...
No Matches
construction.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_AMGCONSTRUCTION_HH
#define DUNE_AMGCONSTRUCTION_HH
#include <dune/istl/bvector.hh>
#include <dune/istl/operators.hh>
#include <dune/istl/owneroverlapcopy.hh>
#include <dune/istl/solvercategory.hh>
#include "pinfo.hh"
namespace Dune
{
namespace Amg
{
template<typename T>
struct ConstructionTraits
{
typedef const void* Arguments;
static inline std::shared_ptr<T> construct(Arguments& /*args*/)
{
return std::make_shared<T>();
}
};
template<class T, class A>
struct ConstructionTraits<BlockVector<T,A> >
{
typedef const int Arguments;
static inline std::shared_ptr<BlockVector<T,A>> construct(Arguments& n)
{
return std::make_shared<BlockVector<T,A>>(n);
}
};
template<class M, class C>
struct ParallelOperatorArgs
{
ParallelOperatorArgs(std::shared_ptr<M> matrix, const C& comm)
: matrix_(matrix), comm_(comm)
{}
std::shared_ptr<M> matrix_;
const C& comm_;
};
#if HAVE_MPI
struct OwnerOverlapCopyCommunicationArgs
{
OwnerOverlapCopyCommunicationArgs(MPI_Comm comm, SolverCategory::Category cat)
: comm_(comm), cat_(cat)
{}
MPI_Comm comm_;
SolverCategory::Category cat_;
};
#endif
struct SequentialCommunicationArgs
{
SequentialCommunicationArgs(Communication<void*> comm, [[maybe_unused]] int cat)
: comm_(comm)
{}
Communication<void*> comm_;
};
} // end Amg namspace
// forward declaration
template<class M, class X, class Y, class C>
class OverlappingSchwarzOperator;
template<class M, class X, class Y, class C>
class NonoverlappingSchwarzOperator;
namespace Amg
{
template<class M, class X, class Y, class C>
struct ConstructionTraits<OverlappingSchwarzOperator<M,X,Y,C> >
{
typedef ParallelOperatorArgs<M,C> Arguments;
static inline std::shared_ptr<OverlappingSchwarzOperator<M,X,Y,C>> construct(const Arguments& args)
{
return std::make_shared<OverlappingSchwarzOperator<M,X,Y,C>>
(args.matrix_, args.comm_);
}
};
template<class M, class X, class Y, class C>
struct ConstructionTraits<NonoverlappingSchwarzOperator<M,X,Y,C> >
{
typedef ParallelOperatorArgs<M,C> Arguments;
static inline std::shared_ptr<NonoverlappingSchwarzOperator<M,X,Y,C>> construct(const Arguments& args)
{
return std::make_shared<NonoverlappingSchwarzOperator<M,X,Y,C>>
(args.matrix_, args.comm_);
}
};
template<class M, class X, class Y>
struct MatrixAdapterArgs
{
MatrixAdapterArgs(std::shared_ptr<M> matrix, const SequentialInformation)
: matrix_(matrix)
{}
std::shared_ptr<M> matrix_;
};
template<class M, class X, class Y>
struct ConstructionTraits<MatrixAdapter<M,X,Y> >
{
typedef const MatrixAdapterArgs<M,X,Y> Arguments;
static inline std::shared_ptr<MatrixAdapter<M,X,Y>> construct(Arguments& args)
{
return std::make_shared<MatrixAdapter<M,X,Y>>(args.matrix_);
}
};
template<>
struct ConstructionTraits<SequentialInformation>
{
typedef const SequentialCommunicationArgs Arguments;
static inline std::shared_ptr<SequentialInformation> construct(Arguments& args)
{
return std::make_shared<SequentialInformation>(args.comm_);
}
};
#if HAVE_MPI
template<class T1, class T2>
struct ConstructionTraits<OwnerOverlapCopyCommunication<T1,T2> >
{
typedef const OwnerOverlapCopyCommunicationArgs Arguments;
static inline std::shared_ptr<OwnerOverlapCopyCommunication<T1,T2>> construct(Arguments& args)
{
return std::make_shared<OwnerOverlapCopyCommunication<T1,T2>>(args.comm_, args.cat_);
}
};
#endif
} // namespace Amg
} // namespace Dune
#endif
owneroverlapcopy.hh
Classes providing communication interfaces for overlapping Schwarz methods.
pinfo.hh
operators.hh
Define general, extensible interface for operators. The available implementation wraps a matrix.
bvector.hh
This file implements a vector space as a tensor product of a given vector space. The number of compon...
solvercategory.hh
Dune::Amg::ConstructionTraits::construct
static std::shared_ptr< T > construct(Arguments &)
Construct an object with the specified arguments.
Definition construction.hh:52
Dune::Amg::ConstructionTraits< BlockVector< T, A > >::Arguments
const int Arguments
Definition construction.hh:61
Dune::Amg::SequentialCommunicationArgs::SequentialCommunicationArgs
SequentialCommunicationArgs(Communication< void * > comm, int cat)
Definition construction.hh:93
Dune::Amg::OwnerOverlapCopyCommunicationArgs::OwnerOverlapCopyCommunicationArgs
OwnerOverlapCopyCommunicationArgs(MPI_Comm comm, SolverCategory::Category cat)
Definition construction.hh:82
Dune::Amg::OwnerOverlapCopyCommunicationArgs::comm_
MPI_Comm comm_
Definition construction.hh:86
Dune::Amg::OwnerOverlapCopyCommunicationArgs::cat_
SolverCategory::Category cat_
Definition construction.hh:87
Dune::Amg::ParallelOperatorArgs::comm_
const C & comm_
Definition construction.hh:76
Dune::Amg::ParallelOperatorArgs::ParallelOperatorArgs
ParallelOperatorArgs(std::shared_ptr< M > matrix, const C &comm)
Definition construction.hh:71
Dune::Amg::ParallelOperatorArgs::matrix_
std::shared_ptr< M > matrix_
Definition construction.hh:75
Dune::Amg::ConstructionTraits::Arguments
const void * Arguments
A type holding all the arguments needed to call the constructor.
Definition construction.hh:44
Dune::Amg::SequentialCommunicationArgs::comm_
Communication< void * > comm_
Definition construction.hh:97
Dune::Amg::ConstructionTraits< BlockVector< T, A > >::construct
static std::shared_ptr< BlockVector< T, A > > construct(Arguments &n)
Definition construction.hh:62
Dune
Definition allocator.hh:11
Dune::Amg
Definition novlpschwarz.hh:256
Dune::BlockVector
A vector of blocks with memory management.
Definition bvector.hh:392
Dune::NonoverlappingSchwarzOperator
A nonoverlapping operator with communication object.
Definition novlpschwarz.hh:61
Dune::Amg::ConstructionTraits
Traits class for generically constructing non default constructable types.
Definition construction.hh:39
Dune::MatrixAdapter
Adapter to turn a matrix into a linear operator.
Definition operators.hh:135
Dune::OwnerOverlapCopyCommunication
A class setting up standard communication for a two-valued attribute set with owner/overlap/copy sema...
Definition owneroverlapcopy.hh:174
Dune::Amg::ParallelOperatorArgs
Definition construction.hh:70
Dune::Amg::OwnerOverlapCopyCommunicationArgs
Definition construction.hh:81
Dune::Amg::SequentialCommunicationArgs
Definition construction.hh:92
Dune::OverlappingSchwarzOperator
An overlapping Schwarz operator.
Definition schwarz.hh:75
Dune::Amg::ConstructionTraits< OverlappingSchwarzOperator< M, X, Y, C > >::Arguments
ParallelOperatorArgs< M, C > Arguments
Definition construction.hh:114
Dune::Amg::ConstructionTraits< OverlappingSchwarzOperator< M, X, Y, C > >::construct
static std::shared_ptr< OverlappingSchwarzOperator< M, X, Y, C > > construct(const Arguments &args)
Definition construction.hh:116
Dune::Amg::ConstructionTraits< NonoverlappingSchwarzOperator< M, X, Y, C > >::Arguments
ParallelOperatorArgs< M, C > Arguments
Definition construction.hh:126
Dune::Amg::ConstructionTraits< NonoverlappingSchwarzOperator< M, X, Y, C > >::construct
static std::shared_ptr< NonoverlappingSchwarzOperator< M, X, Y, C > > construct(const Arguments &args)
Definition construction.hh:128
Dune::Amg::MatrixAdapterArgs
Definition construction.hh:137
Dune::Amg::MatrixAdapterArgs::MatrixAdapterArgs
MatrixAdapterArgs(std::shared_ptr< M > matrix, const SequentialInformation)
Definition construction.hh:138
Dune::Amg::MatrixAdapterArgs::matrix_
std::shared_ptr< M > matrix_
Definition construction.hh:142
Dune::Amg::ConstructionTraits< MatrixAdapter< M, X, Y > >::construct
static std::shared_ptr< MatrixAdapter< M, X, Y > > construct(Arguments &args)
Definition construction.hh:150
Dune::Amg::ConstructionTraits< MatrixAdapter< M, X, Y > >::Arguments
const MatrixAdapterArgs< M, X, Y > Arguments
Definition construction.hh:148
Dune::Amg::ConstructionTraits< SequentialInformation >::Arguments
const SequentialCommunicationArgs Arguments
Definition construction.hh:159
Dune::Amg::ConstructionTraits< SequentialInformation >::construct
static std::shared_ptr< SequentialInformation > construct(Arguments &args)
Definition construction.hh:160
Dune::Amg::ConstructionTraits< OwnerOverlapCopyCommunication< T1, T2 > >::construct
static std::shared_ptr< OwnerOverlapCopyCommunication< T1, T2 > > construct(Arguments &args)
Definition construction.hh:174
Dune::Amg::ConstructionTraits< OwnerOverlapCopyCommunication< T1, T2 > >::Arguments
const OwnerOverlapCopyCommunicationArgs Arguments
Definition construction.hh:172
Dune::Amg::SequentialInformation
Definition pinfo.hh:28
Dune::SolverCategory::Category
Category
Definition solvercategory.hh:23