aboutsummaryrefslogtreecommitdiff
path: root/ML_BSSN_Helper
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2009-09-04 18:50:58 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2009-09-04 18:50:58 -0500
commita52abf35db4c68c5e28e8ce9b00b394c4ea382ee (patch)
tree821022c69d1b1ce7a41186243ae46b534c3f7721 /ML_BSSN_Helper
parent2cd0fd3a8711fbb9fa7f9db13c74301cd361c1cc (diff)
Add new RHS boundary condition NewRad, implemented in the thorn LSUThorns/NewRad.
Diffstat (limited to 'ML_BSSN_Helper')
-rw-r--r--ML_BSSN_Helper/interface.ccl29
-rw-r--r--ML_BSSN_Helper/param.ccl11
-rw-r--r--ML_BSSN_Helper/schedule.ccl27
-rw-r--r--ML_BSSN_Helper/src/ExtrapolateGammas.c29
-rw-r--r--ML_BSSN_Helper/src/NewRad.c67
-rw-r--r--ML_BSSN_Helper/src/make.code.defn2
6 files changed, 163 insertions, 2 deletions
diff --git a/ML_BSSN_Helper/interface.ccl b/ML_BSSN_Helper/interface.ccl
index 8ad9ba2..4c57f29 100644
--- a/ML_BSSN_Helper/interface.ccl
+++ b/ML_BSSN_Helper/interface.ccl
@@ -6,5 +6,32 @@ USES INCLUDE: Symmetry.h
-CCTK_INT FUNCTION Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN group_name, CCTK_STRING IN bc_name)
+CCTK_INT FUNCTION MoLRegisterConstrainedGroup \
+ (CCTK_INT IN ConstrainedIndex)
+USES FUNCTION MoLRegisterConstrainedGroup
+
+CCTK_INT FUNCTION \
+ Boundary_SelectGroupForBC \
+ (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_INT IN faces, \
+ CCTK_INT IN boundary_width, \
+ CCTK_INT IN table_handle, \
+ CCTK_STRING IN group_name, \
+ CCTK_STRING IN bc_name)
USES FUNCTION Boundary_SelectGroupForBC
+
+CCTK_INT FUNCTION \
+ ExtrapolateGammas \
+ (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_REAL ARRAY INOUT var)
+USES FUNCTION ExtrapolateGammas
+
+CCTK_INT FUNCTION \
+ NewRad_Apply \
+ (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_REAL ARRAY IN var, \
+ CCTK_REAL ARRAY INOUT rhs, \
+ CCTK_REAL IN var0, \
+ CCTK_REAL IN v0, \
+ CCTK_INT IN radpower)
+USES FUNCTION NewRad_Apply
diff --git a/ML_BSSN_Helper/param.ccl b/ML_BSSN_Helper/param.ccl
index 605ea7a..338d0a2 100644
--- a/ML_BSSN_Helper/param.ccl
+++ b/ML_BSSN_Helper/param.ccl
@@ -1,3 +1,7 @@
+SHARES: Boundary
+
+USES CCTK_INT radpower
+
SHARES: MethodofLines
USES CCTK_INT MoL_Num_Constrained_Vars
@@ -15,6 +19,13 @@ SHARES: ML_BSSN
USES CCTK_INT timelevels
USES KEYWORD calculate_ADMBase_variables_at
+USES CCTK_REAL harmonicF
+
+EXTENDS KEYWORD my_rhs_boundary_condition
+{
+ "NewRad" :: "NewRad"
+}
+
PRIVATE:
CCTK_INT ML_BSSN_MaxNumConstrainedVars "Number of constrained variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Constrained_Vars
diff --git a/ML_BSSN_Helper/schedule.ccl b/ML_BSSN_Helper/schedule.ccl
index a2134a1..48bea28 100644
--- a/ML_BSSN_Helper/schedule.ccl
+++ b/ML_BSSN_Helper/schedule.ccl
@@ -62,6 +62,33 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN")) {
+ if (CCTK_EQUALS (my_rhs_boundary_condition, "NewRad"))
+ {
+ SCHEDULE ML_BSSN_ExtrapolateGammas AT initial AFTER ML_BSSN_convertFromADMBaseGamma
+ {
+ LANG: C
+ SYNC: ML_Gamma
+ SYNC: ML_dtlapse
+ SYNC: ML_dtshift
+ } "Extrapolate Gammas and time derivatives of lapse and shift"
+
+ SCHEDULE ML_BSSN_NewRad IN ML_BSSN_evolCalcGroup AFTER ML_BSSN_RHS
+ {
+ LANG: C
+ SYNC: ML_curvrhs
+ SYNC: ML_dtlapserhs
+ SYNC: ML_dtshiftrhs
+ SYNC: ML_Gammarhs
+ SYNC: ML_lapserhs
+ SYNC: ML_log_confacrhs
+ SYNC: ML_metricrhs
+ SYNC: ML_shiftrhs
+ SYNC: ML_trace_curvrhs
+ } "Apply NewRad boundary conditions to RHS"
+ }
+
+
+
SCHEDULE GROUP ML_BSSN_convertToADMBaseGroup IN ML_BSSN_convertToADMBaseGroupWrapper
{
} "Calculate ADM variables"
diff --git a/ML_BSSN_Helper/src/ExtrapolateGammas.c b/ML_BSSN_Helper/src/ExtrapolateGammas.c
new file mode 100644
index 0000000..4e52e8f
--- /dev/null
+++ b/ML_BSSN_Helper/src/ExtrapolateGammas.c
@@ -0,0 +1,29 @@
+#include <cctk.h>
+#include <cctk_Arguments.h>
+
+static void
+extrap (cGH const * restrict cctkGH,
+ CCTK_REAL * restrict var);
+
+void
+ML_BSSN_ExtrapolateGammas (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+
+ extrap (cctkGH, Xt1);
+ extrap (cctkGH, Xt2);
+ extrap (cctkGH, Xt3);
+
+ extrap (cctkGH, A);
+
+ extrap (cctkGH, B1);
+ extrap (cctkGH, B2);
+ extrap (cctkGH, B3);
+}
+
+static void
+extrap (cGH const * restrict const cctkGH,
+ CCTK_REAL * restrict const var)
+{
+ ExtrapolateGammas (cctkGH, var);
+}
diff --git a/ML_BSSN_Helper/src/NewRad.c b/ML_BSSN_Helper/src/NewRad.c
new file mode 100644
index 0000000..9c576a1
--- /dev/null
+++ b/ML_BSSN_Helper/src/NewRad.c
@@ -0,0 +1,67 @@
+#include <math.h>
+
+#include <cctk.h>
+#include <cctk_Arguments.h>
+#include <cctk_Parameters.h>
+
+static void
+newrad (cGH const * restrict cctkGH,
+ CCTK_REAL const * restrict var,
+ CCTK_REAL * restrict rhs,
+ CCTK_REAL var0,
+ CCTK_REAL v0);
+
+void
+ML_BSSN_NewRad (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_REAL const v0 = sqrt (harmonicF);
+
+ newrad (cctkGH, phi , phirhs , 0.0, v0 );
+
+ newrad (cctkGH, gt11 , gt11rhs , 1.0, 1.0);
+ newrad (cctkGH, gt12 , gt12rhs , 0.0, 1.0);
+ newrad (cctkGH, gt13 , gt13rhs , 0.0, 1.0);
+ newrad (cctkGH, gt22 , gt22rhs , 1.0, 1.0);
+ newrad (cctkGH, gt23 , gt23rhs , 0.0, 1.0);
+ newrad (cctkGH, gt33 , gt33rhs , 1.0, 1.0);
+
+ newrad (cctkGH, Xt1 , Xt1rhs , 0.0, 1.0);
+ newrad (cctkGH, Xt2 , Xt2rhs , 0.0, 1.0);
+ newrad (cctkGH, Xt3 , Xt3rhs , 0.0, 1.0);
+
+ newrad (cctkGH, trK , trKrhs , 0.0, v0 );
+
+ newrad (cctkGH, At11 , At11rhs , 0.0, 1.0);
+ newrad (cctkGH, At12 , At12rhs , 0.0, 1.0);
+ newrad (cctkGH, At13 , At13rhs , 0.0, 1.0);
+ newrad (cctkGH, At22 , At22rhs , 0.0, 1.0);
+ newrad (cctkGH, At23 , At23rhs , 0.0, 1.0);
+ newrad (cctkGH, At33 , At33rhs , 0.0, 1.0);
+
+ newrad (cctkGH, alpha, alpharhs, 1.0, v0 );
+
+ newrad (cctkGH, A , Arhs , 0.0, v0 );
+
+ newrad (cctkGH, beta1, beta1rhs, 0.0, 1.0);
+ newrad (cctkGH, beta2, beta2rhs, 0.0, 1.0);
+ newrad (cctkGH, beta3, beta3rhs, 0.0, 1.0);
+
+ newrad (cctkGH, B1 , B1rhs , 0.0, 1.0);
+ newrad (cctkGH, B2 , B2rhs , 0.0, 1.0);
+ newrad (cctkGH, B3 , B3rhs , 0.0, 1.0);
+}
+
+static void
+newrad (cGH const * restrict const cctkGH,
+ CCTK_REAL const * restrict const var,
+ CCTK_REAL * restrict const rhs,
+ CCTK_REAL const var0,
+ CCTK_REAL const v0)
+{
+ DECLARE_CCTK_PARAMETERS;
+
+ NewRad_Apply (cctkGH, var, rhs, var0, v0, radpower);
+}
diff --git a/ML_BSSN_Helper/src/make.code.defn b/ML_BSSN_Helper/src/make.code.defn
index dcfe66e..7cc4e72 100644
--- a/ML_BSSN_Helper/src/make.code.defn
+++ b/ML_BSSN_Helper/src/make.code.defn
@@ -1,3 +1,3 @@
# -*-Makefile-*-
-SRCS = RegisterConstrained.c RegisterSlicing.c SelectBCsADMBase.c UnsetCheckpointTags.c
+SRCS = ExtrapolateGammas.c NewRad.c RegisterConstrained.c RegisterSlicing.c SelectBCsADMBase.c UnsetCheckpointTags.c
# CopyADMBase.c