Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
SystemJacobianFactory.cpp
Go to the documentation of this file.
1
//! @file SystemJacobianFactory.cpp
2
3
// This file is part of Cantera. See License.txt in the top-level directory or
4
// at https://cantera.org/license.txt for license and copyright information.
5
6
#include "
cantera/numerics/SystemJacobianFactory.h
"
7
#include "
cantera/numerics/AdaptivePreconditioner.h
"
8
#include "
cantera/numerics/EigenSparseDirectJacobian.h
"
9
#include "
cantera/oneD/MultiJac.h
"
10
11
namespace
Cantera
12
{
13
14
SystemJacobianFactory
* SystemJacobianFactory::factory() {
15
std::unique_lock<std::mutex> lock(jac_mutex);
16
if
(!s_factory) {
17
s_factory =
new
SystemJacobianFactory;
18
}
19
return
s_factory;
20
};
21
22
void
SystemJacobianFactory::deleteFactory
() {
23
std::unique_lock<std::mutex> lock(jac_mutex);
24
delete
s_factory;
25
s_factory = 0;
26
};
27
28
SystemJacobianFactory
* SystemJacobianFactory::s_factory = 0;
29
std::mutex SystemJacobianFactory::jac_mutex;
30
31
SystemJacobianFactory::SystemJacobianFactory()
32
{
33
reg
(
"Adaptive"
, []() {
return
new
AdaptivePreconditioner
(); });
34
reg
(
"banded-direct"
, []() {
return
new
MultiJac(); });
35
reg
(
"eigen-sparse-direct"
, []() {
return
new
EigenSparseDirectJacobian(); });
36
}
37
38
shared_ptr<SystemJacobian>
newSystemJacobian
(
const
string
& type)
39
{
40
return
shared_ptr<SystemJacobian>(SystemJacobianFactory::factory()->create(type));
41
};
42
43
}
AdaptivePreconditioner.h
Declarations for the class AdaptivePreconditioner which is a child class of SystemJacobian for precon...
EigenSparseDirectJacobian.h
MultiJac.h
SystemJacobianFactory.h
Cantera::AdaptivePreconditioner
AdaptivePreconditioner a preconditioner designed for use with large mechanisms that leverages sparse ...
Definition
AdaptivePreconditioner.h:24
Cantera::Factory< SystemJacobian >::reg
void reg(const string &name, function< SystemJacobian *(Args...)> f)
Definition
FactoryBase.h:80
Cantera::SystemJacobianFactory
Factory class to create Jacobian objects for use by linear solvers.
Definition
SystemJacobianFactory.h:19
Cantera::SystemJacobianFactory::deleteFactory
void deleteFactory() override
Virtual abstract function that deletes the factory.
Definition
SystemJacobianFactory.cpp:22
Cantera
Namespace for the Cantera kernel.
Definition
AnyMap.cpp:595
Cantera::newSystemJacobian
shared_ptr< SystemJacobian > newSystemJacobian(const string &type)
Create a SystemJacobian object of the specified type.
Definition
SystemJacobianFactory.cpp:38
src
numerics
SystemJacobianFactory.cpp
Generated by
1.17.0