Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ if (USE_NETCDF)
target_link_libraries(aether PUBLIC ${NETCDF_LIBRARIES_C})
endif()

# use_old_timing
# cmake -DUSE_OLD_TIMING=ON ..
option(USE_OLD_TIMING "Use old timing for performance - default is off" OFF)
if (USE_OLD_TIMING)
add_definitions(-DOLD_TIMING)
set(OLD_TIMING "YES")
endif()

# Set up links for executable
file(CREATE_LINK ${CMAKE_BINARY_DIR}/aether
${PROJECT_SOURCE_DIR}/share/run/aether SYMBOLIC)
Expand Down
2 changes: 1 addition & 1 deletion include/aurora.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ arma_vec calculate_fang(float eflux, // in ergs/cm2/s
* param ions the class that contains all info about the ions
**/

void calc_aurora(Grid grid,
void calc_aurora(Grid &grid,
Neutrals &neutrals,
Ions &ions);

Expand Down
2 changes: 1 addition & 1 deletion include/calc_euv.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// -------------------------------------------------------------------------

bool calc_euv(Planets planet,
Grid grid,
Grid &grid,
Times time,
Euv &euv,
Neutrals &neutrals,
Expand Down
2 changes: 1 addition & 1 deletion include/chemistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Chemistry {
void calc_chemistry(Neutrals &neutrals,
Ions &ions,
Times time,
Grid grid);
Grid &grid);

void calc_chemical_sources(Neutrals &neutrals,
Ions &ions);
Expand Down
32 changes: 16 additions & 16 deletions include/ions.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ class Ions {
\param grid The grid to define the ions on
\param planet contains information about the species to simulate
**/
Ions(Grid grid, Planets planet);
Ions(Grid &grid, Planets planet);

/**********************************************************************
\brief Creates the variables within the species_chars structure
\param grid The grid to define the ions on
**/
species_chars create_species(Grid grid);
species_chars create_species(Grid &grid);

/**********************************************************************
\brief
Expand All @@ -248,7 +248,7 @@ class Ions {
\param neutrals the neutral class to grab the temperature from
\param grid The grid that the ions are defined on
**/
void init_ion_temperature(Neutrals neutrals, Grid grid);
void init_ion_temperature(Neutrals neutrals, Grid &grid);

/**********************************************************************
\brief Sets the floor of the ion densities, just in case!
Expand Down Expand Up @@ -290,28 +290,28 @@ class Ions {
\param time The time class to get dt and the current time
\param indices The indices class to get different indices that may be needed
**/
bool set_bcs(Grid grid, Times time, Indices indices);
bool set_bcs(Grid &grid, Times time, Indices indices);

/**********************************************************************
\brief Sets the upper boundary conditions for the ions
\param grid The grid that the ions are defined on
**/
bool set_upper_bcs(Grid grid);
bool set_upper_bcs(Grid &grid);

/**********************************************************************
\brief Sets the lower boundary condition for the ions
\param grid The grid that the ions are defined on
\param time The time class to get dt and the current time
\param indices The indices class to get different indices that may be needed
**/
bool set_lower_bcs(Grid grid, Times time, Indices indices);
bool set_lower_bcs(Grid &grid, Times time, Indices indices);

/**********************************************************************
\brief Advect the ions along the 3rd dimension (could be altitude)
\param grid The grid that the ions are defined on
\param time The time class to get dt and the current time
**/
bool advect_vertical(Grid grid, Times time);
bool advect_vertical(Grid &grid, Times time);

/**********************************************************************
\brief Get the ID of the ion species with the given name
Expand All @@ -323,24 +323,24 @@ class Ions {
\brief Calculates the electric field
\param grid The grid that the ions are defined on
**/
void calc_efield(Grid grid);
void calc_efield(Grid &grid);

/**********************************************************************
\brief Calculates the E x B drift
\param grid The grid that the ions are defined on
**/
void calc_exb_drift(Grid grid);
void calc_exb_drift(Grid &grid);

/**********************************************************************
\brief Calculate the ion drift
\param neutrals these are needed for the collision terms
\param grid The grid that the ions are defined on
\param dt the delta-t for the current time
**/
void calc_ion_drift(Neutrals neutrals,
Grid grid,
precision_t dt);

void calc_ion_drift(Neutrals &neutrals,
Grid &grid,
precision_t dt);
/**********************************************************************
\brief Calculate the ion + electron pressure gradient
\param iIon which ion to act upon
Expand All @@ -355,15 +355,15 @@ class Ions {
\param grid this is the grid to solve the equation on
\param time the time class to know dt
**/
void calc_ion_temperature(Neutrals neutrals, Grid grid, Times time);
void calc_ion_temperature(const Neutrals &neutrals, Grid &grid, Times time);

/**********************************************************************
\brief Calculates the electron temperature on the given grid
\param neutrals these are needed for the collision terms
\param grid this is the grid to solve the equation on
\param time the time class to know dt
**/
void calc_electron_temperature(Neutrals neutrals, Grid grid, Times time);
void calc_electron_temperature(Neutrals neutrals, Grid &grid, Times time);

/**********************************************************************
/// @brief Calculate epsilon
Expand Down Expand Up @@ -464,7 +464,7 @@ class Ions {
\param grid The grid to define the neutrals on
\param time contains information about the current time
**/
void solver_vertical_rusanov(Grid grid, Times time);
void solver_vertical_rusanov(Grid &grid, Times time);

};
#endif // INCLUDE_IONS_H_
66 changes: 33 additions & 33 deletions include/neutrals.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,16 @@ class Neutrals {
\param time contains information about the current time
\param indices used to help set initial conditions
**/
Neutrals(Grid grid,
Planets planet,
Times time,
Indices indices);
Neutrals(Grid &grid,
Planets planet,
Times time,
Indices indices);

/**********************************************************************
\brief Creates the variables within the species_chars structure
\param grid The grid to define the neutrals on
**/
species_chars create_species(Grid grid);
species_chars create_species(Grid &grid);

/**********************************************************************
\brief Read in the planet-specific file
Expand All @@ -285,9 +285,9 @@ class Neutrals {
\param time contains information about the current time
\param indices used to help set initial conditions
**/
bool initial_conditions(Grid grid,
Times time,
Indices indices);
bool initial_conditions(Grid &grid,
Times time,
Indices indices);

/**********************************************************************
\brief temporary function to set neutral densities with in the model
Expand All @@ -302,14 +302,14 @@ class Neutrals {
\param grid The grid to define the neutrals on
**/
void fill_with_hydrostatic(int64_t iStart,
int64_t iEnd,
Grid grid);
int64_t iEnd,
Grid &grid);

void fill_with_hydrostatic(int64_t iSpecies,
int64_t iStart,
int64_t iEnd,
Grid grid);

int64_t iStart,
int64_t iEnd,
Grid &grid);
/**********************************************************************
\brief Limit the density to a floor and a ceiling
**/
Expand All @@ -324,8 +324,8 @@ class Neutrals {
\brief Calculate the scale heights for the individual species
\param grid The grid to define the neutrals on
**/
void calc_scale_height(Grid grid);

void calc_scale_height(Grid &grid);
/**********************************************************************
\brief Calculate the viscosity coefficient
**/
Expand Down Expand Up @@ -381,21 +381,21 @@ class Neutrals {
\brief Calculate the chapman integrals for the individual species
\param grid The grid to define the neutrals on
**/
void calc_chapman(Grid grid);
void calc_chapman(Grid &grid);

/**********************************************************************
\brief Calculate the neutral bulk vertical thermal conduction
\param grid The grid to define the neutrals on
\param time The times within the model (dt is needed)
**/
void update_temperature(Grid grid, Times time);
void update_temperature(Grid &grid, Times time);

/**********************************************************************
\brief Calculate the neutral bulk horizontal viscosity
\param grid The grid to define the neutrals on
\param time The times within the model (dt is needed)
**/
void update_horizontal_velocity(Grid grid, Times time);
void update_horizontal_velocity(Grid &grid, Times time);

/**********************************************************************
\brief Calculate the O radiative cooling
Expand All @@ -413,43 +413,43 @@ class Neutrals {
\param planet Need things like rotation rate
\param grid Need things like radius
**/
void add_sources(Times time, Planets planet, Grid grid);
void add_sources(Times time, Planets planet, Grid &grid);

/**********************************************************************
\brief Set boundary conditions for the neutrals
\param grid The grid to define the neutrals on
\param time contains information about the current time
\param indices used to help set initial conditions
**/
bool set_bcs(Grid grid,
Times time,
Indices indices);
bool set_bcs(Grid &grid,
Times time,
Indices indices);

/**********************************************************************
\brief Set lower boundary conditions for the neutrals
\param grid The grid to define the neutrals on
\param time contains information about the current time
\param indices used to help set initial conditions
**/
bool set_lower_bcs(Grid grid,
Times time,
Indices indices);
bool set_lower_bcs(Grid &grid,
Times time,
Indices indices);

/**********************************************************************
\brief Set upper boundary conditions for the neutrals
\param grid The grid to define the neutrals on
\param time contains information about the current time
\param indices used to help set initial conditions
**/
bool set_upper_bcs(Grid grid);
bool set_upper_bcs(Grid &grid);

/**********************************************************************
\brief Set boundary conditions for the neutrals
\param iDir direction of the BC to set
\param grid The grid to define the neutrals on
**/
bool set_horizontal_bcs(int64_t iDir, Grid grid);

bool set_horizontal_bcs(int64_t iDir, Grid &grid);
/**********************************************************************
\brief Get the species ID number (int) given the species name (string)
\param name string holding the species name (e.g., "O+")
Expand Down Expand Up @@ -524,15 +524,15 @@ class Neutrals {
\param grid The grid to define the neutrals on
\param time contains information about the current time
**/
void solver_vertical_rusanov(Grid grid,
Times time);

void solver_vertical_rusanov(Grid &grid,
Times time);
/**********************************************************************
\brief Call the correct vertical advection scheme
\param grid The grid to define the neutrals on
\param time contains information about the current time
**/
bool advect_vertical(Grid grid, Times time);
bool advect_vertical(Grid &grid, Times time);

/**********************************************************************
\brief Calculate the neutral friction in one cell using an implicit solver
Expand Down
5 changes: 5 additions & 0 deletions include/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <string>
#include <vector>
#include <map>
#include <sys/time.h>

#include "aether.h"

Expand Down Expand Up @@ -211,6 +212,8 @@ class Report {
precision_t timing_total;
/// This is the start-gate for the timer
unsigned long long timing_start;

struct timeval timing_start_new;
/// This is the level of the function that is then compared to verbose
int iLevel;
/// This is a string that holds all of the function names above this one
Expand Down Expand Up @@ -250,6 +253,8 @@ class Report {
std::string error;
};

struct timeval start, end;

//Vector of error structs
std::vector<error_struct> error_list;
};
Expand Down
Loading
Loading