From ec3c868d9084b5173a708f211d17da047f24d298 Mon Sep 17 00:00:00 2001 From: hayk Date: Thu, 27 Jun 2024 15:10:47 -0400 Subject: [PATCH] added special check for 2D in sph/qsph --- README.md | 2 +- src/metrics/qspherical.h | 4 ++++ src/metrics/spherical.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 047da4b2c..41a5fe47e 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,4 @@ Our [detailed documentation](https://entity-toolkit.github.io/) includes everyth ## Branch policy -Master branch contains the latest stable version of the code which has already been released. Development on the core is done on branches starting with `dev/`. User-specific modifications (i.e., new problem generators plus perhaps minor corrections in the core) are done on branches starting with `pgen/`. Before merging to the master branch, all the branches must first be merged to the latest release-candidate branch, which ends with `rc`, via a pull request. After which, when all the release goals are met, the `rc` branch is merged to the master and released as a new stable version. Stale branches will be archived with a tag starting with `archive/` (can still be accessed via the "Tags" tab) and removed. +Master branch contains the latest stable version of the code which has already been released. Development on the core is done on branches starting with `dev/`, while fixing bugs is done in branches that start with `bug/`. User-specific modifications (i.e., new problem generators plus perhaps minor corrections in the core) are done on branches starting with `pgen/`. Before merging to the master branch, all the branches must first be merged to the latest release-candidate branch, which ends with `rc`, via a pull request. After which, when all the release goals are met, the `rc` branch is merged to the master and released as a new stable version. Stale branches will be archived with a tag starting with `archive/` (can still be accessed via the "Tags" tab) and removed. diff --git a/src/metrics/qspherical.h b/src/metrics/qspherical.h index 3f370d03a..8062f7589 100644 --- a/src/metrics/qspherical.h +++ b/src/metrics/qspherical.h @@ -317,6 +317,8 @@ namespace metric { return v_in * math::exp(xi[0] * dchi + chi_min) * dchi; } else if constexpr (i == 2) { return v_in * (dtheta_deta(xi[1] * deta + eta_min) * deta); + } else if constexpr (D == Dim::_2D) { + return v_in; } else { return v_in * dphi; } @@ -327,6 +329,8 @@ namespace metric { return v_in * dchi_inv / (math::exp(xi[0] * dchi + chi_min)); } else if constexpr (i == 2) { return v_in * deta_inv / (dtheta_deta(xi[1] * deta + eta_min)); + } else if constexpr (D == Dim::_2D) { + return v_in; } else { return v_in * dphi_inv; } diff --git a/src/metrics/spherical.h b/src/metrics/spherical.h index 1e6f83dbc..f4bbe2eea 100644 --- a/src/metrics/spherical.h +++ b/src/metrics/spherical.h @@ -285,6 +285,8 @@ namespace metric { return v_in * dr; } else if constexpr (i == 2) { return v_in * dtheta; + } else if constexpr (D == Dim::_2D) { + return v_in; } else { return v_in * dphi; } @@ -295,6 +297,8 @@ namespace metric { return v_in * dr_inv; } else if constexpr (i == 2) { return v_in * dtheta_inv; + } else if constexpr (D == Dim::_2D) { + return v_in; } else { return v_in * dphi_inv; }