File Castro_sources.H

Functions

bool source_flag(int src)

Returns true if flag corresponding to source type src is set.

Parameters:

src – integer, index corresponding to source type

bool apply_sources()

Returns whether any sources are actually applied.

static inline int get_output_at_completion()
static void apply_source_to_state(amrex::MultiFab &state, amrex::MultiFab &source, amrex::Real dt, int ng)

Add source terms to state

Parameters:
  • state – State

  • source – Source terms

  • dt – timestep

  • ng – number of ghost cells

void do_old_sources(amrex::MultiFab &Bx, amrex::MultiFab &By, amrex::MultiFab &Bz, amrex::MultiFab &source, amrex::MultiFab &state_old, amrex::MultiFab &state_new, amrex::Real time, amrex::Real dt, bool apply_to_state = true)

Construct source terms at old time

Parameters:
  • source – MultiFab to save sources to

  • state_old – Old state

  • state_new – New state

  • time – the current simulation time

  • dt – the timestep to advance (e.g., go from time to time + dt)

  • apply_to_state – whether to apply the source to state_new

advance_status do_old_sources(amrex::Real time, amrex::Real dt, bool apply_to_state = true)

Construct source terms at old time (convenience wrapper for CTU advance)

Parameters:
  • time – the current simulation time

  • dt – the timestep to advance (e.g., go from time to time + dt)

void construct_old_source(int src, amrex::MultiFab &source, amrex::MultiFab &state, amrex::Real time, amrex::Real dt)

Construct the old-time source

Parameters:
  • src – integer corresponding to source type to construct

  • source – MultiFab to save sources to

  • state – State data

  • time – the current simulation time

  • dt – the timestep to advance (e.g., go from time to time + dt)

void do_new_sources(amrex::MultiFab &Bx, amrex::MultiFab &By, amrex::MultiFab &Bz, amrex::MultiFab &source, amrex::MultiFab &state_old, amrex::MultiFab &state_new, amrex::Real time, amrex::Real dt, bool apply_to_state = true)

Construct new time sources

Parameters:
  • source – MultiFab to save sources to

  • state_old – Old state

  • state_new – New state

  • time – the current simulation time

  • dt – the timestep to advance (e.g., go from time to time + dt)

  • apply_to_state – whether to apply the source to state_new

advance_status do_new_sources(amrex::Real time, amrex::Real dt)

Construct new time sources (convenience wrapper for CTU advance)

Parameters:
  • time – the current simulation time

  • dt – the timestep to advance (e.g., go from time to time + dt)

void construct_new_source(int src, amrex::MultiFab &source, amrex::MultiFab &state_old, amrex::MultiFab &state_new, amrex::Real time, amrex::Real dt)

Construct the new-time sources.

Parameters:
  • src – Integer corresponding to type of source to construct

  • source – MultiFab to save source to

  • state_old – Old state

  • state_new – New state

  • time – the current simulation time

  • dt – t he timestep to advance (e.g., go from time to time + dt)

amrex::Vector<amrex::Real> evaluate_source_change(const amrex::MultiFab &source, amrex::Real dt, bool local = false)

Evaluate diagnostics quantities describing the effect of an update on the state. The optional parameter local determines whether we want to do this calculation globally over all processes or locally just on this processor. The latter is useful if you are evaluating the contribution from multiple source changes at once and want to amortize the cost of the parallel reductions. Note that the resultant output is volume-weighted.

Parameters:
  • source – MultiFab containing source

  • dt – timestep

  • local – boolean, do we want to do this calculation globally over all processes or locally just on this processor?

static void print_source_change(const amrex::Vector<amrex::Real> &update)

Print the change due to a given source term update. We assume here that the input array is lined up with the NUM_STATE components of State_Type because we are interested in printing changes to energy, mass, etc.

Parameters:

update – Real Vector of changes

void print_all_source_changes(amrex::Real dt, bool is_new)

For the old-time or new-time sources update, evaluate the change in the state for all source terms, then print the results.

Parameters:
  • dt – timestep

  • is_new – boolean, do we get the new or old state data?

void evaluate_and_print_source_change(const amrex::MultiFab &source, amrex::Real dt, const std::string &source_name)

Evaluate the change to the state due to sources and then print it.

Parameters:
  • source – update to the state

  • dt – timestep (will multiply the update)

  • source_name – string to associate with this source

static void time_center_source_terms(amrex::MultiFab &S_new, amrex::MultiFab &src_old, amrex::MultiFab &src_new, amrex::Real dt = 1.0)

Center source terms in time, storing in S_new

Parameters:
  • S_new – MultiFab to store centered sources in

  • src_old – Old source term

  • src_new – New source term

  • dt – timestep

static void construct_old_sponge_source(amrex::MultiFab &source, amrex::MultiFab &state, amrex::Real time, amrex::Real dt)

