Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
Grid3D Class Reference

Class to create a the gravity object. More...

#include <grav3D.h>

Collaboration diagram for Grid3D:
Collaboration graph
[legend]

Classes

struct  Conserved
 

Public Member Functions

 Grid3D (void)
 Constructor for the grid.
 
void Initialize (struct Parameters *P)
 Initialize the grid.
 
void AllocateMemory (void)
 Allocate memory for the d, m, E arrays.
 
void Set_Initial_Conditions (Parameters P, const ParameterMap &pmap)
 
void Get_Position (long i, long j, long k, Real *xpos, Real *ypos, Real *zpos) const
 
Real Calc_Inverse_Timestep ()
 
void Set_Domain_Properties (struct Parameters P)
 Set local domain properties.
 
void set_dt (Real dti)
 Calculate the timestep.
 
void Execute_Hydro_Integrator (void)
 
Real Update_Hydro_Grid (std::function< void(Grid3D &)> &feedback_callback, std::function< void(Grid3D &)> &chemistry_callback)
 Do all steps to update the hydro.
 
void Update_Time ()
 
void Write_Header (AttrRecorderInterface &attr_recorder) const
 
void Read_Grid (struct Parameters P)
 Read in grid data from 1-per-process output files.
 
void Read_Grid_Cat (struct Parameters P)
 Read in grid data from a single concatenated output file.
 
void Reset (void)
 Reset the Grid3D class.
 
void FreeMemory (void)
 Free the memory for the density array.
 
void Constant (Parameters const &P)
 Constant gas properties.
 
void Sound_Wave (Parameters const &P)
 Sine wave perturbation.
 
void Linear_Wave (Parameters const &P)
 Initialize the grid with a simple linear wave.
 
void Square_Wave (Parameters const &P)
 Square wave density perturbation with amplitude A*rho in pressure equilibrium.
 
void Riemann (Parameters const &P)
 Initialize the grid with a Riemann problem.
 
void Shu_Osher ()
 Initialize the grid with the Shu-Osher shock tube problem. See Stone 2008, Section 8.1.
 
void Blast_1D ()
 Initialize the grid with two interacting blast waves. See Stone 2008, Section 8.1.
 
void KH ()
 Initialize the grid with a Kelvin-Helmholtz instability with a discontinuous interface.
 
void KH_res_ind ()
 Initialize the grid with a Kelvin-Helmholtz instability whose modes are resolution independent.
 
void Rayleigh_Taylor ()
 Initialize the grid with a 2D Rayleigh-Taylor instability.
 
void Gresho ()
 Initialize the grid with the 2D Gresho problem described in LW03.
 
void Implosion_2D ()
 Implosion test described in Liska, 2003.
 
void Explosion_2D ()
 Explosion test described in Liska, 2003.
 
void Noh_2D ()
 Noh test described in Liska, 2003.
 
void Noh_3D ()
 Noh test described in Stone, 2008.
 
void Disk_2D ()
 Initialize the grid with a 2D disk following a Kuzmin profile.
 
void Disk_3D (Parameters P)
 Initialize the grid with a 3D disk following a Miyamoto-Nagai profile.
 
void Set_Boundary_Conditions (Parameters P)
 Set the boundary conditions based on info in the parameters structure.
 
void Set_Boundary_Conditions_Grid (Parameters P)
 Set the boundary conditions for all components based on info in the parameters structure.
 
int Check_Custom_Boundary (int *flags, struct Parameters P)
 Check for custom boundary conditions.
 
void Set_Boundaries (int dir, int flags[])
 Apply boundary conditions to the grid.
 
void Set_Boundary_Extents (int dir, int *imin, int *imax)
 Set the extents of the ghost region we are initializing.
 
void Custom_Boundary (char bcnd[MAXLEN])
 Select appropriate custom boundary function.
 
void Wind_Boundary ()
 Apply a constant wind to the -x boundary.
 
void Noh_Boundary ()
 Apply analytic boundary conditions to +x, +y (and +z) faces, as per the Noh problem in Liska, 2003, or in Stone, 2008.
 
void Spherical_Overpressure_3D ()
 Initialize the grid with a 3D spherical overdensity and overpressue.
 
void Spherical_Overdensity_3D ()
 
void Clouds ()
 
void Uniform_Grid ()
 
void Zeldovich_Pancake (struct Parameters P)
 
void Adiabatic_Expansion (struct Parameters P)
 
void Chemistry_Test (struct Parameters P)
 
void Initialize_Models (ParameterMap &pmap)
 initialize the model collection
 
const ModelCollectionmodels () const
 get the model collection
 

Public Attributes

int flag_init
 Initialization flag.
 
struct Header H
 Header for the grid.
 
FieldInfo field_info
 
ModelCollection model_collection
 
struct Grid3D::Conserved C
 

Detailed Description

Class to create a the gravity object.

Class to create a 3D grid of cells.

Member Function Documentation

◆ Constant()

void Grid3D::Constant ( Parameters const &  P)

Constant gas properties.

Parameters
[in]Pthe parameters struct.

◆ Linear_Wave()

void Grid3D::Linear_Wave ( Parameters const &  P)

Initialize the grid with a simple linear wave.

Parameters
[in]Pthe parameters struct.

◆ Riemann()

void Grid3D::Riemann ( Parameters const &  P)

Initialize the grid with a Riemann problem.

Parameters
[in]Pthe parameters struct.

◆ Set_Initial_Conditions()

void Grid3D::Set_Initial_Conditions ( Parameters  P,
const ParameterMap pmap 
)

Set the initial conditions based on already-parsed parameter info in the Parameters arg or unparsed parameter-info in the ParameterMap arg

Set the initial conditions based on info in the parameters structure.

◆ Sound_Wave()

void Grid3D::Sound_Wave ( Parameters const &  P)

Sine wave perturbation.

Parameters
[in]Pthe parameters struct.

◆ Spherical_Overpressure_3D()

void Grid3D::Spherical_Overpressure_3D ( )

Initialize the grid with a 3D spherical overdensity and overpressue.

Initialize the grid with a 3D spherical overdensity for gravitational collapse.

◆ Square_Wave()

void Grid3D::Square_Wave ( Parameters const &  P)

Square wave density perturbation with amplitude A*rho in pressure equilibrium.

Parameters
[in]Pthe parameters struct.

◆ Update_Hydro_Grid()

void Grid3D::Update_Hydro_Grid ( std::function< void(Grid3D &)> &  feedback_callback,
std::function< void(Grid3D &)> &  chemistry_callback 
)

Do all steps to update the hydro.

Parameters
feedback_callbackis a crude way to optionally provide a feedback function that is invoked after the hydro-integrator, but before heating/cooling/chemistry
chemistry_callbackis a crude way to optionally provide a cooling function that is invoked after the hydro-integrator. At the moment, this does not support chemistry.

◆ Write_Header()

void Grid3D::Write_Header ( AttrRecorderInterface attr_recorder) const

records the relevant file header information

This has been written so that the logic can be used for both text outputs and HDF5 outputs. By employing inheritance, there is minor runtime overhead (from using virtual functions) when we record each item to the output

Parameters
attr_recorderAttribute recorder implementing the interface specified by the AttrRecorderInterface

Member Data Documentation

◆ field_info

FieldInfo Grid3D::field_info

Describes the mapping between field names and field indices

◆ model_collection

ModelCollection Grid3D::model_collection

Holds all models (if any)


The documentation for this class was generated from the following files: