cholla
Classes | Public Member Functions | Public Attributes | List of all members
Grid3D Class Reference

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

#include <grav3D.h>

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)
 Set the initial conditions based on info in the parameters structure.
 
void Get_Position (long i, long j, long k, Real *xpos, Real *ypos, Real *zpos)
 Get the cell-centered position based on cell index.
 
void Set_Domain_Properties (struct parameters P)
 Set local domain properties.
 
void set_dt (Real dti)
 Calculate the timestep.
 
Real calc_dti_CPU_1D ()
 Calculate the maximum inverse timestep on 1D, according to the CFL condition (Toro 6.17).
 
Real calc_dti_CPU_2D ()
 Calculate the maximum inverse timestep on 2D, according to the CFL condition (Toro 6.17).
 
Real calc_dti_CPU_3D_function (int g_start, int g_end)
 Calculate the maximum inverse timestep on 3D using openMP, according to the CFL condition (Toro 6.17).
 
Real calc_dti_CPU_3D ()
 Calculate the maximum inverse timestep on 3D, according to the CFL condition (Toro 6.17).
 
Real calc_dti_CPU ()
 Calculate the maximum inverse timestep, according to the CFL condition (Toro 6.17).
 
Real Update_Grid (void)
 Update the conserved quantities in each cell.
 
Real Update_Hydro_Grid (void)
 Do all steps to update the hydro.
 
void Update_Time ()
 
void Write_Header_Binary (FILE *fp)
 Write the relevant header info to a binary output file.
 
void Write_Grid_Binary (FILE *fp)
 Write the grid to a file, at the current simulation time.
 
void Read_Grid (struct parameters P)
 Read in grid data from an output file.
 
void Read_Grid_Binary (FILE *fp)
 Read in grid data from a binary file.
 
void Reset (void)
 Reset the Grid3D class.
 
void FreeMemory (void)
 Free the memory for the density array.
 
void Constant (Real rho, Real vx, Real vy, Real vz, Real P)
 Constant gas properties.
 
void Sound_Wave (Real rho, Real vx, Real vy, Real vz, Real P, Real A)
 Sine wave perturbation.
 
void Square_Wave (Real rho, Real vx, Real vy, Real vz, Real P, Real A)
 Square wave density perturbation with amplitude A*rho in pressure equilibrium.
 
void Riemann (Real rho_l, Real v_l, Real P_l, Real rho_r, Real v_r, Real P_r, Real diaph)
 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 componentes 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.
 
int Set_Boundary_Mapping (int ig, int jg, int kg, int flags[], Real *a)
 Given the i,j,k index of a ghost cell, return the index of the corresponding real cell, and reverse the momentum if necessary.
 
int Find_Index (int ig, int nx, int flag, int face, Real *a)
 Given a ghost cell index and boundary flag, return the index of the corresponding real cell.
 
void Custom_Boundary (char bcnd[MAXLEN])
 Select appropriate custom boundary function.
 
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. More...
 
void Spherical_Overdensity_3D ()
 
void Uniform_Grid ()
 
void Zeldovich_Pancake (struct parameters P)
 

Public Attributes

int flag_init
 Initialization flag.
 
int gflag
 Flag that determines which buffer contains updated conserved variables.
 
struct Header H
 Header for the grid.
 
struct Rotation R
 Rotation struct for data projections.
 
Real * buffer0
 Buffer to hold conserved variable arrays.
 
Real * buffer1
 Buffer to hold conserved variable arrays.
 
struct Grid3D::Conserved C
 

Detailed Description

Class to create a the gravity object.

Class to create a 3D grid of cells.

Member Function Documentation

§ 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.


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