-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smart clib cabinets / add Solution to clib API #1448
Conversation
26376e1
to
f771e0f
Compare
Codecov Report
@@ Coverage Diff @@
## main #1448 +/- ##
==========================================
+ Coverage 70.94% 71.02% +0.08%
==========================================
Files 369 369
Lines 55259 55558 +299
Branches 18207 18378 +171
==========================================
+ Hits 39201 39462 +261
- Misses 13593 13607 +14
- Partials 2465 2489 +24
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
385b244
to
278203c
Compare
Mole fractions have to be set before T and P; otherwise, the pressure changes. Before the change, the pressure was significantly lower than 5 atm. Also fix incorrect use of 'kin_newFromFile', which causes unintended linkages to default objects that do not raise exceptions but may lead to erroneous results.
278203c
to
6d632db
Compare
6d632db
to
87d5778
Compare
Also add service functions for testing cabinet sizes
b953085
to
331b48d
Compare
As the storage m_table can contain duplicate entries referencing the same object, all entries need to be stored in the reverse lookup table.
e8f2d65
to
c5bf0db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, @ischoegl. Besides the minor suggestions below, I think the one thing that still needs a little bit of work is the error handling for soln_kinetics
, soln_transport
, and soln_adjacent
. I commented on that here: #1448 (comment), but GitHub is probably trying to hide that from you.
@speth ... thanks for the re-review! You probably noticed that I updated the reverse lookup table to prevent memory leaks (see c5bf0db). Otherwise, I believe the clib exception handling should now be addressed. I am stuck on the |
cf04086
to
7935229
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ischoegl, this looks good to me. The last commit I pushed took care of the callback-related errors, so I'll leave the final merge to you.
Thank you, @speth! |
The shared_ptr goes out of scope at the end of the function, deleting the held ThermoPhase right as it's returned. Erroneous behaviour introduced in f3e840d (Cantera#1448).
The shared_ptr goes out of scope at the end of the function, deleting the held ThermoPhase right as it's returned. Erroneous behavior introduced in f3e840d (Cantera#1448).
Revert to original name after SharedCabinet was introduced in Cantera#1448 and the original Cabinet was subsequently removed.
Revert to original name after SharedCabinet was introduced in Cantera#1448 and the original Cabinet was subsequently removed.
Revert to original name after SharedCabinet was introduced in Cantera#1448 and the original Cabinet was subsequently removed.
Revert to original name after SharedCabinet was introduced in Cantera#1448 and the original Cabinet was subsequently removed.
Revert to original name after SharedCabinet was introduced in #1448 and the original Cabinet was subsequently removed.
Revert to original name after SharedCabinet was introduced in Cantera#1448 and the original Cabinet was subsequently removed.
Changes proposed in this pull request
This PR required keeping track of shared pointers to core Cantera objects (
ThermoPhase
,Kinetics
andTransport
) after their construction. Several factory constructors and internal methods that previously used raw pointers or references are replaced by methods that use shared pointers, with the original methods being deprecated.Modifications allowed for consistent tracking of objects behind the
clib
API, where a newSharedCabinet
based on smart pointers is introduced. The new object is adopted forThermoCabinet
,KineticsCabinet
andTransportCabinet
.Other details:
test_problems/clib_test/clib_test.c
SolutionCabinet
based onSharedCabinet
clib
tests based ongoogletests
(run viascons test-clib-gtest
), which now includes tests forctonedim
If applicable, fill in the issue number this pull request is fixing
Fixes #1447
Resolves Cantera/enhancements#158
If applicable, provide an example illustrating new features this pull request is introducing
Solution types can now be loaded directly, i.e.
where parts are obtained as:
Checklist
scons build
&scons test
) and unit tests address code coverage