Construct sponge source terms at old timestep

Parameters:
  • source – MultiFab to save source terms to

  • state – Old state

  • time – current time

  • dt – timestep

void construct_new_sponge_source(amrex::MultiFab &source, amrex::MultiFab &state_old, amrex::MultiFab &state_new, amrex::Real time, amrex::Real dt)

Construct sponge source terms at new timestep

Parameters:
  • source – MultiFab to save source terms to

  • state_old – Old state

  • state_new – New state

  • time – current time

  • dt – timestep

void apply_sponge(const amrex::Box &bx, amrex::Array4<amrex::Real const> const state, amrex::Array4<amrex::Real> const source, amrex::Real dt)

Compute the sponge source given a state

Parameters:
  • bx – Box to operate over

  • state – input state

  • source – source incremented with the sponge

  • dt – timestep

void construct_old_ext_source(amrex::MultiFab &source, amrex::MultiFab &state, amrex::Real time, amrex::Real dt)

Create external source terms at old timestep

Parameters:
  • source – MultiFab to save source terms to

  • state – Old state

  • time – current time

  • dt – timestep

void construct_new_ext_source(amrex::MultiFab &source, amrex::MultiFab &state_old, amrex::MultiFab &state_new, amrex::Real time, amrex::Real dt)

Create external source terms at new timestep

Parameters:
  • source – MultiFab to save source terms to

  • state_old – Old state

  • state_new – New state

  • time – current time

  • dt – timestep

void fill_ext_source(const amrex::Real time, const amrex::Real dt, const amrex::MultiFab &state_old, const amrex::MultiFab &state_new, amrex::MultiFab &ext_src)

Fill ext_src with external sources

Parameters:
  • time – current time

  • dt – timestep

  • state_old – Old state

  • state_new – New state

  • ext_src – MultiFab to save sources to

void construct_old_thermo_source(amrex::MultiFab &source, amrex::MultiFab &state, amrex::Real time, amrex::Real dt)

Construct thermal sources at old timestep

Parameters:
  • source – MultiFab to save sources to

  • state – Old state

  • time – current time

  • dt – timestep

void construct_new_thermo_source(amrex::MultiFab &source, amrex::MultiFab &state_old, amrex::MultiFab &state_new, amrex::Real time, amrex::Real dt)

Construct thermal sources at new timestep

Parameters:
  • source – MultiFab to save sources to

  • state_old – Old state

  • state_new – New state

  • time – current time

  • dt – timestep

void fill_thermo_source(amrex::MultiFab &state_in, amrex::MultiFab &thermo_src)

Fill ext_src with thermal sources

Parameters:
  • state_in – input state

  • thermo_src – MultiFab to fill with sources

void construct_old_geom_source(amrex::MultiFab &source, amrex::MultiFab &state, amrex::Real time, amrex::Real dt)

Construct axisymmetric geometry source at old timestep

Parameters:
  • source – MultiFab to save sources to

  • state – Old state

  • time – current time

  • dt – timestep

void construct_new_geom_source(amrex::MultiFab &source, amrex::MultiFab &state_old, amrex::MultiFab &state_new, amrex::Real time, amrex::Real dt)

Construct axisymmetric geometry source at new timestep

Parameters:
  • source – MultiFab to save sources to

  • state_old – Old state

  • state_new – New state

  • time – current time

  • dt – timestep

void fill_RZ_geom_source(amrex::Real time, amrex::Real dt, amrex::MultiFab &cons_state, amrex::MultiFab &geom_src)

Fill ext_src with 2D cylindrical R-Z geometry sources

Parameters:
  • time – current time

  • dt – timestep

  • S – state

  • ext_src – MultiFab to fill with sources

void fill_RTheta_geom_source(amrex::Real time, amrex::Real dt, amrex::MultiFab &cons_state, amrex::MultiFab &geom_src)

Fill ext_src with 2D spherical R-Theta geometry sources

Parameters:
  • time – current time

  • dt – timestep

  • S – state

  • ext_src – MultiFab to fill with sources

advance_status pre_advance_operators(amrex::Real time, amrex::Real dt)

Perform all operations that occur prior to computing the predictor sources and the hydro advance.

Parameters:
  • time – current time

  • dt – timestep

advance_status pre_hydro_operators(amrex::Real time, amrex::Real dt)

Perform all operations that occur after computing the predictor sources but before the hydro advance.

Parameters:
  • time – current time

  • dt – timestep

advance_status post_hydro_operators(amrex::Real time, amrex::Real dt)

Perform all operations that occur after the hydro source but before the corrector sources.

Parameters:
  • time – current time

  • dt – timestep

advance_status post_advance_operators(amrex::Real time, amrex::Real dt)

Perform all operations that occur after the corrector sources.

Parameters:
  • time – current time

  • dt – timestep