-
Notifications
You must be signed in to change notification settings - Fork 9
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
Dholladay00/scaleshift fortran #15
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5a4b753
Initial changes to c/c++ interface of singularity to account for modi…
dholladay00 1757364
Whitespace changes and fortran interface changes necessary for EAP.
dholladay00 fe91002
Merge branch 'main' into dholladay00/scaleshift_fortran
dholladay00 bcf567f
This commit places non-modifying overloads outside of the C scope.
dholladay00 b274531
Bumping minor version number in prep for merge with main and new rele…
dholladay00 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 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 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 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 |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
//------------------------------------------------------------------------------ | ||
|
||
#include "singularity_eos.hpp" | ||
#include "eos_builder.hpp" | ||
#include <map> | ||
#include <algorithm> | ||
#include <cassert> | ||
|
@@ -34,39 +35,48 @@ int init_sg_eos(const int nmat, EOS* &eos) { | |
return 0; | ||
} | ||
|
||
#define SGAPPLYMOD(A) \ | ||
EOSBuilder::applyShiftAndScale(A, enabled[0] == 1, enabled[1] == 1,\ | ||
vals[0], vals[1]) | ||
Comment on lines
+38
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clever. |
||
|
||
int init_sg_IdealGas(const int matindex, EOS* eos, const double gm1, | ||
const double Cv) { | ||
const double Cv, | ||
int const * const enabled, double const * const vals) { | ||
assert(matindex >= 0); | ||
EOS eos_ = IdealGas(gm1, Cv); | ||
EOS eos_ = SGAPPLYMOD(IdealGas(gm1, Cv)); | ||
eos[matindex] = eos_.GetOnDevice(); | ||
return 0; | ||
} | ||
|
||
int init_sg_Gruneisen(const int matindex, EOS* eos, const double C0, | ||
const double s1, const double s2, const double s3, | ||
const double G0, const double b, const double rho0, | ||
const double T0, const double P0, const double Cv) { | ||
const double T0, const double P0, const double Cv, | ||
int const * const enabled, double const * const vals) { | ||
assert(matindex >= 0); | ||
EOS eos_ = Gruneisen(C0, s1, s2, s3, G0, b, rho0, T0, P0, Cv); | ||
EOS eos_ = SGAPPLYMOD(Gruneisen(C0, s1, s2, s3, G0, b, rho0, T0, P0, Cv)); | ||
eos[matindex] = eos_.GetOnDevice(); | ||
return 0; | ||
} | ||
|
||
int init_sg_JWL(const int matindex, EOS* eos, const double A, | ||
const double B, const double R1, const double R2, | ||
const double w, const double rho0, const double Cv) { | ||
const double w, const double rho0, const double Cv, | ||
int const * const enabled, double const * const vals) { | ||
assert(matindex >= 0); | ||
EOS eos_ = JWL(A, B, R1, R2, w, rho0, Cv); | ||
EOS eos_ = SGAPPLYMOD(JWL(A, B, R1, R2, w, rho0, Cv)); | ||
eos[matindex] = eos_.GetOnDevice(); | ||
return 0; | ||
} | ||
|
||
int init_sg_DavisProducts(const int matindex, EOS* eos, const double a, | ||
const double b, const double k, const double n, | ||
const double vc, const double pc, const double Cv, | ||
const double E0) { | ||
const double E0, | ||
int const * const enabled, | ||
double const * const vals) { | ||
assert(matindex >= 0); | ||
EOS eos_ = DavisProducts(a, b, k, n, vc, pc, Cv, E0); | ||
EOS eos_ = SGAPPLYMOD(DavisProducts(a, b, k, n, vc, pc, Cv, E0)); | ||
eos[matindex] = eos_.GetOnDevice(); | ||
return 0; | ||
} | ||
|
@@ -75,39 +85,49 @@ int init_sg_DavisReactants(const int matindex, EOS* eos, | |
const double rho0, const double e0, const double P0, | ||
const double T0, const double A, const double B, | ||
const double C, const double G0, const double Z, | ||
const double alpha, const double Cv0) { | ||
const double alpha, const double Cv0, | ||
int const * const enabled, | ||
double const * const vals) { | ||
assert(matindex >= 0); | ||
EOS eos_ = DavisReactants(rho0, e0, P0, T0, A, B, C, G0, Z, alpha, Cv0); | ||
EOS eos_ = | ||
SGAPPLYMOD(DavisReactants(rho0, e0, P0, T0, A, B, C, G0, Z, alpha, Cv0)); | ||
eos[matindex] = eos_.GetOnDevice(); | ||
return 0; | ||
} | ||
|
||
#ifdef SPINER_USE_HDF | ||
int init_sg_SpinerDependsRhoT(const int matindex, EOS* eos, | ||
const char* filename, const int matid) { | ||
const char* filename, const int matid, | ||
int const * const enabled, | ||
double const * const vals) { | ||
assert(matindex >= 0); | ||
EOS eos_ = SpinerEOSDependsRhoT(std::string(filename), matid); | ||
EOS eos_ = SGAPPLYMOD(SpinerEOSDependsRhoT(std::string(filename), matid)); | ||
eos[matindex] = eos_.GetOnDevice(); | ||
return 0; | ||
} | ||
|
||
int init_sg_SpinerDependsRhoSie(const int matindex, EOS* eos, | ||
const char* filename, const int matid) { | ||
const char* filename, const int matid, | ||
int const * const enabled, | ||
double const * const vals) { | ||
assert(matindex >= 0); | ||
EOS eos_ = SpinerEOSDependsRhoSie(std::string(filename), matid); | ||
EOS eos_ = SGAPPLYMOD(SpinerEOSDependsRhoSie(std::string(filename), matid)); | ||
eos[matindex] = eos_.GetOnDevice(); | ||
return 0; | ||
} | ||
#endif | ||
|
||
#ifdef SINGULARITY_USE_EOSPAC | ||
int init_sg_eospac(const int matindex, EOS* eos, const int id) { | ||
int init_sg_eospac(const int matindex, EOS* eos, const int id, | ||
int const * const enabled, double const * const vals) { | ||
assert(matindex >= 0); | ||
EOS eos_ = EOSPAC(id); | ||
EOS eos_ = SGAPPLYMOD(EOSPAC(id)); | ||
eos[matindex] = eos_.GetOnDevice(); | ||
} | ||
#endif // SINGULARITY_USE_EOSPAC | ||
|
||
#undef SGAPPLYMOD | ||
|
||
#ifdef PORTABILITY_STRATEGY_KOKKOS | ||
using Lrgt = Kokkos::LayoutRight; | ||
template< typename T> | ||
|
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.
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.
If this is the canonical form used in rage, should we remove support for the other one?
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.
I'm not sure it hurts anything to leave it there, but I'm not opposed to removing it either.
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.
Well let's leave it for now, I suppose. Because riot does it that way. But we should probably unify that at some point.