CoordinateSystem.h
Go to the documentation of this file.
1 /*
2 This file is part of the Ristra Wonton project.
3 Please see the license file at the root of this repository, or at:
4  https://github.com/laristra/wonton/blob/master/LICENSE
5 */
6 
7 #ifndef WONTON_SUPPORT_COORDINATESYSTEM_H_
8 #define WONTON_SUPPORT_COORDINATESYSTEM_H_
9 
10 #include <cassert>
11 #include <cmath>
12 #include <string>
13 #include <tuple>
14 
15 #include "moment_index.h"
16 #include "wonton/support/Point.h"
17 #include "wonton/support/Vector.h"
18 
19 /*
20  @file CoordinateSystem.h
21  @brief Defines quantities needed for non-Cartesian coordinates
22 
23  Portage prefers to work with geometry factors of unity (actual volumes rather
24  than wedges). Because of this, a geometry factor is unnecessary. However,
25  to help emphasize to users of Portage that this is the assumption, the
26  geometry factor is listed explicitly for every coordinate system. This also
27  makes it easier to change to different geometry factors in the future if
28  desired.
29 
30  The modify_* routines all take an input calculated using the "standard",
31  Cartesian-like expression, and then modify it to be appropriate for the
32  selected coordinate system. For Cartesian coordinates, this becomes a no-op
33  because the expression is already calculated correctly.
34  */
35 
36 
37 namespace Wonton {
38 
39  // Because C++ never bothered to define pi for some bizarre reason
40 namespace CoordinateSystem {
41  // atan, acos, and similar are not (by the standard) constexpr, so we can't
42  // use them to define constexpr values for pi
43  constexpr double pi = 3.141592653589793238462643383279502884L;
44  constexpr double twopi = 2.0 * pi;
45  constexpr double fourpi = 4.0 * pi;
46 
49  template<int D>
50  static void shift_moments_list_core(
51  std::vector<double> & moments, int const shift,
52  double const scaling_factor) {
53  // Allocate new storage
54  auto top_moment = index_to_moment<D>(moments.size() - 1);
55  auto max_order = std::get<0>(top_moment) - shift;
56  auto num_new_moments = count_moments<D>(max_order);
57  std::vector<double> new_moments(num_new_moments);
58  // Shift moments
59  int const nb_new_moments = new_moments.size();
60 
61  for (int new_index = 0; new_index < nb_new_moments; new_index++) {
62  auto moment_spec = index_to_moment<D>(new_index);
63  auto order = std::get<0>(moment_spec);
64  auto exponents = std::get<1>(moment_spec);
65  order += shift;
66  exponents[0] += shift;
67  auto old_index = moment_to_index<D>(order, exponents);
68  new_moments[new_index] = moments[old_index];
69  }
70  // Rescale moments
71  for (double & new_moment : new_moments) {
72  new_moment *= scaling_factor;
73  }
74  // Swap vectors
75  new_moments.swap(moments);
76  }
77 
78 }
79 
80 // ============================================================================
83  public:
84 
86  static std::string to_string() {
87  return std::string{"Cartesian coordinates"};
88  }
89 
91  static constexpr double geometry_factor = 1;
92 
94  static constexpr double inv_geo_fac = 1.0 / geometry_factor;
95 
97  template<int D>
98  static constexpr void verify_coordinate_system() {
99  // Valid for any positive dimensionality
100  static_assert(D >= 1,
101  "Cartesian coordinates must have positive dimensionality.");
102  }
103 
105  template<int D>
106  static constexpr void modify_gradient(Vector<D> & gradient,
107  Point<D> const & reference_point) {
108  // No change from "standard", Cartesian-like calculation.
109  }
110 
112  template<int D>
113  static constexpr void modify_line_element(Vector<D> & line_element,
114  Point<D> const & reference_point) {
115  // No change from "standard", Cartesian-like calculation.
116  }
117 
120  template<int D>
121  static constexpr void modify_volume(double & volume,
122  Point<D> const & plo, Point<D> const & phi) {
123  // No change from "standard", Cartesian-like calculation.
124  // --> Other than the geometry factor (which should be one, because any
125  // other value would be highly unusual for Cartesian coordinates, but
126  // we verify this anyway).
127  volume *= inv_geo_fac;
128  }
129 
132  template<int D>
133  static constexpr void modify_first_moments(Point<D> & moments,
134  Point<D> const & plo, Point<D> const & phi) {
135  // No change from "standard", Cartesian-like calculation.
136  // --> Other than the geometry factor (which should be one, because any
137  // other value would be highly unusual for Cartesian coordinates, but
138  // we verify this anyway).
139  for (int d = 0; d < D; ++d) {
140  moments[d] *= inv_geo_fac;
141  }
142  }
143 
146  static constexpr int moment_shift = 0;
147 
150  static constexpr double moment_coefficient = 1;
151 
154  template<int D>
155  static void shift_moments_list(std::vector<double> & moments) {
156  // No change from "standard", Cartesian-like calculation.
157  // --> Other than the geometry factor (which should be one, because any
158  // other value would be highly unusual for Cartesian coordinates, but
159  // we verify this anyway).
160  for (double & moment : moments) {
161  moment *= inv_geo_fac;
162  }
163  }
164 
165 }; // Cartesian Coordinates
166 
167 
168 // ============================================================================
172  public:
173 
175  static std::string to_string() {
176  return std::string{"cylindrical radial coordinates"};
177  }
178 
182  static constexpr double geometry_factor = 1;
183 
185  static constexpr double inv_geo_fac = 1.0 / geometry_factor;
186 
188  template<int D>
189  static constexpr void verify_coordinate_system() {
190  // Valid only in 1D
191  static_assert(D == 1,
192  "Cylindrical (radial) coordinates only valid in 1D.");
193  }
194 
196  template<int D>
197  static constexpr void modify_gradient(Vector<D> & gradient,
198  Point<D> const & reference_point) {
199  // No change from "standard", Cartesian-like calculation.
200  }
201 
203  template<int D>
204  static constexpr void modify_line_element(Vector<D> & line_element,
205  Point<D> const & reference_point) {
206  // No change from "standard", Cartesian-like calculation.
207  }
208 
211  template<int D>
212  static constexpr void modify_volume(double & volume,
213  Point<D> const & plo, Point<D> const & phi) {
214  // Adjust for different coordinate system
215  auto mean_radius = 0.5 * (plo[0] + phi[0]);
216  volume *= CoordinateSystem::twopi * mean_radius;
217  // Apply geometry factor
218  volume *= inv_geo_fac;
219  }
220 
223  template<int D>
224  static constexpr void modify_first_moments(Point<D> & moments,
225  Point<D> const & plo, Point<D> const & phi) {
226  // Adjust for different coordinate system
227  auto rhobar = 0.5 * (phi[0] + plo[0]);
228  auto drho_2 = 0.5 * (phi[0] - plo[0]);
229  moments[0] *= CoordinateSystem::twopi *
230  (rhobar*rhobar + drho_2*drho_2/3.0) / rhobar;
231  // Apply geometry factor
232  moments[0] *= inv_geo_fac;
233  }
234 
238  static constexpr int moment_shift = 1;
239 
242  static constexpr double moment_coefficient = CoordinateSystem::twopi;
243 
246  template<int D>
247  static void shift_moments_list(std::vector<double> & moments) {
248  // Shift and rescale moments
249  CoordinateSystem::shift_moments_list_core<D>(
250  moments, moment_shift, inv_geo_fac * moment_coefficient);
251  }
252 
253 }; // Cylindrical (Radial) Coordinates
254 
255 
256 // ============================================================================
261  public:
262 
264  static std::string to_string() {
265  return std::string{"cylindrical axisymmetric coordinates"};
266  }
267 
271  static constexpr double geometry_factor = 1;
272 
274  static constexpr double inv_geo_fac = 1.0 / geometry_factor;
275 
277  template<int D>
278  static constexpr void verify_coordinate_system() {
279  // Valid only in 2D
280  static_assert(D == 2,
281  "Cylindrical (axisymmetric) coordinates only valid in 2D.");
282  }
283 
285  template<int D>
286  static constexpr void modify_gradient(Vector<D> & gradient,
287  Point<D> const & reference_point) {
288  // No change from "standard", Cartesian-like calculation.
289  }
290 
292  template<int D>
293  static constexpr void modify_line_element(Vector<D> & line_element,
294  Point<D> const & reference_point) {
295  // No change from "standard", Cartesian-like calculation.
296  }
297 
300  template<int D>
301  static constexpr void modify_volume(double & volume,
302  Point<D> const & plo, Point<D> const & phi) {
303  // Adjust for different coordinate system
304  auto mean_radius = 0.5 * (plo[0] + phi[0]);
305  volume *= CoordinateSystem::twopi * mean_radius;
306  // Apply geometry factor
307  volume *= inv_geo_fac;
308  }
309 
312  template<int D>
313  static constexpr void modify_first_moments(Point<D> & moments,
314  Point<D> const & plo, Point<D> const & phi) {
315  // Adjust for different coordinate system
316  auto rhobar = 0.5 * (phi[0] + plo[0]);
317  auto drho_2 = 0.5 * (phi[0] - plo[0]);
318  moments[0] *= CoordinateSystem::twopi *
319  (rhobar*rhobar + drho_2*drho_2/3.0) / rhobar;
320  moments[1] *= CoordinateSystem::twopi * rhobar;
321  // Apply geometry factor
322  for (int d = 0; d < D; ++d) {
323  moments[d] *= inv_geo_fac;
324  }
325  }
326 
330  static constexpr int moment_shift = 1;
331 
334  static constexpr double moment_coefficient = CoordinateSystem::twopi;
335 
338  template<int D>
339  static void shift_moments_list(std::vector<double> & moments) {
340  // Shift and rescale moments
341  CoordinateSystem::shift_moments_list_core<D>(
342  moments, moment_shift, inv_geo_fac * moment_coefficient);
343  }
344 
345 }; // Cylindrical (Axisymmetric) Coordinates
346 
347 
348 // ============================================================================
353  public:
354 
356  static std::string to_string() {
357  return std::string{"cylindrical polar coordinates"};
358  }
359 
361  static constexpr double geometry_factor = 1;
362 
364  static constexpr double inv_geo_fac = 1.0 / geometry_factor;
365 
367  template<int D>
368  static constexpr void verify_coordinate_system() {
369  // Valid only in 2D
370  static_assert(D == 2,
371  "Cylindrical (polar) coordinates only valid in 2D.");
372  }
373 
375  template<int D>
376  static constexpr void modify_gradient(Vector<D> & gradient,
377  Point<D> const & reference_point) {
378  gradient[1] /= reference_point[0];
379  }
380 
382  template<int D>
383  static constexpr void modify_line_element(Vector<D> & line_element,
384  Point<D> const & reference_point) {
385  line_element[1] *= reference_point[0];
386  }
387 
390  template<int D>
391  static constexpr void modify_volume(double & volume,
392  Point<D> const & plo, Point<D> const & phi) {
393  // Adjust for different coordinate system
394  auto mean_radius = 0.5 * (plo[0] + phi[0]);
395  volume *= mean_radius;
396  // Apply geometry factor
397  volume *= inv_geo_fac;
398  }
399 
402  template<int D>
403  static constexpr void modify_first_moments(Point<D> & moments,
404  Point<D> const & plo, Point<D> const & phi) {
405  // Adjust for different coordinate system
406  auto rhobar = 0.5 * (phi[0] + plo[0]);
407  auto drho_2 = 0.5 * (phi[0] - plo[0]);
408  moments[0] *= (rhobar*rhobar + drho_2*drho_2/3.0) / rhobar;
409  moments[1] *= rhobar;
410  // Apply geometry factor
411  for (int d = 0; d < D; ++d) {
412  moments[d] *= inv_geo_fac;
413  }
414  }
415 
419  static constexpr int moment_shift = 1;
420 
423  static constexpr double moment_coefficient = 1;
424 
427  template<int D>
428  static void shift_moments_list(std::vector<double> & moments) {
429  // Shift and rescale moments
430  CoordinateSystem::shift_moments_list_core<D>(
431  moments, moment_shift, inv_geo_fac * moment_coefficient);
432  }
433 
434 }; // Cylindrical Polar Coordinates
435 
436 
437 // ============================================================================
442  public:
443 
445  static std::string to_string() {
446  return std::string{"cylindrical 3D coordinates"};
447  }
448 
450  static constexpr double geometry_factor = 1;
451 
453  static constexpr double inv_geo_fac = 1.0 / geometry_factor;
454 
456  template<int D>
457  static constexpr void verify_coordinate_system() {
458  // Valid only in 3D
459  static_assert(D == 3,
460  "Cylindrical (3D) coordinates only valid in 3D.");
461  }
462 
464  template<int D>
465  static constexpr void modify_gradient(Vector<D> & gradient,
466  Point<D> const & reference_point) {
467  gradient[1] /= reference_point[0];
468  }
469 
471  template<int D>
472  static constexpr void modify_line_element(Vector<D> & line_element,
473  Point<D> const & reference_point) {
474  line_element[1] *= reference_point[0];
475  }
476 
479  template<int D>
480  static constexpr void modify_volume(double & volume,
481  Point<D> const & plo, Point<D> const & phi) {
482  // Adjust for different coordinate system
483  auto mean_radius = 0.5 * (plo[0] + phi[0]);
484  volume *= mean_radius;
485  // Apply geometry factor
486  volume *= inv_geo_fac;
487  }
488 
491  template<int D>
492  static constexpr void modify_first_moments(Point<D> & moments,
493  Point<D> const & plo, Point<D> const & phi) {
494  // Adjust for different coordinate system
495  auto rhobar = 0.5 * (phi[0] + plo[0]);
496  auto drho_2 = 0.5 * (phi[0] - plo[0]);
497  moments[0] *= (rhobar*rhobar + drho_2*drho_2/3.0) / rhobar;
498  moments[1] *= rhobar;
499  moments[2] *= rhobar;
500  // Apply geometry factor
501  for (int d = 0; d < D; ++d) {
502  moments[d] *= inv_geo_fac;
503  }
504  }
505 
509  static constexpr int moment_shift = 1;
510 
513  static constexpr double moment_coefficient = 1;
514 
517  template<int D>
518  static void shift_moments_list(std::vector<double> & moments) {
519  // Shift and rescale moments
520  CoordinateSystem::shift_moments_list_core<D>(
521  moments, moment_shift, inv_geo_fac * moment_coefficient);
522  }
523 
524 }; // Cylindrical (3D) Coordinates
525 
526 
527 // ============================================================================
531  public:
532 
534  static std::string to_string() {
535  return std::string{"spherical radial coordinates"};
536  }
537 
541  static constexpr double geometry_factor = 1;
542 
544  static constexpr double inv_geo_fac = 1.0 / geometry_factor;
545 
547  template<int D>
548  static constexpr void verify_coordinate_system() {
549  // Valid only in 1D
550  static_assert(D == 1,
551  "Spherical (radial) coordinates only valid in 1D.");
552  }
553 
555  template<int D>
556  static constexpr void modify_gradient(Vector<D> & gradient,
557  Point<D> const & reference_point) {
558  // No change from "standard", Cartesian-like calculation.
559  }
560 
562  template<int D>
563  static constexpr void modify_line_element(Vector<D> & line_element,
564  Point<D> const & reference_point) {
565  // No change from "standard", Cartesian-like calculation.
566  }
567 
570  template<int D>
571  static constexpr void modify_volume(double & volume,
572  Point<D> const & plo, Point<D> const & phi) {
573  // Adjust for different coordinate system
574  auto rbar = 0.5 * (plo[0] + phi[0]);
575  auto dr_2 = 0.5 * (phi[0] - plo[0]);
576  volume *= CoordinateSystem::fourpi * (rbar*rbar + dr_2*dr_2/3.0);
577  // Apply geometry factor
578  volume *= inv_geo_fac;
579  }
580 
583  template<int D>
584  static constexpr void modify_first_moments(Point<D> & moments,
585  Point<D> const & plo, Point<D> const & phi) {
586  // Adjust for different coordinate system
587  auto rbar = 0.5 * (phi[0] + plo[0]);
588  auto dr_2 = 0.5 * (phi[0] - plo[0]);
589  moments[0] *= CoordinateSystem::fourpi * (rbar*rbar + dr_2*dr_2);
590  // Apply geometry factor
591  for (int d = 0; d < D; ++d) {
592  moments[d] *= inv_geo_fac;
593  }
594  }
595 
599  static constexpr int moment_shift = 2;
600 
603  static constexpr double moment_coefficient = CoordinateSystem::fourpi;
604 
607  template<int D>
608  static void shift_moments_list(std::vector<double> & moments) {
609  // Shift and rescale moments
610  CoordinateSystem::shift_moments_list_core<D>(
611  moments, moment_shift, inv_geo_fac * moment_coefficient);
612  }
613 
614 }; // Spherical (Radial) Coordinates
615 
616 
617 // ============================================================================
622  public:
623 
625  static std::string to_string() {
626  return std::string{"spherical 3D coordinates"};
627  }
628 
630  static constexpr double geometry_factor = 1;
631 
633  static constexpr double inv_geo_fac = 1.0 / geometry_factor;
634 
636  template<int D>
637  static constexpr void verify_coordinate_system() {
638  // Valid only in 3D
639  static_assert(D == 3,
640  "Spherical (3D) coordinates only valid in 3D.");
641  }
642 
644  template<int D>
645  static constexpr void modify_gradient(Vector<D> & gradient,
646  Point<D> const & reference_point) {
647  gradient[1] /= reference_point[0];
648  gradient[2] /= (reference_point[0] * sin(reference_point[1]));
649  }
650 
652  template<int D>
653  static constexpr void modify_line_element(Vector<D> & line_element,
654  Point<D> const & reference_point) {
655  line_element[1] *= reference_point[0];
656  line_element[2] *= (reference_point[0] * sin(reference_point[1]));
657  }
658 
661  template<int D>
662  static constexpr void modify_volume(double & volume,
663  Point<D> const & plo, Point<D> const & phi) {
664  // Adjust for different coordinate system
665  auto rbar = 0.5 * (plo[0] + phi[0]);
666  auto dr_2 = 0.5 * (phi[0] - plo[0]);
667  auto thetabar = 0.5 * (phi[1] + plo[1]);
668  auto dtheta_2 = 0.5 * (phi[1] - plo[1]);
669  auto sin_tb = sin(thetabar);
670  auto sinc_dt = sin(dtheta_2) / dtheta_2;
671  volume *= (rbar*rbar + dr_2*dr_2/3.0) * (sin_tb * sinc_dt);
672  // Apply geometry factor
673  volume *= inv_geo_fac;
674  }
675 
678  template<int D>
679  static constexpr void modify_first_moments(Point<D> & moments,
680  Point<D> const & plo, Point<D> const & phi) {
681  // Adjust for different coordinate system
682  auto rbar = 0.5 * (phi[0] + plo[0]);
683  auto dr_2 = 0.5 * (phi[0] - plo[0]);
684  auto rbar_sq = rbar * rbar;
685  auto dr_2_sq = dr_2 * dr_2;
686  auto rr1 = rbar_sq + dr_2_sq;
687  auto rr2 = rbar_sq + dr_2_sq/3.0;
688  auto thetabar = 0.5 * (phi[1] + plo[1]);
689  auto dtheta_2 = 0.5 * (phi[1] - plo[1]);
690  auto sin_tb = sin(thetabar);
691  auto sinc_dt = sin(dtheta_2) / dtheta_2;
692  auto cosc_tb = cos(thetabar) / thetabar;
693  auto cos_dt = cos(dtheta_2);
694  auto ss1 = sin_tb * sinc_dt;
695  moments[0] *= rr1 * ss1;
696  moments[1] *= rr2 * (ss1 + cosc_tb * (sinc_dt - cos_dt));
697  moments[2] *= rr2 * ss1;
698  // Apply geometry factor
699  for (int d = 0; d < D; ++d) {
700  moments[d] *= inv_geo_fac;
701  }
702  }
703 
707  static constexpr int moment_shift = 2;
708 
711  static constexpr double moment_coefficient = 1;
712 
715  template<int D>
716  static void shift_moments_list(std::vector<double> & moments) {
717  // TODO: The precise expression is M^{\rm sph}[i,j,k] = (1/G)
718  // sum_{n=0}^{\infty} \left[ \frac{(-1)^n}{(2n)!} M^{\rm
719  // Cart}[i+2,j+2n,k]\right]. We could allow an approximation that
720  // performs that summation over however many moments are available,
721  // and higher moments will be progressively lower accuracy (because
722  // there will be less moments available for the summation). In that
723  // case, we should still leave moment_shift as 2, because you
724  // definitely lose two orders, and then any order you keep has an
725  // accuracy limited by how many moments are available. But in that
726  // case, we would definitely want the user to be aware of this, such
727  // as by a compiler flag that compiles in the approximate formula vs
728  // compiling in the failed assertion below.
729  // Spherical coordinates include an extra factor of r^2 sin(theta), which
730  // cannot be managed by shifting moments.
731  std::cerr << "The shift_moments_list method does not work in 3D " <<
732  "spherical coordinates." << std::endl;
733  assert(false);
734  }
735 
736 }; // Spherical (3D) Coordinates
737 
738 
739 // ============================================================================
740 
741 // Default coordinate system for consistency across the code
743 
744 // ============================================================================
745 
746 } // namespace Wonton
747 
748 #endif // WONTON_SUPPORT_COORDINATESYSTEM_H_
static void shift_moments_list(std::vector< double > &moments)
Definition: CoordinateSystem.h:339
static constexpr void verify_coordinate_system()
Verify coordinate system / dimensionality combination.
Definition: CoordinateSystem.h:548
static constexpr void modify_first_moments(Point< D > &moments, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:403
static constexpr void modify_gradient(Vector< D > &gradient, Point< D > const &reference_point)
Modify gradient to account for the coordinate system.
Definition: CoordinateSystem.h:465
Cartesian Coordinates.
Definition: CoordinateSystem.h:82
static constexpr void modify_first_moments(Point< D > &moments, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:679
static void shift_moments_list(std::vector< double > &moments)
Definition: CoordinateSystem.h:155
static constexpr void modify_gradient(Vector< D > &gradient, Point< D > const &reference_point)
Modify gradient to account for the coordinate system.
Definition: CoordinateSystem.h:556
static std::string to_string()
Name as a string.
Definition: CoordinateSystem.h:175
static constexpr void modify_gradient(Vector< D > &gradient, Point< D > const &reference_point)
Modify gradient to account for the coordinate system.
Definition: CoordinateSystem.h:645
Factorize a number N into D equal (or nearly equal) factors.
Definition: adaptive_refinement_mesh.h:31
Definition: CoordinateSystem.h:441
static constexpr void modify_volume(double &volume, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:391
static constexpr void verify_coordinate_system()
Verify coordinate system / dimensionality combination.
Definition: CoordinateSystem.h:368
static constexpr void modify_line_element(Vector< D > &line_element, Point< D > const &reference_point)
Modify line element to account for the coordinate system.
Definition: CoordinateSystem.h:653
constexpr double pi
Definition: CoordinateSystem.h:43
static constexpr void modify_volume(double &volume, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:212
static void shift_moments_list(std::vector< double > &moments)
Definition: CoordinateSystem.h:518
static void shift_moments_list(std::vector< double > &moments)
Definition: CoordinateSystem.h:247
static constexpr void modify_first_moments(Point< D > &moments, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:492
static void shift_moments_list(std::vector< double > &moments)
Definition: CoordinateSystem.h:428
static constexpr void modify_first_moments(Point< D > &moments, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:133
static constexpr void modify_gradient(Vector< D > &gradient, Point< D > const &reference_point)
Modify gradient to account for the coordinate system.
Definition: CoordinateSystem.h:106
static void shift_moments_list(std::vector< double > &moments)
Definition: CoordinateSystem.h:716
static constexpr void verify_coordinate_system()
Verify coordinate system / dimensionality combination.
Definition: CoordinateSystem.h:637
static constexpr void modify_line_element(Vector< D > &line_element, Point< D > const &reference_point)
Modify line element to account for the coordinate system.
Definition: CoordinateSystem.h:293
static constexpr void modify_volume(double &volume, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:571
static std::string to_string()
Name as a string.
Definition: CoordinateSystem.h:534
Definition: CoordinateSystem.h:621
constexpr double twopi
Definition: CoordinateSystem.h:44
Represents a point in an N-dimensional space.
Definition: Point.h:50
static std::string to_string()
Name as a string.
Definition: CoordinateSystem.h:86
static constexpr void modify_gradient(Vector< D > &gradient, Point< D > const &reference_point)
Modify gradient to account for the coordinate system.
Definition: CoordinateSystem.h:286
static constexpr void verify_coordinate_system()
Verify coordinate system / dimensionality combination.
Definition: CoordinateSystem.h:278
static constexpr void modify_line_element(Vector< D > &line_element, Point< D > const &reference_point)
Modify line element to account for the coordinate system.
Definition: CoordinateSystem.h:472
static constexpr void verify_coordinate_system()
Verify coordinate system / dimensionality combination.
Definition: CoordinateSystem.h:98
Definition: CoordinateSystem.h:260
static constexpr void modify_first_moments(Point< D > &moments, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:584
static std::string to_string()
Name as a string.
Definition: CoordinateSystem.h:264
static constexpr void modify_gradient(Vector< D > &gradient, Point< D > const &reference_point)
Modify gradient to account for the coordinate system.
Definition: CoordinateSystem.h:197
static std::string to_string()
Name as a string.
Definition: CoordinateSystem.h:445
static constexpr void verify_coordinate_system()
Verify coordinate system / dimensionality combination.
Definition: CoordinateSystem.h:457
static constexpr void modify_first_moments(Point< D > &moments, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:224
static constexpr void modify_line_element(Vector< D > &line_element, Point< D > const &reference_point)
Modify line element to account for the coordinate system.
Definition: CoordinateSystem.h:204
static constexpr void verify_coordinate_system()
Verify coordinate system / dimensionality combination.
Definition: CoordinateSystem.h:189
static constexpr void modify_gradient(Vector< D > &gradient, Point< D > const &reference_point)
Modify gradient to account for the coordinate system.
Definition: CoordinateSystem.h:376
static constexpr void modify_volume(double &volume, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:480
static std::string to_string()
Name as a string.
Definition: CoordinateSystem.h:625
static constexpr void modify_volume(double &volume, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:301
static std::string to_string()
Name as a string.
Definition: CoordinateSystem.h:356
static constexpr void modify_volume(double &volume, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:662
static constexpr void modify_line_element(Vector< D > &line_element, Point< D > const &reference_point)
Modify line element to account for the coordinate system.
Definition: CoordinateSystem.h:113
Definition: CoordinateSystem.h:352
static constexpr void modify_volume(double &volume, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:121
static constexpr void modify_line_element(Vector< D > &line_element, Point< D > const &reference_point)
Modify line element to account for the coordinate system.
Definition: CoordinateSystem.h:383
static constexpr void modify_first_moments(Point< D > &moments, Point< D > const &plo, Point< D > const &phi)
Definition: CoordinateSystem.h:313
Definition: CoordinateSystem.h:171
constexpr double fourpi
Definition: CoordinateSystem.h:45
static void shift_moments_list(std::vector< double > &moments)
Definition: CoordinateSystem.h:608
Definition: CoordinateSystem.h:530
static constexpr void modify_line_element(Vector< D > &line_element, Point< D > const &reference_point)
Modify line element to account for the coordinate system.
Definition: CoordinateSystem.h:563
Represents a vector in N-dimensional space.
Definition: Vector.h:40