Skip to content

Commit

Permalink
Rename C++ autodiff template parameter type
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Jul 17, 2024
1 parent 2f735b1 commit 78d4226
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ void evaluate_rates(const burn_t& state, T& rate_eval) {

// Calculate Reaclib rates

using dual_t = std::conditional_t<do_T_derivatives, autodiff::dual, amrex::Real>;
dual_t temp = state.T;
using number_t = std::conditional_t<do_T_derivatives, autodiff::dual, amrex::Real>;
number_t temp = state.T;
if constexpr (do_T_derivatives) {
// seed the dual number for temperature before calculating anything with it
autodiff::seed(temp);
}
plasma_state_t<dual_t> pstate{};
plasma_state_t<number_t> pstate{};
fill_plasma_state(pstate, temp, state.rho, Y);

tf_t tfactors = evaluate_tfactors(state.T);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ void evaluate_rates(const burn_t& state, T& rate_eval) {

// Calculate Reaclib rates

using dual_t = std::conditional_t<do_T_derivatives, autodiff::dual, amrex::Real>;
dual_t temp = state.T;
using number_t = std::conditional_t<do_T_derivatives, autodiff::dual, amrex::Real>;
number_t temp = state.T;
if constexpr (do_T_derivatives) {
// seed the dual number for temperature before calculating anything with it
autodiff::seed(temp);
}
plasma_state_t<dual_t> pstate{};
plasma_state_t<number_t> pstate{};
fill_plasma_state(pstate, temp, state.rho, Y);

tf_t tfactors = evaluate_tfactors(state.T);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ void evaluate_rates(const burn_t& state, T& rate_eval) {

// Calculate Reaclib rates

using dual_t = std::conditional_t<do_T_derivatives, autodiff::dual, amrex::Real>;
dual_t temp = state.T;
using number_t = std::conditional_t<do_T_derivatives, autodiff::dual, amrex::Real>;
number_t temp = state.T;
if constexpr (do_T_derivatives) {
// seed the dual number for temperature before calculating anything with it
autodiff::seed(temp);
}
plasma_state_t<dual_t> pstate{};
plasma_state_t<number_t> pstate{};
fill_plasma_state(pstate, temp, state.rho, Y);

tf_t tfactors = evaluate_tfactors(state.T);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ void evaluate_rates(const burn_t& state, T& rate_eval) {

// Calculate Reaclib rates

using dual_t = std::conditional_t<do_T_derivatives, autodiff::dual, amrex::Real>;
dual_t temp = state.T;
using number_t = std::conditional_t<do_T_derivatives, autodiff::dual, amrex::Real>;
number_t temp = state.T;
if constexpr (do_T_derivatives) {
// seed the dual number for temperature before calculating anything with it
autodiff::seed(temp);
}
plasma_state_t<dual_t> pstate{};
plasma_state_t<number_t> pstate{};
fill_plasma_state(pstate, temp, state.rho, Y);

tf_t tfactors = evaluate_tfactors(state.T);
Expand Down

0 comments on commit 78d4226

Please sign in to comment.