Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
grid3D.h
Go to the documentation of this file.
1
4#ifndef GRID3D_H
5#define GRID3D_H
6
7#ifdef MPI_CHOLLA
8 #include "../mpi/mpi_routines.h"
9#endif /*MPI_CHOLLA*/
10
11#include <stdio.h>
12
13#include <functional>
14
15#include "../global/global.h" // declares Parameter and forward-declares ParameterMap
16#include "../global/global_cuda.h"
17#include "../grid/field_info.h"
18#include "../io/FnameTemplate.h"
19#include "../model/model_collection.h"
20
21#ifdef HDF5
22 #include <hdf5.h>
23#endif
24
25#ifdef GRAVITY
26 #include "../gravity/grav3D.h"
27#endif
28
29#ifdef PARTICLES
30 #include "../particles/particles_3D.h"
31#endif
32
33#ifdef COSMOLOGY
34 #include "../cosmology/cosmology.h"
35#endif
36
37#ifdef COOLING_GRACKLE
38 #include "../cooling_grackle/cool_grackle.h"
39#endif
40
41#ifdef CPU_TIME
42 #include "../utils/timing_functions.h"
43#endif
44
45#ifdef CHEMISTRY_GPU
46 #include "chemistry_gpu/chemistry_gpu.h"
47#endif
48
49#ifdef ANALYSIS
50 #include "../analysis/analysis.h"
51#endif
52
54
55struct Header {
59
63
66 int nx;
67
70 int ny;
71
74 int nz;
75
79
82 int ny_real;
83
86 int nz_real;
87
89 /* \brief Global domain x-direction minimum */
90 Real xbound;
91
93 /* \brief Global domain y-direction minimum */
94 Real ybound;
95
97 /* \brief Global domain z-direction minimum */
98 Real zbound;
99
101 /* \brief Local domain x-direction minimum */
102 Real xblocal;
103
105 /* \brief Local domain y-direction minimum */
106 Real yblocal;
107
109 /* \brief Local domain z-direction minimum */
110 Real zblocal;
111
113 /* \brief Local domain x-direction maximum */
114 Real xblocal_max;
115
117 /* \brief Local domain y-direction maximum */
118 Real yblocal_max;
119
121 /* \brief Local domain z-direction maximum */
122 Real zblocal_max;
123
125 /* \brief Global domain length in x-direction */
126 Real xdglobal;
127
129 /* \brief Global domain length in y-direction */
130 Real ydglobal;
131
133 /* \brief Global domain length in z-direction */
134 Real zdglobal;
135
138 Real dx;
139
142 Real dy;
143
146 Real dz;
147
150 Real t;
151
154 Real dt;
155
160
163 Real t_wall;
164
168
172
176
177 // Values for lower limit for density and temperature
178 Real temperature_floor;
179 Real density_floor;
180 Real scalar_floor;
181
182 Real Ekin_avrg;
183
184 // Flag to indicate when to transfer the Conserved boundaries
185 bool TRANSFER_HYDRO_BOUNDARIES;
186
187 // Parameters For Spherical Colapse Problem
188 Real sphere_density;
189 Real sphere_radius;
190 Real sphere_background_density;
191 Real sphere_center_x;
192 Real sphere_center_y;
193 Real sphere_center_z;
194
195 // only meaningful when GRAVITY and GRAVITY_ANALYTIC_COMP are defined
196 bool gas_only_use_static_grav;
197
198#ifdef GRAVITY
202 int n_ghost_potential_offset;
203#endif
204
205#ifdef COSMOLOGY
206 bool OUTPUT_SCALE_FACOR;
207#endif
208
212 bool Output_Initial;
213
218
219#ifdef SCALAR
220 #ifdef DUST
221 Real grain_radius;
222 #endif
223#endif
224};
225
229{
230 public:
234
237 struct Header H;
238
241
244
245#ifdef GRAVITY
246 // Object that contains data for gravity
247 Grav3D Grav;
248#endif
249
250#ifdef PARTICLES
251 // Object that contains data for particles
252 Particles3D Particles;
253#endif
254
255#ifdef COSMOLOGY
256 // Object that contains data for cosmology
257 Cosmology Cosmo;
258#endif
259
260#ifdef COOLING_GRACKLE
261 // Object that contains data for Grackle cooling
262 Cool_GK Cool;
263#endif
264
265#ifdef CPU_TIME
266 Time Timer;
267#endif
268
269#ifdef CHEMISTRY_GPU
270 // Object that contains data for the GPU chemistry solver
271 Chem_GPU Chem;
272#endif
273
274#ifdef ANALYSIS
275 AnalysisModule Analysis;
276#endif
277
278 struct Conserved {
280 Real *host;
281
284 Real *density;
285
290
295
300
303 Real *Energy;
304
305#ifdef SCALAR
308 Real *scalar;
309 #ifdef BASIC_SCALAR
313 Real *basic_scalar;
314 #endif
315 #ifdef DUST
319 Real *dust_density;
320 #endif
321#endif // SCALAR
322
323#ifdef MHD
328 Real *magnetic_x;
329
334 Real *magnetic_y;
335
340 Real *magnetic_z;
341#endif // MHD
342
343#ifdef DE
347 Real *GasEnergy;
348#endif // DE
349
353 Real *Grav_potential;
354
355#ifdef CHEMISTRY_GPU
356 Real *HI_density;
357 Real *HII_density;
358 Real *HeI_density;
359 Real *HeII_density;
360 Real *HeIII_density;
361 Real *e_density;
362#endif
363
365 Real *device;
366 Real *d_density, *d_momentum_x, *d_momentum_y, *d_momentum_z, *d_Energy, *d_scalar, *d_basic_scalar,
367 *d_dust_density, *d_magnetic_x, *d_magnetic_y, *d_magnetic_z, *d_GasEnergy;
368
373 } C;
374
377 Grid3D(void);
378
381 void Initialize(struct Parameters *P);
382
385 void AllocateMemory(void);
386
391
394 void Get_Position(long i, long j, long k, Real *xpos, Real *ypos, Real *zpos) const;
395
396 Real Calc_Inverse_Timestep();
397
400 void Set_Domain_Properties(struct Parameters P);
401
404 void set_dt(Real dti);
405
406#ifdef GRAVITY
409 void set_dt_Gravity();
410#endif
411
414 void Execute_Hydro_Integrator(void);
415
426 Real Update_Hydro_Grid(std::function<void(Grid3D &)> &feedback_callback,
427 std::function<void(Grid3D &)> &chemistry_callback);
428
429 void Update_Time();
430
440 void Write_Header(AttrRecorderInterface &attr_recorder) const;
441
444 void Read_Grid(struct Parameters P);
445
448 void Read_Grid_Cat(struct Parameters P);
449
450#ifdef HDF5
453 void Read_Grid_HDF5(hid_t file_id, struct Parameters P);
454#endif
455
456#if defined(PRINT_INITIAL_STATS) && defined(COSMOLOGY)
459 void Print_Grid_Stats(void);
460#endif
461
464 void Reset(void);
465
468 void FreeMemory(void);
469
475 void Constant(Parameters const &P);
476
482 void Sound_Wave(Parameters const &P);
483
489 void Linear_Wave(Parameters const &P);
490
497 void Square_Wave(Parameters const &P);
498
504 void Riemann(Parameters const &P);
505
509 void Shu_Osher();
510
514 void Blast_1D();
515
519 void KH();
520
524 void KH_res_ind();
525
528 void Rayleigh_Taylor();
529
533 void Gresho();
534
537 void Implosion_2D();
538
542
545 void Noh_2D();
546
549 void Noh_3D();
550
553 void Disk_2D();
554
558 void Disk_3D(Parameters P);
559
564
569
572 int Check_Custom_Boundary(int *flags, struct Parameters P);
573
576 void Set_Boundaries(int dir, int flags[]);
577
580 void Set_Boundary_Extents(int dir, int *imin, int *imax);
581
584 void Custom_Boundary(char bcnd[MAXLEN]);
585
588 void Wind_Boundary();
589
593 void Noh_Boundary();
594
599
603 void Spherical_Overdensity_3D();
604
605 void Clouds();
606
607 void Uniform_Grid();
608
609 void Zeldovich_Pancake(struct Parameters P);
610
611 void Adiabatic_Expansion(struct Parameters P);
612
613 void Chemistry_Test(struct Parameters P);
614
615#ifdef MHD
622 void Circularly_Polarized_Alfven_Wave(struct Parameters const P);
623
630 void Advecting_Field_Loop(struct Parameters const P);
631
638 void MHD_Spherical_Blast(struct Parameters const P);
639
646 void Orszag_Tang_Vortex();
647#endif // MHD
648
649#ifdef MPI_CHOLLA
650 void Set_Boundaries_MPI(struct Parameters P);
651 void Set_Boundaries_MPI_BLOCK(int *flags, struct Parameters P);
652 void Load_and_Send_MPI_Comm_Buffers(int dir, int *flags);
653 void Wait_and_Unload_MPI_Comm_Buffers(int dir, int *flags);
654 void Unload_MPI_Comm_Buffers(int index);
655
656 int Load_Hydro_DeviceBuffer_X0(Real *buffer);
657 int Load_Hydro_DeviceBuffer_X1(Real *buffer);
658 int Load_Hydro_DeviceBuffer_Y0(Real *buffer);
659 int Load_Hydro_DeviceBuffer_Y1(Real *buffer);
660 int Load_Hydro_DeviceBuffer_Z0(Real *buffer);
661 int Load_Hydro_DeviceBuffer_Z1(Real *buffer);
662
663 void Unload_Hydro_DeviceBuffer_X0(Real *buffer);
664 void Unload_Hydro_DeviceBuffer_X1(Real *buffer);
665 void Unload_Hydro_DeviceBuffer_Y0(Real *buffer);
666 void Unload_Hydro_DeviceBuffer_Y1(Real *buffer);
667 void Unload_Hydro_DeviceBuffer_Z0(Real *buffer);
668 void Unload_Hydro_DeviceBuffer_Z1(Real *buffer);
669#endif /*MPI_CHOLLA*/
670
673
675 const ModelCollection &models() const { return model_collection; }
676
677#ifdef GRAVITY
678 void Initialize_Gravity(struct Parameters *P);
679 void Compute_Gravitational_Potential(struct Parameters *P);
680 void Copy_Hydro_Density_to_Gravity_Function(int g_start, int g_end);
681 void Copy_Hydro_Density_to_Gravity();
682 void Extrapolate_Grav_Potential_Function(int g_start, int g_end);
683 void Extrapolate_Grav_Potential();
684 void Set_Potential_Boundaries_Periodic(int direction, int side, int *flags);
685 int Load_Gravity_Potential_To_Buffer(int direction, int side, Real *buffer, int buffer_start);
686 void Unload_Gravity_Potential_from_Buffer(int direction, int side, Real *buffer, int buffer_start);
687 void Set_Potential_Boundaries_Isolated(int direction, int side, int *flags);
688 void Compute_Potential_Boundaries_Isolated(int dir, struct Parameters *P);
689 void Compute_Potential_Isolated_Boundary(int direction, int side, int bc_potential_type);
690 #ifdef SOR
691 void Get_Potential_SOR(Real Grav_Constant, Real dens_avrg, Real current_a, struct Parameters *P);
692 int Load_Poisson_Boundary_To_Buffer(int direction, int side, Real *buffer);
693 void Unload_Poisson_Boundary_From_Buffer(int direction, int side, Real *buffer_host);
694 #endif
695 #ifdef GRAVITY_GPU
696 void Copy_Hydro_Density_to_Gravity_GPU();
697 void Extrapolate_Grav_Potential_GPU();
698 int Load_Gravity_Potential_To_Buffer_GPU(int direction, int side, Real *buffer, int buffer_start);
699 void Unload_Gravity_Potential_from_Buffer_GPU(int direction, int side, Real *buffer, int buffer_start);
700 void Set_Potential_Boundaries_Isolated_GPU(int direction, int side, int *flags);
701 void Set_Potential_Boundaries_Periodic_GPU(int direction, int side, int *flags);
702 #endif
703
704#endif // GRAVITY
705
706#ifdef GRAVITY_ANALYTIC_COMP
707 void Add_Analytic_Potential();
708 void Add_Analytic_Potential(int g_start, int g_end);
709 void Setup_Analytic_Potential(struct Parameters *P);
710 void Setup_Analytic_Galaxy_Potential(int g_start, int g_end, const DiskGalaxy &gal);
711 #ifdef GRAVITY_GPU
712 void Add_Analytic_Potential_GPU();
713 #endif
714#endif // GRAVITY_ANALYTIC_COMP
715
716#ifdef PARTICLES
717 void Initialize_Particles(struct Parameters *P);
718 void Initialize_Uniform_Particles();
719 void Copy_Particles_Density_function(int g_start, int g_end);
720 void Copy_Particles_Density();
721 void Copy_Particles_Density_to_Gravity(struct Parameters P);
722 void Set_Particles_Density_Boundaries_Periodic(int direction, int side);
723 void Transfer_Particles_Boundaries(struct Parameters P);
724 Real Update_Grid_and_Particles_KDK(struct Parameters P);
725 void Set_Particles_Boundary(int dir, int side);
726 #ifdef PARTICLES_CPU
727 void Set_Particles_Open_Boundary_CPU(int dir, int side);
728 #endif
729 #ifdef MPI_CHOLLA
730 int Load_Particles_Density_Boundary_to_Buffer(int direction, int side, Real *buffer);
731 void Unload_Particles_Density_Boundary_From_Buffer(int direction, int side, Real *buffer);
732 void Load_and_Send_Particles_X0(int ireq_n_particles, int ireq_particles_transfer);
733 void Load_and_Send_Particles_X1(int ireq_n_particles, int ireq_particles_transfer);
734 void Load_and_Send_Particles_Y0(int ireq_n_particles, int ireq_particles_transfer);
735 void Load_and_Send_Particles_Y1(int ireq_n_particles, int ireq_particles_transfer);
736 void Load_and_Send_Particles_Z0(int ireq_n_particles, int ireq_particles_transfer);
737 void Load_and_Send_Particles_Z1(int ireq_n_particles, int ireq_particles_transfer);
738 void Unload_Particles_from_Buffer_X0(int *flags);
739 void Unload_Particles_from_Buffer_X1(int *flags);
740 void Unload_Particles_from_Buffer_Y0(int *flags);
741 void Unload_Particles_from_Buffer_Y1(int *flags);
742 void Unload_Particles_from_Buffer_Z0(int *flags);
743 void Unload_Particles_from_Buffer_Z1(int *flags);
744 void Wait_NTransfer_and_Request_Recv_Particles_Transfer_BLOCK(int dir, int *flags);
745 void Load_NTtransfer_and_Request_Receive_Particles_Transfer(int index, int *ireq_particles_transfer);
746 void Wait_and_Unload_MPI_Comm_Particles_Buffers_BLOCK(int dir, int *flags);
747 void Unload_Particles_From_Buffers_BLOCK(int index, int *flags);
748 void Finish_Particles_Transfer();
749 #endif // MPI_CHOLLA
750 void Transfer_Particles_Density_Boundaries(struct Parameters P);
751 void Copy_Particles_Density_Buffer_Device_to_Host(int direction, int side, Real *buffer_d, Real *buffer_h);
752 // void Transfer_Particles_Boundaries( struct Parameters P );
753 void WriteData_Particles(struct Parameters P, int nfile, const FnameTemplate &fname_template);
754 void OutputData_Particles(struct Parameters P, int nfile, const FnameTemplate &fname_template);
755 void Load_Particles_Data(struct Parameters P);
756 #ifdef HDF5
757
763 void Write_Particles_Header(AttrRecorderInterface &attr_recorder);
764 void Write_Particles_Data_HDF5(hid_t file_id);
765 void Load_Particles_Data_HDF5(hid_t file_id, int nfile);
766 #endif // HDF5
767 void Get_Gravity_Field_Particles_function(int g_start, int g_end);
768 void Get_Gravity_Field_Particles();
769 void Get_Gravity_CIC_function(part_int_t p_start, part_int_t p_end);
770 void Get_Gravity_CIC();
771 void Advance_Particles_KDK_Step1();
772 void Advance_Particles_KDK_Step2();
773 void Advance_Particles_KDK_Step1_function(part_int_t p_start, part_int_t p_end);
774 void Advance_Particles_KDK_Step2_function(part_int_t p_start, part_int_t p_end);
775 void Get_Particles_Acceleration();
776 void Advance_Particles(int N_KDK_step);
777 Real Calc_Particles_dt_function(part_int_t p_start, part_int_t p_end);
778 Real Calc_Particles_dt();
779 #ifdef PARTICLES_GPU
780 Real Calc_Particles_dt_GPU();
781 void Advance_Particles_KDK_Step1_GPU();
782 void Advance_Particles_KDK_Step2_GPU();
783 void Set_Particles_Boundary_GPU(int dir, int side);
784 void Set_Particles_Density_Boundaries_Periodic_GPU(int direction, int side);
785 int Load_Particles_Density_Boundary_to_Buffer_GPU(int direction, int side, Real *buffer);
786 void Unload_Particles_Density_Boundary_From_Buffer_GPU(int direction, int side, Real *buffer);
787 #endif // PARTICLES_GPU
788 #ifdef GRAVITY_GPU
789 void Copy_Potential_From_GPU();
790 void Copy_Particles_Density_to_GPU();
791 void Copy_Particles_Density_GPU();
792 #endif // GRAVITY_GPU
793#endif // PARTICLES
794
795#ifdef COSMOLOGY
796 void Initialize_Cosmology(struct Parameters *P);
797 void Change_DM_Frame_System(bool forward);
798 void Change_GAS_Frame_System(bool forward);
799 void Change_GAS_Frame_System_GPU(bool forward);
800 void Change_Cosmological_Frame_System(bool forward);
801 void Advance_Particles_KDK_Cosmo_Step1_function(part_int_t p_start, part_int_t p_end);
802 void Advance_Particles_KDK_Cosmo_Step2_function(part_int_t p_start, part_int_t p_end);
803 Real Calc_Particles_dt_Cosmo_function(part_int_t p_start, part_int_t p_end);
804 Real Calc_Particles_dt_Cosmo();
805 #ifdef PARTICLES_GPU
806 void Advance_Particles_KDK_Cosmo_Step1_GPU();
807 void Advance_Particles_KDK_Cosmo_Step2_GPU();
808 #endif // PARTICLES_GPU
809#endif // COSMOLOGY
810
811#ifdef COOLING_GRACKLE
812 void Initialize_Grackle(struct Parameters *P);
813 void Allocate_Memory_Grackle();
814 void Initialize_Fields_Grackle();
815 void Copy_Fields_To_Grackle_function(int g_start, int g_end);
816 void Copy_Fields_To_Grackle();
817 void Update_Internal_Energy_function(int g_start, int g_end);
818 void Update_Internal_Energy();
819 void Do_Cooling_Step_Grackle();
820#endif
821
822#ifdef CHEMISTRY_GPU
823 void Initialize_Chemistry(struct Parameters *P);
824 void Compute_Gas_Temperature(Real *temperature, bool convert_cosmo_units);
825 void Update_Chemistry();
826#endif
827
828#ifdef ANALYSIS
829 void Initialize_AnalysisModule(struct Parameters *P);
830 void Compute_and_Output_Analysis(struct Parameters *P);
831 void Output_Analysis(struct Parameters *P);
832 void Write_Analysis_Header_HDF5(hid_t file_id);
833 void Write_Analysis_Data_HDF5(hid_t file_id);
834
835 #ifdef PHASE_DIAGRAM
836 void Compute_Phase_Diagram();
837 #endif
838
839 #ifdef LYA_STATISTICS
840 void Populate_Lya_Skewers_Local(int axis);
841 void Compute_Transmitted_Flux_Skewer(int skewer_id, int axis);
842 void Compute_Lya_Statistics();
843 void Compute_Flux_Power_Spectrum_Skewer(int skewer_id, int axis);
844 void Initialize_Power_Spectrum_Measurements(int axis);
845 #ifdef OUTPUT_SKEWERS
846 void Output_Skewers_File(struct Parameters *P);
847 void Write_Skewers_Header_HDF5(hid_t file_id);
848 void Write_Skewers_Data_HDF5(hid_t file_id);
849 #endif
850 #endif // LYA_STATISTICS
851#endif // ANALYSIS
852};
853
854// typedef for Grid3D_PointerMemberFunction
855typedef void (Grid3D::*Grid3D_PMF_UnloadHydroBuffer)(Real *);
856typedef void (Grid3D::*Grid3D_PMF_UnloadGravityPotential)(int, int, Real *, int);
857typedef void (Grid3D::*Grid3D_PMF_UnloadParticleDensity)(int, int, Real *);
858
859#endif // GRID3D_H
Definition AttrRecorderInterface.h:36
Definition disk_galaxy.h:39
Definition field_info.h:49
Definition FnameTemplate.h:43
Definition grav3D.h:38
Class to create a the gravity object.
Definition grid3D.h:229
Grid3D(void)
Constructor for the grid.
Definition grid3D.cpp:43
void Explosion_2D()
Explosion test described in Liska, 2003.
void Wind_Boundary()
Apply a constant wind to the -x boundary.
Definition boundary_conditions.cpp:525
void Initialize_Models(ParameterMap &pmap)
initialize the model collection
Definition grid3D.h:672
void Noh_2D()
Noh test described in Liska, 2003.
Definition initial_conditions.cpp:1076
void Write_Header(AttrRecorderInterface &attr_recorder) const
Definition io.cpp:150
struct Header H
Header for the grid.
Definition grid3D.h:237
void Blast_1D()
Initialize the grid with two interacting blast waves. See Stone 2008, Section 8.1.
Definition initial_conditions.cpp:635
Real Update_Hydro_Grid(std::function< void(Grid3D &)> &feedback_callback, std::function< void(Grid3D &)> &chemistry_callback)
Do all steps to update the hydro.
Definition grid3D.cpp:437
void Gresho()
Initialize the grid with the 2D Gresho problem described in LW03.
Definition initial_conditions.cpp:932
void Riemann(Parameters const &P)
Initialize the grid with a Riemann problem.
Definition initial_conditions.cpp:509
void Noh_3D()
Noh test described in Stone, 2008.
Definition initial_conditions.cpp:1107
const ModelCollection & models() const
get the model collection
Definition grid3D.h:675
void Initialize(struct Parameters *P)
Initialize the grid.
Definition grid3D.cpp:114
void Spherical_Overpressure_3D()
Initialize the grid with a 3D spherical overdensity and overpressue.
Definition initial_conditions.cpp:1203
void Shu_Osher()
Initialize the grid with the Shu-Osher shock tube problem. See Stone 2008, Section 8....
Definition initial_conditions.cpp:597
void Custom_Boundary(char bcnd[MAXLEN])
Select appropriate custom boundary function.
Definition boundary_conditions.cpp:509
void Rayleigh_Taylor()
Initialize the grid with a 2D Rayleigh-Taylor instability.
Definition initial_conditions.cpp:883
void Set_Domain_Properties(struct Parameters P)
Set local domain properties.
Definition initial_conditions.cpp:109
void Read_Grid(struct Parameters P)
Read in grid data from 1-per-process output files.
Definition io.cpp:522
void Set_Boundary_Conditions_Grid(Parameters P)
Set the boundary conditions for all components based on info in the parameters structure.
Definition boundary_conditions.cpp:19
FieldInfo field_info
Definition grid3D.h:240
void Set_Boundaries(int dir, int flags[])
Apply boundary conditions to the grid.
Definition boundary_conditions.cpp:165
int Check_Custom_Boundary(int *flags, struct Parameters P)
Check for custom boundary conditions.
Definition boundary_conditions.cpp:133
void KH_res_ind()
Initialize the grid with a Kelvin-Helmholtz instability whose modes are resolution independent.
Definition initial_conditions.cpp:749
void FreeMemory(void)
Free the memory for the density array.
Definition grid3D.cpp:624
void Set_Boundary_Extents(int dir, int *imin, int *imax)
Set the extents of the ghost region we are initializing.
Definition boundary_conditions.cpp:419
void Square_Wave(Parameters const &P)
Square wave density perturbation with amplitude A*rho in pressure equilibrium.
Definition initial_conditions.cpp:437
void Read_Grid_Cat(struct Parameters P)
Read in grid data from a single concatenated output file.
Definition io_parallel.cpp:133
void Noh_Boundary()
Apply analytic boundary conditions to +x, +y (and +z) faces, as per the Noh problem in Liska,...
Definition boundary_conditions.cpp:544
void Set_Boundary_Conditions(Parameters P)
Set the boundary conditions based on info in the parameters structure.
Definition boundary_conditions.cpp:54
void Constant(Parameters const &P)
Constant gas properties.
Definition initial_conditions.cpp:180
void Disk_3D(Parameters P)
Initialize the grid with a 3D disk following a Miyamoto-Nagai profile.
Definition disk_ICs.cu:829
int flag_init
Initialization flag.
Definition grid3D.h:233
void Reset(void)
Reset the Grid3D class.
Definition grid3D.cpp:613
void Set_Initial_Conditions(Parameters P, const ParameterMap &pmap)
Definition initial_conditions.cpp:27
void Disk_2D()
Initialize the grid with a 2D disk following a Kuzmin profile.
Definition initial_conditions.cpp:1139
void KH()
Initialize the grid with a Kelvin-Helmholtz instability with a discontinuous interface.
Definition initial_conditions.cpp:677
void Sound_Wave(Parameters const &P)
Sine wave perturbation.
Definition initial_conditions.cpp:244
void Implosion_2D()
Implosion test described in Liska, 2003.
Definition initial_conditions.cpp:1033
void AllocateMemory(void)
Allocate memory for the d, m, E arrays.
Definition grid3D.cpp:230
void set_dt(Real dti)
Calculate the timestep.
Definition grid3D.cpp:311
void Linear_Wave(Parameters const &P)
Initialize the grid with a simple linear wave.
Definition initial_conditions.cpp:302
ModelCollection model_collection
Definition grid3D.h:243
Holds a collection of models.
Definition model_collection.h:215
A class that provides map-like access to parameter files.
Definition ParameterMap.h:74
Definition timing_functions.h:42
Definition grid3D.h:278
Real * device
Definition grid3D.h:365
Real * d_Grav_potential
Definition grid3D.h:372
Real * momentum_x
Array containing the momentum in the x direction of each cell in the grid.
Definition grid3D.h:289
Real * momentum_y
Array containing the momentum in the y direction of each cell in the grid.
Definition grid3D.h:294
Real * Energy
Array containing the total Energy of each cell in the grid.
Definition grid3D.h:303
Real * host
Definition grid3D.h:280
Real * momentum_z
Array containing the momentum in the z direction of each cell in the grid.
Definition grid3D.h:299
Real * density
Array containing the density of each cell in the grid.
Definition grid3D.h:284
Definition grid3D.h:55
Real min_dt_slow
Cells that introduce timesteps shorter than will be averaged with neighboring cells....
Definition grid3D.h:159
int nz
Total number of cells in the z-dimension.
Definition grid3D.h:74
int ny
Total number of cells in the y-dimension.
Definition grid3D.h:70
int nx_real
Number of real cells in the x-dimension.
Definition grid3D.h:78
Real dy
y-width of cells
Definition grid3D.h:142
Real dx
x-width of cells
Definition grid3D.h:138
int n_cells
Total number of cells in the grid (including ghost cells)
Definition grid3D.h:58
int n_fields
Number of fields (conserved variables, scalars, etc.)
Definition grid3D.h:171
Real dz
z-width of cells
Definition grid3D.h:146
int n_step
Number of timesteps taken.
Definition grid3D.h:167
Real t
Simulation time.
Definition grid3D.h:150
Real t_wall
Wall time.
Definition grid3D.h:163
int n_ghost
Number of ghost cells on each side of the grid.
Definition grid3D.h:62
int nx
Total number of cells in the x-dimension.
Definition grid3D.h:66
bool Output_Now
Flag set to true when data has to be written to file.
Definition grid3D.h:211
int custom_grav
Flag to set specific static gravity field.
Definition grid3D.h:175
Real dt
Length of the current timestep.
Definition grid3D.h:154
bool Output_Complete_Data
Flag set to true when all the data will be written to file (Restart File )
Definition grid3D.h:217
Definition global.h:217