File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,23 @@ void Coordinates::Initialize(ParameterInput *pin) {
51
51
ATHENA_ERROR (msg);
52
52
}
53
53
54
+ // x2 limits must be symmetric about PI/2 in 1D
55
+ if (pm->ndim == 1 ) {
56
+ Real dmax = pm->mesh_size .x2max - PI/2.0 ;
57
+ Real dmin = PI/2.0 - pm->mesh_size .x2min ;
58
+ if (std::abs (dmax - dmin) > std::numeric_limits<Real>::epsilon ()) {
59
+ std::stringstream msg;
60
+ msg << " ### FATAL ERROR in BoundaryValues constructor" << std::endl
61
+ << " 1D spherical-like coordinates requires x2-limits to be symmetric about "
62
+ << std::setprecision (std::numeric_limits<Real>::max_digits10 -1 )
63
+ << std::scientific << PI/2.0 << " \n "
64
+ << " Current x2 domsin limits are: \n "
65
+ << " x2min=" << pm->mesh_size .x2min << " \n "
66
+ << " x2max=" << pm->mesh_size .x2max << std::endl;
67
+ ATHENA_ERROR (msg);
68
+ }
69
+ }
70
+
54
71
// initialize volume-averaged coordinates and spacing
55
72
// x1-direction: x1v = (\int r dV / \int dV) = d(r^4/4)/d(r^3/3)
56
73
for (int i=il-ng; i<=iu+ng; ++i) {
You can’t perform that action at this time.
0 commit comments