Canoe
Comprehensive Atmosphere N' Ocean Engine
affine_coordinate.cpp
Go to the documentation of this file.
1 // Athena++ headers
2 #include <athena/athena.hpp>
3 #include <athena/athena_arrays.hpp>
4 #include <athena/coordinates/coordinates.hpp>
5 #include <athena/mesh/mesh.hpp>
6 #include <athena/parameter_input.hpp>
7 
8 // exo3
9 #include "affine_coordinate.hpp"
10 
11 //----------------------------------------------------------------------------------------
13 
14 AffineCoordinate::AffineCoordinate(MeshBlock *pmb, ParameterInput *pin,
15  bool flag)
16  : Coordinates(pmb, pin, flag) {
17  // Send something to confirm that we are using Affine
18  std::cout << "===Note===: Affine coordinates activated" << std::endl;
19  theta_ = PI / 3.;
20  // theta_ = PI/2.;
21  sin_theta_ = sin(theta_);
22  cos_theta_ = cos(theta_);
23 
24  // initialize volume-averaged coordinates and spacing
25  // x1-direction: x1v = dx/2
26  for (int i = il - ng; i <= iu + ng; ++i) {
27  x1v(i) = 0.5 * (x1f(i + 1) + x1f(i));
28  }
29  for (int i = il - ng; i <= iu + ng - 1; ++i) {
30  if (pmb->block_size.x1rat != 1.0) {
31  dx1v(i) = x1v(i + 1) - x1v(i);
32  } else {
33  // dx1v = dx1f constant for uniform mesh; may disagree with x1v(i+1) -
34  // x1v(i)
35  dx1v(i) = dx1f(i);
36  }
37  }
38 
39  // x2-direction: x2v = dy/2
40  if (pmb->block_size.nx2 == 1) {
41  x2v(jl) = 0.5 * (x2f(jl + 1) + x2f(jl));
42  dx2v(jl) = dx2f(jl);
43  } else {
44  for (int j = jl - ng; j <= ju + ng; ++j) {
45  x2v(j) = 0.5 * (x2f(j + 1) + x2f(j));
46  }
47  for (int j = jl - ng; j <= ju + ng - 1; ++j) {
48  if (pmb->block_size.x2rat != 1.0) {
49  dx2v(j) = x2v(j + 1) - x2v(j);
50  } else {
51  // dx2v = dx2f constant for uniform mesh; may disagree with x2v(j+1) -
52  // x2v(j)
53  dx2v(j) = dx2f(j);
54  }
55  }
56  }
57 
58  // x3-direction: x3v = dz/2
59  if (pmb->block_size.nx3 == 1) {
60  x3v(kl) = 0.5 * (x3f(kl + 1) + x3f(kl));
61  dx3v(kl) = dx3f(kl);
62  } else {
63  for (int k = kl - ng; k <= ku + ng; ++k) {
64  x3v(k) = 0.5 * (x3f(k + 1) + x3f(k));
65  }
66  for (int k = kl - ng; k <= ku + ng - 1; ++k) {
67  if (pmb->block_size.x3rat != 1.0) {
68  dx3v(k) = x3v(k + 1) - x3v(k);
69  } else {
70  // dxkv = dx3f constant for uniform mesh; may disagree with x3v(k+1) -
71  // x3v(k)
72  dx3v(k) = dx3f(k);
73  }
74  }
75  }
76  // initialize geometry coefficients
77  // x1-direction
78  for (int i = il - ng; i <= iu + ng; ++i) {
79  h2v(i) = 1.0;
80  h2f(i) = 1.0;
81  h31v(i) = 1.0;
82  h31f(i) = 1.0;
83  dh2vd1(i) = 0.0;
84  dh2fd1(i) = 0.0;
85  dh31vd1(i) = 0.0;
86  dh31fd1(i) = 0.0;
87  }
88 
89  // x2-direction
90  if (pmb->block_size.nx2 == 1) {
91  h32v(jl) = 1.0;
92  h32f(jl) = 1.0;
93  dh32vd2(jl) = 0.0;
94  dh32fd2(jl) = 0.0;
95  } else {
96  for (int j = jl - ng; j <= ju + ng; ++j) {
97  h32v(j) = 1.0;
98  h32f(j) = 1.0;
99  dh32vd2(j) = 0.0;
100  dh32fd2(j) = 0.0;
101  }
102  }
103 
104  // Initialize coordinate-transfer related variables
105  g_.NewAthenaArray(NMETRIC, nc1 + 1);
106  gi_.NewAthenaArray(NMETRIC, nc1 + 1);
107 
108  // Not needed here, but precalculation of the parts of metrics
109  // may be possible in gnomonic equiangle...
110 }
111 
112 // Put in the changes in face2area etc, similar to cylindrical.cpp
113 // In affine coordinates, the differences lie in face1area and face2area.
114 // face3area cancels the sqrt(g) term exactly.
115 
116 //----------------------------------------------------------------------------------------
117 // FaceXArea functions: compute area of face with normal in X-dir as vector
118 
119 void AffineCoordinate::Face1Area(const int k, const int j, const int il,
120  const int iu, AthenaArray<Real> &area) {
121 #pragma omp simd
122  for (int i = il; i <= iu; ++i) {
123  Real &area_i = area(i);
124  area_i = sin_theta_ * dx2f(j) * dx3f(k);
125  }
126  return;
127 }
128 
129 void AffineCoordinate::Face2Area(const int k, const int j, const int il,
130  const int iu, AthenaArray<Real> &area) {
131 #pragma omp simd
132  for (int i = il; i <= iu; ++i) {
133  Real &area_i = area(i);
134  area_i = dx1f(i) * dx3f(k);
135  }
136  return;
137 }
138 
139 void AffineCoordinate::Face3Area(const int k, const int j, const int il,
140  const int iu, AthenaArray<Real> &area) {
141 #pragma omp simd
142  for (int i = il; i <= iu; ++i) {
143  Real &area_i = area(i);
144  area_i = dx1f(i) * dx2f(j);
145  }
146  return;
147 }
148 
149 //----------------------------------------------------------------------------------------
150 // GetFaceXArea functions: return area of face with normal in X-dir at (i,j,k)
151 
152 Real AffineCoordinate::GetFace1Area(const int k, const int j, const int i) {
153  return dx2f(j) * dx3f(k) * sin_theta_;
154 }
155 
156 Real AffineCoordinate::GetFace2Area(const int k, const int j, const int i) {
157  return dx1f(i) * dx3f(k);
158 }
159 
160 Real AffineCoordinate::GetFace3Area(const int k, const int j, const int i) {
161  return dx1f(i) * dx2f(j);
162 }
163 
164 //----------------------------------------------------------------------------------------
165 //----------------------------------------------------------------------------------------
166 // VolCenterFaceXArea functions: compute area of face with normal in X-dir as
167 // vector where the faces are joined by cell centers (for non-ideal MHD)
168 
169 void AffineCoordinate::VolCenterFace1Area(const int k, const int j,
170  const int il, const int iu,
171  AthenaArray<Real> &area) {
172 #pragma omp simd
173  for (int i = il; i <= iu; ++i) {
174  Real &area_i = area(i);
175  area_i = dx2v(j) * dx3v(k) * sin_theta_;
176  }
177  return;
178 }
179 
180 void AffineCoordinate::VolCenterFace2Area(const int k, const int j,
181  const int il, const int iu,
182  AthenaArray<Real> &area) {
183 #pragma omp simd
184  for (int i = il; i <= iu; ++i) {
185  Real &area_i = area(i);
186  area_i = dx1v(i) * dx3v(k);
187  }
188  return;
189 }
190 
191 void AffineCoordinate::VolCenterFace3Area(const int k, const int j,
192  const int il, const int iu,
193  AthenaArray<Real> &area) {
194 #pragma omp simd
195  for (int i = il; i <= iu; ++i) {
196  Real &area_i = area(i);
197  area_i = dx1v(i) * dx2v(j);
198  }
199  return;
200 }
201 
202 // Cell Volume function: compute volume of cell as vector
203 
204 void AffineCoordinate::CellVolume(const int k, const int j, const int il,
205  const int iu, AthenaArray<Real> &vol) {
206 #pragma omp simd
207  for (int i = il; i <= iu; ++i) {
208  vol(i) = dx1f(i) * dx2f(j) * dx3f(k) * sin_theta_;
209  }
210  return;
211 }
212 
213 //----------------------------------------------------------------------------------------
214 // GetCellVolume: returns cell volume at (i,j,k)
215 
216 Real AffineCoordinate::GetCellVolume(const int k, const int j, const int i) {
217  return dx1f(i) * dx2f(j) * dx3f(k) * sin_theta_;
218 }
219 
220 //----------------------------------------------------------------------------------------
221 // For Affine coordinate: the metrics are all the same for volume, faces
222 void AffineCoordinate::CellMetric(const int k, const int j, const int il,
223  const int iu, AthenaArray<Real> &g,
224  AthenaArray<Real> &g_inv) {
225  // Go through 1D block of cells
226 #pragma omp simd
227  for (int i = il; i <= iu; ++i) {
228  // Extract metric terms
229  Real &g11 = g(I11, i);
230  Real &g22 = g(I22, i);
231  Real &g33 = g(I33, i);
232 
233  Real &gi11 = g_inv(I11, i);
234  Real &gi22 = g_inv(I22, i);
235  Real &gi33 = g_inv(I33, i);
236 
237  Real &g12 = g(I12, i);
238  Real &g13 = g(I13, i);
239  Real &g23 = g(I23, i);
240 
241  // Set metric terms, we only use covariant g for all calculations
242  g11 = 1.0;
243  g22 = 1.0;
244  g12 = 0.0;
245  g13 = 0.0;
246  g23 = cos_theta_;
247  g33 = 1.0;
248 
249  gi11 = 1.0;
250  gi22 = 1.0 / (sin_theta_ * sin_theta_);
251  gi33 = 1.0 / (sin_theta_ * sin_theta_);
252  }
253  return;
254 }
255 
256 void AffineCoordinate::Face1Metric(const int k, const int j, const int il,
257  const int iu, AthenaArray<Real> &g,
258  AthenaArray<Real> &g_inv) {
259  // Go through 1D block of cells
260 #pragma omp simd
261  for (int i = il; i <= iu; ++i) {
262  // Extract remaining geometric quantities
263 
264  // Extract metric terms
265  Real &g11 = g(I11, i);
266  Real &g22 = g(I22, i);
267  Real &g33 = g(I33, i);
268 
269  Real &gi11 = g_inv(I11, i);
270  Real &gi22 = g_inv(I22, i);
271  Real &gi33 = g_inv(I33, i);
272 
273  Real &g12 = g(I12, i);
274  Real &g13 = g(I13, i);
275  Real &g23 = g(I23, i);
276 
277  // Set metric terms, we only use covariant g for all calculations
278  g11 = 1.0;
279  g22 = 1.0;
280  g12 = 0.0;
281  g13 = 0.0;
282  g23 = cos_theta_;
283  g33 = 1.0;
284 
285  gi11 = 1.0;
286  gi22 = 1.0 / (sin_theta_ * sin_theta_);
287  gi33 = 1.0 / (sin_theta_ * sin_theta_);
288  }
289  return;
290 }
291 
292 void AffineCoordinate::Face2Metric(const int k, const int j, const int il,
293  const int iu, AthenaArray<Real> &g,
294  AthenaArray<Real> &g_inv) {
295  // Go through 1D block of cells
296 #pragma omp simd
297  for (int i = il; i <= iu; ++i) {
298  // Extract remaining geometric quantities
299 
300  // Extract metric terms
301  Real &g11 = g(I11, i);
302  Real &g22 = g(I22, i);
303  Real &g33 = g(I33, i);
304 
305  Real &gi11 = g_inv(I11, i);
306  Real &gi22 = g_inv(I22, i);
307  Real &gi33 = g_inv(I33, i);
308 
309  Real &g12 = g(I12, i);
310  Real &g13 = g(I13, i);
311  Real &g23 = g(I23, i);
312 
313  // Set metric terms, we only use covariant g for all calculations
314  g11 = 1.0;
315  g22 = 1.0;
316  g12 = 0.0;
317  g13 = 0.0;
318  g23 = cos_theta_;
319  g33 = 1.0;
320 
321  gi11 = 1.0;
322  gi22 = 1.0 / (sin_theta_ * sin_theta_);
323  gi33 = 1.0 / (sin_theta_ * sin_theta_);
324  }
325  return;
326 }
327 
328 void AffineCoordinate::Face3Metric(const int k, const int j, const int il,
329  const int iu, AthenaArray<Real> &g,
330  AthenaArray<Real> &g_inv) {
331  // Go through 1D block of cells
332 #pragma omp simd
333  for (int i = il; i <= iu; ++i) {
334  // Extract remaining geometric quantities
335 
336  // Extract metric terms
337  Real &g11 = g(I11, i);
338  Real &g22 = g(I22, i);
339  Real &g33 = g(I33, i);
340 
341  Real &gi11 = g_inv(I11, i);
342  Real &gi22 = g_inv(I22, i);
343  Real &gi33 = g_inv(I33, i);
344 
345  Real &g12 = g(I12, i);
346  Real &g13 = g(I13, i);
347  Real &g23 = g(I23, i);
348 
349  // Set metric terms, we only use covariant g for all calculations
350  g11 = 1.0;
351  g22 = 1.0;
352  g12 = 0.0;
353  g13 = 0.0;
354  g23 = cos_theta_;
355  g33 = 1.0;
356 
357  gi11 = 1.0;
358  gi22 = 1.0 / (sin_theta_ * sin_theta_);
359  gi33 = 1.0 / (sin_theta_ * sin_theta_);
360  }
361  return;
362 }
363 
364 //----------------------------------------------------------------------------------------
365 // Function for transforming primitives to locally flat frame: r-interface
366 // Inputs:
367 // k,j: phi- and theta-indices
368 // il,iu: r-index bounds
369 // prim_l: 1D array of left primitives, using global coordinates
370 // prim_r: 1D array of right primitives, using global coordinates
371 // Outputs:
372 // prim_l: values overwritten in local coordinates
373 // prim_r: values overwritten in local coordinates
374 // Notes: no notes
375 
376 void AffineCoordinate::PrimToLocal2(const int k, const int j, const int il,
377  const int iu,
378  const AthenaArray<Real> &b1_vals,
379  AthenaArray<Real> &prim_left,
380  AthenaArray<Real> &prim_right,
381  AthenaArray<Real> &bx) {
382  // Calculate metric coefficients for projection
383  // Face2Metric(k, j, il, iu, g_, gi_);
384 
385  // Go through 1D block of cells
386 #pragma omp simd
387  for (int i = il; i <= iu; ++i) {
388  // Real &g11 = g_(I11,i);
389  // Real &g22 = g_(I22,i);
390  // Real &g33 = g_(I33,i);
391 
392  // Real &gi11 = gi_(I11,i);
393  // Real &gi22 = gi_(I22,i);
394  // Real &gi33 = gi_(I33,i);
395 
396  // Real &g12 = g_(I12,i);
397  // Real &g13 = g_(I13,i);
398  // Real &g23 = g_(I23,i);
399 
400  // Extract global projected 4-velocities
401  Real uu1_l = prim_left(IVX, i);
402  Real uu2_l = prim_left(IVY, i);
403  Real uu3_l = prim_left(IVZ, i);
404  Real uu1_r = prim_right(IVX, i);
405  Real uu2_r = prim_right(IVY, i);
406  Real uu3_r = prim_right(IVZ, i);
407 
408  // // Calculate transformation matrix
409  // Real T11 = sqrt(g11);
410  // Real T12 = g12/sqrt(g11);
411  // Real T13 = g13/sqrt(g11);
412  // Real T21 = 0.0;
413  // Real T22 = 1.0/sqrt(gi22);
414  // Real T23 = 0.0;
415  // Real T31 = g13/sqrt(g33);
416  // Real T32 = g23/sqrt(g33);
417  // Real T33 = sqrt(g33);
418 
419  // // Transform projected 4-velocities
420  // // Differ from Schwartzchild here only...
421  // Real ux_l = T11*uu1_l+T12*uu2_l+T13*uu3_l;
422  // Real uy_l = T21*uu1_l+T22*uu2_l+T23*uu3_l;
423  // Real uz_l = T31*uu1_l+T32*uu2_l+T33*uu3_l;
424  // Real ux_r = T11*uu1_r+T12*uu2_r+T13*uu3_r;
425  // Real uy_r = T11*uu1_r+T12*uu2_r+T13*uu3_r;
426  // Real uz_r = T11*uu1_r+T12*uu2_r+T13*uu3_r;
427 
428  // affine: quick
429  Real ux_l = uu1_l;
430  Real uy_l = uu2_l * sin_theta_;
431  Real uz_l = uu2_l * cos_theta_ + uu3_l;
432  Real ux_r = uu1_r;
433  Real uy_r = uu2_r * sin_theta_;
434  Real uz_r = uu2_r * cos_theta_ + uu3_r;
435 
436  // Set local projected 4-velocities
437  prim_left(IVX, i) = ux_l;
438  prim_left(IVY, i) = uy_l;
439  prim_left(IVZ, i) = uz_l;
440  prim_right(IVX, i) = ux_r;
441  prim_right(IVY, i) = uy_r;
442  prim_right(IVZ, i) = uz_r;
443  }
444  return;
445 }
446 
447 void AffineCoordinate::PrimToLocal3(const int k, const int j, const int il,
448  const int iu,
449  const AthenaArray<Real> &b1_vals,
450  AthenaArray<Real> &prim_left,
451  AthenaArray<Real> &prim_right,
452  AthenaArray<Real> &bx) {
453  // Calculate metric coefficients for projection
454  // Face3Metric(k, j, il, iu, g_, gi_);
455 
456  // Go through 1D block of cells
457 #pragma omp simd
458  for (int i = il; i <= iu; ++i) {
459  // Real &g11 = g_(I11,i);
460  // Real &g22 = g_(I22,i);
461  // Real &g33 = g_(I33,i);
462 
463  // Real &gi11 = gi_(I11,i);
464  // Real &gi22 = gi_(I22,i);
465  // Real &gi33 = gi_(I33,i);
466 
467  // Real &g12 = g_(I12,i);
468  // Real &g13 = g_(I13,i);
469  // Real &g23 = g_(I23,i);
470 
471  // Extract global projected 4-velocities
472  Real uu1_l = prim_left(IVX, i);
473  Real uu2_l = prim_left(IVY, i);
474  Real uu3_l = prim_left(IVZ, i);
475  Real uu1_r = prim_right(IVX, i);
476  Real uu2_r = prim_right(IVY, i);
477  Real uu3_r = prim_right(IVZ, i);
478 
479  // Calculate transformation matrix
480  // Real T11 = sqrt(g11);
481  // Real T12 = g12/sqrt(g11);
482  // Real T13 = g13/sqrt(g11);
483  // Real T21 = g12/sqrt(g22);
484  // Real T22 = sqrt(g22);
485  // Real T23 = g23/sqrt(g22);
486  // Real T31 = 0.0;
487  // Real T32 = 0.0;
488  // Real T33 = 1.0/sqrt(gi33);
489 
490  // Transform projected 4-velocities
491  // Differ from Schwartzchild here only...
492  // Real ux_l = T11*uu1_l+T12*uu2_l+T13*uu3_l;
493  // Real uy_l = T21*uu1_l+T22*uu2_l+T23*uu3_l;
494  // Real uz_l = T31*uu1_l+T32*uu2_l+T33*uu3_l;
495  // Real ux_r = T11*uu1_r+T12*uu2_r+T13*uu3_r;
496  // Real uy_r = T11*uu1_r+T12*uu2_r+T13*uu3_r;
497  // Real uz_r = T11*uu1_r+T12*uu2_r+T13*uu3_r;
498 
499  // affine: simple form
500  Real ux_l = uu1_l;
501  Real uy_l = uu2_l + uu3_l * cos_theta_;
502  Real uz_l = uu3_l * sin_theta_;
503  Real ux_r = uu1_r;
504  Real uy_r = uu2_r + uu3_r * cos_theta_;
505  Real uz_r = uu3_r * sin_theta_;
506 
507  // Set local projected 4-velocities
508  prim_left(IVX, i) = ux_l;
509  prim_left(IVY, i) = uy_l;
510  prim_left(IVZ, i) = uz_l;
511  prim_right(IVX, i) = ux_r;
512  prim_right(IVY, i) = uy_r;
513  prim_right(IVZ, i) = uz_r;
514  }
515  return;
516 }
517 
518 //----------------------------------------------------------------------------------------
519 // Function for transforming fluxes to global frame: r-interface
520 // Inputs:
521 // k,j: phi- and theta-indices
522 // il,iu: r-index bounds
523 // flux: 3D array of hydrodynamical fluxes, using local coordinates
524 // ey,ez: 3D arrays of magnetic fluxes (electric fields), using local
525 // coordinates
526 // Outputs:
527 // flux: values overwritten in global coordinates
528 // ey,ez: values overwritten in global coordinates
529 // Notes:
530 // expects values and x-fluxes of Mx/My/Mz in IM1/IM2/IM3 slots
531 // puts r-fluxes of M1/M2/M3 in IM1/IM2/IM3 slots
532 
534  const int k, const int j, const int il, const int iu,
535  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
537  // Extract metrics
538  Face2Metric(k, j, il, iu, g_, gi_);
539 
540  // Go through 1D block of cells
541 #pragma omp simd
542  for (int i = il; i <= iu; ++i) {
543  // Extract metric tensors
544  // Real &g11 = g_(I11,i);
545  // Real &g22 = g_(I22,i);
546  // Real &g33 = g_(I33,i);
547 
548  // Real &gi11 = gi_(I11,i);
549  // Real &gi22 = gi_(I22,i);
550  // Real &gi33 = gi_(I33,i);
551 
552  // Real &g12 = g_(I12,i);
553  // Real &g13 = g_(I13,i);
554  // Real &g23 = g_(I23,i);
555 
556  // Extract local conserved quantities and fluxes
557  const Real txx = flux(IM1, k, j, i);
558  const Real txy = flux(IM2, k, j, i);
559  const Real txz = flux(IM3, k, j, i);
560 
561  // Calculate transformation matrix
562  // const Real D = g11*g33-g13*g13;
563  // Real T11 = g33*sqrt(g11)/D;
564  // Real T12 = sqrt(gi22)*(g13*g23-g12*g33)/D;
565  // Real T13 = -g13*sqrt(g33)/D;
566  // Real T21 = 0.0;
567  // Real T22 = sqrt(gi22);
568  // Real T23 = 0.0;
569  // Real T31 = -g13*sqrt(g11)/D;
570  // Real T32 = sqrt(gi22)*(g12*g13-g23*g11)/D;
571  // Real T33 = g11*sqrt(g33)/D;
572 
573  // Extract global fluxes
574  Real &t1_1 = flux(IM1, k, j, i);
575  Real &t1_2 = flux(IM2, k, j, i);
576  Real &t1_3 = flux(IM3, k, j, i);
577 
578  // Set fluxes
579  t1_1 = txx;
580  t1_2 = txy / sin_theta_;
581  t1_3 = -txy * cos_theta_ / sin_theta_ + txz;
582  }
583  return;
584 }
585 
587  const int k, const int j, const int il, const int iu,
588  const AthenaArray<Real> &cons, const AthenaArray<Real> &bbx,
590  // Extract metrics
591  Face3Metric(k, j, il, iu, g_, gi_);
592 
593  // Go through 1D block of cells
594 #pragma omp simd
595  for (int i = il; i <= iu; ++i) {
596  // Extract metric tensors
597  // Real &g11 = g_(I11,i);
598  // Real &g22 = g_(I22,i);
599  // Real &g33 = g_(I33,i);
600 
601  // Real &gi11 = gi_(I11,i);
602  // Real &gi22 = gi_(I22,i);
603  // Real &gi33 = gi_(I33,i);
604 
605  // Real &g12 = g_(I12,i);
606  // Real &g13 = g_(I13,i);
607  // Real &g23 = g_(I23,i);
608 
609  // Extract local conserved quantities and fluxes
610  const Real txx = flux(IM1, k, j, i);
611  const Real txy = flux(IM2, k, j, i);
612  const Real txz = flux(IM3, k, j, i);
613 
614  // Calculate transformation matrix
615  // const Real D = g11*g22-g12*g12;
616  // Real T11 = g22*sqrt(g11)/D;
617  // Real T12 = -g12*sqrt(g22)/D;
618  // Real T13 = sqrt(gi33)*(g12*g23-g13*g22)/D;
619  // Real T21 = -g12*sqrt(g11)/D;
620  // Real T22 = g11*sqrt(g22)/D;
621  // Real T23 = sqrt(gi33)*(g12*g13-g23*g11)/D;
622  // Real T31 = 0.0;
623  // Real T32 = 0.0;
624  // Real T33 = sqrt(gi33);
625 
626  // Extract global fluxes
627  Real &t1_1 = flux(IM1, k, j, i);
628  Real &t1_2 = flux(IM2, k, j, i);
629  Real &t1_3 = flux(IM3, k, j, i);
630 
631  // Set fluxes
632  t1_1 = txx;
633  t1_2 = txy - txz * cos_theta_ / sin_theta_;
634  t1_3 = txz / sin_theta_;
635  }
636  return;
637 }
Real GetCellVolume(const int k, const int j, const int i)
void Face1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void PrimToLocal3(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)
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)
Real GetFace3Area(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)
void CellMetric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv)
void VolCenterFace1Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) 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)
void PrimToLocal2(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)
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)
Real GetFace2Area(const int k, const int j, const int i) final
void Face2Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv)
AffineCoordinate(MeshBlock *pmb, ParameterInput *pin, bool flag)
Cartesian coordinates constructor.
void Face3Metric(const int k, const int j, const int il, const int iu, AthenaArray< Real > &g, AthenaArray< Real > &g_inv)
Real GetFace1Area(const int k, const int j, const int i) final
void Face2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final
void VolCenterFace2Area(const int k, const int j, const int il, const int iu, AthenaArray< Real > &area) final