aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@80bd93c7-81bc-453a-9e3f-619c0b4f6fe4>2008-04-07 03:28:24 +0000
committerschnetter <schnetter@80bd93c7-81bc-453a-9e3f-619c0b4f6fe4>2008-04-07 03:28:24 +0000
commit03a581d1ccebd4b674816f12a86180c394f0041a (patch)
treebcfb6353299bd52ff881f80906ca53b924d72f48
parent2ba2eed6221f8801f74b9e54628365e45ee81441 (diff)
Update thorn ADMAnalysis to make it work better with mesh refinement.
We applied similar changes to ADMConstraints some time ago. Set prolongation types of all grid functions. Allow the Ricci tensor to have 3 time levels, so that its boundaries can be interpolated. Add parameters ricci_persist, ricci_timelevels, and ricci_prolongation_type to specify how the boundaries are treated. The default is to do nothing on mesh refinement boundaries, keeping the old behaviour. Select Ricci tensor boundary conditions in level mode in a new routine. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/ADMAnalysis/trunk@52 80bd93c7-81bc-453a-9e3f-619c0b4f6fe4
-rw-r--r--interface.ccl12
-rw-r--r--param.ccl18
-rw-r--r--schedule.ccl63
-rw-r--r--src/Ricci.c15
4 files changed, 91 insertions, 17 deletions
diff --git a/interface.ccl b/interface.ccl
index a439a9d..1e30d44 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -53,35 +53,35 @@ REQUIRES FUNCTION Boundary_SelectGroupForBC
public:
# For evaltrK
-REAL trace_of_K TYPE = GF TAGS = 'tensortypealias="scalar"'
+REAL trace_of_K TYPE = GF TAGS = 'tensortypealias="scalar" Prolongation="none"'
{
trK
} "trace of extrinsic curvature"
-REAL detofg TYPE = GF TAGS = 'tensortypealias="scalar"'
+REAL detofg TYPE = GF TAGS = 'tensortypealias="scalar" Prolongation="none"'
{
detg
} "determinant of the conformal metric"
# For carttoshpere (p=phi, q=theta)
-REAL spherical_metric TYPE = GF
+REAL spherical_metric TYPE = GF TAGS = 'Prolongation="none"'
{
grr,gqq,gpp,grq,grp,gqp
} "Metric in spherical coordinates"
-REAL spherical_curv TYPE = GF
+REAL spherical_curv TYPE = GF TAGS = 'Prolongation="none"'
{
krr,kqq,kpp,krq,krp,kqp
} "extrinsic curvature in spherical coordinates"
# For the Ricci tensor and scalar
-REAL ricci_tensor TYPE = GF TAGS = 'tensortypealias="dd_sym"'
+REAL ricci_tensor TYPE = GF TIMELEVELS = 3 TAGS = 'tensortypealias="dd_sym" ProlongationParameter="ADMAnalysis::ricci_prolongation_type"'
{
Ricci11, Ricci12, Ricci13, Ricci22, Ricci23, Ricci33
} "Components of the Ricci tensor"
-REAL ricci_scalar TYPE = GF TAGS = 'tensortypealias="scalar"'
+REAL ricci_scalar TYPE = GF TIMELEVELS = 3 TAGS = 'tensortypealias="scalar" ProlongationParameter="ADMAnalysis::ricci_prolongation_type"'
{
Ricci
} "The Ricci scalar"
diff --git a/param.ccl b/param.ccl
index 69727c7..179d7ee 100644
--- a/param.ccl
+++ b/param.ccl
@@ -10,3 +10,21 @@ private:
BOOLEAN normalize_dtheta_dphi "Project angular components onto r*dtheta and r*sin(theta)*dphi?"
{
} "no"
+
+
+
+BOOLEAN ricci_persist "Keep storage of the Ricci tensor and scalar around?"
+{
+} "no"
+
+INT ricci_timelevels "Number of time levels for the Ricci tensor and scalar"
+{
+ 1:3 :: ""
+} 1
+
+KEYWORD ricci_prolongation_type "The kind of boundary prolongation for the Ricci tensor and scalar"
+{
+ "Lagrange" :: "standard prolongation (requires several time levels)"
+ "copy" :: "use data from the current time level (requires only one time level)"
+ "none" :: "no prolongation (use this if you do not have enough time levels active)"
+} "none"
diff --git a/schedule.ccl b/schedule.ccl
index abc354a..da09739 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -38,18 +38,67 @@ SCHEDULE ADMAnalysis_CurvCartToSphere AT CCTK_ANALYSIS
SYNC:spherical_curv
} "Calculate the spherical ex. curvature in r, theta(q), phi(p)"
-SCHEDULE GROUP RicciGroup at CCTK_ANALYSIS
+
+
+if (ricci_persist)
{
- STORAGE: ricci_tensor, ricci_scalar, detofg
- TRIGGERS: ricci_tensor, ricci_scalar
-} "Calculate Ricci tensor, with boundary conditions"
+ if (ricci_timelevels == 1)
+ {
+ STORAGE: ricci_tensor[1], ricci_scalar[1]
+ }
+ else if (ricci_timelevels == 2)
+ {
+ STORAGE: ricci_tensor[2], ricci_scalar[2]
+ }
+ else if (ricci_timelevels == 3)
+ {
+ STORAGE: ricci_tensor[3], ricci_scalar[3]
+ }
+
+ SCHEDULE GROUP RicciGroup at CCTK_POSTINITIAL after (MoL_PostStep MoL_PostInitial)
+ {
+ STORAGE: detofg
+ } "Calculate Ricci tensor, with boundary conditions"
+
+ SCHEDULE GROUP RicciGroup at CCTK_EVOL after MoL_Evolution
+ {
+ STORAGE: detofg
+ } "Calculate Ricci tensor, with boundary conditions"
+
+ SCHEDULE GROUP RicciBoundariesGroup at CCTK_POSTREGRID
+ {
+ STORAGE: detofg
+ } "Set Ricci tensor on the boundary"
+
+ SCHEDULE GROUP RicciBoundariesGroup at CCTK_POSTRESTRICT
+ {
+ } "Set Ricci tensor on the boundary"
+}
+else
+{
+ SCHEDULE GROUP RicciGroup at CCTK_ANALYSIS
+ {
+ STORAGE: ricci_tensor[1], ricci_scalar[1], detofg
+ TRIGGERS: ricci_tensor, ricci_scalar
+ } "Calculate Ricci tensor, with boundary conditions"
+}
SCHEDULE ADMAnalysis_Ricci in RicciGroup
{
LANG: C
+} "Calculate Ricci tensor, with boundary conditions"
+
+schedule GROUP RicciBoundariesGroup in RicciGroup after ADMAnalysis_Ricci
+{
+} "Set Ricci tensor on the boundary"
+
+SCHEDULE ADMAnalysis_Ricci_Boundaries in RicciBoundariesGroup
+{
+ LANG: C
+ OPTIONS: level
SYNC: ricci_tensor, ricci_scalar
-} "Calculation of the Ricci tensor"
+} "Select boundary conditions for the Ricci tensor"
-SCHEDULE GROUP ApplyBCs as ADMAnalysis_ApplyBCs in RicciGroup after ADMAnalysis_Ricci
+SCHEDULE GROUP ApplyBCs as ADMAnalysis_ApplyBCs in RicciBoundariesGroup after ADMAnalysis_Ricci
{
-} "Apply boundary conditions"
+} "Apply boundary conditions to the Ricci tensor"
diff --git a/src/Ricci.c b/src/Ricci.c
index adb4693..04f8b18 100644
--- a/src/Ricci.c
+++ b/src/Ricci.c
@@ -68,7 +68,7 @@ void ADMAnalysis_Ricci(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
CCTK_INT lsh[3];
- CCTK_INT i,j,k, d, ijk, di, dj, dk, err;
+ CCTK_INT i,j,k, d, ijk, di, dj, dk;
#include "CactusEinstein/ADMMacros/src/macro/RICCI_declare.h"
@@ -104,6 +104,16 @@ void ADMAnalysis_Ricci(CCTK_ARGUMENTS)
Ricci11, Ricci12, Ricci13, Ricci22, Ricci23, Ricci33,
Ricci, detg);
+ return;
+
+}
+
+void ADMAnalysis_Ricci_Boundaries(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+
+ CCTK_INT err;
+
/* Apply Flat Boundary Condition */
err = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1,
"ADMAnalysis::ricci_scalar", "Flat");
@@ -118,9 +128,6 @@ void ADMAnalysis_Ricci(CCTK_ARGUMENTS)
* value of the Ricci tensor is going to be used for something other
* than output, then the boundaries should be handled more properly.
*/
-
- return;
-
}
/********************************************************************