Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
potential_paris_galactic.h
1#pragma once
2
3#ifdef PARIS_GALACTIC
4
5 #include "../global/global.h"
6 #include "../model/galaxy/disk_galaxy.h"
7 #include "paris/PoissonZero3DBlockedGPU.hpp"
8
9class PotentialParisGalactic
10{
11 public:
12 PotentialParisGalactic();
13 ~PotentialParisGalactic();
14
22 void Get_Potential(const Real *density, Real *potential, Real grav_const, const DiskGalaxy &galaxy);
23 void Initialize(Real lx, Real ly, Real lz, Real xMin, Real yMin, Real zMin, int nx, int ny, int nz, int nxReal,
24 int nyReal, int nzReal, Real dx, Real dy, Real dz);
25 void Reset();
26
27 protected:
28 int dn_[3];
29 Real dr_[3], lo_[3], lr_[3], myLo_[3];
30
31 /* Pointer to the object that does the hard part of solving Poisson's equation */
33
34 /* minimum sizes of the buffers, passed to pp_, in order to be large enough to
35 * hold values at all spatial locations */
36 long densityBytes_;
37 /* minimum sizes of the buffers, passed to pp_, in order to be large enough to
38 * hold intermediate calculated values. */
39 long minBytes_;
40
41 /* device buffer used to hold the values corresponding to the RHS of poisson's equation,
42 * `4 * pi * G / scale_factor * ( dens - dens_bkg )`. */
43 Real *da_; // a better name might be poisson_rhs_
44
45 /* device buffer used to store the the gravitational potential computed from da_ (it does
46 * NOT include phi contributions from dens_bkg) */
47 Real *db_; // a better name might be phi_from_poisson_
48
49 #ifndef GRAVITY_GPU
50 /* length of the temporary buffer represented by dc_ (in bytes) */
51 long potentialBytes_;
52 /* when the GRAVITY_GPU macro is undefined, this is a gpu-allocated temporary buffer used
53 * to temporarily hold the combined gravitational potential from self-gravity and the
54 * static potential */
55 Real *dc_; // a better name might be total_phi_
56 #endif
57};
58
59#endif
Definition disk_galaxy.h:39
Encapsulates core logic for using Discrete Sine Transform (implemented in terms of FFTs) to solve Poi...
Definition PoissonZero3DBlockedGPU.hpp:26