diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-01-18 16:46:39 -0600 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 16:45:25 +0000 |
commit | 6d30eb78ce7a84291a17a9b63aeccaf234bec03f (patch) | |
tree | 4abafd3ac4b67252e08245e3f0962c98fbad48cb /Carpet | |
parent | 90c3774729e3a77c445442135943fc2e100065c1 (diff) |
CarpetRegrid2: Ensur that symmetries are consistent
Ensure that the specified symmetries are consistent with the activated
symmetry thorns.
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/CarpetRegrid2/src/paramcheck.cc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Carpet/CarpetRegrid2/src/paramcheck.cc b/Carpet/CarpetRegrid2/src/paramcheck.cc index 0ee09ca23..5cc897883 100644 --- a/Carpet/CarpetRegrid2/src/paramcheck.cc +++ b/Carpet/CarpetRegrid2/src/paramcheck.cc @@ -25,6 +25,57 @@ namespace CarpetRegrid2 { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; + enum sym_t { sym_unknown, sym_90, sym_180 }; + + int num_params = 0; + sym_t params = sym_unknown; + char const* param = ""; + if (symmetry_rotating90) { + ++num_params; + params = sym_90; + param = "symmetry_rotating90"; + } + if (symmetry_rotating180) { + ++num_params; + params = sym_180; + param = "symmetry_rotating180"; + } + + int num_thorns = 0; + sym_t thorns = sym_unknown; + char const* thorn = ""; + if (CCTK_IsThornActive ("RotatingSymmetry90")) { + ++num_thorns; + thorns = sym_90; + thorn = "RotatingSymmetry90"; + } + if (CCTK_IsThornActive ("RotatingSymmetry90r")) { + ++num_thorns; + thorns = sym_90; + thorn = "RotatingSymmetry90r"; + } + if (CCTK_IsThornActive ("RotatingSymmetry180")) { + ++num_thorns; + thorns = sym_180; + thorn = "RotatingSymmetry180"; + } + + if (num_params > 1) { + CCTK_PARAMWARN ("Too many of the symmetry parameters symmetry_rotating90 and symmetry_rotating180 are specified. (At most one of these can be specified.)"); + } + + if (num_thorns > 1) { + CCTK_PARAMWARN ("Too many of the symmetry thorns RotatingSymmetry90, RotatingSymmetry90r, and RotatingSymmetry180 are active. (At most one of these can be active.)"); + } + + if (params != sym_unknown and thorns != sym_unknown and params != thorns) { + CCTK_VParamWarn (CCTK_THORNSTRING, + "The symmetry parameters and the active thorns do not agree. The symmetry parameter \"%s\" and the active thorn \"%s\" cannot be used together.", + param, thorn); + } + + + if ((num_centres >= 1 and num_levels_1 > maxreflevels) or (num_centres >= 2 and num_levels_2 > maxreflevels) or (num_centres >= 3 and num_levels_3 > maxreflevels) or |