aboutsummaryrefslogtreecommitdiff
path: root/src/SetSym.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/SetSym.c')
-rw-r--r--src/SetSym.c261
1 files changed, 0 insertions, 261 deletions
diff --git a/src/SetSym.c b/src/SetSym.c
deleted file mode 100644
index 3277b8d..0000000
--- a/src/SetSym.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/*@@
- @file SetSym.c
- @date October 2001
- @author Denis Pollney
- @desc
- Turn off the boundary conditions on the cartoon faces
- for grid functions defined by various thorns.
- @enddesc
- @@*/
-
-#include <stdlib.h>
-
-#include "cGH.h"
-#include "CactusBase/CartGrid3D/src/Symmetry.h"
-
-#include "cctk.h"
-#include "cctk_Arguments.h"
-#include "cctk_Parameters.h"
-
-#define CARTOON_NOSYM -222;
-
-static const char *rcsid = "$Id$";
-
-CCTK_FILEVERSION(BetaThorns_Cartoon2D_SetSym_c);
-
-/* function prototypes */
-int ResetSym(cGH* GH, const char* vn);
-void Cartoon_SetSym_Einstein(CCTK_ARGUMENTS);
-void Cartoon_SetSym_BSSN(CCTK_ARGUMENTS);
-void Cartoon_SetSym_WaveToy(CCTK_ARGUMENTS);
-
-
- /*@@
- @routine Cartoon_ResetSym
- @date October 2001
- @author Denis Pollney
- @desc
- Applies a ruthless reset of the symmetry flag for the
- flat faces (y-direction) of the cartoon plane. The faces
- are given the flag CARTOON_NOSYM, which corresponds to
- the GFSYM_NOSYM flag in CartGrid3D. The problem with using
- CartGrid3D is that it is used to distinguish either a
- symmetry BC or radiation BC -- one or the other is always
- chosen. So instead, we assign the grid face an otherwise
- unrecognised flag which neither the symmetry routines nor
- boundary conditions will respond to. Not a complete solution,
- but good enough to get Cartoon running with standard
- BSSN configurations.
- This routine has to be run after SpatialCoordinates.
- @enddesc
- @@*/
-int
-ResetSym(cGH* GH, const char* vn)
-{
- SymmetryGHex *sGHex;
- int vi = CCTK_VarIndex(vn);
-
- if (vi < 0)
- {
- CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Couldn't find variable %s in ResetSym\n", vn);
- return -1;
- }
-
- sGHex = (SymmetryGHex*) GH->extensions[CCTK_GHExtensionHandle("Symmetry")];
-
- /*
- * Clobber the previously assigned symmetry flags on the y faces.
- */
- sGHex->GFSym[vi][2] = CARTOON_NOSYM;
- sGHex->GFSym[vi][3] = CARTOON_NOSYM;
-
- return 0;
-}
-
-
- /*@@
- @routine Cartoon_SetSym_Einstein
- @date October 2001
- @author Denis Pollney
- @desc
- Resets the symmetries for the Einstein grid functions so
- that boundary conditions are not applied to the cartoon
- faces.
- @enddesc
- @@*/
-
-void
-Cartoon_SetSym_Einstein(CCTK_ARGUMENTS)
-{
- DECLARE_CCTK_ARGUMENTS
-
- CCTK_INFO("Resetting cartoon boundary symmetries for Einstein variables");
-
- /* Handle both old and new einstein systems */
- if (CCTK_GroupIndex("einstein::metric") > -1)
- {
- ResetSym(cctkGH, "einstein::gxx");
- ResetSym(cctkGH, "einstein::gyy");
- ResetSym(cctkGH, "einstein::gzz");
- ResetSym(cctkGH, "einstein::gxy");
- ResetSym(cctkGH, "einstein::gxz");
- ResetSym(cctkGH, "einstein::gyz");
- ResetSym(cctkGH, "einstein::kxx");
- ResetSym(cctkGH, "einstein::kyy");
- ResetSym(cctkGH, "einstein::kzz");
- ResetSym(cctkGH, "einstein::kxy");
- ResetSym(cctkGH, "einstein::kxz");
- ResetSym(cctkGH, "einstein::kyz");
- ResetSym(cctkGH, "einstein::alp");
- ResetSym(cctkGH, "einstein::betax");
- ResetSym(cctkGH, "einstein::betay");
- ResetSym(cctkGH, "einstein::betaz");
- ResetSym(cctkGH, "einstein::emask");
- }
- else if (CCTK_GroupIndex("admbase::metric") > -1)
- {
- ResetSym(cctkGH, "admbase::gxx");
- ResetSym(cctkGH, "admbase::gyy");
- ResetSym(cctkGH, "admbase::gzz");
- ResetSym(cctkGH, "admbase::gxy");
- ResetSym(cctkGH, "admbase::gxz");
- ResetSym(cctkGH, "admbase::gyz");
- ResetSym(cctkGH, "admbase::kxx");
- ResetSym(cctkGH, "admbase::kyy");
- ResetSym(cctkGH, "admbase::kzz");
- ResetSym(cctkGH, "admbase::kxy");
- ResetSym(cctkGH, "admbase::kxz");
- ResetSym(cctkGH, "admbase::kyz");
- ResetSym(cctkGH, "admbase::alp");
- ResetSym(cctkGH, "admbase::betax");
- ResetSym(cctkGH, "admbase::betay");
- ResetSym(cctkGH, "admbase::betaz");
- ResetSym(cctkGH, "spacemask::emask");
- }
-
-}
-
- /*@@
- @routine Cartoon_SetSym_BSSN
- @date October 2001
- @author Denis Pollney
- @desc
- Resets the symmetries for the ADM_BSSN grid functions so
- that boundary conditions are not applied to the cartoon
- faces.
- @enddesc
- @@*/
-
-void
-Cartoon_SetSym_BSSN(CCTK_ARGUMENTS)
-{
- DECLARE_CCTK_ARGUMENTS
- DECLARE_CCTK_PARAMETERS
-
- int ret=0;
- /*char* method;*/
- char* evolution_system;
- char* evolution_method;
-
- evolution_system = CCTK_ParameterValString("evolution_system", "Einstein");
- evolution_method = CCTK_ParameterValString("evolution_method", "ADMBase");
-
- if (evolution_system)
- {
- ret = CCTK_Equals(evolution_system, "adm_bssn");
- }
- else if (evolution_method)
- {
- ret = CCTK_Equals(evolution_method, "adm_bssn");
- }
-
- if (ret)
- {
-
- CCTK_INFO("Resetting cartoon boundary symmetries for ADM_BSSN variables");
-
- ResetSym(cctkGH, "adm_bssn::ADM_BS_dtalp");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_phi");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_gxx");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_gyy");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_gzz");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_K");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Axx");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Ayy");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Azz");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_mask");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_gxy");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Axy");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_gxz");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Axz");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_gyz");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Ayz");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Gx");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Bx");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_dirx");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Gy");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_By");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_diry");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Gz");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_Bz");
- ResetSym(cctkGH, "adm_bssn::ADM_BS_dirz");
-
- if (CCTK_GroupIndex("einstein::shift") > -1)
- {
- ResetSym(cctkGH, "einstein::betax");
- ResetSym(cctkGH, "einstein::betay");
- ResetSym(cctkGH, "einstein::betaz");
- }
- else if (CCTK_GroupIndex("admbase::shift") > -1)
- {
- ResetSym(cctkGH, "admbase::betax");
- ResetSym(cctkGH, "admbase::betay");
- ResetSym(cctkGH, "admbase::betaz");
- }
-
- /* stagleap no longer exists in ADM_BSSN
- * method = CCTK_ParameterValString("method", "ADM_BSSN");
- * if (CCTK_Equals(method, "stagleap"))
- * {
- * ResetSym(cctkGH, "adm_bssn::ADM_BS_K_stag");
- * ResetSym(cctkGH, "adm_bssn::ADM_BS_Axx_stag");
- * ResetSym(cctkGH, "adm_bssn::ADM_BS_Ayy_stag");
- * ResetSym(cctkGH, "adm_bssn::ADM_BS_Azz_stag");
- * ResetSym(cctkGH, "adm_bssn::ADM_BS_Axy_stag");
- * ResetSym(cctkGH, "adm_bssn::ADM_BS_Axz_stag");
- * ResetSym(cctkGH, "adm_bssn::ADM_BS_Ayz_stag");
- * }
- * free(method);
- */
-
- }
-
- if (evolution_system)
- {
- free(evolution_system);
- }
- if (evolution_method)
- {
- free(evolution_method);
- }
-}
-
-
- /*@@
- @routine Cartoon_SetSym_WaveToy
- @date Oct 2002
- @author David Rideout
- @desc
- Resets the symmetries for the WaveToy grid function so
- that boundary conditions are not applied to the cartoon
- faces.
- @enddesc
- @@*/
-
-void Cartoon_SetSym_WaveToy(CCTK_ARGUMENTS) {
- DECLARE_CCTK_ARGUMENTS;
-
- CCTK_INFO("Resetting cartoon boundary symmetry for WaveToy variable");
- ResetSym(cctkGH, "wavetoy::phi");
-}