-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from lanl/dholladay00/sap_ramp
Dholladay00/sap ramp
- Loading branch information
Showing
16 changed files
with
670 additions
and
72 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.. _modifiers: | ||
|
||
EOS Modifiers | ||
============== | ||
|
||
An equation of state modifier (perhaps intuitively) *modifies* an | ||
equation of state in some pre-prescribed way. For example, one can use | ||
a modifier to shift the assumed zero-point energy of the equation of | ||
state, add a unit system, or account for porosity. |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
//------------------------------------------------------------------------------ | ||
// © 2021-2022. Triad National Security, LLC. All rights reserved. This | ||
// program was produced under U.S. Government contract 89233218CNA000001 | ||
// for Los Alamos National Laboratory (LANL), which is operated by Triad | ||
// National Security, LLC for the U.S. Department of Energy/National | ||
// Nuclear Security Administration. All rights in the program are | ||
// reserved by Triad National Security, LLC, and the U.S. Department of | ||
// Energy/National Nuclear Security Administration. The Government is | ||
// granted for itself and others acting on its behalf a nonexclusive, | ||
// paid-up, irrevocable worldwide license in this material to reproduce, | ||
// prepare derivative works, distribute copies to the public, perform | ||
// publicly and display publicly, and to permit others to do so. | ||
//------------------------------------------------------------------------------ | ||
|
||
#ifndef SINGULARITY_EOS_BASE_ROBUST_UTILS_HPP_ | ||
#define SINGULARITY_EOS_BASE_ROBUST_UTILS_HPP_ | ||
|
||
#include <limits> | ||
#include <ports-of-call/portability.hpp> | ||
|
||
namespace singularity { | ||
namespace robust { | ||
|
||
template <typename T = Real> | ||
PORTABLE_FORCEINLINE_FUNCTION constexpr auto SMALL() { | ||
return 10 * std::numeric_limits<T>::min(); | ||
} | ||
|
||
template <typename T = Real> | ||
PORTABLE_FORCEINLINE_FUNCTION constexpr auto EPS() { | ||
return 10 * std::numeric_limits<T>::epsilon(); | ||
} | ||
|
||
template <typename T> | ||
PORTABLE_FORCEINLINE_FUNCTION auto make_positive(const T val) { | ||
return std::max(val, EPS<T>()); | ||
} | ||
|
||
PORTABLE_FORCEINLINE_FUNCTION | ||
Real make_bounded(const Real val, const Real vmin, const Real vmax) { | ||
return std::min(std::max(val, vmin + EPS()), vmax * (1.0 - EPS())); | ||
} | ||
|
||
template <typename T> | ||
PORTABLE_FORCEINLINE_FUNCTION int sgn(const T &val) { | ||
return (T(0) <= val) - (val < T(0)); | ||
} | ||
|
||
template <typename A, typename B> | ||
PORTABLE_FORCEINLINE_FUNCTION auto ratio(const A &a, const B &b) { | ||
return a / (b + sgn(b) * SMALL<B>()); | ||
} | ||
|
||
} // namespace robust | ||
} // namespace singularity | ||
|
||
#endif // SINGULARITY_EOS_BASE_ROBUST_UTILS_HPP_ |
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
Oops, something went wrong.