Commit Graph

8438 Commits

Author SHA1 Message Date
Ray Speth
29587eeba5 [SCons] Improve staged installations of Python module
Fixes setup_cantera and the post-install message to reference the path
of the Python module on the target system rather than the staging
directory.

Also, generated .pyc files no long specify the path in the staging
directory. This has no effect on the use of the .pyc files, but helps
avoid warnings/errors from packaging system linters (notably, on
FreeBSD).

Fixes #1094
2021-09-20 12:33:47 -04:00
Ingmar Schoegl
c4d6ecc15a [Kinetics] Improve nomenclature for final step of Kinetics setup
Update nomenclature for previously introduced finalizeSetup method;
new names are Kinetics::resizeReactions and StoichManagerN::resizeCoeffs
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
05c7e7ec7f [Kinetics] Ensure member variables are reset when calling Plog::setRates 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
30bc6cd1c3 [Kinetics] Partially roll back changes to Chebyshev 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
6e37e93cf3 Update formatting 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
38d0b6252a [Python] Switch sparse matrix output to CSC (from COO) format
This change leverages the default internal storage format in Eigen (CSC)
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
a5ad534fe3 [Kinetics] Use compressed sparse matrix format 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
1d2fb9f1b2 [Kinetics] Access Chebyshev coefficients as 'data' 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
e048cc8d2c [Kinetics] Standardize Plog rates access
This commit unifies parameter handling of Plog rate setters and
getters to use std::multimap<...>.
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
160eaf52ff [Unittest] Add test for sparse matrix output 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
4e3aa5b6d6 [Python] Make sparse API more efficient and deprecate *stoich methods
Deprecate Kinetics.*_stoich_coeffs() method in favor of property:
Behavior will change after Cantera 2.6; for new behavior, new properties
Kinetics.*_stoich_coefficients are implemented
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
891584249a [Unittest] Update Chebyshev tests 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
a4873e144a [Kinetics] Streamline Chebyshev interface
Deprecate Tmin/Tmax, Pmin/Pmax as well as constructors to use
std::pair<double,double> input/output
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
618ab3dc4e [Unittest] Skip some tests if h5py is not installed 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
e06830200f [GH] Add scipy to coverage tests 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
2cc52e60cb [Python] Create sparse stoichCoeff API 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
1458440578 [Python] Enable optional scipy.sparse output 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
6af8881b22 [Kinetics] Use sparse stoichcoeff matrices for internal calculations 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
0a40fea67f [Kinetics] Merge irreversible and reversible product StoichManagerN
as Kinetics::m_irrevProductManager is only used in conjunction with
Kinetics::m_revProductManager, a new Kinetics::m_productManager provides
for simpler code.
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
bb634fde2d [Kinetics] Implement mechanism for Kinetics::finalizeSetup
The 'Kinetics::finalizeSetup' method executes code after all reactions
have been added. The new flag 'finalize' is added to 'Kinetics::addReaction'
which determines whether 'finalizeSetup' is executed. While the default
is 'true', imports within 'KineticsManager' use 'addReaction' with the
flag set to 'false'.
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
1d741a0969 [Kinetics] Add sparse stoichiometric coefficients in StoichManager.h 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
fd5af700aa [Kinetics] Remove unused functions from internal StoichManager.h classes
Several internal methods defined for C1, C2, C3, and C_AnyN are unused;
as there are no simple accessor methods defined in StoichManagerN,
deprecation appears not to be required.
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
187cfe55a8 [Kinetics] Update ChebyshevRate interface
* Use consistent interface based on Array2D
* Use column-major consistently in internal calculations
* Deprecate Chebyshev::coeffs and Chebyshev::setup
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
fa86de5895 [Numerics] Update eigen_dense.h and introduce eigen_sparse.h 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
594b5b9e24 [Unittests] Resolve unused variable warning in test-surfSolver2
Resolve GNU g++ warning:

warning: unused variable 'p' [-Wunused-variable]
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
aedf63d61c [Thermo] Fix compilation warning in MixtureFugacityTP.cpp
Compilation with GNU g++ currently raises the following warning.

