aboutsummaryrefslogtreecommitdiff
path: root/src/ApplyCartoon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ApplyCartoon.c')
-rw-r--r--src/ApplyCartoon.c56
1 files changed, 52 insertions, 4 deletions
diff --git a/src/ApplyCartoon.c b/src/ApplyCartoon.c
index a203105..61424e8 100644
--- a/src/ApplyCartoon.c
+++ b/src/ApplyCartoon.c
@@ -25,6 +25,7 @@ CCTK_FILEVERSION(BetaThorns_Cartoon2D_ApplyCartoon_c);
********************************************************************/
/* #define DEBUG 1 */
#define TENSORTYPE_BUFF_SIZE 7
+#define PROLONG_BUFF_SIZE 1000
/********************************************************************
********************* Local Routine Prototypes *********************
@@ -77,11 +78,15 @@ void Cartoon_ApplyBoundaries(CCTK_ARGUMENTS);
@endreturndesc
@@*/
-void Cartoon_ApplyBoundaries(CCTK_ARGUMENTS) {
+void Cartoon_ApplyBoundaries(CCTK_ARGUMENTS)
+{
+
DECLARE_CCTK_ARGUMENTS;
int num_vars, err, i, gi, group_tags_table;
CCTK_INT * vars;
char tensortype[TENSORTYPE_BUFF_SIZE];
+ char prolongtype[PROLONG_BUFF_SIZE];
+ int prolongmethod;
/* Allocate memory to hold selected bcs */
num_vars = Boundary_SelectedGVs(cctkGH, 0, NULL, NULL, NULL, NULL, NULL);
@@ -145,6 +150,49 @@ void Cartoon_ApplyBoundaries(CCTK_ARGUMENTS) {
#ifdef DEBUG
printf("Cartoon_ApplyBoundaries: tensor type is %s\n",tensortype);
#endif
+
+ /* Get prolongation type from group tags table */
+
+ err = Util_TableGetString(group_tags_table, PROLONG_BUFF_SIZE,
+ prolongtype, "Prolongation");
+
+ if (err == UTIL_ERROR_TABLE_NO_SUCH_KEY)
+ {
+ /* Use the default */
+
+ prolongmethod = PROLONG_LAGRANGE;
+ }
+ else if (err < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Error (%d) in TAGS table for variable group %s", err,
+ CCTK_GroupName(gi));
+ }
+ else
+ {
+ if (CCTK_Equals(prolongtype, "None"))
+ {
+ prolongmethod = PROLONG_LAGRANGE; /* But why? */
+ }
+ else if (CCTK_Equals(prolongtype, "Lagrange"))
+ {
+ prolongmethod = PROLONG_LAGRANGE;
+ }
+ else if (CCTK_Equals(prolongtype, "TVD"))
+ {
+ prolongmethod = PROLONG_ENO;
+ }
+ else if (CCTK_Equals(prolongtype, "ENO"))
+ {
+ prolongmethod = PROLONG_ENO;
+ }
+ else
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Error in TAGS table for variable group %s",
+ CCTK_GroupName(gi));
+ }
+ }
/* Here one should check that the group's size is correct for the
* specified tensortype.
@@ -154,13 +202,13 @@ void Cartoon_ApplyBoundaries(CCTK_ARGUMENTS) {
macro */
if (CCTK_Equals(tensortype, "scalar"))
{
- BndCartoon2DVI(cctkGH, TENSORTYPE_SCALAR, vars[i]);
+ BndCartoon2DVI(cctkGH, TENSORTYPE_SCALAR, prolongmethod, vars[i]);
} else if (CCTK_Equals(tensortype, "u"))
{
- BndCartoon2DVI(cctkGH, TENSORTYPE_U, vars[i]);
+ BndCartoon2DVI(cctkGH, TENSORTYPE_U, prolongmethod, vars[i]);
} else if (CCTK_Equals(tensortype, "dd_sym"))
{
- BndCartoon2DVI(cctkGH, TENSORTYPE_DDSYM, vars[i]);
+ BndCartoon2DVI(cctkGH, TENSORTYPE_DDSYM, prolongmethod, vars[i]);
} else
{
CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,