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
12
namespace
Cantera
13
{
14
15
/**
16
* Class MultiJac evaluates the Jacobian of a system of equations defined by a
17
* residual function supplied by an instance of class OneDim. The residual
18
* function may consist of several linked 1D domains, with different variables
19
* in each domain.
20
* @ingroup onedUtilsGroup
21
* @ingroup derivGroup
22
*/
23
class
MultiJac :
public
SystemJacobian
24
{
25
public
:
26
MultiJac() =
default
;
27
void
reset
()
override
;
28
const
string
type
()
const override
{
return
"banded-direct"
; }
29
void
setValue
(
size_t
row,
size_t
col,
double
value)
override
;
30
void
initialize
(
size_t
nVars)
override
;
31
void
setBandwidth
(
size_t
bw)
override
;
32
void
updateTransient
(
double
rdt, span<const int> mask)
override
;
33
void
factorize
()
override
{
34
m_mat
.factor();
35
}
36
37
double
& value(
size_t
i,
size_t
j) {
38
return
m_mat
.
value
(i, j);
39
}
40
41
double
value(
size_t
i,
size_t
j)
const
{
42
return
m_mat
.
value
(i, j);
43
}
44
45
void
solve
(span<const double> b, span<double> x)
override
{
46
m_mat
.solve(b, x);
47
}
48
49
int
info
()
const override
{
50
return
m_mat
.info();
51
}
52
53
protected
:
54
BandMatrix
m_mat
;
//!< Underlying matrix storage
55
vector<double>
m_ssdiag
;
//!< Diagonal of the steady-state Jacobian
56
};
57
58
}
59
60
#endif
BandMatrix.h
Declarations for the class BandMatrix which is a child class of GeneralMatrix for banded matrices han...
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:54
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:33
Cantera::MultiJac::m_ssdiag
vector< double > m_ssdiag
Diagonal of the steady-state Jacobian.
Definition
MultiJac.h:55
Cantera::MultiJac::type
const string type() const override
Derived type, corresponding to names registered with SystemJacobianFactory.
Definition
MultiJac.h:28
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:45
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:49
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
numerics
MultiJac.h
Generated by
1.17.0