Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
MultiJac.h
Go to the documentation of this file.
1
//! @file MultiJac.h
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
#ifndef CT_MULTIJAC_H
7
#define CT_MULTIJAC_H
8
9
#include "
cantera/numerics/BandMatrix.h
"
10
#include "
cantera/numerics/SystemJacobian.h
"
11
#include "
OneDim.h
"
12
13
namespace
Cantera
14
{
15
16
/**
17
* Class MultiJac evaluates the Jacobian of a system of equations defined by a
18
* residual function supplied by an instance of class OneDim. The residual
19
* function may consist of several linked 1D domains, with different variables
20
* in each domain.
21
* @ingroup onedUtilsGroup
22
* @ingroup derivGroup
23
*/
24
class
MultiJac :
public
SystemJacobian
25
{
26
public
:
27
MultiJac() =
default
;
28
void
reset
()
override
;
29
const
string
type
()
const override
{
return
"banded-direct"
; }
30
void
setValue
(
size_t
row,
size_t
col,
double
value)
override
;
31
void
initialize
(
size_t
nVars)
override
;
32
void
setBandwidth
(
size_t
bw)
override
;
33
void
updateTransient
(
double
rdt, span<const int> mask)
override
;
34
void
factorize
()
override
{
35
m_mat
.factor();
36
}
37
38
double
& value(
size_t
i,
size_t
j) {
39
return
m_mat
.
value
(i, j);
40
}
41
42
double
value(
size_t
i,
size_t
j)
const
{
43
return
m_mat
.
value
(i, j);
44
}
45
46
void
solve
(span<const double> b, span<double> x)
override
{
47
m_mat
.solve(b, x);
48
}
49
50
int
info
()
const override
{
51
return
m_mat
.info();
52
}
53
54
protected
:
55
BandMatrix
m_mat
;
//!< Underlying matrix storage
56
vector<double>
m_ssdiag
;
//!< Diagonal of the steady-state Jacobian
57
};
58
59
}
60
61
#endif
BandMatrix.h
Declarations for the class BandMatrix which is a child class of GeneralMatrix for banded matrices han...
OneDim.h
SystemJacobian.h
Declarations for class SystemJacobian.
Cantera::BandMatrix
A class for banded matrices, involving matrix inversion processes.
Definition
BandMatrix.h:37
Cantera::BandMatrix::value
double & value(size_t i, size_t j)
Return a changeable reference to element (i,j).
Definition
BandMatrix.cpp:140
Cantera::MultiJac::m_mat
BandMatrix m_mat
Underlying matrix storage.
Definition
MultiJac.h:55
Cantera::MultiJac::updateTransient
void updateTransient(double rdt, span< const int > mask) override
Update the diagonal terms in the Jacobian by using the transient mask .
Definition
MultiJac.cpp:38
Cantera::MultiJac::setBandwidth
void setBandwidth(size_t bw) override
Used to provide system bandwidth for implementations that use banded matrix storage.
Definition
MultiJac.cpp:25
Cantera::MultiJac::setValue
void setValue(size_t row, size_t col, double value) override
Set a value at the specified row and column of the jacobian triplet vector.
Definition
MultiJac.cpp:30
Cantera::MultiJac::factorize
void factorize() override
Factorize the system matrix.
Definition
MultiJac.h:34
Cantera::MultiJac::m_ssdiag
vector< double > m_ssdiag
Diagonal of the steady-state Jacobian.
Definition
MultiJac.h:56
Cantera::MultiJac::type
const string type() const override
Derived type, corresponding to names registered with SystemJacobianFactory.
Definition
MultiJac.h:29
Cantera::MultiJac::solve
void solve(span< const double > b, span< double > x) override
Solve a linear system using the system matrix M.
Definition
MultiJac.h:46
Cantera::MultiJac::reset
void reset() override
Reset parameters as needed.
Definition
MultiJac.cpp:12
Cantera::MultiJac::info
int info() const override
Get latest status of linear solver.
Definition
MultiJac.h:50
Cantera::MultiJac::initialize
void initialize(size_t nVars) override
Called during setup for any processes that need to be completed prior to setup functions used in sund...
Definition
MultiJac.cpp:18
Cantera
Namespace for the Cantera kernel.
Definition
AnyMap.cpp:595
include
cantera
oneD
MultiJac.h
Generated by
1.17.0