Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
remainder
example
SolverFactory
PackageB.cpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Teuchos: Common Tools Package
4
//
5
// Copyright 2004 NTESS and the Teuchos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#include "
PackageB.hpp
"
11
12
namespace
B
{
13
14
// Creating an instance of this "object" registers B::FactoryB<MV,
15
// OP> with the central registry of packages' factories. That lets
16
// B::getLinearSolver create solvers from package B.
17
template
<
class
MV,
class
OP,
class
NormType>
18
class
RegisterFactoryB
{
19
public
:
20
RegisterFactoryB
() {
21
#ifdef HAVE_TEUCHOSCORE_CXX11
22
typedef
std::shared_ptr<Trilinos::Details::LinearSolverFactory<MV, OP, NormType> > ptr_type;
23
#else
24
typedef
Teuchos::RCP<Trilinos::Details::LinearSolverFactory<MV, OP, NormType>
> ptr_type;
25
#endif // HAVE_TEUCHOSCORE_CXX11
26
27
ptr_type factory (
new
FactoryB<MV, OP, NormType>
());
28
Trilinos::Details::registerLinearSolverFactory<MV, OP, NormType> (
"B"
, factory);
29
}
30
};
31
32
}
// namespace B
33
34
namespace
{
// (anonymous)
35
//
36
// See PackageA.cpp for an explanation of the macro and its use.
37
//
38
#define INSTMACRO( SCALAR ) \
39
B::RegisterFactoryB< Common::MultiVector< SCALAR >, Common::Operator< SCALAR >, SCALAR > registerer_##SCALAR;
40
41
//B::RegisterFactoryB< Common::MultiVector<double>, Common::Operator<double>, double > registerer_double;
42
INSTMACRO
(
double
)
43
44
//B::RegisterFactoryB< Common::MultiVector<float>, Common::Operator<float>, float > registerer_float;
45
INSTMACRO
(
float
)
46
47
}
// namespace (anonymous)
48
B::RegisterFactoryB
Definition:
PackageB.cpp:18
B
Definition:
core/test/dyn_cast/cxx_main.cpp:16
PackageB.hpp
B::FactoryB
Definition:
PackageB.hpp:71
B::RegisterFactoryB::RegisterFactoryB
RegisterFactoryB()
Definition:
PackageB.cpp:20
INSTMACRO
#define INSTMACRO(SCALAR)
Definition:
PackageB.cpp:38
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition:
Teuchos_RCPDecl.hpp:397
Generated on Fri Dec 20 2024 09:21:21 for Teuchos Package Browser (Single Doxygen Collection) by
1.8.5