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
PackageC.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 "
PackageC.hpp
"
11
12
namespace
C
{
13
14
// Creating an instance of this "object" registers C::FactoryC<MV,
15
// OP> with the central registry of packages' factories. That lets
16
// C::getLinearSolver create solvers from package C.
17
template
<
class
MV,
class
OP,
class
NormType>
18
class
RegisterFactoryC
{
19
public
:
20
RegisterFactoryC
() {
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
FactoryC<MV, OP, NormType>
());
28
Trilinos::Details::registerLinearSolverFactory<MV, OP, NormType> (
"C"
, factory);
29
}
30
};
31
32
}
// namespace C
33
34
namespace
{
// (anonymous)
35
//
36
// See PackageA.cpp for an explanation of the macro and its use.
37
//
38
#define INSTMACRO( SCALAR ) \
39
C::RegisterFactoryC< Common::MultiVector< SCALAR >, Common::Operator< SCALAR >, SCALAR > registerer_##SCALAR;
40
41
//C::RegisterFactoryC< Common::MultiVector<double>, Common::Operator<double>, double > registerer_double;
42
INSTMACRO
(
double
)
43
44
//C::RegisterFactoryC< Common::MultiVector<float>, Common::Operator<float>, float > registerer_float;
45
INSTMACRO
(
float
)
46
47
}
// namespace (anonymous)
48
PackageC.hpp
C
Definition:
core/example/RefCountPtr/cxx_main.cpp:21
C::RegisterFactoryC::RegisterFactoryC
RegisterFactoryC()
Definition:
PackageC.cpp:20
INSTMACRO
#define INSTMACRO(SCALAR)
Definition:
PackageC.cpp:38
C::FactoryC
Definition:
PackageC.hpp:63
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition:
Teuchos_RCPDecl.hpp:397
C::RegisterFactoryC
Definition:
PackageC.cpp:18
Generated on Thu Nov 21 2024 09:21:38 for Teuchos Package Browser (Single Doxygen Collection) by
1.8.5