warning: 'nSolnValues' may be used uninitialized in this function [-Wmaybe-uninitialized]

The warning is resolved by providing an (invalid) initial value; the
value is overwritten by a subsequent (pre-existing) if-else tree.
2021-09-17 11:33:57 -04:00
Ingmar Schoegl
062beaf5b3 Allow for custom NotImplementedError messages 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
d833018412 [UnitTest] Fix true_divide RuntimeWarning in test_kinetics.py 2021-09-17 11:33:57 -04:00
Ingmar Schoegl
086dfcea4c [SCons] Update docstring
'scons help' reports setting values in terms of 'yes' and 'no' rather than
boolean flags that are otherwise used internally. This commit ensures that
documentation for the newly added flag 'legacy-rate-constants' is
consistent with this convention; accordingly, the setting is either enabled
or disabled.
2021-09-17 11:33:57 -04:00
Ray Speth
37599a79e3 Deprecate unused exception classes 2021-09-16 21:00:45 -04:00
Ray Speth
ea993e85a6 Bump version to 2.6.0a3 2021-09-16 21:00:45 -04:00
Ray Speth
c2709d009f [SCons] Fix installation of Python package into stage directory
In the default case where the 'python_prefix' variable is '$prefix',
the Python module would get installed to the literal '$prefix'
subdirectory of the staging directory, instead of actually expanding
the '$prefix' variable.

Fixes a regression introduced in c7a5d1885e.
2021-09-16 21:00:45 -04:00
Ray Speth
de24a3d193 Fix missing "override" specifier on MultiBulkRate::resizeSpecies
This was generating warnings from Clang.
2021-09-16 21:00:45 -04:00
Ray Speth
b3f1a73663 [Test] Skip conversion tests if no Python package is being built
Converting between different mechanism formats require at least
the "minimal" Python package to be built.
2021-09-16 21:00:45 -04:00
Ray Speth
9d5c9d45e1 [Test] Update TransportFromScratch to stop using CTI/XML
This allows these tests to work even when the Python package is not present.
2021-09-16 21:00:45 -04:00
decaluwe
457b1a465c Test molar enthalpy for IdealSolidSolnPhas
- Test that `enthalpy_mole = sum(X_k * h_k)` for `IdealSolidSolnPhase`
class, where `X_k` is mole fraction and `h_k` partial molar enthalpy.
- Also test the pressure independence of this equality, by verifying at
pressures 1 atm and 2 atm.
2021-09-16 10:50:18 -04:00
decaluwe
15e8b5dbfc Fix p-dependence in IdealSolidSolnPhase::getPartialMolarEnthalpies
Addresses #1080
2021-09-16 10:50:18 -04:00
decaluwe
22bb36835d Adding some commenting to IdealSolidSolnPhase
Removing remnant code from a different update on another branch.
2021-09-16 10:50:18 -04:00
Ray Speth
82666058db Simplify implementation of UnitSystem::defaults 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
783f0a0c8c [Units] Improve docstrings 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
b55edca97a [Units] Update checks for unity conversion factor 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
77b6bcb482 [YamlWriter] Set UnitSystem directly with YamlWriter::setUnitSystem 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
e5f5a0e84d [Python] Shorten UnitSystem.__repr__ 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
6a7e43de18 [Python] Disable Units constructors with non-unity conversion factors 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
6e446df141 [Unittest] Add tests for UnitSystem.defaults
Also: remove redundant tests for Units objects.
2021-09-16 10:40:42 -04:00
Ingmar Schoegl
a0f391b5b0 [Unittest] Add unit test for Units::str output 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
022988fbdc [Units] Implement shortened Units::unit_str without factor 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
2583a8cb6e [Units] Simplify Units::str() 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
61e56785eb [Units] Set YamlWriter UnitSystem directly 2021-09-16 10:40:42 -04:00
Ingmar Schoegl
72a131caa2 [Python] Create API for UnitSystem 2021-09-16 10:40:42 -04:00