Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
wrappers.h
1
// This file is part of Cantera. See License.txt in the top-level directory or
2
// at https://cantera.org/license.txt for license and copyright information.
3
4
#ifndef CT_PY_WRAPPERS_H
5
#define CT_PY_WRAPPERS_H
6
7
#include "
cantera/base/Array.h
"
8
9
// Function for assigning elements of Array2D, since Cython has trouble
10
// with assigning to the reference returned by operator()
11
inline
void
CxxArray2D_set(
Cantera::Array2D
& array,
size_t
i,
size_t
j,
double
value)
12
{
13
array(i,j) = value;
14
}
15
16
// Function which populates a 1D array
17
#define ARRAY_FUNC(PREFIX, CLASS_NAME, FUNC_NAME) \
18
inline void PREFIX ## _ ## FUNC_NAME(Cantera::CLASS_NAME* object, std::span<double> data) \
19
{ object->FUNC_NAME(data); }
20
21
// function which takes a stride as the first argument and populates a 2D array
22
#define ARRAY_FUNC2(PREFIX, CLASS_NAME, FUNC_NAME) \
23
inline void PREFIX ## _ ## FUNC_NAME(Cantera::CLASS_NAME* object, size_t dim, std::span<double> data) \
24
{ object->FUNC_NAME(dim, data); }
25
26
// Function which populates a 1D array, extra arguments
27
#define ARRAY_POLY(PREFIX, CLASS_NAME, FUNC_NAME) \
28
inline void PREFIX ## _ ## FUNC_NAME(Cantera::CLASS_NAME* object, size_t i, std::span<double> data) \
29
{ object->FUNC_NAME(i, data); }
30
31
#define ARRAY_POLY_BINARY(PREFIX, CLASS_NAME, FUNC_NAME) \
32
inline void PREFIX ## _ ## FUNC_NAME(Cantera::CLASS_NAME* object, size_t i, size_t j, std::span<double> data) \
33
{ object->FUNC_NAME(i, j, data); }
34
35
#endif
Array.h
Header file for class Cantera::Array2D.
Cantera::Array2D
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition
Array.h:32
include
cantera
cython
wrappers.h
Generated by
1.17.0