Athena++/Atmosphere
Planetary Atmosphere Simulator
coordinates.hpp
Go to the documentation of this file.
1 #ifndef COORDINATES_COORDINATES_HPP_
2 #define COORDINATES_COORDINATES_HPP_
3 //========================================================================================
4 // Athena++ astrophysical MHD code
5 // Copyright(C) 2014 James M. Stone <jmstone@princeton.edu> and other code contributors
6 // Licensed under the 3-clause BSD License, see LICENSE file for details
7 //========================================================================================
9 // \brief defines abstract base and derived classes for coordinates. These classes
10 // provide data and functions to compute/store coordinate positions and spacing, as well
11 // as geometrical factors (areas, volumes, coordinate source terms) for various
12 // coordinate systems.
13 
14 // C headers
15 
16 // C++ headers
17 #include <iostream>
18 
19 // Athena++ headers
20 #include "../athena.hpp"
21 #include "../athena_arrays.hpp"
22 #include "../hydro/srcterms/hydro_srcterms.hpp"
23 #include "../mesh/mesh.hpp"
24 
25 // forward declarations
26 class MeshBlock;
27 class ParameterInput;
28 
29 //----------------------------------------------------------------------------------------
31 // \brief abstract base class for all coordinate derived classes
32 
33 class Coordinates {
34  public:
35  friend class HydroSourceTerms;
36  Coordinates(MeshBlock *pmb, ParameterInput *pin, bool flag = false);
37  virtual ~Coordinates() = default;
38 
39  // data
40  MeshBlock *pmy_block; // ptr to MeshBlock containing this Coordinates
41  AthenaArray<Real> dx1f, dx2f, dx3f, x1f, x2f, x3f; // face spacing and positions
42  AthenaArray<Real> dx1v, dx2v, dx3v, x1v, x2v, x3v; // volume spacing and positions
43  AthenaArray<Real> x1s2, x1s3, x2s1, x2s3, x3s1, x3s2; // area averaged positions for AMR
44  // geometry coefficients (only used in SphericalPolar, Cylindrical, Cartesian)
47 
48  // functions...
49  // ...to compute length of edges
50  virtual void Edge1Length(const int k, const int j, const int il, const int iu,
51  AthenaArray<Real> &len);
52  virtual void Edge2Length(const int k, const int j, const int il, const int iu,
53  AthenaArray<Real> &len);
54  virtual void Edge3Length(const int k, const int j, const int il, const int iu,
55  AthenaArray<Real> &len);
56  virtual Real GetEdge1Length(const int k, const int j, const int i);
57  virtual Real GetEdge2Length(const int k, const int j, const int i);
58  virtual Real GetEdge3Length(const int k, const int j, const int i);
59  // ...to compute length connecting cell centers (for non-ideal MHD)
60  virtual void VolCenter1Length(const int k, const int j, const int il, const int iu,
61  AthenaArray<Real> &len);
62  virtual void VolCenter2Length(const int k, const int j, const int il, const int iu,
63  AthenaArray<Real> &len);
64  virtual void VolCenter3Length(const int k, const int j, const int il, const int iu,
65  AthenaArray<Real> &len);
66  // ...to compute physical width at cell center
67  virtual void CenterWidth1(const int k, const int j, const int il, const int iu,
68  AthenaArray<Real> &dx1);
69  virtual void CenterWidth2(const int k, const int j, const int il, const int iu,
70  AthenaArray<Real> &dx2);
71  virtual void CenterWidth3(const int k, const int j, const int il, const int iu,
72  AthenaArray<Real> &dx3);
73 
74  // ...to compute area of faces
75  virtual void Face1Area(const int k, const int j, const int il, const int iu,
76  AthenaArray<Real> &area);
77  virtual void Face2Area(const int k, const int j, const int il, const int iu,
78  AthenaArray<Real> &area);
79  virtual void Face3Area(const int k, const int j, const int il, const int iu,
80  AthenaArray<Real> &area);
81  virtual Real GetFace1Area(const int k, const int j, const int i);
82  virtual Real GetFace2Area(const int k, const int j, const int i);
83  virtual Real GetFace3Area(const int k, const int j, const int i);
84  // ...to compute area of faces joined by cell centers (for non-ideal MHD)
85  virtual void VolCenterFace1Area(const int k, const int j, const int il, const int iu,
86  AthenaArray<Real> &area);
87  virtual void VolCenterFace2Area(const int k, const int j, const int il, const int iu,
88  AthenaArray<Real> &area);
89  virtual void VolCenterFace3Area(const int k, const int j, const int il, const int iu,
90  AthenaArray<Real> &area);
91 
92  // ...to compute Laplacian of quantities in the coord system and orthogonal subspaces
93  virtual void Laplacian(
94  const AthenaArray<Real> &s, AthenaArray<Real> &delta_s,
95  const int il, const int iu, const int jl, const int ju, const int kl, const int ku,
96  const int nl, const int nu);
97  virtual void LaplacianX1(
98  const AthenaArray<Real> &s, AthenaArray<Real> &delta_s,
99  const int n, const int k, const int j, const int il, const int iu);
100  virtual void LaplacianX1All(
101  const AthenaArray<Real> &s, AthenaArray<Real> &delta_s,
102  const int nl, const int nu, const int kl, const int ku,
103  const int jl, const int ju, const int il, const int iu);
104  virtual void LaplacianX2(
105  const AthenaArray<Real> &s, AthenaArray<Real> &delta_s,
106  const int n, const int k, const int j, const int il, const int iu);
107  virtual void LaplacianX2All(
108  const AthenaArray<Real> &s, AthenaArray<Real> &delta_s,
109  const int nl, const int nu, const int kl, const int ku,
110  const int jl, const int ju, const int il, const int iu);
111  virtual void LaplacianX3(
112  const AthenaArray<Real> &s, AthenaArray<Real> &delta_s,
113  const int n, const int k, const int j, const int il, const int iu);
114  virtual void LaplacianX3All(
115  const AthenaArray<Real> &s, AthenaArray<Real> &delta_s,
116  const int nl, const int nu, const int kl, const int ku,
117  const int jl, const int ju, const int il, const int iu);
118 
119  // ...to compute volume of cells
120  virtual void CellVolume(const int k, const int j, const int il, const int iu,
121  AthenaArray<Real> &vol);
122  virtual Real GetCellVolume(const int k, const int j, const int i);
123 
124  // ...to compute geometrical source terms
125  virtual void AddCoordTermsDivergence(const Real dt, const AthenaArray<Real> *flux,
126  const AthenaArray<Real> &prim, const AthenaArray<Real> &bcc,
127  AthenaArray<Real> &u);
128 
129  // ...to determine if index is a pole
130  bool IsPole(int j);
131 
132 
133  // In GR, functions...
134  // ...to return private variables
135  Real GetMass() const {return bh_mass_;}
136  Real GetSpin() const {return bh_spin_;}
137 
138  // ...to compute metric
139  void Metric(
140  Real x1, Real x2, Real x3, ParameterInput *pin, AthenaArray<Real> &g,
141  AthenaArray<Real> &g_inv, AthenaArray<Real> &dg_dx1, AthenaArray<Real> &dg_dx2,
142  AthenaArray<Real> &dg_dx3);
143  virtual void CellMetric(const int k, const int j, const int il, const int iu,
145  virtual void Face1Metric(const int k, const int j, const int il, const int iu,
146  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) {}
147  virtual void Face2Metric(const int k, const int j, const int il, const int iu,
148  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) {}
149  virtual void Face3Metric(const int k, const int j, const int il, const int iu,
150  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) {}
151 
152  // ...to transform primitives to locally flat space
153  virtual void PrimToLocal1(
154  const int k, const int j, const int il, const int iu,
155  const AthenaArray<Real> &b1_vals, AthenaArray<Real> &prim_left,
156  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) {}
157  virtual void PrimToLocal2(
158  const int k, const int j, const int il, const int iu,
159  const AthenaArray<Real> &b2_vals, AthenaArray<Real> &prim_left,
160  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) {}
161  virtual void PrimToLocal3(
162  const int k, const int j, const int il, const int iu,
163  const AthenaArray<Real> &b3_vals, AthenaArray<Real> &prim_left,
164  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) {}
165 
166  // ...to transform fluxes in locally flat space to global frame
167  virtual void FluxToGlobal1(
168  const int k, const int j, const int il, const int iu,
169  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
171  virtual void FluxToGlobal2(
172  const int k, const int j, const int il, const int iu,
173  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
175  virtual void FluxToGlobal3(
176  const int k, const int j, const int il, const int iu,
177  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
179 
180  // ...to raise (lower) covariant (contravariant) components of a vector
181  virtual void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j,
182  int i, Real *pa0, Real *pa1, Real *pa2, Real *pa3) {}
183  virtual void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i,
184  Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) {}
185 
186  protected:
187  bool coarse_flag; // true if this coordinate object is parent (coarse) mesh in AMR
189  int il, iu, jl, ju, kl, ku, ng; // limits of indices of arrays (normal or coarse)
190  int nc1, nc2, nc3; // # cells in each dir of arrays (normal or coarse)
191  // Scratch arrays for coordinate factors
192  // Format: coord_<type>[<direction>]_<index>[<count>]_
193  // type: vol[ume], area, etc.
194  // direction: 1/2/3 depending on which face, edge, etc. is in play
195  // index: i/j/k indicating which coordinates index array
196  // count: 1/2/... in case multiple arrays are needed for different terms
214  AthenaArray<Real> coord_area3vc_i_; //nonidealmhd addition
241 
242  // Scratch arrays for physical source terms
244 
245  // GR-specific scratch arrays
274 
275  // GR-specific variables
278 };
279 
280 //----------------------------------------------------------------------------------------
282 // \brief derived class for Cartesian coordinates. None of the virtual funcs
283 // in the Coordinates abstract base class need to be overridden.
284 
285 class Cartesian : public Coordinates {
286  friend class HydroSourceTerms;
287 
288  public:
289  Cartesian(MeshBlock *pmb, ParameterInput *pin, bool flag);
290 };
291 
292 //----------------------------------------------------------------------------------------
294 // \brief derived class for Cylindrical coordinates. Some of the length, area,
295 // and volume functions in the Coordinates abstract base class are overridden
296 
297 class Cylindrical : public Coordinates {
298  friend class HydroSourceTerms;
299 
300  public:
301  Cylindrical(MeshBlock *pmb, ParameterInput *pin, bool flag);
302 
303  // functions...
304  // ...to compute length of edges
305  void Edge2Length(const int k, const int j, const int il, const int iu,
306  AthenaArray<Real> &len) final;
307  Real GetEdge2Length(const int k, const int j, const int i) final;
308  // ...to compute length connecting cell centers (for non-ideal MHD)
309  void VolCenter2Length(const int k, const int j, const int il, const int iu,
310  AthenaArray<Real> &len) final;
311  // ...to compute physical width at cell center
312  void CenterWidth2(const int k, const int j, const int il, const int iu,
313  AthenaArray<Real> &dx2) final;
314 
315  // ...to compute area of faces
316  void Face1Area(const int k, const int j, const int il, const int iu,
317  AthenaArray<Real> &area) final;
318  void Face3Area(const int k, const int j, const int il, const int iu,
319  AthenaArray<Real> &area) final;
320  Real GetFace1Area(const int k, const int j, const int i) final;
321  Real GetFace3Area(const int k, const int j, const int i) final;
322  // ...to compute area of faces joined by cell centers (for non-ideal MHD)
323  void VolCenterFace1Area(const int k, const int j, const int il, const int iu,
324  AthenaArray<Real> &area) final;
325  void VolCenterFace3Area(const int k, const int j, const int il, const int iu,
326  AthenaArray<Real> &area) final;
327  // ...to compute volumes of cells
328  void CellVolume(const int k, const int j, const int il, const int iu,
329  AthenaArray<Real> &vol) final;
330  Real GetCellVolume(const int k, const int j, const int i) final;
331 
332  // ...to compute geometrical source terms
333  void AddCoordTermsDivergence(const Real dt, const AthenaArray<Real> *flux,
334  const AthenaArray<Real> &prim, const AthenaArray<Real> &bcc,
335  AthenaArray<Real> &u) final;
336 };
337 
338 //----------------------------------------------------------------------------------------
340 // \brief derived class for spherical polar coordinates. Many of the length, area,
341 // and volume functions in the Coordinates abstract base class are overridden.
342 
343 class SphericalPolar : public Coordinates {
344  friend class HydroSourceTerms;
345 
346  public:
347  SphericalPolar(MeshBlock *pmb, ParameterInput *pin, bool flag);
348 
349  // functions...
350  // ...to compute length of edges
351  void Edge2Length(const int k, const int j, const int il, const int iu,
352  AthenaArray<Real> &len) final;
353  void Edge3Length(const int k, const int j, const int il, const int iu,
354  AthenaArray<Real> &len) final;
355  Real GetEdge2Length(const int k, const int j, const int i) final;
356  Real GetEdge3Length(const int k, const int j, const int i) final;
357  // ...to compute length connecting cell centers (for non-ideal MHD)
358  void VolCenter2Length(const int k, const int j, const int il, const int iu,
359  AthenaArray<Real> &len) final;
360  void VolCenter3Length(const int k, const int j, const int il, const int iu,
361  AthenaArray<Real> &len) final;
362  // ...to compute physical width at cell center
363  void CenterWidth2(const int k, const int j, const int il, const int iu,
364  AthenaArray<Real> &dx2) final;
365  void CenterWidth3(const int k, const int j, const int il, const int iu,
366  AthenaArray<Real> &dx3) final;
367 
368  // ...to compute area of faces
369  void Face1Area(const int k, const int j, const int il, const int iu,
370  AthenaArray<Real> &area) final;
371  void Face2Area(const int k, const int j, const int il, const int iu,
372  AthenaArray<Real> &area) final;
373  void Face3Area(const int k, const int j, const int il, const int iu,
374  AthenaArray<Real> &area) final;
375  Real GetFace1Area(const int k, const int j, const int i) final;
376  Real GetFace2Area(const int k, const int j, const int i) final;
377  Real GetFace3Area(const int k, const int j, const int i) final;
378  // ...to compute area of faces joined by cell centers (for non-ideal MHD)
379  void VolCenterFace1Area(const int k, const int j, const int il, const int iu,
380  AthenaArray<Real> &area) final;
381  void VolCenterFace2Area(const int k, const int j, const int il, const int iu,
382  AthenaArray<Real> &area) final;
383  void VolCenterFace3Area(const int k, const int j, const int il, const int iu,
384  AthenaArray<Real> &area) final;
385  // ...to compute volumes of cells
386  void CellVolume(const int k, const int j, const int il, const int iu,
387  AthenaArray<Real> &vol) final;
388  Real GetCellVolume(const int k, const int j, const int i) final;
389 
390  // ...to compute geometrical source terms
391  void AddCoordTermsDivergence(const Real dt, const AthenaArray<Real> *flux,
392  const AthenaArray<Real> &prim, const AthenaArray<Real> &bcc,
393  AthenaArray<Real> &u) final;
394 };
395 
396 //----------------------------------------------------------------------------------------
398 // \brief derived class for Minkowski (flat) spacetime and Cartesian coordinates in GR.
399 // None of the length, area, and volume functions in the abstract base class need to be
400 // overridden, but all the metric and transforms functions are.
401 
402 class Minkowski : public Coordinates {
403  friend class HydroSourceTerms;
404 
405  public:
406  Minkowski(MeshBlock *pmb, ParameterInput *pin, bool flag);
407 
408  // In GR, functions...
409  // ...to compute metric
410  void CellMetric(const int k, const int j, const int il, const int iu,
411  AthenaArray<Real> &g, AthenaArray<Real> &gi) final;
412  void Face1Metric(const int k, const int j, const int il, const int iu,
413  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
414  void Face2Metric(const int k, const int j, const int il, const int iu,
415  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
416  void Face3Metric(const int k, const int j, const int il, const int iu,
417  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
418 
419  // ...to transform primitives to locally flat space
420  void PrimToLocal1(const int k, const int j, const int il, const int iu,
421  const AthenaArray<Real> &b1_vals, AthenaArray<Real> &prim_left,
422  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
423  void PrimToLocal2(const int k, const int j, const int il, const int iu,
424  const AthenaArray<Real> &b2_vals, AthenaArray<Real> &prim_left,
425  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
426  void PrimToLocal3(const int k, const int j, const int il, const int iu,
427  const AthenaArray<Real> &b3_vals, AthenaArray<Real> &prim_left,
428  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
429 
430  // ...to transform fluxes in locally flat space to global frame
431  void FluxToGlobal1(
432  const int k, const int j, const int il, const int iu,
433  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
435  void FluxToGlobal2(
436  const int k, const int j, const int il, const int iu,
437  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
439  void FluxToGlobal3(
440  const int k, const int j, const int il, const int iu,
441  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
443 
444  // for raising (lowering) covariant (contravariant) components of a vector
445  void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i,
446  Real *pa0, Real *pa1, Real *pa2, Real *pa3) final;
447  void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i,
448  Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) final;
449 };
450 
451 //----------------------------------------------------------------------------------------
453 // \brief derived class for Schwarzschild spacetime and spherical polar coordinates in GR
454 // Nearly every function in the abstract base class need to be overridden.
455 
456 class Schwarzschild : public Coordinates {
457  friend class HydroSourceTerms;
458 
459  public:
460  Schwarzschild(MeshBlock *pmb, ParameterInput *pin, bool flag);
461 
462  // functions...
463  // ...to compute length of edges
464  void Edge1Length(const int k, const int j, const int il, const int iu,
465  AthenaArray<Real> &len) final;
466  void Edge2Length(const int k, const int j, const int il, const int iu,
467  AthenaArray<Real> &len) final;
468  void Edge3Length(const int k, const int j, const int il, const int iu,
469  AthenaArray<Real> &len) final;
470  Real GetEdge1Length(const int k, const int j, const int i) final;
471  Real GetEdge2Length(const int k, const int j, const int i) final;
472  Real GetEdge3Length(const int k, const int j, const int i) final;
473 
474  // ...to compute physical width at cell center
475  void CenterWidth1(const int k, const int j, const int il, const int iu,
476  AthenaArray<Real> &dx1) final;
477  void CenterWidth2(const int k, const int j, const int il, const int iu,
478  AthenaArray<Real> &dx2) final;
479  void CenterWidth3(const int k, const int j, const int il, const int iu,
480  AthenaArray<Real> &dx3) final;
481 
482  // ...to compute area of faces
483  void Face1Area(const int k, const int j, const int il, const int iu,
484  AthenaArray<Real> &area) final;
485  void Face2Area(const int k, const int j, const int il, const int iu,
486  AthenaArray<Real> &area) final;
487  void Face3Area(const int k, const int j, const int il, const int iu,
488  AthenaArray<Real> &area) final;
489  Real GetFace1Area(const int k, const int j, const int i) final;
490  Real GetFace2Area(const int k, const int j, const int i) final;
491  Real GetFace3Area(const int k, const int j, const int i) final;
492 
493  // ...to compute volumes of cells
494  void CellVolume(const int k, const int j, const int il, const int iu,
495  AthenaArray<Real> &vol) final;
496  Real GetCellVolume(const int k, const int j, const int i) final;
497 
498  // ...to compute geometrical source terms
499  void AddCoordTermsDivergence(const Real dt, const AthenaArray<Real> *flux,
500  const AthenaArray<Real> &prim, const AthenaArray<Real> &bcc,
501  AthenaArray<Real> &u) final;
502 
503  // In GR, functions...
504  // ...to compute metric
505  void CellMetric(const int k, const int j, const int il, const int iu,
506  AthenaArray<Real> &g, AthenaArray<Real> &gi) final;
507  void Face1Metric(const int k, const int j, const int il, const int iu,
508  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
509  void Face2Metric(const int k, const int j, const int il, const int iu,
510  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
511  void Face3Metric(const int k, const int j, const int il, const int iu,
512  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
513 
514  // ...to transform primitives to locally flat space
515  void PrimToLocal1(const int k, const int j, const int il, const int iu,
516  const AthenaArray<Real> &b1_vals, AthenaArray<Real> &prim_left,
517  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
518  void PrimToLocal2(const int k, const int j, const int il, const int iu,
519  const AthenaArray<Real> &b2_vals, AthenaArray<Real> &prim_left,
520  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
521  void PrimToLocal3(const int k, const int j, const int il, const int iu,
522  const AthenaArray<Real> &b3_vals, AthenaArray<Real> &prim_left,
523  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
524 
525  // ...to transform fluxes in locally flat space to global frame
526  void FluxToGlobal1(
527  const int k, const int j, const int il, const int iu,
528  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
530  void FluxToGlobal2(
531  const int k, const int j, const int il, const int iu,
532  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
534  void FluxToGlobal3(
535  const int k, const int j, const int il, const int iu,
536  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
538 
539  // for raising (lowering) covariant (contravariant) components of a vector
540  void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i,
541  Real *pa0, Real *pa1, Real *pa2, Real *pa3) final;
542  void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i,
543  Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) final;
544 };
545 
546 //----------------------------------------------------------------------------------------
548 // \brief derived class for Kerr spacetime and Kerr-Schild coordinates in GR.
549 // Nearly every function in the abstract base class need to be overridden.
550 
551 class KerrSchild : public Coordinates {
552  friend class HydroSourceTerms;
553 
554  public:
555  KerrSchild(MeshBlock *pmb, ParameterInput *pin, bool flag);
556 
557  // functions...
558  // ...to compute length of edges
559  void Edge1Length(const int k, const int j, const int il, const int iu,
560  AthenaArray<Real> &len) final;
561  void Edge2Length(const int k, const int j, const int il, const int iu,
562  AthenaArray<Real> &len) final;
563  void Edge3Length(const int k, const int j, const int il, const int iu,
564  AthenaArray<Real> &len) final;
565  Real GetEdge1Length(const int k, const int j, const int i) final;
566  Real GetEdge2Length(const int k, const int j, const int i) final;
567  Real GetEdge3Length(const int k, const int j, const int i) final;
568 
569  // ...to compute physical width at cell center
570  void CenterWidth1(const int k, const int j, const int il, const int iu,
571  AthenaArray<Real> &dx1) final;
572  void CenterWidth2(const int k, const int j, const int il, const int iu,
573  AthenaArray<Real> &dx2) final;
574  void CenterWidth3(const int k, const int j, const int il, const int iu,
575  AthenaArray<Real> &dx3) final;
576 
577  // ...to compute area of faces
578  void Face1Area(const int k, const int j, const int il, const int iu,
579  AthenaArray<Real> &area) final;
580  void Face2Area(const int k, const int j, const int il, const int iu,
581  AthenaArray<Real> &area) final;
582  void Face3Area(const int k, const int j, const int il, const int iu,
583  AthenaArray<Real> &area) final;
584  Real GetFace1Area(const int k, const int j, const int i) final;
585  Real GetFace2Area(const int k, const int j, const int i) final;
586  Real GetFace3Area(const int k, const int j, const int i) final;
587 
588  // ...to compute volumes of cells
589  void CellVolume(const int k, const int j, const int il, const int iu,
590  AthenaArray<Real> &vol) final;
591  Real GetCellVolume(const int k, const int j, const int i) final;
592 
593  // ...to compute geometrical source terms
594  void AddCoordTermsDivergence(const Real dt, const AthenaArray<Real> *flux,
595  const AthenaArray<Real> &prim, const AthenaArray<Real> &bcc,
596  AthenaArray<Real> &u) final;
597 
598  // In GR, functions...
599  // ...to compute metric
600  void CellMetric(const int k, const int j, const int il, const int iu,
601  AthenaArray<Real> &g, AthenaArray<Real> &gi) final;
602  void Face1Metric(const int k, const int j, const int il, const int iu,
603  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
604  void Face2Metric(const int k, const int j, const int il, const int iu,
605  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
606  void Face3Metric(const int k, const int j, const int il, const int iu,
607  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
608 
609  // ...to transform primitives to locally flat space
610  void PrimToLocal1(const int k, const int j, const int il, const int iu,
611  const AthenaArray<Real> &b1_vals, AthenaArray<Real> &prim_left,
612  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
613  void PrimToLocal2(const int k, const int j, const int il, const int iu,
614  const AthenaArray<Real> &b2_vals, AthenaArray<Real> &prim_left,
615  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
616  void PrimToLocal3(const int k, const int j, const int il, const int iu,
617  const AthenaArray<Real> &b3_vals, AthenaArray<Real> &prim_left,
618  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
619 
620  // ...to transform fluxes in locally flat space to global frame
621  void FluxToGlobal1(
622  const int k, const int j, const int il, const int iu,
623  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
625  void FluxToGlobal2(
626  const int k, const int j, const int il, const int iu,
627  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
629  void FluxToGlobal3(
630  const int k, const int j, const int il, const int iu,
631  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
633 
634  // for raising (lowering) covariant (contravariant) components of a vector
635  void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i,
636  Real *pa0, Real *pa1, Real *pa2, Real *pa3) final;
637  void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i,
638  Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) final;
639 };
640 
641 //----------------------------------------------------------------------------------------
643 // \brief derived class for arbitrary (stationary) user-defined coordinates in GR.
644 // Nearly every function in the abstract base class need to be overridden.
645 
646 class GRUser : public Coordinates {
647  friend class HydroSourceTerms;
648 
649  public:
650  GRUser(MeshBlock *pmb, ParameterInput *pin, bool flag);
651 
652  // functions...
653  // ...to compute length of edges
654  void Edge1Length(const int k, const int j, const int il, const int iu,
655  AthenaArray<Real> &len) final;
656  void Edge2Length(const int k, const int j, const int il, const int iu,
657  AthenaArray<Real> &len) final;
658  void Edge3Length(const int k, const int j, const int il, const int iu,
659  AthenaArray<Real> &len) final;
660  Real GetEdge1Length(const int k, const int j, const int i) final;
661  Real GetEdge2Length(const int k, const int j, const int i) final;
662  Real GetEdge3Length(const int k, const int j, const int i) final;
663 
664  // ...to compute physical width at cell center
665  void CenterWidth1(const int k, const int j, const int il, const int iu,
666  AthenaArray<Real> &dx1) final;
667  void CenterWidth2(const int k, const int j, const int il, const int iu,
668  AthenaArray<Real> &dx2) final;
669  void CenterWidth3(const int k, const int j, const int il, const int iu,
670  AthenaArray<Real> &dx3) final;
671 
672  // ...to compute area of faces
673  void Face1Area(const int k, const int j, const int il, const int iu,
674  AthenaArray<Real> &area) final;
675  void Face2Area(const int k, const int j, const int il, const int iu,
676  AthenaArray<Real> &area) final;
677  void Face3Area(const int k, const int j, const int il, const int iu,
678  AthenaArray<Real> &area) final;
679  Real GetFace1Area(const int k, const int j, const int i) final;
680  Real GetFace2Area(const int k, const int j, const int i) final;
681  Real GetFace3Area(const int k, const int j, const int i) final;
682 
683  // ...to compute volumes of cells
684  void CellVolume(const int k, const int j, const int il, const int iu,
685  AthenaArray<Real> &vol) final;
686  Real GetCellVolume(const int k, const int j, const int i) final;
687 
688  // ...to compute geometrical source terms
689  void AddCoordTermsDivergence(const Real dt, const AthenaArray<Real> *flux,
690  const AthenaArray<Real> &prim, const AthenaArray<Real> &bcc,
691  AthenaArray<Real> &u) final;
692 
693  // In GR, functions...
694  // ...to compute metric
695  void CellMetric(const int k, const int j, const int il, const int iu,
696  AthenaArray<Real> &g, AthenaArray<Real> &gi) final;
697  void Face1Metric(const int k, const int j, const int il, const int iu,
698  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
699  void Face2Metric(const int k, const int j, const int il, const int iu,
700  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
701  void Face3Metric(const int k, const int j, const int il, const int iu,
702  AthenaArray<Real> &g, AthenaArray<Real> &g_inv) final;
703 
704  // ...to transform primitives to locally flat space
705  void PrimToLocal1(const int k, const int j, const int il, const int iu,
706  const AthenaArray<Real> &b1_vals, AthenaArray<Real> &prim_left,
707  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
708  void PrimToLocal2(const int k, const int j, const int il, const int iu,
709  const AthenaArray<Real> &b2_vals, AthenaArray<Real> &prim_left,
710  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
711  void PrimToLocal3(const int k, const int j, const int il, const int iu,
712  const AthenaArray<Real> &b3_vals, AthenaArray<Real> &prim_left,
713  AthenaArray<Real> &prim_right, AthenaArray<Real> &bx) final;
714 
715  // ...to transform fluxes in locally flat space to global frame
716  void FluxToGlobal1(
717  const int k, const int j, const int il, const int iu,
718  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
720  void FluxToGlobal2(
721  const int k, const int j, const int il, const int iu,
722  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
724  void FluxToGlobal3(
725  const int k, const int j, const int il, const int iu,
726  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
728 
729  // ...for raising (lowering) covariant (contravariant) components of a vector
730  void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i,
731  Real *pa0, Real *pa1, Real *pa2, Real *pa3) final;
732  void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i,
733  Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) final;
734 };
735 
736 #endif // COORDINATES_COORDINATES_HPP_
double Real
Definition: athena.hpp:29
Cartesian(MeshBlock *pmb, ParameterInput *pin, bool flag)
Definition: cartesian.cpp:24
AthenaArray< Real > trans_face3_i1_
AthenaArray< Real > coord_area2_k1_
AthenaArray< Real > x1s2
Definition: coordinates.hpp:43
AthenaArray< Real > coord_len2_i1_
AthenaArray< Real > coord_area2vc_i_
AthenaArray< Real > metric_face1_i2_
AthenaArray< Real > coord_width3_j2_
AthenaArray< Real > trans_face3_ji4_
AthenaArray< Real > metric_face1_j1_
Real GetSpin() const
virtual void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i, Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3)
virtual void LaplacianX1(const AthenaArray< Real > &s, AthenaArray< Real > &delta_s, const int n, const int k, const int j, const int il, const int iu)
AthenaArray< Real > trans_face2_i2_
AthenaArray< Real > trans_face3_ji3_
AthenaArray< Real > coord_area1_j2_
AthenaArray< Real > dx2v
Definition: coordinates.hpp:42
AthenaArray< Real > x2f
Definition: coordinates.hpp:41
AthenaArray< Real > phy_src2_i_
AthenaArray< Real > coord_len3_j2_
AthenaArray< Real > trans_face3_ji1_
AthenaArray< Real > h31f
Definition: coordinates.hpp:45
AthenaArray< Real > dx1f
Definition: coordinates.hpp:41
AthenaArray< Real > metric_face3_j2_
AthenaArray< Real > x3s2
Definition: coordinates.hpp:43
AthenaArray< Real > trans_face1_kji_
AthenaArray< Real > metric_face2_i1_
virtual void Face1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area)
AthenaArray< Real > dx2f
Definition: coordinates.hpp:41
AthenaArray< Real > trans_face3_kji_
virtual Real GetEdge3Length(const int k, const int j, const int i)
virtual void Edge2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len)
AthenaArray< Real > trans_face1_ji6_
AthenaArray< Real > coord_area2_j1_
AthenaArray< Real > dx3v
Definition: coordinates.hpp:42
AthenaArray< Real > coord_area2_i_
AthenaArray< Real > trans_face3_j1_
AthenaArray< Real > coord_area1vc_j_
AthenaArray< Real > coord_len1_i2_
AthenaArray< Real > trans_face2_j1_
AthenaArray< Real > dx3f
Definition: coordinates.hpp:41
virtual void CenterWidth2(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx2)
AthenaArray< Real > metric_face2_j1_
AthenaArray< Real > coord_width2_i1_
virtual void FluxToGlobal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez)
AthenaArray< Real > coord_area1_kji_
AthenaArray< Real > trans_face1_i1_
AthenaArray< Real > metric_face3_i1_
virtual void CellMetric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &gi)
AthenaArray< Real > trans_face2_ji6_
AthenaArray< Real > coord_src2_j_
AthenaArray< Real > coord_width2_kji_
AthenaArray< Real > coord_width2_j1_
AthenaArray< Real > coord_src_j1_
AthenaArray< Real > trans_face2_ji5_
AthenaArray< Real > coord_len2_kji_
Coordinates(MeshBlock *pmb, ParameterInput *pin, bool flag=false)
Definition: coordinates.cpp:26
AthenaArray< Real > trans_face1_ji2_
virtual void LaplacianX3All(const AthenaArray< Real > &s, AthenaArray< Real > &delta_s, const int nl, const int nu, const int kl, const int ku, const int jl, const int ju, const int il, const int iu)
virtual Real GetEdge1Length(const int k, const int j, const int i)
AthenaArray< Real > metric_face2_i2_
virtual ~Coordinates()=default
AthenaArray< Real > gi_
virtual void PrimToLocal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b1_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx)
AthenaArray< Real > h32v
Definition: coordinates.hpp:46
AthenaArray< Real > coord_len3_i1_
AthenaArray< Real > coord_vol_j2_
AthenaArray< Real > coord_area1_j1_
AthenaArray< Real > coord_src3_j_
AthenaArray< Real > coord_vol_i2_
AthenaArray< Real > trans_face1_j1_
AthenaArray< Real > h2v
Definition: coordinates.hpp:46
AthenaArray< Real > coord_len2_j1_
virtual void VolCenter3Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len)
AthenaArray< Real > coord_area3_i_
virtual Real GetEdge2Length(const int k, const int j, const int i)
AthenaArray< Real > trans_face1_i2_
AthenaArray< Real > coord_len3_j1_
AthenaArray< Real > trans_face1_ji3_
AthenaArray< Real > metric_face2_j2_
virtual void Edge1Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len)
AthenaArray< Real > h2f
Definition: coordinates.hpp:45
AthenaArray< Real > coord_len2_j2_
AthenaArray< Real > coord_area1vc_i_
AthenaArray< Real > coord_vol_j1_
Real GetMass() const
AthenaArray< Real > x1f
Definition: coordinates.hpp:41
AthenaArray< Real > coord_src_j2_
AthenaArray< Real > coord_area3_i2_
AthenaArray< Real > coord_len1_j2_
AthenaArray< Real > metric_face1_i1_
AthenaArray< Real > coord_len3_k1_
AthenaArray< Real > coord_vol_i_
AthenaArray< Real > coord_len1_i1_
AthenaArray< Real > coord_area2_i2_
AthenaArray< Real > dh31vd1
Definition: coordinates.hpp:46
AthenaArray< Real > x3f
Definition: coordinates.hpp:41
AthenaArray< Real > coord_area3_i1_
virtual void LaplacianX2All(const AthenaArray< Real > &s, AthenaArray< Real > &delta_s, const int nl, const int nu, const int kl, const int ku, const int jl, const int ju, const int il, const int iu)
AthenaArray< Real > g_
AthenaArray< Real > coord_len1_j1_
AthenaArray< Real > coord_area3_kji_
MeshBlock * pmy_block
Definition: coordinates.hpp:40
AthenaArray< Real > dh32fd2
Definition: coordinates.hpp:45
AthenaArray< Real > x1v
Definition: coordinates.hpp:42
virtual void VolCenter1Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len)
AthenaArray< Real > coord_area2_j2_
virtual void VolCenterFace1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area)
virtual void Face1Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv)
virtual Real GetFace1Area(const int k, const int j, const int i)
AthenaArray< Real > coord_area2_i1_
AthenaArray< Real > coord_len3_kji_
AthenaArray< Real > x2v
Definition: coordinates.hpp:42
virtual void Face2Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv)
virtual void VolCenterFace2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area)
AthenaArray< Real > phy_src1_i_
AthenaArray< Real > dx1v
Definition: coordinates.hpp:42
AthenaArray< Real > coord_area2vc_j_
AthenaArray< Real > coord_src1_j_
AthenaArray< Real > metric_cell_i2_
AthenaArray< Real > trans_face3_ji2_
AthenaArray< Real > coord_area3_j1_
AthenaArray< Real > trans_face1_ji5_
virtual Real GetFace3Area(const int k, const int j, const int i)
bool IsPole(int j)
AthenaArray< Real > coord_width1_i1_
AthenaArray< Real > x1s3
Definition: coordinates.hpp:43
AthenaArray< Real > trans_face2_i1_
virtual void CenterWidth3(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx3)
AthenaArray< Real > trans_face3_ji5_
AthenaArray< Real > x3v
Definition: coordinates.hpp:42
AthenaArray< Real > h32f
Definition: coordinates.hpp:45
AthenaArray< Real > coord_src_kji_
AthenaArray< Real > coord_width1_kji_
AthenaArray< Real > trans_face1_ji1_
AthenaArray< Real > coord_area1_j_
AthenaArray< Real > coord_vol_k1_
AthenaArray< Real > coord_vol_kji_
AthenaArray< Real > trans_face1_ji7_
AthenaArray< Real > trans_face1_ji4_
virtual void VolCenterFace3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area)
virtual void FluxToGlobal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez)
AthenaArray< Real > x3s1
Definition: coordinates.hpp:43
virtual void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i, Real *pa0, Real *pa1, Real *pa2, Real *pa3)
AthenaArray< Real > metric_cell_j2_
AthenaArray< Real > coord_vol_i1_
AthenaArray< Real > dh31fd1
Definition: coordinates.hpp:45
AthenaArray< Real > coord_width3_kji_
AthenaArray< Real > coord_vol_j_
AthenaArray< Real > coord_area1_i_
AthenaArray< Real > x2s3
Definition: coordinates.hpp:43
AthenaArray< Real > coord_area1_k1_
AthenaArray< Real > dh2vd1
Definition: coordinates.hpp:46
AthenaArray< Real > coord_area2_j_
AthenaArray< Real > trans_face2_ji3_
AthenaArray< Real > metric_face3_j1_
AthenaArray< Real > coord_width3_j3_
AthenaArray< Real > metric_face2_kji_
AthenaArray< Real > metric_face3_kji_
AthenaArray< Real > coord_area2_kji_
virtual void Face2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area)
AthenaArray< Real > trans_face2_ji1_
virtual void PrimToLocal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b2_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx)
virtual void LaplacianX3(const AthenaArray< Real > &s, AthenaArray< Real > &delta_s, const int n, const int k, const int j, const int il, const int iu)
AthenaArray< Real > h31v
Definition: coordinates.hpp:46
AthenaArray< Real > coord_width3_j1_
virtual void Edge3Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len)
AthenaArray< Real > trans_face3_ji6_
AthenaArray< Real > coord_src1_i_
AthenaArray< Real > trans_face2_ji4_
virtual void FluxToGlobal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez)
virtual void CellVolume(const int k, const int j, const int il, const int iu, AthenaArray< Real > &vol)
AthenaArray< Real > coord_area1_i1_
virtual void LaplacianX2(const AthenaArray< Real > &s, AthenaArray< Real > &delta_s, const int n, const int k, const int j, const int il, const int iu)
virtual void Laplacian(const AthenaArray< Real > &s, AthenaArray< Real > &delta_s, const int il, const int iu, const int jl, const int ju, const int kl, const int ku, const int nl, const int nu)
AthenaArray< Real > dh2fd1
Definition: coordinates.hpp:45
AthenaArray< Real > dh32vd2
Definition: coordinates.hpp:46
AthenaArray< Real > trans_face3_i2_
AthenaArray< Real > metric_face1_j2_
AthenaArray< Real > coord_width3_k1_
AthenaArray< Real > coord_area3_j2_
virtual void CenterWidth1(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx1)
AthenaArray< Real > metric_face1_kji_
AthenaArray< Real > metric_face3_i2_
AthenaArray< Real > coord_len1_kji_
virtual Real GetFace2Area(const int k, const int j, const int i)
AthenaArray< Real > trans_face2_ji2_
void Metric(Real x1, Real x2, Real x3, ParameterInput *pin, AthenaArray< Real > &g, AthenaArray< Real > &g_inv, AthenaArray< Real > &dg_dx1, AthenaArray< Real > &dg_dx2, AthenaArray< Real > &dg_dx3)
AthenaArray< Real > coord_src2_i_
virtual void Face3Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv)
AthenaArray< Real > coord_width3_ji1_
virtual void VolCenter2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len)
AthenaArray< Real > metric_cell_kji_
AthenaArray< Real > trans_face2_kji_
AthenaArray< Real > x2s1
Definition: coordinates.hpp:43
virtual Real GetCellVolume(const int k, const int j, const int i)
virtual void PrimToLocal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b3_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx)
virtual void LaplacianX1All(const AthenaArray< Real > &s, AthenaArray< Real > &delta_s, const int nl, const int nu, const int kl, const int ku, const int jl, const int ju, const int il, const int iu)
AthenaArray< Real > metric_cell_i1_
AthenaArray< Real > metric_cell_j1_
virtual void Face3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area)
virtual void AddCoordTermsDivergence(const Real dt, const AthenaArray< Real > *flux, const AthenaArray< Real > &prim, const AthenaArray< Real > &bcc, AthenaArray< Real > &u)
AthenaArray< Real > coord_area3vc_i_
void AddCoordTermsDivergence(const Real dt, const AthenaArray< Real > *flux, const AthenaArray< Real > &prim, const AthenaArray< Real > &bcc, AthenaArray< Real > &u) final
Cylindrical(MeshBlock *pmb, ParameterInput *pin, bool flag)
Definition: cylindrical.cpp:28
Real GetCellVolume(const int k, const int j, const int i) final
void CenterWidth2(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx2) final
Real GetFace3Area(const int k, const int j, const int i) final
Real GetFace1Area(const int k, const int j, const int i) final
void Edge2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
void VolCenter2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
void VolCenterFace3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void Face1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void Face3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void CellVolume(const int k, const int j, const int il, const int iu, AthenaArray< Real > &vol) final
void VolCenterFace1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
Real GetEdge2Length(const int k, const int j, const int i) final
void Face1Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
Definition: gr_user.cpp:737
Real GetFace2Area(const int k, const int j, const int i) final
Definition: gr_user.cpp:536
void Edge1Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
Definition: gr_user.cpp:405
void CenterWidth3(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx3) final
Definition: gr_user.cpp:476
void FluxToGlobal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
Definition: gr_user.cpp:1304
void Edge3Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
Definition: gr_user.cpp:425
Real GetEdge1Length(const int k, const int j, const int i) final
Definition: gr_user.cpp:438
GRUser(MeshBlock *pmb, ParameterInput *pin, bool flag)
Definition: gr_user.cpp:42
void Face2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
Definition: gr_user.cpp:504
void PrimToLocal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b3_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
Definition: gr_user.cpp:1136
void CellVolume(const int k, const int j, const int il, const int iu, AthenaArray< Real > &vol) final
Definition: gr_user.cpp:554
void FluxToGlobal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
Definition: gr_user.cpp:1528
void Face1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
Definition: gr_user.cpp:494
Real GetFace1Area(const int k, const int j, const int i) final
Definition: gr_user.cpp:531
Real GetEdge3Length(const int k, const int j, const int i) final
Definition: gr_user.cpp:448
void CellMetric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &gi) final
Definition: gr_user.cpp:725
void CenterWidth1(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx1) final
Definition: gr_user.cpp:456
void Edge2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
Definition: gr_user.cpp:415
void Face2Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
Definition: gr_user.cpp:749
Real GetFace3Area(const int k, const int j, const int i) final
Definition: gr_user.cpp:541
void PrimToLocal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b1_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
Definition: gr_user.cpp:794
Real GetEdge2Length(const int k, const int j, const int i) final
Definition: gr_user.cpp:443
void CenterWidth2(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx2) final
Definition: gr_user.cpp:466
void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i, Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) final
Definition: gr_user.cpp:1666
void PrimToLocal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b2_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
Definition: gr_user.cpp:965
void FluxToGlobal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
Definition: gr_user.cpp:1416
Real GetCellVolume(const int k, const int j, const int i) final
Definition: gr_user.cpp:571
void Face3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
Definition: gr_user.cpp:514
void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i, Real *pa0, Real *pa1, Real *pa2, Real *pa3) final
Definition: gr_user.cpp:1630
void Face3Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
Definition: gr_user.cpp:761
void AddCoordTermsDivergence(const Real dt, const AthenaArray< Real > *flux, const AthenaArray< Real > &prim, const AthenaArray< Real > &bcc, AthenaArray< Real > &u) final
Definition: gr_user.cpp:586
void CenterWidth1(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx1) final
void Face1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
Real GetFace3Area(const int k, const int j, const int i) final
void PrimToLocal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b2_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
void FluxToGlobal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
void Face2Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i, Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) final
void CenterWidth2(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx2) final
Real GetEdge1Length(const int k, const int j, const int i) final
Real GetEdge3Length(const int k, const int j, const int i) final
void Face3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i, Real *pa0, Real *pa1, Real *pa2, Real *pa3) final
void AddCoordTermsDivergence(const Real dt, const AthenaArray< Real > *flux, const AthenaArray< Real > &prim, const AthenaArray< Real > &bcc, AthenaArray< Real > &u) final
void PrimToLocal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b3_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
void FluxToGlobal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
void CellMetric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &gi) final
Real GetCellVolume(const int k, const int j, const int i) final
void Edge3Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
void PrimToLocal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b1_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
void Face3Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
void Edge2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
KerrSchild(MeshBlock *pmb, ParameterInput *pin, bool flag)
Definition: kerr-schild.cpp:48
Real GetFace1Area(const int k, const int j, const int i) final
void Edge1Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
void Face1Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
void Face2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void FluxToGlobal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
void CellVolume(const int k, const int j, const int il, const int iu, AthenaArray< Real > &vol) final
void CenterWidth3(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx3) final
Real GetFace2Area(const int k, const int j, const int i) final
Real GetEdge2Length(const int k, const int j, const int i) final
Definition: mesh.hpp:203
void Face1Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
Definition: minkowski.cpp:127
void Face2Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
Definition: minkowski.cpp:143
void PrimToLocal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b2_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
Definition: minkowski.cpp:203
void CellMetric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &gi) final
Definition: minkowski.cpp:102
Minkowski(MeshBlock *pmb, ParameterInput *pin, bool flag)
Definition: minkowski.cpp:33
void PrimToLocal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b1_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
Definition: minkowski.cpp:190
void FluxToGlobal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
Definition: minkowski.cpp:243
void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i, Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) final
Definition: minkowski.cpp:307
void PrimToLocal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b3_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
Definition: minkowski.cpp:216
void FluxToGlobal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
Definition: minkowski.cpp:269
void Face3Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
Definition: minkowski.cpp:159
void FluxToGlobal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
Definition: minkowski.cpp:256
void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i, Real *pa0, Real *pa1, Real *pa2, Real *pa3) final
Definition: minkowski.cpp:290
void Face1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
Real GetFace3Area(const int k, const int j, const int i) final
void CenterWidth3(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx3) final
void Face3Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
void AddCoordTermsDivergence(const Real dt, const AthenaArray< Real > *flux, const AthenaArray< Real > &prim, const AthenaArray< Real > &bcc, AthenaArray< Real > &u) final
Real GetFace2Area(const int k, const int j, const int i) final
void Edge1Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
void CellMetric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &gi) final
void CellVolume(const int k, const int j, const int il, const int iu, AthenaArray< Real > &vol) final
void FluxToGlobal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
Real GetFace1Area(const int k, const int j, const int i) final
Schwarzschild(MeshBlock *pmb, ParameterInput *pin, bool flag)
void Face3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void FluxToGlobal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
void CenterWidth1(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx1) final
Real GetEdge2Length(const int k, const int j, const int i) final
void PrimToLocal1(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b1_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
void PrimToLocal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b2_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
void LowerVectorCell(Real a0, Real a1, Real a2, Real a3, int k, int j, int i, Real *pa_0, Real *pa_1, Real *pa_2, Real *pa_3) final
void Edge3Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
void FluxToGlobal2(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &cons, const AthenaArray< Real > &bbx, AthenaArray< Real > &flux, AthenaArray< Real > &ey, AthenaArray< Real > &ez) final
Real GetEdge1Length(const int k, const int j, const int i) final
void RaiseVectorCell(Real a_0, Real a_1, Real a_2, Real a_3, int k, int j, int i, Real *pa0, Real *pa1, Real *pa2, Real *pa3) final
void Face2Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
void Face1Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv) final
void Face2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void CenterWidth2(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx2) final
Real GetCellVolume(const int k, const int j, const int i) final
void Edge2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
void PrimToLocal3(const int k, const int j, const int il, const int iu, const AthenaArray< Real > &b3_vals, AthenaArray< Real > &prim_left, AthenaArray< Real > &prim_right, AthenaArray< Real > &bx) final
Real GetEdge3Length(const int k, const int j, const int i) final
void Face1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
Real GetCellVolume(const int k, const int j, const int i) final
void CenterWidth3(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx3) final
void VolCenter2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
Real GetFace3Area(const int k, const int j, const int i) final
void VolCenterFace3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void CellVolume(const int k, const int j, const int il, const int iu, AthenaArray< Real > &vol) final
SphericalPolar(MeshBlock *pmb, ParameterInput *pin, bool flag)
void AddCoordTermsDivergence(const Real dt, const AthenaArray< Real > *flux, const AthenaArray< Real > &prim, const AthenaArray< Real > &bcc, AthenaArray< Real > &u) final
void CenterWidth2(const int k, const int j, const int il, const int iu, AthenaArray< Real > &dx2) final
Real GetEdge3Length(const int k, const int j, const int i) final
void VolCenter3Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
Real GetFace1Area(const int k, const int j, const int i) final
void Edge3Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
void Face3Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void Face2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
Real GetFace2Area(const int k, const int j, const int i) final
void VolCenterFace1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void Edge2Length(const int k, const int j, const int il, const int iu, AthenaArray< Real > &len) final
Real GetEdge2Length(const int k, const int j, const int i) final
void VolCenterFace2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
double a2[2]
Definition: interp_weno3.hpp:8
double a1[2]
Definition: interp_weno3.hpp:6
double a3[3]