DOLFIN
DOLFIN C++ interface
Toggle main menu visibility
Loading...
Searching...
No Matches
dolfin
la
TpetraFactory.h
1
// Copyright (C) 2014 Chris Richardson
2
//
3
// This file is part of DOLFIN.
4
//
5
// DOLFIN is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU Lesser General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// DOLFIN is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU Lesser General Public License for more details.
14
//
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17
//
18
19
#ifdef HAS_TRILINOS
20
21
#ifndef __TPETRA_FACTORY_H
22
#define __TPETRA_FACTORY_H
23
24
#include <string>
25
#include <memory>
26
#include <dolfin/common/types.h>
27
#include "TpetraVector.h"
28
#include "TensorLayout.h"
29
#include "GenericLinearAlgebraFactory.h"
30
31
namespace
dolfin
32
{
33
35
36
class
TpetraFactory :
public
GenericLinearAlgebraFactory
37
{
38
public
:
39
41
virtual
~TpetraFactory
() {}
42
44
std::shared_ptr<GenericMatrix>
create_matrix
(MPI_Comm comm)
const
;
45
47
std::shared_ptr<GenericVector>
create_vector
(MPI_Comm comm)
const
;
48
50
std::shared_ptr<TensorLayout>
create_layout
(MPI_Comm comm,
51
std::size_t rank)
const
;
52
54
std::shared_ptr<GenericLinearOperator>
55
create_linear_operator
(MPI_Comm comm)
const
;
56
58
std::shared_ptr<GenericLinearSolver>
59
create_lu_solver
(MPI_Comm comm, std::string method)
const
;
60
62
std::shared_ptr<GenericLinearSolver>
63
create_krylov_solver
(MPI_Comm comm,
64
std::string method,
65
std::string preconditioner)
const
;
66
68
std::map<std::string, std::string>
69
lu_solver_methods
()
const
;
70
72
std::map<std::string, std::string>
73
krylov_solver_methods
()
const
;
74
76
std::map<std::string, std::string>
krylov_solver_preconditioners
()
const
;
77
79
static
TpetraFactory&
instance
()
80
{
return
factory; }
81
82
private
:
83
85
TpetraFactory
() {}
86
static
TpetraFactory factory;
87
88
};
89
90
}
91
92
#endif
93
94
#endif
dolfin::GenericLinearAlgebraFactory::GenericLinearAlgebraFactory
GenericLinearAlgebraFactory()
Constructor.
Definition
GenericLinearAlgebraFactory.h:51
dolfin::TpetraFactory
Tpetra linear algebra factory.
Definition
TpetraFactory.h:37
dolfin::TpetraFactory::create_layout
std::shared_ptr< TensorLayout > create_layout(MPI_Comm comm, std::size_t rank) const
Create empty tensor layout.
Definition
TpetraFactory.cpp:46
dolfin::TpetraFactory::~TpetraFactory
virtual ~TpetraFactory()
Destructor.
Definition
TpetraFactory.h:41
dolfin::TpetraFactory::create_vector
std::shared_ptr< GenericVector > create_vector(MPI_Comm comm) const
Create empty vector.
Definition
TpetraFactory.cpp:40
dolfin::TpetraFactory::create_linear_operator
std::shared_ptr< GenericLinearOperator > create_linear_operator(MPI_Comm comm) const
Create empty linear operator.
Definition
TpetraFactory.cpp:55
dolfin::TpetraFactory::create_krylov_solver
std::shared_ptr< GenericLinearSolver > create_krylov_solver(MPI_Comm comm, std::string method, std::string preconditioner) const
Create Krylov solver.
Definition
TpetraFactory.cpp:70
dolfin::TpetraFactory::create_lu_solver
std::shared_ptr< GenericLinearSolver > create_lu_solver(MPI_Comm comm, std::string method) const
Create LU solver.
Definition
TpetraFactory.cpp:64
dolfin::TpetraFactory::create_matrix
std::shared_ptr< GenericMatrix > create_matrix(MPI_Comm comm) const
Create empty matrix.
Definition
TpetraFactory.cpp:35
dolfin::TpetraFactory::instance
static TpetraFactory & instance()
Return singleton instance.
Definition
TpetraFactory.h:79
dolfin
Definition
adapt.h:30
dolfin::krylov_solver_methods
std::map< std::string, std::string > krylov_solver_methods()
Definition
solve.cpp:132
dolfin::lu_solver_methods
std::map< std::string, std::string > lu_solver_methods()
Definition
solve.cpp:127
dolfin::krylov_solver_preconditioners
std::map< std::string, std::string > krylov_solver_preconditioners()
Definition
solve.cpp:137
Generated by
1.18.0