-
Notifications
You must be signed in to change notification settings - Fork 2
Changed behaviour with setPT() #16
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7ab6566
Merge pull request #2 from gemshub/master
sdmytrievs 13f4670
setPT() :return bool: True if PT was set correctly, False if out of r…
sdmytrievs b528d9a
Build with unlimited phase and substance names
sdmytrievs 0e71a25
Add to c++ API if the index species from name, an optional parameter,…
sdmytrievs f86e693
Add to Python API if the index species from name, an optional paramet…
sdmytrievs 773c600
Implemented for xGems API: log warning and do nothing if not a valid …
sdmytrievs 2ca3437
Implemented tests for using the new xGems C++ and Python API
sdmytrievs 4bcbcd4
Update environment.devenv.yml
sdmytrievs f931714
Update environment.devenv.yml
sdmytrievs 25fc0fa
Merge pull request #3 from sdmytrievs/check_limits
sdmytrievs 6607c8d
Implemented overloaded functions that use index/name to get propertie…
sdmytrievs 789242e
Implemented overloaded functions ... (part 2)
sdmytrievs b70d3fa
Add checks to ChemicalEngineMaps
sdmytrievs 13c208f
Check pull request
sdmytrievs 017cc54
Apply suggestion from @coderabbitai[bot]
gdmiron f051d34
Update demos/demo2.py
sdmytrievs 79e3818
Changes suggested by CodeRabbit
sdmytrievs 7c4460e
Changes suggested by CodeRabbit
sdmytrievs 45e7a96
Change version to 2.1.0
sdmytrievs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # xGEMS is a C++ and Python library for thermodynamic modeling by Gibbs energy minimization | ||
| # | ||
| # Copyright (C) 2018 Allan Leal, Dmitrii Kulik | ||
| # | ||
| # This program is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation, either version 3 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| from xgems import * | ||
| from numpy import * | ||
|
|
||
| #connect all loggers | ||
| update_loggers(True, "test_demo1.log", 3) | ||
|
|
||
| engine = ChemicalEngine("resources/solvus2/series1-dat.lst") | ||
|
gdmiron marked this conversation as resolved.
|
||
|
|
||
| T = engine.temperature() | ||
| P = engine.pressure() | ||
| b = engine.elementAmounts() | ||
|
|
||
| engine.equilibrate(T, P, b) | ||
|
|
||
| # SetPT test | ||
| print("setPT(101325, 298.15)", engine.setPT(101325, 298.15) ) | ||
| print("setPT(50000000, 673.15)", engine.setPT(50000000, 673.15) ) | ||
|
|
||
| # long names | ||
| ispecies1 = engine.indexSpecies("Anorthite_long_substance_name") | ||
| ispecies2 = engine.indexSpecies("Anorthite_long_substance_name", "Plagioclase") | ||
| ispecies3 = engine.indexSpecies("Anorthite") | ||
| print(ispecies1, " ",ispecies2, " ",ispecies3, " ") | ||
|
|
||
| print(engine.speciesName(ispecies1), " ", engine.speciesName(ispecies2), " ",engine.speciesName(ispecies3)) | ||
|
|
||
| iphase1= engine.indexPhase("Kaolinite_long_phase_name"); | ||
| print(iphase1, " ", engine.phaseName(iphase1)) | ||
| iphase2= engine.indexPhase("Kaolinite"); | ||
| print(iphase2, " ", engine.phaseName(iphase2)) | ||
|
|
||
| #indexSpecies dependen on phase optional | ||
| print(engine.speciesAmount(ispecies1), " ", engine.speciesAmount(ispecies2)) | ||
| engine.setSpeciesAmount("Anorthite_long_substance_name", 10) | ||
| engine.setSpeciesAmount("Anorthite_long_substance_name", 20, "Plagioclase") | ||
| print(engine.speciesAmount(ispecies1), " ", engine.speciesAmount(ispecies2)) | ||
|
|
||
| print("Albite indexes\n", engine.indexSpeciesMap("Albite")) | ||
| print("Quartz indexes\n", engine.indexSpeciesMap("Quartz")) | ||
|
|
||
| # warning messages required | ||
| print(engine.phaseSpecificVolume(2)) | ||
| print(engine.phaseSpecificVolume(30)) | ||
| print(engine.phaseSpecificVolume(-1)) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| -j "series1-dch.json" "series1-ipm.json" "series1-dbr-0-0000.json" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.