diff options
73 files changed, 15147 insertions, 2025 deletions
diff --git a/ML_ADM/interface.ccl b/ML_ADM/interface.ccl index 305c740..cdbd29e 100644 --- a/ML_ADM/interface.ccl +++ b/ML_ADM/interface.ccl @@ -5,7 +5,7 @@ implements: ML_ADM -inherits: ADMBase TmunuBase Grid GenericFD Boundary +inherits: ADMBase Grid GenericFD Boundary @@ -31,21 +31,21 @@ CCTK_INT FUNCTION Boundary_SelectVarForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT USES FUNCTION Boundary_SelectVarForBC public: -CCTK_REAL Ham type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +CCTK_REAL ML_Ham type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' { H -} "Ham" +} "ML_Ham" public: -CCTK_REAL mom type=GF timelevels=1 tags='tensortypealias="D" tensorweight=1.0000000000000000000' +CCTK_REAL ML_mom type=GF timelevels=1 tags='tensortypealias="D" tensorweight=1.0000000000000000000' { M1, M2, M3 -} "mom" +} "ML_mom" public: -CCTK_REAL ml_curvrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tensorweight=1.0000000000000000000' +CCTK_REAL ML_curvrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tensorweight=1.0000000000000000000' { K11rhs, K12rhs, @@ -53,16 +53,16 @@ CCTK_REAL ml_curvrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tensorw K22rhs, K23rhs, K33rhs -} "ml_curvrhs" +} "ML_curvrhs" public: -CCTK_REAL ml_lapserhs type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +CCTK_REAL ML_lapserhs type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' { alpharhs -} "ml_lapserhs" +} "ML_lapserhs" public: -CCTK_REAL ml_metricrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tensorweight=1.0000000000000000000' +CCTK_REAL ML_metricrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tensorweight=1.0000000000000000000' { g11rhs, g12rhs, @@ -70,18 +70,18 @@ CCTK_REAL ml_metricrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tenso g22rhs, g23rhs, g33rhs -} "ml_metricrhs" +} "ML_metricrhs" public: -CCTK_REAL ml_shiftrhs type=GF timelevels=1 tags='tensortypealias="U" tensorweight=1.0000000000000000000' +CCTK_REAL ML_shiftrhs type=GF timelevels=1 tags='tensortypealias="U" tensorweight=1.0000000000000000000' { beta1rhs, beta2rhs, beta3rhs -} "ml_shiftrhs" +} "ML_shiftrhs" public: -CCTK_REAL ml_curv type=GF timelevels=3 tags='tensortypealias="DD_sym" tensorweight=1.0000000000000000000' +CCTK_REAL ML_curv type=GF timelevels=3 tags='tensortypealias="DD_sym" tensorweight=1.0000000000000000000' { K11, K12, @@ -89,16 +89,16 @@ CCTK_REAL ml_curv type=GF timelevels=3 tags='tensortypealias="DD_sym" tensorweig K22, K23, K33 -} "ml_curv" +} "ML_curv" public: -CCTK_REAL ml_lapse type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +CCTK_REAL ML_lapse type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' { alpha -} "ml_lapse" +} "ML_lapse" public: -CCTK_REAL ml_metric type=GF timelevels=3 tags='tensortypealias="DD_sym" tensorweight=1.0000000000000000000' +CCTK_REAL ML_metric type=GF timelevels=3 tags='tensortypealias="DD_sym" tensorweight=1.0000000000000000000' { g11, g12, @@ -106,12 +106,12 @@ CCTK_REAL ml_metric type=GF timelevels=3 tags='tensortypealias="DD_sym" tensorwe g22, g23, g33 -} "ml_metric" +} "ML_metric" public: -CCTK_REAL ml_shift type=GF timelevels=3 tags='tensortypealias="U" tensorweight=1.0000000000000000000' +CCTK_REAL ML_shift type=GF timelevels=3 tags='tensortypealias="U" tensorweight=1.0000000000000000000' { beta1, beta2, beta3 -} "ml_shift" +} "ML_shift" diff --git a/ML_ADM/param.ccl b/ML_ADM/param.ccl index db99057..b22e4ba 100644 --- a/ML_ADM/param.ccl +++ b/ML_ADM/param.ccl @@ -19,9 +19,9 @@ USES CCTK_INT MoL_Num_Evolved_Vars USES CCTK_INT MoL_Num_Constrained_Vars restricted: -CCTK_REAL verbose "verbose" +CCTK_INT verbose "verbose" { - "*:*" :: "" + *:* :: "" } 0 private: @@ -47,8 +47,8 @@ CCTK_INT ML_ADM_MaxNumEvolvedVars "Number of evolved variables used by this thor restricted: CCTK_INT ML_ADM_MaxNumConstrainedVars "Number of constrained variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Constrained_Vars { - 38:38 :: "Number of constrained variables used by this thorn" -} 38 + 65:65 :: "Number of constrained variables used by this thorn" +} 65 restricted: CCTK_INT timelevels "Number of active timelevels" @@ -333,7 +333,7 @@ KEYWORD beta3_bound "Boundary condition to implement" } "skip" private: -KEYWORD ml_curv_bound "Boundary condition to implement" +KEYWORD ML_curv_bound "Boundary condition to implement" { "flat" :: "Flat boundary condition" "none" :: "No boundary condition" @@ -345,7 +345,7 @@ KEYWORD ml_curv_bound "Boundary condition to implement" } "skip" private: -KEYWORD ml_lapse_bound "Boundary condition to implement" +KEYWORD ML_lapse_bound "Boundary condition to implement" { "flat" :: "Flat boundary condition" "none" :: "No boundary condition" @@ -357,7 +357,7 @@ KEYWORD ml_lapse_bound "Boundary condition to implement" } "skip" private: -KEYWORD ml_metric_bound "Boundary condition to implement" +KEYWORD ML_metric_bound "Boundary condition to implement" { "flat" :: "Flat boundary condition" "none" :: "No boundary condition" @@ -369,7 +369,7 @@ KEYWORD ml_metric_bound "Boundary condition to implement" } "skip" private: -KEYWORD ml_shift_bound "Boundary condition to implement" +KEYWORD ML_shift_bound "Boundary condition to implement" { "flat" :: "Flat boundary condition" "none" :: "No boundary condition" @@ -477,25 +477,25 @@ CCTK_REAL beta3_bound_speed "characteristic speed at boundary" } 1. private: -CCTK_REAL ml_curv_bound_speed "characteristic speed at boundary" +CCTK_REAL ML_curv_bound_speed "characteristic speed at boundary" { "0:*" :: "outgoing characteristic speed > 0" } 1. private: -CCTK_REAL ml_lapse_bound_speed "characteristic speed at boundary" +CCTK_REAL ML_lapse_bound_speed "characteristic speed at boundary" { "0:*" :: "outgoing characteristic speed > 0" } 1. private: -CCTK_REAL ml_metric_bound_speed "characteristic speed at boundary" +CCTK_REAL ML_metric_bound_speed "characteristic speed at boundary" { "0:*" :: "outgoing characteristic speed > 0" } 1. private: -CCTK_REAL ml_shift_bound_speed "characteristic speed at boundary" +CCTK_REAL ML_shift_bound_speed "characteristic speed at boundary" { "0:*" :: "outgoing characteristic speed > 0" } 1. @@ -597,25 +597,25 @@ CCTK_REAL beta3_bound_limit "limit value for r -> infinity" } 0. private: -CCTK_REAL ml_curv_bound_limit "limit value for r -> infinity" +CCTK_REAL ML_curv_bound_limit "limit value for r -> infinity" { "*:*" :: "value of limit value is unrestricted" } 0. private: -CCTK_REAL ml_lapse_bound_limit "limit value for r -> infinity" +CCTK_REAL ML_lapse_bound_limit "limit value for r -> infinity" { "*:*" :: "value of limit value is unrestricted" } 0. private: -CCTK_REAL ml_metric_bound_limit "limit value for r -> infinity" +CCTK_REAL ML_metric_bound_limit "limit value for r -> infinity" { "*:*" :: "value of limit value is unrestricted" } 0. private: -CCTK_REAL ml_shift_bound_limit "limit value for r -> infinity" +CCTK_REAL ML_shift_bound_limit "limit value for r -> infinity" { "*:*" :: "value of limit value is unrestricted" } 0. @@ -717,25 +717,25 @@ CCTK_REAL beta3_bound_scalar "Dirichlet boundary value" } 0. private: -CCTK_REAL ml_curv_bound_scalar "Dirichlet boundary value" +CCTK_REAL ML_curv_bound_scalar "Dirichlet boundary value" { "*:*" :: "unrestricted" } 0. private: -CCTK_REAL ml_lapse_bound_scalar "Dirichlet boundary value" +CCTK_REAL ML_lapse_bound_scalar "Dirichlet boundary value" { "*:*" :: "unrestricted" } 0. private: -CCTK_REAL ml_metric_bound_scalar "Dirichlet boundary value" +CCTK_REAL ML_metric_bound_scalar "Dirichlet boundary value" { "*:*" :: "unrestricted" } 0. private: -CCTK_REAL ml_shift_bound_scalar "Dirichlet boundary value" +CCTK_REAL ML_shift_bound_scalar "Dirichlet boundary value" { "*:*" :: "unrestricted" } 0. diff --git a/ML_ADM/schedule.ccl b/ML_ADM/schedule.ccl index e66f883..88c07e5 100644 --- a/ML_ADM/schedule.ccl +++ b/ML_ADM/schedule.ccl @@ -4,68 +4,68 @@ # Mathematica script written by Ian Hinder and Sascha Husa -STORAGE: Ham[1] +STORAGE: ML_Ham[1] -STORAGE: mom[1] +STORAGE: ML_mom[1] -STORAGE: ml_curvrhs[1] +STORAGE: ML_curvrhs[1] -STORAGE: ml_lapserhs[1] +STORAGE: ML_lapserhs[1] -STORAGE: ml_metricrhs[1] +STORAGE: ML_metricrhs[1] -STORAGE: ml_shiftrhs[1] +STORAGE: ML_shiftrhs[1] if (timelevels == 1) { - STORAGE: ml_curv[1] + STORAGE: ML_curv[1] } if (timelevels == 2) { - STORAGE: ml_curv[2] + STORAGE: ML_curv[2] } if (timelevels == 3) { - STORAGE: ml_curv[3] + STORAGE: ML_curv[3] } if (timelevels == 1) { - STORAGE: ml_lapse[1] + STORAGE: ML_lapse[1] } if (timelevels == 2) { - STORAGE: ml_lapse[2] + STORAGE: ML_lapse[2] } if (timelevels == 3) { - STORAGE: ml_lapse[3] + STORAGE: ML_lapse[3] } if (timelevels == 1) { - STORAGE: ml_metric[1] + STORAGE: ML_metric[1] } if (timelevels == 2) { - STORAGE: ml_metric[2] + STORAGE: ML_metric[2] } if (timelevels == 3) { - STORAGE: ml_metric[3] + STORAGE: ML_metric[3] } if (timelevels == 1) { - STORAGE: ml_shift[1] + STORAGE: ML_shift[1] } if (timelevels == 2) { - STORAGE: ml_shift[2] + STORAGE: ML_shift[2] } if (timelevels == 3) { - STORAGE: ml_shift[3] + STORAGE: ML_shift[3] } schedule ML_ADM_Startup at STARTUP @@ -112,10 +112,10 @@ schedule ML_ADM_RHS IN MoL_CalcRHS schedule ML_ADM_RHS AT analysis { LANG: C - SYNC: ml_curvrhs - SYNC: ml_lapserhs - SYNC: ml_metricrhs - SYNC: ml_shiftrhs + SYNC: ML_curvrhs + SYNC: ML_lapserhs + SYNC: ML_metricrhs + SYNC: ML_shiftrhs } "ML_ADM_RHS" @@ -127,7 +127,7 @@ if (CCTK_EQUALS(my_boundary_condition, "Minkowski")) } "ML_ADM_boundary" } -schedule ML_ADM_convertToADMBase IN MoL_PostStep AFTER (ML_ADM_ApplyBCs ML_ADM_boundary) +schedule ML_ADM_convertToADMBase IN MoL_PostStep AFTER ML_ADM_ApplyBCs { LANG: C } "ML_ADM_convertToADMBase" @@ -135,10 +135,10 @@ schedule ML_ADM_convertToADMBase IN MoL_PostStep AFTER (ML_ADM_ApplyBCs ML_ADM_b schedule ML_ADM_constraints AT analysis { LANG: C - SYNC: Ham - SYNC: mom - TRIGGERS: Ham - TRIGGERS: mom + SYNC: ML_Ham + SYNC: ML_mom + TRIGGERS: ML_Ham + TRIGGERS: ML_mom } "ML_ADM_constraints" schedule ML_ADM_constraints_boundary AT analysis AFTER ML_ADM_constraints @@ -150,10 +150,10 @@ schedule ML_ADM_ApplyBoundConds in MoL_PostStep { LANG: C OPTIONS: level - SYNC: ml_curv - SYNC: ml_lapse - SYNC: ml_metric - SYNC: ml_shift + SYNC: ML_curv + SYNC: ML_lapse + SYNC: ML_metric + SYNC: ML_shift } "apply boundary conditions" schedule ML_ADM_CheckBoundaries at BASEGRID diff --git a/ML_ADM/src/Boundaries.c b/ML_ADM/src/Boundaries.c index 8c6c288..de39fc6 100644 --- a/ML_ADM/src/Boundaries.c +++ b/ML_ADM/src/Boundaries.c @@ -35,48 +35,48 @@ void ML_ADM_ApplyBoundConds(CCTK_ARGUMENTS) CCTK_INT ierr = 0; - if (CCTK_EQUALS(ml_curv_bound, "none" ) || - CCTK_EQUALS(ml_curv_bound, "static") || - CCTK_EQUALS(ml_curv_bound, "flat" ) || - CCTK_EQUALS(ml_curv_bound, "zero" ) ) + if (CCTK_EQUALS(ML_curv_bound, "none" ) || + CCTK_EQUALS(ML_curv_bound, "static") || + CCTK_EQUALS(ML_curv_bound, "flat" ) || + CCTK_EQUALS(ML_curv_bound, "zero" ) ) { ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - "ML_ADM::ml_curv", ml_curv_bound); + "ML_ADM::ML_curv", ML_curv_bound); if (ierr < 0) - CCTK_WARN(0, "Failed to register ml_curv_bound BC for ML_ADM::ml_curv!"); + CCTK_WARN(0, "Failed to register ML_curv_bound BC for ML_ADM::ML_curv!"); } - if (CCTK_EQUALS(ml_lapse_bound, "none" ) || - CCTK_EQUALS(ml_lapse_bound, "static") || - CCTK_EQUALS(ml_lapse_bound, "flat" ) || - CCTK_EQUALS(ml_lapse_bound, "zero" ) ) + if (CCTK_EQUALS(ML_lapse_bound, "none" ) || + CCTK_EQUALS(ML_lapse_bound, "static") || + CCTK_EQUALS(ML_lapse_bound, "flat" ) || + CCTK_EQUALS(ML_lapse_bound, "zero" ) ) { ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - "ML_ADM::ml_lapse", ml_lapse_bound); + "ML_ADM::ML_lapse", ML_lapse_bound); if (ierr < 0) - CCTK_WARN(0, "Failed to register ml_lapse_bound BC for ML_ADM::ml_lapse!"); + CCTK_WARN(0, "Failed to register ML_lapse_bound BC for ML_ADM::ML_lapse!"); } - if (CCTK_EQUALS(ml_metric_bound, "none" ) || - CCTK_EQUALS(ml_metric_bound, "static") || - CCTK_EQUALS(ml_metric_bound, "flat" ) || - CCTK_EQUALS(ml_metric_bound, "zero" ) ) + if (CCTK_EQUALS(ML_metric_bound, "none" ) || + CCTK_EQUALS(ML_metric_bound, "static") || + CCTK_EQUALS(ML_metric_bound, "flat" ) || + CCTK_EQUALS(ML_metric_bound, "zero" ) ) { ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - "ML_ADM::ml_metric", ml_metric_bound); + "ML_ADM::ML_metric", ML_metric_bound); if (ierr < 0) - CCTK_WARN(0, "Failed to register ml_metric_bound BC for ML_ADM::ml_metric!"); + CCTK_WARN(0, "Failed to register ML_metric_bound BC for ML_ADM::ML_metric!"); } - if (CCTK_EQUALS(ml_shift_bound, "none" ) || - CCTK_EQUALS(ml_shift_bound, "static") || - CCTK_EQUALS(ml_shift_bound, "flat" ) || - CCTK_EQUALS(ml_shift_bound, "zero" ) ) + if (CCTK_EQUALS(ML_shift_bound, "none" ) || + CCTK_EQUALS(ML_shift_bound, "static") || + CCTK_EQUALS(ML_shift_bound, "flat" ) || + CCTK_EQUALS(ML_shift_bound, "zero" ) ) { ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, - "ML_ADM::ml_shift", ml_shift_bound); + "ML_ADM::ML_shift", ML_shift_bound); if (ierr < 0) - CCTK_WARN(0, "Failed to register ml_shift_bound BC for ML_ADM::ml_shift!"); + CCTK_WARN(0, "Failed to register ML_shift_bound BC for ML_ADM::ML_shift!"); } if (CCTK_EQUALS(K11_bound, "none" ) || @@ -255,79 +255,79 @@ void ML_ADM_ApplyBoundConds(CCTK_ARGUMENTS) CCTK_WARN(0, "Failed to register beta3_bound BC for ML_ADM::beta3!"); } - if (CCTK_EQUALS(ml_curv_bound, "radiative")) + if (CCTK_EQUALS(ML_curv_bound, "radiative")) { /* apply radiation boundary condition */ - static CCTK_INT handle_ml_curv_bound = -1; - if (handle_ml_curv_bound < 0) handle_ml_curv_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); - if (handle_ml_curv_bound < 0) CCTK_WARN(0, "could not create table!"); - if (Util_TableSetReal(handle_ml_curv_bound , ml_curv_bound_limit, "LIMIT") < 0) + static CCTK_INT handle_ML_curv_bound = -1; + if (handle_ML_curv_bound < 0) handle_ML_curv_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_curv_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_curv_bound , ML_curv_bound_limit, "LIMIT") < 0) CCTK_WARN(0, "could not set LIMIT value in table!"); - if (Util_TableSetReal(handle_ml_curv_bound ,ml_curv_bound_speed, "SPEED") < 0) + if (Util_TableSetReal(handle_ML_curv_bound ,ML_curv_bound_speed, "SPEED") < 0) CCTK_WARN(0, "could not set SPEED value in table!"); - ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ml_curv_bound, - "ML_ADM::ml_curv", "Radiation"); + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_curv_bound, + "ML_ADM::ML_curv", "Radiation"); if (ierr < 0) - CCTK_WARN(0, "Failed to register Radiation BC for ML_ADM::ml_curv!"); + CCTK_WARN(0, "Failed to register Radiation BC for ML_ADM::ML_curv!"); } - if (CCTK_EQUALS(ml_lapse_bound, "radiative")) + if (CCTK_EQUALS(ML_lapse_bound, "radiative")) { /* apply radiation boundary condition */ - static CCTK_INT handle_ml_lapse_bound = -1; - if (handle_ml_lapse_bound < 0) handle_ml_lapse_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); - if (handle_ml_lapse_bound < 0) CCTK_WARN(0, "could not create table!"); - if (Util_TableSetReal(handle_ml_lapse_bound , ml_lapse_bound_limit, "LIMIT") < 0) + static CCTK_INT handle_ML_lapse_bound = -1; + if (handle_ML_lapse_bound < 0) handle_ML_lapse_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_lapse_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_lapse_bound , ML_lapse_bound_limit, "LIMIT") < 0) CCTK_WARN(0, "could not set LIMIT value in table!"); - if (Util_TableSetReal(handle_ml_lapse_bound ,ml_lapse_bound_speed, "SPEED") < 0) + if (Util_TableSetReal(handle_ML_lapse_bound ,ML_lapse_bound_speed, "SPEED") < 0) CCTK_WARN(0, "could not set SPEED value in table!"); - ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ml_lapse_bound, - "ML_ADM::ml_lapse", "Radiation"); + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_lapse_bound, + "ML_ADM::ML_lapse", "Radiation"); if (ierr < 0) - CCTK_WARN(0, "Failed to register Radiation BC for ML_ADM::ml_lapse!"); + CCTK_WARN(0, "Failed to register Radiation BC for ML_ADM::ML_lapse!"); } - if (CCTK_EQUALS(ml_metric_bound, "radiative")) + if (CCTK_EQUALS(ML_metric_bound, "radiative")) { /* apply radiation boundary condition */ - static CCTK_INT handle_ml_metric_bound = -1; - if (handle_ml_metric_bound < 0) handle_ml_metric_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); - if (handle_ml_metric_bound < 0) CCTK_WARN(0, "could not create table!"); - if (Util_TableSetReal(handle_ml_metric_bound , ml_metric_bound_limit, "LIMIT") < 0) + static CCTK_INT handle_ML_metric_bound = -1; + if (handle_ML_metric_bound < 0) handle_ML_metric_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_metric_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_metric_bound , ML_metric_bound_limit, "LIMIT") < 0) CCTK_WARN(0, "could not set LIMIT value in table!"); - if (Util_TableSetReal(handle_ml_metric_bound ,ml_metric_bound_speed, "SPEED") < 0) + if (Util_TableSetReal(handle_ML_metric_bound ,ML_metric_bound_speed, "SPEED") < 0) CCTK_WARN(0, "could not set SPEED value in table!"); - ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ml_metric_bound, - "ML_ADM::ml_metric", "Radiation"); + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_metric_bound, + "ML_ADM::ML_metric", "Radiation"); if (ierr < 0) - CCTK_WARN(0, "Failed to register Radiation BC for ML_ADM::ml_metric!"); + CCTK_WARN(0, "Failed to register Radiation BC for ML_ADM::ML_metric!"); } - if (CCTK_EQUALS(ml_shift_bound, "radiative")) + if (CCTK_EQUALS(ML_shift_bound, "radiative")) { /* apply radiation boundary condition */ - static CCTK_INT handle_ml_shift_bound = -1; - if (handle_ml_shift_bound < 0) handle_ml_shift_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); - if (handle_ml_shift_bound < 0) CCTK_WARN(0, "could not create table!"); - if (Util_TableSetReal(handle_ml_shift_bound , ml_shift_bound_limit, "LIMIT") < 0) + static CCTK_INT handle_ML_shift_bound = -1; + if (handle_ML_shift_bound < 0) handle_ML_shift_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_shift_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_shift_bound , ML_shift_bound_limit, "LIMIT") < 0) CCTK_WARN(0, "could not set LIMIT value in table!"); - if (Util_TableSetReal(handle_ml_shift_bound ,ml_shift_bound_speed, "SPEED") < 0) + if (Util_TableSetReal(handle_ML_shift_bound ,ML_shift_bound_speed, "SPEED") < 0) CCTK_WARN(0, "could not set SPEED value in table!"); - ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ml_shift_bound, - "ML_ADM::ml_shift", "Radiation"); + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_shift_bound, + "ML_ADM::ML_shift", "Radiation"); if (ierr < 0) - CCTK_WARN(0, "Failed to register Radiation BC for ML_ADM::ml_shift!"); + CCTK_WARN(0, "Failed to register Radiation BC for ML_ADM::ML_shift!"); } @@ -635,71 +635,71 @@ void ML_ADM_ApplyBoundConds(CCTK_ARGUMENTS) } - if (CCTK_EQUALS(ml_curv_bound, "scalar")) + if (CCTK_EQUALS(ML_curv_bound, "scalar")) { /* apply scalar boundary condition */ - static CCTK_INT handle_ml_curv_bound = -1; - if (handle_ml_curv_bound < 0) handle_ml_curv_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); - if (handle_ml_curv_bound < 0) CCTK_WARN(0, "could not create table!"); - if (Util_TableSetReal(handle_ml_curv_bound ,ml_curv_bound_scalar, "SCALAR") < 0) + static CCTK_INT handle_ML_curv_bound = -1; + if (handle_ML_curv_bound < 0) handle_ML_curv_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_curv_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_curv_bound ,ML_curv_bound_scalar, "SCALAR") < 0) CCTK_WARN(0, "could not set SCALAR value in table!"); - ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ml_curv_bound, - "ML_ADM::ml_curv", "scalar"); + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_curv_bound, + "ML_ADM::ML_curv", "scalar"); if (ierr < 0) - CCTK_WARN(0, "Failed to register Scalar BC for ML_ADM::ml_curv!"); + CCTK_WARN(0, "Failed to register Scalar BC for ML_ADM::ML_curv!"); } - if (CCTK_EQUALS(ml_lapse_bound, "scalar")) + if (CCTK_EQUALS(ML_lapse_bound, "scalar")) { /* apply scalar boundary condition */ - static CCTK_INT handle_ml_lapse_bound = -1; - if (handle_ml_lapse_bound < 0) handle_ml_lapse_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); - if (handle_ml_lapse_bound < 0) CCTK_WARN(0, "could not create table!"); - if (Util_TableSetReal(handle_ml_lapse_bound ,ml_lapse_bound_scalar, "SCALAR") < 0) + static CCTK_INT handle_ML_lapse_bound = -1; + if (handle_ML_lapse_bound < 0) handle_ML_lapse_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_lapse_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_lapse_bound ,ML_lapse_bound_scalar, "SCALAR") < 0) CCTK_WARN(0, "could not set SCALAR value in table!"); - ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ml_lapse_bound, - "ML_ADM::ml_lapse", "scalar"); + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_lapse_bound, + "ML_ADM::ML_lapse", "scalar"); if (ierr < 0) - CCTK_WARN(0, "Failed to register Scalar BC for ML_ADM::ml_lapse!"); + CCTK_WARN(0, "Failed to register Scalar BC for ML_ADM::ML_lapse!"); } - if (CCTK_EQUALS(ml_metric_bound, "scalar")) + if (CCTK_EQUALS(ML_metric_bound, "scalar")) { /* apply scalar boundary condition */ - static CCTK_INT handle_ml_metric_bound = -1; - if (handle_ml_metric_bound < 0) handle_ml_metric_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); - if (handle_ml_metric_bound < 0) CCTK_WARN(0, "could not create table!"); - if (Util_TableSetReal(handle_ml_metric_bound ,ml_metric_bound_scalar, "SCALAR") < 0) + static CCTK_INT handle_ML_metric_bound = -1; + if (handle_ML_metric_bound < 0) handle_ML_metric_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_metric_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_metric_bound ,ML_metric_bound_scalar, "SCALAR") < 0) CCTK_WARN(0, "could not set SCALAR value in table!"); - ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ml_metric_bound, - "ML_ADM::ml_metric", "scalar"); + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_metric_bound, + "ML_ADM::ML_metric", "scalar"); if (ierr < 0) - CCTK_WARN(0, "Failed to register Scalar BC for ML_ADM::ml_metric!"); + CCTK_WARN(0, "Failed to register Scalar BC for ML_ADM::ML_metric!"); } - if (CCTK_EQUALS(ml_shift_bound, "scalar")) + if (CCTK_EQUALS(ML_shift_bound, "scalar")) { /* apply scalar boundary condition */ - static CCTK_INT handle_ml_shift_bound = -1; - if (handle_ml_shift_bound < 0) handle_ml_shift_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); - if (handle_ml_shift_bound < 0) CCTK_WARN(0, "could not create table!"); - if (Util_TableSetReal(handle_ml_shift_bound ,ml_shift_bound_scalar, "SCALAR") < 0) + static CCTK_INT handle_ML_shift_bound = -1; + if (handle_ML_shift_bound < 0) handle_ML_shift_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_shift_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_shift_bound ,ML_shift_bound_scalar, "SCALAR") < 0) CCTK_WARN(0, "could not set SCALAR value in table!"); - ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ml_shift_bound, - "ML_ADM::ml_shift", "scalar"); + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_shift_bound, + "ML_ADM::ML_shift", "scalar"); if (ierr < 0) - CCTK_WARN(0, "Failed to register Scalar BC for ML_ADM::ml_shift!"); + CCTK_WARN(0, "Failed to register Scalar BC for ML_ADM::ML_shift!"); } @@ -980,25 +980,25 @@ void ML_ADM_ApplyBoundConds(CCTK_ARGUMENTS) /* template for entries in parameter file: -#$bound$#ML_ADM::ml_curv_bound = "skip" -#$bound$#ML_ADM::ml_curv_bound_speed = 1.0 -#$bound$#ML_ADM::ml_curv_bound_limit = 0.0 -#$bound$#ML_ADM::ml_curv_bound_scalar = 0.0 +#$bound$#ML_ADM::ML_curv_bound = "skip" +#$bound$#ML_ADM::ML_curv_bound_speed = 1.0 +#$bound$#ML_ADM::ML_curv_bound_limit = 0.0 +#$bound$#ML_ADM::ML_curv_bound_scalar = 0.0 -#$bound$#ML_ADM::ml_lapse_bound = "skip" -#$bound$#ML_ADM::ml_lapse_bound_speed = 1.0 -#$bound$#ML_ADM::ml_lapse_bound_limit = 0.0 -#$bound$#ML_ADM::ml_lapse_bound_scalar = 0.0 +#$bound$#ML_ADM::ML_lapse_bound = "skip" +#$bound$#ML_ADM::ML_lapse_bound_speed = 1.0 +#$bound$#ML_ADM::ML_lapse_bound_limit = 0.0 +#$bound$#ML_ADM::ML_lapse_bound_scalar = 0.0 -#$bound$#ML_ADM::ml_metric_bound = "skip" -#$bound$#ML_ADM::ml_metric_bound_speed = 1.0 -#$bound$#ML_ADM::ml_metric_bound_limit = 0.0 -#$bound$#ML_ADM::ml_metric_bound_scalar = 0.0 +#$bound$#ML_ADM::ML_metric_bound = "skip" +#$bound$#ML_ADM::ML_metric_bound_speed = 1.0 +#$bound$#ML_ADM::ML_metric_bound_limit = 0.0 +#$bound$#ML_ADM::ML_metric_bound_scalar = 0.0 -#$bound$#ML_ADM::ml_shift_bound = "skip" -#$bound$#ML_ADM::ml_shift_bound_speed = 1.0 -#$bound$#ML_ADM::ml_shift_bound_limit = 0.0 -#$bound$#ML_ADM::ml_shift_bound_scalar = 0.0 +#$bound$#ML_ADM::ML_shift_bound = "skip" +#$bound$#ML_ADM::ML_shift_bound_speed = 1.0 +#$bound$#ML_ADM::ML_shift_bound_limit = 0.0 +#$bound$#ML_ADM::ML_shift_bound_scalar = 0.0 #$bound$#ML_ADM::K11_bound = "skip" #$bound$#ML_ADM::K11_bound_speed = 1.0 diff --git a/ML_ADM/src/ML_ADM_Minkowski.c b/ML_ADM/src/ML_ADM_Minkowski.c index dd11e04..8912c16 100644 --- a/ML_ADM/src/ML_ADM_Minkowski.c +++ b/ML_ADM/src/ML_ADM_Minkowski.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -84,7 +87,7 @@ void ML_ADM_Minkowski_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL n pm1o12dz2 = -pow(dz,-2)/12.; /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_ADM_Minkowski, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_ADM/src/ML_ADM_RHS.c b/ML_ADM/src/ML_ADM_RHS.c index 424275d..936ed3f 100644 --- a/ML_ADM/src/ML_ADM_RHS.c +++ b/ML_ADM/src/ML_ADM_RHS.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -84,7 +87,7 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ pm1o12dz2 = -pow(dz,-2)/12.; /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_ADM_RHS, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) @@ -99,7 +102,8 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ CCTK_REAL G111 = INITVALUE, G112 = INITVALUE, G113 = INITVALUE, G122 = INITVALUE, G123 = INITVALUE, G133 = INITVALUE; CCTK_REAL G211 = INITVALUE, G212 = INITVALUE, G213 = INITVALUE, G222 = INITVALUE, G223 = INITVALUE, G233 = INITVALUE; CCTK_REAL G311 = INITVALUE, G312 = INITVALUE, G313 = INITVALUE, G322 = INITVALUE, G323 = INITVALUE, G333 = INITVALUE; - CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; + CCTK_REAL gu11 = INITVALUE, gu12 = INITVALUE, gu13 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu23 = INITVALUE; + CCTK_REAL gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; CCTK_REAL Km11 = INITVALUE, Km12 = INITVALUE, Km13 = INITVALUE, Km21 = INITVALUE, Km22 = INITVALUE, Km23 = INITVALUE; CCTK_REAL Km31 = INITVALUE, Km32 = INITVALUE, Km33 = INITVALUE; CCTK_REAL R11 = INITVALUE, R12 = INITVALUE, R13 = INITVALUE, R22 = INITVALUE, R23 = INITVALUE, R33 = INITVALUE; @@ -136,31 +140,30 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ CCTK_REAL PDstandardNth1g11 = INITVALUE; CCTK_REAL PDstandardNth2g11 = INITVALUE; CCTK_REAL PDstandardNth3g11 = INITVALUE; + CCTK_REAL PDstandardNth11g11 = INITVALUE; CCTK_REAL PDstandardNth22g11 = INITVALUE; CCTK_REAL PDstandardNth33g11 = INITVALUE; CCTK_REAL PDstandardNth12g11 = INITVALUE; CCTK_REAL PDstandardNth13g11 = INITVALUE; - CCTK_REAL PDstandardNth21g11 = INITVALUE; CCTK_REAL PDstandardNth23g11 = INITVALUE; - CCTK_REAL PDstandardNth31g11 = INITVALUE; - CCTK_REAL PDstandardNth32g11 = INITVALUE; CCTK_REAL PDstandardNth1g12 = INITVALUE; CCTK_REAL PDstandardNth2g12 = INITVALUE; CCTK_REAL PDstandardNth3g12 = INITVALUE; + CCTK_REAL PDstandardNth11g12 = INITVALUE; + CCTK_REAL PDstandardNth22g12 = INITVALUE; CCTK_REAL PDstandardNth33g12 = INITVALUE; CCTK_REAL PDstandardNth12g12 = INITVALUE; CCTK_REAL PDstandardNth13g12 = INITVALUE; CCTK_REAL PDstandardNth21g12 = INITVALUE; CCTK_REAL PDstandardNth23g12 = INITVALUE; - CCTK_REAL PDstandardNth31g12 = INITVALUE; - CCTK_REAL PDstandardNth32g12 = INITVALUE; CCTK_REAL PDstandardNth1g13 = INITVALUE; CCTK_REAL PDstandardNth2g13 = INITVALUE; CCTK_REAL PDstandardNth3g13 = INITVALUE; + CCTK_REAL PDstandardNth11g13 = INITVALUE; CCTK_REAL PDstandardNth22g13 = INITVALUE; + CCTK_REAL PDstandardNth33g13 = INITVALUE; CCTK_REAL PDstandardNth12g13 = INITVALUE; CCTK_REAL PDstandardNth13g13 = INITVALUE; - CCTK_REAL PDstandardNth21g13 = INITVALUE; CCTK_REAL PDstandardNth23g13 = INITVALUE; CCTK_REAL PDstandardNth31g13 = INITVALUE; CCTK_REAL PDstandardNth32g13 = INITVALUE; @@ -168,17 +171,18 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ CCTK_REAL PDstandardNth2g22 = INITVALUE; CCTK_REAL PDstandardNth3g22 = INITVALUE; CCTK_REAL PDstandardNth11g22 = INITVALUE; + CCTK_REAL PDstandardNth22g22 = INITVALUE; CCTK_REAL PDstandardNth33g22 = INITVALUE; CCTK_REAL PDstandardNth12g22 = INITVALUE; CCTK_REAL PDstandardNth13g22 = INITVALUE; CCTK_REAL PDstandardNth21g22 = INITVALUE; CCTK_REAL PDstandardNth23g22 = INITVALUE; - CCTK_REAL PDstandardNth31g22 = INITVALUE; - CCTK_REAL PDstandardNth32g22 = INITVALUE; CCTK_REAL PDstandardNth1g23 = INITVALUE; CCTK_REAL PDstandardNth2g23 = INITVALUE; CCTK_REAL PDstandardNth3g23 = INITVALUE; CCTK_REAL PDstandardNth11g23 = INITVALUE; + CCTK_REAL PDstandardNth22g23 = INITVALUE; + CCTK_REAL PDstandardNth33g23 = INITVALUE; CCTK_REAL PDstandardNth12g23 = INITVALUE; CCTK_REAL PDstandardNth13g23 = INITVALUE; CCTK_REAL PDstandardNth21g23 = INITVALUE; @@ -190,29 +194,20 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ CCTK_REAL PDstandardNth3g33 = INITVALUE; CCTK_REAL PDstandardNth11g33 = INITVALUE; CCTK_REAL PDstandardNth22g33 = INITVALUE; + CCTK_REAL PDstandardNth33g33 = INITVALUE; CCTK_REAL PDstandardNth12g33 = INITVALUE; CCTK_REAL PDstandardNth13g33 = INITVALUE; - CCTK_REAL PDstandardNth21g33 = INITVALUE; CCTK_REAL PDstandardNth23g33 = INITVALUE; CCTK_REAL PDstandardNth31g33 = INITVALUE; CCTK_REAL PDstandardNth32g33 = INITVALUE; CCTK_REAL PDstandardNth1K11 = INITVALUE; - CCTK_REAL PDstandardNth2K11 = INITVALUE; - CCTK_REAL PDstandardNth3K11 = INITVALUE; CCTK_REAL PDstandardNth1K12 = INITVALUE; CCTK_REAL PDstandardNth2K12 = INITVALUE; - CCTK_REAL PDstandardNth3K12 = INITVALUE; CCTK_REAL PDstandardNth1K13 = INITVALUE; - CCTK_REAL PDstandardNth2K13 = INITVALUE; CCTK_REAL PDstandardNth3K13 = INITVALUE; - CCTK_REAL PDstandardNth1K22 = INITVALUE; CCTK_REAL PDstandardNth2K22 = INITVALUE; - CCTK_REAL PDstandardNth3K22 = INITVALUE; - CCTK_REAL PDstandardNth1K23 = INITVALUE; CCTK_REAL PDstandardNth2K23 = INITVALUE; CCTK_REAL PDstandardNth3K23 = INITVALUE; - CCTK_REAL PDstandardNth1K33 = INITVALUE; - CCTK_REAL PDstandardNth2K33 = INITVALUE; CCTK_REAL PDstandardNth3K33 = INITVALUE; /* Assign local copies of grid functions */ @@ -259,12 +254,17 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ PDstandardNth1g11 = PDstandardNth1(g11, i, j, k); PDstandardNth2g11 = PDstandardNth2(g11, i, j, k); PDstandardNth3g11 = PDstandardNth3(g11, i, j, k); + PDstandardNth11g11 = PDstandardNth11(g11, i, j, k); PDstandardNth22g11 = PDstandardNth22(g11, i, j, k); PDstandardNth33g11 = PDstandardNth33(g11, i, j, k); + PDstandardNth12g11 = PDstandardNth12(g11, i, j, k); + PDstandardNth13g11 = PDstandardNth13(g11, i, j, k); PDstandardNth23g11 = PDstandardNth23(g11, i, j, k); PDstandardNth1g12 = PDstandardNth1(g12, i, j, k); PDstandardNth2g12 = PDstandardNth2(g12, i, j, k); PDstandardNth3g12 = PDstandardNth3(g12, i, j, k); + PDstandardNth11g12 = PDstandardNth11(g12, i, j, k); + PDstandardNth22g12 = PDstandardNth22(g12, i, j, k); PDstandardNth33g12 = PDstandardNth33(g12, i, j, k); PDstandardNth12g12 = PDstandardNth12(g12, i, j, k); PDstandardNth13g12 = PDstandardNth13(g12, i, j, k); @@ -272,7 +272,9 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ PDstandardNth1g13 = PDstandardNth1(g13, i, j, k); PDstandardNth2g13 = PDstandardNth2(g13, i, j, k); PDstandardNth3g13 = PDstandardNth3(g13, i, j, k); + PDstandardNth11g13 = PDstandardNth11(g13, i, j, k); PDstandardNth22g13 = PDstandardNth22(g13, i, j, k); + PDstandardNth33g13 = PDstandardNth33(g13, i, j, k); PDstandardNth12g13 = PDstandardNth12(g13, i, j, k); PDstandardNth13g13 = PDstandardNth13(g13, i, j, k); PDstandardNth23g13 = PDstandardNth23(g13, i, j, k); @@ -280,12 +282,17 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ PDstandardNth2g22 = PDstandardNth2(g22, i, j, k); PDstandardNth3g22 = PDstandardNth3(g22, i, j, k); PDstandardNth11g22 = PDstandardNth11(g22, i, j, k); + PDstandardNth22g22 = PDstandardNth22(g22, i, j, k); PDstandardNth33g22 = PDstandardNth33(g22, i, j, k); + PDstandardNth12g22 = PDstandardNth12(g22, i, j, k); PDstandardNth13g22 = PDstandardNth13(g22, i, j, k); + PDstandardNth23g22 = PDstandardNth23(g22, i, j, k); PDstandardNth1g23 = PDstandardNth1(g23, i, j, k); PDstandardNth2g23 = PDstandardNth2(g23, i, j, k); PDstandardNth3g23 = PDstandardNth3(g23, i, j, k); PDstandardNth11g23 = PDstandardNth11(g23, i, j, k); + PDstandardNth22g23 = PDstandardNth22(g23, i, j, k); + PDstandardNth33g23 = PDstandardNth33(g23, i, j, k); PDstandardNth12g23 = PDstandardNth12(g23, i, j, k); PDstandardNth13g23 = PDstandardNth13(g23, i, j, k); PDstandardNth23g23 = PDstandardNth23(g23, i, j, k); @@ -294,206 +301,297 @@ void ML_ADM_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[ PDstandardNth3g33 = PDstandardNth3(g33, i, j, k); PDstandardNth11g33 = PDstandardNth11(g33, i, j, k); PDstandardNth22g33 = PDstandardNth22(g33, i, j, k); + PDstandardNth33g33 = PDstandardNth33(g33, i, j, k); PDstandardNth12g33 = PDstandardNth12(g33, i, j, k); + PDstandardNth13g33 = PDstandardNth13(g33, i, j, k); + PDstandardNth23g33 = PDstandardNth23(g33, i, j, k); PDstandardNth1K11 = PDstandardNth1(K11, i, j, k); - PDstandardNth2K11 = PDstandardNth2(K11, i, j, k); - PDstandardNth3K11 = PDstandardNth3(K11, i, j, k); PDstandardNth1K12 = PDstandardNth1(K12, i, j, k); PDstandardNth2K12 = PDstandardNth2(K12, i, j, k); - PDstandardNth3K12 = PDstandardNth3(K12, i, j, k); PDstandardNth1K13 = PDstandardNth1(K13, i, j, k); - PDstandardNth2K13 = PDstandardNth2(K13, i, j, k); PDstandardNth3K13 = PDstandardNth3(K13, i, j, k); - PDstandardNth1K22 = PDstandardNth1(K22, i, j, k); PDstandardNth2K22 = PDstandardNth2(K22, i, j, k); - PDstandardNth3K22 = PDstandardNth3(K22, i, j, k); - PDstandardNth1K23 = PDstandardNth1(K23, i, j, k); PDstandardNth2K23 = PDstandardNth2(K23, i, j, k); PDstandardNth3K23 = PDstandardNth3(K23, i, j, k); - PDstandardNth1K33 = PDstandardNth1(K33, i, j, k); - PDstandardNth2K33 = PDstandardNth2(K33, i, j, k); PDstandardNth3K33 = PDstandardNth3(K33, i, j, k); /* Precompute derivatives (old style) */ /* Calculate temporaries and grid functions */ - detg = 2*g12L*g13L*g23L + g33L*(g11L*g22L - SQR(g12L)) - g22L*SQR(g13L) - g11L*SQR(g23L); + detg = 2*g12L*g13L*g23L + g33L*(g11L*g22L - SQR(g12L)) - g22L*SQR(g13L) - + g11L*SQR(g23L); gu11 = INV(detg)*(g22L*g33L - SQR(g23L)); - gu21 = (g13L*g23L - g12L*g33L)*INV(detg); + gu12 = (g13L*g23L - g12L*g33L)*INV(detg); - gu31 = (-(g13L*g22L) + g12L*g23L)*INV(detg); + gu13 = (-(g13L*g22L) + g12L*g23L)*INV(detg); + + gu21 = (g13L*g23L - g12L*g33L)*INV(detg); gu22 = INV(detg)*(g11L*g33L - SQR(g13L)); + gu23 = (g12L*g13L - g11L*g23L)*INV(detg); + + gu31 = (-(g13L*g22L) + g12L*g23L)*INV(detg); + gu32 = (g12L*g13L - g11L*g23L)*INV(detg); gu33 = INV(detg)*(g11L*g22L - SQR(g12L)); - G111 = khalf*(gu11*PDstandardNth1g11 + 2*(gu21*PDstandardNth1g12 + gu31*PDstandardNth1g13) - gu21*PDstandardNth2g11 - - gu31*PDstandardNth3g11); + G111 = khalf*(gu11*PDstandardNth1g11 + + 2*(gu12*PDstandardNth1g12 + gu13*PDstandardNth1g13) - + gu12*PDstandardNth2g11 - gu13*PDstandardNth3g11); - G211 = khalf*(gu21*PDstandardNth1g11 + 2*(gu22*PDstandardNth1g12 + gu32*PDstandardNth1g13) - gu22*PDstandardNth2g11 - - gu32*PDstandardNth3g11); + G211 = khalf*(gu21*PDstandardNth1g11 + + 2*(gu22*PDstandardNth1g12 + gu23*PDstandardNth1g13) - + gu22*PDstandardNth2g11 - gu23*PDstandardNth3g11); - G311 = khalf*(gu31*PDstandardNth1g11 + 2*(gu32*PDstandardNth1g12 + gu33*PDstandardNth1g13) - gu32*PDstandardNth2g11 - - gu33*PDstandardNth3g11); + G311 = khalf*(gu31*PDstandardNth1g11 + + 2*(gu32*PDstandardNth1g12 + gu33*PDstandardNth1g13) - + gu32*PDstandardNth2g11 - gu33*PDstandardNth3g11); - G112 = khalf*(gu21*PDstandardNth1g22 + gu11*PDstandardNth2g11 + - gu31*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); + G112 = khalf*(gu12*PDstandardNth1g22 + gu11*PDstandardNth2g11 + + gu13*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); G212 = khalf*(gu22*PDstandardNth1g22 + gu21*PDstandardNth2g11 + - gu32*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); + gu23*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); G312 = khalf*(gu32*PDstandardNth1g22 + gu31*PDstandardNth2g11 + gu33*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); - G113 = khalf*(gu31*PDstandardNth1g33 + gu11*PDstandardNth3g11 + - gu21*(PDstandardNth1g23 - PDstandardNth2g13 + PDstandardNth3g12)); + G113 = khalf*(gu13*PDstandardNth1g33 + gu11*PDstandardNth3g11 + + gu12*(PDstandardNth1g23 - PDstandardNth2g13 + PDstandardNth3g12)); - G213 = khalf*(gu32*PDstandardNth1g33 + gu21*PDstandardNth3g11 + + G213 = khalf*(gu23*PDstandardNth1g33 + gu21*PDstandardNth3g11 + gu22*(PDstandardNth1g23 - PDstandardNth2g13 + PDstandardNth3g12)); G313 = khalf*(gu33*PDstandardNth1g33 + gu31*PDstandardNth3g11 + gu32*(PDstandardNth1g23 - PDstandardNth2g13 + PDstandardNth3g12)); - G122 = khalf*(gu11*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + gu21*PDstandardNth2g22 + - gu31*(2*PDstandardNth2g23 - PDstandardNth3g22)); + G122 = khalf*(gu11*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + + gu12*PDstandardNth2g22 + gu13*(2*PDstandardNth2g23 - PDstandardNth3g22)); - G222 = khalf*(gu21*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + gu22*PDstandardNth2g22 + - gu32*(2*PDstandardNth2g23 - PDstandardNth3g22)); + G222 = khalf*(gu21*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + + gu22*PDstandardNth2g22 + gu23*(2*PDstandardNth2g23 - PDstandardNth3g22)); - G322 = khalf*(gu31*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + gu32*PDstandardNth2g22 + - gu33*(2*PDstandardNth2g23 - PDstandardNth3g22)); + G322 = khalf*(gu31*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + + gu32*PDstandardNth2g22 + gu33*(2*PDstandardNth2g23 - PDstandardNth3g22)); - G123 = khalf*(gu31*PDstandardNth2g33 + gu11*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + - gu21*PDstandardNth3g22); + G123 = khalf*(gu13*PDstandardNth2g33 + + gu11*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + + gu12*PDstandardNth3g22); - G223 = khalf*(gu32*PDstandardNth2g33 + gu21*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + + G223 = khalf*(gu23*PDstandardNth2g33 + + gu21*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + gu22*PDstandardNth3g22); - G323 = khalf*(gu33*PDstandardNth2g33 + gu31*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + + G323 = khalf*(gu33*PDstandardNth2g33 + + gu31*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + gu32*PDstandardNth3g22); - G133 = khalf*(-(gu11*PDstandardNth1g33) - gu21*PDstandardNth2g33 + 2*gu11*PDstandardNth3g13 + - 2*gu21*PDstandardNth3g23 + gu31*PDstandardNth3g33); - - G233 = khalf*(-(gu21*PDstandardNth1g33) - gu22*PDstandardNth2g33 + 2*gu21*PDstandardNth3g13 + - 2*gu22*PDstandardNth3g23 + gu32*PDstandardNth3g33); - - G333 = khalf*(-(gu31*PDstandardNth1g33) - gu32*PDstandardNth2g33 + 2*gu31*PDstandardNth3g13 + - 2*gu32*PDstandardNth3g23 + gu33*PDstandardNth3g33); - - R11 = khalf*(4*G213*G312 + G211*(2*G112 - 2*G222 - 2*G323) + G311*(2*G113 - 2*G333) - gu22*PDstandardNth11g22 - - 2*(G111*G212 + G223*G311 + G111*G313 + gu32*PDstandardNth11g23) - gu33*PDstandardNth11g33 + - 2*gu22*PDstandardNth12g12 + 2*gu32*PDstandardNth12g13 + 2*gu32*PDstandardNth13g12 + 2*gu33*PDstandardNth13g13 - - gu22*PDstandardNth22g11 - 2*gu32*PDstandardNth23g11 - gu33*PDstandardNth33g11 + 2*SQR(G212) + 2*SQR(G313)); - - R12 = khalf*(2*(G122*G211 + G123*G311 + G213*G322 + G313*G323) - - 2*(G112*G212 + G112*G313 + G212*G323 + G312*G333 + gu21*PDstandardNth12g12) - gu32*PDstandardNth12g23 - - gu33*PDstandardNth12g33 + gu31*(PDstandardNth11g23 - PDstandardNth12g13 - PDstandardNth13g12) + - gu32*PDstandardNth13g22 + gu33*PDstandardNth13g23 + gu21*(PDstandardNth11g22 + PDstandardNth22g11) + - gu32*PDstandardNth22g13 + gu31*PDstandardNth23g11 - gu32*PDstandardNth23g12 + gu33*PDstandardNth23g13 - - gu33*PDstandardNth33g12); - - R13 = khalf*(2*(G123*G211 + G212*G223 + G133*G311 + G233*G312) - - 2*(G213*G222 + G223*G313 + G113*(G212 + G313) + gu31*PDstandardNth13g13) + - gu21*(PDstandardNth11g23 - PDstandardNth12g13 - PDstandardNth13g12 + PDstandardNth23g11) + - gu22*(PDstandardNth12g23 - PDstandardNth13g22 - PDstandardNth22g13 + PDstandardNth23g12) + - gu31*(PDstandardNth11g33 + PDstandardNth33g11) + - gu32*(PDstandardNth12g33 - PDstandardNth13g23 - PDstandardNth23g13 + PDstandardNth33g12)); - - R22 = khalf*(4*G123*G312 + G122*(2*G212 - 2*(G111 + G313)) + G322*(2*G223 - 2*G333) - - 2*(G113*G322 + G222*(G112 + G323) + gu31*PDstandardNth13g22) + - gu11*(-PDstandardNth11g22 + 2*PDstandardNth12g12 - PDstandardNth22g11) + - gu31*(-2*PDstandardNth22g13 + 2*(PDstandardNth12g23 + PDstandardNth23g12)) + - gu33*(-PDstandardNth22g33 + 2*PDstandardNth23g23 - PDstandardNth33g22) + 2*(SQR(G112) + SQR(G323))); - - R23 = khalf*(2*(G112*G113 + G122*G213 + G133*G312 + G233*G322) + - gu11*(-PDstandardNth11g23 + PDstandardNth12g13 + PDstandardNth13g12 - PDstandardNth23g11) + - gu21*(-PDstandardNth12g23 + PDstandardNth13g22 + PDstandardNth22g13 - PDstandardNth23g12) - - 2*(G111*G123 + G113*G323 + G223*(G112 + G323) + gu32*PDstandardNth23g23) + - gu31*(PDstandardNth12g33 - PDstandardNth13g23 - PDstandardNth23g13 + PDstandardNth33g12) + - gu32*(PDstandardNth22g33 + PDstandardNth33g22)); - - R33 = khalf*(4*G123*G213 - gu11*PDstandardNth11g33 - - 2*(G111*G133 + G133*G212 + G112*G233 + G222*G233 + G113*G333 + G223*G333 + gu21*PDstandardNth12g33) + - 2*(G133*G313 + G233*G323 + gu11*PDstandardNth13g13) + 2*gu21*PDstandardNth13g23 - gu22*PDstandardNth22g33 + - 2*gu21*PDstandardNth23g13 + 2*gu22*PDstandardNth23g23 - gu11*PDstandardNth33g11 - 2*gu21*PDstandardNth33g12 - - gu22*PDstandardNth33g22 + 2*SQR(G113) + 2*SQR(G223)); - - Km11 = gu11*K11L + gu21*K12L + gu31*K13L; - - Km21 = gu21*K11L + gu22*K12L + gu32*K13L; + G133 = khalf*(-(gu11*PDstandardNth1g33) - gu12*PDstandardNth2g33 + + 2*gu11*PDstandardNth3g13 + 2*gu12*PDstandardNth3g23 + + gu13*PDstandardNth3g33); + + G233 = khalf*(-(gu21*PDstandardNth1g33) - gu22*PDstandardNth2g33 + + 2*gu21*PDstandardNth3g13 + 2*gu22*PDstandardNth3g23 + + gu23*PDstandardNth3g33); + + G333 = khalf*(-(gu31*PDstandardNth1g33) - gu32*PDstandardNth2g33 + + 2*gu31*PDstandardNth3g13 + 2*gu32*PDstandardNth3g23 + + gu33*PDstandardNth3g33); + + R11 = 2*(G112*G211 + G113*G311 + G213*G312) - G111*(G111 + G212 + G313) - + G211*(G112 + G222 + G323) - G311*(G113 + G223 + G333) + + khalf*(-6*gu11*PDstandardNth11g11 + + gu12*(-8*PDstandardNth11g12 + 2*PDstandardNth12g12) + + gu22*(-9*PDstandardNth11g22 + 3*PDstandardNth12g22) + + gu13*(-8*PDstandardNth11g13 + 2*PDstandardNth13g13) + + gu33*(-9*PDstandardNth11g33 + 3*PDstandardNth13g33) + + gu21*(-6*PDstandardNth11g12 - PDstandardNth12g12 + PDstandardNth22g12) + + gu23*(-9*PDstandardNth11g23 + 3*PDstandardNth13g23 + + PDstandardNth22g23 - PDstandardNth23g23) + + gu31*(-6*PDstandardNth11g13 - PDstandardNth13g13 + PDstandardNth33g13) + + gu32*(-9*PDstandardNth11g23 + 3*PDstandardNth12g23 - + PDstandardNth23g23 + PDstandardNth33g23)) + SQR(G111) + SQR(G212) + + SQR(G313); + + R12 = khalf*(-2*(G112*G212 + G112*G313 + G212*G323 + G312*G333) - + 6*(gu11*PDstandardNth12g11 + gu31*PDstandardNth12g13) - + 9*(gu22*PDstandardNth12g22 + gu23*PDstandardNth12g23 + + gu32*PDstandardNth12g23 + gu33*PDstandardNth12g33) - + gu31*PDstandardNth13g13 + gu21* + (-7*PDstandardNth12g12 + PDstandardNth22g12) + + gu12*(PDstandardNth11g12 - 10*PDstandardNth12g12 + + 3*PDstandardNth22g12) + 3*gu22*PDstandardNth22g22 + + gu23*PDstandardNth22g23 + 3*gu32*PDstandardNth22g23 + + gu13*(PDstandardNth11g13 - 9*PDstandardNth12g13 - PDstandardNth13g13 + + 3*PDstandardNth23g13) - gu32*PDstandardNth23g23 + + 2*(G122*G211 + G123*G311 + G213*G322 + G313*G323 + + gu23*PDstandardNth23g23) + 3*gu33*PDstandardNth23g33 + + gu31*PDstandardNth33g13 + gu32*PDstandardNth33g23); + + R13 = khalf*(-2*(G213*G222 + G223*G313 + G113*(G212 + G313)) - + 6*gu11*PDstandardNth13g11 - + 9*(gu22*PDstandardNth13g22 + (gu23 + gu32)*PDstandardNth13g23 + + gu33*PDstandardNth13g33) + + gu21*(-PDstandardNth12g12 - 6*PDstandardNth13g12 + PDstandardNth22g12) + + gu12*(PDstandardNth11g12 - PDstandardNth12g12 - 9*PDstandardNth13g12 + + 3*PDstandardNth23g12) + + gu23*(PDstandardNth22g23 - PDstandardNth23g23) + + 2*(G123*G211 + G212*G223 + G133*G311 + G233*G312 + + gu32*PDstandardNth23g23) + + gu31*(-7*PDstandardNth13g13 + PDstandardNth33g13) + + gu13*(PDstandardNth11g13 - 10*PDstandardNth13g13 + + 3*PDstandardNth33g13) + gu32*PDstandardNth33g23 + + 3*(gu22*PDstandardNth23g22 + gu23*PDstandardNth33g23 + + gu33*PDstandardNth33g33)); + + R22 = -(G122*(G111 + G212 + G313)) + 2*(G122*G212 + G123*G312 + G223*G322) - + G222*(G112 + G222 + G323) - G322*(G113 + G223 + G333) + + khalf*(3*gu11*(PDstandardNth12g11 - 3*PDstandardNth22g11) + + gu21*(2*PDstandardNth12g12 - 8*PDstandardNth22g12) + + gu12*(PDstandardNth11g12 - PDstandardNth12g12 - 6*PDstandardNth22g12) - + 6*gu22*PDstandardNth22g22 + + gu13*(PDstandardNth11g13 - PDstandardNth13g13 - 9*PDstandardNth22g13 + + 3*PDstandardNth23g13) - + gu23*(8*PDstandardNth22g23 - 2*PDstandardNth23g23) + + gu33*(-9*PDstandardNth22g33 + 3*PDstandardNth23g33) + + gu31*(3*PDstandardNth12g13 - PDstandardNth13g13 - 9*PDstandardNth22g13 + + PDstandardNth33g13) + gu32* + (-6*PDstandardNth22g23 - PDstandardNth23g23 + PDstandardNth33g23)) + + SQR(G112) + SQR(G222) + SQR(G323); + + R23 = khalf*(-2*(G111*G123 + G113*G323 + G223*(G112 + G323)) + + 2*(G112*G113 + G122*G213 + G133*G312 + G233*G322 + + gu31*PDstandardNth13g13) + + gu11*(3*PDstandardNth13g11 - 9*PDstandardNth23g11) + + gu21*(-PDstandardNth12g12 + 3*PDstandardNth13g12 + PDstandardNth22g12 - + 9*PDstandardNth23g12) + + gu12*(PDstandardNth11g12 - PDstandardNth12g12 - 6*PDstandardNth23g12) - + 6*gu22*PDstandardNth23g22 - + 9*(gu31*PDstandardNth23g13 + gu33*PDstandardNth23g33) + + gu31*PDstandardNth33g13 + gu13* + (PDstandardNth11g13 - PDstandardNth13g13 - 9*PDstandardNth23g13 + + 3*PDstandardNth33g13) + + gu32*(-7*PDstandardNth23g23 + PDstandardNth33g23) + + gu23*(PDstandardNth22g23 - 10*PDstandardNth23g23 + + 3*PDstandardNth33g23) + 3*gu33*PDstandardNth33g33); + + R33 = -(G133*(G111 + G212 + G313)) + 2*(G123*G213 + G133*G313) + 2*G233*G323 - + G233*(G112 + G222 + G323) - G333*(G113 + G223 + G333) + + khalf*(3*gu11*(PDstandardNth13g11 - 3*PDstandardNth33g11) + + gu21*(-PDstandardNth12g12 + 3*PDstandardNth13g12 + PDstandardNth22g12 - + 9*PDstandardNth33g12) + + gu12*(PDstandardNth11g12 - PDstandardNth12g12 + 3*PDstandardNth23g12 - + 9*PDstandardNth33g12) + + gu31*(2*PDstandardNth13g13 - 8*PDstandardNth33g13) + + gu13*(PDstandardNth11g13 - PDstandardNth13g13 - 6*PDstandardNth33g13) + + 3*gu22*(PDstandardNth23g22 - 3*PDstandardNth33g22) + + gu32*(2*PDstandardNth23g23 - 8*PDstandardNth33g23) + + gu23*(PDstandardNth22g23 - PDstandardNth23g23 - 6*PDstandardNth33g23) - + 6*gu33*PDstandardNth33g33) + SQR(G113) + SQR(G223) + SQR(G333); + + Km11 = gu11*K11L + gu12*K12L + gu13*K13L; + + Km21 = gu21*K11L + gu22*K12L + gu23*K13L; Km31 = gu31*K11L + gu32*K12L + gu33*K13L; - Km12 = gu11*K12L + gu21*K22L + gu31*K23L; + Km12 = gu11*K12L + gu12*K22L + gu13*K23L; - Km22 = gu21*K12L + gu22*K22L + gu32*K23L; + Km22 = gu21*K12L + gu22*K22L + gu23*K23L; Km32 = gu31*K12L + gu32*K22L + gu33*K23L; - Km13 = gu11*K13L + gu21*K23L + gu31*K33L; + Km13 = gu11*K13L + gu12*K23L + gu13*K33L; - Km23 = gu21*K13L + gu22*K23L + gu32*K33L; + Km23 = gu21*K13L + gu22*K23L + gu23*K33L; Km33 = gu31*K13L + gu32*K23L + gu33*K33L; trK = Km11 + Km22 + Km33; - g11rhsL = -2*alphaL*K11L + 2*(g11L*PDstandardNth1beta1 + g12L*PDstandardNth1beta2 + g13L*PDstandardNth1beta3) + - beta1L*PDstandardNth1g11 + beta2L*PDstandardNth2g11 + beta3L*PDstandardNth3g11; - - g12rhsL = -2*alphaL*K12L + g22L*PDstandardNth1beta2 + g23L*PDstandardNth1beta3 + beta1L*PDstandardNth1g12 + - g11L*PDstandardNth2beta1 + g12L*(PDstandardNth1beta1 + PDstandardNth2beta2) + g13L*PDstandardNth2beta3 + - beta2L*PDstandardNth2g12 + beta3L*PDstandardNth3g12; - - g13rhsL = -2*alphaL*K13L + g23L*PDstandardNth1beta2 + g33L*PDstandardNth1beta3 + beta1L*PDstandardNth1g13 + - beta2L*PDstandardNth2g13 + g11L*PDstandardNth3beta1 + g12L*PDstandardNth3beta2 + - g13L*(PDstandardNth1beta1 + PDstandardNth3beta3) + beta3L*PDstandardNth3g13; - - g22rhsL = -2*alphaL*K22L + beta1L*PDstandardNth1g22 + - 2*(g12L*PDstandardNth2beta1 + g22L*PDstandardNth2beta2 + g23L*PDstandardNth2beta3) + beta2L*PDstandardNth2g22 + - beta3L*PDstandardNth3g22; - - g23rhsL = -2*alphaL*K23L + beta1L*PDstandardNth1g23 + g13L*PDstandardNth2beta1 + g33L*PDstandardNth2beta3 + - beta2L*PDstandardNth2g23 + g12L*PDstandardNth3beta1 + g22L*PDstandardNth3beta2 + - g23L*(PDstandardNth2beta2 + PDstandardNth3beta3) + beta3L*PDstandardNth3g23; - - g33rhsL = -2*alphaL*K33L + beta1L*PDstandardNth1g33 + beta2L*PDstandardNth2g33 + - 2*(g13L*PDstandardNth3beta1 + g23L*PDstandardNth3beta2 + g33L*PDstandardNth3beta3) + beta3L*PDstandardNth3g33; - - K11rhsL = -PDstandardNth11alpha + G111*PDstandardNth1alpha + - 2*(K11L*PDstandardNth1beta1 + K12L*PDstandardNth1beta2 + K13L*PDstandardNth1beta3) + beta1L*PDstandardNth1K11 + - G211*PDstandardNth2alpha + beta2L*PDstandardNth2K11 + G311*PDstandardNth3alpha + beta3L*PDstandardNth3K11 + + g11rhsL = -2*alphaL*K11L + 4*(g11L*PDstandardNth1beta1 + + g12L*PDstandardNth1beta2 + g13L*PDstandardNth1beta3) + + beta1L*PDstandardNth1g11 + beta2L*PDstandardNth2g12 + + beta3L*PDstandardNth3g13; + + g12rhsL = -2*alphaL*K12L + 3*(g12L*PDstandardNth1beta1 + + g22L*PDstandardNth1beta2 + g23L*PDstandardNth1beta3) + + beta1L*PDstandardNth1g12 + g12L*PDstandardNth2beta1 + + g22L*PDstandardNth2beta2 + g23L*PDstandardNth2beta3 + + beta2L*PDstandardNth2g22 + beta3L*PDstandardNth3g23; + + g13rhsL = -2*alphaL*K13L + 3*(g13L*PDstandardNth1beta1 + + g23L*PDstandardNth1beta2 + g33L*PDstandardNth1beta3) + + beta1L*PDstandardNth1g13 + beta2L*PDstandardNth2g23 + + g13L*PDstandardNth3beta1 + g23L*PDstandardNth3beta2 + + g33L*PDstandardNth3beta3 + beta3L*PDstandardNth3g33; + + g22rhsL = -2*alphaL*K22L + beta1L*PDstandardNth1g12 + + 4*(g12L*PDstandardNth2beta1 + g22L*PDstandardNth2beta2 + + g23L*PDstandardNth2beta3) + beta2L*PDstandardNth2g22 + + beta3L*PDstandardNth3g23; + + g23rhsL = -2*alphaL*K23L + beta1L*PDstandardNth1g13 + + 3*(g13L*PDstandardNth2beta1 + g23L*PDstandardNth2beta2 + + g33L*PDstandardNth2beta3) + beta2L*PDstandardNth2g23 + + g13L*PDstandardNth3beta1 + g23L*PDstandardNth3beta2 + + g33L*PDstandardNth3beta3 + beta3L*PDstandardNth3g33; + + g33rhsL = -2*alphaL*K33L + beta1L*PDstandardNth1g13 + + beta2L*PDstandardNth2g23 + 4* + (g13L*PDstandardNth3beta1 + g23L*PDstandardNth3beta2 + + g33L*PDstandardNth3beta3) + beta3L*PDstandardNth3g33; + + K11rhsL = -9*PDstandardNth11alpha + G111*PDstandardNth1alpha + + 4*(K11L*PDstandardNth1beta1 + K12L*PDstandardNth1beta2 + + K13L*PDstandardNth1beta3) + beta1L*PDstandardNth1K11 + + G212*PDstandardNth2alpha + beta2L*PDstandardNth2K12 + + G313*PDstandardNth3alpha + beta3L*PDstandardNth3K13 + alphaL*(-2*(K11L*Km11 + K12L*Km21 + K13L*Km31) + R11 + K11L*trK); - K12rhsL = -PDstandardNth12alpha + G112*PDstandardNth1alpha + K22L*PDstandardNth1beta2 + K23L*PDstandardNth1beta3 + - beta1L*PDstandardNth1K12 + G212*PDstandardNth2alpha + K11L*PDstandardNth2beta1 + - K12L*(PDstandardNth1beta1 + PDstandardNth2beta2) + K13L*PDstandardNth2beta3 + beta2L*PDstandardNth2K12 + - G312*PDstandardNth3alpha + beta3L*PDstandardNth3K12 + - alphaL*(-2*(K11L*Km12 + K12L*Km22 + K13L*Km32) + R12 + K12L*trK); - - K13rhsL = -PDstandardNth13alpha + G113*PDstandardNth1alpha + K23L*PDstandardNth1beta2 + K33L*PDstandardNth1beta3 + - beta1L*PDstandardNth1K13 + G213*PDstandardNth2alpha + beta2L*PDstandardNth2K13 + G313*PDstandardNth3alpha + - K11L*PDstandardNth3beta1 + K12L*PDstandardNth3beta2 + K13L*(PDstandardNth1beta1 + PDstandardNth3beta3) + - beta3L*PDstandardNth3K13 + alphaL*(-2*(K11L*Km13 + K12L*Km23 + K13L*Km33) + R13 + K13L*trK); - - K22rhsL = G122*PDstandardNth1alpha + beta1L*PDstandardNth1K22 - PDstandardNth22alpha + G222*PDstandardNth2alpha + - 2*(K12L*PDstandardNth2beta1 + K22L*PDstandardNth2beta2 + K23L*PDstandardNth2beta3) + beta2L*PDstandardNth2K22 + - G322*PDstandardNth3alpha + beta3L*PDstandardNth3K22 + + K12rhsL = -9*PDstandardNth12alpha + G112*PDstandardNth1alpha + + 3*(K12L*PDstandardNth1beta1 + K22L*PDstandardNth1beta2 + + K23L*PDstandardNth1beta3) + beta1L*PDstandardNth1K12 + + G222*PDstandardNth2alpha + K12L*PDstandardNth2beta1 + + K22L*PDstandardNth2beta2 + K23L*PDstandardNth2beta3 + + beta2L*PDstandardNth2K22 + G323*PDstandardNth3alpha + + beta3L*PDstandardNth3K23 + alphaL* + (-2*(K11L*Km12 + K12L*Km22 + K13L*Km32) + R12 + K12L*trK); + + K13rhsL = -9*PDstandardNth13alpha + G113*PDstandardNth1alpha + + 3*(K13L*PDstandardNth1beta1 + K23L*PDstandardNth1beta2 + + K33L*PDstandardNth1beta3) + beta1L*PDstandardNth1K13 + + G223*PDstandardNth2alpha + beta2L*PDstandardNth2K23 + + G333*PDstandardNth3alpha + K13L*PDstandardNth3beta1 + + K23L*PDstandardNth3beta2 + K33L*PDstandardNth3beta3 + + beta3L*PDstandardNth3K33 + alphaL* + (-2*(K11L*Km13 + K12L*Km23 + K13L*Km33) + R13 + K13L*trK); + + K22rhsL = G112*PDstandardNth1alpha + beta1L*PDstandardNth1K12 - + 9*PDstandardNth22alpha + G222*PDstandardNth2alpha + + 4*(K12L*PDstandardNth2beta1 + K22L*PDstandardNth2beta2 + + K23L*PDstandardNth2beta3) + beta2L*PDstandardNth2K22 + + G323*PDstandardNth3alpha + beta3L*PDstandardNth3K23 + alphaL*(-2*(K12L*Km12 + K22L*Km22 + K23L*Km32) + R22 + K22L*trK); - K23rhsL = G123*PDstandardNth1alpha + beta1L*PDstandardNth1K23 - PDstandardNth23alpha + G223*PDstandardNth2alpha + - K13L*PDstandardNth2beta1 + K33L*PDstandardNth2beta3 + beta2L*PDstandardNth2K23 + G323*PDstandardNth3alpha + - K12L*PDstandardNth3beta1 + K22L*PDstandardNth3beta2 + K23L*(PDstandardNth2beta2 + PDstandardNth3beta3) + - beta3L*PDstandardNth3K23 + alphaL*(-2*(K12L*Km13 + K22L*Km23 + K23L*Km33) + R23 + K23L*trK); - - K33rhsL = G133*PDstandardNth1alpha + beta1L*PDstandardNth1K33 + G233*PDstandardNth2alpha + beta2L*PDstandardNth2K33 - - PDstandardNth33alpha + G333*PDstandardNth3alpha + - 2*(K13L*PDstandardNth3beta1 + K23L*PDstandardNth3beta2 + K33L*PDstandardNth3beta3) + beta3L*PDstandardNth3K33 + + K23rhsL = G113*PDstandardNth1alpha + beta1L*PDstandardNth1K13 - + 9*PDstandardNth23alpha + G223*PDstandardNth2alpha + + 3*(K13L*PDstandardNth2beta1 + K23L*PDstandardNth2beta2 + + K33L*PDstandardNth2beta3) + beta2L*PDstandardNth2K23 + + G333*PDstandardNth3alpha + K13L*PDstandardNth3beta1 + + K23L*PDstandardNth3beta2 + K33L*PDstandardNth3beta3 + + beta3L*PDstandardNth3K33 + alphaL* + (-2*(K12L*Km13 + K22L*Km23 + K23L*Km33) + R23 + K23L*trK); + + K33rhsL = G113*PDstandardNth1alpha + beta1L*PDstandardNth1K13 + + G223*PDstandardNth2alpha + beta2L*PDstandardNth2K23 - + 9*PDstandardNth33alpha + G333*PDstandardNth3alpha + + 4*(K13L*PDstandardNth3beta1 + K23L*PDstandardNth3beta2 + + K33L*PDstandardNth3beta3) + beta3L*PDstandardNth3K33 + alphaL*(-2*(K13L*Km13 + K23L*Km23 + K33L*Km33) + R33 + K33L*trK); alpharhsL = 0; diff --git a/ML_ADM/src/ML_ADM_boundary.c b/ML_ADM/src/ML_ADM_boundary.c index 99b4b47..14f9375 100644 --- a/ML_ADM/src/ML_ADM_boundary.c +++ b/ML_ADM/src/ML_ADM_boundary.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -84,7 +87,7 @@ void ML_ADM_boundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL no pm1o12dz2 = -pow(dz,-2)/12.; /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_ADM_boundary, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_ADM/src/ML_ADM_constraints.c b/ML_ADM/src/ML_ADM_constraints.c index cacb53f..6d8c808 100644 --- a/ML_ADM/src/ML_ADM_constraints.c +++ b/ML_ADM/src/ML_ADM_constraints.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -84,7 +87,7 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL pm1o12dz2 = -pow(dz,-2)/12.; /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_ADM_constraints, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) @@ -99,7 +102,8 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL CCTK_REAL G111 = INITVALUE, G112 = INITVALUE, G113 = INITVALUE, G122 = INITVALUE, G123 = INITVALUE, G133 = INITVALUE; CCTK_REAL G211 = INITVALUE, G212 = INITVALUE, G213 = INITVALUE, G222 = INITVALUE, G223 = INITVALUE, G233 = INITVALUE; CCTK_REAL G311 = INITVALUE, G312 = INITVALUE, G313 = INITVALUE, G322 = INITVALUE, G323 = INITVALUE, G333 = INITVALUE; - CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; + CCTK_REAL gu11 = INITVALUE, gu12 = INITVALUE, gu13 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu23 = INITVALUE; + CCTK_REAL gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; CCTK_REAL Km11 = INITVALUE, Km12 = INITVALUE, Km13 = INITVALUE, Km21 = INITVALUE, Km22 = INITVALUE, Km23 = INITVALUE; CCTK_REAL Km31 = INITVALUE, Km32 = INITVALUE, Km33 = INITVALUE; CCTK_REAL R11 = INITVALUE, R12 = INITVALUE, R13 = INITVALUE, R22 = INITVALUE, R23 = INITVALUE, R33 = INITVALUE; @@ -117,31 +121,30 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL CCTK_REAL PDstandardNth1g11 = INITVALUE; CCTK_REAL PDstandardNth2g11 = INITVALUE; CCTK_REAL PDstandardNth3g11 = INITVALUE; + CCTK_REAL PDstandardNth11g11 = INITVALUE; CCTK_REAL PDstandardNth22g11 = INITVALUE; CCTK_REAL PDstandardNth33g11 = INITVALUE; CCTK_REAL PDstandardNth12g11 = INITVALUE; CCTK_REAL PDstandardNth13g11 = INITVALUE; - CCTK_REAL PDstandardNth21g11 = INITVALUE; CCTK_REAL PDstandardNth23g11 = INITVALUE; - CCTK_REAL PDstandardNth31g11 = INITVALUE; - CCTK_REAL PDstandardNth32g11 = INITVALUE; CCTK_REAL PDstandardNth1g12 = INITVALUE; CCTK_REAL PDstandardNth2g12 = INITVALUE; CCTK_REAL PDstandardNth3g12 = INITVALUE; + CCTK_REAL PDstandardNth11g12 = INITVALUE; + CCTK_REAL PDstandardNth22g12 = INITVALUE; CCTK_REAL PDstandardNth33g12 = INITVALUE; CCTK_REAL PDstandardNth12g12 = INITVALUE; CCTK_REAL PDstandardNth13g12 = INITVALUE; CCTK_REAL PDstandardNth21g12 = INITVALUE; CCTK_REAL PDstandardNth23g12 = INITVALUE; - CCTK_REAL PDstandardNth31g12 = INITVALUE; - CCTK_REAL PDstandardNth32g12 = INITVALUE; CCTK_REAL PDstandardNth1g13 = INITVALUE; CCTK_REAL PDstandardNth2g13 = INITVALUE; CCTK_REAL PDstandardNth3g13 = INITVALUE; + CCTK_REAL PDstandardNth11g13 = INITVALUE; CCTK_REAL PDstandardNth22g13 = INITVALUE; + CCTK_REAL PDstandardNth33g13 = INITVALUE; CCTK_REAL PDstandardNth12g13 = INITVALUE; CCTK_REAL PDstandardNth13g13 = INITVALUE; - CCTK_REAL PDstandardNth21g13 = INITVALUE; CCTK_REAL PDstandardNth23g13 = INITVALUE; CCTK_REAL PDstandardNth31g13 = INITVALUE; CCTK_REAL PDstandardNth32g13 = INITVALUE; @@ -149,17 +152,18 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL CCTK_REAL PDstandardNth2g22 = INITVALUE; CCTK_REAL PDstandardNth3g22 = INITVALUE; CCTK_REAL PDstandardNth11g22 = INITVALUE; + CCTK_REAL PDstandardNth22g22 = INITVALUE; CCTK_REAL PDstandardNth33g22 = INITVALUE; CCTK_REAL PDstandardNth12g22 = INITVALUE; CCTK_REAL PDstandardNth13g22 = INITVALUE; CCTK_REAL PDstandardNth21g22 = INITVALUE; CCTK_REAL PDstandardNth23g22 = INITVALUE; - CCTK_REAL PDstandardNth31g22 = INITVALUE; - CCTK_REAL PDstandardNth32g22 = INITVALUE; CCTK_REAL PDstandardNth1g23 = INITVALUE; CCTK_REAL PDstandardNth2g23 = INITVALUE; CCTK_REAL PDstandardNth3g23 = INITVALUE; CCTK_REAL PDstandardNth11g23 = INITVALUE; + CCTK_REAL PDstandardNth22g23 = INITVALUE; + CCTK_REAL PDstandardNth33g23 = INITVALUE; CCTK_REAL PDstandardNth12g23 = INITVALUE; CCTK_REAL PDstandardNth13g23 = INITVALUE; CCTK_REAL PDstandardNth21g23 = INITVALUE; @@ -171,12 +175,13 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL CCTK_REAL PDstandardNth3g33 = INITVALUE; CCTK_REAL PDstandardNth11g33 = INITVALUE; CCTK_REAL PDstandardNth22g33 = INITVALUE; + CCTK_REAL PDstandardNth33g33 = INITVALUE; CCTK_REAL PDstandardNth12g33 = INITVALUE; CCTK_REAL PDstandardNth13g33 = INITVALUE; - CCTK_REAL PDstandardNth21g33 = INITVALUE; CCTK_REAL PDstandardNth23g33 = INITVALUE; CCTK_REAL PDstandardNth31g33 = INITVALUE; CCTK_REAL PDstandardNth32g33 = INITVALUE; + CCTK_REAL PDstandardNth1K11 = INITVALUE; CCTK_REAL PDstandardNth2K11 = INITVALUE; CCTK_REAL PDstandardNth3K11 = INITVALUE; CCTK_REAL PDstandardNth1K12 = INITVALUE; @@ -186,12 +191,14 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL CCTK_REAL PDstandardNth2K13 = INITVALUE; CCTK_REAL PDstandardNth3K13 = INITVALUE; CCTK_REAL PDstandardNth1K22 = INITVALUE; + CCTK_REAL PDstandardNth2K22 = INITVALUE; CCTK_REAL PDstandardNth3K22 = INITVALUE; CCTK_REAL PDstandardNth1K23 = INITVALUE; CCTK_REAL PDstandardNth2K23 = INITVALUE; CCTK_REAL PDstandardNth3K23 = INITVALUE; CCTK_REAL PDstandardNth1K33 = INITVALUE; CCTK_REAL PDstandardNth2K33 = INITVALUE; + CCTK_REAL PDstandardNth3K33 = INITVALUE; /* Assign local copies of grid functions */ g11L = g11[index]; @@ -215,12 +222,17 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL PDstandardNth1g11 = PDstandardNth1(g11, i, j, k); PDstandardNth2g11 = PDstandardNth2(g11, i, j, k); PDstandardNth3g11 = PDstandardNth3(g11, i, j, k); + PDstandardNth11g11 = PDstandardNth11(g11, i, j, k); PDstandardNth22g11 = PDstandardNth22(g11, i, j, k); PDstandardNth33g11 = PDstandardNth33(g11, i, j, k); + PDstandardNth12g11 = PDstandardNth12(g11, i, j, k); + PDstandardNth13g11 = PDstandardNth13(g11, i, j, k); PDstandardNth23g11 = PDstandardNth23(g11, i, j, k); PDstandardNth1g12 = PDstandardNth1(g12, i, j, k); PDstandardNth2g12 = PDstandardNth2(g12, i, j, k); PDstandardNth3g12 = PDstandardNth3(g12, i, j, k); + PDstandardNth11g12 = PDstandardNth11(g12, i, j, k); + PDstandardNth22g12 = PDstandardNth22(g12, i, j, k); PDstandardNth33g12 = PDstandardNth33(g12, i, j, k); PDstandardNth12g12 = PDstandardNth12(g12, i, j, k); PDstandardNth13g12 = PDstandardNth13(g12, i, j, k); @@ -228,7 +240,9 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL PDstandardNth1g13 = PDstandardNth1(g13, i, j, k); PDstandardNth2g13 = PDstandardNth2(g13, i, j, k); PDstandardNth3g13 = PDstandardNth3(g13, i, j, k); + PDstandardNth11g13 = PDstandardNth11(g13, i, j, k); PDstandardNth22g13 = PDstandardNth22(g13, i, j, k); + PDstandardNth33g13 = PDstandardNth33(g13, i, j, k); PDstandardNth12g13 = PDstandardNth12(g13, i, j, k); PDstandardNth13g13 = PDstandardNth13(g13, i, j, k); PDstandardNth23g13 = PDstandardNth23(g13, i, j, k); @@ -236,12 +250,17 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL PDstandardNth2g22 = PDstandardNth2(g22, i, j, k); PDstandardNth3g22 = PDstandardNth3(g22, i, j, k); PDstandardNth11g22 = PDstandardNth11(g22, i, j, k); + PDstandardNth22g22 = PDstandardNth22(g22, i, j, k); PDstandardNth33g22 = PDstandardNth33(g22, i, j, k); + PDstandardNth12g22 = PDstandardNth12(g22, i, j, k); PDstandardNth13g22 = PDstandardNth13(g22, i, j, k); + PDstandardNth23g22 = PDstandardNth23(g22, i, j, k); PDstandardNth1g23 = PDstandardNth1(g23, i, j, k); PDstandardNth2g23 = PDstandardNth2(g23, i, j, k); PDstandardNth3g23 = PDstandardNth3(g23, i, j, k); PDstandardNth11g23 = PDstandardNth11(g23, i, j, k); + PDstandardNth22g23 = PDstandardNth22(g23, i, j, k); + PDstandardNth33g23 = PDstandardNth33(g23, i, j, k); PDstandardNth12g23 = PDstandardNth12(g23, i, j, k); PDstandardNth13g23 = PDstandardNth13(g23, i, j, k); PDstandardNth23g23 = PDstandardNth23(g23, i, j, k); @@ -250,7 +269,11 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL PDstandardNth3g33 = PDstandardNth3(g33, i, j, k); PDstandardNth11g33 = PDstandardNth11(g33, i, j, k); PDstandardNth22g33 = PDstandardNth22(g33, i, j, k); + PDstandardNth33g33 = PDstandardNth33(g33, i, j, k); PDstandardNth12g33 = PDstandardNth12(g33, i, j, k); + PDstandardNth13g33 = PDstandardNth13(g33, i, j, k); + PDstandardNth23g33 = PDstandardNth23(g33, i, j, k); + PDstandardNth1K11 = PDstandardNth1(K11, i, j, k); PDstandardNth2K11 = PDstandardNth2(K11, i, j, k); PDstandardNth3K11 = PDstandardNth3(K11, i, j, k); PDstandardNth1K12 = PDstandardNth1(K12, i, j, k); @@ -260,170 +283,263 @@ void ML_ADM_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL PDstandardNth2K13 = PDstandardNth2(K13, i, j, k); PDstandardNth3K13 = PDstandardNth3(K13, i, j, k); PDstandardNth1K22 = PDstandardNth1(K22, i, j, k); + PDstandardNth2K22 = PDstandardNth2(K22, i, j, k); PDstandardNth3K22 = PDstandardNth3(K22, i, j, k); PDstandardNth1K23 = PDstandardNth1(K23, i, j, k); PDstandardNth2K23 = PDstandardNth2(K23, i, j, k); PDstandardNth3K23 = PDstandardNth3(K23, i, j, k); PDstandardNth1K33 = PDstandardNth1(K33, i, j, k); PDstandardNth2K33 = PDstandardNth2(K33, i, j, k); + PDstandardNth3K33 = PDstandardNth3(K33, i, j, k); /* Precompute derivatives (old style) */ /* Calculate temporaries and grid functions */ - detg = 2*g12L*g13L*g23L + g33L*(g11L*g22L - SQR(g12L)) - g22L*SQR(g13L) - g11L*SQR(g23L); + detg = 2*g12L*g13L*g23L + g33L*(g11L*g22L - SQR(g12L)) - g22L*SQR(g13L) - + g11L*SQR(g23L); gu11 = INV(detg)*(g22L*g33L - SQR(g23L)); - gu21 = (g13L*g23L - g12L*g33L)*INV(detg); + gu12 = (g13L*g23L - g12L*g33L)*INV(detg); - gu31 = (-(g13L*g22L) + g12L*g23L)*INV(detg); + gu13 = (-(g13L*g22L) + g12L*g23L)*INV(detg); + + gu21 = (g13L*g23L - g12L*g33L)*INV(detg); gu22 = INV(detg)*(g11L*g33L - SQR(g13L)); + gu23 = (g12L*g13L - g11L*g23L)*INV(detg); + + gu31 = (-(g13L*g22L) + g12L*g23L)*INV(detg); + gu32 = (g12L*g13L - g11L*g23L)*INV(detg); gu33 = INV(detg)*(g11L*g22L - SQR(g12L)); - G111 = khalf*(gu11*PDstandardNth1g11 + 2*(gu21*PDstandardNth1g12 + gu31*PDstandardNth1g13) - gu21*PDstandardNth2g11 - - gu31*PDstandardNth3g11); + G111 = khalf*(gu11*PDstandardNth1g11 + + 2*(gu12*PDstandardNth1g12 + gu13*PDstandardNth1g13) - + gu12*PDstandardNth2g11 - gu13*PDstandardNth3g11); - G211 = khalf*(gu21*PDstandardNth1g11 + 2*(gu22*PDstandardNth1g12 + gu32*PDstandardNth1g13) - gu22*PDstandardNth2g11 - - gu32*PDstandardNth3g11); + G211 = khalf*(gu21*PDstandardNth1g11 + + 2*(gu22*PDstandardNth1g12 + gu23*PDstandardNth1g13) - + gu22*PDstandardNth2g11 - gu23*PDstandardNth3g11); - G311 = khalf*(gu31*PDstandardNth1g11 + 2*(gu32*PDstandardNth1g12 + gu33*PDstandardNth1g13) - gu32*PDstandardNth2g11 - - gu33*PDstandardNth3g11); + G311 = khalf*(gu31*PDstandardNth1g11 + + 2*(gu32*PDstandardNth1g12 + gu33*PDstandardNth1g13) - + gu32*PDstandardNth2g11 - gu33*PDstandardNth3g11); - G112 = khalf*(gu21*PDstandardNth1g22 + gu11*PDstandardNth2g11 + - gu31*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); + G112 = khalf*(gu12*PDstandardNth1g22 + gu11*PDstandardNth2g11 + + gu13*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); G212 = khalf*(gu22*PDstandardNth1g22 + gu21*PDstandardNth2g11 + - gu32*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); + gu23*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); G312 = khalf*(gu32*PDstandardNth1g22 + gu31*PDstandardNth2g11 + gu33*(PDstandardNth1g23 + PDstandardNth2g13 - PDstandardNth3g12)); - G113 = khalf*(gu31*PDstandardNth1g33 + gu11*PDstandardNth3g11 + - gu21*(PDstandardNth1g23 - PDstandardNth2g13 + PDstandardNth3g12)); + G113 = khalf*(gu13*PDstandardNth1g33 + gu11*PDstandardNth3g11 + + gu12*(PDstandardNth1g23 - PDstandardNth2g13 + PDstandardNth3g12)); - G213 = khalf*(gu32*PDstandardNth1g33 + gu21*PDstandardNth3g11 + + G213 = khalf*(gu23*PDstandardNth1g33 + gu21*PDstandardNth3g11 + gu22*(PDstandardNth1g23 - PDstandardNth2g13 + PDstandardNth3g12)); G313 = khalf*(gu33*PDstandardNth1g33 + gu31*PDstandardNth3g11 + gu32*(PDstandardNth1g23 - PDstandardNth2g13 + PDstandardNth3g12)); - G122 = khalf*(gu11*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + gu21*PDstandardNth2g22 + - gu31*(2*PDstandardNth2g23 - PDstandardNth3g22)); + G122 = khalf*(gu11*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + + gu12*PDstandardNth2g22 + gu13*(2*PDstandardNth2g23 - PDstandardNth3g22)); - G222 = khalf*(gu21*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + gu22*PDstandardNth2g22 + - gu32*(2*PDstandardNth2g23 - PDstandardNth3g22)); + G222 = khalf*(gu21*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + + gu22*PDstandardNth2g22 + gu23*(2*PDstandardNth2g23 - PDstandardNth3g22)); - G322 = khalf*(gu31*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + gu32*PDstandardNth2g22 + - gu33*(2*PDstandardNth2g23 - PDstandardNth3g22)); + G322 = khalf*(gu31*(-PDstandardNth1g22 + 2*PDstandardNth2g12) + + gu32*PDstandardNth2g22 + gu33*(2*PDstandardNth2g23 - PDstandardNth3g22)); - G123 = khalf*(gu31*PDstandardNth2g33 + gu11*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + - gu21*PDstandardNth3g22); + G123 = khalf*(gu13*PDstandardNth2g33 + + gu11*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + + gu12*PDstandardNth3g22); - G223 = khalf*(gu32*PDstandardNth2g33 + gu21*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + + G223 = khalf*(gu23*PDstandardNth2g33 + + gu21*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + gu22*PDstandardNth3g22); - G323 = khalf*(gu33*PDstandardNth2g33 + gu31*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + + G323 = khalf*(gu33*PDstandardNth2g33 + + gu31*(-PDstandardNth1g23 + PDstandardNth2g13 + PDstandardNth3g12) + gu32*PDstandardNth3g22); - G133 = khalf*(-(gu11*PDstandardNth1g33) - gu21*PDstandardNth2g33 + 2*gu11*PDstandardNth3g13 + - 2*gu21*PDstandardNth3g23 + gu31*PDstandardNth3g33); - - G233 = khalf*(-(gu21*PDstandardNth1g33) - gu22*PDstandardNth2g33 + 2*gu21*PDstandardNth3g13 + - 2*gu22*PDstandardNth3g23 + gu32*PDstandardNth3g33); - - G333 = khalf*(-(gu31*PDstandardNth1g33) - gu32*PDstandardNth2g33 + 2*gu31*PDstandardNth3g13 + - 2*gu32*PDstandardNth3g23 + gu33*PDstandardNth3g33); - - R11 = khalf*(-(gu22*PDstandardNth11g22) - 2*(G111*G122 + G111*G133 + G211*G222 + G211*G233 + G311*G322 + G311*G333 + - gu32*PDstandardNth11g23) - gu33*PDstandardNth11g33 + 2*gu22*PDstandardNth12g12 + 2*gu32*PDstandardNth12g13 + - 2*gu32*PDstandardNth13g12 + 2*gu33*PDstandardNth13g13 - gu22*PDstandardNth22g11 - 2*gu32*PDstandardNth23g11 - - gu33*PDstandardNth33g11 + 2*SQR(G112) + 2*SQR(G113) + 2*SQR(G212) + 2*SQR(G213) + 2*SQR(G312) + 2*SQR(G313)); - - R12 = khalf*(2*(G113*G123 + G213*G223 + G313*G323) - 2*(G112*G133 + G212*G233 + G312*G333 + gu21*PDstandardNth12g12) - - gu32*PDstandardNth12g23 - gu33*PDstandardNth12g33 + - gu31*(PDstandardNth11g23 - PDstandardNth12g13 - PDstandardNth13g12) + gu32*PDstandardNth13g22 + - gu33*PDstandardNth13g23 + gu21*(PDstandardNth11g22 + PDstandardNth22g11) + gu32*PDstandardNth22g13 + - gu31*PDstandardNth23g11 - gu32*PDstandardNth23g12 + gu33*PDstandardNth23g13 - gu33*PDstandardNth33g12); - - R13 = khalf*(2*(G112*G123 + G212*G223 + G312*G323) - 2*(G113*G122 + G213*G222 + G313*G322 + gu31*PDstandardNth13g13) + - gu21*(PDstandardNth11g23 - PDstandardNth12g13 - PDstandardNth13g12 + PDstandardNth23g11) + - gu22*(PDstandardNth12g23 - PDstandardNth13g22 - PDstandardNth22g13 + PDstandardNth23g12) + - gu31*(PDstandardNth11g33 + PDstandardNth33g11) + - gu32*(PDstandardNth12g33 - PDstandardNth13g23 - PDstandardNth23g13 + PDstandardNth33g12)); - - R22 = khalf*(-2*(G122*(G111 + G133) + G222*(G211 + G233) + G322*(G311 + G333) + gu31*PDstandardNth13g22) + - gu11*(-PDstandardNth11g22 + 2*PDstandardNth12g12 - PDstandardNth22g11) + - gu31*(-2*PDstandardNth22g13 + 2*(PDstandardNth12g23 + PDstandardNth23g12)) + - gu33*(-PDstandardNth22g33 + 2*PDstandardNth23g23 - PDstandardNth33g22) + - 2*(SQR(G112) + SQR(G123) + SQR(G212) + SQR(G223) + SQR(G312) + SQR(G323))); - - R23 = khalf*(2*(G112*G113 + G212*G213 + G312*G313) + - gu11*(-PDstandardNth11g23 + PDstandardNth12g13 + PDstandardNth13g12 - PDstandardNth23g11) + - gu21*(-PDstandardNth12g23 + PDstandardNth13g22 + PDstandardNth22g13 - PDstandardNth23g12) - - 2*(G111*G123 + G211*G223 + G311*G323 + gu32*PDstandardNth23g23) + - gu31*(PDstandardNth12g33 - PDstandardNth13g23 - PDstandardNth23g13 + PDstandardNth33g12) + - gu32*(PDstandardNth22g33 + PDstandardNth33g22)); - - R33 = khalf*(gu11*(-PDstandardNth11g33 + 2*PDstandardNth13g13 - PDstandardNth33g11) - - 2*((G111 + G122)*G133 + (G211 + G222)*G233 + (G311 + G322)*G333 + - gu21*(PDstandardNth12g33 + PDstandardNth33g12)) + - gu22*(-PDstandardNth22g33 + 2*PDstandardNth23g23 - PDstandardNth33g22) + - 2*(gu21*(PDstandardNth13g23 + PDstandardNth23g13) + SQR(G113) + SQR(G123) + SQR(G213) + SQR(G223) + SQR(G313) + - SQR(G323))); - - trR = gu11*R11 + gu22*R22 + 2*(gu21*R12 + gu31*R13 + gu32*R23) + gu33*R33; - - Km11 = gu11*K11L + gu21*K12L + gu31*K13L; - - Km21 = gu21*K11L + gu22*K12L + gu32*K13L; + G133 = khalf*(-(gu11*PDstandardNth1g33) - gu12*PDstandardNth2g33 + + 2*gu11*PDstandardNth3g13 + 2*gu12*PDstandardNth3g23 + + gu13*PDstandardNth3g33); + + G233 = khalf*(-(gu21*PDstandardNth1g33) - gu22*PDstandardNth2g33 + + 2*gu21*PDstandardNth3g13 + 2*gu22*PDstandardNth3g23 + + gu23*PDstandardNth3g33); + + G333 = khalf*(-(gu31*PDstandardNth1g33) - gu32*PDstandardNth2g33 + + 2*gu31*PDstandardNth3g13 + 2*gu32*PDstandardNth3g23 + + gu33*PDstandardNth3g33); + + R11 = -(G111*(G111 + G122 + G133)) - G211*(G211 + G222 + G233) - + G311*(G311 + G322 + G333) + khalf* + (-6*gu11*PDstandardNth11g11 + + gu12*(-8*PDstandardNth11g12 + 2*PDstandardNth12g12) + + gu22*(-9*PDstandardNth11g22 + 3*PDstandardNth12g22) + + gu13*(-8*PDstandardNth11g13 + 2*PDstandardNth13g13) + + gu33*(-9*PDstandardNth11g33 + 3*PDstandardNth13g33) + + gu21*(-6*PDstandardNth11g12 - PDstandardNth12g12 + PDstandardNth22g12) + + gu23*(-9*PDstandardNth11g23 + 3*PDstandardNth13g23 + + PDstandardNth22g23 - PDstandardNth23g23) + + gu31*(-6*PDstandardNth11g13 - PDstandardNth13g13 + PDstandardNth33g13) + + gu32*(-9*PDstandardNth11g23 + 3*PDstandardNth12g23 - + PDstandardNth23g23 + PDstandardNth33g23)) + SQR(G111) + SQR(G112) + + SQR(G113) + SQR(G211) + SQR(G212) + SQR(G213) + SQR(G311) + SQR(G312) + + SQR(G313); + + R12 = khalf*(-2*(G112*G133 + G212*G233 + G312*G333) - + 6*(gu11*PDstandardNth12g11 + gu31*PDstandardNth12g13) - + 9*(gu22*PDstandardNth12g22 + gu23*PDstandardNth12g23 + + gu32*PDstandardNth12g23 + gu33*PDstandardNth12g33) - + gu31*PDstandardNth13g13 + gu21* + (-7*PDstandardNth12g12 + PDstandardNth22g12) + + gu12*(PDstandardNth11g12 - 10*PDstandardNth12g12 + + 3*PDstandardNth22g12) + 3*gu22*PDstandardNth22g22 + + gu23*PDstandardNth22g23 + 3*gu32*PDstandardNth22g23 + + gu13*(PDstandardNth11g13 - 9*PDstandardNth12g13 - PDstandardNth13g13 + + 3*PDstandardNth23g13) - gu32*PDstandardNth23g23 + + 2*(G113*G123 + G213*G223 + G313*G323 + gu23*PDstandardNth23g23) + + 3*gu33*PDstandardNth23g33 + gu31*PDstandardNth33g13 + + gu32*PDstandardNth33g23); + + R13 = khalf*(-2*(G113*G122 + G213*G222 + G313*G322) - + 6*gu11*PDstandardNth13g11 - + 9*(gu22*PDstandardNth13g22 + (gu23 + gu32)*PDstandardNth13g23 + + gu33*PDstandardNth13g33) + + gu21*(-PDstandardNth12g12 - 6*PDstandardNth13g12 + PDstandardNth22g12) + + gu12*(PDstandardNth11g12 - PDstandardNth12g12 - 9*PDstandardNth13g12 + + 3*PDstandardNth23g12) + + gu23*(PDstandardNth22g23 - PDstandardNth23g23) + + 2*(G112*G123 + G212*G223 + G312*G323 + gu32*PDstandardNth23g23) + + gu31*(-7*PDstandardNth13g13 + PDstandardNth33g13) + + gu13*(PDstandardNth11g13 - 10*PDstandardNth13g13 + + 3*PDstandardNth33g13) + gu32*PDstandardNth33g23 + + 3*(gu22*PDstandardNth23g22 + gu23*PDstandardNth33g23 + + gu33*PDstandardNth33g33)); + + R22 = -(G122*(G111 + G122 + G133)) - G222*(G211 + G222 + G233) - + G322*(G311 + G322 + G333) + khalf* + (3*gu11*(PDstandardNth12g11 - 3*PDstandardNth22g11) + + gu21*(2*PDstandardNth12g12 - 8*PDstandardNth22g12) + + gu12*(PDstandardNth11g12 - PDstandardNth12g12 - 6*PDstandardNth22g12) - + 6*gu22*PDstandardNth22g22 + + gu13*(PDstandardNth11g13 - PDstandardNth13g13 - 9*PDstandardNth22g13 + + 3*PDstandardNth23g13) - + gu23*(8*PDstandardNth22g23 - 2*PDstandardNth23g23) + + gu33*(-9*PDstandardNth22g33 + 3*PDstandardNth23g33) + + gu31*(3*PDstandardNth12g13 - PDstandardNth13g13 - 9*PDstandardNth22g13 + + PDstandardNth33g13) + gu32* + (-6*PDstandardNth22g23 - PDstandardNth23g23 + PDstandardNth33g23)) + + SQR(G112) + SQR(G122) + SQR(G123) + SQR(G212) + SQR(G222) + SQR(G223) + + SQR(G312) + SQR(G322) + SQR(G323); + + R23 = khalf*(-2*(G111*G123 + G211*G223 + G311*G323) + + 2*(G112*G113 + G212*G213 + G312*G313 + gu31*PDstandardNth13g13) + + gu11*(3*PDstandardNth13g11 - 9*PDstandardNth23g11) + + gu21*(-PDstandardNth12g12 + 3*PDstandardNth13g12 + PDstandardNth22g12 - + 9*PDstandardNth23g12) + + gu12*(PDstandardNth11g12 - PDstandardNth12g12 - 6*PDstandardNth23g12) - + 6*gu22*PDstandardNth23g22 - + 9*(gu31*PDstandardNth23g13 + gu33*PDstandardNth23g33) + + gu31*PDstandardNth33g13 + gu13* + (PDstandardNth11g13 - PDstandardNth13g13 - 9*PDstandardNth23g13 + + 3*PDstandardNth33g13) + + gu32*(-7*PDstandardNth23g23 + PDstandardNth33g23) + + gu23*(PDstandardNth22g23 - 10*PDstandardNth23g23 + + 3*PDstandardNth33g23) + 3*gu33*PDstandardNth33g33); + + R33 = -(G133*(G111 + G122 + G133)) - G233*(G211 + G222 + G233) - + G333*(G311 + G322 + G333) + khalf* + (3*gu11*(PDstandardNth13g11 - 3*PDstandardNth33g11) + + gu21*(-PDstandardNth12g12 + 3*PDstandardNth13g12 + PDstandardNth22g12 - + 9*PDstandardNth33g12) + + gu12*(PDstandardNth11g12 - PDstandardNth12g12 + 3*PDstandardNth23g12 - + 9*PDstandardNth33g12) + + gu31*(2*PDstandardNth13g13 - 8*PDstandardNth33g13) + + gu13*(PDstandardNth11g13 - PDstandardNth13g13 - 6*PDstandardNth33g13) + + 3*gu22*(PDstandardNth23g22 - 3*PDstandardNth33g22) + + gu32*(2*PDstandardNth23g23 - 8*PDstandardNth33g23) + + gu23*(PDstandardNth22g23 - PDstandardNth23g23 - 6*PDstandardNth33g23) - + 6*gu33*PDstandardNth33g33) + SQR(G113) + SQR(G123) + SQR(G133) + + SQR(G213) + SQR(G223) + SQR(G233) + SQR(G313) + SQR(G323) + SQR(G333); + + trR = gu11*R11 + (gu12 + gu21)*R12 + (gu13 + gu31)*R13 + gu22*R22 + + (gu23 + gu32)*R23 + gu33*R33; + + Km11 = gu11*K11L + gu12*K12L + gu13*K13L; + + Km21 = gu21*K11L + gu22*K12L + gu23*K13L; Km31 = gu31*K11L + gu32*K12L + gu33*K13L; - Km12 = gu11*K12L + gu21*K22L + gu31*K23L; + Km12 = gu11*K12L + gu12*K22L + gu13*K23L; - Km22 = gu21*K12L + gu22*K22L + gu32*K23L; + Km22 = gu21*K12L + gu22*K22L + gu23*K23L; Km32 = gu31*K12L + gu32*K22L + gu33*K23L; - Km13 = gu11*K13L + gu21*K23L + gu31*K33L; + Km13 = gu11*K13L + gu12*K23L + gu13*K33L; - Km23 = gu21*K13L + gu22*K23L + gu32*K33L; + Km23 = gu21*K13L + gu22*K23L + gu23*K33L; Km33 = gu31*K13L + gu32*K23L + gu33*K33L; trK = Km11 + Km22 + Km33; - HL = -2*(Km12*Km21 + Km13*Km31 + Km23*Km32) + trR - SQR(Km11) - SQR(Km22) - SQR(Km33) + SQR(trK); - - M1L = gu21*(-(G112*K11L) + G111*K12L - G212*K12L - G312*K13L + G211*K22L + G311*K23L - PDstandardNth1K12 + - PDstandardNth2K11) + gu22*(-(G122*K11L) + G112*K12L - G222*K12L - G322*K13L + G212*K22L + G312*K23L - - PDstandardNth1K22 + PDstandardNth2K12) + gu31* - (-(G113*K11L) - G213*K12L + G111*K13L - G313*K13L + G211*K23L + G311*K33L - PDstandardNth1K13 + PDstandardNth3K11)\ - + gu32*(G113*K12L + G112*K13L + G213*K22L + (G212 + G313)*K23L + G312*K33L - - 2*(G123*K11L + G223*K12L + G323*K13L + PDstandardNth1K23) + PDstandardNth2K13 + PDstandardNth3K12) + - gu33*(-(G133*K11L) - G233*K12L + G113*K13L - G333*K13L + G213*K23L + G313*K33L - PDstandardNth1K33 + - PDstandardNth3K13); - - M2L = gu11*(G112*K11L + (-G111 + G212)*K12L + G312*K13L - G211*K22L - G311*K23L + PDstandardNth1K12 - - PDstandardNth2K11) + gu21*(G122*K11L + (-G112 + G222)*K12L + G322*K13L - G212*K22L - G312*K23L + - PDstandardNth1K22 - PDstandardNth2K12) + gu31* - (G123*K11L + (-2*G113 + G223)*K12L + (G112 + G323)*K13L + G212*K23L + G312*K33L + PDstandardNth1K23 - - 2*(G213*K22L + G313*K23L + PDstandardNth2K13) + PDstandardNth3K12) + - gu32*(-(G123*K12L) + G122*K13L - G223*K22L + G222*K23L - G323*K23L + G322*K33L - PDstandardNth2K23 + - PDstandardNth3K22) + gu33*(-(G133*K12L) + G123*K13L - G233*K22L + G223*K23L - G333*K23L + G323*K33L - - PDstandardNth2K33 + PDstandardNth3K23); - - M3L = gu11*(G113*K11L + G213*K12L + (-G111 + G313)*K13L - G211*K23L - G311*K33L + PDstandardNth1K13 - - PDstandardNth3K11) + gu21*(G123*K11L + (G113 + G223)*K12L + (-2*G112 + G323)*K13L + G213*K22L + - (-2*G212 + G313)*K23L + PDstandardNth1K23 + PDstandardNth2K13 - 2*(G312*K33L + PDstandardNth3K12)) + - gu31*(G133*K11L + G233*K12L + (-G113 + G333)*K13L - G213*K23L - G313*K33L + PDstandardNth1K33 - - PDstandardNth3K13) + gu22*(G123*K12L - G122*K13L + G223*K22L - G222*K23L + G323*K23L - G322*K33L + - PDstandardNth2K23 - PDstandardNth3K22) + gu32* - (G133*K12L - G123*K13L + G233*K22L - G223*K23L + G333*K23L - G323*K33L + PDstandardNth2K33 - PDstandardNth3K23); + HL = -2*(Km12*Km21 + Km13*Km31 + Km23*Km32) + trR - SQR(Km11) - SQR(Km22) - + SQR(Km33) + SQR(trK); + + M1L = -2*(gu11*PDstandardNth1K11 + gu12*PDstandardNth1K12 + + gu13*PDstandardNth1K13) + + gu21*(-(G112*K11L) + G111*K12L - G212*K12L - G312*K13L + G211*K22L + + G311*K23L - 3*PDstandardNth1K12 + PDstandardNth2K12) + + gu22*(-(G122*K11L) + G112*K12L - G222*K12L - G322*K13L + G212*K22L + + G312*K23L - 3*PDstandardNth1K22 + PDstandardNth2K22) + + gu23*(-(G123*K11L) + G113*K12L - G223*K12L - G323*K13L + G213*K22L + + G313*K23L - 3*PDstandardNth1K23 + PDstandardNth2K23) + + gu31*(-(G113*K11L) - G213*K12L + G111*K13L - G313*K13L + G211*K23L + + G311*K33L - 3*PDstandardNth1K13 + PDstandardNth3K13) + + gu32*(-(G123*K11L) - G223*K12L + G112*K13L - G323*K13L + G212*K23L + + G312*K33L - 3*PDstandardNth1K23 + PDstandardNth3K23) + + gu33*(-(G133*K11L) - G233*K12L + G113*K13L - G333*K13L + G213*K23L + + G313*K33L - 3*PDstandardNth1K33 + PDstandardNth3K33); + + M2L = gu11*(G112*K11L + (-G111 + G212)*K12L + G312*K13L - G211*K22L - + G311*K23L + PDstandardNth1K11 - 3*PDstandardNth2K11) + + gu12*(G122*K11L + (-G112 + G222)*K12L + G322*K13L - G212*K22L - G312*K23L + + PDstandardNth1K12 - 3*PDstandardNth2K12) + + gu13*(G123*K11L + (-G113 + G223)*K12L + G323*K13L - G213*K22L - G313*K23L + + PDstandardNth1K13 - 3*PDstandardNth2K13) - + 2*(gu21*PDstandardNth2K12 + gu22*PDstandardNth2K22 + + gu23*PDstandardNth2K23) + + gu31*(-(G113*K12L) + G112*K13L - G213*K22L + G212*K23L - G313*K23L + + G312*K33L - 3*PDstandardNth2K13 + PDstandardNth3K13) + + gu32*(-(G123*K12L) + G122*K13L - G223*K22L + G222*K23L - G323*K23L + + G322*K33L - 3*PDstandardNth2K23 + PDstandardNth3K23) + + gu33*(-(G133*K12L) + G123*K13L - G233*K22L + G223*K23L - G333*K23L + + G323*K33L - 3*PDstandardNth2K33 + PDstandardNth3K33); + + M3L = gu11*(G113*K11L + G213*K12L + (-G111 + G313)*K13L - G211*K23L - + G311*K33L + PDstandardNth1K11 - 3*PDstandardNth3K11) + + gu12*(G123*K11L + G223*K12L + (-G112 + G323)*K13L - G212*K23L - G312*K33L + + PDstandardNth1K12 - 3*PDstandardNth3K12) + + gu21*(G113*K12L - G112*K13L + G213*K22L - G212*K23L + G313*K23L - + G312*K33L + PDstandardNth2K12 - 3*PDstandardNth3K12) + + gu13*(G133*K11L + G233*K12L + (-G113 + G333)*K13L - G213*K23L - G313*K33L + + PDstandardNth1K13 - 3*PDstandardNth3K13) + + gu22*(G123*K12L - G122*K13L + G223*K22L - G222*K23L + G323*K23L - + G322*K33L + PDstandardNth2K22 - 3*PDstandardNth3K22) + + gu23*(G133*K12L - G123*K13L + G233*K22L - G223*K23L + G333*K23L - + G323*K33L + PDstandardNth2K23 - 3*PDstandardNth3K23) - + 2*(gu31*PDstandardNth3K13 + gu32*PDstandardNth3K23 + gu33*PDstandardNth3K33); /* Copy local copies back to grid functions */ diff --git a/ML_ADM/src/ML_ADM_constraints_boundary.c b/ML_ADM/src/ML_ADM_constraints_boundary.c index 33e504d..4108bff 100644 --- a/ML_ADM/src/ML_ADM_constraints_boundary.c +++ b/ML_ADM/src/ML_ADM_constraints_boundary.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -84,7 +87,7 @@ void ML_ADM_constraints_boundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, pm1o12dz2 = -pow(dz,-2)/12.; /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_ADM_constraints_boundary, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_ADM/src/ML_ADM_convertFromADMBase.c b/ML_ADM/src/ML_ADM_convertFromADMBase.c index a78d3de..8ece38e 100644 --- a/ML_ADM/src/ML_ADM_convertFromADMBase.c +++ b/ML_ADM/src/ML_ADM_convertFromADMBase.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -84,7 +87,7 @@ void ML_ADM_convertFromADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CC pm1o12dz2 = -pow(dz,-2)/12.; /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_ADM_convertFromADMBase, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_ADM/src/ML_ADM_convertToADMBase.c b/ML_ADM/src/ML_ADM_convertToADMBase.c index 50150f1..a7047e3 100644 --- a/ML_ADM/src/ML_ADM_convertToADMBase.c +++ b/ML_ADM/src/ML_ADM_convertToADMBase.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -84,7 +87,7 @@ void ML_ADM_convertToADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK pm1o12dz2 = -pow(dz,-2)/12.; /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_ADM_convertToADMBase, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_BSSN/interface.ccl b/ML_BSSN/interface.ccl index ea46ba0..4f83bb5 100644 --- a/ML_BSSN/interface.ccl +++ b/ML_BSSN/interface.ccl @@ -31,38 +31,38 @@ CCTK_INT FUNCTION Boundary_SelectVarForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT USES FUNCTION Boundary_SelectVarForBC public: -CCTK_REAL cons_detg type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=2.0000000000000000000' +CCTK_REAL ML_cons_detg type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=2.0000000000000000000' { cS -} "cons_detg" +} "ML_cons_detg" public: -CCTK_REAL cons_Gamma type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0.66666666666666666667' +CCTK_REAL ML_cons_Gamma type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0.66666666666666666667' { cXt1, cXt2, cXt3 -} "cons_Gamma" +} "ML_cons_Gamma" public: -CCTK_REAL cons_traceA type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +CCTK_REAL ML_cons_traceA type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' { cA -} "cons_traceA" +} "ML_cons_traceA" public: -CCTK_REAL Ham type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +CCTK_REAL ML_Ham type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' { H -} "Ham" +} "ML_Ham" public: -CCTK_REAL mom type=GF timelevels=1 tags='tensortypealias="D" tensorweight=1.0000000000000000000' +CCTK_REAL ML_mom type=GF timelevels=1 tags='tensortypealias="D" tensorweight=1.0000000000000000000' { M1, M2, M3 -} "mom" +} "ML_mom" public: CCTK_REAL ML_curvrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tensorweight=-0.66666666666666666667' diff --git a/ML_BSSN/param.ccl b/ML_BSSN/param.ccl index 89c654a..e4032ed 100644 --- a/ML_BSSN/param.ccl +++ b/ML_BSSN/param.ccl @@ -41,9 +41,9 @@ USES CCTK_INT MoL_Num_Evolved_Vars USES CCTK_INT MoL_Num_Constrained_Vars restricted: -CCTK_REAL verbose "verbose" +CCTK_INT verbose "verbose" { - "*:*" :: "" + *:* :: "" } 0 restricted: @@ -102,6 +102,13 @@ KEYWORD my_initial_data "my_initial_data" } "ADMBase" private: +KEYWORD my_rhs_boundary_condition "my_rhs_boundary_condition" +{ + "none" :: "none" + "radiative" :: "radiative" +} "none" + +private: KEYWORD my_boundary_condition "my_boundary_condition" { "none" :: "none" @@ -117,8 +124,8 @@ CCTK_INT ML_BSSN_MaxNumEvolvedVars "Number of evolved variables used by this tho restricted: CCTK_INT ML_BSSN_MaxNumConstrainedVars "Number of constrained variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Constrained_Vars { - 43:43 :: "Number of constrained variables used by this thorn" -} 43 + 70:70 :: "Number of constrained variables used by this thorn" +} 70 restricted: CCTK_INT timelevels "Number of active timelevels" @@ -151,6 +158,12 @@ CCTK_INT ML_BSSN_RHS_calc_every "ML_BSSN_RHS_calc_every" } 1 restricted: +CCTK_INT ML_BSSN_RHSBoundary_calc_every "ML_BSSN_RHSBoundary_calc_every" +{ + *:* :: "" +} 1 + +restricted: CCTK_INT ML_BSSN_enforce_calc_every "ML_BSSN_enforce_calc_every" { *:* :: "" @@ -211,6 +224,12 @@ CCTK_INT ML_BSSN_RHS_calc_offset "ML_BSSN_RHS_calc_offset" } 0 restricted: +CCTK_INT ML_BSSN_RHSBoundary_calc_offset "ML_BSSN_RHSBoundary_calc_offset" +{ + *:* :: "" +} 0 + +restricted: CCTK_INT ML_BSSN_enforce_calc_offset "ML_BSSN_enforce_calc_offset" { *:* :: "" diff --git a/ML_BSSN/schedule.ccl b/ML_BSSN/schedule.ccl index 997deca..d2ea16c 100644 --- a/ML_BSSN/schedule.ccl +++ b/ML_BSSN/schedule.ccl @@ -4,15 +4,15 @@ # Mathematica script written by Ian Hinder and Sascha Husa -STORAGE: cons_detg[1] +STORAGE: ML_cons_detg[1] -STORAGE: cons_Gamma[1] +STORAGE: ML_cons_Gamma[1] -STORAGE: cons_traceA[1] +STORAGE: ML_cons_traceA[1] -STORAGE: Ham[1] +STORAGE: ML_Ham[1] -STORAGE: mom[1] +STORAGE: ML_mom[1] STORAGE: ML_curvrhs[1] @@ -212,6 +212,15 @@ schedule ML_BSSN_RHS IN ML_BSSN_evolCalcGroup } "ML_BSSN_RHS" +if (CCTK_EQUALS(my_rhs_boundary_condition, "radiative")) +{ + schedule ML_BSSN_RHSBoundary IN MoL_RHSBoundaries + { + LANG: C + } "ML_BSSN_RHSBoundary" +} + + if (CCTK_EQUALS(evolution_method, "ML_BSSN")) { schedule ML_BSSN_enforce IN MoL_PostStep BEFORE ML_BSSN_BoundConds @@ -232,7 +241,7 @@ if (CCTK_EQUALS(my_boundary_condition, "Minkowski")) if (CCTK_EQUALS(evolution_method, "ML_BSSN")) { - schedule ML_BSSN_convertToADMBase IN MoL_PostStep AFTER (ML_BSSN_ApplyBCs ML_BSSN_boundary ML_BSSN_enforce) + schedule ML_BSSN_convertToADMBase IN MoL_PostStep AFTER (ML_BSSN_ApplyBCs ML_BSSN_enforce) { LANG: C SYNC: ADMBase::curv @@ -256,11 +265,11 @@ if (CCTK_EQUALS(my_boundary_condition, "Minkowski")) schedule ML_BSSN_constraints IN ML_BSSN_constraintsCalcGroup { LANG: C - SYNC: cons_detg - SYNC: cons_Gamma - SYNC: cons_traceA - SYNC: Ham - SYNC: mom + SYNC: ML_cons_detg + SYNC: ML_cons_Gamma + SYNC: ML_cons_traceA + SYNC: ML_Ham + SYNC: ML_mom } "ML_BSSN_constraints" schedule ML_BSSN_constraints_boundary IN ML_BSSN_constraintsCalcGroup AFTER ML_BSSN_constraints diff --git a/ML_BSSN/src/Differencing.h b/ML_BSSN/src/Differencing.h index b8ee67b..46cddca 100644 --- a/ML_BSSN/src/Differencing.h +++ b/ML_BSSN/src/Differencing.h @@ -10,3 +10,9 @@ #define PDstandardNth23(u,i,j,k) (p1o144dydz*(-64*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,-1 + k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,1 + k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,-1 + k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,1 + k)]) + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,2 + k)])) #define PDstandardNth31(u,i,j,k) (p1o144dxdz*(-64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,-1 + k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,1 + k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,-1 + k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,1 + k)]) + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,2 + k)])) #define PDstandardNth32(u,i,j,k) (p1o144dydz*(-64*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,-1 + k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,1 + k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,-1 + k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,1 + k)]) + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,2 + k)])) +#define PDPlus1(u,i,j,k) (pm1o2dx*(-4*(u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDPlus2(u,i,j,k) (pm1o2dy*(-4*(u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDPlus3(u,i,j,k) (pm1o2dz*(-4*(u)[CCTK_GFINDEX3D(cctkGH,i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,j,2 + k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDMinus1(u,i,j,k) (p1o2dx*(-4*(u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDMinus2(u,i,j,k) (p1o2dy*(-4*(u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDMinus3(u,i,j,k) (p1o2dz*(-4*(u)[CCTK_GFINDEX3D(cctkGH,i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,j,-2 + k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) diff --git a/ML_BSSN/src/ML_BSSN_ADMBaseBoundary.c b/ML_BSSN/src/ML_BSSN_ADMBaseBoundary.c index c80dbeb..a399db9 100644 --- a/ML_BSSN/src/ML_BSSN_ADMBaseBoundary.c +++ b/ML_BSSN/src/ML_BSSN_ADMBaseBoundary.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_ADMBaseBoundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_ADMBaseBoundary_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_ADMBaseBoundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_ADMBaseBoundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_ADMBaseBoundary, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_BSSN/src/ML_BSSN_Minkowski.c b/ML_BSSN/src/ML_BSSN_Minkowski.c index 337d66a..1cfc3e1 100644 --- a/ML_BSSN/src/ML_BSSN_Minkowski.c +++ b/ML_BSSN/src/ML_BSSN_Minkowski.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_Minkowski_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_Minkowski_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_Minkowski_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_Minkowski, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_BSSN/src/ML_BSSN_RHS.c b/ML_BSSN/src/ML_BSSN_RHS.c index 0a56114..62371b7 100644 --- a/ML_BSSN/src/ML_BSSN_RHS.c +++ b/ML_BSSN/src/ML_BSSN_RHS.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_RHS_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_RHS, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) @@ -120,9 +135,14 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal CCTK_REAL gtu11 = INITVALUE, gtu21 = INITVALUE, gtu22 = INITVALUE, gtu31 = INITVALUE, gtu32 = INITVALUE, gtu33 = INITVALUE; CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; CCTK_REAL R11 = INITVALUE, R12 = INITVALUE, R13 = INITVALUE, R22 = INITVALUE, R23 = INITVALUE, R33 = INITVALUE; + CCTK_REAL rho = INITVALUE; CCTK_REAL Rphi11 = INITVALUE, Rphi12 = INITVALUE, Rphi13 = INITVALUE, Rphi22 = INITVALUE, Rphi23 = INITVALUE, Rphi33 = INITVALUE; CCTK_REAL Rt11 = INITVALUE, Rt12 = INITVALUE, Rt13 = INITVALUE, Rt22 = INITVALUE, Rt23 = INITVALUE, Rt33 = INITVALUE; + CCTK_REAL S1 = INITVALUE, S2 = INITVALUE, S3 = INITVALUE; + CCTK_REAL T00 = INITVALUE, T01 = INITVALUE, T02 = INITVALUE, T03 = INITVALUE, T11 = INITVALUE, T12 = INITVALUE; + CCTK_REAL T13 = INITVALUE, T22 = INITVALUE, T23 = INITVALUE, T33 = INITVALUE; CCTK_REAL trAts = INITVALUE; + CCTK_REAL trS = INITVALUE; CCTK_REAL Xtn1 = INITVALUE, Xtn2 = INITVALUE, Xtn3 = INITVALUE; /* Declare local copies of grid functions */ @@ -133,6 +153,16 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal CCTK_REAL At22L = INITVALUE, At22rhsL = INITVALUE, At23L = INITVALUE, At23rhsL = INITVALUE, At33L = INITVALUE, At33rhsL = INITVALUE; CCTK_REAL B1L = INITVALUE, B1rhsL = INITVALUE, B2L = INITVALUE, B2rhsL = INITVALUE, B3L = INITVALUE, B3rhsL = INITVALUE; CCTK_REAL beta1L = INITVALUE, beta1rhsL = INITVALUE, beta2L = INITVALUE, beta2rhsL = INITVALUE, beta3L = INITVALUE, beta3rhsL = INITVALUE; + CCTK_REAL eTttL = INITVALUE; + CCTK_REAL eTtxL = INITVALUE; + CCTK_REAL eTtyL = INITVALUE; + CCTK_REAL eTtzL = INITVALUE; + CCTK_REAL eTxxL = INITVALUE; + CCTK_REAL eTxyL = INITVALUE; + CCTK_REAL eTxzL = INITVALUE; + CCTK_REAL eTyyL = INITVALUE; + CCTK_REAL eTyzL = INITVALUE; + CCTK_REAL eTzzL = INITVALUE; CCTK_REAL gt11L = INITVALUE, gt11rhsL = INITVALUE, gt12L = INITVALUE, gt12rhsL = INITVALUE, gt13L = INITVALUE, gt13rhsL = INITVALUE; CCTK_REAL gt22L = INITVALUE, gt22rhsL = INITVALUE, gt23L = INITVALUE, gt23rhsL = INITVALUE, gt33L = INITVALUE, gt33rhsL = INITVALUE; CCTK_REAL phiL = INITVALUE, phirhsL = INITVALUE; @@ -328,6 +358,16 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal beta1L = beta1[index]; beta2L = beta2[index]; beta3L = beta3[index]; + eTttL = eTtt[index]; + eTtxL = eTtx[index]; + eTtyL = eTty[index]; + eTtzL = eTtz[index]; + eTxxL = eTxx[index]; + eTxyL = eTxy[index]; + eTxzL = eTxz[index]; + eTyyL = eTyy[index]; + eTyzL = eTyz[index]; + eTzzL = eTzz[index]; gt11L = gt11[index]; gt12L = gt12[index]; gt13L = gt13[index]; @@ -505,13 +545,16 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); - Gt111 = khalf*(gtu11*PDstandardNth1gt11 + 2*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) - + Gt111 = khalf*(gtu11*PDstandardNth1gt11 + + 2*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) - gtu21*PDstandardNth2gt11 - gtu31*PDstandardNth3gt11); - Gt211 = khalf*(gtu21*PDstandardNth1gt11 + 2*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) - + Gt211 = khalf*(gtu21*PDstandardNth1gt11 + + 2*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) - gtu22*PDstandardNth2gt11 - gtu32*PDstandardNth3gt11); - Gt311 = khalf*(gtu31*PDstandardNth1gt11 + 2*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) - + Gt311 = khalf*(gtu31*PDstandardNth1gt11 + + 2*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) - gtu32*PDstandardNth2gt11 - gtu33*PDstandardNth3gt11); Gt112 = khalf*(gtu21*PDstandardNth1gt22 + gtu11*PDstandardNth2gt11 + @@ -532,362 +575,579 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal Gt313 = khalf*(gtu33*PDstandardNth1gt33 + gtu31*PDstandardNth3gt11 + gtu32*(PDstandardNth1gt23 - PDstandardNth2gt13 + PDstandardNth3gt12)); - Gt122 = khalf*(gtu11*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu21*PDstandardNth2gt22 + + Gt122 = khalf*(gtu11*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu21*PDstandardNth2gt22 + gtu31*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt222 = khalf*(gtu21*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu22*PDstandardNth2gt22 + + Gt222 = khalf*(gtu21*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu22*PDstandardNth2gt22 + gtu32*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt322 = khalf*(gtu31*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu32*PDstandardNth2gt22 + + Gt322 = khalf*(gtu31*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu32*PDstandardNth2gt22 + gtu33*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt123 = khalf*(gtu31*PDstandardNth2gt33 + gtu11*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt123 = khalf*(gtu31*PDstandardNth2gt33 + + gtu11*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu21*PDstandardNth3gt22); - Gt223 = khalf*(gtu32*PDstandardNth2gt33 + gtu21*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt223 = khalf*(gtu32*PDstandardNth2gt33 + + gtu21*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu22*PDstandardNth3gt22); - Gt323 = khalf*(gtu33*PDstandardNth2gt33 + gtu31*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt323 = khalf*(gtu33*PDstandardNth2gt33 + + gtu31*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu32*PDstandardNth3gt22); - Gt133 = khalf*(-(gtu11*PDstandardNth1gt33) - gtu21*PDstandardNth2gt33 + 2*gtu11*PDstandardNth3gt13 + - 2*gtu21*PDstandardNth3gt23 + gtu31*PDstandardNth3gt33); - - Gt233 = khalf*(-(gtu21*PDstandardNth1gt33) - gtu22*PDstandardNth2gt33 + 2*gtu21*PDstandardNth3gt13 + - 2*gtu22*PDstandardNth3gt23 + gtu32*PDstandardNth3gt33); - - Gt333 = khalf*(-(gtu31*PDstandardNth1gt33) - gtu32*PDstandardNth2gt33 + 2*gtu31*PDstandardNth3gt13 + - 2*gtu32*PDstandardNth3gt23 + gtu33*PDstandardNth3gt33); - - Xtn1 = Gt111*gtu11 + Gt122*gtu22 + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33; - - Xtn2 = Gt211*gtu11 + Gt222*gtu22 + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33; - - Xtn3 = Gt311*gtu11 + Gt322*gtu22 + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33; - - Rt11 = -(gtu11*khalf*PDstandardNth11gt11) + gtu21* - (2*Gt211*Gt212*gt22L + 4*Gt112*gt13L*Gt311 + 2*Gt113*gt11L*Gt312 + 2*gt13L*Gt312*Gt313 + 2*gt13L*Gt211*Gt322 + - 2*gt13L*Gt311*Gt323 + 2*Gt311*Gt312*gt33L - PDstandardNth12gt11) - gtu31*PDstandardNth13gt11 + - gt11L*PDstandardNth1Xt1 + gt12L*(4*Gt111*Gt212*gtu21 + 2*Gt211*Gt222*gtu21 + 2*Gt212*Gt222*gtu22 + - 4*Gt113*Gt211*gtu31 + 4*Gt113*Gt212*gtu32 + 4*Gt113*Gt213*gtu33 + PDstandardNth1Xt2) + - gt13L*(4*Gt111*Gt312*gtu21 + 2*Gt212*Gt312*gtu21 + 4*Gt112*Gt312*gtu22 + 4*Gt113*Gt311*gtu31 + - 4*Gt113*Gt312*gtu32 + 4*Gt113*Gt313*gtu33 + PDstandardNth1Xt3) - gtu22*khalf*PDstandardNth22gt11 - + Gt133 = khalf*(-(gtu11*PDstandardNth1gt33) - gtu21*PDstandardNth2gt33 + + 2*gtu11*PDstandardNth3gt13 + 2*gtu21*PDstandardNth3gt23 + + gtu31*PDstandardNth3gt33); + + Gt233 = khalf*(-(gtu21*PDstandardNth1gt33) - gtu22*PDstandardNth2gt33 + + 2*gtu21*PDstandardNth3gt13 + 2*gtu22*PDstandardNth3gt23 + + gtu32*PDstandardNth3gt33); + + Gt333 = khalf*(-(gtu31*PDstandardNth1gt33) - gtu32*PDstandardNth2gt33 + + 2*gtu31*PDstandardNth3gt13 + 2*gtu32*PDstandardNth3gt23 + + gtu33*PDstandardNth3gt33); + + Xtn1 = Gt111*gtu11 + Gt122*gtu22 + + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33; + + Xtn2 = Gt211*gtu11 + Gt222*gtu22 + + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33; + + Xtn3 = Gt311*gtu11 + Gt322*gtu22 + + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33; + + Rt11 = -(gtu11*khalf*PDstandardNth11gt11) + + gtu21*(2*Gt211*Gt212*gt22L + 4*Gt112*gt13L*Gt311 + 2*Gt113*gt11L*Gt312 + + 2*gt13L*Gt312*Gt313 + 2*gt13L*Gt211*Gt322 + 2*gt13L*Gt311*Gt323 + + 2*Gt311*Gt312*gt33L - PDstandardNth12gt11) - gtu31*PDstandardNth13gt11 + + gt11L*PDstandardNth1Xt1 + gt12L* + (4*Gt111*Gt212*gtu21 + 2*Gt211*Gt222*gtu21 + 2*Gt212*Gt222*gtu22 + + 4*Gt113*Gt211*gtu31 + 4*Gt113*Gt212*gtu32 + 4*Gt113*Gt213*gtu33 + + PDstandardNth1Xt2) + gt13L* + (4*Gt111*Gt312*gtu21 + 2*Gt212*Gt312*gtu21 + 4*Gt112*Gt312*gtu22 + + 4*Gt113*Gt311*gtu31 + 4*Gt113*Gt312*gtu32 + 4*Gt113*Gt313*gtu33 + + PDstandardNth1Xt3) - gtu22*khalf*PDstandardNth22gt11 - gtu32*PDstandardNth23gt11 - gtu33*khalf*PDstandardNth33gt11 + Gt111*(6*Gt113*gt11L*gtu31 + 4*gt12L*Gt213*gtu31 + gt11L*Xtn1) + - Gt211*(2*Gt112*gt11L*gtu11 + 4*Gt111*gt12L*gtu11 + 2*gt11L*Gt122*gtu21 + 2*gt11L*Gt123*gtu31 + gt12L*Xtn1) + - Gt311*(4*Gt111*gt13L*gtu11 + 2*gt12L*Gt213*gtu11 + 2*gt13L*Gt313*gtu11 + 2*gt11L*Gt123*gtu21 + - 2*gt11L*Gt133*gtu31 + gt13L*Xtn1) + gt12L*Gt212*Xtn2 + gt13L*Gt312*Xtn2 + - Gt112*(6*Gt111*gt11L*gtu21 + 4*gt12L*Gt211*gtu21 + 4*gt12L*Gt212*gtu22 + 2*gt11L*Gt213*gtu31 + - 6*Gt113*gt11L*gtu32 + gt11L*Xtn2) + Gt113*gt11L*Xtn3 + - Gt213*(2*gt11L*Gt122*gtu32 + 4*Gt112*gt12L*gtu32 + 2*gt11L*Gt123*gtu33 + gt12L*Xtn3) + - Gt313*(4*Gt111*gt13L*gtu31 + 2*gt12L*Gt213*gtu31 + 2*gt11L*Gt123*gtu32 + 4*Gt112*gt13L*gtu32 + - 2*gt12L*Gt223*gtu32 + 2*gt11L*Gt133*gtu33 + gt13L*Xtn3) + 3*gt11L*gtu11*SQR(Gt111) + 3*gt11L*gtu22*SQR(Gt112) + - 3*gt11L*gtu33*SQR(Gt113) + gt22L*gtu11*SQR(Gt211) + gt22L*gtu22*SQR(Gt212) + - 2*(gt12L*Gt211*Gt212*gtu11 + Gt113*gt11L*Gt311*gtu11 + Gt211*gt23L*Gt311*gtu11 + gt13L*Gt211*Gt312*gtu11 + - Gt112*gt11L*Gt212*gtu21 + gt12L*Gt223*Gt311*gtu21 + Gt212*gt23L*Gt311*gtu21 + gt12L*Gt213*Gt312*gtu21 + - Gt211*gt23L*Gt312*gtu21 + gt11L*Gt122*Gt212*gtu22 + gt11L*Gt123*Gt312*gtu22 + gt12L*Gt223*Gt312*gtu22 + - Gt212*gt23L*Gt312*gtu22 + gt13L*Gt212*Gt322*gtu22 + gt13L*Gt312*Gt323*gtu22 + gt12L*Gt212*Gt213*gtu31 + - gt12L*Gt211*Gt223*gtu31 + Gt211*Gt213*gt22L*gtu31 + gt12L*Gt233*Gt311*gtu31 + Gt213*gt23L*Gt311*gtu31 + - gt13L*Gt213*Gt312*gtu31 + Gt113*gt11L*Gt313*gtu31 + Gt211*gt23L*Gt313*gtu31 + gt13L*Gt211*Gt323*gtu31 + - gt13L*Gt311*Gt333*gtu31 + Gt311*Gt313*gt33L*gtu31 + gt11L*Gt123*Gt212*gtu32 + gt12L*Gt213*Gt222*gtu32 + - gt12L*Gt212*Gt223*gtu32 + Gt212*Gt213*gt22L*gtu32 + gt11L*Gt133*Gt312*gtu32 + gt12L*Gt233*Gt312*gtu32 + - Gt213*gt23L*Gt312*gtu32 + Gt212*gt23L*Gt313*gtu32 + gt13L*Gt213*Gt322*gtu32 + gt13L*Gt212*Gt323*gtu32 + - gt13L*Gt313*Gt323*gtu32 + gt13L*Gt312*Gt333*gtu32 + Gt312*Gt313*gt33L*gtu32 + gt12L*Gt213*Gt223*gtu33 + - gt12L*Gt233*Gt313*gtu33 + Gt213*gt23L*Gt313*gtu33 + gt13L*Gt213*Gt323*gtu33 + gt13L*Gt313*Gt333*gtu33 + - gt12L*gtu21*SQR(Gt212)) + gt22L*gtu33*SQR(Gt213) + gt33L*gtu11*SQR(Gt311) + gt33L*gtu22*SQR(Gt312) + + Gt211*(2*Gt112*gt11L*gtu11 + 4*Gt111*gt12L*gtu11 + 2*gt11L*Gt122*gtu21 + + 2*gt11L*Gt123*gtu31 + gt12L*Xtn1) + + Gt311*(4*Gt111*gt13L*gtu11 + 2*gt12L*Gt213*gtu11 + 2*gt13L*Gt313*gtu11 + + 2*gt11L*Gt123*gtu21 + 2*gt11L*Gt133*gtu31 + gt13L*Xtn1) + + gt12L*Gt212*Xtn2 + gt13L*Gt312*Xtn2 + + Gt112*(6*Gt111*gt11L*gtu21 + 4*gt12L*Gt211*gtu21 + 4*gt12L*Gt212*gtu22 + + 2*gt11L*Gt213*gtu31 + 6*Gt113*gt11L*gtu32 + gt11L*Xtn2) + + Gt113*gt11L*Xtn3 + Gt213*(2*gt11L*Gt122*gtu32 + 4*Gt112*gt12L*gtu32 + + 2*gt11L*Gt123*gtu33 + gt12L*Xtn3) + + Gt313*(4*Gt111*gt13L*gtu31 + 2*gt12L*Gt213*gtu31 + 2*gt11L*Gt123*gtu32 + + 4*Gt112*gt13L*gtu32 + 2*gt12L*Gt223*gtu32 + 2*gt11L*Gt133*gtu33 + + gt13L*Xtn3) + 3*gt11L*gtu11*SQR(Gt111) + 3*gt11L*gtu22*SQR(Gt112) + + 3*gt11L*gtu33*SQR(Gt113) + gt22L*gtu11*SQR(Gt211) + + gt22L*gtu22*SQR(Gt212) + 2*(gt12L*Gt211*Gt212*gtu11 + + Gt113*gt11L*Gt311*gtu11 + Gt211*gt23L*Gt311*gtu11 + + gt13L*Gt211*Gt312*gtu11 + Gt112*gt11L*Gt212*gtu21 + + gt12L*Gt223*Gt311*gtu21 + Gt212*gt23L*Gt311*gtu21 + + gt12L*Gt213*Gt312*gtu21 + Gt211*gt23L*Gt312*gtu21 + + gt11L*Gt122*Gt212*gtu22 + gt11L*Gt123*Gt312*gtu22 + + gt12L*Gt223*Gt312*gtu22 + Gt212*gt23L*Gt312*gtu22 + + gt13L*Gt212*Gt322*gtu22 + gt13L*Gt312*Gt323*gtu22 + + gt12L*Gt212*Gt213*gtu31 + gt12L*Gt211*Gt223*gtu31 + + Gt211*Gt213*gt22L*gtu31 + gt12L*Gt233*Gt311*gtu31 + + Gt213*gt23L*Gt311*gtu31 + gt13L*Gt213*Gt312*gtu31 + + Gt113*gt11L*Gt313*gtu31 + Gt211*gt23L*Gt313*gtu31 + + gt13L*Gt211*Gt323*gtu31 + gt13L*Gt311*Gt333*gtu31 + + Gt311*Gt313*gt33L*gtu31 + gt11L*Gt123*Gt212*gtu32 + + gt12L*Gt213*Gt222*gtu32 + gt12L*Gt212*Gt223*gtu32 + + Gt212*Gt213*gt22L*gtu32 + gt11L*Gt133*Gt312*gtu32 + + gt12L*Gt233*Gt312*gtu32 + Gt213*gt23L*Gt312*gtu32 + + Gt212*gt23L*Gt313*gtu32 + gt13L*Gt213*Gt322*gtu32 + + gt13L*Gt212*Gt323*gtu32 + gt13L*Gt313*Gt323*gtu32 + + gt13L*Gt312*Gt333*gtu32 + Gt312*Gt313*gt33L*gtu32 + + gt12L*Gt213*Gt223*gtu33 + gt12L*Gt233*Gt313*gtu33 + + Gt213*gt23L*Gt313*gtu33 + gt13L*Gt213*Gt323*gtu33 + + gt13L*Gt313*Gt333*gtu33 + gt12L*gtu21*SQR(Gt212)) + + gt22L*gtu33*SQR(Gt213) + gt33L*gtu11*SQR(Gt311) + gt33L*gtu22*SQR(Gt312) + 2*gt13L*gtu31*SQR(Gt313) + gt33L*gtu33*SQR(Gt313); - Rt12 = khalf*(-(gtu11*PDstandardNth11gt12) - 2*gtu21*PDstandardNth12gt12 - 2*gtu31*PDstandardNth13gt12 + - gt12L*PDstandardNth1Xt1 + gt22L*PDstandardNth1Xt2 + gt23L*PDstandardNth1Xt3 - gtu22*PDstandardNth22gt12 - - 2*gtu32*PDstandardNth23gt12 + gt11L*PDstandardNth2Xt1 + gt12L*PDstandardNth2Xt2 + gt13L*PDstandardNth2Xt3 - - gtu33*PDstandardNth33gt12 + (Gt111*gt12L + Gt211*gt22L + gt23L*Gt311)*Xtn1 + - (Gt112*gt11L + gt12L*Gt212 + gt13L*Gt312)*Xtn1 + (Gt112*gt12L + Gt212*gt22L + gt23L*Gt312)*Xtn2 + - (gt11L*Gt122 + gt12L*Gt222 + gt13L*Gt322)*Xtn2 + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313)*Xtn3 + + Rt12 = khalf*(-(gtu11*PDstandardNth11gt12) - 2*gtu21*PDstandardNth12gt12 - + 2*gtu31*PDstandardNth13gt12 + gt12L*PDstandardNth1Xt1 + + gt22L*PDstandardNth1Xt2 + gt23L*PDstandardNth1Xt3 - + gtu22*PDstandardNth22gt12 - 2*gtu32*PDstandardNth23gt12 + + gt11L*PDstandardNth2Xt1 + gt12L*PDstandardNth2Xt2 + + gt13L*PDstandardNth2Xt3 - gtu33*PDstandardNth33gt12 + + (Gt111*gt12L + Gt211*gt22L + gt23L*Gt311)*Xtn1 + + (Gt112*gt11L + gt12L*Gt212 + gt13L*Gt312)*Xtn1 + + (Gt112*gt12L + Gt212*gt22L + gt23L*Gt312)*Xtn2 + + (gt11L*Gt122 + gt12L*Gt222 + gt13L*Gt322)*Xtn2 + + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313)*Xtn3 + (gt11L*Gt123 + gt12L*Gt223 + gt13L*Gt323)*Xtn3 + - 2*gtu21*(Gt112*gt11L*Gt222 + Gt112*Gt211*gt22L + Gt211*Gt222*gt22L + 2*Gt122*gt13L*Gt311 + Gt112*gt23L*Gt311 + - Gt222*gt23L*Gt311 + gt13L*Gt222*Gt312 + Gt213*gt22L*Gt312 + Gt212*gt23L*Gt312 + gt23L*Gt312*Gt313 + - Gt113*gt11L*Gt322 + Gt211*gt23L*Gt322 + gt13L*Gt313*Gt322 + - Gt111*(2*gt11L*Gt122 + Gt112*gt12L + gt12L*Gt222 + gt13L*Gt322) + - gt12L*(2*Gt122*Gt211 + Gt112*Gt212 + Gt212*Gt222 + Gt113*Gt312 + Gt213*Gt322) + Gt311*Gt322*gt33L + - gt22L*SQR(Gt212)) + 2*((Gt123*gt12L*Gt211 + Gt113*gt12L*Gt212 + 2*Gt112*gt12L*Gt213 + gt12L*Gt212*Gt223 + - Gt212*Gt213*gt22L + Gt211*Gt223*gt22L + gt12L*Gt133*Gt311 + gt22L*Gt233*Gt311 + Gt113*gt13L*Gt312 + - gt12L*Gt233*Gt312 + Gt213*gt23L*Gt312 + gt11L*(2*Gt112*Gt113 + Gt123*Gt212 + Gt133*Gt312) + - 2*Gt112*gt13L*Gt313 + Gt212*gt23L*Gt313 + Gt111*(Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + - gt13L*Gt212*Gt323 + Gt211*gt23L*Gt323 + gt23L*Gt311*Gt333 + gt13L*Gt312*Gt333 + Gt312*Gt313*gt33L)*gtu31 + - (Gt123*gt12L*Gt212 + 2*Gt122*gt12L*Gt213 + Gt113*gt12L*Gt222 + gt12L*Gt222*Gt223 + Gt213*Gt222*gt22L + - Gt212*Gt223*gt22L + gt12L*Gt133*Gt312 + gt22L*Gt233*Gt312 + 2*Gt122*gt13L*Gt313 + Gt222*gt23L*Gt313 + - Gt112*(Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + Gt113*gt13L*Gt322 + gt12L*Gt233*Gt322 + - Gt213*gt23L*Gt322 + gt11L*(2*Gt113*Gt122 + Gt123*Gt222 + Gt133*Gt322) + gt13L*Gt222*Gt323 + - Gt212*gt23L*Gt323 + gt23L*Gt312*Gt333 + gt13L*Gt322*Gt333 + Gt313*Gt322*gt33L)*gtu32 + - gtu11*(3*Gt112*gt12L*Gt211 + 2*Gt211*Gt212*gt22L + Gt113*gt12L*Gt311 + 2*Gt112*gt13L*Gt311 + - Gt213*gt22L*Gt311 + Gt212*gt23L*Gt311 + gt13L*Gt212*Gt312 + gt12L*Gt213*Gt312 + 2*Gt211*gt23L*Gt312 + + 2*gtu21*(Gt112*gt11L*Gt222 + Gt112*Gt211*gt22L + Gt211*Gt222*gt22L + + 2*Gt122*gt13L*Gt311 + Gt112*gt23L*Gt311 + Gt222*gt23L*Gt311 + + gt13L*Gt222*Gt312 + Gt213*gt22L*Gt312 + Gt212*gt23L*Gt312 + + gt23L*Gt312*Gt313 + Gt113*gt11L*Gt322 + Gt211*gt23L*Gt322 + + gt13L*Gt313*Gt322 + Gt111* + (2*gt11L*Gt122 + Gt112*gt12L + gt12L*Gt222 + gt13L*Gt322) + + gt12L*(2*Gt122*Gt211 + Gt112*Gt212 + Gt212*Gt222 + Gt113*Gt312 + + Gt213*Gt322) + Gt311*Gt322*gt33L + gt22L*SQR(Gt212)) + + 2*((Gt123*gt12L*Gt211 + Gt113*gt12L*Gt212 + 2*Gt112*gt12L*Gt213 + + gt12L*Gt212*Gt223 + Gt212*Gt213*gt22L + Gt211*Gt223*gt22L + + gt12L*Gt133*Gt311 + gt22L*Gt233*Gt311 + Gt113*gt13L*Gt312 + + gt12L*Gt233*Gt312 + Gt213*gt23L*Gt312 + + gt11L*(2*Gt112*Gt113 + Gt123*Gt212 + Gt133*Gt312) + + 2*Gt112*gt13L*Gt313 + Gt212*gt23L*Gt313 + + Gt111*(Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + + gt13L*Gt212*Gt323 + Gt211*gt23L*Gt323 + gt23L*Gt311*Gt333 + + gt13L*Gt312*Gt333 + Gt312*Gt313*gt33L)*gtu31 + + (Gt123*gt12L*Gt212 + 2*Gt122*gt12L*Gt213 + Gt113*gt12L*Gt222 + + gt12L*Gt222*Gt223 + Gt213*Gt222*gt22L + Gt212*Gt223*gt22L + + gt12L*Gt133*Gt312 + gt22L*Gt233*Gt312 + 2*Gt122*gt13L*Gt313 + + Gt222*gt23L*Gt313 + Gt112* + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + Gt113*gt13L*Gt322 + + gt12L*Gt233*Gt322 + Gt213*gt23L*Gt322 + + gt11L*(2*Gt113*Gt122 + Gt123*Gt222 + Gt133*Gt322) + + gt13L*Gt222*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt312*Gt333 + + gt13L*Gt322*Gt333 + Gt313*Gt322*gt33L)*gtu32 + + gtu11*(3*Gt112*gt12L*Gt211 + 2*Gt211*Gt212*gt22L + Gt113*gt12L*Gt311 + + 2*Gt112*gt13L*Gt311 + Gt213*gt22L*Gt311 + Gt212*gt23L*Gt311 + + gt13L*Gt212*Gt312 + gt12L*Gt213*Gt312 + 2*Gt211*gt23L*Gt312 + gt11L*(2*Gt111*Gt112 + Gt112*Gt212 + Gt113*Gt312) + - Gt111*(gt12L*Gt212 + Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + gt23L*Gt311*Gt313 + gt13L*Gt312*Gt313 + - Gt311*Gt312*gt33L + gt12L*SQR(Gt111) + gt12L*SQR(Gt212))) + - 2*gtu22*(gt11L*Gt122*Gt222 + 2*Gt212*Gt222*gt22L + 2*Gt122*gt13L*Gt312 + Gt223*gt22L*Gt312 + Gt222*gt23L*Gt312 + - gt11L*Gt123*Gt322 + gt13L*Gt222*Gt322 + 2*Gt212*gt23L*Gt322 + - Gt112*(2*gt11L*Gt122 + gt12L*Gt222 + Gt212*gt22L + gt23L*Gt312 + gt13L*Gt322) + gt23L*Gt312*Gt323 + - gt13L*Gt322*Gt323 + Gt312*Gt322*gt33L + gt12L*SQR(Gt112) + + Gt111*(gt12L*Gt212 + Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + + gt23L*Gt311*Gt313 + gt13L*Gt312*Gt313 + Gt311*Gt312*gt33L + + gt12L*SQR(Gt111) + gt12L*SQR(Gt212))) + + 2*gtu22*(gt11L*Gt122*Gt222 + 2*Gt212*Gt222*gt22L + 2*Gt122*gt13L*Gt312 + + Gt223*gt22L*Gt312 + Gt222*gt23L*Gt312 + gt11L*Gt123*Gt322 + + gt13L*Gt222*Gt322 + 2*Gt212*gt23L*Gt322 + + Gt112*(2*gt11L*Gt122 + gt12L*Gt222 + Gt212*gt22L + gt23L*Gt312 + + gt13L*Gt322) + gt23L*Gt312*Gt323 + gt13L*Gt322*Gt323 + + Gt312*Gt322*gt33L + gt12L*SQR(Gt112) + gt12L*(3*Gt122*Gt212 + Gt123*Gt312 + Gt223*Gt322 + SQR(Gt222))) + - 2*gtu33*(gt11L*Gt123*Gt223 + 2*Gt213*Gt223*gt22L + 2*Gt123*gt13L*Gt313 + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + - gt11L*Gt133*Gt323 + gt13L*Gt223*Gt323 + 2*Gt213*gt23L*Gt323 + - Gt113*(2*gt11L*Gt123 + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + gt13L*Gt323) + gt23L*Gt313*Gt333 + - gt13L*Gt323*Gt333 + Gt313*Gt323*gt33L + gt12L*SQR(Gt113) + + 2*gtu33*(gt11L*Gt123*Gt223 + 2*Gt213*Gt223*gt22L + 2*Gt123*gt13L*Gt313 + + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + gt11L*Gt133*Gt323 + + gt13L*Gt223*Gt323 + 2*Gt213*gt23L*Gt323 + + Gt113*(2*gt11L*Gt123 + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + + gt13L*Gt323) + gt23L*Gt313*Gt333 + gt13L*Gt323*Gt333 + + Gt313*Gt323*gt33L + gt12L*SQR(Gt113) + gt12L*(3*Gt123*Gt213 + Gt133*Gt313 + Gt233*Gt323 + SQR(Gt223))) + - 2*gtu21*(Gt122*gt12L*Gt211 + 3*Gt112*gt12L*Gt212 + gt12L*Gt212*Gt222 + Gt211*Gt222*gt22L + Gt123*gt12L*Gt311 + - Gt223*gt22L*Gt311 + 3*Gt112*gt13L*Gt312 + gt12L*Gt223*Gt312 + 2*Gt212*gt23L*Gt312 + - Gt111*(Gt112*gt12L + Gt212*gt22L + gt23L*Gt312) + gt13L*Gt212*Gt322 + Gt211*gt23L*Gt322 + gt23L*Gt311*Gt323 + - gt13L*Gt312*Gt323 + gt11L*(Gt122*Gt212 + Gt123*Gt312 + 2*SQR(Gt112)) + gt22L*SQR(Gt212) + gt33L*SQR(Gt312)) + - 2*gtu31*(Gt112*gt11L*Gt223 + Gt113*Gt211*gt22L + Gt212*Gt213*gt22L + Gt211*Gt223*gt22L + 2*Gt123*gt13L*Gt311 + - Gt113*gt23L*Gt311 + Gt223*gt23L*Gt311 + gt13L*Gt223*Gt312 + Gt213*gt23L*Gt312 + Gt213*gt22L*Gt313 + - Gt113*gt11L*Gt323 + Gt211*gt23L*Gt323 + gt13L*Gt313*Gt323 + - Gt111*(2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + - gt12L*(2*Gt123*Gt211 + Gt112*Gt213 + Gt212*Gt223 + Gt113*Gt313 + Gt213*Gt323) + Gt311*Gt323*gt33L + - gt23L*SQR(Gt313)) + 2*gtu32*(gt11L*Gt122*Gt223 + Gt113*Gt212*gt22L + Gt213*Gt222*gt22L + Gt212*Gt223*gt22L + - 2*Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + Gt223*gt23L*Gt312 + Gt223*gt22L*Gt313 + gt13L*Gt223*Gt322 + - Gt213*gt23L*Gt322 + gt11L*Gt123*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt313*Gt323 + - Gt112*(2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + - gt12L*(Gt122*Gt213 + Gt123*(2*Gt212 + Gt313) + Gt223*(Gt222 + Gt323)) + Gt312*Gt323*gt33L + gt13L*SQR(Gt323))); - - Rt13 = khalf*(-(gtu11*PDstandardNth11gt13) - 2*gtu21*PDstandardNth12gt13 - 2*gtu31*PDstandardNth13gt13 + - gt13L*PDstandardNth1Xt1 + gt23L*PDstandardNth1Xt2 + gt33L*PDstandardNth1Xt3 - gtu22*PDstandardNth22gt13 - - 2*gtu32*PDstandardNth23gt13 - gtu33*PDstandardNth33gt13 + gt11L*PDstandardNth3Xt1 + gt12L*PDstandardNth3Xt2 + - gt13L*PDstandardNth3Xt3 + (Gt113*gt11L + gt12L*Gt213 + gt13L*Gt313)*Xtn1 + - (Gt111*gt13L + Gt211*gt23L + Gt311*gt33L)*Xtn1 + (gt11L*Gt123 + gt12L*Gt223 + gt13L*Gt323)*Xtn2 + - (Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)*Xtn2 + (gt11L*Gt133 + gt12L*Gt233 + gt13L*Gt333)*Xtn3 + + 2*gtu21*(Gt122*gt12L*Gt211 + 3*Gt112*gt12L*Gt212 + gt12L*Gt212*Gt222 + + Gt211*Gt222*gt22L + Gt123*gt12L*Gt311 + Gt223*gt22L*Gt311 + + 3*Gt112*gt13L*Gt312 + gt12L*Gt223*Gt312 + 2*Gt212*gt23L*Gt312 + + Gt111*(Gt112*gt12L + Gt212*gt22L + gt23L*Gt312) + gt13L*Gt212*Gt322 + + Gt211*gt23L*Gt322 + gt23L*Gt311*Gt323 + gt13L*Gt312*Gt323 + + gt11L*(Gt122*Gt212 + Gt123*Gt312 + 2*SQR(Gt112)) + gt22L*SQR(Gt212) + + gt33L*SQR(Gt312)) + 2*gtu31* + (Gt112*gt11L*Gt223 + Gt113*Gt211*gt22L + Gt212*Gt213*gt22L + + Gt211*Gt223*gt22L + 2*Gt123*gt13L*Gt311 + Gt113*gt23L*Gt311 + + Gt223*gt23L*Gt311 + gt13L*Gt223*Gt312 + Gt213*gt23L*Gt312 + + Gt213*gt22L*Gt313 + Gt113*gt11L*Gt323 + Gt211*gt23L*Gt323 + + gt13L*Gt313*Gt323 + Gt111* + (2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + + gt12L*(2*Gt123*Gt211 + Gt112*Gt213 + Gt212*Gt223 + Gt113*Gt313 + + Gt213*Gt323) + Gt311*Gt323*gt33L + gt23L*SQR(Gt313)) + + 2*gtu32*(gt11L*Gt122*Gt223 + Gt113*Gt212*gt22L + Gt213*Gt222*gt22L + + Gt212*Gt223*gt22L + 2*Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + + Gt223*gt23L*Gt312 + Gt223*gt22L*Gt313 + gt13L*Gt223*Gt322 + + Gt213*gt23L*Gt322 + gt11L*Gt123*Gt323 + Gt212*gt23L*Gt323 + + gt23L*Gt313*Gt323 + Gt112* + (2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + + gt12L*(Gt122*Gt213 + Gt123*(2*Gt212 + Gt313) + + Gt223*(Gt222 + Gt323)) + Gt312*Gt323*gt33L + gt13L*SQR(Gt323))); + + Rt13 = khalf*(-(gtu11*PDstandardNth11gt13) - 2*gtu21*PDstandardNth12gt13 - + 2*gtu31*PDstandardNth13gt13 + gt13L*PDstandardNth1Xt1 + + gt23L*PDstandardNth1Xt2 + gt33L*PDstandardNth1Xt3 - + gtu22*PDstandardNth22gt13 - 2*gtu32*PDstandardNth23gt13 - + gtu33*PDstandardNth33gt13 + gt11L*PDstandardNth3Xt1 + + gt12L*PDstandardNth3Xt2 + gt13L*PDstandardNth3Xt3 + + (Gt113*gt11L + gt12L*Gt213 + gt13L*Gt313)*Xtn1 + + (Gt111*gt13L + Gt211*gt23L + Gt311*gt33L)*Xtn1 + + (gt11L*Gt123 + gt12L*Gt223 + gt13L*Gt323)*Xtn2 + + (Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)*Xtn2 + + (gt11L*Gt133 + gt12L*Gt233 + gt13L*Gt333)*Xtn3 + (Gt113*gt13L + Gt213*gt23L + Gt313*gt33L)*Xtn3 + - 2*((Gt122*gt13L*Gt211 + 2*Gt113*gt12L*Gt212 + Gt112*gt12L*Gt213 + gt12L*Gt213*Gt222 + Gt212*Gt213*gt22L + - Gt211*Gt222*gt23L + Gt123*gt13L*Gt311 + Gt223*gt23L*Gt311 + 2*Gt113*gt13L*Gt312 + Gt213*gt23L*Gt312 + - Gt112*gt13L*Gt313 + gt12L*Gt223*Gt313 + Gt212*gt23L*Gt313 + - gt11L*(2*Gt112*Gt113 + Gt122*Gt213 + Gt123*Gt313) + gt13L*Gt213*Gt322 + gt13L*Gt313*Gt323 + - Gt312*Gt313*gt33L + Gt211*Gt322*gt33L + Gt311*Gt323*gt33L + Gt111*(Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)) - *gtu21 + (Gt122*gt13L*Gt213 + gt11L*Gt122*Gt233 + Gt212*gt22L*Gt233 + Gt113*Gt212*gt23L + - Gt213*Gt222*gt23L + 2*Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + - gt13L*Gt233*Gt322 + gt11L*Gt123*Gt333 + Gt212*gt23L*Gt333 + gt13L*Gt323*Gt333 + + 2*((Gt122*gt13L*Gt211 + 2*Gt113*gt12L*Gt212 + Gt112*gt12L*Gt213 + + gt12L*Gt213*Gt222 + Gt212*Gt213*gt22L + Gt211*Gt222*gt23L + + Gt123*gt13L*Gt311 + Gt223*gt23L*Gt311 + 2*Gt113*gt13L*Gt312 + + Gt213*gt23L*Gt312 + Gt112*gt13L*Gt313 + gt12L*Gt223*Gt313 + + Gt212*gt23L*Gt313 + gt11L* + (2*Gt112*Gt113 + Gt122*Gt213 + Gt123*Gt313) + gt13L*Gt213*Gt322 + + gt13L*Gt313*Gt323 + Gt312*Gt313*gt33L + Gt211*Gt322*gt33L + + Gt311*Gt323*gt33L + Gt111*(Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)) + *gtu21 + (Gt122*gt13L*Gt213 + gt11L*Gt122*Gt233 + + Gt212*gt22L*Gt233 + Gt113*Gt212*gt23L + Gt213*Gt222*gt23L + + 2*Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + Gt123*gt13L*Gt313 + + Gt223*gt23L*Gt313 + gt13L*Gt233*Gt322 + gt11L*Gt123*Gt333 + + Gt212*gt23L*Gt333 + gt13L*Gt323*Gt333 + Gt112*(2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + - gt12L*(2*Gt133*Gt212 + Gt222*Gt233 + Gt223*Gt333) + Gt113*Gt312*gt33L + Gt213*Gt322*gt33L + - Gt313*Gt323*gt33L + Gt312*Gt333*gt33L)*gtu32 + - gtu21*(2*Gt123*gt12L*Gt211 + Gt112*gt13L*Gt212 + gt12L*Gt212*Gt223 + Gt211*Gt223*gt22L + Gt112*Gt211*gt23L + - 2*Gt123*gt13L*Gt311 + Gt223*gt23L*Gt311 + Gt113*gt13L*Gt312 + gt13L*Gt223*Gt312 + Gt213*gt23L*Gt312 + - gt12L*Gt213*Gt323 + Gt211*gt23L*Gt323 + gt13L*Gt313*Gt323 + - gt11L*(2*Gt111*Gt123 + Gt112*Gt223 + Gt113*Gt323) + Gt111*(Gt112*gt13L + gt12L*Gt223 + gt13L*Gt323) + - Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + Gt312*Gt313*gt33L + Gt311*Gt323*gt33L + gt23L*SQR(Gt212))) + - 2*gtu32*(Gt123*gt13L*Gt212 + 2*Gt123*gt12L*Gt213 + Gt113*gt12L*Gt223 + Gt213*Gt223*gt22L + Gt212*Gt223*gt23L + - Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + 2*Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + Gt113*gt13L*Gt323 + - gt13L*Gt223*Gt323 + gt12L*Gt233*Gt323 + Gt213*gt23L*Gt323 + - gt11L*(2*Gt113*Gt123 + Gt123*Gt223 + Gt133*Gt323) + gt13L*Gt323*Gt333 + Gt212*Gt323*gt33L + - Gt313*Gt323*gt33L + Gt312*Gt333*gt33L + Gt112*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + gt12L*SQR(Gt223)) + - 2*gtu11*(2*Gt113*gt12L*Gt211 + Gt112*gt13L*Gt211 + gt12L*Gt212*Gt213 + Gt211*Gt213*gt22L + Gt211*Gt212*gt23L + - 3*Gt113*gt13L*Gt311 + 2*Gt213*gt23L*Gt311 + gt13L*Gt213*Gt312 + gt12L*Gt213*Gt313 + Gt211*gt23L*Gt313 + - gt11L*(2*Gt111*Gt113 + Gt112*Gt213 + Gt113*Gt313) + Gt211*Gt312*gt33L + 2*Gt311*Gt313*gt33L + - Gt111*(gt12L*Gt213 + Gt211*gt23L + gt13L*Gt313 + Gt311*gt33L) + gt13L*SQR(Gt111) + gt13L*SQR(Gt313)) + - 2*gtu31*(Gt112*gt13L*Gt213 + Gt112*gt11L*Gt233 + Gt211*gt22L*Gt233 + Gt113*Gt211*gt23L + Gt212*Gt213*gt23L + - 2*Gt133*gt13L*Gt311 + Gt233*gt23L*Gt311 + gt13L*Gt233*Gt312 + Gt113*gt13L*Gt313 + Gt213*gt23L*Gt313 + - Gt113*gt11L*Gt333 + Gt211*gt23L*Gt333 + gt13L*Gt313*Gt333 + - Gt111*(2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + - gt12L*(2*Gt133*Gt211 + Gt212*Gt233 + Gt213*Gt333) + Gt113*Gt311*gt33L + Gt213*Gt312*gt33L + - Gt311*Gt333*gt33L + gt33L*SQR(Gt313)) + - 2*gtu31*(Gt123*gt13L*Gt211 + 3*Gt113*gt12L*Gt213 + gt12L*Gt213*Gt223 + Gt211*Gt223*gt23L + Gt133*gt13L*Gt311 + - Gt233*gt23L*Gt311 + 3*Gt113*gt13L*Gt313 + gt12L*Gt233*Gt313 + 2*Gt213*gt23L*Gt313 + gt13L*Gt213*Gt323 + - gt13L*Gt313*Gt333 + Gt211*Gt323*gt33L + Gt311*Gt333*gt33L + Gt111*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + - gt11L*(Gt123*Gt213 + Gt133*Gt313 + 2*SQR(Gt113)) + gt22L*SQR(Gt213) + gt33L*SQR(Gt313)) + - 2*gtu22*(2*Gt123*gt12L*Gt212 + Gt122*gt13L*Gt212 + gt12L*Gt222*Gt223 + Gt212*Gt223*gt22L + Gt212*Gt222*gt23L + - 3*Gt123*gt13L*Gt312 + 2*Gt223*gt23L*Gt312 + gt13L*Gt223*Gt322 + gt12L*Gt223*Gt323 + Gt212*gt23L*Gt323 + - gt11L*(2*Gt112*Gt123 + Gt122*Gt223 + Gt123*Gt323) + Gt212*Gt322*gt33L + 2*Gt312*Gt323*gt33L + - Gt112*(gt12L*Gt223 + Gt212*gt23L + gt13L*Gt323 + Gt312*gt33L) + gt13L*SQR(Gt112) + gt13L*SQR(Gt323)) + - 2*gtu33*(2*gt12L*Gt133*Gt213 + Gt123*gt13L*Gt213 + gt11L*Gt123*Gt233 + gt12L*Gt223*Gt233 + Gt213*gt22L*Gt233 + - Gt213*Gt223*gt23L + 3*Gt133*gt13L*Gt313 + 2*Gt233*gt23L*Gt313 + gt13L*Gt233*Gt323 + gt11L*Gt133*Gt333 + - gt12L*Gt233*Gt333 + Gt213*gt23L*Gt333 + Gt213*Gt323*gt33L + 2*Gt313*Gt333*gt33L + - Gt113*(2*gt11L*Gt133 + gt12L*Gt233 + Gt213*gt23L + gt13L*Gt333 + Gt313*gt33L) + gt13L*SQR(Gt113) + - gt13L*SQR(Gt333))); - - Rt22 = 4*(Gt122*gt12L*Gt212*gtu21 + Gt112*gt12L*Gt222*gtu21 + Gt122*gt12L*Gt222*gtu22 + Gt123*gt12L*Gt212*gtu31 + - Gt123*gt12L*Gt222*gtu32 + Gt123*gt12L*Gt223*gtu33) - gtu11*khalf*PDstandardNth11gt22 + - gtu21*(6*Gt212*Gt222*gt22L + 2*Gt122*gt23L*Gt311 + 2*Gt122*gt13L*Gt312 + 4*Gt222*gt23L*Gt312 + - 2*Gt113*gt12L*Gt322 + 2*gt23L*Gt312*Gt323 + 2*Gt312*Gt322*gt33L - PDstandardNth12gt22) + - gtu31*(6*Gt212*Gt223*gt22L + 2*Gt123*gt13L*Gt312 + 2*Gt112*gt23L*Gt313 + 2*Gt113*gt12L*Gt323 + - 2*gt23L*Gt312*Gt333 + 2*Gt312*Gt323*gt33L - PDstandardNth13gt22) - gtu22*khalf*PDstandardNth22gt22 + - gtu32*(4*Gt122*gt12L*Gt223 + 2*Gt123*Gt212*gt22L + 2*gt12L*Gt133*Gt322 + 4*Gt223*gt23L*Gt322 + - 2*Gt123*gt12L*Gt323 + 4*Gt222*gt23L*Gt323 + 2*gt23L*Gt322*Gt333 + 2*Gt322*Gt323*gt33L - PDstandardNth23gt22) + - gt12L*(2*Gt111*Gt123*gtu31 + 4*Gt112*Gt223*gtu31 + 2*Gt113*Gt122*gtu32 + 2*Gt113*Gt123*gtu33 + PDstandardNth2Xt1) + - gt22L*(2*Gt122*Gt213*gtu32 + 6*Gt222*Gt223*gtu32 + 2*Gt123*Gt213*gtu33 + PDstandardNth2Xt2) + - gt23L*(4*Gt212*Gt322*gtu21 + 2*Gt313*Gt322*gtu21 + 4*Gt222*Gt322*gtu22 + 2*Gt123*Gt311*gtu31 + - 4*Gt212*Gt323*gtu31 + 2*Gt313*Gt323*gtu31 + 2*Gt122*Gt313*gtu32 + 2*Gt123*Gt313*gtu33 + 4*Gt223*Gt323*gtu33 + - 2*Gt323*Gt333*gtu33 + PDstandardNth2Xt3) - gtu33*khalf*PDstandardNth33gt22 + Gt212*gt22L*Xtn1 + - Gt112*(2*Gt111*gt12L*gtu11 + 4*gt12L*Gt212*gtu11 + 2*gt11L*Gt122*gtu21 + 2*Gt122*gt12L*gtu22 + - 2*gt11L*Gt123*gtu31 + 2*Gt123*gt12L*gtu32 + gt12L*Xtn1) + - Gt312*(2*Gt213*gt22L*gtu11 + 4*Gt212*gt23L*gtu11 + 2*gt23L*Gt313*gtu11 + 2*Gt123*gt12L*gtu21 + - 2*Gt122*gt23L*gtu22 + 2*gt12L*Gt133*gtu31 + 2*gt22L*Gt233*gtu31 + 4*Gt223*gt23L*gtu31 + 2*Gt123*gt23L*gtu32 + - gt23L*Xtn1) + Gt122*gt12L*Xtn2 + Gt222*gt22L*Xtn2 + gt23L*Gt322*Xtn2 + Gt123*gt12L*Xtn3 + Gt223*gt22L*Xtn3 + - gt23L*Gt323*Xtn3 + gt11L*gtu11*SQR(Gt112) + 2* - (Gt112*Gt211*gt22L*gtu11 + Gt112*gt23L*Gt311*gtu11 + Gt113*gt12L*Gt312*gtu11 + Gt112*gt13L*Gt312*gtu11 + - Gt111*Gt122*gt12L*gtu21 + Gt122*Gt211*gt22L*gtu21 + Gt112*Gt212*gt22L*gtu21 + Gt223*gt22L*Gt312*gtu21 + - Gt112*gt23L*Gt312*gtu21 + Gt112*gt13L*Gt322*gtu21 + Gt213*gt22L*Gt322*gtu21 + Gt122*Gt212*gt22L*gtu22 + - Gt123*gt12L*Gt322*gtu22 + Gt122*gt13L*Gt322*gtu22 + Gt223*gt22L*Gt322*gtu22 + gt23L*Gt322*Gt323*gtu22 + - Gt112*Gt113*gt12L*gtu31 + Gt123*Gt211*gt22L*gtu31 + Gt112*Gt213*gt22L*gtu31 + Gt112*gt13L*Gt323*gtu31 + - Gt213*gt22L*Gt323*gtu31 + gt11L*Gt122*Gt123*gtu32 + Gt123*gt13L*Gt322*gtu32 + gt22L*Gt233*Gt322*gtu32 + - Gt122*gt13L*Gt323*gtu32 + Gt223*gt22L*Gt323*gtu32 + gt12L*Gt133*Gt323*gtu33 + Gt123*gt13L*Gt323*gtu33 + - gt22L*Gt233*Gt323*gtu33 + gt12L*gtu21*SQR(Gt112)) + gt11L*gtu22*SQR(Gt122) + gt11L*gtu33*SQR(Gt123) + - 3*gt22L*gtu11*SQR(Gt212) + 3*gt22L*gtu22*SQR(Gt222) + 3*gt22L*gtu33*SQR(Gt223) + gt33L*gtu11*SQR(Gt312) + + gt12L*(2*Gt133*Gt212 + Gt222*Gt233 + Gt223*Gt333) + + Gt113*Gt312*gt33L + Gt213*Gt322*gt33L + Gt313*Gt323*gt33L + + Gt312*Gt333*gt33L)*gtu32 + + gtu21*(2*Gt123*gt12L*Gt211 + Gt112*gt13L*Gt212 + gt12L*Gt212*Gt223 + + Gt211*Gt223*gt22L + Gt112*Gt211*gt23L + 2*Gt123*gt13L*Gt311 + + Gt223*gt23L*Gt311 + Gt113*gt13L*Gt312 + gt13L*Gt223*Gt312 + + Gt213*gt23L*Gt312 + gt12L*Gt213*Gt323 + Gt211*gt23L*Gt323 + + gt13L*Gt313*Gt323 + gt11L* + (2*Gt111*Gt123 + Gt112*Gt223 + Gt113*Gt323) + + Gt111*(Gt112*gt13L + gt12L*Gt223 + gt13L*Gt323) + + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + Gt312*Gt313*gt33L + + Gt311*Gt323*gt33L + gt23L*SQR(Gt212))) + + 2*gtu32*(Gt123*gt13L*Gt212 + 2*Gt123*gt12L*Gt213 + Gt113*gt12L*Gt223 + + Gt213*Gt223*gt22L + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + + Gt233*gt23L*Gt312 + 2*Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + + Gt113*gt13L*Gt323 + gt13L*Gt223*Gt323 + gt12L*Gt233*Gt323 + + Gt213*gt23L*Gt323 + gt11L* + (2*Gt113*Gt123 + Gt123*Gt223 + Gt133*Gt323) + gt13L*Gt323*Gt333 + + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L + + Gt112*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + gt12L*SQR(Gt223)) + + 2*gtu11*(2*Gt113*gt12L*Gt211 + Gt112*gt13L*Gt211 + gt12L*Gt212*Gt213 + + Gt211*Gt213*gt22L + Gt211*Gt212*gt23L + 3*Gt113*gt13L*Gt311 + + 2*Gt213*gt23L*Gt311 + gt13L*Gt213*Gt312 + gt12L*Gt213*Gt313 + + Gt211*gt23L*Gt313 + gt11L* + (2*Gt111*Gt113 + Gt112*Gt213 + Gt113*Gt313) + Gt211*Gt312*gt33L + + 2*Gt311*Gt313*gt33L + Gt111* + (gt12L*Gt213 + Gt211*gt23L + gt13L*Gt313 + Gt311*gt33L) + + gt13L*SQR(Gt111) + gt13L*SQR(Gt313)) + + 2*gtu31*(Gt112*gt13L*Gt213 + Gt112*gt11L*Gt233 + Gt211*gt22L*Gt233 + + Gt113*Gt211*gt23L + Gt212*Gt213*gt23L + 2*Gt133*gt13L*Gt311 + + Gt233*gt23L*Gt311 + gt13L*Gt233*Gt312 + Gt113*gt13L*Gt313 + + Gt213*gt23L*Gt313 + Gt113*gt11L*Gt333 + Gt211*gt23L*Gt333 + + gt13L*Gt313*Gt333 + Gt111* + (2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + + gt12L*(2*Gt133*Gt211 + Gt212*Gt233 + Gt213*Gt333) + + Gt113*Gt311*gt33L + Gt213*Gt312*gt33L + Gt311*Gt333*gt33L + + gt33L*SQR(Gt313)) + 2*gtu31* + (Gt123*gt13L*Gt211 + 3*Gt113*gt12L*Gt213 + gt12L*Gt213*Gt223 + + Gt211*Gt223*gt23L + Gt133*gt13L*Gt311 + Gt233*gt23L*Gt311 + + 3*Gt113*gt13L*Gt313 + gt12L*Gt233*Gt313 + 2*Gt213*gt23L*Gt313 + + gt13L*Gt213*Gt323 + gt13L*Gt313*Gt333 + Gt211*Gt323*gt33L + + Gt311*Gt333*gt33L + Gt111*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + + gt11L*(Gt123*Gt213 + Gt133*Gt313 + 2*SQR(Gt113)) + gt22L*SQR(Gt213) + + gt33L*SQR(Gt313)) + 2*gtu22* + (2*Gt123*gt12L*Gt212 + Gt122*gt13L*Gt212 + gt12L*Gt222*Gt223 + + Gt212*Gt223*gt22L + Gt212*Gt222*gt23L + 3*Gt123*gt13L*Gt312 + + 2*Gt223*gt23L*Gt312 + gt13L*Gt223*Gt322 + gt12L*Gt223*Gt323 + + Gt212*gt23L*Gt323 + gt11L* + (2*Gt112*Gt123 + Gt122*Gt223 + Gt123*Gt323) + Gt212*Gt322*gt33L + + 2*Gt312*Gt323*gt33L + Gt112* + (gt12L*Gt223 + Gt212*gt23L + gt13L*Gt323 + Gt312*gt33L) + + gt13L*SQR(Gt112) + gt13L*SQR(Gt323)) + + 2*gtu33*(2*gt12L*Gt133*Gt213 + Gt123*gt13L*Gt213 + gt11L*Gt123*Gt233 + + gt12L*Gt223*Gt233 + Gt213*gt22L*Gt233 + Gt213*Gt223*gt23L + + 3*Gt133*gt13L*Gt313 + 2*Gt233*gt23L*Gt313 + gt13L*Gt233*Gt323 + + gt11L*Gt133*Gt333 + gt12L*Gt233*Gt333 + Gt213*gt23L*Gt333 + + Gt213*Gt323*gt33L + 2*Gt313*Gt333*gt33L + + Gt113*(2*gt11L*Gt133 + gt12L*Gt233 + Gt213*gt23L + gt13L*Gt333 + + Gt313*gt33L) + gt13L*SQR(Gt113) + gt13L*SQR(Gt333))); + + Rt22 = 4*(Gt122*gt12L*Gt212*gtu21 + Gt112*gt12L*Gt222*gtu21 + + Gt122*gt12L*Gt222*gtu22 + Gt123*gt12L*Gt212*gtu31 + + Gt123*gt12L*Gt222*gtu32 + Gt123*gt12L*Gt223*gtu33) - + gtu11*khalf*PDstandardNth11gt22 + + gtu21*(6*Gt212*Gt222*gt22L + 2*Gt122*gt23L*Gt311 + 2*Gt122*gt13L*Gt312 + + 4*Gt222*gt23L*Gt312 + 2*Gt113*gt12L*Gt322 + 2*gt23L*Gt312*Gt323 + + 2*Gt312*Gt322*gt33L - PDstandardNth12gt22) + + gtu31*(6*Gt212*Gt223*gt22L + 2*Gt123*gt13L*Gt312 + 2*Gt112*gt23L*Gt313 + + 2*Gt113*gt12L*Gt323 + 2*gt23L*Gt312*Gt333 + 2*Gt312*Gt323*gt33L - + PDstandardNth13gt22) - gtu22*khalf*PDstandardNth22gt22 + + gtu32*(4*Gt122*gt12L*Gt223 + 2*Gt123*Gt212*gt22L + 2*gt12L*Gt133*Gt322 + + 4*Gt223*gt23L*Gt322 + 2*Gt123*gt12L*Gt323 + 4*Gt222*gt23L*Gt323 + + 2*gt23L*Gt322*Gt333 + 2*Gt322*Gt323*gt33L - PDstandardNth23gt22) + + gt12L*(2*Gt111*Gt123*gtu31 + 4*Gt112*Gt223*gtu31 + 2*Gt113*Gt122*gtu32 + + 2*Gt113*Gt123*gtu33 + PDstandardNth2Xt1) + + gt22L*(2*Gt122*Gt213*gtu32 + 6*Gt222*Gt223*gtu32 + 2*Gt123*Gt213*gtu33 + + PDstandardNth2Xt2) + gt23L* + (4*Gt212*Gt322*gtu21 + 2*Gt313*Gt322*gtu21 + 4*Gt222*Gt322*gtu22 + + 2*Gt123*Gt311*gtu31 + 4*Gt212*Gt323*gtu31 + 2*Gt313*Gt323*gtu31 + + 2*Gt122*Gt313*gtu32 + 2*Gt123*Gt313*gtu33 + 4*Gt223*Gt323*gtu33 + + 2*Gt323*Gt333*gtu33 + PDstandardNth2Xt3) - + gtu33*khalf*PDstandardNth33gt22 + Gt212*gt22L*Xtn1 + + Gt112*(2*Gt111*gt12L*gtu11 + 4*gt12L*Gt212*gtu11 + 2*gt11L*Gt122*gtu21 + + 2*Gt122*gt12L*gtu22 + 2*gt11L*Gt123*gtu31 + 2*Gt123*gt12L*gtu32 + + gt12L*Xtn1) + Gt312*(2*Gt213*gt22L*gtu11 + 4*Gt212*gt23L*gtu11 + + 2*gt23L*Gt313*gtu11 + 2*Gt123*gt12L*gtu21 + 2*Gt122*gt23L*gtu22 + + 2*gt12L*Gt133*gtu31 + 2*gt22L*Gt233*gtu31 + 4*Gt223*gt23L*gtu31 + + 2*Gt123*gt23L*gtu32 + gt23L*Xtn1) + Gt122*gt12L*Xtn2 + + Gt222*gt22L*Xtn2 + gt23L*Gt322*Xtn2 + Gt123*gt12L*Xtn3 + Gt223*gt22L*Xtn3 + + gt23L*Gt323*Xtn3 + gt11L*gtu11*SQR(Gt112) + + 2*(Gt112*Gt211*gt22L*gtu11 + Gt112*gt23L*Gt311*gtu11 + + Gt113*gt12L*Gt312*gtu11 + Gt112*gt13L*Gt312*gtu11 + + Gt111*Gt122*gt12L*gtu21 + Gt122*Gt211*gt22L*gtu21 + + Gt112*Gt212*gt22L*gtu21 + Gt223*gt22L*Gt312*gtu21 + + Gt112*gt23L*Gt312*gtu21 + Gt112*gt13L*Gt322*gtu21 + + Gt213*gt22L*Gt322*gtu21 + Gt122*Gt212*gt22L*gtu22 + + Gt123*gt12L*Gt322*gtu22 + Gt122*gt13L*Gt322*gtu22 + + Gt223*gt22L*Gt322*gtu22 + gt23L*Gt322*Gt323*gtu22 + + Gt112*Gt113*gt12L*gtu31 + Gt123*Gt211*gt22L*gtu31 + + Gt112*Gt213*gt22L*gtu31 + Gt112*gt13L*Gt323*gtu31 + + Gt213*gt22L*Gt323*gtu31 + gt11L*Gt122*Gt123*gtu32 + + Gt123*gt13L*Gt322*gtu32 + gt22L*Gt233*Gt322*gtu32 + + Gt122*gt13L*Gt323*gtu32 + Gt223*gt22L*Gt323*gtu32 + + gt12L*Gt133*Gt323*gtu33 + Gt123*gt13L*Gt323*gtu33 + + gt22L*Gt233*Gt323*gtu33 + gt12L*gtu21*SQR(Gt112)) + + gt11L*gtu22*SQR(Gt122) + gt11L*gtu33*SQR(Gt123) + + 3*gt22L*gtu11*SQR(Gt212) + 3*gt22L*gtu22*SQR(Gt222) + + 3*gt22L*gtu33*SQR(Gt223) + gt33L*gtu11*SQR(Gt312) + gt33L*gtu22*SQR(Gt322) + 2*gt23L*gtu32*SQR(Gt323) + gt33L*gtu33*SQR(Gt323); - Rt23 = khalf*(-(gtu11*PDstandardNth11gt23) - 2*gtu21*PDstandardNth12gt23 - 2*gtu31*PDstandardNth13gt23 - - gtu22*PDstandardNth22gt23 - 2*gtu32*PDstandardNth23gt23 + gt13L*PDstandardNth2Xt1 + gt23L*PDstandardNth2Xt2 + - gt33L*PDstandardNth2Xt3 - gtu33*PDstandardNth33gt23 + gt12L*PDstandardNth3Xt1 + gt22L*PDstandardNth3Xt2 + - gt23L*PDstandardNth3Xt3 + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313)*Xtn1 + - (Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)*Xtn1 + (Gt123*gt12L + Gt223*gt22L + gt23L*Gt323)*Xtn2 + - (Gt122*gt13L + Gt222*gt23L + Gt322*gt33L)*Xtn2 + (gt12L*Gt133 + gt22L*Gt233 + gt23L*Gt333)*Xtn3 + + Rt23 = khalf*(-(gtu11*PDstandardNth11gt23) - 2*gtu21*PDstandardNth12gt23 - + 2*gtu31*PDstandardNth13gt23 - gtu22*PDstandardNth22gt23 - + 2*gtu32*PDstandardNth23gt23 + gt13L*PDstandardNth2Xt1 + + gt23L*PDstandardNth2Xt2 + gt33L*PDstandardNth2Xt3 - + gtu33*PDstandardNth33gt23 + gt12L*PDstandardNth3Xt1 + + gt22L*PDstandardNth3Xt2 + gt23L*PDstandardNth3Xt3 + + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313)*Xtn1 + + (Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)*Xtn1 + + (Gt123*gt12L + Gt223*gt22L + gt23L*Gt323)*Xtn2 + + (Gt122*gt13L + Gt222*gt23L + Gt322*gt33L)*Xtn2 + + (gt12L*Gt133 + gt22L*Gt233 + gt23L*Gt333)*Xtn3 + (Gt123*gt13L + Gt223*gt23L + Gt323*gt33L)*Xtn3 + - 2*((Gt112*gt11L*Gt123 + Gt111*Gt123*gt12L + Gt111*Gt122*gt13L + Gt123*gt12L*Gt212 + Gt112*gt13L*Gt222 + - 2*Gt112*gt12L*Gt223 + Gt123*Gt211*gt22L + 2*Gt212*Gt223*gt22L + Gt122*Gt211*gt23L + Gt212*Gt222*gt23L + - Gt123*gt23L*Gt311 + Gt123*gt13L*Gt312 + 2*Gt223*gt23L*Gt312 + Gt113*gt13L*Gt322 + Gt213*gt23L*Gt322 + - Gt113*gt12L*Gt323 + Gt112*gt13L*Gt323 + Gt213*gt22L*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt313*Gt323 + - Gt122*Gt311*gt33L + Gt222*Gt312*gt33L + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L)*gtu21 + - (Gt112*gt11L*Gt133 + Gt111*gt12L*Gt133 + Gt111*Gt123*gt13L + gt12L*Gt133*Gt212 + Gt112*gt13L*Gt223 + - Gt133*Gt211*gt22L + 2*Gt112*gt12L*Gt233 + 2*Gt212*gt22L*Gt233 + Gt123*Gt211*gt23L + Gt212*Gt223*gt23L + - Gt133*gt23L*Gt311 + Gt133*gt13L*Gt312 + 2*Gt233*gt23L*Gt312 + Gt113*gt13L*Gt323 + Gt213*gt23L*Gt323 + - Gt113*gt12L*Gt333 + Gt112*gt13L*Gt333 + Gt213*gt22L*Gt333 + Gt212*gt23L*Gt333 + gt23L*Gt313*Gt333 + - Gt123*Gt311*gt33L + Gt223*Gt312*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L)*gtu31 + - gtu21*(Gt113*gt11L*Gt122 + Gt122*gt13L*Gt212 + 2*Gt122*gt12L*Gt213 + Gt113*gt12L*Gt222 + Gt113*Gt212*gt22L + - 2*Gt213*Gt222*gt22L + Gt212*Gt222*gt23L + Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + Gt223*gt23L*Gt312 + - Gt123*gt12L*Gt313 + Gt122*gt13L*Gt313 + Gt223*gt22L*Gt313 + Gt222*gt23L*Gt313 + Gt113*gt13L*Gt322 + - 2*Gt213*gt23L*Gt322 + gt23L*Gt313*Gt323 + Gt212*Gt322*gt33L + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L + - Gt112*(Gt113*gt12L + Gt212*gt23L + Gt312*gt33L) + gt13L*SQR(Gt112))) + - 2*gtu31*(2*Gt213*Gt223*gt22L + Gt112*Gt213*gt23L + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + - gt12L*Gt133*Gt313 + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + Gt123*(2*gt12L*Gt213 + gt13L*(Gt212 + Gt313)) + - 2*Gt213*gt23L*Gt323 + Gt113*(gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + - gt13L*Gt323) + gt23L*Gt313*Gt333 + Gt112*Gt313*gt33L + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + + 2*((Gt112*gt11L*Gt123 + Gt111*Gt123*gt12L + Gt111*Gt122*gt13L + + Gt123*gt12L*Gt212 + Gt112*gt13L*Gt222 + 2*Gt112*gt12L*Gt223 + + Gt123*Gt211*gt22L + 2*Gt212*Gt223*gt22L + Gt122*Gt211*gt23L + + Gt212*Gt222*gt23L + Gt123*gt23L*Gt311 + Gt123*gt13L*Gt312 + + 2*Gt223*gt23L*Gt312 + Gt113*gt13L*Gt322 + Gt213*gt23L*Gt322 + + Gt113*gt12L*Gt323 + Gt112*gt13L*Gt323 + Gt213*gt22L*Gt323 + + Gt212*gt23L*Gt323 + gt23L*Gt313*Gt323 + Gt122*Gt311*gt33L + + Gt222*Gt312*gt33L + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L)*gtu21 + + (Gt112*gt11L*Gt133 + Gt111*gt12L*Gt133 + Gt111*Gt123*gt13L + + gt12L*Gt133*Gt212 + Gt112*gt13L*Gt223 + Gt133*Gt211*gt22L + + 2*Gt112*gt12L*Gt233 + 2*Gt212*gt22L*Gt233 + Gt123*Gt211*gt23L + + Gt212*Gt223*gt23L + Gt133*gt23L*Gt311 + Gt133*gt13L*Gt312 + + 2*Gt233*gt23L*Gt312 + Gt113*gt13L*Gt323 + Gt213*gt23L*Gt323 + + Gt113*gt12L*Gt333 + Gt112*gt13L*Gt333 + Gt213*gt22L*Gt333 + + Gt212*gt23L*Gt333 + gt23L*Gt313*Gt333 + Gt123*Gt311*gt33L + + Gt223*Gt312*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L)*gtu31 + + gtu21*(Gt113*gt11L*Gt122 + Gt122*gt13L*Gt212 + 2*Gt122*gt12L*Gt213 + + Gt113*gt12L*Gt222 + Gt113*Gt212*gt22L + 2*Gt213*Gt222*gt22L + + Gt212*Gt222*gt23L + Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + + Gt223*gt23L*Gt312 + Gt123*gt12L*Gt313 + Gt122*gt13L*Gt313 + + Gt223*gt22L*Gt313 + Gt222*gt23L*Gt313 + Gt113*gt13L*Gt322 + + 2*Gt213*gt23L*Gt322 + gt23L*Gt313*Gt323 + Gt212*Gt322*gt33L + + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L + + Gt112*(Gt113*gt12L + Gt212*gt23L + Gt312*gt33L) + gt13L*SQR(Gt112))) + + 2*gtu31*(2*Gt213*Gt223*gt22L + Gt112*Gt213*gt23L + + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + + gt12L*Gt133*Gt313 + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + + Gt123*(2*gt12L*Gt213 + gt13L*(Gt212 + Gt313)) + 2*Gt213*gt23L*Gt323 + + Gt113*(gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + Gt213*gt22L + + gt23L*Gt313 + gt13L*Gt323) + gt23L*Gt313*Gt333 + + Gt112*Gt313*gt33L + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L + gt12L*SQR(Gt113)) + - 2*gtu11*(Gt112*Gt113*gt11L + Gt111*Gt113*gt12L + Gt111*Gt112*gt13L + Gt113*gt12L*Gt212 + Gt112*gt13L*Gt212 + - 2*Gt112*gt12L*Gt213 + Gt113*Gt211*gt22L + 2*Gt212*Gt213*gt22L + Gt112*Gt211*gt23L + Gt113*gt23L*Gt311 + - 2*Gt113*gt13L*Gt312 + 3*Gt213*gt23L*Gt312 + Gt113*gt12L*Gt313 + Gt112*gt13L*Gt313 + Gt213*gt22L*Gt313 + - Gt212*gt23L*Gt313 + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + 2*Gt312*Gt313*gt33L + gt23L*SQR(Gt212) + - gt23L*SQR(Gt313)) + 2*gtu22*(gt11L*Gt122*Gt123 + Gt112*Gt123*gt12L + Gt112*Gt122*gt13L + Gt123*gt12L*Gt222 + - Gt122*gt13L*Gt222 + 2*Gt122*gt12L*Gt223 + Gt123*Gt212*gt22L + 2*Gt222*Gt223*gt22L + Gt122*Gt212*gt23L + - Gt123*gt23L*Gt312 + 2*Gt123*gt13L*Gt322 + 3*Gt223*gt23L*Gt322 + Gt123*gt12L*Gt323 + Gt122*gt13L*Gt323 + - Gt223*gt22L*Gt323 + Gt222*gt23L*Gt323 + Gt122*Gt312*gt33L + Gt222*Gt322*gt33L + 2*Gt322*Gt323*gt33L + - gt23L*SQR(Gt222) + gt23L*SQR(Gt323)) + 2*gtu32* - (gt11L*Gt122*Gt133 + Gt112*gt12L*Gt133 + Gt112*Gt123*gt13L + gt12L*Gt133*Gt222 + Gt122*gt13L*Gt223 + - Gt133*Gt212*gt22L + 2*Gt122*gt12L*Gt233 + 2*Gt222*gt22L*Gt233 + Gt123*Gt212*gt23L + Gt222*Gt223*gt23L + - Gt133*gt23L*Gt312 + Gt133*gt13L*Gt322 + 2*Gt233*gt23L*Gt322 + Gt123*gt13L*Gt323 + Gt223*gt23L*Gt323 + - Gt123*gt12L*Gt333 + Gt122*gt13L*Gt333 + Gt223*gt22L*Gt333 + Gt222*gt23L*Gt333 + gt23L*Gt323*Gt333 + - Gt123*Gt312*gt33L + Gt223*Gt322*gt33L + Gt322*Gt333*gt33L + gt33L*SQR(Gt323)) + - 2*gtu32*(Gt113*Gt123*gt12L + Gt113*Gt122*gt13L + Gt123*gt13L*Gt222 + 3*Gt123*gt12L*Gt223 + Gt123*Gt213*gt22L + - Gt122*Gt213*gt23L + Gt222*Gt223*gt23L + Gt123*gt23L*Gt313 + Gt133*gt13L*Gt322 + Gt233*gt23L*Gt322 + - gt12L*Gt133*Gt323 + 2*Gt123*gt13L*Gt323 + gt22L*Gt233*Gt323 + 3*Gt223*gt23L*Gt323 + gt23L*Gt323*Gt333 + - Gt122*Gt313*gt33L + Gt222*Gt323*gt33L + Gt322*Gt333*gt33L + gt11L*SQR(Gt123) + 2*gt22L*SQR(Gt223) + - gt33L*SQR(Gt323)) + 2*gtu33*(gt11L*Gt123*Gt133 + Gt113*gt12L*Gt133 + Gt113*Gt123*gt13L + gt12L*Gt133*Gt223 + - Gt123*gt13L*Gt223 + Gt133*Gt213*gt22L + 2*Gt123*gt12L*Gt233 + 2*Gt223*gt22L*Gt233 + Gt123*Gt213*gt23L + - Gt133*gt23L*Gt313 + 2*Gt133*gt13L*Gt323 + 3*Gt233*gt23L*Gt323 + gt12L*Gt133*Gt333 + Gt123*gt13L*Gt333 + - gt22L*Gt233*Gt333 + Gt223*gt23L*Gt333 + Gt123*Gt313*gt33L + Gt223*Gt323*gt33L + 2*Gt323*Gt333*gt33L + - gt23L*SQR(Gt223) + gt23L*SQR(Gt333))); - - Rt33 = 4*(Gt123*gt13L*Gt323*gtu22 + Gt223*gt23L*Gt323*gtu22 + Gt133*gt13L*Gt313*gtu31 + Gt233*gt23L*Gt313*gtu31 + - Gt113*gt13L*Gt333*gtu31 + Gt133*gt13L*Gt323*gtu32 + Gt233*gt23L*Gt323*gtu32 + Gt123*gt13L*Gt333*gtu32 + - Gt133*gt13L*Gt333*gtu33) + gtu21*(2*Gt212*Gt223*gt23L + 4*Gt123*gt13L*Gt313 + 4*Gt223*gt23L*Gt313 + - 4*Gt113*gt13L*Gt323 + 4*Gt213*gt23L*Gt323 + 2*Gt123*Gt311*gt33L - PDstandardNth12gt33) + - gtu31*(4*Gt213*gt23L*Gt333 + 2*Gt233*Gt312*gt33L + 6*Gt313*Gt333*gt33L - PDstandardNth13gt33) - - gtu22*khalf*PDstandardNth22gt33 + gtu32*(4*Gt223*gt23L*Gt333 + 2*Gt123*Gt313*gt33L + 6*Gt323*Gt333*gt33L - - PDstandardNth23gt33) - gtu33*khalf*PDstandardNth33gt33 + gt13L*PDstandardNth3Xt1 + gt23L*PDstandardNth3Xt2 + - gt33L*(2*Gt213*Gt322*gtu21 + 6*Gt313*Gt323*gtu21 + 2*Gt123*Gt312*gtu22 + 2*Gt133*Gt311*gtu31 + - 2*Gt133*Gt312*gtu32 + 2*Gt133*Gt313*gtu33 + PDstandardNth3Xt3) + Gt113*gt13L*Xtn1 + Gt213*gt23L*Xtn1 + - Gt313*gt33L*Xtn1 + Gt123*gt13L*Xtn2 + Gt223*gt23L*Xtn2 + Gt323*gt33L*Xtn2 + Gt133*gt13L*Xtn3 + Gt333*gt33L*Xtn3 + + 2*gtu11*(Gt112*Gt113*gt11L + Gt111*Gt113*gt12L + Gt111*Gt112*gt13L + + Gt113*gt12L*Gt212 + Gt112*gt13L*Gt212 + 2*Gt112*gt12L*Gt213 + + Gt113*Gt211*gt22L + 2*Gt212*Gt213*gt22L + Gt112*Gt211*gt23L + + Gt113*gt23L*Gt311 + 2*Gt113*gt13L*Gt312 + 3*Gt213*gt23L*Gt312 + + Gt113*gt12L*Gt313 + Gt112*gt13L*Gt313 + Gt213*gt22L*Gt313 + + Gt212*gt23L*Gt313 + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + + 2*Gt312*Gt313*gt33L + gt23L*SQR(Gt212) + gt23L*SQR(Gt313)) + + 2*gtu22*(gt11L*Gt122*Gt123 + Gt112*Gt123*gt12L + Gt112*Gt122*gt13L + + Gt123*gt12L*Gt222 + Gt122*gt13L*Gt222 + 2*Gt122*gt12L*Gt223 + + Gt123*Gt212*gt22L + 2*Gt222*Gt223*gt22L + Gt122*Gt212*gt23L + + Gt123*gt23L*Gt312 + 2*Gt123*gt13L*Gt322 + 3*Gt223*gt23L*Gt322 + + Gt123*gt12L*Gt323 + Gt122*gt13L*Gt323 + Gt223*gt22L*Gt323 + + Gt222*gt23L*Gt323 + Gt122*Gt312*gt33L + Gt222*Gt322*gt33L + + 2*Gt322*Gt323*gt33L + gt23L*SQR(Gt222) + gt23L*SQR(Gt323)) + + 2*gtu32*(gt11L*Gt122*Gt133 + Gt112*gt12L*Gt133 + Gt112*Gt123*gt13L + + gt12L*Gt133*Gt222 + Gt122*gt13L*Gt223 + Gt133*Gt212*gt22L + + 2*Gt122*gt12L*Gt233 + 2*Gt222*gt22L*Gt233 + Gt123*Gt212*gt23L + + Gt222*Gt223*gt23L + Gt133*gt23L*Gt312 + Gt133*gt13L*Gt322 + + 2*Gt233*gt23L*Gt322 + Gt123*gt13L*Gt323 + Gt223*gt23L*Gt323 + + Gt123*gt12L*Gt333 + Gt122*gt13L*Gt333 + Gt223*gt22L*Gt333 + + Gt222*gt23L*Gt333 + gt23L*Gt323*Gt333 + Gt123*Gt312*gt33L + + Gt223*Gt322*gt33L + Gt322*Gt333*gt33L + gt33L*SQR(Gt323)) + + 2*gtu32*(Gt113*Gt123*gt12L + Gt113*Gt122*gt13L + Gt123*gt13L*Gt222 + + 3*Gt123*gt12L*Gt223 + Gt123*Gt213*gt22L + Gt122*Gt213*gt23L + + Gt222*Gt223*gt23L + Gt123*gt23L*Gt313 + Gt133*gt13L*Gt322 + + Gt233*gt23L*Gt322 + gt12L*Gt133*Gt323 + 2*Gt123*gt13L*Gt323 + + gt22L*Gt233*Gt323 + 3*Gt223*gt23L*Gt323 + gt23L*Gt323*Gt333 + + Gt122*Gt313*gt33L + Gt222*Gt323*gt33L + Gt322*Gt333*gt33L + + gt11L*SQR(Gt123) + 2*gt22L*SQR(Gt223) + gt33L*SQR(Gt323)) + + 2*gtu33*(gt11L*Gt123*Gt133 + Gt113*gt12L*Gt133 + Gt113*Gt123*gt13L + + gt12L*Gt133*Gt223 + Gt123*gt13L*Gt223 + Gt133*Gt213*gt22L + + 2*Gt123*gt12L*Gt233 + 2*Gt223*gt22L*Gt233 + Gt123*Gt213*gt23L + + Gt133*gt23L*Gt313 + 2*Gt133*gt13L*Gt323 + 3*Gt233*gt23L*Gt323 + + gt12L*Gt133*Gt333 + Gt123*gt13L*Gt333 + gt22L*Gt233*Gt333 + + Gt223*gt23L*Gt333 + Gt123*Gt313*gt33L + Gt223*Gt323*gt33L + + 2*Gt323*Gt333*gt33L + gt23L*SQR(Gt223) + gt23L*SQR(Gt333))); + + Rt33 = 4*(Gt123*gt13L*Gt323*gtu22 + Gt223*gt23L*Gt323*gtu22 + + Gt133*gt13L*Gt313*gtu31 + Gt233*gt23L*Gt313*gtu31 + + Gt113*gt13L*Gt333*gtu31 + Gt133*gt13L*Gt323*gtu32 + + Gt233*gt23L*Gt323*gtu32 + Gt123*gt13L*Gt333*gtu32 + + Gt133*gt13L*Gt333*gtu33) + + gtu21*(2*Gt212*Gt223*gt23L + 4*Gt123*gt13L*Gt313 + 4*Gt223*gt23L*Gt313 + + 4*Gt113*gt13L*Gt323 + 4*Gt213*gt23L*Gt323 + 2*Gt123*Gt311*gt33L - + PDstandardNth12gt33) + gtu31* + (4*Gt213*gt23L*Gt333 + 2*Gt233*Gt312*gt33L + 6*Gt313*Gt333*gt33L - + PDstandardNth13gt33) - gtu22*khalf*PDstandardNth22gt33 + + gtu32*(4*Gt223*gt23L*Gt333 + 2*Gt123*Gt313*gt33L + 6*Gt323*Gt333*gt33L - + PDstandardNth23gt33) - gtu33*khalf*PDstandardNth33gt33 + + gt13L*PDstandardNth3Xt1 + gt23L*PDstandardNth3Xt2 + + gt33L*(2*Gt213*Gt322*gtu21 + 6*Gt313*Gt323*gtu21 + 2*Gt123*Gt312*gtu22 + + 2*Gt133*Gt311*gtu31 + 2*Gt133*Gt312*gtu32 + 2*Gt133*Gt313*gtu33 + + PDstandardNth3Xt3) + Gt113*gt13L*Xtn1 + Gt213*gt23L*Xtn1 + + Gt313*gt33L*Xtn1 + Gt123*gt13L*Xtn2 + Gt223*gt23L*Xtn2 + Gt323*gt33L*Xtn2 + + Gt133*gt13L*Xtn3 + Gt333*gt33L*Xtn3 + Gt233*(4*gt23L*Gt333*gtu33 + 2*Gt323*gt33L*gtu33 + gt23L*Xtn3) + - gtu11*(2*Gt212*Gt213*gt23L + 4*Gt113*gt13L*Gt313 + 4*Gt213*gt23L*Gt313 + 2*Gt113*Gt311*gt33L + - 2*Gt213*Gt312*gt33L - khalf*PDstandardNth11gt33 + gt11L*SQR(Gt113)) + - 2*(Gt111*Gt113*gt13L*gtu11 + Gt113*gt12L*Gt213*gtu11 + Gt112*gt13L*Gt213*gtu11 + Gt113*Gt211*gt23L*gtu11 + - Gt113*gt11L*Gt123*gtu21 + Gt112*Gt113*gt13L*gtu21 + Gt111*Gt123*gt13L*gtu21 + Gt123*gt12L*Gt213*gtu21 + - Gt122*gt13L*Gt213*gtu21 + Gt113*gt12L*Gt223*gtu21 + Gt112*gt13L*Gt223*gtu21 + Gt213*Gt223*gt22L*gtu21 + - Gt123*Gt211*gt23L*gtu21 + Gt113*Gt212*gt23L*gtu21 + Gt213*Gt222*gt23L*gtu21 + Gt113*Gt312*gt33L*gtu21 + - Gt223*Gt312*gt33L*gtu21 + Gt112*Gt123*gt13L*gtu22 + Gt123*gt12L*Gt223*gtu22 + Gt122*gt13L*Gt223*gtu22 + - Gt123*Gt212*gt23L*gtu22 + Gt222*Gt223*gt23L*gtu22 + Gt223*Gt322*gt33L*gtu22 + Gt113*gt11L*Gt133*gtu31 + - Gt111*Gt133*gt13L*gtu31 + gt12L*Gt133*Gt213*gtu31 + Gt123*gt13L*Gt213*gtu31 + Gt113*gt12L*Gt233*gtu31 + - Gt112*gt13L*Gt233*gtu31 + Gt213*gt22L*Gt233*gtu31 + Gt133*Gt211*gt23L*gtu31 + Gt113*Gt213*gt23L*gtu31 + - Gt213*Gt223*gt23L*gtu31 + Gt212*Gt233*gt23L*gtu31 + Gt113*Gt313*gt33L*gtu31 + Gt213*Gt323*gt33L*gtu31 + - gt11L*Gt123*Gt133*gtu32 + Gt113*Gt123*gt13L*gtu32 + Gt112*Gt133*gt13L*gtu32 + gt12L*Gt133*Gt223*gtu32 + - Gt123*gt13L*Gt223*gtu32 + Gt123*gt12L*Gt233*gtu32 + Gt122*gt13L*Gt233*gtu32 + Gt223*gt22L*Gt233*gtu32 + - Gt133*Gt212*gt23L*gtu32 + Gt123*Gt213*gt23L*gtu32 + Gt222*Gt233*gt23L*gtu32 + Gt233*Gt322*gt33L*gtu32 + - Gt223*Gt323*gt33L*gtu32 + Gt113*Gt133*gt13L*gtu33 + gt12L*Gt133*Gt233*gtu33 + Gt123*gt13L*Gt233*gtu33 + - Gt133*Gt213*gt23L*gtu33 + Gt223*Gt233*gt23L*gtu33 + gt13L*gtu31*SQR(Gt113)) + gt11L*gtu22*SQR(Gt123) + - gt11L*gtu33*SQR(Gt133) + gt22L*gtu11*SQR(Gt213) + gt22L*gtu22*SQR(Gt223) + 2*gt23L*gtu32*SQR(Gt223) + - gt22L*gtu33*SQR(Gt233) + 3*gt33L*gtu11*SQR(Gt313) + 3*gt33L*gtu22*SQR(Gt323) + 3*gt33L*gtu33*SQR(Gt333); - - Rphi11 = 2*(-PDstandardNth11phi - gt11L*gtu11*PDstandardNth11phi - 2*gt11L*gtu21*PDstandardNth12phi - - 2*gt11L*gtu31*PDstandardNth13phi - gt11L*gtu22*PDstandardNth22phi - 2*gt11L*gtu32*PDstandardNth23phi - - gt11L*gtu33*PDstandardNth33phi + Gt311*PDstandardNth3phi + gt11L*Gt311*gtu11*PDstandardNth3phi + - 2*gt11L*Gt312*gtu21*PDstandardNth3phi + gt11L*Gt322*gtu22*PDstandardNth3phi + - 2*gt11L*Gt313*gtu31*PDstandardNth3phi + 2*gt11L*Gt323*gtu32*PDstandardNth3phi + - gt11L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt111 + Gt111*gt11L*gtu11 + 2*Gt112*gt11L*gtu21 + gt11L*Gt122*gtu22 + 2*Gt113*gt11L*gtu31 + - 2*gt11L*Gt123*gtu32 + gt11L*Gt133*gtu33 - 4*gt11L*gtu21*PDstandardNth2phi - 4*gt11L*gtu31*PDstandardNth3phi) + + gtu11*(2*Gt212*Gt213*gt23L + 4*Gt113*gt13L*Gt313 + 4*Gt213*gt23L*Gt313 + + 2*Gt113*Gt311*gt33L + 2*Gt213*Gt312*gt33L - khalf*PDstandardNth11gt33 + + gt11L*SQR(Gt113)) + 2*(Gt111*Gt113*gt13L*gtu11 + + Gt113*gt12L*Gt213*gtu11 + Gt112*gt13L*Gt213*gtu11 + + Gt113*Gt211*gt23L*gtu11 + Gt113*gt11L*Gt123*gtu21 + + Gt112*Gt113*gt13L*gtu21 + Gt111*Gt123*gt13L*gtu21 + + Gt123*gt12L*Gt213*gtu21 + Gt122*gt13L*Gt213*gtu21 + + Gt113*gt12L*Gt223*gtu21 + Gt112*gt13L*Gt223*gtu21 + + Gt213*Gt223*gt22L*gtu21 + Gt123*Gt211*gt23L*gtu21 + + Gt113*Gt212*gt23L*gtu21 + Gt213*Gt222*gt23L*gtu21 + + Gt113*Gt312*gt33L*gtu21 + Gt223*Gt312*gt33L*gtu21 + + Gt112*Gt123*gt13L*gtu22 + Gt123*gt12L*Gt223*gtu22 + + Gt122*gt13L*Gt223*gtu22 + Gt123*Gt212*gt23L*gtu22 + + Gt222*Gt223*gt23L*gtu22 + Gt223*Gt322*gt33L*gtu22 + + Gt113*gt11L*Gt133*gtu31 + Gt111*Gt133*gt13L*gtu31 + + gt12L*Gt133*Gt213*gtu31 + Gt123*gt13L*Gt213*gtu31 + + Gt113*gt12L*Gt233*gtu31 + Gt112*gt13L*Gt233*gtu31 + + Gt213*gt22L*Gt233*gtu31 + Gt133*Gt211*gt23L*gtu31 + + Gt113*Gt213*gt23L*gtu31 + Gt213*Gt223*gt23L*gtu31 + + Gt212*Gt233*gt23L*gtu31 + Gt113*Gt313*gt33L*gtu31 + + Gt213*Gt323*gt33L*gtu31 + gt11L*Gt123*Gt133*gtu32 + + Gt113*Gt123*gt13L*gtu32 + Gt112*Gt133*gt13L*gtu32 + + gt12L*Gt133*Gt223*gtu32 + Gt123*gt13L*Gt223*gtu32 + + Gt123*gt12L*Gt233*gtu32 + Gt122*gt13L*Gt233*gtu32 + + Gt223*gt22L*Gt233*gtu32 + Gt133*Gt212*gt23L*gtu32 + + Gt123*Gt213*gt23L*gtu32 + Gt222*Gt233*gt23L*gtu32 + + Gt233*Gt322*gt33L*gtu32 + Gt223*Gt323*gt33L*gtu32 + + Gt113*Gt133*gt13L*gtu33 + gt12L*Gt133*Gt233*gtu33 + + Gt123*gt13L*Gt233*gtu33 + Gt133*Gt213*gt23L*gtu33 + + Gt223*Gt233*gt23L*gtu33 + gt13L*gtu31*SQR(Gt113)) + + gt11L*gtu22*SQR(Gt123) + gt11L*gtu33*SQR(Gt133) + gt22L*gtu11*SQR(Gt213) + + gt22L*gtu22*SQR(Gt223) + 2*gt23L*gtu32*SQR(Gt223) + + gt22L*gtu33*SQR(Gt233) + 3*gt33L*gtu11*SQR(Gt313) + + 3*gt33L*gtu22*SQR(Gt323) + 3*gt33L*gtu33*SQR(Gt333); + + Rphi11 = 2*(-PDstandardNth11phi - gt11L*gtu11*PDstandardNth11phi - + 2*gt11L*gtu21*PDstandardNth12phi - 2*gt11L*gtu31*PDstandardNth13phi - + gt11L*gtu22*PDstandardNth22phi - 2*gt11L*gtu32*PDstandardNth23phi - + gt11L*gtu33*PDstandardNth33phi + Gt311*PDstandardNth3phi + + gt11L*Gt311*gtu11*PDstandardNth3phi + + 2*gt11L*Gt312*gtu21*PDstandardNth3phi + + gt11L*Gt322*gtu22*PDstandardNth3phi + + 2*gt11L*Gt313*gtu31*PDstandardNth3phi + + 2*gt11L*Gt323*gtu32*PDstandardNth3phi + + gt11L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt111 + Gt111*gt11L*gtu11 + 2*Gt112*gt11L*gtu21 + + gt11L*Gt122*gtu22 + 2*Gt113*gt11L*gtu31 + 2*gt11L*Gt123*gtu32 + + gt11L*Gt133*gtu33 - 4*gt11L*gtu21*PDstandardNth2phi - + 4*gt11L*gtu31*PDstandardNth3phi) + PDstandardNth2phi*(Gt211 + gt11L*Gt211*gtu11 + - gt11L*(2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + Gt233*gtu33) - - 4*gt11L*gtu32*PDstandardNth3phi) + (2 - 2*gt11L*gtu11)*SQR(PDstandardNth1phi) - - 2*gt11L*gtu22*SQR(PDstandardNth2phi) - 2*gt11L*gtu33*SQR(PDstandardNth3phi)); - - Rphi12 = 2*(-(gt12L*gtu11*PDstandardNth11phi) - PDstandardNth12phi - 2*gt12L*gtu21*PDstandardNth12phi - - 2*gt12L*gtu31*PDstandardNth13phi - gt12L*gtu22*PDstandardNth22phi - 2*gt12L*gtu32*PDstandardNth23phi - - gt12L*gtu33*PDstandardNth33phi + Gt312*PDstandardNth3phi + gt12L*Gt311*gtu11*PDstandardNth3phi + - 2*gt12L*Gt312*gtu21*PDstandardNth3phi + gt12L*Gt322*gtu22*PDstandardNth3phi + - 2*gt12L*Gt313*gtu31*PDstandardNth3phi + 2*gt12L*Gt323*gtu32*PDstandardNth3phi + - gt12L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt112 + Gt111*gt12L*gtu11 + 2*Gt112*gt12L*gtu21 + Gt122*gt12L*gtu22 + 2*Gt113*gt12L*gtu31 + - 2*Gt123*gt12L*gtu32 + gt12L*Gt133*gtu33 + (2 - 4*gt12L*gtu21)*PDstandardNth2phi - - 4*gt12L*gtu31*PDstandardNth3phi) + PDstandardNth2phi* - (Gt212 + 2*gt12L*Gt212*gtu21 + gt12L*(Gt211*gtu11 + Gt222*gtu22 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + Gt233*gtu33) - - 4*gt12L*gtu32*PDstandardNth3phi) - 2*gt12L*gtu11*SQR(PDstandardNth1phi) - - 2*gt12L*gtu22*SQR(PDstandardNth2phi) - 2*gt12L*gtu33*SQR(PDstandardNth3phi)); - - Rphi13 = 2*(-PDstandardNth13phi + gt13L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - - 2*gtu31*PDstandardNth13phi) - gt13L*gtu22*PDstandardNth22phi - 2*gt13L*gtu32*PDstandardNth23phi - - gt13L*gtu33*PDstandardNth33phi + Gt313*PDstandardNth3phi + gt13L*Gt311*gtu11*PDstandardNth3phi + - 2*gt13L*Gt312*gtu21*PDstandardNth3phi + gt13L*Gt322*gtu22*PDstandardNth3phi + - 2*gt13L*Gt313*gtu31*PDstandardNth3phi + 2*gt13L*Gt323*gtu32*PDstandardNth3phi + - gt13L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt113 + Gt111*gt13L*gtu11 + 2*Gt112*gt13L*gtu21 + Gt122*gt13L*gtu22 + 2*Gt113*gt13L*gtu31 + - 2*Gt123*gt13L*gtu32 + Gt133*gt13L*gtu33 - 4*gt13L*gtu21*PDstandardNth2phi + + gt11L*(2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + + Gt233*gtu33) - 4*gt11L*gtu32*PDstandardNth3phi) + + (2 - 2*gt11L*gtu11)*SQR(PDstandardNth1phi) - + 2*gt11L*gtu22*SQR(PDstandardNth2phi) - + 2*gt11L*gtu33*SQR(PDstandardNth3phi)); + + Rphi12 = 2*(-(gt12L*gtu11*PDstandardNth11phi) - PDstandardNth12phi - + 2*gt12L*gtu21*PDstandardNth12phi - 2*gt12L*gtu31*PDstandardNth13phi - + gt12L*gtu22*PDstandardNth22phi - 2*gt12L*gtu32*PDstandardNth23phi - + gt12L*gtu33*PDstandardNth33phi + Gt312*PDstandardNth3phi + + gt12L*Gt311*gtu11*PDstandardNth3phi + + 2*gt12L*Gt312*gtu21*PDstandardNth3phi + + gt12L*Gt322*gtu22*PDstandardNth3phi + + 2*gt12L*Gt313*gtu31*PDstandardNth3phi + + 2*gt12L*Gt323*gtu32*PDstandardNth3phi + + gt12L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt112 + Gt111*gt12L*gtu11 + 2*Gt112*gt12L*gtu21 + + Gt122*gt12L*gtu22 + 2*Gt113*gt12L*gtu31 + 2*Gt123*gt12L*gtu32 + + gt12L*Gt133*gtu33 + (2 - 4*gt12L*gtu21)*PDstandardNth2phi - + 4*gt12L*gtu31*PDstandardNth3phi) + + PDstandardNth2phi*(Gt212 + 2*gt12L*Gt212*gtu21 + + gt12L*(Gt211*gtu11 + Gt222*gtu22 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + + Gt233*gtu33) - 4*gt12L*gtu32*PDstandardNth3phi) - + 2*gt12L*gtu11*SQR(PDstandardNth1phi) - + 2*gt12L*gtu22*SQR(PDstandardNth2phi) - + 2*gt12L*gtu33*SQR(PDstandardNth3phi)); + + Rphi13 = 2*(-PDstandardNth13phi + + gt13L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - + 2*gtu31*PDstandardNth13phi) - gt13L*gtu22*PDstandardNth22phi - + 2*gt13L*gtu32*PDstandardNth23phi - gt13L*gtu33*PDstandardNth33phi + + Gt313*PDstandardNth3phi + gt13L*Gt311*gtu11*PDstandardNth3phi + + 2*gt13L*Gt312*gtu21*PDstandardNth3phi + + gt13L*Gt322*gtu22*PDstandardNth3phi + + 2*gt13L*Gt313*gtu31*PDstandardNth3phi + + 2*gt13L*Gt323*gtu32*PDstandardNth3phi + + gt13L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt113 + Gt111*gt13L*gtu11 + 2*Gt112*gt13L*gtu21 + + Gt122*gt13L*gtu22 + 2*Gt113*gt13L*gtu31 + 2*Gt123*gt13L*gtu32 + + Gt133*gt13L*gtu33 - 4*gt13L*gtu21*PDstandardNth2phi + (2 - 4*gt13L*gtu31)*PDstandardNth3phi) + PDstandardNth2phi*(Gt213 + 2*gt13L*Gt213*gtu31 + - gt13L*(Gt211*gtu11 + 2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt223*gtu32 + Gt233*gtu33) - - 4*gt13L*gtu32*PDstandardNth3phi) - 2*gt13L*gtu11*SQR(PDstandardNth1phi) - - 2*gt13L*gtu22*SQR(PDstandardNth2phi) - 2*gt13L*gtu33*SQR(PDstandardNth3phi)); - - Rphi22 = 2*(-PDstandardNth22phi + gt22L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - - 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi) - 2*gt22L*gtu32*PDstandardNth23phi - - gt22L*gtu33*PDstandardNth33phi + Gt322*PDstandardNth3phi + gt22L*Gt311*gtu11*PDstandardNth3phi + - 2*gt22L*Gt312*gtu21*PDstandardNth3phi + gt22L*Gt322*gtu22*PDstandardNth3phi + - 2*gt22L*Gt313*gtu31*PDstandardNth3phi + 2*gt22L*Gt323*gtu32*PDstandardNth3phi + - gt22L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt122 + Gt111*gt22L*gtu11 + 2*Gt112*gt22L*gtu21 + Gt122*gt22L*gtu22 + 2*Gt113*gt22L*gtu31 + - 2*Gt123*gt22L*gtu32 + Gt133*gt22L*gtu33 - 4*gt22L*gtu21*PDstandardNth2phi - 4*gt22L*gtu31*PDstandardNth3phi) + + gt13L*(Gt211*gtu11 + 2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt223*gtu32 + + Gt233*gtu33) - 4*gt13L*gtu32*PDstandardNth3phi) - + 2*gt13L*gtu11*SQR(PDstandardNth1phi) - + 2*gt13L*gtu22*SQR(PDstandardNth2phi) - + 2*gt13L*gtu33*SQR(PDstandardNth3phi)); + + Rphi22 = 2*(-PDstandardNth22phi + + gt22L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - + 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi) - + 2*gt22L*gtu32*PDstandardNth23phi - gt22L*gtu33*PDstandardNth33phi + + Gt322*PDstandardNth3phi + gt22L*Gt311*gtu11*PDstandardNth3phi + + 2*gt22L*Gt312*gtu21*PDstandardNth3phi + + gt22L*Gt322*gtu22*PDstandardNth3phi + + 2*gt22L*Gt313*gtu31*PDstandardNth3phi + + 2*gt22L*Gt323*gtu32*PDstandardNth3phi + + gt22L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt122 + Gt111*gt22L*gtu11 + 2*Gt112*gt22L*gtu21 + + Gt122*gt22L*gtu22 + 2*Gt113*gt22L*gtu31 + 2*Gt123*gt22L*gtu32 + + Gt133*gt22L*gtu33 - 4*gt22L*gtu21*PDstandardNth2phi - + 4*gt22L*gtu31*PDstandardNth3phi) + PDstandardNth2phi*(Gt222 + Gt222*gt22L*gtu22 + - gt22L*(Gt211*gtu11 + 2*Gt212*gtu21 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + Gt233*gtu33) - - 4*gt22L*gtu32*PDstandardNth3phi) - 2*gt22L*gtu11*SQR(PDstandardNth1phi) + - (2 - 2*gt22L*gtu22)*SQR(PDstandardNth2phi) - 2*gt22L*gtu33*SQR(PDstandardNth3phi)); - - Rphi23 = 2*(-PDstandardNth23phi + gt23L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - - 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi - 2*gtu32*PDstandardNth23phi) - - gt23L*gtu33*PDstandardNth33phi + Gt323*PDstandardNth3phi + gt23L*Gt311*gtu11*PDstandardNth3phi + - 2*gt23L*Gt312*gtu21*PDstandardNth3phi + gt23L*Gt322*gtu22*PDstandardNth3phi + - 2*gt23L*Gt313*gtu31*PDstandardNth3phi + 2*gt23L*Gt323*gtu32*PDstandardNth3phi + - gt23L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt123 + Gt111*gt23L*gtu11 + 2*Gt112*gt23L*gtu21 + Gt122*gt23L*gtu22 + 2*Gt113*gt23L*gtu31 + - 2*Gt123*gt23L*gtu32 + Gt133*gt23L*gtu33 - 4*gt23L*gtu21*PDstandardNth2phi - 4*gt23L*gtu31*PDstandardNth3phi) + + gt22L*(Gt211*gtu11 + 2*Gt212*gtu21 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + + Gt233*gtu33) - 4*gt22L*gtu32*PDstandardNth3phi) - + 2*gt22L*gtu11*SQR(PDstandardNth1phi) + + (2 - 2*gt22L*gtu22)*SQR(PDstandardNth2phi) - + 2*gt22L*gtu33*SQR(PDstandardNth3phi)); + + Rphi23 = 2*(-PDstandardNth23phi + + gt23L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - + 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi - + 2*gtu32*PDstandardNth23phi) - gt23L*gtu33*PDstandardNth33phi + + Gt323*PDstandardNth3phi + gt23L*Gt311*gtu11*PDstandardNth3phi + + 2*gt23L*Gt312*gtu21*PDstandardNth3phi + + gt23L*Gt322*gtu22*PDstandardNth3phi + + 2*gt23L*Gt313*gtu31*PDstandardNth3phi + + 2*gt23L*Gt323*gtu32*PDstandardNth3phi + + gt23L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt123 + Gt111*gt23L*gtu11 + 2*Gt112*gt23L*gtu21 + + Gt122*gt23L*gtu22 + 2*Gt113*gt23L*gtu31 + 2*Gt123*gt23L*gtu32 + + Gt133*gt23L*gtu33 - 4*gt23L*gtu21*PDstandardNth2phi - + 4*gt23L*gtu31*PDstandardNth3phi) + PDstandardNth2phi*(Gt223 + 2*Gt223*gt23L*gtu32 + - gt23L*(Gt211*gtu11 + 2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt213*gtu31 + Gt233*gtu33) + - (2 - 4*gt23L*gtu32)*PDstandardNth3phi) - 2*gt23L*gtu11*SQR(PDstandardNth1phi) - - 2*gt23L*gtu22*SQR(PDstandardNth2phi) - 2*gt23L*gtu33*SQR(PDstandardNth3phi)); - - Rphi33 = 2*(-PDstandardNth33phi + (Gt333 + gt33L* - (Gt322*gtu22 + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33))*PDstandardNth3phi + - PDstandardNth2phi*(Gt233 + gt33L*(Gt211*gtu11 + Gt222*gtu22 + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + - Gt233*gtu33 - 4*gtu32*PDstandardNth3phi)) + - PDstandardNth1phi*(Gt133 + gt33L*(Gt111*gtu11 + Gt122*gtu22 + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + - Gt133*gtu33 - 4*(gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi))) + 2*SQR(PDstandardNth3phi) + - gt33L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - 2*gtu31*PDstandardNth13phi - - gtu22*PDstandardNth22phi - 2*gtu32*PDstandardNth23phi - gtu33*PDstandardNth33phi + - Gt311*gtu11*PDstandardNth3phi - 2*gtu11*SQR(PDstandardNth1phi) - 2*gtu22*SQR(PDstandardNth2phi) - - 2*gtu33*SQR(PDstandardNth3phi))); + gt23L*(Gt211*gtu11 + 2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt213*gtu31 + + Gt233*gtu33) + (2 - 4*gt23L*gtu32)*PDstandardNth3phi) - + 2*gt23L*gtu11*SQR(PDstandardNth1phi) - + 2*gt23L*gtu22*SQR(PDstandardNth2phi) - + 2*gt23L*gtu33*SQR(PDstandardNth3phi)); + + Rphi33 = 2*(-PDstandardNth33phi + + (Gt333 + gt33L*(Gt322*gtu22 + + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33))* + PDstandardNth3phi + PDstandardNth2phi* + (Gt233 + gt33L*(Gt211*gtu11 + Gt222*gtu22 + + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33 - + 4*gtu32*PDstandardNth3phi)) + + PDstandardNth1phi*(Gt133 + + gt33L*(Gt111*gtu11 + Gt122*gtu22 + + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33 - + 4*(gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi))) + + 2*SQR(PDstandardNth3phi) + + gt33L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - + 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi - + 2*gtu32*PDstandardNth23phi - gtu33*PDstandardNth33phi + + Gt311*gtu11*PDstandardNth3phi - 2*gtu11*SQR(PDstandardNth1phi) - + 2*gtu22*SQR(PDstandardNth2phi) - 2*gtu33*SQR(PDstandardNth3phi))); Atm11 = At11L*gtu11 + At12L*gtu21 + At13L*gtu31; @@ -947,43 +1207,61 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal gu33 = em4phi*gtu33; - G111 = Gt111 + (4 - 2*gt11L*gtu11)*PDstandardNth1phi - 2*gt11L*(gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi); + G111 = Gt111 + (4 - 2*gt11L*gtu11)*PDstandardNth1phi - + 2*gt11L*(gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi); - G211 = Gt211 - 2*gt11L*(gtu21*PDstandardNth1phi + gtu22*PDstandardNth2phi + gtu32*PDstandardNth3phi); + G211 = Gt211 - 2*gt11L*(gtu21*PDstandardNth1phi + gtu22*PDstandardNth2phi + + gtu32*PDstandardNth3phi); - G311 = Gt311 - 2*gt11L*(gtu31*PDstandardNth1phi + gtu32*PDstandardNth2phi + gtu33*PDstandardNth3phi); + G311 = Gt311 - 2*gt11L*(gtu31*PDstandardNth1phi + gtu32*PDstandardNth2phi + + gtu33*PDstandardNth3phi); - G112 = Gt112 + (2 - 2*gt12L*gtu21)*PDstandardNth2phi - 2*gt12L*(gtu11*PDstandardNth1phi + gtu31*PDstandardNth3phi); + G112 = Gt112 + (2 - 2*gt12L*gtu21)*PDstandardNth2phi - + 2*gt12L*(gtu11*PDstandardNth1phi + gtu31*PDstandardNth3phi); - G212 = Gt212 + (2 - 2*gt12L*gtu21)*PDstandardNth1phi - 2*gt12L*(gtu22*PDstandardNth2phi + gtu32*PDstandardNth3phi); + G212 = Gt212 + (2 - 2*gt12L*gtu21)*PDstandardNth1phi - + 2*gt12L*(gtu22*PDstandardNth2phi + gtu32*PDstandardNth3phi); - G312 = Gt312 - 2*gt12L*(gtu31*PDstandardNth1phi + gtu32*PDstandardNth2phi + gtu33*PDstandardNth3phi); + G312 = Gt312 - 2*gt12L*(gtu31*PDstandardNth1phi + gtu32*PDstandardNth2phi + + gtu33*PDstandardNth3phi); - G113 = Gt113 + 2*PDstandardNth3phi - 2*gt13L*(gtu11*PDstandardNth1phi + gtu21*PDstandardNth2phi + + G113 = Gt113 + 2*PDstandardNth3phi - + 2*gt13L*(gtu11*PDstandardNth1phi + gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi); - G213 = Gt213 - 2*gt13L*(gtu21*PDstandardNth1phi + gtu22*PDstandardNth2phi + gtu32*PDstandardNth3phi); + G213 = Gt213 - 2*gt13L*(gtu21*PDstandardNth1phi + gtu22*PDstandardNth2phi + + gtu32*PDstandardNth3phi); - G313 = Gt313 + (2 - 2*gt13L*gtu31)*PDstandardNth1phi - 2*gt13L*(gtu32*PDstandardNth2phi + gtu33*PDstandardNth3phi); + G313 = Gt313 + (2 - 2*gt13L*gtu31)*PDstandardNth1phi - + 2*gt13L*(gtu32*PDstandardNth2phi + gtu33*PDstandardNth3phi); - G122 = Gt122 - 2*gt22L*(gtu11*PDstandardNth1phi + gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi); + G122 = Gt122 - 2*gt22L*(gtu11*PDstandardNth1phi + gtu21*PDstandardNth2phi + + gtu31*PDstandardNth3phi); - G222 = Gt222 + (4 - 2*gt22L*gtu22)*PDstandardNth2phi - 2*gt22L*(gtu21*PDstandardNth1phi + gtu32*PDstandardNth3phi); + G222 = Gt222 + (4 - 2*gt22L*gtu22)*PDstandardNth2phi - + 2*gt22L*(gtu21*PDstandardNth1phi + gtu32*PDstandardNth3phi); - G322 = Gt322 - 2*gt22L*(gtu31*PDstandardNth1phi + gtu32*PDstandardNth2phi + gtu33*PDstandardNth3phi); + G322 = Gt322 - 2*gt22L*(gtu31*PDstandardNth1phi + gtu32*PDstandardNth2phi + + gtu33*PDstandardNth3phi); - G123 = Gt123 - 2*gt23L*(gtu11*PDstandardNth1phi + gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi); + G123 = Gt123 - 2*gt23L*(gtu11*PDstandardNth1phi + gtu21*PDstandardNth2phi + + gtu31*PDstandardNth3phi); - G223 = Gt223 + 2*PDstandardNth3phi - 2*gt23L*(gtu21*PDstandardNth1phi + gtu22*PDstandardNth2phi + + G223 = Gt223 + 2*PDstandardNth3phi - + 2*gt23L*(gtu21*PDstandardNth1phi + gtu22*PDstandardNth2phi + gtu32*PDstandardNth3phi); - G323 = Gt323 + (2 - 2*gt23L*gtu32)*PDstandardNth2phi - 2*gt23L*(gtu31*PDstandardNth1phi + gtu33*PDstandardNth3phi); + G323 = Gt323 + (2 - 2*gt23L*gtu32)*PDstandardNth2phi - + 2*gt23L*(gtu31*PDstandardNth1phi + gtu33*PDstandardNth3phi); - G133 = Gt133 - 2*gt33L*(gtu11*PDstandardNth1phi + gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi); + G133 = Gt133 - 2*gt33L*(gtu11*PDstandardNth1phi + gtu21*PDstandardNth2phi + + gtu31*PDstandardNth3phi); - G233 = Gt233 - 2*gt33L*(gtu21*PDstandardNth1phi + gtu22*PDstandardNth2phi + gtu32*PDstandardNth3phi); + G233 = Gt233 - 2*gt33L*(gtu21*PDstandardNth1phi + gtu22*PDstandardNth2phi + + gtu32*PDstandardNth3phi); - G333 = Gt333 + 4*PDstandardNth3phi - 2*gt33L*(gtu31*PDstandardNth1phi + gtu32*PDstandardNth2phi + + G333 = Gt333 + 4*PDstandardNth3phi - + 2*gt33L*(gtu31*PDstandardNth1phi + gtu32*PDstandardNth2phi + gtu33*PDstandardNth3phi); R11 = Rphi11 + Rt11; @@ -998,165 +1276,294 @@ void ML_BSSN_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal R33 = Rphi33 + Rt33; - phirhsL = (PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3 + - 6*(beta1L*PDstandardNth1phi + beta2L*PDstandardNth2phi + beta3L*PDstandardNth3phi) - alphaL*trKL)/6.; + T00 = eTttL; + + T01 = eTtxL; + + T02 = eTtyL; + + T03 = eTtzL; + + T11 = eTxxL; + + T12 = eTxyL; + + T13 = eTxzL; + + T22 = eTyyL; - gt11rhsL = -2*alphaL*At11L + 2*(gt11L*PDstandardNth1beta1 + gt12L*PDstandardNth1beta2 + gt13L*PDstandardNth1beta3) + - beta1L*PDstandardNth1gt11 + beta2L*PDstandardNth2gt11 - - gt11L*ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3) + beta3L*PDstandardNth3gt11; + T23 = eTyzL; - gt12rhsL = -2*alphaL*At12L + gt22L*PDstandardNth1beta2 + gt23L*PDstandardNth1beta3 + beta1L*PDstandardNth1gt12 + - gt11L*PDstandardNth2beta1 + gt13L*PDstandardNth2beta3 + beta2L*PDstandardNth2gt12 + - gt12L*(kthird*(PDstandardNth1beta1 + PDstandardNth2beta2) - ktwothird*PDstandardNth3beta3) + - beta3L*PDstandardNth3gt12; + T33 = eTzzL; - gt13rhsL = -2*alphaL*At13L + gt23L*PDstandardNth1beta2 + gt33L*PDstandardNth1beta3 + beta1L*PDstandardNth1gt13 + - beta2L*PDstandardNth2gt13 + gt11L*PDstandardNth3beta1 + gt12L*PDstandardNth3beta2 + - gt13L*(-(ktwothird*PDstandardNth2beta2) + kthird*(PDstandardNth1beta1 + PDstandardNth3beta3)) + + rho = pow(alphaL,-2)*(T00 - 2*(beta2L*T02 + beta3L*T03) + + 2*(beta1L*(-T01 + beta2L*T12 + beta3L*T13) + beta2L*beta3L*T23) + + T11*SQR(beta1L) + T22*SQR(beta2L) + T33*SQR(beta3L)); + + S1 = (-T01 + beta1L*T11 + beta2L*T12 + beta3L*T13)*INV(alphaL); + + S2 = (-T02 + beta1L*T12 + beta2L*T22 + beta3L*T23)*INV(alphaL); + + S3 = (-T03 + beta1L*T13 + beta2L*T23 + beta3L*T33)*INV(alphaL); + + trS = gu11*T11 + gu22*T22 + 2*(gu21*T12 + gu31*T13 + gu32*T23) + gu33*T33; + + phirhsL = (PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3 + + 6*(beta1L*PDstandardNth1phi + beta2L*PDstandardNth2phi + + beta3L*PDstandardNth3phi) - alphaL*trKL)/6.; + + gt11rhsL = -2*alphaL*At11L + 2*(gt12L*PDstandardNth1beta2 + + gt13L*PDstandardNth1beta3) + beta1L*PDstandardNth1gt11 + + beta2L*PDstandardNth2gt11 + gt11L* + (kfourthird*PDstandardNth1beta1 - ktwothird*PDstandardNth2beta2 - + ktwothird*PDstandardNth3beta3) + beta3L*PDstandardNth3gt11; + + gt12rhsL = -2*alphaL*At12L + gt22L*PDstandardNth1beta2 + + gt23L*PDstandardNth1beta3 + beta1L*PDstandardNth1gt12 + + gt11L*PDstandardNth2beta1 + gt13L*PDstandardNth2beta3 + + beta2L*PDstandardNth2gt12 + gt12L* + (kthird*(PDstandardNth1beta1 + PDstandardNth2beta2) - + ktwothird*PDstandardNth3beta3) + beta3L*PDstandardNth3gt12; + + gt13rhsL = -2*alphaL*At13L + gt23L*PDstandardNth1beta2 + + gt33L*PDstandardNth1beta3 + beta1L*PDstandardNth1gt13 + + beta2L*PDstandardNth2gt13 + gt11L*PDstandardNth3beta1 + + gt12L*PDstandardNth3beta2 + gt13L* + (-(ktwothird*PDstandardNth2beta2) + + kthird*(PDstandardNth1beta1 + PDstandardNth3beta3)) + beta3L*PDstandardNth3gt13; gt22rhsL = -2*alphaL*At22L + beta1L*PDstandardNth1gt22 + - 2*(gt12L*PDstandardNth2beta1 + gt22L*PDstandardNth2beta2 + gt23L*PDstandardNth2beta3) + beta2L*PDstandardNth2gt22 - - gt22L*ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3) + beta3L*PDstandardNth3gt22; - - gt23rhsL = -2*alphaL*At23L + beta1L*PDstandardNth1gt23 + gt13L*PDstandardNth2beta1 + gt33L*PDstandardNth2beta3 + - beta2L*PDstandardNth2gt23 + gt12L*PDstandardNth3beta1 + gt22L*PDstandardNth3beta2 + - gt23L*(-(ktwothird*PDstandardNth1beta1) + kthird*(PDstandardNth2beta2 + PDstandardNth3beta3)) + + 2*(gt12L*PDstandardNth2beta1 + gt23L*PDstandardNth2beta3) + + beta2L*PDstandardNth2gt22 + gt22L* + (-(ktwothird*PDstandardNth1beta1) + kfourthird*PDstandardNth2beta2 - + ktwothird*PDstandardNth3beta3) + beta3L*PDstandardNth3gt22; + + gt23rhsL = -2*alphaL*At23L + beta1L*PDstandardNth1gt23 + + gt13L*PDstandardNth2beta1 + gt33L*PDstandardNth2beta3 + + beta2L*PDstandardNth2gt23 + gt12L*PDstandardNth3beta1 + + gt22L*PDstandardNth3beta2 + gt23L* + (-(ktwothird*PDstandardNth1beta1) + + kthird*(PDstandardNth2beta2 + PDstandardNth3beta3)) + beta3L*PDstandardNth3gt23; - gt33rhsL = -2*alphaL*At33L + beta1L*PDstandardNth1gt33 + beta2L*PDstandardNth2gt33 - - gt33L*ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3) + - 2*(gt13L*PDstandardNth3beta1 + gt23L*PDstandardNth3beta2 + gt33L*PDstandardNth3beta3) + beta3L*PDstandardNth3gt33; - - Xt1rhsL = gtu11*PDstandardNth11beta1 + beta1L*PDstandardNth1Xt1 + gtu22*PDstandardNth22beta1 + - beta2L*PDstandardNth2Xt1 + gtu33*PDstandardNth33beta1 + - kthird*(gtu11*(PDstandardNth11beta1 + PDstandardNth12beta2 + PDstandardNth13beta3) + - gtu21*(PDstandardNth12beta1 + PDstandardNth22beta2 + PDstandardNth23beta3) + - gtu31*(PDstandardNth13beta1 + PDstandardNth23beta2 + PDstandardNth33beta3)) - - 2*(Atu11*PDstandardNth1alpha + Atu21*PDstandardNth2alpha + Atu31*PDstandardNth3alpha) + - 2*(gtu21*PDstandardNth12beta1 + gtu31*PDstandardNth13beta1 + gtu32*PDstandardNth23beta1 + - alphaL*(Atu11*Gt111 + 2*Atu21*Gt112 + 2*Atu31*Gt113 + Atu22*Gt122 + 2*Atu32*Gt123 + Atu33*Gt133 + - 6*(Atu11*PDstandardNth1phi + Atu21*PDstandardNth2phi + Atu31*PDstandardNth3phi) - - ktwothird*(gtu11*PDstandardNth1trK + gtu21*PDstandardNth2trK + gtu31*PDstandardNth3trK))) + - beta3L*PDstandardNth3Xt1 + (-PDstandardNth1beta1 + - ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3))*Xtn1 - PDstandardNth2beta1*Xtn2 - - PDstandardNth3beta1*Xtn3; - - Xt2rhsL = gtu11*PDstandardNth11beta2 + beta1L*PDstandardNth1Xt2 + gtu22*PDstandardNth22beta2 + - beta2L*PDstandardNth2Xt2 + gtu33*PDstandardNth33beta2 + - kthird*(gtu21*(PDstandardNth11beta1 + PDstandardNth12beta2 + PDstandardNth13beta3) + - gtu22*(PDstandardNth12beta1 + PDstandardNth22beta2 + PDstandardNth23beta3) + - gtu32*(PDstandardNth13beta1 + PDstandardNth23beta2 + PDstandardNth33beta3)) - - 2*(Atu21*PDstandardNth1alpha + Atu22*PDstandardNth2alpha + Atu32*PDstandardNth3alpha) + - 2*(gtu21*PDstandardNth12beta2 + gtu31*PDstandardNth13beta2 + gtu32*PDstandardNth23beta2 + - alphaL*(Atu11*Gt211 + 2*Atu21*Gt212 + 2*Atu31*Gt213 + Atu22*Gt222 + 2*Atu32*Gt223 + Atu33*Gt233 + - 6*(Atu21*PDstandardNth1phi + Atu22*PDstandardNth2phi + Atu32*PDstandardNth3phi) - - ktwothird*(gtu21*PDstandardNth1trK + gtu22*PDstandardNth2trK + gtu32*PDstandardNth3trK))) + - beta3L*PDstandardNth3Xt2 - PDstandardNth1beta2*Xtn1 - PDstandardNth2beta2*Xtn2 + - ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3)*Xtn2 - PDstandardNth3beta2*Xtn3; - - Xt3rhsL = gtu11*PDstandardNth11beta3 + beta1L*PDstandardNth1Xt3 + gtu22*PDstandardNth22beta3 + - beta2L*PDstandardNth2Xt3 + gtu33*PDstandardNth33beta3 + - kthird*(gtu31*(PDstandardNth11beta1 + PDstandardNth12beta2 + PDstandardNth13beta3) + - gtu32*(PDstandardNth12beta1 + PDstandardNth22beta2 + PDstandardNth23beta3) + - gtu33*(PDstandardNth13beta1 + PDstandardNth23beta2 + PDstandardNth33beta3)) - - 2*(Atu31*PDstandardNth1alpha + Atu32*PDstandardNth2alpha + Atu33*PDstandardNth3alpha) + - 2*(gtu21*PDstandardNth12beta3 + gtu31*PDstandardNth13beta3 + gtu32*PDstandardNth23beta3 + - alphaL*(Atu11*Gt311 + 2*Atu21*Gt312 + 2*Atu31*Gt313 + Atu22*Gt322 + 2*Atu32*Gt323 + Atu33*Gt333 + - 6*(Atu31*PDstandardNth1phi + Atu32*PDstandardNth2phi + Atu33*PDstandardNth3phi) - - ktwothird*(gtu31*PDstandardNth1trK + gtu32*PDstandardNth2trK + gtu33*PDstandardNth3trK))) + - beta3L*PDstandardNth3Xt3 - PDstandardNth1beta3*Xtn1 - PDstandardNth2beta3*Xtn2 - PDstandardNth3beta3*Xtn3 + - ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3)*Xtn3; - - trKrhsL = -(gu11*PDstandardNth11alpha) - 2*gu21*PDstandardNth12alpha - 2*gu31*PDstandardNth13alpha + - (G111*gu11 + 2*G112*gu21 + G122*gu22 + 2*G113*gu31 + 2*G123*gu32 + G133*gu33)*PDstandardNth1alpha + - beta1L*PDstandardNth1trK - gu22*PDstandardNth22alpha - 2*gu32*PDstandardNth23alpha + - (G211*gu11 + 2*G212*gu21 + G222*gu22 + 2*G213*gu31 + 2*G223*gu32 + G233*gu33)*PDstandardNth2alpha + - beta2L*PDstandardNth2trK - gu33*PDstandardNth33alpha + G311*gu11*PDstandardNth3alpha + - G322*gu22*PDstandardNth3alpha + 2*G313*gu31*PDstandardNth3alpha + 2*G323*gu32*PDstandardNth3alpha + - G333*gu33*PDstandardNth3alpha + 2*(alphaL*Atm12*Atm21 + alphaL*Atm13*Atm31 + alphaL*Atm23*Atm32 + - G312*gu21*PDstandardNth3alpha) + beta3L*PDstandardNth3trK + alphaL*SQR(Atm11) + alphaL*SQR(Atm22) + - alphaL*SQR(Atm33) + alphaL*kthird*SQR(trKL); - - Ats11 = -PDstandardNth11alpha + G111*PDstandardNth1alpha + G211*PDstandardNth2alpha + G311*PDstandardNth3alpha + - alphaL*R11; - - Ats12 = -PDstandardNth12alpha + G112*PDstandardNth1alpha + G212*PDstandardNth2alpha + G312*PDstandardNth3alpha + - alphaL*R12; - - Ats13 = -PDstandardNth13alpha + G113*PDstandardNth1alpha + G213*PDstandardNth2alpha + G313*PDstandardNth3alpha + - alphaL*R13; - - Ats22 = G122*PDstandardNth1alpha - PDstandardNth22alpha + G222*PDstandardNth2alpha + G322*PDstandardNth3alpha + - alphaL*R22; - - Ats23 = G123*PDstandardNth1alpha - PDstandardNth23alpha + G223*PDstandardNth2alpha + G323*PDstandardNth3alpha + - alphaL*R23; - - Ats33 = G133*PDstandardNth1alpha + G233*PDstandardNth2alpha - PDstandardNth33alpha + G333*PDstandardNth3alpha + - alphaL*R33; - - trAts = Ats11*gu11 + Ats22*gu22 + 2*(Ats12*gu21 + Ats13*gu31 + Ats23*gu32) + Ats33*gu33; - - At11rhsL = beta1L*PDstandardNth1At11 + 2*(At11L*PDstandardNth1beta1 + At12L*PDstandardNth1beta2 + - At13L*PDstandardNth1beta3) + beta2L*PDstandardNth2At11 + beta3L*PDstandardNth3At11 - - At11L*ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3) + - em4phi*(Ats11 - g11*kthird*trAts) + alphaL*(-2*(At11L*Atm11 + At12L*Atm21 + At13L*Atm31) + At11L*trKL); - - At12rhsL = beta1L*PDstandardNth1At12 + At22L*PDstandardNth1beta2 + At23L*PDstandardNth1beta3 + - beta2L*PDstandardNth2At12 + At11L*PDstandardNth2beta1 + At13L*PDstandardNth2beta3 + beta3L*PDstandardNth3At12 + - At12L*(PDstandardNth1beta1 + PDstandardNth2beta2 - - ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3)) + - em4phi*(Ats12 - g12*kthird*trAts) + alphaL*(-2*(At11L*Atm12 + At12L*Atm22 + At13L*Atm32) + At12L*trKL); - - At13rhsL = beta1L*PDstandardNth1At13 + At23L*PDstandardNth1beta2 + At33L*PDstandardNth1beta3 + - beta2L*PDstandardNth2At13 + beta3L*PDstandardNth3At13 + At11L*PDstandardNth3beta1 + At12L*PDstandardNth3beta2 + - At13L*(PDstandardNth1beta1 + PDstandardNth3beta3 - - ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3)) + - em4phi*(Ats13 - g13*kthird*trAts) + alphaL*(-2*(At11L*Atm13 + At12L*Atm23 + At13L*Atm33) + At13L*trKL); - - At22rhsL = beta1L*PDstandardNth1At22 + beta2L*PDstandardNth2At22 + - 2*(At12L*PDstandardNth2beta1 + At22L*PDstandardNth2beta2 + At23L*PDstandardNth2beta3) + beta3L*PDstandardNth3At22 - - At22L*ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3) + - em4phi*(Ats22 - g22*kthird*trAts) + alphaL*(-2*(At12L*Atm12 + At22L*Atm22 + At23L*Atm32) + At22L*trKL); - - At23rhsL = beta1L*PDstandardNth1At23 + beta2L*PDstandardNth2At23 + At13L*PDstandardNth2beta1 + - At33L*PDstandardNth2beta3 + beta3L*PDstandardNth3At23 + At12L*PDstandardNth3beta1 + At22L*PDstandardNth3beta2 + - At23L*(PDstandardNth2beta2 + PDstandardNth3beta3 - - ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3)) + - em4phi*(Ats23 - g23*kthird*trAts) + alphaL*(-2*(At12L*Atm13 + At22L*Atm23 + At23L*Atm33) + At23L*trKL); - - At33rhsL = beta1L*PDstandardNth1At33 + beta2L*PDstandardNth2At33 + beta3L*PDstandardNth3At33 - - At33L*ktwothird*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3) + - 2*(At13L*PDstandardNth3beta1 + At23L*PDstandardNth3beta2 + At33L*PDstandardNth3beta3) + - em4phi*(Ats33 - g33*kthird*trAts) + alphaL*(-2*(At13L*Atm13 + At23L*Atm23 + At33L*Atm33) + At33L*trKL); - - alpharhsL = LapseAdvectionCoeff*(beta1L*PDstandardNth1alpha + beta2L*PDstandardNth2alpha + - beta3L*PDstandardNth3alpha) + harmonicF*(AL*(-1 + LapseAdvectionCoeff) - LapseAdvectionCoeff*trKL)* + gt33rhsL = -2*alphaL*At33L - gt33L*ktwothird*PDstandardNth1beta1 + + beta1L*PDstandardNth1gt33 - gt33L*ktwothird*PDstandardNth2beta2 + + beta2L*PDstandardNth2gt33 + 2*gt13L*PDstandardNth3beta1 + + 2*gt23L*PDstandardNth3beta2 + gt33L*kfourthird*PDstandardNth3beta3 + + beta3L*PDstandardNth3gt33; + + Xt1rhsL = kthird*(7*(gtu21*PDstandardNth12beta1 + + gtu31*PDstandardNth13beta1) + + gtu11*(4*PDstandardNth11beta1 + PDstandardNth12beta2 + + PDstandardNth13beta3) + + gtu21*(PDstandardNth22beta2 + PDstandardNth23beta3) + + gtu31*(PDstandardNth23beta2 + PDstandardNth33beta3) - + 6*(Atu11*PDstandardNth1alpha + Atu21*PDstandardNth2alpha + + Atu31*PDstandardNth3alpha) + + 6*(gtu32*PDstandardNth23beta1 + + alphaL*(Atu11*Gt111 + Atu22*Gt122 + + 2*(Atu21*Gt112 + Atu31*Gt113 + Atu32*Gt123) + Atu33*Gt133 + + 6*(Atu11*PDstandardNth1phi + Atu21*PDstandardNth2phi + + Atu31*PDstandardNth3phi) - + ktwothird*(gtu11*PDstandardNth1trK + gtu21*PDstandardNth2trK + + gtu31*PDstandardNth3trK))) + + 3*(beta1L*PDstandardNth1Xt1 + gtu22*PDstandardNth22beta1 + + beta2L*PDstandardNth2Xt1 + gtu33*PDstandardNth33beta1 + + beta3L*PDstandardNth3Xt1) - + 150.7964473723100754462068823974161384415*alphaL* + (gtu11*S1 + gtu21*S2 + gtu31*S3) + + (-3*PDstandardNth1beta1 + 2* + (PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3))* + Xtn1 - 3*(PDstandardNth2beta1*Xtn2 + PDstandardNth3beta1*Xtn3)); + + Xt2rhsL = kthird*(gtu21*(PDstandardNth11beta1 + 7*PDstandardNth12beta2 + + PDstandardNth13beta3) + + gtu22*(PDstandardNth12beta1 + 4*PDstandardNth22beta2 + + PDstandardNth23beta3) + + gtu32*(PDstandardNth13beta1 + 7*PDstandardNth23beta2 + + PDstandardNth33beta3) - + 6*(Atu21*PDstandardNth1alpha + Atu22*PDstandardNth2alpha + + Atu32*PDstandardNth3alpha) + + 6*(gtu31*PDstandardNth13beta2 + + alphaL*(Atu11*Gt211 + Atu22*Gt222 + + 2*(Atu21*Gt212 + Atu31*Gt213 + Atu32*Gt223) + Atu33*Gt233 + + 6*(Atu21*PDstandardNth1phi + Atu22*PDstandardNth2phi + + Atu32*PDstandardNth3phi) - + ktwothird*(gtu21*PDstandardNth1trK + gtu22*PDstandardNth2trK + + gtu32*PDstandardNth3trK))) + + 3*(gtu11*PDstandardNth11beta2 + beta1L*PDstandardNth1Xt2 + + beta2L*PDstandardNth2Xt2 + gtu33*PDstandardNth33beta2 + + beta3L*PDstandardNth3Xt2) - + 150.7964473723100754462068823974161384415*alphaL* + (gtu21*S1 + gtu22*S2 + gtu32*S3) + + 2*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3)* + Xtn2 - 3*(PDstandardNth1beta2*Xtn1 + PDstandardNth2beta2*Xtn2 + + PDstandardNth3beta2*Xtn3)); + + Xt3rhsL = kthird*(gtu31*(PDstandardNth11beta1 + PDstandardNth12beta2 + + 7*PDstandardNth13beta3) + + gtu32*(PDstandardNth12beta1 + PDstandardNth22beta2 + + 7*PDstandardNth23beta3) + + gtu33*(PDstandardNth13beta1 + PDstandardNth23beta2 + + 4*PDstandardNth33beta3) - + 6*(Atu31*PDstandardNth1alpha + Atu32*PDstandardNth2alpha + + Atu33*PDstandardNth3alpha) + + 6*(gtu21*PDstandardNth12beta3 + + alphaL*(Atu11*Gt311 + Atu22*Gt322 + + 2*(Atu21*Gt312 + Atu31*Gt313 + Atu32*Gt323) + Atu33*Gt333 + + 6*(Atu31*PDstandardNth1phi + Atu32*PDstandardNth2phi + + Atu33*PDstandardNth3phi) - + ktwothird*(gtu31*PDstandardNth1trK + gtu32*PDstandardNth2trK + + gtu33*PDstandardNth3trK))) + + 3*(gtu11*PDstandardNth11beta3 + beta1L*PDstandardNth1Xt3 + + gtu22*PDstandardNth22beta3 + beta2L*PDstandardNth2Xt3 + + beta3L*PDstandardNth3Xt3) - + 150.7964473723100754462068823974161384415*alphaL* + (gtu31*S1 + gtu32*S2 + gtu33*S3) + + 2*(PDstandardNth1beta1 + PDstandardNth2beta2 + PDstandardNth3beta3)* + Xtn3 - 3*(PDstandardNth1beta3*Xtn1 + PDstandardNth2beta3*Xtn2 + + PDstandardNth3beta3*Xtn3)); + + trKrhsL = (G111*gu11 + G122*gu22 + 2.*(G112*gu21 + G113*gu31 + G123*gu32) + + G133*gu33)*PDstandardNth1alpha + beta1L*PDstandardNth1trK - + 2.*(gu21*PDstandardNth12alpha + gu31*PDstandardNth13alpha + + gu32*PDstandardNth23alpha) + + (G211*gu11 + G222*gu22 + 2.*(G212*gu21 + G213*gu31 + G223*gu32) + + G233*gu33)*PDstandardNth2alpha + beta2L*PDstandardNth2trK - + 1.*(gu11*PDstandardNth11alpha + gu22*PDstandardNth22alpha + + gu33*PDstandardNth33alpha) + + (G311*gu11 + G322*gu22 + 2.*(G313*gu31 + G323*gu32) + G333*gu33)* + PDstandardNth3alpha + 2.*(alphaL* + (Atm12*Atm21 + Atm13*Atm31 + Atm23*Atm32) + + G312*gu21*PDstandardNth3alpha) + beta3L*PDstandardNth3trK + + alphaL*(12.56637061435917295385057353311801153679*(rho + trS) + + SQR(Atm11) + SQR(Atm22) + SQR(Atm33) + + 0.3333333333333333333333333333333333333333*SQR(trKL)); + + Ats11 = -PDstandardNth11alpha + G111*PDstandardNth1alpha + + G211*PDstandardNth2alpha + G311*PDstandardNth3alpha + alphaL*R11; + + Ats12 = -PDstandardNth12alpha + G112*PDstandardNth1alpha + + G212*PDstandardNth2alpha + G312*PDstandardNth3alpha + alphaL*R12; + + Ats13 = -PDstandardNth13alpha + G113*PDstandardNth1alpha + + G213*PDstandardNth2alpha + G313*PDstandardNth3alpha + alphaL*R13; + + Ats22 = G122*PDstandardNth1alpha - PDstandardNth22alpha + + G222*PDstandardNth2alpha + G322*PDstandardNth3alpha + alphaL*R22; + + Ats23 = G123*PDstandardNth1alpha - PDstandardNth23alpha + + G223*PDstandardNth2alpha + G323*PDstandardNth3alpha + alphaL*R23; + + Ats33 = G133*PDstandardNth1alpha + G233*PDstandardNth2alpha - + PDstandardNth33alpha + G333*PDstandardNth3alpha + alphaL*R33; + + trAts = Ats11*gu11 + Ats22*gu22 + 2*(Ats12*gu21 + Ats13*gu31 + Ats23*gu32) + + Ats33*gu33; + + At11rhsL = -2.*alphaL*(At11L*Atm11 + At12L*Atm21 + At13L*Atm31) + + beta1L*PDstandardNth1At11 + 2.* + (At12L*PDstandardNth1beta2 + At13L*PDstandardNth1beta3) + + beta2L*PDstandardNth2At11 + beta3L*PDstandardNth3At11 + + At11L*(1.333333333333333333333333333333333333333*PDstandardNth1beta1 - + 0.6666666666666666666666666666666666666667* + (PDstandardNth2beta2 + PDstandardNth3beta3) + alphaL*trKL) + + em4phi*(Ats11 - 0.3333333333333333333333333333333333333333*g11*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T11 + + 8.377580409572781969233715688745341024526*g11*trS)); + + At12rhsL = -2.*alphaL*(At11L*Atm12 + At12L*Atm22 + At13L*Atm32) + + beta1L*PDstandardNth1At12 + At22L*PDstandardNth1beta2 + + At23L*PDstandardNth1beta3 + beta2L*PDstandardNth2At12 + + At11L*PDstandardNth2beta1 + At13L*PDstandardNth2beta3 + + beta3L*PDstandardNth3At12 + At12L* + (0.3333333333333333333333333333333333333333* + (PDstandardNth1beta1 + PDstandardNth2beta2) - + 0.6666666666666666666666666666666666666667*PDstandardNth3beta3 + + alphaL*trKL) + em4phi*(Ats12 - + 0.3333333333333333333333333333333333333333*g12*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T12 + + 8.377580409572781969233715688745341024526*g12*trS)); + + At13rhsL = -2.*alphaL*(At11L*Atm13 + At12L*Atm23 + At13L*Atm33) + + beta1L*PDstandardNth1At13 + At23L*PDstandardNth1beta2 + + At33L*PDstandardNth1beta3 + beta2L*PDstandardNth2At13 + + beta3L*PDstandardNth3At13 + At11L*PDstandardNth3beta1 + + At12L*PDstandardNth3beta2 + At13L* + (-0.6666666666666666666666666666666666666667*PDstandardNth2beta2 + + 0.3333333333333333333333333333333333333333* + (PDstandardNth1beta1 + PDstandardNth3beta3) + alphaL*trKL) + + em4phi*(Ats13 - 0.3333333333333333333333333333333333333333*g13*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T13 + + 8.377580409572781969233715688745341024526*g13*trS)); + + At22rhsL = -2.*alphaL*(At12L*Atm12 + At22L*Atm22 + At23L*Atm32) + + beta1L*PDstandardNth1At22 + beta2L*PDstandardNth2At22 + + 2.*(At12L*PDstandardNth2beta1 + At23L*PDstandardNth2beta3) + + beta3L*PDstandardNth3At22 + At22L* + (1.333333333333333333333333333333333333333*PDstandardNth2beta2 - + 0.6666666666666666666666666666666666666667* + (PDstandardNth1beta1 + PDstandardNth3beta3) + alphaL*trKL) + + em4phi*(Ats22 - 0.3333333333333333333333333333333333333333*g22*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T22 + + 8.377580409572781969233715688745341024526*g22*trS)); + + At23rhsL = -2.*alphaL*(At12L*Atm13 + At22L*Atm23 + At23L*Atm33) + + beta1L*PDstandardNth1At23 + beta2L*PDstandardNth2At23 + + At13L*PDstandardNth2beta1 + At33L*PDstandardNth2beta3 + + beta3L*PDstandardNth3At23 + At12L*PDstandardNth3beta1 + + At22L*PDstandardNth3beta2 + At23L* + (-0.6666666666666666666666666666666666666667*PDstandardNth1beta1 + + 0.3333333333333333333333333333333333333333* + (PDstandardNth2beta2 + PDstandardNth3beta3) + alphaL*trKL) + + em4phi*(Ats23 - 0.3333333333333333333333333333333333333333*g23*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T23 + + 8.377580409572781969233715688745341024526*g23*trS)); + + At33rhsL = -2.*alphaL*(At13L*Atm13 + At23L*Atm23 + At33L*Atm33) + + beta1L*PDstandardNth1At33 + beta2L*PDstandardNth2At33 + + beta3L*PDstandardNth3At33 + 2.* + (At13L*PDstandardNth3beta1 + At23L*PDstandardNth3beta2) + + At33L*(-0.6666666666666666666666666666666666666667* + (PDstandardNth1beta1 + PDstandardNth2beta2) + + 1.333333333333333333333333333333333333333*PDstandardNth3beta3 + + alphaL*trKL) + em4phi*(Ats33 - + 0.3333333333333333333333333333333333333333*g33*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T33 + + 8.377580409572781969233715688745341024526*g33*trS)); + + alpharhsL = LapseAdvectionCoeff* + (beta1L*PDstandardNth1alpha + beta2L*PDstandardNth2alpha + + beta3L*PDstandardNth3alpha) + + harmonicF*(AL*(-1 + LapseAdvectionCoeff) - LapseAdvectionCoeff*trKL)* pow(alphaL,harmonicN); ArhsL = (-1 + LapseAdvectionCoeff)*(AL*AlphaDriver - trKrhsL); - beta1rhsL = (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + beta3L*PDstandardNth3beta1)* - ShiftAdvectionCoeff + B1L*ShiftGammaCoeff; + beta1rhsL = (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + + beta3L*PDstandardNth3beta1)*ShiftAdvectionCoeff + B1L*ShiftGammaCoeff; - beta2rhsL = (beta1L*PDstandardNth1beta2 + beta2L*PDstandardNth2beta2 + beta3L*PDstandardNth3beta2)* - ShiftAdvectionCoeff + B2L*ShiftGammaCoeff; + beta2rhsL = (beta1L*PDstandardNth1beta2 + beta2L*PDstandardNth2beta2 + + beta3L*PDstandardNth3beta2)*ShiftAdvectionCoeff + B2L*ShiftGammaCoeff; - beta3rhsL = (beta1L*PDstandardNth1beta3 + beta2L*PDstandardNth2beta3 + beta3L*PDstandardNth3beta3)* - ShiftAdvectionCoeff + B3L*ShiftGammaCoeff; + beta3rhsL = (beta1L*PDstandardNth1beta3 + beta2L*PDstandardNth2beta3 + + beta3L*PDstandardNth3beta3)*ShiftAdvectionCoeff + B3L*ShiftGammaCoeff; B1rhsL = -(B1L*BetaDriver) + (beta1L*(PDstandardNth1B1 - PDstandardNth1Xt1) + - beta2L*(PDstandardNth2B1 - PDstandardNth2Xt1) + beta3L*(PDstandardNth3B1 - PDstandardNth3Xt1))* - ShiftAdvectionCoeff + Xt1rhsL; + beta2L*(PDstandardNth2B1 - PDstandardNth2Xt1) + + beta3L*(PDstandardNth3B1 - PDstandardNth3Xt1))*ShiftAdvectionCoeff + + Xt1rhsL; B2rhsL = -(B2L*BetaDriver) + (beta1L*(PDstandardNth1B2 - PDstandardNth1Xt2) + - beta2L*(PDstandardNth2B2 - PDstandardNth2Xt2) + beta3L*(PDstandardNth3B2 - PDstandardNth3Xt2))* - ShiftAdvectionCoeff + Xt2rhsL; + beta2L*(PDstandardNth2B2 - PDstandardNth2Xt2) + + beta3L*(PDstandardNth3B2 - PDstandardNth3Xt2))*ShiftAdvectionCoeff + + Xt2rhsL; B3rhsL = -(B3L*BetaDriver) + (beta1L*(PDstandardNth1B3 - PDstandardNth1Xt3) + - beta2L*(PDstandardNth2B3 - PDstandardNth2Xt3) + beta3L*(PDstandardNth3B3 - PDstandardNth3Xt3))* - ShiftAdvectionCoeff + Xt3rhsL; + beta2L*(PDstandardNth2B3 - PDstandardNth2Xt3) + + beta3L*(PDstandardNth3B3 - PDstandardNth3Xt3))*ShiftAdvectionCoeff + + Xt3rhsL; /* Copy local copies back to grid functions */ diff --git a/ML_BSSN/src/ML_BSSN_RHSBoundary.c b/ML_BSSN/src/ML_BSSN_RHSBoundary.c new file mode 100644 index 0000000..b747af2 --- /dev/null +++ b/ML_BSSN/src/ML_BSSN_RHSBoundary.c @@ -0,0 +1,467 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_RHSBoundary_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_RHSBoundary_Body"); + } + + if (cctk_iteration % ML_BSSN_RHSBoundary_calc_every != ML_BSSN_RHSBoundary_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_RHSBoundary, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + CCTK_REAL detgt = INITVALUE; + CCTK_REAL em4phi = INITVALUE; + CCTK_REAL gtu11 = INITVALUE, gtu21 = INITVALUE, gtu22 = INITVALUE, gtu31 = INITVALUE, gtu32 = INITVALUE, gtu33 = INITVALUE; + CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; + CCTK_REAL nlen = INITVALUE, nlen2 = INITVALUE; + CCTK_REAL nn1 = INITVALUE, nn2 = INITVALUE, nn3 = INITVALUE; + CCTK_REAL nu1 = INITVALUE, nu2 = INITVALUE, nu3 = INITVALUE; + CCTK_REAL su1 = INITVALUE, su2 = INITVALUE, su3 = INITVALUE; + CCTK_REAL vg = INITVALUE; + + /* Declare local copies of grid functions */ + CCTK_REAL AL = INITVALUE; + CCTK_REAL alphaL = INITVALUE, alpharhsL = INITVALUE; + CCTK_REAL ArhsL = INITVALUE; + CCTK_REAL At11L = INITVALUE, At11rhsL = INITVALUE, At12L = INITVALUE, At12rhsL = INITVALUE, At13L = INITVALUE, At13rhsL = INITVALUE; + CCTK_REAL At22L = INITVALUE, At22rhsL = INITVALUE, At23L = INITVALUE, At23rhsL = INITVALUE, At33L = INITVALUE, At33rhsL = INITVALUE; + CCTK_REAL B1L = INITVALUE, B1rhsL = INITVALUE, B2L = INITVALUE, B2rhsL = INITVALUE, B3L = INITVALUE, B3rhsL = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta1rhsL = INITVALUE, beta2L = INITVALUE, beta2rhsL = INITVALUE, beta3L = INITVALUE, beta3rhsL = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt11rhsL = INITVALUE, gt12L = INITVALUE, gt12rhsL = INITVALUE, gt13L = INITVALUE, gt13rhsL = INITVALUE; + CCTK_REAL gt22L = INITVALUE, gt22rhsL = INITVALUE, gt23L = INITVALUE, gt23rhsL = INITVALUE, gt33L = INITVALUE, gt33rhsL = INITVALUE; + CCTK_REAL phiL = INITVALUE, phirhsL = INITVALUE; + CCTK_REAL trKL = INITVALUE, trKrhsL = INITVALUE; + CCTK_REAL Xt1L = INITVALUE, Xt1rhsL = INITVALUE, Xt2L = INITVALUE, Xt2rhsL = INITVALUE, Xt3L = INITVALUE, Xt3rhsL = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + CCTK_REAL PDMinus1A = INITVALUE; + CCTK_REAL PDMinus2A = INITVALUE; + CCTK_REAL PDMinus3A = INITVALUE; + CCTK_REAL PDMinus1alpha = INITVALUE; + CCTK_REAL PDMinus2alpha = INITVALUE; + CCTK_REAL PDMinus3alpha = INITVALUE; + CCTK_REAL PDMinus1At11 = INITVALUE; + CCTK_REAL PDMinus2At11 = INITVALUE; + CCTK_REAL PDMinus3At11 = INITVALUE; + CCTK_REAL PDMinus1At12 = INITVALUE; + CCTK_REAL PDMinus2At12 = INITVALUE; + CCTK_REAL PDMinus3At12 = INITVALUE; + CCTK_REAL PDMinus1At13 = INITVALUE; + CCTK_REAL PDMinus2At13 = INITVALUE; + CCTK_REAL PDMinus3At13 = INITVALUE; + CCTK_REAL PDMinus1At22 = INITVALUE; + CCTK_REAL PDMinus2At22 = INITVALUE; + CCTK_REAL PDMinus3At22 = INITVALUE; + CCTK_REAL PDMinus1At23 = INITVALUE; + CCTK_REAL PDMinus2At23 = INITVALUE; + CCTK_REAL PDMinus3At23 = INITVALUE; + CCTK_REAL PDMinus1At33 = INITVALUE; + CCTK_REAL PDMinus2At33 = INITVALUE; + CCTK_REAL PDMinus3At33 = INITVALUE; + CCTK_REAL PDMinus1B1 = INITVALUE; + CCTK_REAL PDMinus2B1 = INITVALUE; + CCTK_REAL PDMinus3B1 = INITVALUE; + CCTK_REAL PDMinus1B2 = INITVALUE; + CCTK_REAL PDMinus2B2 = INITVALUE; + CCTK_REAL PDMinus3B2 = INITVALUE; + CCTK_REAL PDMinus1B3 = INITVALUE; + CCTK_REAL PDMinus2B3 = INITVALUE; + CCTK_REAL PDMinus3B3 = INITVALUE; + CCTK_REAL PDMinus1beta1 = INITVALUE; + CCTK_REAL PDMinus2beta1 = INITVALUE; + CCTK_REAL PDMinus3beta1 = INITVALUE; + CCTK_REAL PDMinus1beta2 = INITVALUE; + CCTK_REAL PDMinus2beta2 = INITVALUE; + CCTK_REAL PDMinus3beta2 = INITVALUE; + CCTK_REAL PDMinus1beta3 = INITVALUE; + CCTK_REAL PDMinus2beta3 = INITVALUE; + CCTK_REAL PDMinus3beta3 = INITVALUE; + CCTK_REAL PDMinus1gt11 = INITVALUE; + CCTK_REAL PDMinus2gt11 = INITVALUE; + CCTK_REAL PDMinus3gt11 = INITVALUE; + CCTK_REAL PDMinus1gt12 = INITVALUE; + CCTK_REAL PDMinus2gt12 = INITVALUE; + CCTK_REAL PDMinus3gt12 = INITVALUE; + CCTK_REAL PDMinus1gt13 = INITVALUE; + CCTK_REAL PDMinus2gt13 = INITVALUE; + CCTK_REAL PDMinus3gt13 = INITVALUE; + CCTK_REAL PDMinus1gt22 = INITVALUE; + CCTK_REAL PDMinus2gt22 = INITVALUE; + CCTK_REAL PDMinus3gt22 = INITVALUE; + CCTK_REAL PDMinus1gt23 = INITVALUE; + CCTK_REAL PDMinus2gt23 = INITVALUE; + CCTK_REAL PDMinus3gt23 = INITVALUE; + CCTK_REAL PDMinus1gt33 = INITVALUE; + CCTK_REAL PDMinus2gt33 = INITVALUE; + CCTK_REAL PDMinus3gt33 = INITVALUE; + CCTK_REAL PDMinus1phi = INITVALUE; + CCTK_REAL PDMinus2phi = INITVALUE; + CCTK_REAL PDMinus3phi = INITVALUE; + CCTK_REAL PDMinus1trK = INITVALUE; + CCTK_REAL PDMinus2trK = INITVALUE; + CCTK_REAL PDMinus3trK = INITVALUE; + CCTK_REAL PDMinus1Xt1 = INITVALUE; + CCTK_REAL PDMinus2Xt1 = INITVALUE; + CCTK_REAL PDMinus3Xt1 = INITVALUE; + CCTK_REAL PDMinus1Xt2 = INITVALUE; + CCTK_REAL PDMinus2Xt2 = INITVALUE; + CCTK_REAL PDMinus3Xt2 = INITVALUE; + CCTK_REAL PDMinus1Xt3 = INITVALUE; + CCTK_REAL PDMinus2Xt3 = INITVALUE; + CCTK_REAL PDMinus3Xt3 = INITVALUE; + + /* Assign local copies of grid functions */ + AL = A[index]; + alphaL = alpha[index]; + At11L = At11[index]; + At12L = At12[index]; + At13L = At13[index]; + At22L = At22[index]; + At23L = At23[index]; + At33L = At33[index]; + B1L = B1[index]; + B2L = B2[index]; + B3L = B3[index]; + beta1L = beta1[index]; + beta2L = beta2[index]; + beta3L = beta3[index]; + gt11L = gt11[index]; + gt12L = gt12[index]; + gt13L = gt13[index]; + gt22L = gt22[index]; + gt23L = gt23[index]; + gt33L = gt33[index]; + phiL = phi[index]; + trKL = trK[index]; + Xt1L = Xt1[index]; + Xt2L = Xt2[index]; + Xt3L = Xt3[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + PDMinus1A = PDMinus1(A, i, j, k); + PDMinus2A = PDMinus2(A, i, j, k); + PDMinus3A = PDMinus3(A, i, j, k); + PDMinus1alpha = PDMinus1(alpha, i, j, k); + PDMinus2alpha = PDMinus2(alpha, i, j, k); + PDMinus3alpha = PDMinus3(alpha, i, j, k); + PDMinus1At11 = PDMinus1(At11, i, j, k); + PDMinus2At11 = PDMinus2(At11, i, j, k); + PDMinus3At11 = PDMinus3(At11, i, j, k); + PDMinus1At12 = PDMinus1(At12, i, j, k); + PDMinus2At12 = PDMinus2(At12, i, j, k); + PDMinus3At12 = PDMinus3(At12, i, j, k); + PDMinus1At13 = PDMinus1(At13, i, j, k); + PDMinus2At13 = PDMinus2(At13, i, j, k); + PDMinus3At13 = PDMinus3(At13, i, j, k); + PDMinus1At22 = PDMinus1(At22, i, j, k); + PDMinus2At22 = PDMinus2(At22, i, j, k); + PDMinus3At22 = PDMinus3(At22, i, j, k); + PDMinus1At23 = PDMinus1(At23, i, j, k); + PDMinus2At23 = PDMinus2(At23, i, j, k); + PDMinus3At23 = PDMinus3(At23, i, j, k); + PDMinus1At33 = PDMinus1(At33, i, j, k); + PDMinus2At33 = PDMinus2(At33, i, j, k); + PDMinus3At33 = PDMinus3(At33, i, j, k); + PDMinus1B1 = PDMinus1(B1, i, j, k); + PDMinus2B1 = PDMinus2(B1, i, j, k); + PDMinus3B1 = PDMinus3(B1, i, j, k); + PDMinus1B2 = PDMinus1(B2, i, j, k); + PDMinus2B2 = PDMinus2(B2, i, j, k); + PDMinus3B2 = PDMinus3(B2, i, j, k); + PDMinus1B3 = PDMinus1(B3, i, j, k); + PDMinus2B3 = PDMinus2(B3, i, j, k); + PDMinus3B3 = PDMinus3(B3, i, j, k); + PDMinus1beta1 = PDMinus1(beta1, i, j, k); + PDMinus2beta1 = PDMinus2(beta1, i, j, k); + PDMinus3beta1 = PDMinus3(beta1, i, j, k); + PDMinus1beta2 = PDMinus1(beta2, i, j, k); + PDMinus2beta2 = PDMinus2(beta2, i, j, k); + PDMinus3beta2 = PDMinus3(beta2, i, j, k); + PDMinus1beta3 = PDMinus1(beta3, i, j, k); + PDMinus2beta3 = PDMinus2(beta3, i, j, k); + PDMinus3beta3 = PDMinus3(beta3, i, j, k); + PDMinus1gt11 = PDMinus1(gt11, i, j, k); + PDMinus2gt11 = PDMinus2(gt11, i, j, k); + PDMinus3gt11 = PDMinus3(gt11, i, j, k); + PDMinus1gt12 = PDMinus1(gt12, i, j, k); + PDMinus2gt12 = PDMinus2(gt12, i, j, k); + PDMinus3gt12 = PDMinus3(gt12, i, j, k); + PDMinus1gt13 = PDMinus1(gt13, i, j, k); + PDMinus2gt13 = PDMinus2(gt13, i, j, k); + PDMinus3gt13 = PDMinus3(gt13, i, j, k); + PDMinus1gt22 = PDMinus1(gt22, i, j, k); + PDMinus2gt22 = PDMinus2(gt22, i, j, k); + PDMinus3gt22 = PDMinus3(gt22, i, j, k); + PDMinus1gt23 = PDMinus1(gt23, i, j, k); + PDMinus2gt23 = PDMinus2(gt23, i, j, k); + PDMinus3gt23 = PDMinus3(gt23, i, j, k); + PDMinus1gt33 = PDMinus1(gt33, i, j, k); + PDMinus2gt33 = PDMinus2(gt33, i, j, k); + PDMinus3gt33 = PDMinus3(gt33, i, j, k); + PDMinus1phi = PDMinus1(phi, i, j, k); + PDMinus2phi = PDMinus2(phi, i, j, k); + PDMinus3phi = PDMinus3(phi, i, j, k); + PDMinus1trK = PDMinus1(trK, i, j, k); + PDMinus2trK = PDMinus2(trK, i, j, k); + PDMinus3trK = PDMinus3(trK, i, j, k); + PDMinus1Xt1 = PDMinus1(Xt1, i, j, k); + PDMinus2Xt1 = PDMinus2(Xt1, i, j, k); + PDMinus3Xt1 = PDMinus3(Xt1, i, j, k); + PDMinus1Xt2 = PDMinus1(Xt2, i, j, k); + PDMinus2Xt2 = PDMinus2(Xt2, i, j, k); + PDMinus3Xt2 = PDMinus3(Xt2, i, j, k); + PDMinus1Xt3 = PDMinus1(Xt3, i, j, k); + PDMinus2Xt3 = PDMinus2(Xt3, i, j, k); + PDMinus3Xt3 = PDMinus3(Xt3, i, j, k); + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + detgt = 1; + + gtu11 = INV(detgt)*(gt22L*gt33L - SQR(gt23L)); + + gtu21 = (gt13L*gt23L - gt12L*gt33L)*INV(detgt); + + gtu31 = (-(gt13L*gt22L) + gt12L*gt23L)*INV(detgt); + + gtu22 = INV(detgt)*(gt11L*gt33L - SQR(gt13L)); + + gtu32 = (gt12L*gt13L - gt11L*gt23L)*INV(detgt); + + gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); + + em4phi = exp(-4*phiL); + + gu11 = em4phi*gtu11; + + gu21 = em4phi*gtu21; + + gu31 = em4phi*gtu31; + + gu22 = em4phi*gtu22; + + gu32 = em4phi*gtu32; + + gu33 = em4phi*gtu33; + + nn1 = normal[0]; + + nn2 = normal[1]; + + nn3 = normal[2]; + + nu1 = gu11*nn1 + gu21*nn2 + gu31*nn3; + + nu2 = gu21*nn1 + gu22*nn2 + gu32*nn3; + + nu3 = gu31*nn1 + gu32*nn2 + gu33*nn3; + + nlen2 = nn1*nu1 + nn2*nu2 + nn3*nu3; + + nlen = pow(nlen2,0.5); + + su1 = nu1*INV(nlen); + + su2 = nu2*INV(nlen); + + su3 = nu3*INV(nlen); + + vg = pow(harmonicF,0.5); + + phirhsL = -((PDMinus1phi*su1 + PDMinus2phi*su2 + PDMinus3phi*su3)*vg); + + gt11rhsL = -(PDMinus1gt11*su1) - PDMinus2gt11*su2 - PDMinus3gt11*su3; + + gt12rhsL = -(PDMinus1gt12*su1) - PDMinus2gt12*su2 - PDMinus3gt12*su3; + + gt13rhsL = -(PDMinus1gt13*su1) - PDMinus2gt13*su2 - PDMinus3gt13*su3; + + gt22rhsL = -(PDMinus1gt22*su1) - PDMinus2gt22*su2 - PDMinus3gt22*su3; + + gt23rhsL = -(PDMinus1gt23*su1) - PDMinus2gt23*su2 - PDMinus3gt23*su3; + + gt33rhsL = -(PDMinus1gt33*su1) - PDMinus2gt33*su2 - PDMinus3gt33*su3; + + trKrhsL = -((PDMinus1trK*su1 + PDMinus2trK*su2 + PDMinus3trK*su3)*vg); + + At11rhsL = -(PDMinus1At11*su1) - PDMinus2At11*su2 - PDMinus3At11*su3; + + At12rhsL = -(PDMinus1At12*su1) - PDMinus2At12*su2 - PDMinus3At12*su3; + + At13rhsL = -(PDMinus1At13*su1) - PDMinus2At13*su2 - PDMinus3At13*su3; + + At22rhsL = -(PDMinus1At22*su1) - PDMinus2At22*su2 - PDMinus3At22*su3; + + At23rhsL = -(PDMinus1At23*su1) - PDMinus2At23*su2 - PDMinus3At23*su3; + + At33rhsL = -(PDMinus1At33*su1) - PDMinus2At33*su2 - PDMinus3At33*su3; + + Xt1rhsL = -(PDMinus1Xt1*su1) - PDMinus2Xt1*su2 - PDMinus3Xt1*su3; + + Xt2rhsL = -(PDMinus1Xt2*su1) - PDMinus2Xt2*su2 - PDMinus3Xt2*su3; + + Xt3rhsL = -(PDMinus1Xt3*su1) - PDMinus2Xt3*su2 - PDMinus3Xt3*su3; + + alpharhsL = -((PDMinus1alpha*su1 + PDMinus2alpha*su2 + PDMinus3alpha*su3)*vg); + + ArhsL = -((PDMinus1A*su1 + PDMinus2A*su2 + PDMinus3A*su3)*vg); + + beta1rhsL = -(PDMinus1beta1*su1) - PDMinus2beta1*su2 - PDMinus3beta1*su3; + + beta2rhsL = -(PDMinus1beta2*su1) - PDMinus2beta2*su2 - PDMinus3beta2*su3; + + beta3rhsL = -(PDMinus1beta3*su1) - PDMinus2beta3*su2 - PDMinus3beta3*su3; + + B1rhsL = -(PDMinus1B1*su1) - PDMinus2B1*su2 - PDMinus3B1*su3; + + B2rhsL = -(PDMinus1B2*su1) - PDMinus2B2*su2 - PDMinus3B2*su3; + + B3rhsL = -(PDMinus1B3*su1) - PDMinus2B3*su2 - PDMinus3B3*su3; + + + /* Copy local copies back to grid functions */ + alpharhs[index] = alpharhsL; + Arhs[index] = ArhsL; + At11rhs[index] = At11rhsL; + At12rhs[index] = At12rhsL; + At13rhs[index] = At13rhsL; + At22rhs[index] = At22rhsL; + At23rhs[index] = At23rhsL; + At33rhs[index] = At33rhsL; + B1rhs[index] = B1rhsL; + B2rhs[index] = B2rhsL; + B3rhs[index] = B3rhsL; + beta1rhs[index] = beta1rhsL; + beta2rhs[index] = beta2rhsL; + beta3rhs[index] = beta3rhsL; + gt11rhs[index] = gt11rhsL; + gt12rhs[index] = gt12rhsL; + gt13rhs[index] = gt13rhsL; + gt22rhs[index] = gt22rhsL; + gt23rhs[index] = gt23rhsL; + gt33rhs[index] = gt33rhsL; + phirhs[index] = phirhsL; + trKrhs[index] = trKrhsL; + Xt1rhs[index] = Xt1rhsL; + Xt2rhs[index] = Xt2rhsL; + Xt3rhs[index] = Xt3rhsL; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_RHSBoundary); +} + +void ML_BSSN_RHSBoundary(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverBoundary(cctkGH, &ML_BSSN_RHSBoundary_Body); +} diff --git a/ML_BSSN/src/ML_BSSN_boundary.c b/ML_BSSN/src/ML_BSSN_boundary.c index 89929d9..6d825c5 100644 --- a/ML_BSSN/src/ML_BSSN_boundary.c +++ b/ML_BSSN/src/ML_BSSN_boundary.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_boundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_boundary_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_boundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL n CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_boundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL n p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_boundary, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_BSSN/src/ML_BSSN_constraints.c b/ML_BSSN/src/ML_BSSN_constraints.c index dffa789..461b70c 100644 --- a/ML_BSSN/src/ML_BSSN_constraints.c +++ b/ML_BSSN/src/ML_BSSN_constraints.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_constraints_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REA CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REA p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_constraints, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) @@ -106,15 +121,31 @@ void ML_BSSN_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REA CCTK_REAL gtu11 = INITVALUE, gtu21 = INITVALUE, gtu22 = INITVALUE, gtu31 = INITVALUE, gtu32 = INITVALUE, gtu33 = INITVALUE; CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; CCTK_REAL R11 = INITVALUE, R12 = INITVALUE, R13 = INITVALUE, R22 = INITVALUE, R23 = INITVALUE, R33 = INITVALUE; + CCTK_REAL rho = INITVALUE; CCTK_REAL Rphi11 = INITVALUE, Rphi12 = INITVALUE, Rphi13 = INITVALUE, Rphi22 = INITVALUE, Rphi23 = INITVALUE, Rphi33 = INITVALUE; CCTK_REAL Rt11 = INITVALUE, Rt12 = INITVALUE, Rt13 = INITVALUE, Rt22 = INITVALUE, Rt23 = INITVALUE, Rt33 = INITVALUE; + CCTK_REAL S1 = INITVALUE, S2 = INITVALUE, S3 = INITVALUE; + CCTK_REAL T00 = INITVALUE, T01 = INITVALUE, T02 = INITVALUE, T03 = INITVALUE, T11 = INITVALUE, T12 = INITVALUE; + CCTK_REAL T13 = INITVALUE, T22 = INITVALUE, T23 = INITVALUE, T33 = INITVALUE; CCTK_REAL trR = INITVALUE; /* Declare local copies of grid functions */ + CCTK_REAL alphaL = INITVALUE; CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE; CCTK_REAL cAL = INITVALUE; CCTK_REAL cSL = INITVALUE; CCTK_REAL cXt1L = INITVALUE, cXt2L = INITVALUE, cXt3L = INITVALUE; + CCTK_REAL eTttL = INITVALUE; + CCTK_REAL eTtxL = INITVALUE; + CCTK_REAL eTtyL = INITVALUE; + CCTK_REAL eTtzL = INITVALUE; + CCTK_REAL eTxxL = INITVALUE; + CCTK_REAL eTxyL = INITVALUE; + CCTK_REAL eTxzL = INITVALUE; + CCTK_REAL eTyyL = INITVALUE; + CCTK_REAL eTyzL = INITVALUE; + CCTK_REAL eTzzL = INITVALUE; CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE; CCTK_REAL HL = INITVALUE; CCTK_REAL M1L = INITVALUE, M2L = INITVALUE, M3L = INITVALUE; @@ -240,12 +271,26 @@ void ML_BSSN_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REA CCTK_REAL PDstandardNth3Xt3 = INITVALUE; /* Assign local copies of grid functions */ + alphaL = alpha[index]; At11L = At11[index]; At12L = At12[index]; At13L = At13[index]; At22L = At22[index]; At23L = At23[index]; At33L = At33[index]; + beta1L = beta1[index]; + beta2L = beta2[index]; + beta3L = beta3[index]; + eTttL = eTtt[index]; + eTtxL = eTtx[index]; + eTtyL = eTty[index]; + eTtzL = eTtz[index]; + eTxxL = eTxx[index]; + eTxyL = eTxy[index]; + eTxzL = eTxz[index]; + eTyyL = eTyy[index]; + eTyzL = eTyz[index]; + eTzzL = eTzz[index]; gt11L = gt11[index]; gt12L = gt12[index]; gt13L = gt13[index]; @@ -374,13 +419,16 @@ void ML_BSSN_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REA gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); - Gt111 = khalf*(gtu11*PDstandardNth1gt11 + 2*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) - + Gt111 = khalf*(gtu11*PDstandardNth1gt11 + + 2*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) - gtu21*PDstandardNth2gt11 - gtu31*PDstandardNth3gt11); - Gt211 = khalf*(gtu21*PDstandardNth1gt11 + 2*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) - + Gt211 = khalf*(gtu21*PDstandardNth1gt11 + + 2*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) - gtu22*PDstandardNth2gt11 - gtu32*PDstandardNth3gt11); - Gt311 = khalf*(gtu31*PDstandardNth1gt11 + 2*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) - + Gt311 = khalf*(gtu31*PDstandardNth1gt11 + + 2*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) - gtu32*PDstandardNth2gt11 - gtu33*PDstandardNth3gt11); Gt112 = khalf*(gtu21*PDstandardNth1gt22 + gtu11*PDstandardNth2gt11 + @@ -401,356 +449,570 @@ void ML_BSSN_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REA Gt313 = khalf*(gtu33*PDstandardNth1gt33 + gtu31*PDstandardNth3gt11 + gtu32*(PDstandardNth1gt23 - PDstandardNth2gt13 + PDstandardNth3gt12)); - Gt122 = khalf*(gtu11*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu21*PDstandardNth2gt22 + + Gt122 = khalf*(gtu11*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu21*PDstandardNth2gt22 + gtu31*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt222 = khalf*(gtu21*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu22*PDstandardNth2gt22 + + Gt222 = khalf*(gtu21*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu22*PDstandardNth2gt22 + gtu32*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt322 = khalf*(gtu31*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu32*PDstandardNth2gt22 + + Gt322 = khalf*(gtu31*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu32*PDstandardNth2gt22 + gtu33*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt123 = khalf*(gtu31*PDstandardNth2gt33 + gtu11*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt123 = khalf*(gtu31*PDstandardNth2gt33 + + gtu11*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu21*PDstandardNth3gt22); - Gt223 = khalf*(gtu32*PDstandardNth2gt33 + gtu21*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt223 = khalf*(gtu32*PDstandardNth2gt33 + + gtu21*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu22*PDstandardNth3gt22); - Gt323 = khalf*(gtu33*PDstandardNth2gt33 + gtu31*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt323 = khalf*(gtu33*PDstandardNth2gt33 + + gtu31*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu32*PDstandardNth3gt22); - Gt133 = khalf*(-(gtu11*PDstandardNth1gt33) - gtu21*PDstandardNth2gt33 + 2*gtu11*PDstandardNth3gt13 + - 2*gtu21*PDstandardNth3gt23 + gtu31*PDstandardNth3gt33); - - Gt233 = khalf*(-(gtu21*PDstandardNth1gt33) - gtu22*PDstandardNth2gt33 + 2*gtu21*PDstandardNth3gt13 + - 2*gtu22*PDstandardNth3gt23 + gtu32*PDstandardNth3gt33); - - Gt333 = khalf*(-(gtu31*PDstandardNth1gt33) - gtu32*PDstandardNth2gt33 + 2*gtu31*PDstandardNth3gt13 + - 2*gtu32*PDstandardNth3gt23 + gtu33*PDstandardNth3gt33); - - Rt11 = -(gtu11*khalf*PDstandardNth11gt11) + gtu21* - (2*Gt211*Gt212*gt22L + 4*Gt112*gt13L*Gt311 + 2*Gt113*gt11L*Gt312 + 2*gt13L*Gt312*Gt313 + 2*gt13L*Gt211*Gt322 + - 2*gt13L*Gt311*Gt323 + 2*Gt311*Gt312*gt33L - PDstandardNth12gt11) - gtu31*PDstandardNth13gt11 + - gt11L*PDstandardNth1Xt1 + gt12L*(4*Gt111*Gt212*gtu21 + 2*Gt211*Gt222*gtu21 + 2*Gt212*Gt222*gtu22 + - 4*Gt113*Gt211*gtu31 + 4*Gt113*Gt212*gtu32 + 4*Gt113*Gt213*gtu33 + PDstandardNth1Xt2) + - gt13L*(4*Gt111*Gt312*gtu21 + 2*Gt212*Gt312*gtu21 + 4*Gt112*Gt312*gtu22 + 4*Gt113*Gt311*gtu31 + - 4*Gt113*Gt312*gtu32 + 4*Gt113*Gt313*gtu33 + PDstandardNth1Xt3) - gtu22*khalf*PDstandardNth22gt11 - + Gt133 = khalf*(-(gtu11*PDstandardNth1gt33) - gtu21*PDstandardNth2gt33 + + 2*gtu11*PDstandardNth3gt13 + 2*gtu21*PDstandardNth3gt23 + + gtu31*PDstandardNth3gt33); + + Gt233 = khalf*(-(gtu21*PDstandardNth1gt33) - gtu22*PDstandardNth2gt33 + + 2*gtu21*PDstandardNth3gt13 + 2*gtu22*PDstandardNth3gt23 + + gtu32*PDstandardNth3gt33); + + Gt333 = khalf*(-(gtu31*PDstandardNth1gt33) - gtu32*PDstandardNth2gt33 + + 2*gtu31*PDstandardNth3gt13 + 2*gtu32*PDstandardNth3gt23 + + gtu33*PDstandardNth3gt33); + + Rt11 = -(gtu11*khalf*PDstandardNth11gt11) + + gtu21*(2*Gt211*Gt212*gt22L + 4*Gt112*gt13L*Gt311 + 2*Gt113*gt11L*Gt312 + + 2*gt13L*Gt312*Gt313 + 2*gt13L*Gt211*Gt322 + 2*gt13L*Gt311*Gt323 + + 2*Gt311*Gt312*gt33L - PDstandardNth12gt11) - gtu31*PDstandardNth13gt11 + + gt11L*PDstandardNth1Xt1 + gt12L* + (4*Gt111*Gt212*gtu21 + 2*Gt211*Gt222*gtu21 + 2*Gt212*Gt222*gtu22 + + 4*Gt113*Gt211*gtu31 + 4*Gt113*Gt212*gtu32 + 4*Gt113*Gt213*gtu33 + + PDstandardNth1Xt2) + gt13L* + (4*Gt111*Gt312*gtu21 + 2*Gt212*Gt312*gtu21 + 4*Gt112*Gt312*gtu22 + + 4*Gt113*Gt311*gtu31 + 4*Gt113*Gt312*gtu32 + 4*Gt113*Gt313*gtu33 + + PDstandardNth1Xt3) - gtu22*khalf*PDstandardNth22gt11 - gtu32*PDstandardNth23gt11 - gtu33*khalf*PDstandardNth33gt11 + Gt111*(6*Gt113*gt11L*gtu31 + 4*gt12L*Gt213*gtu31 + gt11L*Xt1L) + - Gt211*(2*Gt112*gt11L*gtu11 + 4*Gt111*gt12L*gtu11 + 2*gt11L*Gt122*gtu21 + 2*gt11L*Gt123*gtu31 + gt12L*Xt1L) + - Gt311*(4*Gt111*gt13L*gtu11 + 2*gt12L*Gt213*gtu11 + 2*gt13L*Gt313*gtu11 + 2*gt11L*Gt123*gtu21 + - 2*gt11L*Gt133*gtu31 + gt13L*Xt1L) + gt12L*Gt212*Xt2L + gt13L*Gt312*Xt2L + - Gt112*(6*Gt111*gt11L*gtu21 + 4*gt12L*Gt211*gtu21 + 4*gt12L*Gt212*gtu22 + 2*gt11L*Gt213*gtu31 + - 6*Gt113*gt11L*gtu32 + gt11L*Xt2L) + Gt113*gt11L*Xt3L + - Gt213*(2*gt11L*Gt122*gtu32 + 4*Gt112*gt12L*gtu32 + 2*gt11L*Gt123*gtu33 + gt12L*Xt3L) + - Gt313*(4*Gt111*gt13L*gtu31 + 2*gt12L*Gt213*gtu31 + 2*gt11L*Gt123*gtu32 + 4*Gt112*gt13L*gtu32 + - 2*gt12L*Gt223*gtu32 + 2*gt11L*Gt133*gtu33 + gt13L*Xt3L) + 3*gt11L*gtu11*SQR(Gt111) + 3*gt11L*gtu22*SQR(Gt112) + - 3*gt11L*gtu33*SQR(Gt113) + gt22L*gtu11*SQR(Gt211) + gt22L*gtu22*SQR(Gt212) + - 2*(gt12L*Gt211*Gt212*gtu11 + Gt113*gt11L*Gt311*gtu11 + Gt211*gt23L*Gt311*gtu11 + gt13L*Gt211*Gt312*gtu11 + - Gt112*gt11L*Gt212*gtu21 + gt12L*Gt223*Gt311*gtu21 + Gt212*gt23L*Gt311*gtu21 + gt12L*Gt213*Gt312*gtu21 + - Gt211*gt23L*Gt312*gtu21 + gt11L*Gt122*Gt212*gtu22 + gt11L*Gt123*Gt312*gtu22 + gt12L*Gt223*Gt312*gtu22 + - Gt212*gt23L*Gt312*gtu22 + gt13L*Gt212*Gt322*gtu22 + gt13L*Gt312*Gt323*gtu22 + gt12L*Gt212*Gt213*gtu31 + - gt12L*Gt211*Gt223*gtu31 + Gt211*Gt213*gt22L*gtu31 + gt12L*Gt233*Gt311*gtu31 + Gt213*gt23L*Gt311*gtu31 + - gt13L*Gt213*Gt312*gtu31 + Gt113*gt11L*Gt313*gtu31 + Gt211*gt23L*Gt313*gtu31 + gt13L*Gt211*Gt323*gtu31 + - gt13L*Gt311*Gt333*gtu31 + Gt311*Gt313*gt33L*gtu31 + gt11L*Gt123*Gt212*gtu32 + gt12L*Gt213*Gt222*gtu32 + - gt12L*Gt212*Gt223*gtu32 + Gt212*Gt213*gt22L*gtu32 + gt11L*Gt133*Gt312*gtu32 + gt12L*Gt233*Gt312*gtu32 + - Gt213*gt23L*Gt312*gtu32 + Gt212*gt23L*Gt313*gtu32 + gt13L*Gt213*Gt322*gtu32 + gt13L*Gt212*Gt323*gtu32 + - gt13L*Gt313*Gt323*gtu32 + gt13L*Gt312*Gt333*gtu32 + Gt312*Gt313*gt33L*gtu32 + gt12L*Gt213*Gt223*gtu33 + - gt12L*Gt233*Gt313*gtu33 + Gt213*gt23L*Gt313*gtu33 + gt13L*Gt213*Gt323*gtu33 + gt13L*Gt313*Gt333*gtu33 + - gt12L*gtu21*SQR(Gt212)) + gt22L*gtu33*SQR(Gt213) + gt33L*gtu11*SQR(Gt311) + gt33L*gtu22*SQR(Gt312) + + Gt211*(2*Gt112*gt11L*gtu11 + 4*Gt111*gt12L*gtu11 + 2*gt11L*Gt122*gtu21 + + 2*gt11L*Gt123*gtu31 + gt12L*Xt1L) + + Gt311*(4*Gt111*gt13L*gtu11 + 2*gt12L*Gt213*gtu11 + 2*gt13L*Gt313*gtu11 + + 2*gt11L*Gt123*gtu21 + 2*gt11L*Gt133*gtu31 + gt13L*Xt1L) + + gt12L*Gt212*Xt2L + gt13L*Gt312*Xt2L + + Gt112*(6*Gt111*gt11L*gtu21 + 4*gt12L*Gt211*gtu21 + 4*gt12L*Gt212*gtu22 + + 2*gt11L*Gt213*gtu31 + 6*Gt113*gt11L*gtu32 + gt11L*Xt2L) + + Gt113*gt11L*Xt3L + Gt213*(2*gt11L*Gt122*gtu32 + 4*Gt112*gt12L*gtu32 + + 2*gt11L*Gt123*gtu33 + gt12L*Xt3L) + + Gt313*(4*Gt111*gt13L*gtu31 + 2*gt12L*Gt213*gtu31 + 2*gt11L*Gt123*gtu32 + + 4*Gt112*gt13L*gtu32 + 2*gt12L*Gt223*gtu32 + 2*gt11L*Gt133*gtu33 + + gt13L*Xt3L) + 3*gt11L*gtu11*SQR(Gt111) + 3*gt11L*gtu22*SQR(Gt112) + + 3*gt11L*gtu33*SQR(Gt113) + gt22L*gtu11*SQR(Gt211) + + gt22L*gtu22*SQR(Gt212) + 2*(gt12L*Gt211*Gt212*gtu11 + + Gt113*gt11L*Gt311*gtu11 + Gt211*gt23L*Gt311*gtu11 + + gt13L*Gt211*Gt312*gtu11 + Gt112*gt11L*Gt212*gtu21 + + gt12L*Gt223*Gt311*gtu21 + Gt212*gt23L*Gt311*gtu21 + + gt12L*Gt213*Gt312*gtu21 + Gt211*gt23L*Gt312*gtu21 + + gt11L*Gt122*Gt212*gtu22 + gt11L*Gt123*Gt312*gtu22 + + gt12L*Gt223*Gt312*gtu22 + Gt212*gt23L*Gt312*gtu22 + + gt13L*Gt212*Gt322*gtu22 + gt13L*Gt312*Gt323*gtu22 + + gt12L*Gt212*Gt213*gtu31 + gt12L*Gt211*Gt223*gtu31 + + Gt211*Gt213*gt22L*gtu31 + gt12L*Gt233*Gt311*gtu31 + + Gt213*gt23L*Gt311*gtu31 + gt13L*Gt213*Gt312*gtu31 + + Gt113*gt11L*Gt313*gtu31 + Gt211*gt23L*Gt313*gtu31 + + gt13L*Gt211*Gt323*gtu31 + gt13L*Gt311*Gt333*gtu31 + + Gt311*Gt313*gt33L*gtu31 + gt11L*Gt123*Gt212*gtu32 + + gt12L*Gt213*Gt222*gtu32 + gt12L*Gt212*Gt223*gtu32 + + Gt212*Gt213*gt22L*gtu32 + gt11L*Gt133*Gt312*gtu32 + + gt12L*Gt233*Gt312*gtu32 + Gt213*gt23L*Gt312*gtu32 + + Gt212*gt23L*Gt313*gtu32 + gt13L*Gt213*Gt322*gtu32 + + gt13L*Gt212*Gt323*gtu32 + gt13L*Gt313*Gt323*gtu32 + + gt13L*Gt312*Gt333*gtu32 + Gt312*Gt313*gt33L*gtu32 + + gt12L*Gt213*Gt223*gtu33 + gt12L*Gt233*Gt313*gtu33 + + Gt213*gt23L*Gt313*gtu33 + gt13L*Gt213*Gt323*gtu33 + + gt13L*Gt313*Gt333*gtu33 + gt12L*gtu21*SQR(Gt212)) + + gt22L*gtu33*SQR(Gt213) + gt33L*gtu11*SQR(Gt311) + gt33L*gtu22*SQR(Gt312) + 2*gt13L*gtu31*SQR(Gt313) + gt33L*gtu33*SQR(Gt313); - Rt12 = khalf*(-(gtu11*PDstandardNth11gt12) - 2*gtu21*PDstandardNth12gt12 - 2*gtu31*PDstandardNth13gt12 + - gt12L*PDstandardNth1Xt1 + gt22L*PDstandardNth1Xt2 + gt23L*PDstandardNth1Xt3 - gtu22*PDstandardNth22gt12 - - 2*gtu32*PDstandardNth23gt12 + gt11L*PDstandardNth2Xt1 + gt12L*PDstandardNth2Xt2 + gt13L*PDstandardNth2Xt3 - - gtu33*PDstandardNth33gt12 + (Gt111*gt12L + Gt211*gt22L + gt23L*Gt311)*Xt1L + - (Gt112*gt11L + gt12L*Gt212 + gt13L*Gt312)*Xt1L + (Gt112*gt12L + Gt212*gt22L + gt23L*Gt312)*Xt2L + - (gt11L*Gt122 + gt12L*Gt222 + gt13L*Gt322)*Xt2L + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313)*Xt3L + + Rt12 = khalf*(-(gtu11*PDstandardNth11gt12) - 2*gtu21*PDstandardNth12gt12 - + 2*gtu31*PDstandardNth13gt12 + gt12L*PDstandardNth1Xt1 + + gt22L*PDstandardNth1Xt2 + gt23L*PDstandardNth1Xt3 - + gtu22*PDstandardNth22gt12 - 2*gtu32*PDstandardNth23gt12 + + gt11L*PDstandardNth2Xt1 + gt12L*PDstandardNth2Xt2 + + gt13L*PDstandardNth2Xt3 - gtu33*PDstandardNth33gt12 + + (Gt111*gt12L + Gt211*gt22L + gt23L*Gt311)*Xt1L + + (Gt112*gt11L + gt12L*Gt212 + gt13L*Gt312)*Xt1L + + (Gt112*gt12L + Gt212*gt22L + gt23L*Gt312)*Xt2L + + (gt11L*Gt122 + gt12L*Gt222 + gt13L*Gt322)*Xt2L + + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313)*Xt3L + (gt11L*Gt123 + gt12L*Gt223 + gt13L*Gt323)*Xt3L + - 2*gtu21*(Gt112*gt11L*Gt222 + Gt112*Gt211*gt22L + Gt211*Gt222*gt22L + 2*Gt122*gt13L*Gt311 + Gt112*gt23L*Gt311 + - Gt222*gt23L*Gt311 + gt13L*Gt222*Gt312 + Gt213*gt22L*Gt312 + Gt212*gt23L*Gt312 + gt23L*Gt312*Gt313 + - Gt113*gt11L*Gt322 + Gt211*gt23L*Gt322 + gt13L*Gt313*Gt322 + - Gt111*(2*gt11L*Gt122 + Gt112*gt12L + gt12L*Gt222 + gt13L*Gt322) + - gt12L*(2*Gt122*Gt211 + Gt112*Gt212 + Gt212*Gt222 + Gt113*Gt312 + Gt213*Gt322) + Gt311*Gt322*gt33L + - gt22L*SQR(Gt212)) + 2*((Gt123*gt12L*Gt211 + Gt113*gt12L*Gt212 + 2*Gt112*gt12L*Gt213 + gt12L*Gt212*Gt223 + - Gt212*Gt213*gt22L + Gt211*Gt223*gt22L + gt12L*Gt133*Gt311 + gt22L*Gt233*Gt311 + Gt113*gt13L*Gt312 + - gt12L*Gt233*Gt312 + Gt213*gt23L*Gt312 + gt11L*(2*Gt112*Gt113 + Gt123*Gt212 + Gt133*Gt312) + - 2*Gt112*gt13L*Gt313 + Gt212*gt23L*Gt313 + Gt111*(Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + - gt13L*Gt212*Gt323 + Gt211*gt23L*Gt323 + gt23L*Gt311*Gt333 + gt13L*Gt312*Gt333 + Gt312*Gt313*gt33L)*gtu31 + - (Gt123*gt12L*Gt212 + 2*Gt122*gt12L*Gt213 + Gt113*gt12L*Gt222 + gt12L*Gt222*Gt223 + Gt213*Gt222*gt22L + - Gt212*Gt223*gt22L + gt12L*Gt133*Gt312 + gt22L*Gt233*Gt312 + 2*Gt122*gt13L*Gt313 + Gt222*gt23L*Gt313 + - Gt112*(Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + Gt113*gt13L*Gt322 + gt12L*Gt233*Gt322 + - Gt213*gt23L*Gt322 + gt11L*(2*Gt113*Gt122 + Gt123*Gt222 + Gt133*Gt322) + gt13L*Gt222*Gt323 + - Gt212*gt23L*Gt323 + gt23L*Gt312*Gt333 + gt13L*Gt322*Gt333 + Gt313*Gt322*gt33L)*gtu32 + - gtu11*(3*Gt112*gt12L*Gt211 + 2*Gt211*Gt212*gt22L + Gt113*gt12L*Gt311 + 2*Gt112*gt13L*Gt311 + - Gt213*gt22L*Gt311 + Gt212*gt23L*Gt311 + gt13L*Gt212*Gt312 + gt12L*Gt213*Gt312 + 2*Gt211*gt23L*Gt312 + + 2*gtu21*(Gt112*gt11L*Gt222 + Gt112*Gt211*gt22L + Gt211*Gt222*gt22L + + 2*Gt122*gt13L*Gt311 + Gt112*gt23L*Gt311 + Gt222*gt23L*Gt311 + + gt13L*Gt222*Gt312 + Gt213*gt22L*Gt312 + Gt212*gt23L*Gt312 + + gt23L*Gt312*Gt313 + Gt113*gt11L*Gt322 + Gt211*gt23L*Gt322 + + gt13L*Gt313*Gt322 + Gt111* + (2*gt11L*Gt122 + Gt112*gt12L + gt12L*Gt222 + gt13L*Gt322) + + gt12L*(2*Gt122*Gt211 + Gt112*Gt212 + Gt212*Gt222 + Gt113*Gt312 + + Gt213*Gt322) + Gt311*Gt322*gt33L + gt22L*SQR(Gt212)) + + 2*((Gt123*gt12L*Gt211 + Gt113*gt12L*Gt212 + 2*Gt112*gt12L*Gt213 + + gt12L*Gt212*Gt223 + Gt212*Gt213*gt22L + Gt211*Gt223*gt22L + + gt12L*Gt133*Gt311 + gt22L*Gt233*Gt311 + Gt113*gt13L*Gt312 + + gt12L*Gt233*Gt312 + Gt213*gt23L*Gt312 + + gt11L*(2*Gt112*Gt113 + Gt123*Gt212 + Gt133*Gt312) + + 2*Gt112*gt13L*Gt313 + Gt212*gt23L*Gt313 + + Gt111*(Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + + gt13L*Gt212*Gt323 + Gt211*gt23L*Gt323 + gt23L*Gt311*Gt333 + + gt13L*Gt312*Gt333 + Gt312*Gt313*gt33L)*gtu31 + + (Gt123*gt12L*Gt212 + 2*Gt122*gt12L*Gt213 + Gt113*gt12L*Gt222 + + gt12L*Gt222*Gt223 + Gt213*Gt222*gt22L + Gt212*Gt223*gt22L + + gt12L*Gt133*Gt312 + gt22L*Gt233*Gt312 + 2*Gt122*gt13L*Gt313 + + Gt222*gt23L*Gt313 + Gt112* + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + Gt113*gt13L*Gt322 + + gt12L*Gt233*Gt322 + Gt213*gt23L*Gt322 + + gt11L*(2*Gt113*Gt122 + Gt123*Gt222 + Gt133*Gt322) + + gt13L*Gt222*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt312*Gt333 + + gt13L*Gt322*Gt333 + Gt313*Gt322*gt33L)*gtu32 + + gtu11*(3*Gt112*gt12L*Gt211 + 2*Gt211*Gt212*gt22L + Gt113*gt12L*Gt311 + + 2*Gt112*gt13L*Gt311 + Gt213*gt22L*Gt311 + Gt212*gt23L*Gt311 + + gt13L*Gt212*Gt312 + gt12L*Gt213*Gt312 + 2*Gt211*gt23L*Gt312 + gt11L*(2*Gt111*Gt112 + Gt112*Gt212 + Gt113*Gt312) + - Gt111*(gt12L*Gt212 + Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + gt23L*Gt311*Gt313 + gt13L*Gt312*Gt313 + - Gt311*Gt312*gt33L + gt12L*SQR(Gt111) + gt12L*SQR(Gt212))) + - 2*gtu22*(gt11L*Gt122*Gt222 + 2*Gt212*Gt222*gt22L + 2*Gt122*gt13L*Gt312 + Gt223*gt22L*Gt312 + Gt222*gt23L*Gt312 + - gt11L*Gt123*Gt322 + gt13L*Gt222*Gt322 + 2*Gt212*gt23L*Gt322 + - Gt112*(2*gt11L*Gt122 + gt12L*Gt222 + Gt212*gt22L + gt23L*Gt312 + gt13L*Gt322) + gt23L*Gt312*Gt323 + - gt13L*Gt322*Gt323 + Gt312*Gt322*gt33L + gt12L*SQR(Gt112) + + Gt111*(gt12L*Gt212 + Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + + gt23L*Gt311*Gt313 + gt13L*Gt312*Gt313 + Gt311*Gt312*gt33L + + gt12L*SQR(Gt111) + gt12L*SQR(Gt212))) + + 2*gtu22*(gt11L*Gt122*Gt222 + 2*Gt212*Gt222*gt22L + 2*Gt122*gt13L*Gt312 + + Gt223*gt22L*Gt312 + Gt222*gt23L*Gt312 + gt11L*Gt123*Gt322 + + gt13L*Gt222*Gt322 + 2*Gt212*gt23L*Gt322 + + Gt112*(2*gt11L*Gt122 + gt12L*Gt222 + Gt212*gt22L + gt23L*Gt312 + + gt13L*Gt322) + gt23L*Gt312*Gt323 + gt13L*Gt322*Gt323 + + Gt312*Gt322*gt33L + gt12L*SQR(Gt112) + gt12L*(3*Gt122*Gt212 + Gt123*Gt312 + Gt223*Gt322 + SQR(Gt222))) + - 2*gtu33*(gt11L*Gt123*Gt223 + 2*Gt213*Gt223*gt22L + 2*Gt123*gt13L*Gt313 + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + - gt11L*Gt133*Gt323 + gt13L*Gt223*Gt323 + 2*Gt213*gt23L*Gt323 + - Gt113*(2*gt11L*Gt123 + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + gt13L*Gt323) + gt23L*Gt313*Gt333 + - gt13L*Gt323*Gt333 + Gt313*Gt323*gt33L + gt12L*SQR(Gt113) + + 2*gtu33*(gt11L*Gt123*Gt223 + 2*Gt213*Gt223*gt22L + 2*Gt123*gt13L*Gt313 + + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + gt11L*Gt133*Gt323 + + gt13L*Gt223*Gt323 + 2*Gt213*gt23L*Gt323 + + Gt113*(2*gt11L*Gt123 + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + + gt13L*Gt323) + gt23L*Gt313*Gt333 + gt13L*Gt323*Gt333 + + Gt313*Gt323*gt33L + gt12L*SQR(Gt113) + gt12L*(3*Gt123*Gt213 + Gt133*Gt313 + Gt233*Gt323 + SQR(Gt223))) + - 2*gtu21*(Gt122*gt12L*Gt211 + 3*Gt112*gt12L*Gt212 + gt12L*Gt212*Gt222 + Gt211*Gt222*gt22L + Gt123*gt12L*Gt311 + - Gt223*gt22L*Gt311 + 3*Gt112*gt13L*Gt312 + gt12L*Gt223*Gt312 + 2*Gt212*gt23L*Gt312 + - Gt111*(Gt112*gt12L + Gt212*gt22L + gt23L*Gt312) + gt13L*Gt212*Gt322 + Gt211*gt23L*Gt322 + gt23L*Gt311*Gt323 + - gt13L*Gt312*Gt323 + gt11L*(Gt122*Gt212 + Gt123*Gt312 + 2*SQR(Gt112)) + gt22L*SQR(Gt212) + gt33L*SQR(Gt312)) + - 2*gtu31*(Gt112*gt11L*Gt223 + Gt113*Gt211*gt22L + Gt212*Gt213*gt22L + Gt211*Gt223*gt22L + 2*Gt123*gt13L*Gt311 + - Gt113*gt23L*Gt311 + Gt223*gt23L*Gt311 + gt13L*Gt223*Gt312 + Gt213*gt23L*Gt312 + Gt213*gt22L*Gt313 + - Gt113*gt11L*Gt323 + Gt211*gt23L*Gt323 + gt13L*Gt313*Gt323 + - Gt111*(2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + - gt12L*(2*Gt123*Gt211 + Gt112*Gt213 + Gt212*Gt223 + Gt113*Gt313 + Gt213*Gt323) + Gt311*Gt323*gt33L + - gt23L*SQR(Gt313)) + 2*gtu32*(gt11L*Gt122*Gt223 + Gt113*Gt212*gt22L + Gt213*Gt222*gt22L + Gt212*Gt223*gt22L + - 2*Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + Gt223*gt23L*Gt312 + Gt223*gt22L*Gt313 + gt13L*Gt223*Gt322 + - Gt213*gt23L*Gt322 + gt11L*Gt123*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt313*Gt323 + - Gt112*(2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + - gt12L*(Gt122*Gt213 + Gt123*(2*Gt212 + Gt313) + Gt223*(Gt222 + Gt323)) + Gt312*Gt323*gt33L + gt13L*SQR(Gt323))); - - Rt13 = khalf*(-(gtu11*PDstandardNth11gt13) - 2*gtu21*PDstandardNth12gt13 - 2*gtu31*PDstandardNth13gt13 + - gt13L*PDstandardNth1Xt1 + gt23L*PDstandardNth1Xt2 + gt33L*PDstandardNth1Xt3 - gtu22*PDstandardNth22gt13 - - 2*gtu32*PDstandardNth23gt13 - gtu33*PDstandardNth33gt13 + gt11L*PDstandardNth3Xt1 + gt12L*PDstandardNth3Xt2 + - gt13L*PDstandardNth3Xt3 + (Gt113*gt11L + gt12L*Gt213 + gt13L*Gt313)*Xt1L + - (Gt111*gt13L + Gt211*gt23L + Gt311*gt33L)*Xt1L + (gt11L*Gt123 + gt12L*Gt223 + gt13L*Gt323)*Xt2L + - (Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)*Xt2L + (gt11L*Gt133 + gt12L*Gt233 + gt13L*Gt333)*Xt3L + + 2*gtu21*(Gt122*gt12L*Gt211 + 3*Gt112*gt12L*Gt212 + gt12L*Gt212*Gt222 + + Gt211*Gt222*gt22L + Gt123*gt12L*Gt311 + Gt223*gt22L*Gt311 + + 3*Gt112*gt13L*Gt312 + gt12L*Gt223*Gt312 + 2*Gt212*gt23L*Gt312 + + Gt111*(Gt112*gt12L + Gt212*gt22L + gt23L*Gt312) + gt13L*Gt212*Gt322 + + Gt211*gt23L*Gt322 + gt23L*Gt311*Gt323 + gt13L*Gt312*Gt323 + + gt11L*(Gt122*Gt212 + Gt123*Gt312 + 2*SQR(Gt112)) + gt22L*SQR(Gt212) + + gt33L*SQR(Gt312)) + 2*gtu31* + (Gt112*gt11L*Gt223 + Gt113*Gt211*gt22L + Gt212*Gt213*gt22L + + Gt211*Gt223*gt22L + 2*Gt123*gt13L*Gt311 + Gt113*gt23L*Gt311 + + Gt223*gt23L*Gt311 + gt13L*Gt223*Gt312 + Gt213*gt23L*Gt312 + + Gt213*gt22L*Gt313 + Gt113*gt11L*Gt323 + Gt211*gt23L*Gt323 + + gt13L*Gt313*Gt323 + Gt111* + (2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + + gt12L*(2*Gt123*Gt211 + Gt112*Gt213 + Gt212*Gt223 + Gt113*Gt313 + + Gt213*Gt323) + Gt311*Gt323*gt33L + gt23L*SQR(Gt313)) + + 2*gtu32*(gt11L*Gt122*Gt223 + Gt113*Gt212*gt22L + Gt213*Gt222*gt22L + + Gt212*Gt223*gt22L + 2*Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + + Gt223*gt23L*Gt312 + Gt223*gt22L*Gt313 + gt13L*Gt223*Gt322 + + Gt213*gt23L*Gt322 + gt11L*Gt123*Gt323 + Gt212*gt23L*Gt323 + + gt23L*Gt313*Gt323 + Gt112* + (2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + + gt12L*(Gt122*Gt213 + Gt123*(2*Gt212 + Gt313) + + Gt223*(Gt222 + Gt323)) + Gt312*Gt323*gt33L + gt13L*SQR(Gt323))); + + Rt13 = khalf*(-(gtu11*PDstandardNth11gt13) - 2*gtu21*PDstandardNth12gt13 - + 2*gtu31*PDstandardNth13gt13 + gt13L*PDstandardNth1Xt1 + + gt23L*PDstandardNth1Xt2 + gt33L*PDstandardNth1Xt3 - + gtu22*PDstandardNth22gt13 - 2*gtu32*PDstandardNth23gt13 - + gtu33*PDstandardNth33gt13 + gt11L*PDstandardNth3Xt1 + + gt12L*PDstandardNth3Xt2 + gt13L*PDstandardNth3Xt3 + + (Gt113*gt11L + gt12L*Gt213 + gt13L*Gt313)*Xt1L + + (Gt111*gt13L + Gt211*gt23L + Gt311*gt33L)*Xt1L + + (gt11L*Gt123 + gt12L*Gt223 + gt13L*Gt323)*Xt2L + + (Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)*Xt2L + + (gt11L*Gt133 + gt12L*Gt233 + gt13L*Gt333)*Xt3L + (Gt113*gt13L + Gt213*gt23L + Gt313*gt33L)*Xt3L + - 2*((Gt122*gt13L*Gt211 + 2*Gt113*gt12L*Gt212 + Gt112*gt12L*Gt213 + gt12L*Gt213*Gt222 + Gt212*Gt213*gt22L + - Gt211*Gt222*gt23L + Gt123*gt13L*Gt311 + Gt223*gt23L*Gt311 + 2*Gt113*gt13L*Gt312 + Gt213*gt23L*Gt312 + - Gt112*gt13L*Gt313 + gt12L*Gt223*Gt313 + Gt212*gt23L*Gt313 + - gt11L*(2*Gt112*Gt113 + Gt122*Gt213 + Gt123*Gt313) + gt13L*Gt213*Gt322 + gt13L*Gt313*Gt323 + - Gt312*Gt313*gt33L + Gt211*Gt322*gt33L + Gt311*Gt323*gt33L + Gt111*(Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)) - *gtu21 + (Gt122*gt13L*Gt213 + gt11L*Gt122*Gt233 + Gt212*gt22L*Gt233 + Gt113*Gt212*gt23L + - Gt213*Gt222*gt23L + 2*Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + - gt13L*Gt233*Gt322 + gt11L*Gt123*Gt333 + Gt212*gt23L*Gt333 + gt13L*Gt323*Gt333 + + 2*((Gt122*gt13L*Gt211 + 2*Gt113*gt12L*Gt212 + Gt112*gt12L*Gt213 + + gt12L*Gt213*Gt222 + Gt212*Gt213*gt22L + Gt211*Gt222*gt23L + + Gt123*gt13L*Gt311 + Gt223*gt23L*Gt311 + 2*Gt113*gt13L*Gt312 + + Gt213*gt23L*Gt312 + Gt112*gt13L*Gt313 + gt12L*Gt223*Gt313 + + Gt212*gt23L*Gt313 + gt11L* + (2*Gt112*Gt113 + Gt122*Gt213 + Gt123*Gt313) + gt13L*Gt213*Gt322 + + gt13L*Gt313*Gt323 + Gt312*Gt313*gt33L + Gt211*Gt322*gt33L + + Gt311*Gt323*gt33L + Gt111*(Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)) + *gtu21 + (Gt122*gt13L*Gt213 + gt11L*Gt122*Gt233 + + Gt212*gt22L*Gt233 + Gt113*Gt212*gt23L + Gt213*Gt222*gt23L + + 2*Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + Gt123*gt13L*Gt313 + + Gt223*gt23L*Gt313 + gt13L*Gt233*Gt322 + gt11L*Gt123*Gt333 + + Gt212*gt23L*Gt333 + gt13L*Gt323*Gt333 + Gt112*(2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + - gt12L*(2*Gt133*Gt212 + Gt222*Gt233 + Gt223*Gt333) + Gt113*Gt312*gt33L + Gt213*Gt322*gt33L + - Gt313*Gt323*gt33L + Gt312*Gt333*gt33L)*gtu32 + - gtu21*(2*Gt123*gt12L*Gt211 + Gt112*gt13L*Gt212 + gt12L*Gt212*Gt223 + Gt211*Gt223*gt22L + Gt112*Gt211*gt23L + - 2*Gt123*gt13L*Gt311 + Gt223*gt23L*Gt311 + Gt113*gt13L*Gt312 + gt13L*Gt223*Gt312 + Gt213*gt23L*Gt312 + - gt12L*Gt213*Gt323 + Gt211*gt23L*Gt323 + gt13L*Gt313*Gt323 + - gt11L*(2*Gt111*Gt123 + Gt112*Gt223 + Gt113*Gt323) + Gt111*(Gt112*gt13L + gt12L*Gt223 + gt13L*Gt323) + - Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + Gt312*Gt313*gt33L + Gt311*Gt323*gt33L + gt23L*SQR(Gt212))) + - 2*gtu32*(Gt123*gt13L*Gt212 + 2*Gt123*gt12L*Gt213 + Gt113*gt12L*Gt223 + Gt213*Gt223*gt22L + Gt212*Gt223*gt23L + - Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + 2*Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + Gt113*gt13L*Gt323 + - gt13L*Gt223*Gt323 + gt12L*Gt233*Gt323 + Gt213*gt23L*Gt323 + - gt11L*(2*Gt113*Gt123 + Gt123*Gt223 + Gt133*Gt323) + gt13L*Gt323*Gt333 + Gt212*Gt323*gt33L + - Gt313*Gt323*gt33L + Gt312*Gt333*gt33L + Gt112*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + gt12L*SQR(Gt223)) + - 2*gtu11*(2*Gt113*gt12L*Gt211 + Gt112*gt13L*Gt211 + gt12L*Gt212*Gt213 + Gt211*Gt213*gt22L + Gt211*Gt212*gt23L + - 3*Gt113*gt13L*Gt311 + 2*Gt213*gt23L*Gt311 + gt13L*Gt213*Gt312 + gt12L*Gt213*Gt313 + Gt211*gt23L*Gt313 + - gt11L*(2*Gt111*Gt113 + Gt112*Gt213 + Gt113*Gt313) + Gt211*Gt312*gt33L + 2*Gt311*Gt313*gt33L + - Gt111*(gt12L*Gt213 + Gt211*gt23L + gt13L*Gt313 + Gt311*gt33L) + gt13L*SQR(Gt111) + gt13L*SQR(Gt313)) + - 2*gtu31*(Gt112*gt13L*Gt213 + Gt112*gt11L*Gt233 + Gt211*gt22L*Gt233 + Gt113*Gt211*gt23L + Gt212*Gt213*gt23L + - 2*Gt133*gt13L*Gt311 + Gt233*gt23L*Gt311 + gt13L*Gt233*Gt312 + Gt113*gt13L*Gt313 + Gt213*gt23L*Gt313 + - Gt113*gt11L*Gt333 + Gt211*gt23L*Gt333 + gt13L*Gt313*Gt333 + - Gt111*(2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + - gt12L*(2*Gt133*Gt211 + Gt212*Gt233 + Gt213*Gt333) + Gt113*Gt311*gt33L + Gt213*Gt312*gt33L + - Gt311*Gt333*gt33L + gt33L*SQR(Gt313)) + - 2*gtu31*(Gt123*gt13L*Gt211 + 3*Gt113*gt12L*Gt213 + gt12L*Gt213*Gt223 + Gt211*Gt223*gt23L + Gt133*gt13L*Gt311 + - Gt233*gt23L*Gt311 + 3*Gt113*gt13L*Gt313 + gt12L*Gt233*Gt313 + 2*Gt213*gt23L*Gt313 + gt13L*Gt213*Gt323 + - gt13L*Gt313*Gt333 + Gt211*Gt323*gt33L + Gt311*Gt333*gt33L + Gt111*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + - gt11L*(Gt123*Gt213 + Gt133*Gt313 + 2*SQR(Gt113)) + gt22L*SQR(Gt213) + gt33L*SQR(Gt313)) + - 2*gtu22*(2*Gt123*gt12L*Gt212 + Gt122*gt13L*Gt212 + gt12L*Gt222*Gt223 + Gt212*Gt223*gt22L + Gt212*Gt222*gt23L + - 3*Gt123*gt13L*Gt312 + 2*Gt223*gt23L*Gt312 + gt13L*Gt223*Gt322 + gt12L*Gt223*Gt323 + Gt212*gt23L*Gt323 + - gt11L*(2*Gt112*Gt123 + Gt122*Gt223 + Gt123*Gt323) + Gt212*Gt322*gt33L + 2*Gt312*Gt323*gt33L + - Gt112*(gt12L*Gt223 + Gt212*gt23L + gt13L*Gt323 + Gt312*gt33L) + gt13L*SQR(Gt112) + gt13L*SQR(Gt323)) + - 2*gtu33*(2*gt12L*Gt133*Gt213 + Gt123*gt13L*Gt213 + gt11L*Gt123*Gt233 + gt12L*Gt223*Gt233 + Gt213*gt22L*Gt233 + - Gt213*Gt223*gt23L + 3*Gt133*gt13L*Gt313 + 2*Gt233*gt23L*Gt313 + gt13L*Gt233*Gt323 + gt11L*Gt133*Gt333 + - gt12L*Gt233*Gt333 + Gt213*gt23L*Gt333 + Gt213*Gt323*gt33L + 2*Gt313*Gt333*gt33L + - Gt113*(2*gt11L*Gt133 + gt12L*Gt233 + Gt213*gt23L + gt13L*Gt333 + Gt313*gt33L) + gt13L*SQR(Gt113) + - gt13L*SQR(Gt333))); - - Rt22 = 4*(Gt122*gt12L*Gt212*gtu21 + Gt112*gt12L*Gt222*gtu21 + Gt122*gt12L*Gt222*gtu22 + Gt123*gt12L*Gt212*gtu31 + - Gt123*gt12L*Gt222*gtu32 + Gt123*gt12L*Gt223*gtu33) - gtu11*khalf*PDstandardNth11gt22 + - gtu21*(6*Gt212*Gt222*gt22L + 2*Gt122*gt23L*Gt311 + 2*Gt122*gt13L*Gt312 + 4*Gt222*gt23L*Gt312 + - 2*Gt113*gt12L*Gt322 + 2*gt23L*Gt312*Gt323 + 2*Gt312*Gt322*gt33L - PDstandardNth12gt22) + - gtu31*(6*Gt212*Gt223*gt22L + 2*Gt123*gt13L*Gt312 + 2*Gt112*gt23L*Gt313 + 2*Gt113*gt12L*Gt323 + - 2*gt23L*Gt312*Gt333 + 2*Gt312*Gt323*gt33L - PDstandardNth13gt22) - gtu22*khalf*PDstandardNth22gt22 + - gtu32*(4*Gt122*gt12L*Gt223 + 2*Gt123*Gt212*gt22L + 2*gt12L*Gt133*Gt322 + 4*Gt223*gt23L*Gt322 + - 2*Gt123*gt12L*Gt323 + 4*Gt222*gt23L*Gt323 + 2*gt23L*Gt322*Gt333 + 2*Gt322*Gt323*gt33L - PDstandardNth23gt22) + - gt12L*(2*Gt111*Gt123*gtu31 + 4*Gt112*Gt223*gtu31 + 2*Gt113*Gt122*gtu32 + 2*Gt113*Gt123*gtu33 + PDstandardNth2Xt1) + - gt22L*(2*Gt122*Gt213*gtu32 + 6*Gt222*Gt223*gtu32 + 2*Gt123*Gt213*gtu33 + PDstandardNth2Xt2) + - gt23L*(4*Gt212*Gt322*gtu21 + 2*Gt313*Gt322*gtu21 + 4*Gt222*Gt322*gtu22 + 2*Gt123*Gt311*gtu31 + - 4*Gt212*Gt323*gtu31 + 2*Gt313*Gt323*gtu31 + 2*Gt122*Gt313*gtu32 + 2*Gt123*Gt313*gtu33 + 4*Gt223*Gt323*gtu33 + - 2*Gt323*Gt333*gtu33 + PDstandardNth2Xt3) - gtu33*khalf*PDstandardNth33gt22 + Gt212*gt22L*Xt1L + - Gt112*(2*Gt111*gt12L*gtu11 + 4*gt12L*Gt212*gtu11 + 2*gt11L*Gt122*gtu21 + 2*Gt122*gt12L*gtu22 + - 2*gt11L*Gt123*gtu31 + 2*Gt123*gt12L*gtu32 + gt12L*Xt1L) + - Gt312*(2*Gt213*gt22L*gtu11 + 4*Gt212*gt23L*gtu11 + 2*gt23L*Gt313*gtu11 + 2*Gt123*gt12L*gtu21 + - 2*Gt122*gt23L*gtu22 + 2*gt12L*Gt133*gtu31 + 2*gt22L*Gt233*gtu31 + 4*Gt223*gt23L*gtu31 + 2*Gt123*gt23L*gtu32 + - gt23L*Xt1L) + Gt122*gt12L*Xt2L + Gt222*gt22L*Xt2L + gt23L*Gt322*Xt2L + Gt123*gt12L*Xt3L + Gt223*gt22L*Xt3L + - gt23L*Gt323*Xt3L + gt11L*gtu11*SQR(Gt112) + 2* - (Gt112*Gt211*gt22L*gtu11 + Gt112*gt23L*Gt311*gtu11 + Gt113*gt12L*Gt312*gtu11 + Gt112*gt13L*Gt312*gtu11 + - Gt111*Gt122*gt12L*gtu21 + Gt122*Gt211*gt22L*gtu21 + Gt112*Gt212*gt22L*gtu21 + Gt223*gt22L*Gt312*gtu21 + - Gt112*gt23L*Gt312*gtu21 + Gt112*gt13L*Gt322*gtu21 + Gt213*gt22L*Gt322*gtu21 + Gt122*Gt212*gt22L*gtu22 + - Gt123*gt12L*Gt322*gtu22 + Gt122*gt13L*Gt322*gtu22 + Gt223*gt22L*Gt322*gtu22 + gt23L*Gt322*Gt323*gtu22 + - Gt112*Gt113*gt12L*gtu31 + Gt123*Gt211*gt22L*gtu31 + Gt112*Gt213*gt22L*gtu31 + Gt112*gt13L*Gt323*gtu31 + - Gt213*gt22L*Gt323*gtu31 + gt11L*Gt122*Gt123*gtu32 + Gt123*gt13L*Gt322*gtu32 + gt22L*Gt233*Gt322*gtu32 + - Gt122*gt13L*Gt323*gtu32 + Gt223*gt22L*Gt323*gtu32 + gt12L*Gt133*Gt323*gtu33 + Gt123*gt13L*Gt323*gtu33 + - gt22L*Gt233*Gt323*gtu33 + gt12L*gtu21*SQR(Gt112)) + gt11L*gtu22*SQR(Gt122) + gt11L*gtu33*SQR(Gt123) + - 3*gt22L*gtu11*SQR(Gt212) + 3*gt22L*gtu22*SQR(Gt222) + 3*gt22L*gtu33*SQR(Gt223) + gt33L*gtu11*SQR(Gt312) + + gt12L*(2*Gt133*Gt212 + Gt222*Gt233 + Gt223*Gt333) + + Gt113*Gt312*gt33L + Gt213*Gt322*gt33L + Gt313*Gt323*gt33L + + Gt312*Gt333*gt33L)*gtu32 + + gtu21*(2*Gt123*gt12L*Gt211 + Gt112*gt13L*Gt212 + gt12L*Gt212*Gt223 + + Gt211*Gt223*gt22L + Gt112*Gt211*gt23L + 2*Gt123*gt13L*Gt311 + + Gt223*gt23L*Gt311 + Gt113*gt13L*Gt312 + gt13L*Gt223*Gt312 + + Gt213*gt23L*Gt312 + gt12L*Gt213*Gt323 + Gt211*gt23L*Gt323 + + gt13L*Gt313*Gt323 + gt11L* + (2*Gt111*Gt123 + Gt112*Gt223 + Gt113*Gt323) + + Gt111*(Gt112*gt13L + gt12L*Gt223 + gt13L*Gt323) + + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + Gt312*Gt313*gt33L + + Gt311*Gt323*gt33L + gt23L*SQR(Gt212))) + + 2*gtu32*(Gt123*gt13L*Gt212 + 2*Gt123*gt12L*Gt213 + Gt113*gt12L*Gt223 + + Gt213*Gt223*gt22L + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + + Gt233*gt23L*Gt312 + 2*Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + + Gt113*gt13L*Gt323 + gt13L*Gt223*Gt323 + gt12L*Gt233*Gt323 + + Gt213*gt23L*Gt323 + gt11L* + (2*Gt113*Gt123 + Gt123*Gt223 + Gt133*Gt323) + gt13L*Gt323*Gt333 + + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L + + Gt112*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + gt12L*SQR(Gt223)) + + 2*gtu11*(2*Gt113*gt12L*Gt211 + Gt112*gt13L*Gt211 + gt12L*Gt212*Gt213 + + Gt211*Gt213*gt22L + Gt211*Gt212*gt23L + 3*Gt113*gt13L*Gt311 + + 2*Gt213*gt23L*Gt311 + gt13L*Gt213*Gt312 + gt12L*Gt213*Gt313 + + Gt211*gt23L*Gt313 + gt11L* + (2*Gt111*Gt113 + Gt112*Gt213 + Gt113*Gt313) + Gt211*Gt312*gt33L + + 2*Gt311*Gt313*gt33L + Gt111* + (gt12L*Gt213 + Gt211*gt23L + gt13L*Gt313 + Gt311*gt33L) + + gt13L*SQR(Gt111) + gt13L*SQR(Gt313)) + + 2*gtu31*(Gt112*gt13L*Gt213 + Gt112*gt11L*Gt233 + Gt211*gt22L*Gt233 + + Gt113*Gt211*gt23L + Gt212*Gt213*gt23L + 2*Gt133*gt13L*Gt311 + + Gt233*gt23L*Gt311 + gt13L*Gt233*Gt312 + Gt113*gt13L*Gt313 + + Gt213*gt23L*Gt313 + Gt113*gt11L*Gt333 + Gt211*gt23L*Gt333 + + gt13L*Gt313*Gt333 + Gt111* + (2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + + gt12L*(2*Gt133*Gt211 + Gt212*Gt233 + Gt213*Gt333) + + Gt113*Gt311*gt33L + Gt213*Gt312*gt33L + Gt311*Gt333*gt33L + + gt33L*SQR(Gt313)) + 2*gtu31* + (Gt123*gt13L*Gt211 + 3*Gt113*gt12L*Gt213 + gt12L*Gt213*Gt223 + + Gt211*Gt223*gt23L + Gt133*gt13L*Gt311 + Gt233*gt23L*Gt311 + + 3*Gt113*gt13L*Gt313 + gt12L*Gt233*Gt313 + 2*Gt213*gt23L*Gt313 + + gt13L*Gt213*Gt323 + gt13L*Gt313*Gt333 + Gt211*Gt323*gt33L + + Gt311*Gt333*gt33L + Gt111*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + + gt11L*(Gt123*Gt213 + Gt133*Gt313 + 2*SQR(Gt113)) + gt22L*SQR(Gt213) + + gt33L*SQR(Gt313)) + 2*gtu22* + (2*Gt123*gt12L*Gt212 + Gt122*gt13L*Gt212 + gt12L*Gt222*Gt223 + + Gt212*Gt223*gt22L + Gt212*Gt222*gt23L + 3*Gt123*gt13L*Gt312 + + 2*Gt223*gt23L*Gt312 + gt13L*Gt223*Gt322 + gt12L*Gt223*Gt323 + + Gt212*gt23L*Gt323 + gt11L* + (2*Gt112*Gt123 + Gt122*Gt223 + Gt123*Gt323) + Gt212*Gt322*gt33L + + 2*Gt312*Gt323*gt33L + Gt112* + (gt12L*Gt223 + Gt212*gt23L + gt13L*Gt323 + Gt312*gt33L) + + gt13L*SQR(Gt112) + gt13L*SQR(Gt323)) + + 2*gtu33*(2*gt12L*Gt133*Gt213 + Gt123*gt13L*Gt213 + gt11L*Gt123*Gt233 + + gt12L*Gt223*Gt233 + Gt213*gt22L*Gt233 + Gt213*Gt223*gt23L + + 3*Gt133*gt13L*Gt313 + 2*Gt233*gt23L*Gt313 + gt13L*Gt233*Gt323 + + gt11L*Gt133*Gt333 + gt12L*Gt233*Gt333 + Gt213*gt23L*Gt333 + + Gt213*Gt323*gt33L + 2*Gt313*Gt333*gt33L + + Gt113*(2*gt11L*Gt133 + gt12L*Gt233 + Gt213*gt23L + gt13L*Gt333 + + Gt313*gt33L) + gt13L*SQR(Gt113) + gt13L*SQR(Gt333))); + + Rt22 = 4*(Gt122*gt12L*Gt212*gtu21 + Gt112*gt12L*Gt222*gtu21 + + Gt122*gt12L*Gt222*gtu22 + Gt123*gt12L*Gt212*gtu31 + + Gt123*gt12L*Gt222*gtu32 + Gt123*gt12L*Gt223*gtu33) - + gtu11*khalf*PDstandardNth11gt22 + + gtu21*(6*Gt212*Gt222*gt22L + 2*Gt122*gt23L*Gt311 + 2*Gt122*gt13L*Gt312 + + 4*Gt222*gt23L*Gt312 + 2*Gt113*gt12L*Gt322 + 2*gt23L*Gt312*Gt323 + + 2*Gt312*Gt322*gt33L - PDstandardNth12gt22) + + gtu31*(6*Gt212*Gt223*gt22L + 2*Gt123*gt13L*Gt312 + 2*Gt112*gt23L*Gt313 + + 2*Gt113*gt12L*Gt323 + 2*gt23L*Gt312*Gt333 + 2*Gt312*Gt323*gt33L - + PDstandardNth13gt22) - gtu22*khalf*PDstandardNth22gt22 + + gtu32*(4*Gt122*gt12L*Gt223 + 2*Gt123*Gt212*gt22L + 2*gt12L*Gt133*Gt322 + + 4*Gt223*gt23L*Gt322 + 2*Gt123*gt12L*Gt323 + 4*Gt222*gt23L*Gt323 + + 2*gt23L*Gt322*Gt333 + 2*Gt322*Gt323*gt33L - PDstandardNth23gt22) + + gt12L*(2*Gt111*Gt123*gtu31 + 4*Gt112*Gt223*gtu31 + 2*Gt113*Gt122*gtu32 + + 2*Gt113*Gt123*gtu33 + PDstandardNth2Xt1) + + gt22L*(2*Gt122*Gt213*gtu32 + 6*Gt222*Gt223*gtu32 + 2*Gt123*Gt213*gtu33 + + PDstandardNth2Xt2) + gt23L* + (4*Gt212*Gt322*gtu21 + 2*Gt313*Gt322*gtu21 + 4*Gt222*Gt322*gtu22 + + 2*Gt123*Gt311*gtu31 + 4*Gt212*Gt323*gtu31 + 2*Gt313*Gt323*gtu31 + + 2*Gt122*Gt313*gtu32 + 2*Gt123*Gt313*gtu33 + 4*Gt223*Gt323*gtu33 + + 2*Gt323*Gt333*gtu33 + PDstandardNth2Xt3) - + gtu33*khalf*PDstandardNth33gt22 + Gt212*gt22L*Xt1L + + Gt112*(2*Gt111*gt12L*gtu11 + 4*gt12L*Gt212*gtu11 + 2*gt11L*Gt122*gtu21 + + 2*Gt122*gt12L*gtu22 + 2*gt11L*Gt123*gtu31 + 2*Gt123*gt12L*gtu32 + + gt12L*Xt1L) + Gt312*(2*Gt213*gt22L*gtu11 + 4*Gt212*gt23L*gtu11 + + 2*gt23L*Gt313*gtu11 + 2*Gt123*gt12L*gtu21 + 2*Gt122*gt23L*gtu22 + + 2*gt12L*Gt133*gtu31 + 2*gt22L*Gt233*gtu31 + 4*Gt223*gt23L*gtu31 + + 2*Gt123*gt23L*gtu32 + gt23L*Xt1L) + Gt122*gt12L*Xt2L + + Gt222*gt22L*Xt2L + gt23L*Gt322*Xt2L + Gt123*gt12L*Xt3L + Gt223*gt22L*Xt3L + + gt23L*Gt323*Xt3L + gt11L*gtu11*SQR(Gt112) + + 2*(Gt112*Gt211*gt22L*gtu11 + Gt112*gt23L*Gt311*gtu11 + + Gt113*gt12L*Gt312*gtu11 + Gt112*gt13L*Gt312*gtu11 + + Gt111*Gt122*gt12L*gtu21 + Gt122*Gt211*gt22L*gtu21 + + Gt112*Gt212*gt22L*gtu21 + Gt223*gt22L*Gt312*gtu21 + + Gt112*gt23L*Gt312*gtu21 + Gt112*gt13L*Gt322*gtu21 + + Gt213*gt22L*Gt322*gtu21 + Gt122*Gt212*gt22L*gtu22 + + Gt123*gt12L*Gt322*gtu22 + Gt122*gt13L*Gt322*gtu22 + + Gt223*gt22L*Gt322*gtu22 + gt23L*Gt322*Gt323*gtu22 + + Gt112*Gt113*gt12L*gtu31 + Gt123*Gt211*gt22L*gtu31 + + Gt112*Gt213*gt22L*gtu31 + Gt112*gt13L*Gt323*gtu31 + + Gt213*gt22L*Gt323*gtu31 + gt11L*Gt122*Gt123*gtu32 + + Gt123*gt13L*Gt322*gtu32 + gt22L*Gt233*Gt322*gtu32 + + Gt122*gt13L*Gt323*gtu32 + Gt223*gt22L*Gt323*gtu32 + + gt12L*Gt133*Gt323*gtu33 + Gt123*gt13L*Gt323*gtu33 + + gt22L*Gt233*Gt323*gtu33 + gt12L*gtu21*SQR(Gt112)) + + gt11L*gtu22*SQR(Gt122) + gt11L*gtu33*SQR(Gt123) + + 3*gt22L*gtu11*SQR(Gt212) + 3*gt22L*gtu22*SQR(Gt222) + + 3*gt22L*gtu33*SQR(Gt223) + gt33L*gtu11*SQR(Gt312) + gt33L*gtu22*SQR(Gt322) + 2*gt23L*gtu32*SQR(Gt323) + gt33L*gtu33*SQR(Gt323); - Rt23 = khalf*(-(gtu11*PDstandardNth11gt23) - 2*gtu21*PDstandardNth12gt23 - 2*gtu31*PDstandardNth13gt23 - - gtu22*PDstandardNth22gt23 - 2*gtu32*PDstandardNth23gt23 + gt13L*PDstandardNth2Xt1 + gt23L*PDstandardNth2Xt2 + - gt33L*PDstandardNth2Xt3 - gtu33*PDstandardNth33gt23 + gt12L*PDstandardNth3Xt1 + gt22L*PDstandardNth3Xt2 + - gt23L*PDstandardNth3Xt3 + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313)*Xt1L + - (Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)*Xt1L + (Gt123*gt12L + Gt223*gt22L + gt23L*Gt323)*Xt2L + - (Gt122*gt13L + Gt222*gt23L + Gt322*gt33L)*Xt2L + (gt12L*Gt133 + gt22L*Gt233 + gt23L*Gt333)*Xt3L + + Rt23 = khalf*(-(gtu11*PDstandardNth11gt23) - 2*gtu21*PDstandardNth12gt23 - + 2*gtu31*PDstandardNth13gt23 - gtu22*PDstandardNth22gt23 - + 2*gtu32*PDstandardNth23gt23 + gt13L*PDstandardNth2Xt1 + + gt23L*PDstandardNth2Xt2 + gt33L*PDstandardNth2Xt3 - + gtu33*PDstandardNth33gt23 + gt12L*PDstandardNth3Xt1 + + gt22L*PDstandardNth3Xt2 + gt23L*PDstandardNth3Xt3 + + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313)*Xt1L + + (Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)*Xt1L + + (Gt123*gt12L + Gt223*gt22L + gt23L*Gt323)*Xt2L + + (Gt122*gt13L + Gt222*gt23L + Gt322*gt33L)*Xt2L + + (gt12L*Gt133 + gt22L*Gt233 + gt23L*Gt333)*Xt3L + (Gt123*gt13L + Gt223*gt23L + Gt323*gt33L)*Xt3L + - 2*((Gt112*gt11L*Gt123 + Gt111*Gt123*gt12L + Gt111*Gt122*gt13L + Gt123*gt12L*Gt212 + Gt112*gt13L*Gt222 + - 2*Gt112*gt12L*Gt223 + Gt123*Gt211*gt22L + 2*Gt212*Gt223*gt22L + Gt122*Gt211*gt23L + Gt212*Gt222*gt23L + - Gt123*gt23L*Gt311 + Gt123*gt13L*Gt312 + 2*Gt223*gt23L*Gt312 + Gt113*gt13L*Gt322 + Gt213*gt23L*Gt322 + - Gt113*gt12L*Gt323 + Gt112*gt13L*Gt323 + Gt213*gt22L*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt313*Gt323 + - Gt122*Gt311*gt33L + Gt222*Gt312*gt33L + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L)*gtu21 + - (Gt112*gt11L*Gt133 + Gt111*gt12L*Gt133 + Gt111*Gt123*gt13L + gt12L*Gt133*Gt212 + Gt112*gt13L*Gt223 + - Gt133*Gt211*gt22L + 2*Gt112*gt12L*Gt233 + 2*Gt212*gt22L*Gt233 + Gt123*Gt211*gt23L + Gt212*Gt223*gt23L + - Gt133*gt23L*Gt311 + Gt133*gt13L*Gt312 + 2*Gt233*gt23L*Gt312 + Gt113*gt13L*Gt323 + Gt213*gt23L*Gt323 + - Gt113*gt12L*Gt333 + Gt112*gt13L*Gt333 + Gt213*gt22L*Gt333 + Gt212*gt23L*Gt333 + gt23L*Gt313*Gt333 + - Gt123*Gt311*gt33L + Gt223*Gt312*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L)*gtu31 + - gtu21*(Gt113*gt11L*Gt122 + Gt122*gt13L*Gt212 + 2*Gt122*gt12L*Gt213 + Gt113*gt12L*Gt222 + Gt113*Gt212*gt22L + - 2*Gt213*Gt222*gt22L + Gt212*Gt222*gt23L + Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + Gt223*gt23L*Gt312 + - Gt123*gt12L*Gt313 + Gt122*gt13L*Gt313 + Gt223*gt22L*Gt313 + Gt222*gt23L*Gt313 + Gt113*gt13L*Gt322 + - 2*Gt213*gt23L*Gt322 + gt23L*Gt313*Gt323 + Gt212*Gt322*gt33L + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L + - Gt112*(Gt113*gt12L + Gt212*gt23L + Gt312*gt33L) + gt13L*SQR(Gt112))) + - 2*gtu31*(2*Gt213*Gt223*gt22L + Gt112*Gt213*gt23L + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + - gt12L*Gt133*Gt313 + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + Gt123*(2*gt12L*Gt213 + gt13L*(Gt212 + Gt313)) + - 2*Gt213*gt23L*Gt323 + Gt113*(gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + - gt13L*Gt323) + gt23L*Gt313*Gt333 + Gt112*Gt313*gt33L + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + + 2*((Gt112*gt11L*Gt123 + Gt111*Gt123*gt12L + Gt111*Gt122*gt13L + + Gt123*gt12L*Gt212 + Gt112*gt13L*Gt222 + 2*Gt112*gt12L*Gt223 + + Gt123*Gt211*gt22L + 2*Gt212*Gt223*gt22L + Gt122*Gt211*gt23L + + Gt212*Gt222*gt23L + Gt123*gt23L*Gt311 + Gt123*gt13L*Gt312 + + 2*Gt223*gt23L*Gt312 + Gt113*gt13L*Gt322 + Gt213*gt23L*Gt322 + + Gt113*gt12L*Gt323 + Gt112*gt13L*Gt323 + Gt213*gt22L*Gt323 + + Gt212*gt23L*Gt323 + gt23L*Gt313*Gt323 + Gt122*Gt311*gt33L + + Gt222*Gt312*gt33L + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L)*gtu21 + + (Gt112*gt11L*Gt133 + Gt111*gt12L*Gt133 + Gt111*Gt123*gt13L + + gt12L*Gt133*Gt212 + Gt112*gt13L*Gt223 + Gt133*Gt211*gt22L + + 2*Gt112*gt12L*Gt233 + 2*Gt212*gt22L*Gt233 + Gt123*Gt211*gt23L + + Gt212*Gt223*gt23L + Gt133*gt23L*Gt311 + Gt133*gt13L*Gt312 + + 2*Gt233*gt23L*Gt312 + Gt113*gt13L*Gt323 + Gt213*gt23L*Gt323 + + Gt113*gt12L*Gt333 + Gt112*gt13L*Gt333 + Gt213*gt22L*Gt333 + + Gt212*gt23L*Gt333 + gt23L*Gt313*Gt333 + Gt123*Gt311*gt33L + + Gt223*Gt312*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L)*gtu31 + + gtu21*(Gt113*gt11L*Gt122 + Gt122*gt13L*Gt212 + 2*Gt122*gt12L*Gt213 + + Gt113*gt12L*Gt222 + Gt113*Gt212*gt22L + 2*Gt213*Gt222*gt22L + + Gt212*Gt222*gt23L + Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + + Gt223*gt23L*Gt312 + Gt123*gt12L*Gt313 + Gt122*gt13L*Gt313 + + Gt223*gt22L*Gt313 + Gt222*gt23L*Gt313 + Gt113*gt13L*Gt322 + + 2*Gt213*gt23L*Gt322 + gt23L*Gt313*Gt323 + Gt212*Gt322*gt33L + + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L + + Gt112*(Gt113*gt12L + Gt212*gt23L + Gt312*gt33L) + gt13L*SQR(Gt112))) + + 2*gtu31*(2*Gt213*Gt223*gt22L + Gt112*Gt213*gt23L + + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + + gt12L*Gt133*Gt313 + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + + Gt123*(2*gt12L*Gt213 + gt13L*(Gt212 + Gt313)) + 2*Gt213*gt23L*Gt323 + + Gt113*(gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + Gt213*gt22L + + gt23L*Gt313 + gt13L*Gt323) + gt23L*Gt313*Gt333 + + Gt112*Gt313*gt33L + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L + gt12L*SQR(Gt113)) + - 2*gtu11*(Gt112*Gt113*gt11L + Gt111*Gt113*gt12L + Gt111*Gt112*gt13L + Gt113*gt12L*Gt212 + Gt112*gt13L*Gt212 + - 2*Gt112*gt12L*Gt213 + Gt113*Gt211*gt22L + 2*Gt212*Gt213*gt22L + Gt112*Gt211*gt23L + Gt113*gt23L*Gt311 + - 2*Gt113*gt13L*Gt312 + 3*Gt213*gt23L*Gt312 + Gt113*gt12L*Gt313 + Gt112*gt13L*Gt313 + Gt213*gt22L*Gt313 + - Gt212*gt23L*Gt313 + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + 2*Gt312*Gt313*gt33L + gt23L*SQR(Gt212) + - gt23L*SQR(Gt313)) + 2*gtu22*(gt11L*Gt122*Gt123 + Gt112*Gt123*gt12L + Gt112*Gt122*gt13L + Gt123*gt12L*Gt222 + - Gt122*gt13L*Gt222 + 2*Gt122*gt12L*Gt223 + Gt123*Gt212*gt22L + 2*Gt222*Gt223*gt22L + Gt122*Gt212*gt23L + - Gt123*gt23L*Gt312 + 2*Gt123*gt13L*Gt322 + 3*Gt223*gt23L*Gt322 + Gt123*gt12L*Gt323 + Gt122*gt13L*Gt323 + - Gt223*gt22L*Gt323 + Gt222*gt23L*Gt323 + Gt122*Gt312*gt33L + Gt222*Gt322*gt33L + 2*Gt322*Gt323*gt33L + - gt23L*SQR(Gt222) + gt23L*SQR(Gt323)) + 2*gtu32* - (gt11L*Gt122*Gt133 + Gt112*gt12L*Gt133 + Gt112*Gt123*gt13L + gt12L*Gt133*Gt222 + Gt122*gt13L*Gt223 + - Gt133*Gt212*gt22L + 2*Gt122*gt12L*Gt233 + 2*Gt222*gt22L*Gt233 + Gt123*Gt212*gt23L + Gt222*Gt223*gt23L + - Gt133*gt23L*Gt312 + Gt133*gt13L*Gt322 + 2*Gt233*gt23L*Gt322 + Gt123*gt13L*Gt323 + Gt223*gt23L*Gt323 + - Gt123*gt12L*Gt333 + Gt122*gt13L*Gt333 + Gt223*gt22L*Gt333 + Gt222*gt23L*Gt333 + gt23L*Gt323*Gt333 + - Gt123*Gt312*gt33L + Gt223*Gt322*gt33L + Gt322*Gt333*gt33L + gt33L*SQR(Gt323)) + - 2*gtu32*(Gt113*Gt123*gt12L + Gt113*Gt122*gt13L + Gt123*gt13L*Gt222 + 3*Gt123*gt12L*Gt223 + Gt123*Gt213*gt22L + - Gt122*Gt213*gt23L + Gt222*Gt223*gt23L + Gt123*gt23L*Gt313 + Gt133*gt13L*Gt322 + Gt233*gt23L*Gt322 + - gt12L*Gt133*Gt323 + 2*Gt123*gt13L*Gt323 + gt22L*Gt233*Gt323 + 3*Gt223*gt23L*Gt323 + gt23L*Gt323*Gt333 + - Gt122*Gt313*gt33L + Gt222*Gt323*gt33L + Gt322*Gt333*gt33L + gt11L*SQR(Gt123) + 2*gt22L*SQR(Gt223) + - gt33L*SQR(Gt323)) + 2*gtu33*(gt11L*Gt123*Gt133 + Gt113*gt12L*Gt133 + Gt113*Gt123*gt13L + gt12L*Gt133*Gt223 + - Gt123*gt13L*Gt223 + Gt133*Gt213*gt22L + 2*Gt123*gt12L*Gt233 + 2*Gt223*gt22L*Gt233 + Gt123*Gt213*gt23L + - Gt133*gt23L*Gt313 + 2*Gt133*gt13L*Gt323 + 3*Gt233*gt23L*Gt323 + gt12L*Gt133*Gt333 + Gt123*gt13L*Gt333 + - gt22L*Gt233*Gt333 + Gt223*gt23L*Gt333 + Gt123*Gt313*gt33L + Gt223*Gt323*gt33L + 2*Gt323*Gt333*gt33L + - gt23L*SQR(Gt223) + gt23L*SQR(Gt333))); - - Rt33 = 4*(Gt123*gt13L*Gt323*gtu22 + Gt223*gt23L*Gt323*gtu22 + Gt133*gt13L*Gt313*gtu31 + Gt233*gt23L*Gt313*gtu31 + - Gt113*gt13L*Gt333*gtu31 + Gt133*gt13L*Gt323*gtu32 + Gt233*gt23L*Gt323*gtu32 + Gt123*gt13L*Gt333*gtu32 + - Gt133*gt13L*Gt333*gtu33) + gtu21*(2*Gt212*Gt223*gt23L + 4*Gt123*gt13L*Gt313 + 4*Gt223*gt23L*Gt313 + - 4*Gt113*gt13L*Gt323 + 4*Gt213*gt23L*Gt323 + 2*Gt123*Gt311*gt33L - PDstandardNth12gt33) + - gtu31*(4*Gt213*gt23L*Gt333 + 2*Gt233*Gt312*gt33L + 6*Gt313*Gt333*gt33L - PDstandardNth13gt33) - - gtu22*khalf*PDstandardNth22gt33 + gtu32*(4*Gt223*gt23L*Gt333 + 2*Gt123*Gt313*gt33L + 6*Gt323*Gt333*gt33L - - PDstandardNth23gt33) - gtu33*khalf*PDstandardNth33gt33 + gt13L*PDstandardNth3Xt1 + gt23L*PDstandardNth3Xt2 + - gt33L*(2*Gt213*Gt322*gtu21 + 6*Gt313*Gt323*gtu21 + 2*Gt123*Gt312*gtu22 + 2*Gt133*Gt311*gtu31 + - 2*Gt133*Gt312*gtu32 + 2*Gt133*Gt313*gtu33 + PDstandardNth3Xt3) + Gt113*gt13L*Xt1L + Gt213*gt23L*Xt1L + - Gt313*gt33L*Xt1L + Gt123*gt13L*Xt2L + Gt223*gt23L*Xt2L + Gt323*gt33L*Xt2L + Gt133*gt13L*Xt3L + Gt333*gt33L*Xt3L + + 2*gtu11*(Gt112*Gt113*gt11L + Gt111*Gt113*gt12L + Gt111*Gt112*gt13L + + Gt113*gt12L*Gt212 + Gt112*gt13L*Gt212 + 2*Gt112*gt12L*Gt213 + + Gt113*Gt211*gt22L + 2*Gt212*Gt213*gt22L + Gt112*Gt211*gt23L + + Gt113*gt23L*Gt311 + 2*Gt113*gt13L*Gt312 + 3*Gt213*gt23L*Gt312 + + Gt113*gt12L*Gt313 + Gt112*gt13L*Gt313 + Gt213*gt22L*Gt313 + + Gt212*gt23L*Gt313 + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + + 2*Gt312*Gt313*gt33L + gt23L*SQR(Gt212) + gt23L*SQR(Gt313)) + + 2*gtu22*(gt11L*Gt122*Gt123 + Gt112*Gt123*gt12L + Gt112*Gt122*gt13L + + Gt123*gt12L*Gt222 + Gt122*gt13L*Gt222 + 2*Gt122*gt12L*Gt223 + + Gt123*Gt212*gt22L + 2*Gt222*Gt223*gt22L + Gt122*Gt212*gt23L + + Gt123*gt23L*Gt312 + 2*Gt123*gt13L*Gt322 + 3*Gt223*gt23L*Gt322 + + Gt123*gt12L*Gt323 + Gt122*gt13L*Gt323 + Gt223*gt22L*Gt323 + + Gt222*gt23L*Gt323 + Gt122*Gt312*gt33L + Gt222*Gt322*gt33L + + 2*Gt322*Gt323*gt33L + gt23L*SQR(Gt222) + gt23L*SQR(Gt323)) + + 2*gtu32*(gt11L*Gt122*Gt133 + Gt112*gt12L*Gt133 + Gt112*Gt123*gt13L + + gt12L*Gt133*Gt222 + Gt122*gt13L*Gt223 + Gt133*Gt212*gt22L + + 2*Gt122*gt12L*Gt233 + 2*Gt222*gt22L*Gt233 + Gt123*Gt212*gt23L + + Gt222*Gt223*gt23L + Gt133*gt23L*Gt312 + Gt133*gt13L*Gt322 + + 2*Gt233*gt23L*Gt322 + Gt123*gt13L*Gt323 + Gt223*gt23L*Gt323 + + Gt123*gt12L*Gt333 + Gt122*gt13L*Gt333 + Gt223*gt22L*Gt333 + + Gt222*gt23L*Gt333 + gt23L*Gt323*Gt333 + Gt123*Gt312*gt33L + + Gt223*Gt322*gt33L + Gt322*Gt333*gt33L + gt33L*SQR(Gt323)) + + 2*gtu32*(Gt113*Gt123*gt12L + Gt113*Gt122*gt13L + Gt123*gt13L*Gt222 + + 3*Gt123*gt12L*Gt223 + Gt123*Gt213*gt22L + Gt122*Gt213*gt23L + + Gt222*Gt223*gt23L + Gt123*gt23L*Gt313 + Gt133*gt13L*Gt322 + + Gt233*gt23L*Gt322 + gt12L*Gt133*Gt323 + 2*Gt123*gt13L*Gt323 + + gt22L*Gt233*Gt323 + 3*Gt223*gt23L*Gt323 + gt23L*Gt323*Gt333 + + Gt122*Gt313*gt33L + Gt222*Gt323*gt33L + Gt322*Gt333*gt33L + + gt11L*SQR(Gt123) + 2*gt22L*SQR(Gt223) + gt33L*SQR(Gt323)) + + 2*gtu33*(gt11L*Gt123*Gt133 + Gt113*gt12L*Gt133 + Gt113*Gt123*gt13L + + gt12L*Gt133*Gt223 + Gt123*gt13L*Gt223 + Gt133*Gt213*gt22L + + 2*Gt123*gt12L*Gt233 + 2*Gt223*gt22L*Gt233 + Gt123*Gt213*gt23L + + Gt133*gt23L*Gt313 + 2*Gt133*gt13L*Gt323 + 3*Gt233*gt23L*Gt323 + + gt12L*Gt133*Gt333 + Gt123*gt13L*Gt333 + gt22L*Gt233*Gt333 + + Gt223*gt23L*Gt333 + Gt123*Gt313*gt33L + Gt223*Gt323*gt33L + + 2*Gt323*Gt333*gt33L + gt23L*SQR(Gt223) + gt23L*SQR(Gt333))); + + Rt33 = 4*(Gt123*gt13L*Gt323*gtu22 + Gt223*gt23L*Gt323*gtu22 + + Gt133*gt13L*Gt313*gtu31 + Gt233*gt23L*Gt313*gtu31 + + Gt113*gt13L*Gt333*gtu31 + Gt133*gt13L*Gt323*gtu32 + + Gt233*gt23L*Gt323*gtu32 + Gt123*gt13L*Gt333*gtu32 + + Gt133*gt13L*Gt333*gtu33) + + gtu21*(2*Gt212*Gt223*gt23L + 4*Gt123*gt13L*Gt313 + 4*Gt223*gt23L*Gt313 + + 4*Gt113*gt13L*Gt323 + 4*Gt213*gt23L*Gt323 + 2*Gt123*Gt311*gt33L - + PDstandardNth12gt33) + gtu31* + (4*Gt213*gt23L*Gt333 + 2*Gt233*Gt312*gt33L + 6*Gt313*Gt333*gt33L - + PDstandardNth13gt33) - gtu22*khalf*PDstandardNth22gt33 + + gtu32*(4*Gt223*gt23L*Gt333 + 2*Gt123*Gt313*gt33L + 6*Gt323*Gt333*gt33L - + PDstandardNth23gt33) - gtu33*khalf*PDstandardNth33gt33 + + gt13L*PDstandardNth3Xt1 + gt23L*PDstandardNth3Xt2 + + gt33L*(2*Gt213*Gt322*gtu21 + 6*Gt313*Gt323*gtu21 + 2*Gt123*Gt312*gtu22 + + 2*Gt133*Gt311*gtu31 + 2*Gt133*Gt312*gtu32 + 2*Gt133*Gt313*gtu33 + + PDstandardNth3Xt3) + Gt113*gt13L*Xt1L + Gt213*gt23L*Xt1L + + Gt313*gt33L*Xt1L + Gt123*gt13L*Xt2L + Gt223*gt23L*Xt2L + Gt323*gt33L*Xt2L + + Gt133*gt13L*Xt3L + Gt333*gt33L*Xt3L + Gt233*(4*gt23L*Gt333*gtu33 + 2*Gt323*gt33L*gtu33 + gt23L*Xt3L) + - gtu11*(2*Gt212*Gt213*gt23L + 4*Gt113*gt13L*Gt313 + 4*Gt213*gt23L*Gt313 + 2*Gt113*Gt311*gt33L + - 2*Gt213*Gt312*gt33L - khalf*PDstandardNth11gt33 + gt11L*SQR(Gt113)) + - 2*(Gt111*Gt113*gt13L*gtu11 + Gt113*gt12L*Gt213*gtu11 + Gt112*gt13L*Gt213*gtu11 + Gt113*Gt211*gt23L*gtu11 + - Gt113*gt11L*Gt123*gtu21 + Gt112*Gt113*gt13L*gtu21 + Gt111*Gt123*gt13L*gtu21 + Gt123*gt12L*Gt213*gtu21 + - Gt122*gt13L*Gt213*gtu21 + Gt113*gt12L*Gt223*gtu21 + Gt112*gt13L*Gt223*gtu21 + Gt213*Gt223*gt22L*gtu21 + - Gt123*Gt211*gt23L*gtu21 + Gt113*Gt212*gt23L*gtu21 + Gt213*Gt222*gt23L*gtu21 + Gt113*Gt312*gt33L*gtu21 + - Gt223*Gt312*gt33L*gtu21 + Gt112*Gt123*gt13L*gtu22 + Gt123*gt12L*Gt223*gtu22 + Gt122*gt13L*Gt223*gtu22 + - Gt123*Gt212*gt23L*gtu22 + Gt222*Gt223*gt23L*gtu22 + Gt223*Gt322*gt33L*gtu22 + Gt113*gt11L*Gt133*gtu31 + - Gt111*Gt133*gt13L*gtu31 + gt12L*Gt133*Gt213*gtu31 + Gt123*gt13L*Gt213*gtu31 + Gt113*gt12L*Gt233*gtu31 + - Gt112*gt13L*Gt233*gtu31 + Gt213*gt22L*Gt233*gtu31 + Gt133*Gt211*gt23L*gtu31 + Gt113*Gt213*gt23L*gtu31 + - Gt213*Gt223*gt23L*gtu31 + Gt212*Gt233*gt23L*gtu31 + Gt113*Gt313*gt33L*gtu31 + Gt213*Gt323*gt33L*gtu31 + - gt11L*Gt123*Gt133*gtu32 + Gt113*Gt123*gt13L*gtu32 + Gt112*Gt133*gt13L*gtu32 + gt12L*Gt133*Gt223*gtu32 + - Gt123*gt13L*Gt223*gtu32 + Gt123*gt12L*Gt233*gtu32 + Gt122*gt13L*Gt233*gtu32 + Gt223*gt22L*Gt233*gtu32 + - Gt133*Gt212*gt23L*gtu32 + Gt123*Gt213*gt23L*gtu32 + Gt222*Gt233*gt23L*gtu32 + Gt233*Gt322*gt33L*gtu32 + - Gt223*Gt323*gt33L*gtu32 + Gt113*Gt133*gt13L*gtu33 + gt12L*Gt133*Gt233*gtu33 + Gt123*gt13L*Gt233*gtu33 + - Gt133*Gt213*gt23L*gtu33 + Gt223*Gt233*gt23L*gtu33 + gt13L*gtu31*SQR(Gt113)) + gt11L*gtu22*SQR(Gt123) + - gt11L*gtu33*SQR(Gt133) + gt22L*gtu11*SQR(Gt213) + gt22L*gtu22*SQR(Gt223) + 2*gt23L*gtu32*SQR(Gt223) + - gt22L*gtu33*SQR(Gt233) + 3*gt33L*gtu11*SQR(Gt313) + 3*gt33L*gtu22*SQR(Gt323) + 3*gt33L*gtu33*SQR(Gt333); - - Rphi11 = 2*(-PDstandardNth11phi - gt11L*gtu11*PDstandardNth11phi - 2*gt11L*gtu21*PDstandardNth12phi - - 2*gt11L*gtu31*PDstandardNth13phi - gt11L*gtu22*PDstandardNth22phi - 2*gt11L*gtu32*PDstandardNth23phi - - gt11L*gtu33*PDstandardNth33phi + Gt311*PDstandardNth3phi + gt11L*Gt311*gtu11*PDstandardNth3phi + - 2*gt11L*Gt312*gtu21*PDstandardNth3phi + gt11L*Gt322*gtu22*PDstandardNth3phi + - 2*gt11L*Gt313*gtu31*PDstandardNth3phi + 2*gt11L*Gt323*gtu32*PDstandardNth3phi + - gt11L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt111 + Gt111*gt11L*gtu11 + 2*Gt112*gt11L*gtu21 + gt11L*Gt122*gtu22 + 2*Gt113*gt11L*gtu31 + - 2*gt11L*Gt123*gtu32 + gt11L*Gt133*gtu33 - 4*gt11L*gtu21*PDstandardNth2phi - 4*gt11L*gtu31*PDstandardNth3phi) + + gtu11*(2*Gt212*Gt213*gt23L + 4*Gt113*gt13L*Gt313 + 4*Gt213*gt23L*Gt313 + + 2*Gt113*Gt311*gt33L + 2*Gt213*Gt312*gt33L - khalf*PDstandardNth11gt33 + + gt11L*SQR(Gt113)) + 2*(Gt111*Gt113*gt13L*gtu11 + + Gt113*gt12L*Gt213*gtu11 + Gt112*gt13L*Gt213*gtu11 + + Gt113*Gt211*gt23L*gtu11 + Gt113*gt11L*Gt123*gtu21 + + Gt112*Gt113*gt13L*gtu21 + Gt111*Gt123*gt13L*gtu21 + + Gt123*gt12L*Gt213*gtu21 + Gt122*gt13L*Gt213*gtu21 + + Gt113*gt12L*Gt223*gtu21 + Gt112*gt13L*Gt223*gtu21 + + Gt213*Gt223*gt22L*gtu21 + Gt123*Gt211*gt23L*gtu21 + + Gt113*Gt212*gt23L*gtu21 + Gt213*Gt222*gt23L*gtu21 + + Gt113*Gt312*gt33L*gtu21 + Gt223*Gt312*gt33L*gtu21 + + Gt112*Gt123*gt13L*gtu22 + Gt123*gt12L*Gt223*gtu22 + + Gt122*gt13L*Gt223*gtu22 + Gt123*Gt212*gt23L*gtu22 + + Gt222*Gt223*gt23L*gtu22 + Gt223*Gt322*gt33L*gtu22 + + Gt113*gt11L*Gt133*gtu31 + Gt111*Gt133*gt13L*gtu31 + + gt12L*Gt133*Gt213*gtu31 + Gt123*gt13L*Gt213*gtu31 + + Gt113*gt12L*Gt233*gtu31 + Gt112*gt13L*Gt233*gtu31 + + Gt213*gt22L*Gt233*gtu31 + Gt133*Gt211*gt23L*gtu31 + + Gt113*Gt213*gt23L*gtu31 + Gt213*Gt223*gt23L*gtu31 + + Gt212*Gt233*gt23L*gtu31 + Gt113*Gt313*gt33L*gtu31 + + Gt213*Gt323*gt33L*gtu31 + gt11L*Gt123*Gt133*gtu32 + + Gt113*Gt123*gt13L*gtu32 + Gt112*Gt133*gt13L*gtu32 + + gt12L*Gt133*Gt223*gtu32 + Gt123*gt13L*Gt223*gtu32 + + Gt123*gt12L*Gt233*gtu32 + Gt122*gt13L*Gt233*gtu32 + + Gt223*gt22L*Gt233*gtu32 + Gt133*Gt212*gt23L*gtu32 + + Gt123*Gt213*gt23L*gtu32 + Gt222*Gt233*gt23L*gtu32 + + Gt233*Gt322*gt33L*gtu32 + Gt223*Gt323*gt33L*gtu32 + + Gt113*Gt133*gt13L*gtu33 + gt12L*Gt133*Gt233*gtu33 + + Gt123*gt13L*Gt233*gtu33 + Gt133*Gt213*gt23L*gtu33 + + Gt223*Gt233*gt23L*gtu33 + gt13L*gtu31*SQR(Gt113)) + + gt11L*gtu22*SQR(Gt123) + gt11L*gtu33*SQR(Gt133) + gt22L*gtu11*SQR(Gt213) + + gt22L*gtu22*SQR(Gt223) + 2*gt23L*gtu32*SQR(Gt223) + + gt22L*gtu33*SQR(Gt233) + 3*gt33L*gtu11*SQR(Gt313) + + 3*gt33L*gtu22*SQR(Gt323) + 3*gt33L*gtu33*SQR(Gt333); + + Rphi11 = 2*(-PDstandardNth11phi - gt11L*gtu11*PDstandardNth11phi - + 2*gt11L*gtu21*PDstandardNth12phi - 2*gt11L*gtu31*PDstandardNth13phi - + gt11L*gtu22*PDstandardNth22phi - 2*gt11L*gtu32*PDstandardNth23phi - + gt11L*gtu33*PDstandardNth33phi + Gt311*PDstandardNth3phi + + gt11L*Gt311*gtu11*PDstandardNth3phi + + 2*gt11L*Gt312*gtu21*PDstandardNth3phi + + gt11L*Gt322*gtu22*PDstandardNth3phi + + 2*gt11L*Gt313*gtu31*PDstandardNth3phi + + 2*gt11L*Gt323*gtu32*PDstandardNth3phi + + gt11L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt111 + Gt111*gt11L*gtu11 + 2*Gt112*gt11L*gtu21 + + gt11L*Gt122*gtu22 + 2*Gt113*gt11L*gtu31 + 2*gt11L*Gt123*gtu32 + + gt11L*Gt133*gtu33 - 4*gt11L*gtu21*PDstandardNth2phi - + 4*gt11L*gtu31*PDstandardNth3phi) + PDstandardNth2phi*(Gt211 + gt11L*Gt211*gtu11 + - gt11L*(2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + Gt233*gtu33) - - 4*gt11L*gtu32*PDstandardNth3phi) + (2 - 2*gt11L*gtu11)*SQR(PDstandardNth1phi) - - 2*gt11L*gtu22*SQR(PDstandardNth2phi) - 2*gt11L*gtu33*SQR(PDstandardNth3phi)); - - Rphi12 = 2*(-(gt12L*gtu11*PDstandardNth11phi) - PDstandardNth12phi - 2*gt12L*gtu21*PDstandardNth12phi - - 2*gt12L*gtu31*PDstandardNth13phi - gt12L*gtu22*PDstandardNth22phi - 2*gt12L*gtu32*PDstandardNth23phi - - gt12L*gtu33*PDstandardNth33phi + Gt312*PDstandardNth3phi + gt12L*Gt311*gtu11*PDstandardNth3phi + - 2*gt12L*Gt312*gtu21*PDstandardNth3phi + gt12L*Gt322*gtu22*PDstandardNth3phi + - 2*gt12L*Gt313*gtu31*PDstandardNth3phi + 2*gt12L*Gt323*gtu32*PDstandardNth3phi + - gt12L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt112 + Gt111*gt12L*gtu11 + 2*Gt112*gt12L*gtu21 + Gt122*gt12L*gtu22 + 2*Gt113*gt12L*gtu31 + - 2*Gt123*gt12L*gtu32 + gt12L*Gt133*gtu33 + (2 - 4*gt12L*gtu21)*PDstandardNth2phi - - 4*gt12L*gtu31*PDstandardNth3phi) + PDstandardNth2phi* - (Gt212 + 2*gt12L*Gt212*gtu21 + gt12L*(Gt211*gtu11 + Gt222*gtu22 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + Gt233*gtu33) - - 4*gt12L*gtu32*PDstandardNth3phi) - 2*gt12L*gtu11*SQR(PDstandardNth1phi) - - 2*gt12L*gtu22*SQR(PDstandardNth2phi) - 2*gt12L*gtu33*SQR(PDstandardNth3phi)); - - Rphi13 = 2*(-PDstandardNth13phi + gt13L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - - 2*gtu31*PDstandardNth13phi) - gt13L*gtu22*PDstandardNth22phi - 2*gt13L*gtu32*PDstandardNth23phi - - gt13L*gtu33*PDstandardNth33phi + Gt313*PDstandardNth3phi + gt13L*Gt311*gtu11*PDstandardNth3phi + - 2*gt13L*Gt312*gtu21*PDstandardNth3phi + gt13L*Gt322*gtu22*PDstandardNth3phi + - 2*gt13L*Gt313*gtu31*PDstandardNth3phi + 2*gt13L*Gt323*gtu32*PDstandardNth3phi + - gt13L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt113 + Gt111*gt13L*gtu11 + 2*Gt112*gt13L*gtu21 + Gt122*gt13L*gtu22 + 2*Gt113*gt13L*gtu31 + - 2*Gt123*gt13L*gtu32 + Gt133*gt13L*gtu33 - 4*gt13L*gtu21*PDstandardNth2phi + + gt11L*(2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + + Gt233*gtu33) - 4*gt11L*gtu32*PDstandardNth3phi) + + (2 - 2*gt11L*gtu11)*SQR(PDstandardNth1phi) - + 2*gt11L*gtu22*SQR(PDstandardNth2phi) - + 2*gt11L*gtu33*SQR(PDstandardNth3phi)); + + Rphi12 = 2*(-(gt12L*gtu11*PDstandardNth11phi) - PDstandardNth12phi - + 2*gt12L*gtu21*PDstandardNth12phi - 2*gt12L*gtu31*PDstandardNth13phi - + gt12L*gtu22*PDstandardNth22phi - 2*gt12L*gtu32*PDstandardNth23phi - + gt12L*gtu33*PDstandardNth33phi + Gt312*PDstandardNth3phi + + gt12L*Gt311*gtu11*PDstandardNth3phi + + 2*gt12L*Gt312*gtu21*PDstandardNth3phi + + gt12L*Gt322*gtu22*PDstandardNth3phi + + 2*gt12L*Gt313*gtu31*PDstandardNth3phi + + 2*gt12L*Gt323*gtu32*PDstandardNth3phi + + gt12L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt112 + Gt111*gt12L*gtu11 + 2*Gt112*gt12L*gtu21 + + Gt122*gt12L*gtu22 + 2*Gt113*gt12L*gtu31 + 2*Gt123*gt12L*gtu32 + + gt12L*Gt133*gtu33 + (2 - 4*gt12L*gtu21)*PDstandardNth2phi - + 4*gt12L*gtu31*PDstandardNth3phi) + + PDstandardNth2phi*(Gt212 + 2*gt12L*Gt212*gtu21 + + gt12L*(Gt211*gtu11 + Gt222*gtu22 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + + Gt233*gtu33) - 4*gt12L*gtu32*PDstandardNth3phi) - + 2*gt12L*gtu11*SQR(PDstandardNth1phi) - + 2*gt12L*gtu22*SQR(PDstandardNth2phi) - + 2*gt12L*gtu33*SQR(PDstandardNth3phi)); + + Rphi13 = 2*(-PDstandardNth13phi + + gt13L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - + 2*gtu31*PDstandardNth13phi) - gt13L*gtu22*PDstandardNth22phi - + 2*gt13L*gtu32*PDstandardNth23phi - gt13L*gtu33*PDstandardNth33phi + + Gt313*PDstandardNth3phi + gt13L*Gt311*gtu11*PDstandardNth3phi + + 2*gt13L*Gt312*gtu21*PDstandardNth3phi + + gt13L*Gt322*gtu22*PDstandardNth3phi + + 2*gt13L*Gt313*gtu31*PDstandardNth3phi + + 2*gt13L*Gt323*gtu32*PDstandardNth3phi + + gt13L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt113 + Gt111*gt13L*gtu11 + 2*Gt112*gt13L*gtu21 + + Gt122*gt13L*gtu22 + 2*Gt113*gt13L*gtu31 + 2*Gt123*gt13L*gtu32 + + Gt133*gt13L*gtu33 - 4*gt13L*gtu21*PDstandardNth2phi + (2 - 4*gt13L*gtu31)*PDstandardNth3phi) + PDstandardNth2phi*(Gt213 + 2*gt13L*Gt213*gtu31 + - gt13L*(Gt211*gtu11 + 2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt223*gtu32 + Gt233*gtu33) - - 4*gt13L*gtu32*PDstandardNth3phi) - 2*gt13L*gtu11*SQR(PDstandardNth1phi) - - 2*gt13L*gtu22*SQR(PDstandardNth2phi) - 2*gt13L*gtu33*SQR(PDstandardNth3phi)); - - Rphi22 = 2*(-PDstandardNth22phi + gt22L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - - 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi) - 2*gt22L*gtu32*PDstandardNth23phi - - gt22L*gtu33*PDstandardNth33phi + Gt322*PDstandardNth3phi + gt22L*Gt311*gtu11*PDstandardNth3phi + - 2*gt22L*Gt312*gtu21*PDstandardNth3phi + gt22L*Gt322*gtu22*PDstandardNth3phi + - 2*gt22L*Gt313*gtu31*PDstandardNth3phi + 2*gt22L*Gt323*gtu32*PDstandardNth3phi + - gt22L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt122 + Gt111*gt22L*gtu11 + 2*Gt112*gt22L*gtu21 + Gt122*gt22L*gtu22 + 2*Gt113*gt22L*gtu31 + - 2*Gt123*gt22L*gtu32 + Gt133*gt22L*gtu33 - 4*gt22L*gtu21*PDstandardNth2phi - 4*gt22L*gtu31*PDstandardNth3phi) + + gt13L*(Gt211*gtu11 + 2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt223*gtu32 + + Gt233*gtu33) - 4*gt13L*gtu32*PDstandardNth3phi) - + 2*gt13L*gtu11*SQR(PDstandardNth1phi) - + 2*gt13L*gtu22*SQR(PDstandardNth2phi) - + 2*gt13L*gtu33*SQR(PDstandardNth3phi)); + + Rphi22 = 2*(-PDstandardNth22phi + + gt22L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - + 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi) - + 2*gt22L*gtu32*PDstandardNth23phi - gt22L*gtu33*PDstandardNth33phi + + Gt322*PDstandardNth3phi + gt22L*Gt311*gtu11*PDstandardNth3phi + + 2*gt22L*Gt312*gtu21*PDstandardNth3phi + + gt22L*Gt322*gtu22*PDstandardNth3phi + + 2*gt22L*Gt313*gtu31*PDstandardNth3phi + + 2*gt22L*Gt323*gtu32*PDstandardNth3phi + + gt22L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt122 + Gt111*gt22L*gtu11 + 2*Gt112*gt22L*gtu21 + + Gt122*gt22L*gtu22 + 2*Gt113*gt22L*gtu31 + 2*Gt123*gt22L*gtu32 + + Gt133*gt22L*gtu33 - 4*gt22L*gtu21*PDstandardNth2phi - + 4*gt22L*gtu31*PDstandardNth3phi) + PDstandardNth2phi*(Gt222 + Gt222*gt22L*gtu22 + - gt22L*(Gt211*gtu11 + 2*Gt212*gtu21 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + Gt233*gtu33) - - 4*gt22L*gtu32*PDstandardNth3phi) - 2*gt22L*gtu11*SQR(PDstandardNth1phi) + - (2 - 2*gt22L*gtu22)*SQR(PDstandardNth2phi) - 2*gt22L*gtu33*SQR(PDstandardNth3phi)); - - Rphi23 = 2*(-PDstandardNth23phi + gt23L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - - 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi - 2*gtu32*PDstandardNth23phi) - - gt23L*gtu33*PDstandardNth33phi + Gt323*PDstandardNth3phi + gt23L*Gt311*gtu11*PDstandardNth3phi + - 2*gt23L*Gt312*gtu21*PDstandardNth3phi + gt23L*Gt322*gtu22*PDstandardNth3phi + - 2*gt23L*Gt313*gtu31*PDstandardNth3phi + 2*gt23L*Gt323*gtu32*PDstandardNth3phi + - gt23L*Gt333*gtu33*PDstandardNth3phi + PDstandardNth1phi* - (Gt123 + Gt111*gt23L*gtu11 + 2*Gt112*gt23L*gtu21 + Gt122*gt23L*gtu22 + 2*Gt113*gt23L*gtu31 + - 2*Gt123*gt23L*gtu32 + Gt133*gt23L*gtu33 - 4*gt23L*gtu21*PDstandardNth2phi - 4*gt23L*gtu31*PDstandardNth3phi) + + gt22L*(Gt211*gtu11 + 2*Gt212*gtu21 + 2*Gt213*gtu31 + 2*Gt223*gtu32 + + Gt233*gtu33) - 4*gt22L*gtu32*PDstandardNth3phi) - + 2*gt22L*gtu11*SQR(PDstandardNth1phi) + + (2 - 2*gt22L*gtu22)*SQR(PDstandardNth2phi) - + 2*gt22L*gtu33*SQR(PDstandardNth3phi)); + + Rphi23 = 2*(-PDstandardNth23phi + + gt23L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - + 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi - + 2*gtu32*PDstandardNth23phi) - gt23L*gtu33*PDstandardNth33phi + + Gt323*PDstandardNth3phi + gt23L*Gt311*gtu11*PDstandardNth3phi + + 2*gt23L*Gt312*gtu21*PDstandardNth3phi + + gt23L*Gt322*gtu22*PDstandardNth3phi + + 2*gt23L*Gt313*gtu31*PDstandardNth3phi + + 2*gt23L*Gt323*gtu32*PDstandardNth3phi + + gt23L*Gt333*gtu33*PDstandardNth3phi + + PDstandardNth1phi*(Gt123 + Gt111*gt23L*gtu11 + 2*Gt112*gt23L*gtu21 + + Gt122*gt23L*gtu22 + 2*Gt113*gt23L*gtu31 + 2*Gt123*gt23L*gtu32 + + Gt133*gt23L*gtu33 - 4*gt23L*gtu21*PDstandardNth2phi - + 4*gt23L*gtu31*PDstandardNth3phi) + PDstandardNth2phi*(Gt223 + 2*Gt223*gt23L*gtu32 + - gt23L*(Gt211*gtu11 + 2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt213*gtu31 + Gt233*gtu33) + - (2 - 4*gt23L*gtu32)*PDstandardNth3phi) - 2*gt23L*gtu11*SQR(PDstandardNth1phi) - - 2*gt23L*gtu22*SQR(PDstandardNth2phi) - 2*gt23L*gtu33*SQR(PDstandardNth3phi)); - - Rphi33 = 2*(-PDstandardNth33phi + (Gt333 + gt33L* - (Gt322*gtu22 + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33))*PDstandardNth3phi + - PDstandardNth2phi*(Gt233 + gt33L*(Gt211*gtu11 + Gt222*gtu22 + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + - Gt233*gtu33 - 4*gtu32*PDstandardNth3phi)) + - PDstandardNth1phi*(Gt133 + gt33L*(Gt111*gtu11 + Gt122*gtu22 + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + - Gt133*gtu33 - 4*(gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi))) + 2*SQR(PDstandardNth3phi) + - gt33L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - 2*gtu31*PDstandardNth13phi - - gtu22*PDstandardNth22phi - 2*gtu32*PDstandardNth23phi - gtu33*PDstandardNth33phi + - Gt311*gtu11*PDstandardNth3phi - 2*gtu11*SQR(PDstandardNth1phi) - 2*gtu22*SQR(PDstandardNth2phi) - - 2*gtu33*SQR(PDstandardNth3phi))); + gt23L*(Gt211*gtu11 + 2*Gt212*gtu21 + Gt222*gtu22 + 2*Gt213*gtu31 + + Gt233*gtu33) + (2 - 4*gt23L*gtu32)*PDstandardNth3phi) - + 2*gt23L*gtu11*SQR(PDstandardNth1phi) - + 2*gt23L*gtu22*SQR(PDstandardNth2phi) - + 2*gt23L*gtu33*SQR(PDstandardNth3phi)); + + Rphi33 = 2*(-PDstandardNth33phi + + (Gt333 + gt33L*(Gt322*gtu22 + + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33))* + PDstandardNth3phi + PDstandardNth2phi* + (Gt233 + gt33L*(Gt211*gtu11 + Gt222*gtu22 + + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33 - + 4*gtu32*PDstandardNth3phi)) + + PDstandardNth1phi*(Gt133 + + gt33L*(Gt111*gtu11 + Gt122*gtu22 + + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33 - + 4*(gtu21*PDstandardNth2phi + gtu31*PDstandardNth3phi))) + + 2*SQR(PDstandardNth3phi) + + gt33L*(-(gtu11*PDstandardNth11phi) - 2*gtu21*PDstandardNth12phi - + 2*gtu31*PDstandardNth13phi - gtu22*PDstandardNth22phi - + 2*gtu32*PDstandardNth23phi - gtu33*PDstandardNth33phi + + Gt311*gtu11*PDstandardNth3phi - 2*gtu11*SQR(PDstandardNth1phi) - + 2*gtu22*SQR(PDstandardNth2phi) - 2*gtu33*SQR(PDstandardNth3phi))); e4phi = exp(4*phiL); @@ -800,59 +1062,124 @@ void ML_BSSN_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REA Atm33 = At13L*gtu31 + At23L*gtu32 + At33L*gtu33; - HL = -2*(Atm12*Atm21 + Atm13*Atm31 + Atm23*Atm32) + trR - SQR(Atm11) - SQR(Atm22) - SQR(Atm33) + ktwothird*SQR(trKL); - - M1L = -(At12L*Gt112*gtu22) - At11L*Gt122*gtu22 - At22L*Gt212*gtu22 - At12L*Gt222*gtu22 - At23L*Gt312*gtu22 - - At13L*Gt322*gtu22 - At13L*Gt111*gtu31 - 3*At11L*Gt113*gtu31 - At23L*Gt211*gtu31 - 3*At12L*Gt213*gtu31 - - At33L*Gt311*gtu31 - 3*At13L*Gt313*gtu31 - At13L*Gt112*gtu32 - At12L*Gt113*gtu32 - At23L*Gt212*gtu32 - - At22L*Gt213*gtu32 - 2*At12L*Gt223*gtu32 - At33L*Gt312*gtu32 - At23L*Gt313*gtu32 - 2*At13L*Gt323*gtu32 - - 2*(At11L*Gt111*gtu11 + At12L*Gt211*gtu11 + At13L*Gt311*gtu11 + At11L*Gt123*gtu32) - At13L*Gt113*gtu33 - - At11L*Gt133*gtu33 - At23L*Gt213*gtu33 - At12L*Gt233*gtu33 - At33L*Gt313*gtu33 - At13L*Gt333*gtu33 + - gtu11*PDstandardNth1At11 + gtu21*(-(At12L*Gt111) - 3*At11L*Gt112 - At22L*Gt211 - 3*At12L*Gt212 - At23L*Gt311 - - 3*At13L*Gt312 + PDstandardNth1At12) + gtu31*PDstandardNth1At13 + 6*At11L*gtu11*PDstandardNth1phi + - 6*At12L*gtu21*PDstandardNth1phi + 6*At13L*gtu31*PDstandardNth1phi - ktwothird*PDstandardNth1trK + - gtu21*PDstandardNth2At11 + gtu22*PDstandardNth2At12 + gtu32*PDstandardNth2At13 + 6*At11L*gtu21*PDstandardNth2phi + - 6*At12L*gtu22*PDstandardNth2phi + 6*At13L*gtu32*PDstandardNth2phi + gtu31*PDstandardNth3At11 + - gtu32*PDstandardNth3At12 + gtu33*PDstandardNth3At13 + 6*At11L*gtu31*PDstandardNth3phi + - 6*At12L*gtu32*PDstandardNth3phi + 6*At13L*gtu33*PDstandardNth3phi; - - M2L = -(At12L*Gt111*gtu11) - At11L*Gt112*gtu11 - At22L*Gt211*gtu11 - At12L*Gt212*gtu11 - At23L*Gt311*gtu11 - - At13L*Gt312*gtu11 - 3*At12L*Gt112*gtu21 - At11L*Gt122*gtu21 - 3*At22L*Gt212*gtu21 - At12L*Gt222*gtu21 - - 3*At23L*Gt312*gtu21 - At13L*Gt322*gtu21 - 2*At12L*Gt122*gtu22 - 2*At22L*Gt222*gtu22 - 2*At23L*Gt322*gtu22 - - At13L*Gt112*gtu31 - 2*At12L*Gt113*gtu31 - At11L*Gt123*gtu31 - At23L*Gt212*gtu31 - 2*At22L*Gt213*gtu31 - - At12L*Gt223*gtu31 - At33L*Gt312*gtu31 - 2*At23L*Gt313*gtu31 - At13L*Gt323*gtu31 - At13L*Gt122*gtu32 - - 3*At12L*Gt123*gtu32 - At23L*Gt222*gtu32 - 3*At22L*Gt223*gtu32 - At33L*Gt322*gtu32 - 3*At23L*Gt323*gtu32 - - At13L*Gt123*gtu33 - At12L*Gt133*gtu33 - At23L*Gt223*gtu33 - At22L*Gt233*gtu33 - At33L*Gt323*gtu33 - - At23L*Gt333*gtu33 + gtu11*PDstandardNth1At12 + gtu21*PDstandardNth1At22 + gtu31*PDstandardNth1At23 + - 6*At12L*gtu11*PDstandardNth1phi + 6*At22L*gtu21*PDstandardNth1phi + 6*At23L*gtu31*PDstandardNth1phi + - gtu21*PDstandardNth2At12 + gtu22*PDstandardNth2At22 + gtu32*PDstandardNth2At23 + 6*At12L*gtu21*PDstandardNth2phi + - 6*At22L*gtu22*PDstandardNth2phi + 6*At23L*gtu32*PDstandardNth2phi - ktwothird*PDstandardNth2trK + - gtu31*PDstandardNth3At12 + gtu32*PDstandardNth3At22 + gtu33*PDstandardNth3At23 + 6*At12L*gtu31*PDstandardNth3phi + - 6*At22L*gtu32*PDstandardNth3phi + 6*At23L*gtu33*PDstandardNth3phi; - - M3L = -(At13L*Gt111*gtu11) - At11L*Gt113*gtu11 - At23L*Gt211*gtu11 - At12L*Gt213*gtu11 - At33L*Gt311*gtu11 - - At13L*Gt313*gtu11 - 2*At13L*Gt112*gtu21 - At12L*Gt113*gtu21 - At11L*Gt123*gtu21 - 2*At23L*Gt212*gtu21 - - At22L*Gt213*gtu21 - At12L*Gt223*gtu21 - 2*At33L*Gt312*gtu21 - At23L*Gt313*gtu21 - At13L*Gt323*gtu21 - - At13L*Gt122*gtu22 - At12L*Gt123*gtu22 - At23L*Gt222*gtu22 - At22L*Gt223*gtu22 - At33L*Gt322*gtu22 - - At23L*Gt323*gtu22 - 3*At13L*Gt113*gtu31 - At11L*Gt133*gtu31 - 3*At23L*Gt213*gtu31 - At12L*Gt233*gtu31 - - 3*At33L*Gt313*gtu31 - At13L*Gt333*gtu31 - 3*At13L*Gt123*gtu32 - At12L*Gt133*gtu32 - 3*At23L*Gt223*gtu32 - - At22L*Gt233*gtu32 - 3*At33L*Gt323*gtu32 - At23L*Gt333*gtu32 - 2*At13L*Gt133*gtu33 - 2*At23L*Gt233*gtu33 - - 2*At33L*Gt333*gtu33 + gtu11*PDstandardNth1At13 + gtu21*PDstandardNth1At23 + gtu31*PDstandardNth1At33 + - 6*At13L*gtu11*PDstandardNth1phi + 6*At23L*gtu21*PDstandardNth1phi + 6*At33L*gtu31*PDstandardNth1phi + - gtu21*PDstandardNth2At13 + gtu22*PDstandardNth2At23 + gtu32*PDstandardNth2At33 + 6*At13L*gtu21*PDstandardNth2phi + - 6*At23L*gtu22*PDstandardNth2phi + 6*At33L*gtu32*PDstandardNth2phi + gtu31*PDstandardNth3At13 + - gtu32*PDstandardNth3At23 + gtu33*PDstandardNth3At33 + 6*At13L*gtu31*PDstandardNth3phi + - 6*At23L*gtu32*PDstandardNth3phi + 6*At33L*gtu33*PDstandardNth3phi - ktwothird*PDstandardNth3trK; + T00 = eTttL; + + T01 = eTtxL; + + T02 = eTtyL; + + T03 = eTtzL; + + T11 = eTxxL; + + T12 = eTxyL; + + T13 = eTxzL; + + T22 = eTyyL; + + T23 = eTyzL; + + T33 = eTzzL; + + rho = pow(alphaL,-2)*(T00 - 2*(beta2L*T02 + beta3L*T03) + + 2*(beta1L*(-T01 + beta2L*T12 + beta3L*T13) + beta2L*beta3L*T23) + + T11*SQR(beta1L) + T22*SQR(beta2L) + T33*SQR(beta3L)); + + S1 = (-T01 + beta1L*T11 + beta2L*T12 + beta3L*T13)*INV(alphaL); + + S2 = (-T02 + beta1L*T12 + beta2L*T22 + beta3L*T23)*INV(alphaL); + + S3 = (-T03 + beta1L*T13 + beta2L*T23 + beta3L*T33)*INV(alphaL); + + HL = -2.*(Atm12*Atm21 + Atm13*Atm31 + Atm23*Atm32) - + 50.26548245743669181540229413247204614715*rho + trR - + 1.*(SQR(Atm11) + SQR(Atm22) + SQR(Atm33)) + + 0.6666666666666666666666666666666666666667*SQR(trKL); + + M1L = -2.*((At11L*Gt111 + At12L*Gt211 + At13L*Gt311)*gtu11 + + At11L*Gt123*gtu32) - 1.*((At11L*Gt122 + At22L*Gt212 + + At12L*(Gt112 + Gt222) + At23L*Gt312 + At13L*Gt322)*gtu22 + + (At12L*Gt113 + At23L*Gt212)*gtu32 + + (At11L*Gt133 + At23L*Gt213 + At12L*Gt233 + At33L*Gt313 + At13L*Gt333)* + gtu33 + At13L*(Gt111*gtu31 + Gt112*gtu32 + Gt113*gtu33)) + + gtu11*(PDstandardNth1At11 + 6.*At11L*PDstandardNth1phi) - + 0.6666666666666666666666666666666666666667*PDstandardNth1trK + + gtu22*(PDstandardNth2At12 + 6.*At12L*PDstandardNth2phi) + + gtu21*(-1.*(At12L*Gt111 + At22L*Gt211 + At23L*Gt311) - + 3.*(At11L*Gt112 + At12L*Gt212 + At13L*Gt312) + PDstandardNth1At12 + + PDstandardNth2At11 + 6.*(At12L*PDstandardNth1phi + + At11L*PDstandardNth2phi)) + + gtu33*(PDstandardNth3At13 + 6.*At13L*PDstandardNth3phi) + + gtu31*(-1.*(At23L*Gt211 + At33L*Gt311) - + 3.*(At11L*Gt113 + At12L*Gt213 + At13L*Gt313) + PDstandardNth1At13 + + PDstandardNth3At11 + 6.*(At13L*PDstandardNth1phi + + At11L*PDstandardNth3phi)) + + gtu32*(-1.*(At22L*Gt213 + At33L*Gt312 + At23L*Gt313) - + 2.*(At12L*Gt223 + At13L*Gt323) + PDstandardNth2At13 + + PDstandardNth3At12 + 6.*(At13L*PDstandardNth2phi + + At12L*PDstandardNth3phi)) - + 25.13274122871834590770114706623602307358*S1; + + M2L = -2.*((At12L*Gt122 + At22L*Gt222 + At23L*Gt322)*gtu22 + + At12L*Gt113*gtu31) - 3.*((At12L*Gt112 + At22L*Gt212)*gtu21 + + At12L*Gt123*gtu32) - 1.*((At11L*Gt112 + At22L*Gt211 + + At12L*(Gt111 + Gt212) + At23L*Gt311 + At13L*Gt312)*gtu11 + + (At13L*Gt112 + At23L*Gt212)*gtu31 + At11L*(Gt122*gtu21 + Gt123*gtu31) + + (At12L*Gt133 + At22L*Gt233 + At33L*Gt323 + At23L*(Gt223 + Gt333))* + gtu33 + At13L*(Gt122*gtu32 + Gt123*gtu33)) + + gtu11*(PDstandardNth1At12 + 6.*At12L*PDstandardNth1phi) + + gtu22*(PDstandardNth2At22 + 6.*At22L*PDstandardNth2phi) + + gtu21*(-3.*At23L*Gt312 - 1.*(At12L*Gt222 + At13L*Gt322) + + PDstandardNth1At22 + PDstandardNth2At12 + + 6.*(At22L*PDstandardNth1phi + At12L*PDstandardNth2phi)) - + 0.6666666666666666666666666666666666666667*PDstandardNth2trK + + gtu33*(PDstandardNth3At23 + 6.*At23L*PDstandardNth3phi) + + gtu31*(-2.*(At22L*Gt213 + At23L*Gt313) - + 1.*(At12L*Gt223 + At33L*Gt312 + At13L*Gt323) + PDstandardNth1At23 + + PDstandardNth3At12 + 6.*(At23L*PDstandardNth1phi + + At12L*PDstandardNth3phi)) + + gtu32*(-1.*(At23L*Gt222 + At33L*Gt322) - 3.*(At22L*Gt223 + At23L*Gt323) + + PDstandardNth2At23 + PDstandardNth3At22 + + 6.*(At23L*PDstandardNth2phi + At22L*PDstandardNth3phi)) - + 25.13274122871834590770114706623602307358*S2; + + M3L = -3.*((At13L*Gt113 + At23L*Gt213)*gtu31 + At13L*Gt123*gtu32) - + 1.*((At11L*Gt113 + At23L*Gt211 + At12L*Gt213 + At33L*Gt311 + + At13L*(Gt111 + Gt313))*gtu11 + + (At13L*Gt122 + At22L*Gt223 + At33L*Gt322 + At23L*(Gt222 + Gt323))* + gtu22 + At11L*Gt133*gtu31 + + At12L*(Gt113*gtu21 + Gt123*gtu22 + Gt133*gtu32)) + + gtu11*(PDstandardNth1At13 + 6.*At13L*PDstandardNth1phi) + + gtu22*(PDstandardNth2At23 + 6.*At23L*PDstandardNth2phi) + + gtu21*(-2.*(At13L*Gt112 + At23L*Gt212 + At33L*Gt312) - + 1.*(At11L*Gt123 + At22L*Gt213 + At12L*Gt223 + At23L*Gt313 + + At13L*Gt323) + PDstandardNth1At23 + PDstandardNth2At13 + + 6.*(At23L*PDstandardNth1phi + At13L*PDstandardNth2phi)) + + gtu31*(-1.*(At12L*Gt233 + At13L*Gt333) + PDstandardNth1At33 + + At33L*(-3.*Gt313 + 6.*PDstandardNth1phi) + PDstandardNth3At13 + + 6.*At13L*PDstandardNth3phi) + + gtu33*(-2.*(At13L*Gt133 + At23L*Gt233 + At33L*Gt333) + PDstandardNth3At33 + + 6.*At33L*PDstandardNth3phi) + + gtu32*(-3.*(At23L*Gt223 + At33L*Gt323) - 1.*(At22L*Gt233 + At23L*Gt333) + + PDstandardNth2At33 + PDstandardNth3At23 + + 6.*(At33L*PDstandardNth2phi + At23L*PDstandardNth3phi)) - + 0.6666666666666666666666666666666666666667*PDstandardNth3trK - + 25.13274122871834590770114706623602307358*S3; cSL = Log(detgt); - cXt1L = Gt111*gtu11 + Gt122*gtu22 + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33 - Xt1L; + cXt1L = Gt111*gtu11 + Gt122*gtu22 + + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33 - Xt1L; - cXt2L = Gt211*gtu11 + Gt222*gtu22 + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33 - Xt2L; + cXt2L = Gt211*gtu11 + Gt222*gtu22 + + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33 - Xt2L; - cXt3L = Gt311*gtu11 + Gt322*gtu22 + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33 - Xt3L; + cXt3L = Gt311*gtu11 + Gt322*gtu22 + + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33 - Xt3L; - cAL = At11L*gtu11 + At22L*gtu22 + 2*(At12L*gtu21 + At13L*gtu31 + At23L*gtu32) + At33L*gtu33; + cAL = At11L*gtu11 + At22L*gtu22 + + 2*(At12L*gtu21 + At13L*gtu31 + At23L*gtu32) + At33L*gtu33; /* Copy local copies back to grid functions */ diff --git a/ML_BSSN/src/ML_BSSN_constraints_boundary.c b/ML_BSSN/src/ML_BSSN_constraints_boundary.c index 2e69e6d..db3fd13 100644 --- a/ML_BSSN/src/ML_BSSN_constraints_boundary.c +++ b/ML_BSSN/src/ML_BSSN_constraints_boundary.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_constraints_boundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_constraints_boundary_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_constraints_boundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_constraints_boundary_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_constraints_boundary, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_BSSN/src/ML_BSSN_convertFromADMBase.c b/ML_BSSN/src/ML_BSSN_convertFromADMBase.c index bbde52f..1e6b70a 100644 --- a/ML_BSSN/src/ML_BSSN_convertFromADMBase.c +++ b/ML_BSSN/src/ML_BSSN_convertFromADMBase.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_convertFromADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_convertFromADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, C CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_convertFromADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, C p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_convertFromADMBase, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) diff --git a/ML_BSSN/src/ML_BSSN_convertFromADMBaseGamma.c b/ML_BSSN/src/ML_BSSN_convertFromADMBaseGamma.c index 01d9168..cfba7bf 100644 --- a/ML_BSSN/src/ML_BSSN_convertFromADMBaseGamma.c +++ b/ML_BSSN/src/ML_BSSN_convertFromADMBaseGamma.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_convertFromADMBaseGamma_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_convertFromADMBaseGamma_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_convertFromADMBaseGamma_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT fa CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_convertFromADMBaseGamma_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT fa p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_convertFromADMBaseGamma, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) @@ -209,13 +224,16 @@ void ML_BSSN_convertFromADMBaseGamma_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT fa gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); - Gt111 = khalf*(gtu11*PDstandardNth1gt11 + 2*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) - + Gt111 = khalf*(gtu11*PDstandardNth1gt11 + + 2*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) - gtu21*PDstandardNth2gt11 - gtu31*PDstandardNth3gt11); - Gt211 = khalf*(gtu21*PDstandardNth1gt11 + 2*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) - + Gt211 = khalf*(gtu21*PDstandardNth1gt11 + + 2*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) - gtu22*PDstandardNth2gt11 - gtu32*PDstandardNth3gt11); - Gt311 = khalf*(gtu31*PDstandardNth1gt11 + 2*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) - + Gt311 = khalf*(gtu31*PDstandardNth1gt11 + + 2*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) - gtu32*PDstandardNth2gt11 - gtu33*PDstandardNth3gt11); Gt112 = khalf*(gtu21*PDstandardNth1gt22 + gtu11*PDstandardNth2gt11 + @@ -236,49 +254,61 @@ void ML_BSSN_convertFromADMBaseGamma_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT fa Gt313 = khalf*(gtu33*PDstandardNth1gt33 + gtu31*PDstandardNth3gt11 + gtu32*(PDstandardNth1gt23 - PDstandardNth2gt13 + PDstandardNth3gt12)); - Gt122 = khalf*(gtu11*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu21*PDstandardNth2gt22 + + Gt122 = khalf*(gtu11*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu21*PDstandardNth2gt22 + gtu31*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt222 = khalf*(gtu21*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu22*PDstandardNth2gt22 + + Gt222 = khalf*(gtu21*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu22*PDstandardNth2gt22 + gtu32*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt322 = khalf*(gtu31*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + gtu32*PDstandardNth2gt22 + + Gt322 = khalf*(gtu31*(-PDstandardNth1gt22 + 2*PDstandardNth2gt12) + + gtu32*PDstandardNth2gt22 + gtu33*(2*PDstandardNth2gt23 - PDstandardNth3gt22)); - Gt123 = khalf*(gtu31*PDstandardNth2gt33 + gtu11*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt123 = khalf*(gtu31*PDstandardNth2gt33 + + gtu11*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu21*PDstandardNth3gt22); - Gt223 = khalf*(gtu32*PDstandardNth2gt33 + gtu21*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt223 = khalf*(gtu32*PDstandardNth2gt33 + + gtu21*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu22*PDstandardNth3gt22); - Gt323 = khalf*(gtu33*PDstandardNth2gt33 + gtu31*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + + Gt323 = khalf*(gtu33*PDstandardNth2gt33 + + gtu31*(-PDstandardNth1gt23 + PDstandardNth2gt13 + PDstandardNth3gt12) + gtu32*PDstandardNth3gt22); - Gt133 = khalf*(-(gtu11*PDstandardNth1gt33) - gtu21*PDstandardNth2gt33 + 2*gtu11*PDstandardNth3gt13 + - 2*gtu21*PDstandardNth3gt23 + gtu31*PDstandardNth3gt33); + Gt133 = khalf*(-(gtu11*PDstandardNth1gt33) - gtu21*PDstandardNth2gt33 + + 2*gtu11*PDstandardNth3gt13 + 2*gtu21*PDstandardNth3gt23 + + gtu31*PDstandardNth3gt33); - Gt233 = khalf*(-(gtu21*PDstandardNth1gt33) - gtu22*PDstandardNth2gt33 + 2*gtu21*PDstandardNth3gt13 + - 2*gtu22*PDstandardNth3gt23 + gtu32*PDstandardNth3gt33); + Gt233 = khalf*(-(gtu21*PDstandardNth1gt33) - gtu22*PDstandardNth2gt33 + + 2*gtu21*PDstandardNth3gt13 + 2*gtu22*PDstandardNth3gt23 + + gtu32*PDstandardNth3gt33); - Gt333 = khalf*(-(gtu31*PDstandardNth1gt33) - gtu32*PDstandardNth2gt33 + 2*gtu31*PDstandardNth3gt13 + - 2*gtu32*PDstandardNth3gt23 + gtu33*PDstandardNth3gt33); + Gt333 = khalf*(-(gtu31*PDstandardNth1gt33) - gtu32*PDstandardNth2gt33 + + 2*gtu31*PDstandardNth3gt13 + 2*gtu32*PDstandardNth3gt23 + + gtu33*PDstandardNth3gt33); - Xt1L = Gt111*gtu11 + Gt122*gtu22 + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33; + Xt1L = Gt111*gtu11 + Gt122*gtu22 + + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33; - Xt2L = Gt211*gtu11 + Gt222*gtu22 + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33; + Xt2L = Gt211*gtu11 + Gt222*gtu22 + + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33; - Xt3L = Gt311*gtu11 + Gt322*gtu22 + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33; + Xt3L = Gt311*gtu11 + Gt322*gtu22 + + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33; AL = -(dtalpL*(-1 + LapseAdvectionCoeff)*INV(harmonicF)*pow(alphaL,-harmonicN)); - B1L = (dtbetaxL - (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + beta3L*PDstandardNth3beta1)* - ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); + B1L = (dtbetaxL - (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + + beta3L*PDstandardNth3beta1)*ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); - B2L = (dtbetayL - (beta1L*PDstandardNth1beta2 + beta2L*PDstandardNth2beta2 + beta3L*PDstandardNth3beta2)* - ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); + B2L = (dtbetayL - (beta1L*PDstandardNth1beta2 + beta2L*PDstandardNth2beta2 + + beta3L*PDstandardNth3beta2)*ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); - B3L = (dtbetazL - (beta1L*PDstandardNth1beta3 + beta2L*PDstandardNth2beta3 + beta3L*PDstandardNth3beta3)* - ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); + B3L = (dtbetazL - (beta1L*PDstandardNth1beta3 + beta2L*PDstandardNth2beta3 + + beta3L*PDstandardNth3beta3)*ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); /* Copy local copies back to grid functions */ diff --git a/ML_BSSN/src/ML_BSSN_convertToADMBase.c b/ML_BSSN/src/ML_BSSN_convertToADMBase.c index 7f854ae..f1f98e3 100644 --- a/ML_BSSN/src/ML_BSSN_convertToADMBase.c +++ b/ML_BSSN/src/ML_BSSN_convertToADMBase.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_convertToADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_convertToADMBase_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_convertToADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCT CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_convertToADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCT p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_convertToADMBase, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) @@ -235,17 +250,19 @@ void ML_BSSN_convertToADMBase_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCT betazL = beta3L; - dtalpL = LapseAdvectionCoeff*(beta1L*PDstandardNth1alpha + beta2L*PDstandardNth2alpha + beta3L*PDstandardNth3alpha) + - harmonicF*(AL*(-1 + LapseAdvectionCoeff) - LapseAdvectionCoeff*trKL)*pow(alphaL,harmonicN); + dtalpL = LapseAdvectionCoeff*(beta1L*PDstandardNth1alpha + + beta2L*PDstandardNth2alpha + beta3L*PDstandardNth3alpha) + + harmonicF*(AL*(-1 + LapseAdvectionCoeff) - LapseAdvectionCoeff*trKL)* + pow(alphaL,harmonicN); - dtbetaxL = (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + beta3L*PDstandardNth3beta1)* - ShiftAdvectionCoeff + B1L*ShiftGammaCoeff; + dtbetaxL = (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + + beta3L*PDstandardNth3beta1)*ShiftAdvectionCoeff + B1L*ShiftGammaCoeff; - dtbetayL = (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + beta3L*PDstandardNth3beta1)* - ShiftAdvectionCoeff + B2L*ShiftGammaCoeff; + dtbetayL = (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + + beta3L*PDstandardNth3beta1)*ShiftAdvectionCoeff + B2L*ShiftGammaCoeff; - dtbetazL = (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + beta3L*PDstandardNth3beta1)* - ShiftAdvectionCoeff + B3L*ShiftGammaCoeff; + dtbetazL = (beta1L*PDstandardNth1beta1 + beta2L*PDstandardNth2beta1 + + beta3L*PDstandardNth3beta1)*ShiftAdvectionCoeff + B3L*ShiftGammaCoeff; /* Copy local copies back to grid functions */ diff --git a/ML_BSSN/src/ML_BSSN_enforce.c b/ML_BSSN/src/ML_BSSN_enforce.c index 792adb4..980514f 100644 --- a/ML_BSSN/src/ML_BSSN_enforce.c +++ b/ML_BSSN/src/ML_BSSN_enforce.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -20,7 +23,7 @@ #define CUB(x) ((x) * (x) * (x)) #define QAD(x) ((x) * (x) * (x) * (x)) -void ML_BSSN_enforce_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +void ML_BSSN_enforce_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS @@ -40,9 +43,15 @@ void ML_BSSN_enforce_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL no CCTK_REAL p1o144dxdy = INITVALUE; CCTK_REAL p1o144dxdz = INITVALUE; CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; CCTK_REAL pm1o12dx2 = INITVALUE; CCTK_REAL pm1o12dy2 = INITVALUE; CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; if (verbose > 1) { @@ -79,12 +88,18 @@ void ML_BSSN_enforce_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL no p1o144dxdy = (INV(dx)*INV(dy))/144.; p1o144dxdz = (INV(dx)*INV(dz))/144.; p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); pm1o12dx2 = -pow(dx,-2)/12.; pm1o12dy2 = -pow(dy,-2)/12.; pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); /* Loop over the grid points */ - _Pragma ("omp parallel") + #pragma omp parallel LC_LOOP3 (ML_BSSN_enforce, i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) @@ -143,7 +158,8 @@ void ML_BSSN_enforce_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL no gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); - trAt = At11L*gtu11 + At22L*gtu22 + 2*(At12L*gtu21 + At13L*gtu31 + At23L*gtu32) + At33L*gtu33; + trAt = At11L*gtu11 + At22L*gtu22 + + 2*(At12L*gtu21 + At13L*gtu31 + At23L*gtu32) + At33L*gtu33; At11L = At11L - gt11L*kthird*trAt; diff --git a/ML_BSSN/src/make.code.defn b/ML_BSSN/src/make.code.defn index 0b7999d..97668a7 100644 --- a/ML_BSSN/src/make.code.defn +++ b/ML_BSSN/src/make.code.defn @@ -3,4 +3,4 @@ # Mathematica script written by Ian Hinder and Sascha Husa -SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_Minkowski.c ML_BSSN_convertFromADMBase.c ML_BSSN_convertFromADMBaseGamma.c ML_BSSN_RHS.c ML_BSSN_enforce.c ML_BSSN_boundary.c ML_BSSN_convertToADMBase.c ML_BSSN_ADMBaseBoundary.c ML_BSSN_constraints.c ML_BSSN_constraints_boundary.c Boundaries.c +SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_Minkowski.c ML_BSSN_convertFromADMBase.c ML_BSSN_convertFromADMBaseGamma.c ML_BSSN_RHS.c ML_BSSN_RHSBoundary.c ML_BSSN_enforce.c ML_BSSN_boundary.c ML_BSSN_convertToADMBase.c ML_BSSN_ADMBaseBoundary.c ML_BSSN_constraints.c ML_BSSN_constraints_boundary.c Boundaries.c diff --git a/ML_BSSN_Helper/schedule.ccl b/ML_BSSN_Helper/schedule.ccl index 0d6a02f..e6ec875 100644 --- a/ML_BSSN_Helper/schedule.ccl +++ b/ML_BSSN_Helper/schedule.ccl @@ -58,8 +58,8 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN")) { SCHEDULE GROUP ML_BSSN_constraintsCalcGroup AT analysis { - TRIGGERS: ML_BSSN::Ham - TRIGGERS: ML_BSSN::mom + TRIGGERS: ML_BSSN::ML_Ham + TRIGGERS: ML_BSSN::ML_mom } "Calculate BSSN constraints" diff --git a/ML_BSSN_MP/configuration.ccl b/ML_BSSN_MP/configuration.ccl new file mode 100644 index 0000000..0374af4 --- /dev/null +++ b/ML_BSSN_MP/configuration.ccl @@ -0,0 +1,6 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + +REQUIRES LoopControl diff --git a/ML_BSSN_MP/interface.ccl b/ML_BSSN_MP/interface.ccl new file mode 100644 index 0000000..48c56d1 --- /dev/null +++ b/ML_BSSN_MP/interface.ccl @@ -0,0 +1,205 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + +implements: ML_BSSN_MP + +inherits: ADMBase TmunuBase Coordinates Grid GenericFD Boundary + + + +USES INCLUDE: GenericFD.h +USES INCLUDE: Symmetry.h +USES INCLUDE: sbp_calc_coeffs.h +USES INCLUDE: Boundary.h +USES INCLUDE: loopcontrol.h + +CCTK_INT FUNCTION MoLRegisterEvolved(CCTK_INT IN EvolvedIndex, CCTK_INT IN RHSIndex) +USES FUNCTION MoLRegisterEvolved + +CCTK_INT FUNCTION MoLRegisterConstrained(CCTK_INT IN ConstrainedIndex) +USES FUNCTION MoLRegisterConstrained + +SUBROUTINE Diff_coeff(CCTK_POINTER_TO_CONST IN cctkGH, CCTK_INT IN dir, CCTK_INT IN nsize, CCTK_INT OUT ARRAY imin, CCTK_INT OUT ARRAY imax, CCTK_REAL OUT ARRAY q, CCTK_INT IN table_handle) +USES FUNCTION Diff_coeff + +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) +USES FUNCTION Boundary_SelectGroupForBC + +CCTK_INT FUNCTION Boundary_SelectVarForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN var_name, CCTK_STRING IN bc_name) +USES FUNCTION Boundary_SelectVarForBC + +public: +CCTK_REAL ML_cons_detg type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=2.0000000000000000000' +{ + cS +} "ML_cons_detg" + +public: +CCTK_REAL ML_cons_Gamma type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0.66666666666666666667' +{ + cXt1, + cXt2, + cXt3 +} "ML_cons_Gamma" + +public: +CCTK_REAL ML_cons_traceA type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + cA +} "ML_cons_traceA" + +public: +CCTK_REAL ML_Ham type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + H +} "ML_Ham" + +public: +CCTK_REAL ML_mom type=GF timelevels=1 tags='tensortypealias="D" tensorweight=1.0000000000000000000' +{ + M1, + M2, + M3 +} "ML_mom" + +public: +CCTK_REAL ML_curvrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tensorweight=-0.66666666666666666667' +{ + At11rhs, + At12rhs, + At13rhs, + At22rhs, + At23rhs, + At33rhs +} "ML_curvrhs" + +public: +CCTK_REAL ML_dtlapserhs type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + Arhs +} "ML_dtlapserhs" + +public: +CCTK_REAL ML_dtshiftrhs type=GF timelevels=1 tags='tensortypealias="U" tensorweight=1.0000000000000000000' +{ + B1rhs, + B2rhs, + B3rhs +} "ML_dtshiftrhs" + +public: +CCTK_REAL ML_Gammarhs type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0.66666666666666666667' +{ + Xt1rhs, + Xt2rhs, + Xt3rhs +} "ML_Gammarhs" + +public: +CCTK_REAL ML_lapserhs type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + alpharhs +} "ML_lapserhs" + +public: +CCTK_REAL ML_log_confacrhs type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=0.16666666666666666667' +{ + phirhs +} "ML_log_confacrhs" + +public: +CCTK_REAL ML_metricrhs type=GF timelevels=1 tags='tensortypealias="DD_sym" tensorweight=-0.66666666666666666667' +{ + gt11rhs, + gt12rhs, + gt13rhs, + gt22rhs, + gt23rhs, + gt33rhs +} "ML_metricrhs" + +public: +CCTK_REAL ML_shiftrhs type=GF timelevels=1 tags='tensortypealias="U" tensorweight=1.0000000000000000000' +{ + beta1rhs, + beta2rhs, + beta3rhs +} "ML_shiftrhs" + +public: +CCTK_REAL ML_trace_curvrhs type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + trKrhs +} "ML_trace_curvrhs" + +public: +CCTK_REAL ML_curv type=GF timelevels=3 tags='tensortypealias="DD_sym" tensorweight=-0.66666666666666666667' +{ + At11, + At12, + At13, + At22, + At23, + At33 +} "ML_curv" + +public: +CCTK_REAL ML_dtlapse type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + A +} "ML_dtlapse" + +public: +CCTK_REAL ML_dtshift type=GF timelevels=3 tags='tensortypealias="U" tensorweight=1.0000000000000000000' +{ + B1, + B2, + B3 +} "ML_dtshift" + +public: +CCTK_REAL ML_Gamma type=GF timelevels=3 tags='tensortypealias="U" tensorweight=0.66666666666666666667' +{ + Xt1, + Xt2, + Xt3 +} "ML_Gamma" + +public: +CCTK_REAL ML_lapse type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + alpha +} "ML_lapse" + +public: +CCTK_REAL ML_log_confac type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0.16666666666666666667' +{ + phi +} "ML_log_confac" + +public: +CCTK_REAL ML_metric type=GF timelevels=3 tags='tensortypealias="DD_sym" tensorweight=-0.66666666666666666667' +{ + gt11, + gt12, + gt13, + gt22, + gt23, + gt33 +} "ML_metric" + +public: +CCTK_REAL ML_shift type=GF timelevels=3 tags='tensortypealias="U" tensorweight=1.0000000000000000000' +{ + beta1, + beta2, + beta3 +} "ML_shift" + +public: +CCTK_REAL ML_trace_curv type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + trK +} "ML_trace_curv" diff --git a/ML_BSSN_MP/param.ccl b/ML_BSSN_MP/param.ccl new file mode 100644 index 0000000..8bc281d --- /dev/null +++ b/ML_BSSN_MP/param.ccl @@ -0,0 +1,1287 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + + +shares: ADMBase + + +EXTENDS CCTK_KEYWORD evolution_method "evolution_method" +{ + ML_BSSN_MP :: "" +} + + +EXTENDS CCTK_KEYWORD lapse_evolution_method "lapse_evolution_method" +{ + ML_BSSN_MP :: "" +} + + +EXTENDS CCTK_KEYWORD shift_evolution_method "shift_evolution_method" +{ + ML_BSSN_MP :: "" +} + + + +shares: GenericFD + +USES CCTK_INT stencil_width +USES CCTK_INT stencil_width_x +USES CCTK_INT stencil_width_y +USES CCTK_INT stencil_width_z +USES CCTK_INT boundary_width + + +shares: MethodOfLines + +USES CCTK_INT MoL_Num_Evolved_Vars +USES CCTK_INT MoL_Num_Constrained_Vars + +restricted: +CCTK_INT verbose "verbose" +{ + *:* :: "" +} 0 + +restricted: +CCTK_REAL harmonicF "d/dt alpha = - f alpha^n K (harmonic=1, 1+log=2)" +{ + "*:*" :: "" +} 1 + +restricted: +CCTK_REAL AlphaDriver "AlphaDriver" +{ + "*:*" :: "" +} 0 + +restricted: +CCTK_REAL ShiftGammaCoeff "ShiftGammaCoeff" +{ + "*:*" :: "" +} 0 + +restricted: +CCTK_REAL BetaDriver "BetaDriver" +{ + "*:*" :: "" +} 0 + +restricted: +CCTK_REAL LapseAdvectionCoeff "Factor in front of the shift advection terms in 1+log" +{ + "*:*" :: "" +} 1 + +restricted: +CCTK_REAL ShiftAdvectionCoeff "Factor in front of the shift advection terms in gamma driver" +{ + "*:*" :: "" +} 1 + +restricted: +CCTK_INT harmonicN "d/dt alpha = - f alpha^n K (harmonic=2, 1+log=1)" +{ + *:* :: "" +} 2 + +restricted: +CCTK_INT ShiftAlphaPower "ShiftAlphaPower" +{ + *:* :: "" +} 0 + +private: +KEYWORD my_initial_data "my_initial_data" +{ + "ADMBase" :: "ADMBase" + "Minkowski" :: "Minkowski" +} "ADMBase" + +private: +KEYWORD my_rhs_boundary_condition "my_rhs_boundary_condition" +{ + "none" :: "none" + "radiative" :: "radiative" +} "none" + +private: +KEYWORD my_boundary_condition "my_boundary_condition" +{ + "none" :: "none" + "Minkowski" :: "Minkowski" +} "none" + +restricted: +CCTK_INT ML_BSSN_MP_MaxNumEvolvedVars "Number of evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Evolved_Vars +{ + 25:25 :: "Number of evolved variables used by this thorn" +} 25 + +restricted: +CCTK_INT ML_BSSN_MP_MaxNumConstrainedVars "Number of constrained variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Constrained_Vars +{ + 70:70 :: "Number of constrained variables used by this thorn" +} 70 + +restricted: +CCTK_INT timelevels "Number of active timelevels" +{ + 0:3 :: "" +} 3 + +restricted: +CCTK_INT ML_BSSN_MP_Minkowski_calc_every "ML_BSSN_MP_Minkowski_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_convertFromADMBase_calc_every "ML_BSSN_MP_convertFromADMBase_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_convertFromADMBaseGamma_calc_every "ML_BSSN_MP_convertFromADMBaseGamma_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_RHS_calc_every "ML_BSSN_MP_RHS_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_RHSBoundary_calc_every "ML_BSSN_MP_RHSBoundary_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_enforce_calc_every "ML_BSSN_MP_enforce_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_boundary_calc_every "ML_BSSN_MP_boundary_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_convertToADMBase_calc_every "ML_BSSN_MP_convertToADMBase_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_ADMBaseBoundary_calc_every "ML_BSSN_MP_ADMBaseBoundary_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_constraints_calc_every "ML_BSSN_MP_constraints_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_constraints_boundary_calc_every "ML_BSSN_MP_constraints_boundary_calc_every" +{ + *:* :: "" +} 1 + +restricted: +CCTK_INT ML_BSSN_MP_Minkowski_calc_offset "ML_BSSN_MP_Minkowski_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_convertFromADMBase_calc_offset "ML_BSSN_MP_convertFromADMBase_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_convertFromADMBaseGamma_calc_offset "ML_BSSN_MP_convertFromADMBaseGamma_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_RHS_calc_offset "ML_BSSN_MP_RHS_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_RHSBoundary_calc_offset "ML_BSSN_MP_RHSBoundary_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_enforce_calc_offset "ML_BSSN_MP_enforce_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_boundary_calc_offset "ML_BSSN_MP_boundary_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_convertToADMBase_calc_offset "ML_BSSN_MP_convertToADMBase_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_ADMBaseBoundary_calc_offset "ML_BSSN_MP_ADMBaseBoundary_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_constraints_calc_offset "ML_BSSN_MP_constraints_calc_offset" +{ + *:* :: "" +} 0 + +restricted: +CCTK_INT ML_BSSN_MP_constraints_boundary_calc_offset "ML_BSSN_MP_constraints_boundary_calc_offset" +{ + *:* :: "" +} 0 + +private: +KEYWORD At11_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD At12_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD At13_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD At22_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD At23_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD At33_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD A_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD B1_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD B2_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD B3_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD Xt1_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD Xt2_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD Xt3_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD alpha_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD phi_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD gt11_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD gt12_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD gt13_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD gt22_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD gt23_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD gt33_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD beta1_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD beta2_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD beta3_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD trK_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_curv_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_dtlapse_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_dtshift_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_Gamma_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_lapse_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_log_confac_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_metric_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_shift_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD ML_trace_curv_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +CCTK_REAL At11_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL At12_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL At13_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL At22_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL At23_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL At33_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL A_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL B1_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL B2_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL B3_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL Xt1_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL Xt2_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL Xt3_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL alpha_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL phi_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL gt11_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL gt12_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL gt13_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL gt22_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL gt23_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL gt33_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL beta1_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL beta2_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL beta3_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL trK_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_curv_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_dtlapse_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_dtshift_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_Gamma_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_lapse_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_log_confac_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_metric_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_shift_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL ML_trace_curv_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL At11_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL At12_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL At13_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL At22_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL At23_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL At33_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL A_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL B1_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL B2_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL B3_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL Xt1_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL Xt2_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL Xt3_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL alpha_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL phi_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL gt11_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL gt12_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL gt13_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL gt22_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL gt23_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL gt33_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL beta1_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL beta2_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL beta3_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL trK_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_curv_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_dtlapse_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_dtshift_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_Gamma_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_lapse_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_log_confac_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_metric_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_shift_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL ML_trace_curv_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL At11_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL At12_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL At13_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL At22_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL At23_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL At33_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL A_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL B1_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL B2_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL B3_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL Xt1_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL Xt2_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL Xt3_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL alpha_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL phi_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL gt11_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL gt12_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL gt13_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL gt22_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL gt23_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL gt33_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL beta1_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL beta2_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL beta3_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL trK_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_curv_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_dtlapse_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_dtshift_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_Gamma_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_lapse_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_log_confac_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_metric_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_shift_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL ML_trace_curv_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + diff --git a/ML_BSSN_MP/schedule.ccl b/ML_BSSN_MP/schedule.ccl new file mode 100644 index 0000000..92b2b97 --- /dev/null +++ b/ML_BSSN_MP/schedule.ccl @@ -0,0 +1,304 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + + +STORAGE: ML_cons_detg[1] + +STORAGE: ML_cons_Gamma[1] + +STORAGE: ML_cons_traceA[1] + +STORAGE: ML_Ham[1] + +STORAGE: ML_mom[1] + +STORAGE: ML_curvrhs[1] + +STORAGE: ML_dtlapserhs[1] + +STORAGE: ML_dtshiftrhs[1] + +STORAGE: ML_Gammarhs[1] + +STORAGE: ML_lapserhs[1] + +STORAGE: ML_log_confacrhs[1] + +STORAGE: ML_metricrhs[1] + +STORAGE: ML_shiftrhs[1] + +STORAGE: ML_trace_curvrhs[1] + +if (timelevels == 1) +{ + STORAGE: ML_curv[1] +} +if (timelevels == 2) +{ + STORAGE: ML_curv[2] +} +if (timelevels == 3) +{ + STORAGE: ML_curv[3] +} + +if (timelevels == 1) +{ + STORAGE: ML_dtlapse[1] +} +if (timelevels == 2) +{ + STORAGE: ML_dtlapse[2] +} +if (timelevels == 3) +{ + STORAGE: ML_dtlapse[3] +} + +if (timelevels == 1) +{ + STORAGE: ML_dtshift[1] +} +if (timelevels == 2) +{ + STORAGE: ML_dtshift[2] +} +if (timelevels == 3) +{ + STORAGE: ML_dtshift[3] +} + +if (timelevels == 1) +{ + STORAGE: ML_Gamma[1] +} +if (timelevels == 2) +{ + STORAGE: ML_Gamma[2] +} +if (timelevels == 3) +{ + STORAGE: ML_Gamma[3] +} + +if (timelevels == 1) +{ + STORAGE: ML_lapse[1] +} +if (timelevels == 2) +{ + STORAGE: ML_lapse[2] +} +if (timelevels == 3) +{ + STORAGE: ML_lapse[3] +} + +if (timelevels == 1) +{ + STORAGE: ML_log_confac[1] +} +if (timelevels == 2) +{ + STORAGE: ML_log_confac[2] +} +if (timelevels == 3) +{ + STORAGE: ML_log_confac[3] +} + +if (timelevels == 1) +{ + STORAGE: ML_metric[1] +} +if (timelevels == 2) +{ + STORAGE: ML_metric[2] +} +if (timelevels == 3) +{ + STORAGE: ML_metric[3] +} + +if (timelevels == 1) +{ + STORAGE: ML_shift[1] +} +if (timelevels == 2) +{ + STORAGE: ML_shift[2] +} +if (timelevels == 3) +{ + STORAGE: ML_shift[3] +} + +if (timelevels == 1) +{ + STORAGE: ML_trace_curv[1] +} +if (timelevels == 2) +{ + STORAGE: ML_trace_curv[2] +} +if (timelevels == 3) +{ + STORAGE: ML_trace_curv[3] +} + +schedule ML_BSSN_MP_Startup at STARTUP +{ + LANG: C + OPTIONS: meta +} "create banner" + +schedule ML_BSSN_MP_RegisterVars in MoL_Register +{ + LANG: C + OPTIONS: meta +} "Register Variables for MoL" + +schedule ML_BSSN_MP_RegisterSymmetries at BASEGRID +{ + LANG: C + OPTIONS: meta +} "register symmetries" + + +if (CCTK_EQUALS(my_initial_data, "Minkowski")) +{ + schedule ML_BSSN_MP_Minkowski IN ADMBase_InitialData + { + LANG: C + } "ML_BSSN_MP_Minkowski" +} + + +if (CCTK_EQUALS(my_initial_data, "ADMBase")) +{ + schedule ML_BSSN_MP_convertFromADMBase AT initial AFTER ADMBase_PostInitial + { + LANG: C + } "ML_BSSN_MP_convertFromADMBase" +} + + +if (CCTK_EQUALS(my_initial_data, "ADMBase")) +{ + schedule ML_BSSN_MP_convertFromADMBaseGamma AT initial AFTER ML_BSSN_MP_convertFromADMBase + { + LANG: C + SYNC: ML_dtlapse + SYNC: ML_dtshift + SYNC: ML_Gamma + } "ML_BSSN_MP_convertFromADMBaseGamma" +} + +schedule ML_BSSN_MP_RHS IN ML_BSSN_MP_evolCalcGroup +{ + 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 +} "ML_BSSN_MP_RHS" + + +if (CCTK_EQUALS(my_rhs_boundary_condition, "radiative")) +{ + schedule ML_BSSN_MP_RHSBoundary IN MoL_RHSBoundaries + { + LANG: C + } "ML_BSSN_MP_RHSBoundary" +} + + +if (CCTK_EQUALS(evolution_method, "ML_BSSN_MP")) +{ + schedule ML_BSSN_MP_enforce IN MoL_PostStep BEFORE ML_BSSN_MP_BoundConds + { + LANG: C + } "ML_BSSN_MP_enforce" +} + + +if (CCTK_EQUALS(my_boundary_condition, "Minkowski")) +{ + schedule ML_BSSN_MP_boundary IN MoL_PostStep + { + LANG: C + } "ML_BSSN_MP_boundary" +} + + +if (CCTK_EQUALS(evolution_method, "ML_BSSN_MP")) +{ + schedule ML_BSSN_MP_convertToADMBase IN MoL_PostStep AFTER (ML_BSSN_MP_ApplyBCs ML_BSSN_MP_enforce) + { + LANG: C + SYNC: ADMBase::curv + SYNC: ADMBase::dtlapse + SYNC: ADMBase::dtshift + SYNC: ADMBase::lapse + SYNC: ADMBase::metric + SYNC: ADMBase::shift + } "ML_BSSN_MP_convertToADMBase" +} + + +if (CCTK_EQUALS(my_boundary_condition, "Minkowski")) +{ + schedule ML_BSSN_MP_ADMBaseBoundary IN MoL_PostStep AFTER ML_BSSN_MP_convertToADMBase + { + LANG: C + } "ML_BSSN_MP_ADMBaseBoundary" +} + +schedule ML_BSSN_MP_constraints IN ML_BSSN_MP_constraintsCalcGroup +{ + LANG: C + SYNC: ML_cons_detg + SYNC: ML_cons_Gamma + SYNC: ML_cons_traceA + SYNC: ML_Ham + SYNC: ML_mom +} "ML_BSSN_MP_constraints" + +schedule ML_BSSN_MP_constraints_boundary IN ML_BSSN_MP_constraintsCalcGroup AFTER ML_BSSN_MP_constraints +{ + LANG: C +} "ML_BSSN_MP_constraints_boundary" + +schedule ML_BSSN_MP_ApplyBoundConds in MoL_PostStep +{ + LANG: C + OPTIONS: level + SYNC: ML_curv + SYNC: ML_dtlapse + SYNC: ML_dtshift + SYNC: ML_Gamma + SYNC: ML_lapse + SYNC: ML_log_confac + SYNC: ML_metric + SYNC: ML_shift + SYNC: ML_trace_curv +} "apply boundary conditions" + +schedule ML_BSSN_MP_CheckBoundaries at BASEGRID +{ + LANG: C + OPTIONS: meta +} "check boundaries treatment" + +schedule group ApplyBCs as ML_BSSN_MP_ApplyBCs in MoL_PostStep after ML_BSSN_MP_ApplyBoundConds +{ + # no language specified +} "Apply boundary conditions controlled by thorn Boundary" diff --git a/ML_BSSN_MP/src/Boundaries.c b/ML_BSSN_MP/src/Boundaries.c new file mode 100644 index 0000000..8e99d60 --- /dev/null +++ b/ML_BSSN_MP/src/Boundaries.c @@ -0,0 +1,1812 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "cctk_Faces.h" +#include "util_Table.h" +#include "Symmetry.h" + + +/* the boundary treatment is split into 3 steps: */ +/* 1. excision */ +/* 2. symmetries */ +/* 3. "other" boundary conditions, e.g. radiative */ + +/* to simplify scheduling and testing, the 3 steps */ +/* are currently applied in separate functions */ + + +void ML_BSSN_MP_CheckBoundaries(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + return; +} + +void ML_BSSN_MP_ApplyBoundConds(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + CCTK_INT ierr = 0; + + if (CCTK_EQUALS(ML_curv_bound, "none" ) || + CCTK_EQUALS(ML_curv_bound, "static") || + CCTK_EQUALS(ML_curv_bound, "flat" ) || + CCTK_EQUALS(ML_curv_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_curv", ML_curv_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_curv_bound BC for ML_BSSN_MP::ML_curv!"); + } + + if (CCTK_EQUALS(ML_dtlapse_bound, "none" ) || + CCTK_EQUALS(ML_dtlapse_bound, "static") || + CCTK_EQUALS(ML_dtlapse_bound, "flat" ) || + CCTK_EQUALS(ML_dtlapse_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_dtlapse", ML_dtlapse_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_dtlapse_bound BC for ML_BSSN_MP::ML_dtlapse!"); + } + + if (CCTK_EQUALS(ML_dtshift_bound, "none" ) || + CCTK_EQUALS(ML_dtshift_bound, "static") || + CCTK_EQUALS(ML_dtshift_bound, "flat" ) || + CCTK_EQUALS(ML_dtshift_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_dtshift", ML_dtshift_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_dtshift_bound BC for ML_BSSN_MP::ML_dtshift!"); + } + + if (CCTK_EQUALS(ML_Gamma_bound, "none" ) || + CCTK_EQUALS(ML_Gamma_bound, "static") || + CCTK_EQUALS(ML_Gamma_bound, "flat" ) || + CCTK_EQUALS(ML_Gamma_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_Gamma", ML_Gamma_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_Gamma_bound BC for ML_BSSN_MP::ML_Gamma!"); + } + + if (CCTK_EQUALS(ML_lapse_bound, "none" ) || + CCTK_EQUALS(ML_lapse_bound, "static") || + CCTK_EQUALS(ML_lapse_bound, "flat" ) || + CCTK_EQUALS(ML_lapse_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_lapse", ML_lapse_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_lapse_bound BC for ML_BSSN_MP::ML_lapse!"); + } + + if (CCTK_EQUALS(ML_log_confac_bound, "none" ) || + CCTK_EQUALS(ML_log_confac_bound, "static") || + CCTK_EQUALS(ML_log_confac_bound, "flat" ) || + CCTK_EQUALS(ML_log_confac_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_log_confac", ML_log_confac_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_log_confac_bound BC for ML_BSSN_MP::ML_log_confac!"); + } + + if (CCTK_EQUALS(ML_metric_bound, "none" ) || + CCTK_EQUALS(ML_metric_bound, "static") || + CCTK_EQUALS(ML_metric_bound, "flat" ) || + CCTK_EQUALS(ML_metric_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_metric", ML_metric_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_metric_bound BC for ML_BSSN_MP::ML_metric!"); + } + + if (CCTK_EQUALS(ML_shift_bound, "none" ) || + CCTK_EQUALS(ML_shift_bound, "static") || + CCTK_EQUALS(ML_shift_bound, "flat" ) || + CCTK_EQUALS(ML_shift_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_shift", ML_shift_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_shift_bound BC for ML_BSSN_MP::ML_shift!"); + } + + if (CCTK_EQUALS(ML_trace_curv_bound, "none" ) || + CCTK_EQUALS(ML_trace_curv_bound, "static") || + CCTK_EQUALS(ML_trace_curv_bound, "flat" ) || + CCTK_EQUALS(ML_trace_curv_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::ML_trace_curv", ML_trace_curv_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register ML_trace_curv_bound BC for ML_BSSN_MP::ML_trace_curv!"); + } + + if (CCTK_EQUALS(At11_bound, "none" ) || + CCTK_EQUALS(At11_bound, "static") || + CCTK_EQUALS(At11_bound, "flat" ) || + CCTK_EQUALS(At11_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::At11", At11_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register At11_bound BC for ML_BSSN_MP::At11!"); + } + + if (CCTK_EQUALS(At12_bound, "none" ) || + CCTK_EQUALS(At12_bound, "static") || + CCTK_EQUALS(At12_bound, "flat" ) || + CCTK_EQUALS(At12_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::At12", At12_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register At12_bound BC for ML_BSSN_MP::At12!"); + } + + if (CCTK_EQUALS(At13_bound, "none" ) || + CCTK_EQUALS(At13_bound, "static") || + CCTK_EQUALS(At13_bound, "flat" ) || + CCTK_EQUALS(At13_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::At13", At13_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register At13_bound BC for ML_BSSN_MP::At13!"); + } + + if (CCTK_EQUALS(At22_bound, "none" ) || + CCTK_EQUALS(At22_bound, "static") || + CCTK_EQUALS(At22_bound, "flat" ) || + CCTK_EQUALS(At22_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::At22", At22_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register At22_bound BC for ML_BSSN_MP::At22!"); + } + + if (CCTK_EQUALS(At23_bound, "none" ) || + CCTK_EQUALS(At23_bound, "static") || + CCTK_EQUALS(At23_bound, "flat" ) || + CCTK_EQUALS(At23_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::At23", At23_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register At23_bound BC for ML_BSSN_MP::At23!"); + } + + if (CCTK_EQUALS(At33_bound, "none" ) || + CCTK_EQUALS(At33_bound, "static") || + CCTK_EQUALS(At33_bound, "flat" ) || + CCTK_EQUALS(At33_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::At33", At33_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register At33_bound BC for ML_BSSN_MP::At33!"); + } + + if (CCTK_EQUALS(A_bound, "none" ) || + CCTK_EQUALS(A_bound, "static") || + CCTK_EQUALS(A_bound, "flat" ) || + CCTK_EQUALS(A_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::A", A_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register A_bound BC for ML_BSSN_MP::A!"); + } + + if (CCTK_EQUALS(B1_bound, "none" ) || + CCTK_EQUALS(B1_bound, "static") || + CCTK_EQUALS(B1_bound, "flat" ) || + CCTK_EQUALS(B1_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::B1", B1_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register B1_bound BC for ML_BSSN_MP::B1!"); + } + + if (CCTK_EQUALS(B2_bound, "none" ) || + CCTK_EQUALS(B2_bound, "static") || + CCTK_EQUALS(B2_bound, "flat" ) || + CCTK_EQUALS(B2_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::B2", B2_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register B2_bound BC for ML_BSSN_MP::B2!"); + } + + if (CCTK_EQUALS(B3_bound, "none" ) || + CCTK_EQUALS(B3_bound, "static") || + CCTK_EQUALS(B3_bound, "flat" ) || + CCTK_EQUALS(B3_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::B3", B3_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register B3_bound BC for ML_BSSN_MP::B3!"); + } + + if (CCTK_EQUALS(Xt1_bound, "none" ) || + CCTK_EQUALS(Xt1_bound, "static") || + CCTK_EQUALS(Xt1_bound, "flat" ) || + CCTK_EQUALS(Xt1_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::Xt1", Xt1_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register Xt1_bound BC for ML_BSSN_MP::Xt1!"); + } + + if (CCTK_EQUALS(Xt2_bound, "none" ) || + CCTK_EQUALS(Xt2_bound, "static") || + CCTK_EQUALS(Xt2_bound, "flat" ) || + CCTK_EQUALS(Xt2_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::Xt2", Xt2_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register Xt2_bound BC for ML_BSSN_MP::Xt2!"); + } + + if (CCTK_EQUALS(Xt3_bound, "none" ) || + CCTK_EQUALS(Xt3_bound, "static") || + CCTK_EQUALS(Xt3_bound, "flat" ) || + CCTK_EQUALS(Xt3_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::Xt3", Xt3_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register Xt3_bound BC for ML_BSSN_MP::Xt3!"); + } + + if (CCTK_EQUALS(alpha_bound, "none" ) || + CCTK_EQUALS(alpha_bound, "static") || + CCTK_EQUALS(alpha_bound, "flat" ) || + CCTK_EQUALS(alpha_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::alpha", alpha_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register alpha_bound BC for ML_BSSN_MP::alpha!"); + } + + if (CCTK_EQUALS(phi_bound, "none" ) || + CCTK_EQUALS(phi_bound, "static") || + CCTK_EQUALS(phi_bound, "flat" ) || + CCTK_EQUALS(phi_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::phi", phi_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register phi_bound BC for ML_BSSN_MP::phi!"); + } + + if (CCTK_EQUALS(gt11_bound, "none" ) || + CCTK_EQUALS(gt11_bound, "static") || + CCTK_EQUALS(gt11_bound, "flat" ) || + CCTK_EQUALS(gt11_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::gt11", gt11_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register gt11_bound BC for ML_BSSN_MP::gt11!"); + } + + if (CCTK_EQUALS(gt12_bound, "none" ) || + CCTK_EQUALS(gt12_bound, "static") || + CCTK_EQUALS(gt12_bound, "flat" ) || + CCTK_EQUALS(gt12_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::gt12", gt12_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register gt12_bound BC for ML_BSSN_MP::gt12!"); + } + + if (CCTK_EQUALS(gt13_bound, "none" ) || + CCTK_EQUALS(gt13_bound, "static") || + CCTK_EQUALS(gt13_bound, "flat" ) || + CCTK_EQUALS(gt13_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::gt13", gt13_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register gt13_bound BC for ML_BSSN_MP::gt13!"); + } + + if (CCTK_EQUALS(gt22_bound, "none" ) || + CCTK_EQUALS(gt22_bound, "static") || + CCTK_EQUALS(gt22_bound, "flat" ) || + CCTK_EQUALS(gt22_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::gt22", gt22_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register gt22_bound BC for ML_BSSN_MP::gt22!"); + } + + if (CCTK_EQUALS(gt23_bound, "none" ) || + CCTK_EQUALS(gt23_bound, "static") || + CCTK_EQUALS(gt23_bound, "flat" ) || + CCTK_EQUALS(gt23_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::gt23", gt23_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register gt23_bound BC for ML_BSSN_MP::gt23!"); + } + + if (CCTK_EQUALS(gt33_bound, "none" ) || + CCTK_EQUALS(gt33_bound, "static") || + CCTK_EQUALS(gt33_bound, "flat" ) || + CCTK_EQUALS(gt33_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::gt33", gt33_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register gt33_bound BC for ML_BSSN_MP::gt33!"); + } + + if (CCTK_EQUALS(beta1_bound, "none" ) || + CCTK_EQUALS(beta1_bound, "static") || + CCTK_EQUALS(beta1_bound, "flat" ) || + CCTK_EQUALS(beta1_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::beta1", beta1_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register beta1_bound BC for ML_BSSN_MP::beta1!"); + } + + if (CCTK_EQUALS(beta2_bound, "none" ) || + CCTK_EQUALS(beta2_bound, "static") || + CCTK_EQUALS(beta2_bound, "flat" ) || + CCTK_EQUALS(beta2_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::beta2", beta2_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register beta2_bound BC for ML_BSSN_MP::beta2!"); + } + + if (CCTK_EQUALS(beta3_bound, "none" ) || + CCTK_EQUALS(beta3_bound, "static") || + CCTK_EQUALS(beta3_bound, "flat" ) || + CCTK_EQUALS(beta3_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::beta3", beta3_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register beta3_bound BC for ML_BSSN_MP::beta3!"); + } + + if (CCTK_EQUALS(trK_bound, "none" ) || + CCTK_EQUALS(trK_bound, "static") || + CCTK_EQUALS(trK_bound, "flat" ) || + CCTK_EQUALS(trK_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_BSSN_MP::trK", trK_bound); + if (ierr < 0) + CCTK_WARN(0, "Failed to register trK_bound BC for ML_BSSN_MP::trK!"); + } + + if (CCTK_EQUALS(ML_curv_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_curv_bound = -1; + if (handle_ML_curv_bound < 0) handle_ML_curv_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_curv_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_curv_bound , ML_curv_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_curv_bound ,ML_curv_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_curv_bound, + "ML_BSSN_MP::ML_curv", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_curv!"); + + } + + if (CCTK_EQUALS(ML_dtlapse_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_dtlapse_bound = -1; + if (handle_ML_dtlapse_bound < 0) handle_ML_dtlapse_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_dtlapse_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_dtlapse_bound , ML_dtlapse_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_dtlapse_bound ,ML_dtlapse_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_dtlapse_bound, + "ML_BSSN_MP::ML_dtlapse", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_dtlapse!"); + + } + + if (CCTK_EQUALS(ML_dtshift_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_dtshift_bound = -1; + if (handle_ML_dtshift_bound < 0) handle_ML_dtshift_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_dtshift_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_dtshift_bound , ML_dtshift_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_dtshift_bound ,ML_dtshift_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_dtshift_bound, + "ML_BSSN_MP::ML_dtshift", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_dtshift!"); + + } + + if (CCTK_EQUALS(ML_Gamma_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_Gamma_bound = -1; + if (handle_ML_Gamma_bound < 0) handle_ML_Gamma_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_Gamma_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_Gamma_bound , ML_Gamma_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_Gamma_bound ,ML_Gamma_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_Gamma_bound, + "ML_BSSN_MP::ML_Gamma", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_Gamma!"); + + } + + if (CCTK_EQUALS(ML_lapse_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_lapse_bound = -1; + if (handle_ML_lapse_bound < 0) handle_ML_lapse_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_lapse_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_lapse_bound , ML_lapse_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_lapse_bound ,ML_lapse_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_lapse_bound, + "ML_BSSN_MP::ML_lapse", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_lapse!"); + + } + + if (CCTK_EQUALS(ML_log_confac_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_log_confac_bound = -1; + if (handle_ML_log_confac_bound < 0) handle_ML_log_confac_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_log_confac_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_log_confac_bound , ML_log_confac_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_log_confac_bound ,ML_log_confac_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_log_confac_bound, + "ML_BSSN_MP::ML_log_confac", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_log_confac!"); + + } + + if (CCTK_EQUALS(ML_metric_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_metric_bound = -1; + if (handle_ML_metric_bound < 0) handle_ML_metric_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_metric_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_metric_bound , ML_metric_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_metric_bound ,ML_metric_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_metric_bound, + "ML_BSSN_MP::ML_metric", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_metric!"); + + } + + if (CCTK_EQUALS(ML_shift_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_shift_bound = -1; + if (handle_ML_shift_bound < 0) handle_ML_shift_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_shift_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_shift_bound , ML_shift_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_shift_bound ,ML_shift_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_shift_bound, + "ML_BSSN_MP::ML_shift", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_shift!"); + + } + + if (CCTK_EQUALS(ML_trace_curv_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_ML_trace_curv_bound = -1; + if (handle_ML_trace_curv_bound < 0) handle_ML_trace_curv_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_trace_curv_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_trace_curv_bound , ML_trace_curv_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_ML_trace_curv_bound ,ML_trace_curv_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_trace_curv_bound, + "ML_BSSN_MP::ML_trace_curv", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::ML_trace_curv!"); + + } + + if (CCTK_EQUALS(At11_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_At11_bound = -1; + if (handle_At11_bound < 0) handle_At11_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At11_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At11_bound , At11_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_At11_bound ,At11_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At11_bound, + "ML_BSSN_MP::At11", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::At11!"); + + } + + if (CCTK_EQUALS(At12_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_At12_bound = -1; + if (handle_At12_bound < 0) handle_At12_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At12_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At12_bound , At12_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_At12_bound ,At12_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At12_bound, + "ML_BSSN_MP::At12", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::At12!"); + + } + + if (CCTK_EQUALS(At13_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_At13_bound = -1; + if (handle_At13_bound < 0) handle_At13_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At13_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At13_bound , At13_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_At13_bound ,At13_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At13_bound, + "ML_BSSN_MP::At13", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::At13!"); + + } + + if (CCTK_EQUALS(At22_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_At22_bound = -1; + if (handle_At22_bound < 0) handle_At22_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At22_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At22_bound , At22_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_At22_bound ,At22_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At22_bound, + "ML_BSSN_MP::At22", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::At22!"); + + } + + if (CCTK_EQUALS(At23_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_At23_bound = -1; + if (handle_At23_bound < 0) handle_At23_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At23_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At23_bound , At23_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_At23_bound ,At23_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At23_bound, + "ML_BSSN_MP::At23", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::At23!"); + + } + + if (CCTK_EQUALS(At33_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_At33_bound = -1; + if (handle_At33_bound < 0) handle_At33_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At33_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At33_bound , At33_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_At33_bound ,At33_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At33_bound, + "ML_BSSN_MP::At33", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::At33!"); + + } + + if (CCTK_EQUALS(A_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_A_bound = -1; + if (handle_A_bound < 0) handle_A_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_A_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_A_bound , A_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_A_bound ,A_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_A_bound, + "ML_BSSN_MP::A", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::A!"); + + } + + if (CCTK_EQUALS(B1_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_B1_bound = -1; + if (handle_B1_bound < 0) handle_B1_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_B1_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_B1_bound , B1_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_B1_bound ,B1_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_B1_bound, + "ML_BSSN_MP::B1", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::B1!"); + + } + + if (CCTK_EQUALS(B2_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_B2_bound = -1; + if (handle_B2_bound < 0) handle_B2_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_B2_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_B2_bound , B2_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_B2_bound ,B2_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_B2_bound, + "ML_BSSN_MP::B2", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::B2!"); + + } + + if (CCTK_EQUALS(B3_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_B3_bound = -1; + if (handle_B3_bound < 0) handle_B3_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_B3_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_B3_bound , B3_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_B3_bound ,B3_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_B3_bound, + "ML_BSSN_MP::B3", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::B3!"); + + } + + if (CCTK_EQUALS(Xt1_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_Xt1_bound = -1; + if (handle_Xt1_bound < 0) handle_Xt1_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_Xt1_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_Xt1_bound , Xt1_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_Xt1_bound ,Xt1_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_Xt1_bound, + "ML_BSSN_MP::Xt1", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::Xt1!"); + + } + + if (CCTK_EQUALS(Xt2_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_Xt2_bound = -1; + if (handle_Xt2_bound < 0) handle_Xt2_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_Xt2_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_Xt2_bound , Xt2_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_Xt2_bound ,Xt2_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_Xt2_bound, + "ML_BSSN_MP::Xt2", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::Xt2!"); + + } + + if (CCTK_EQUALS(Xt3_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_Xt3_bound = -1; + if (handle_Xt3_bound < 0) handle_Xt3_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_Xt3_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_Xt3_bound , Xt3_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_Xt3_bound ,Xt3_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_Xt3_bound, + "ML_BSSN_MP::Xt3", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::Xt3!"); + + } + + if (CCTK_EQUALS(alpha_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_alpha_bound = -1; + if (handle_alpha_bound < 0) handle_alpha_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_alpha_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_alpha_bound , alpha_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_alpha_bound ,alpha_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_alpha_bound, + "ML_BSSN_MP::alpha", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::alpha!"); + + } + + if (CCTK_EQUALS(phi_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_phi_bound = -1; + if (handle_phi_bound < 0) handle_phi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_phi_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_phi_bound , phi_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_phi_bound ,phi_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_phi_bound, + "ML_BSSN_MP::phi", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::phi!"); + + } + + if (CCTK_EQUALS(gt11_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_gt11_bound = -1; + if (handle_gt11_bound < 0) handle_gt11_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt11_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt11_bound , gt11_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_gt11_bound ,gt11_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt11_bound, + "ML_BSSN_MP::gt11", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::gt11!"); + + } + + if (CCTK_EQUALS(gt12_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_gt12_bound = -1; + if (handle_gt12_bound < 0) handle_gt12_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt12_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt12_bound , gt12_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_gt12_bound ,gt12_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt12_bound, + "ML_BSSN_MP::gt12", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::gt12!"); + + } + + if (CCTK_EQUALS(gt13_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_gt13_bound = -1; + if (handle_gt13_bound < 0) handle_gt13_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt13_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt13_bound , gt13_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_gt13_bound ,gt13_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt13_bound, + "ML_BSSN_MP::gt13", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::gt13!"); + + } + + if (CCTK_EQUALS(gt22_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_gt22_bound = -1; + if (handle_gt22_bound < 0) handle_gt22_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt22_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt22_bound , gt22_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_gt22_bound ,gt22_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt22_bound, + "ML_BSSN_MP::gt22", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::gt22!"); + + } + + if (CCTK_EQUALS(gt23_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_gt23_bound = -1; + if (handle_gt23_bound < 0) handle_gt23_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt23_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt23_bound , gt23_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_gt23_bound ,gt23_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt23_bound, + "ML_BSSN_MP::gt23", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::gt23!"); + + } + + if (CCTK_EQUALS(gt33_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_gt33_bound = -1; + if (handle_gt33_bound < 0) handle_gt33_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt33_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt33_bound , gt33_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_gt33_bound ,gt33_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt33_bound, + "ML_BSSN_MP::gt33", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::gt33!"); + + } + + if (CCTK_EQUALS(beta1_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_beta1_bound = -1; + if (handle_beta1_bound < 0) handle_beta1_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_beta1_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_beta1_bound , beta1_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_beta1_bound ,beta1_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_beta1_bound, + "ML_BSSN_MP::beta1", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::beta1!"); + + } + + if (CCTK_EQUALS(beta2_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_beta2_bound = -1; + if (handle_beta2_bound < 0) handle_beta2_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_beta2_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_beta2_bound , beta2_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_beta2_bound ,beta2_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_beta2_bound, + "ML_BSSN_MP::beta2", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::beta2!"); + + } + + if (CCTK_EQUALS(beta3_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_beta3_bound = -1; + if (handle_beta3_bound < 0) handle_beta3_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_beta3_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_beta3_bound , beta3_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_beta3_bound ,beta3_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_beta3_bound, + "ML_BSSN_MP::beta3", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::beta3!"); + + } + + if (CCTK_EQUALS(trK_bound, "radiative")) + { + /* apply radiation boundary condition */ + static CCTK_INT handle_trK_bound = -1; + if (handle_trK_bound < 0) handle_trK_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_trK_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_trK_bound , trK_bound_limit, "LIMIT") < 0) + CCTK_WARN(0, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_trK_bound ,trK_bound_speed, "SPEED") < 0) + CCTK_WARN(0, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_trK_bound, + "ML_BSSN_MP::trK", "Radiation"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Radiation BC for ML_BSSN_MP::trK!"); + + } + + if (CCTK_EQUALS(ML_curv_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_curv_bound = -1; + if (handle_ML_curv_bound < 0) handle_ML_curv_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_curv_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_curv_bound ,ML_curv_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_curv_bound, + "ML_BSSN_MP::ML_curv", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_curv!"); + + } + + if (CCTK_EQUALS(ML_dtlapse_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_dtlapse_bound = -1; + if (handle_ML_dtlapse_bound < 0) handle_ML_dtlapse_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_dtlapse_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_dtlapse_bound ,ML_dtlapse_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_dtlapse_bound, + "ML_BSSN_MP::ML_dtlapse", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_dtlapse!"); + + } + + if (CCTK_EQUALS(ML_dtshift_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_dtshift_bound = -1; + if (handle_ML_dtshift_bound < 0) handle_ML_dtshift_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_dtshift_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_dtshift_bound ,ML_dtshift_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_dtshift_bound, + "ML_BSSN_MP::ML_dtshift", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_dtshift!"); + + } + + if (CCTK_EQUALS(ML_Gamma_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_Gamma_bound = -1; + if (handle_ML_Gamma_bound < 0) handle_ML_Gamma_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_Gamma_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_Gamma_bound ,ML_Gamma_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_Gamma_bound, + "ML_BSSN_MP::ML_Gamma", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_Gamma!"); + + } + + if (CCTK_EQUALS(ML_lapse_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_lapse_bound = -1; + if (handle_ML_lapse_bound < 0) handle_ML_lapse_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_lapse_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_lapse_bound ,ML_lapse_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_lapse_bound, + "ML_BSSN_MP::ML_lapse", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_lapse!"); + + } + + if (CCTK_EQUALS(ML_log_confac_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_log_confac_bound = -1; + if (handle_ML_log_confac_bound < 0) handle_ML_log_confac_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_log_confac_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_log_confac_bound ,ML_log_confac_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_log_confac_bound, + "ML_BSSN_MP::ML_log_confac", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_log_confac!"); + + } + + if (CCTK_EQUALS(ML_metric_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_metric_bound = -1; + if (handle_ML_metric_bound < 0) handle_ML_metric_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_metric_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_metric_bound ,ML_metric_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_metric_bound, + "ML_BSSN_MP::ML_metric", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_metric!"); + + } + + if (CCTK_EQUALS(ML_shift_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_shift_bound = -1; + if (handle_ML_shift_bound < 0) handle_ML_shift_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_shift_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_shift_bound ,ML_shift_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_shift_bound, + "ML_BSSN_MP::ML_shift", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_shift!"); + + } + + if (CCTK_EQUALS(ML_trace_curv_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_ML_trace_curv_bound = -1; + if (handle_ML_trace_curv_bound < 0) handle_ML_trace_curv_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_ML_trace_curv_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_ML_trace_curv_bound ,ML_trace_curv_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_ML_trace_curv_bound, + "ML_BSSN_MP::ML_trace_curv", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Failed to register Scalar BC for ML_BSSN_MP::ML_trace_curv!"); + + } + + if (CCTK_EQUALS(At11_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_At11_bound = -1; + if (handle_At11_bound < 0) handle_At11_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At11_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At11_bound ,At11_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At11_bound, + "ML_BSSN_MP::At11", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::At11!"); + + } + + if (CCTK_EQUALS(At12_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_At12_bound = -1; + if (handle_At12_bound < 0) handle_At12_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At12_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At12_bound ,At12_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At12_bound, + "ML_BSSN_MP::At12", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::At12!"); + + } + + if (CCTK_EQUALS(At13_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_At13_bound = -1; + if (handle_At13_bound < 0) handle_At13_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At13_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At13_bound ,At13_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At13_bound, + "ML_BSSN_MP::At13", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::At13!"); + + } + + if (CCTK_EQUALS(At22_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_At22_bound = -1; + if (handle_At22_bound < 0) handle_At22_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At22_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At22_bound ,At22_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At22_bound, + "ML_BSSN_MP::At22", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::At22!"); + + } + + if (CCTK_EQUALS(At23_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_At23_bound = -1; + if (handle_At23_bound < 0) handle_At23_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At23_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At23_bound ,At23_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At23_bound, + "ML_BSSN_MP::At23", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::At23!"); + + } + + if (CCTK_EQUALS(At33_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_At33_bound = -1; + if (handle_At33_bound < 0) handle_At33_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_At33_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_At33_bound ,At33_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_At33_bound, + "ML_BSSN_MP::At33", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::At33!"); + + } + + if (CCTK_EQUALS(A_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_A_bound = -1; + if (handle_A_bound < 0) handle_A_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_A_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_A_bound ,A_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_A_bound, + "ML_BSSN_MP::A", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::A!"); + + } + + if (CCTK_EQUALS(B1_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_B1_bound = -1; + if (handle_B1_bound < 0) handle_B1_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_B1_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_B1_bound ,B1_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_B1_bound, + "ML_BSSN_MP::B1", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::B1!"); + + } + + if (CCTK_EQUALS(B2_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_B2_bound = -1; + if (handle_B2_bound < 0) handle_B2_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_B2_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_B2_bound ,B2_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_B2_bound, + "ML_BSSN_MP::B2", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::B2!"); + + } + + if (CCTK_EQUALS(B3_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_B3_bound = -1; + if (handle_B3_bound < 0) handle_B3_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_B3_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_B3_bound ,B3_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_B3_bound, + "ML_BSSN_MP::B3", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::B3!"); + + } + + if (CCTK_EQUALS(Xt1_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_Xt1_bound = -1; + if (handle_Xt1_bound < 0) handle_Xt1_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_Xt1_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_Xt1_bound ,Xt1_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_Xt1_bound, + "ML_BSSN_MP::Xt1", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::Xt1!"); + + } + + if (CCTK_EQUALS(Xt2_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_Xt2_bound = -1; + if (handle_Xt2_bound < 0) handle_Xt2_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_Xt2_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_Xt2_bound ,Xt2_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_Xt2_bound, + "ML_BSSN_MP::Xt2", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::Xt2!"); + + } + + if (CCTK_EQUALS(Xt3_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_Xt3_bound = -1; + if (handle_Xt3_bound < 0) handle_Xt3_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_Xt3_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_Xt3_bound ,Xt3_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_Xt3_bound, + "ML_BSSN_MP::Xt3", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::Xt3!"); + + } + + if (CCTK_EQUALS(alpha_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_alpha_bound = -1; + if (handle_alpha_bound < 0) handle_alpha_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_alpha_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_alpha_bound ,alpha_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_alpha_bound, + "ML_BSSN_MP::alpha", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::alpha!"); + + } + + if (CCTK_EQUALS(phi_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_phi_bound = -1; + if (handle_phi_bound < 0) handle_phi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_phi_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_phi_bound ,phi_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_phi_bound, + "ML_BSSN_MP::phi", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::phi!"); + + } + + if (CCTK_EQUALS(gt11_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_gt11_bound = -1; + if (handle_gt11_bound < 0) handle_gt11_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt11_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt11_bound ,gt11_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt11_bound, + "ML_BSSN_MP::gt11", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::gt11!"); + + } + + if (CCTK_EQUALS(gt12_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_gt12_bound = -1; + if (handle_gt12_bound < 0) handle_gt12_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt12_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt12_bound ,gt12_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt12_bound, + "ML_BSSN_MP::gt12", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::gt12!"); + + } + + if (CCTK_EQUALS(gt13_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_gt13_bound = -1; + if (handle_gt13_bound < 0) handle_gt13_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt13_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt13_bound ,gt13_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt13_bound, + "ML_BSSN_MP::gt13", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::gt13!"); + + } + + if (CCTK_EQUALS(gt22_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_gt22_bound = -1; + if (handle_gt22_bound < 0) handle_gt22_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt22_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt22_bound ,gt22_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt22_bound, + "ML_BSSN_MP::gt22", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::gt22!"); + + } + + if (CCTK_EQUALS(gt23_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_gt23_bound = -1; + if (handle_gt23_bound < 0) handle_gt23_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt23_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt23_bound ,gt23_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt23_bound, + "ML_BSSN_MP::gt23", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::gt23!"); + + } + + if (CCTK_EQUALS(gt33_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_gt33_bound = -1; + if (handle_gt33_bound < 0) handle_gt33_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_gt33_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_gt33_bound ,gt33_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_gt33_bound, + "ML_BSSN_MP::gt33", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::gt33!"); + + } + + if (CCTK_EQUALS(beta1_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_beta1_bound = -1; + if (handle_beta1_bound < 0) handle_beta1_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_beta1_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_beta1_bound ,beta1_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_beta1_bound, + "ML_BSSN_MP::beta1", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::beta1!"); + + } + + if (CCTK_EQUALS(beta2_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_beta2_bound = -1; + if (handle_beta2_bound < 0) handle_beta2_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_beta2_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_beta2_bound ,beta2_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_beta2_bound, + "ML_BSSN_MP::beta2", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::beta2!"); + + } + + if (CCTK_EQUALS(beta3_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_beta3_bound = -1; + if (handle_beta3_bound < 0) handle_beta3_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_beta3_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_beta3_bound ,beta3_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_beta3_bound, + "ML_BSSN_MP::beta3", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::beta3!"); + + } + + if (CCTK_EQUALS(trK_bound, "scalar")) + { + /* apply scalar boundary condition */ + static CCTK_INT handle_trK_bound = -1; + if (handle_trK_bound < 0) handle_trK_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_trK_bound < 0) CCTK_WARN(0, "could not create table!"); + if (Util_TableSetReal(handle_trK_bound ,trK_bound_scalar, "SCALAR") < 0) + CCTK_WARN(0, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_trK_bound, + "ML_BSSN_MP::trK", "scalar"); + + if (ierr < 0) + CCTK_WARN(0, "Error in registering Scalar BC for ML_BSSN_MP::trK!"); + + } + return; +} + + + +/* template for entries in parameter file: +#$bound$#ML_BSSN_MP::ML_curv_bound = "skip" +#$bound$#ML_BSSN_MP::ML_curv_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_curv_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_curv_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::ML_dtlapse_bound = "skip" +#$bound$#ML_BSSN_MP::ML_dtlapse_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_dtlapse_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_dtlapse_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::ML_dtshift_bound = "skip" +#$bound$#ML_BSSN_MP::ML_dtshift_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_dtshift_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_dtshift_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::ML_Gamma_bound = "skip" +#$bound$#ML_BSSN_MP::ML_Gamma_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_Gamma_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_Gamma_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::ML_lapse_bound = "skip" +#$bound$#ML_BSSN_MP::ML_lapse_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_lapse_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_lapse_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::ML_log_confac_bound = "skip" +#$bound$#ML_BSSN_MP::ML_log_confac_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_log_confac_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_log_confac_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::ML_metric_bound = "skip" +#$bound$#ML_BSSN_MP::ML_metric_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_metric_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_metric_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::ML_shift_bound = "skip" +#$bound$#ML_BSSN_MP::ML_shift_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_shift_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_shift_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::ML_trace_curv_bound = "skip" +#$bound$#ML_BSSN_MP::ML_trace_curv_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::ML_trace_curv_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::ML_trace_curv_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::At11_bound = "skip" +#$bound$#ML_BSSN_MP::At11_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::At11_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::At11_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::At12_bound = "skip" +#$bound$#ML_BSSN_MP::At12_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::At12_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::At12_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::At13_bound = "skip" +#$bound$#ML_BSSN_MP::At13_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::At13_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::At13_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::At22_bound = "skip" +#$bound$#ML_BSSN_MP::At22_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::At22_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::At22_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::At23_bound = "skip" +#$bound$#ML_BSSN_MP::At23_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::At23_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::At23_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::At33_bound = "skip" +#$bound$#ML_BSSN_MP::At33_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::At33_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::At33_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::A_bound = "skip" +#$bound$#ML_BSSN_MP::A_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::A_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::A_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::B1_bound = "skip" +#$bound$#ML_BSSN_MP::B1_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::B1_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::B1_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::B2_bound = "skip" +#$bound$#ML_BSSN_MP::B2_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::B2_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::B2_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::B3_bound = "skip" +#$bound$#ML_BSSN_MP::B3_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::B3_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::B3_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::Xt1_bound = "skip" +#$bound$#ML_BSSN_MP::Xt1_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::Xt1_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::Xt1_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::Xt2_bound = "skip" +#$bound$#ML_BSSN_MP::Xt2_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::Xt2_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::Xt2_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::Xt3_bound = "skip" +#$bound$#ML_BSSN_MP::Xt3_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::Xt3_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::Xt3_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::alpha_bound = "skip" +#$bound$#ML_BSSN_MP::alpha_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::alpha_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::alpha_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::phi_bound = "skip" +#$bound$#ML_BSSN_MP::phi_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::phi_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::phi_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::gt11_bound = "skip" +#$bound$#ML_BSSN_MP::gt11_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::gt11_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::gt11_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::gt12_bound = "skip" +#$bound$#ML_BSSN_MP::gt12_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::gt12_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::gt12_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::gt13_bound = "skip" +#$bound$#ML_BSSN_MP::gt13_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::gt13_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::gt13_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::gt22_bound = "skip" +#$bound$#ML_BSSN_MP::gt22_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::gt22_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::gt22_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::gt23_bound = "skip" +#$bound$#ML_BSSN_MP::gt23_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::gt23_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::gt23_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::gt33_bound = "skip" +#$bound$#ML_BSSN_MP::gt33_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::gt33_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::gt33_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::beta1_bound = "skip" +#$bound$#ML_BSSN_MP::beta1_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::beta1_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::beta1_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::beta2_bound = "skip" +#$bound$#ML_BSSN_MP::beta2_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::beta2_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::beta2_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::beta3_bound = "skip" +#$bound$#ML_BSSN_MP::beta3_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::beta3_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::beta3_bound_scalar = 0.0 + +#$bound$#ML_BSSN_MP::trK_bound = "skip" +#$bound$#ML_BSSN_MP::trK_bound_speed = 1.0 +#$bound$#ML_BSSN_MP::trK_bound_limit = 0.0 +#$bound$#ML_BSSN_MP::trK_bound_scalar = 0.0 + +*/ + diff --git a/ML_BSSN_MP/src/Differencing.h b/ML_BSSN_MP/src/Differencing.h new file mode 100644 index 0000000..46cddca --- /dev/null +++ b/ML_BSSN_MP/src/Differencing.h @@ -0,0 +1,18 @@ +#define PDstandardNth1(u,i,j,k) (p1o12dx*(-8*(u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,k)] + 8*(u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,k)] - (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,k)])) +#define PDstandardNth2(u,i,j,k) (p1o12dy*(-8*(u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,k)] + 8*(u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,k)])) +#define PDstandardNth3(u,i,j,k) (p1o12dz*(-8*(u)[CCTK_GFINDEX3D(cctkGH,i,j,-1 + k)] + 8*(u)[CCTK_GFINDEX3D(cctkGH,i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,j,-2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,j,2 + k)])) +#define PDstandardNth11(u,i,j,k) (pm1o12dx2*(-16*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,k)]) + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,k)] + 30*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDstandardNth22(u,i,j,k) (pm1o12dy2*(-16*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,k)]) + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,k)] + 30*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDstandardNth33(u,i,j,k) (pm1o12dz2*(-16*((u)[CCTK_GFINDEX3D(cctkGH,i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,j,1 + k)]) + (u)[CCTK_GFINDEX3D(cctkGH,i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,j,2 + k)] + 30*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDstandardNth12(u,i,j,k) (p1o144dxdy*(-64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,-1 + j,k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,-1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,1 + j,k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,-2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,-1 + j,k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,-2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,-1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,1 + j,k)]) + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,-2 + j,k)] - (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,2 + j,k)] - (u)[CCTK_GFINDEX3D(cctkGH,2 + i,-2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,2 + j,k)])) +#define PDstandardNth13(u,i,j,k) (p1o144dxdz*(-64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,-1 + k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,1 + k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,-1 + k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,1 + k)]) + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,2 + k)])) +#define PDstandardNth21(u,i,j,k) (p1o144dxdy*(-64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,-1 + j,k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,-1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,1 + j,k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,-2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,-1 + j,k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,-2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,-1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,1 + j,k)]) + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,-2 + j,k)] - (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,2 + j,k)] - (u)[CCTK_GFINDEX3D(cctkGH,2 + i,-2 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,2 + j,k)])) +#define PDstandardNth23(u,i,j,k) (p1o144dydz*(-64*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,-1 + k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,1 + k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,-1 + k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,1 + k)]) + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,2 + k)])) +#define PDstandardNth31(u,i,j,k) (p1o144dxdz*(-64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,-1 + k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,1 + k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,-1 + k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,1 + k)]) + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,2 + k)])) +#define PDstandardNth32(u,i,j,k) (p1o144dydz*(-64*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,-1 + k)]) + 64*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,1 + k)]) + 8*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,-1 + k)]) - 8*((u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,1 + k)]) + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,2 + k)] - (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,-2 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,2 + k)])) +#define PDPlus1(u,i,j,k) (pm1o2dx*(-4*(u)[CCTK_GFINDEX3D(cctkGH,1 + i,j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,2 + i,j,k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDPlus2(u,i,j,k) (pm1o2dy*(-4*(u)[CCTK_GFINDEX3D(cctkGH,i,1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,2 + j,k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDPlus3(u,i,j,k) (pm1o2dz*(-4*(u)[CCTK_GFINDEX3D(cctkGH,i,j,1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,j,2 + k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDMinus1(u,i,j,k) (p1o2dx*(-4*(u)[CCTK_GFINDEX3D(cctkGH,-1 + i,j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,-2 + i,j,k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDMinus2(u,i,j,k) (p1o2dy*(-4*(u)[CCTK_GFINDEX3D(cctkGH,i,-1 + j,k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,-2 + j,k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDMinus3(u,i,j,k) (p1o2dz*(-4*(u)[CCTK_GFINDEX3D(cctkGH,i,j,-1 + k)] + (u)[CCTK_GFINDEX3D(cctkGH,i,j,-2 + k)] + 3*(u)[CCTK_GFINDEX3D(cctkGH,i,j,k)])) diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_ADMBaseBoundary.c b/ML_BSSN_MP/src/ML_BSSN_MP_ADMBaseBoundary.c new file mode 100644 index 0000000..33fbf06 --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_ADMBaseBoundary.c @@ -0,0 +1,224 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_ADMBaseBoundary_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_ADMBaseBoundary_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_ADMBaseBoundary_calc_every != ML_BSSN_MP_ADMBaseBoundary_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_ADMBaseBoundary, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + + /* Declare local copies of grid functions */ + CCTK_REAL alpL = INITVALUE; + CCTK_REAL betaxL = INITVALUE; + CCTK_REAL betayL = INITVALUE; + CCTK_REAL betazL = INITVALUE; + CCTK_REAL dtalpL = INITVALUE; + CCTK_REAL dtbetaxL = INITVALUE; + CCTK_REAL dtbetayL = INITVALUE; + CCTK_REAL dtbetazL = INITVALUE; + CCTK_REAL gxxL = INITVALUE; + CCTK_REAL gxyL = INITVALUE; + CCTK_REAL gxzL = INITVALUE; + CCTK_REAL gyyL = INITVALUE; + CCTK_REAL gyzL = INITVALUE; + CCTK_REAL gzzL = INITVALUE; + CCTK_REAL kxxL = INITVALUE; + CCTK_REAL kxyL = INITVALUE; + CCTK_REAL kxzL = INITVALUE; + CCTK_REAL kyyL = INITVALUE; + CCTK_REAL kyzL = INITVALUE; + CCTK_REAL kzzL = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + + /* Assign local copies of grid functions */ + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + gxxL = 1; + + gxyL = 0; + + gxzL = 0; + + gyyL = 1; + + gyzL = 0; + + gzzL = 1; + + kxxL = 0; + + kxyL = 0; + + kxzL = 0; + + kyyL = 0; + + kyzL = 0; + + kzzL = 0; + + alpL = 1; + + dtalpL = 0; + + betaxL = 0; + + betayL = 0; + + betazL = 0; + + dtbetaxL = 0; + + dtbetayL = 0; + + dtbetazL = 0; + + + /* Copy local copies back to grid functions */ + alp[index] = alpL; + betax[index] = betaxL; + betay[index] = betayL; + betaz[index] = betazL; + dtalp[index] = dtalpL; + dtbetax[index] = dtbetaxL; + dtbetay[index] = dtbetayL; + dtbetaz[index] = dtbetazL; + gxx[index] = gxxL; + gxy[index] = gxyL; + gxz[index] = gxzL; + gyy[index] = gyyL; + gyz[index] = gyzL; + gzz[index] = gzzL; + kxx[index] = kxxL; + kxy[index] = kxyL; + kxz[index] = kxzL; + kyy[index] = kyyL; + kyz[index] = kyzL; + kzz[index] = kzzL; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_ADMBaseBoundary); +} + +void ML_BSSN_MP_ADMBaseBoundary(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverBoundaryWithGhosts(cctkGH, &ML_BSSN_MP_ADMBaseBoundary_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_Minkowski.c b/ML_BSSN_MP/src/ML_BSSN_MP_Minkowski.c new file mode 100644 index 0000000..682c53a --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_Minkowski.c @@ -0,0 +1,228 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_Minkowski_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_Minkowski_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_Minkowski_calc_every != ML_BSSN_MP_Minkowski_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_Minkowski, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + + /* Declare local copies of grid functions */ + CCTK_REAL AL = INITVALUE; + CCTK_REAL alphaL = INITVALUE; + CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE; + CCTK_REAL B1L = INITVALUE, B2L = INITVALUE, B3L = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE; + CCTK_REAL phiL = INITVALUE; + CCTK_REAL trKL = INITVALUE; + CCTK_REAL Xt1L = INITVALUE, Xt2L = INITVALUE, Xt3L = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + + /* Assign local copies of grid functions */ + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + phiL = 0; + + gt11L = 1; + + gt12L = 0; + + gt13L = 0; + + gt22L = 1; + + gt23L = 0; + + gt33L = 1; + + trKL = 0; + + At11L = 0; + + At12L = 0; + + At13L = 0; + + At22L = 0; + + At23L = 0; + + At33L = 0; + + Xt1L = 0; + + Xt2L = 0; + + Xt3L = 0; + + alphaL = 1; + + AL = 0; + + beta1L = 0; + + beta2L = 0; + + beta3L = 0; + + B1L = 0; + + B2L = 0; + + B3L = 0; + + + /* Copy local copies back to grid functions */ + A[index] = AL; + alpha[index] = alphaL; + At11[index] = At11L; + At12[index] = At12L; + At13[index] = At13L; + At22[index] = At22L; + At23[index] = At23L; + At33[index] = At33L; + B1[index] = B1L; + B2[index] = B2L; + B3[index] = B3L; + beta1[index] = beta1L; + beta2[index] = beta2L; + beta3[index] = beta3L; + gt11[index] = gt11L; + gt12[index] = gt12L; + gt13[index] = gt13L; + gt22[index] = gt22L; + gt23[index] = gt23L; + gt33[index] = gt33L; + phi[index] = phiL; + trK[index] = trKL; + Xt1[index] = Xt1L; + Xt2[index] = Xt2L; + Xt3[index] = Xt3L; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_Minkowski); +} + +void ML_BSSN_MP_Minkowski(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_MP_Minkowski_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_RHS.c b/ML_BSSN_MP/src/ML_BSSN_MP_RHS.c new file mode 100644 index 0000000..51a397e --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_RHS.c @@ -0,0 +1,2852 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_RHS_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_RHS_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_RHS_calc_every != ML_BSSN_MP_RHS_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_RHS, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + CCTK_REAL Atm11 = INITVALUE, Atm12 = INITVALUE, Atm13 = INITVALUE, Atm21 = INITVALUE, Atm22 = INITVALUE, Atm23 = INITVALUE; + CCTK_REAL Atm31 = INITVALUE, Atm32 = INITVALUE, Atm33 = INITVALUE; + CCTK_REAL Ats11 = INITVALUE, Ats12 = INITVALUE, Ats13 = INITVALUE, Ats22 = INITVALUE, Ats23 = INITVALUE, Ats33 = INITVALUE; + CCTK_REAL Atu11 = INITVALUE, Atu21 = INITVALUE, Atu22 = INITVALUE, Atu31 = INITVALUE, Atu32 = INITVALUE, Atu33 = INITVALUE; + CCTK_REAL detgt = INITVALUE; + CCTK_REAL e4phi = INITVALUE; + CCTK_REAL em4phi = INITVALUE; + CCTK_REAL g11 = INITVALUE; + CCTK_REAL G111 = INITVALUE, G112 = INITVALUE, G113 = INITVALUE; + CCTK_REAL g12 = INITVALUE; + CCTK_REAL G122 = INITVALUE, G123 = INITVALUE; + CCTK_REAL g13 = INITVALUE; + CCTK_REAL G133 = INITVALUE, G211 = INITVALUE, G212 = INITVALUE, G213 = INITVALUE; + CCTK_REAL g22 = INITVALUE; + CCTK_REAL G222 = INITVALUE, G223 = INITVALUE; + CCTK_REAL g23 = INITVALUE; + CCTK_REAL G233 = INITVALUE, G311 = INITVALUE, G312 = INITVALUE, G313 = INITVALUE, G322 = INITVALUE, G323 = INITVALUE; + CCTK_REAL g33 = INITVALUE; + CCTK_REAL G333 = INITVALUE; + CCTK_REAL Gt111 = INITVALUE, Gt112 = INITVALUE, Gt113 = INITVALUE, Gt122 = INITVALUE, Gt123 = INITVALUE, Gt133 = INITVALUE; + CCTK_REAL Gt211 = INITVALUE, Gt212 = INITVALUE, Gt213 = INITVALUE, Gt222 = INITVALUE, Gt223 = INITVALUE, Gt233 = INITVALUE; + CCTK_REAL Gt311 = INITVALUE, Gt312 = INITVALUE, Gt313 = INITVALUE, Gt322 = INITVALUE, Gt323 = INITVALUE, Gt333 = INITVALUE; + CCTK_REAL gtu11 = INITVALUE, gtu21 = INITVALUE, gtu22 = INITVALUE, gtu31 = INITVALUE, gtu32 = INITVALUE, gtu33 = INITVALUE; + CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; + CCTK_REAL R11 = INITVALUE, R12 = INITVALUE, R13 = INITVALUE, R22 = INITVALUE, R23 = INITVALUE, R33 = INITVALUE; + CCTK_REAL rho = INITVALUE; + CCTK_REAL Rphi11 = INITVALUE, Rphi12 = INITVALUE, Rphi13 = INITVALUE, Rphi22 = INITVALUE, Rphi23 = INITVALUE, Rphi33 = INITVALUE; + CCTK_REAL Rt11 = INITVALUE, Rt12 = INITVALUE, Rt13 = INITVALUE, Rt22 = INITVALUE, Rt23 = INITVALUE, Rt33 = INITVALUE; + CCTK_REAL S1 = INITVALUE, S2 = INITVALUE, S3 = INITVALUE; + CCTK_REAL T00 = INITVALUE, T01 = INITVALUE, T02 = INITVALUE, T03 = INITVALUE, T11 = INITVALUE, T12 = INITVALUE; + CCTK_REAL T13 = INITVALUE, T22 = INITVALUE, T23 = INITVALUE, T33 = INITVALUE; + CCTK_REAL trAts = INITVALUE; + CCTK_REAL trS = INITVALUE; + CCTK_REAL Xtn1 = INITVALUE, Xtn2 = INITVALUE, Xtn3 = INITVALUE; + + /* Declare local copies of grid functions */ + CCTK_REAL AL = INITVALUE; + CCTK_REAL alphaL = INITVALUE, alpharhsL = INITVALUE; + CCTK_REAL ArhsL = INITVALUE; + CCTK_REAL At11L = INITVALUE, At11rhsL = INITVALUE, At12L = INITVALUE, At12rhsL = INITVALUE, At13L = INITVALUE, At13rhsL = INITVALUE; + CCTK_REAL At22L = INITVALUE, At22rhsL = INITVALUE, At23L = INITVALUE, At23rhsL = INITVALUE, At33L = INITVALUE, At33rhsL = INITVALUE; + CCTK_REAL B1L = INITVALUE, B1rhsL = INITVALUE, B2L = INITVALUE, B2rhsL = INITVALUE, B3L = INITVALUE, B3rhsL = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta1rhsL = INITVALUE, beta2L = INITVALUE, beta2rhsL = INITVALUE, beta3L = INITVALUE, beta3rhsL = INITVALUE; + CCTK_REAL dJ111L = INITVALUE, dJ112L = INITVALUE, dJ113L = INITVALUE, dJ122L = INITVALUE, dJ123L = INITVALUE, dJ133L = INITVALUE; + CCTK_REAL dJ211L = INITVALUE, dJ212L = INITVALUE, dJ213L = INITVALUE, dJ222L = INITVALUE, dJ223L = INITVALUE, dJ233L = INITVALUE; + CCTK_REAL dJ311L = INITVALUE, dJ312L = INITVALUE, dJ313L = INITVALUE, dJ322L = INITVALUE, dJ323L = INITVALUE, dJ333L = INITVALUE; + CCTK_REAL eTttL = INITVALUE; + CCTK_REAL eTtxL = INITVALUE; + CCTK_REAL eTtyL = INITVALUE; + CCTK_REAL eTtzL = INITVALUE; + CCTK_REAL eTxxL = INITVALUE; + CCTK_REAL eTxyL = INITVALUE; + CCTK_REAL eTxzL = INITVALUE; + CCTK_REAL eTyyL = INITVALUE; + CCTK_REAL eTyzL = INITVALUE; + CCTK_REAL eTzzL = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt11rhsL = INITVALUE, gt12L = INITVALUE, gt12rhsL = INITVALUE, gt13L = INITVALUE, gt13rhsL = INITVALUE; + CCTK_REAL gt22L = INITVALUE, gt22rhsL = INITVALUE, gt23L = INITVALUE, gt23rhsL = INITVALUE, gt33L = INITVALUE, gt33rhsL = INITVALUE; + CCTK_REAL J11L = INITVALUE, J12L = INITVALUE, J13L = INITVALUE, J21L = INITVALUE, J22L = INITVALUE, J23L = INITVALUE; + CCTK_REAL J31L = INITVALUE, J32L = INITVALUE, J33L = INITVALUE; + CCTK_REAL phiL = INITVALUE, phirhsL = INITVALUE; + CCTK_REAL trKL = INITVALUE, trKrhsL = INITVALUE; + CCTK_REAL Xt1L = INITVALUE, Xt1rhsL = INITVALUE, Xt2L = INITVALUE, Xt2rhsL = INITVALUE, Xt3L = INITVALUE, Xt3rhsL = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + CCTK_REAL PDstandardNth1alpha = INITVALUE; + CCTK_REAL PDstandardNth2alpha = INITVALUE; + CCTK_REAL PDstandardNth3alpha = INITVALUE; + CCTK_REAL PDstandardNth11alpha = INITVALUE; + CCTK_REAL PDstandardNth22alpha = INITVALUE; + CCTK_REAL PDstandardNth33alpha = INITVALUE; + CCTK_REAL PDstandardNth12alpha = INITVALUE; + CCTK_REAL PDstandardNth13alpha = INITVALUE; + CCTK_REAL PDstandardNth21alpha = INITVALUE; + CCTK_REAL PDstandardNth23alpha = INITVALUE; + CCTK_REAL PDstandardNth31alpha = INITVALUE; + CCTK_REAL PDstandardNth32alpha = INITVALUE; + CCTK_REAL PDstandardNth1At11 = INITVALUE; + CCTK_REAL PDstandardNth2At11 = INITVALUE; + CCTK_REAL PDstandardNth3At11 = INITVALUE; + CCTK_REAL PDstandardNth1At12 = INITVALUE; + CCTK_REAL PDstandardNth2At12 = INITVALUE; + CCTK_REAL PDstandardNth3At12 = INITVALUE; + CCTK_REAL PDstandardNth1At13 = INITVALUE; + CCTK_REAL PDstandardNth2At13 = INITVALUE; + CCTK_REAL PDstandardNth3At13 = INITVALUE; + CCTK_REAL PDstandardNth1At22 = INITVALUE; + CCTK_REAL PDstandardNth2At22 = INITVALUE; + CCTK_REAL PDstandardNth3At22 = INITVALUE; + CCTK_REAL PDstandardNth1At23 = INITVALUE; + CCTK_REAL PDstandardNth2At23 = INITVALUE; + CCTK_REAL PDstandardNth3At23 = INITVALUE; + CCTK_REAL PDstandardNth1At33 = INITVALUE; + CCTK_REAL PDstandardNth2At33 = INITVALUE; + CCTK_REAL PDstandardNth3At33 = INITVALUE; + CCTK_REAL PDstandardNth1B1 = INITVALUE; + CCTK_REAL PDstandardNth2B1 = INITVALUE; + CCTK_REAL PDstandardNth3B1 = INITVALUE; + CCTK_REAL PDstandardNth1B2 = INITVALUE; + CCTK_REAL PDstandardNth2B2 = INITVALUE; + CCTK_REAL PDstandardNth3B2 = INITVALUE; + CCTK_REAL PDstandardNth1B3 = INITVALUE; + CCTK_REAL PDstandardNth2B3 = INITVALUE; + CCTK_REAL PDstandardNth3B3 = INITVALUE; + CCTK_REAL PDstandardNth1beta1 = INITVALUE; + CCTK_REAL PDstandardNth2beta1 = INITVALUE; + CCTK_REAL PDstandardNth3beta1 = INITVALUE; + CCTK_REAL PDstandardNth11beta1 = INITVALUE; + CCTK_REAL PDstandardNth22beta1 = INITVALUE; + CCTK_REAL PDstandardNth33beta1 = INITVALUE; + CCTK_REAL PDstandardNth12beta1 = INITVALUE; + CCTK_REAL PDstandardNth13beta1 = INITVALUE; + CCTK_REAL PDstandardNth21beta1 = INITVALUE; + CCTK_REAL PDstandardNth23beta1 = INITVALUE; + CCTK_REAL PDstandardNth31beta1 = INITVALUE; + CCTK_REAL PDstandardNth32beta1 = INITVALUE; + CCTK_REAL PDstandardNth1beta2 = INITVALUE; + CCTK_REAL PDstandardNth2beta2 = INITVALUE; + CCTK_REAL PDstandardNth3beta2 = INITVALUE; + CCTK_REAL PDstandardNth11beta2 = INITVALUE; + CCTK_REAL PDstandardNth22beta2 = INITVALUE; + CCTK_REAL PDstandardNth33beta2 = INITVALUE; + CCTK_REAL PDstandardNth12beta2 = INITVALUE; + CCTK_REAL PDstandardNth13beta2 = INITVALUE; + CCTK_REAL PDstandardNth21beta2 = INITVALUE; + CCTK_REAL PDstandardNth23beta2 = INITVALUE; + CCTK_REAL PDstandardNth31beta2 = INITVALUE; + CCTK_REAL PDstandardNth32beta2 = INITVALUE; + CCTK_REAL PDstandardNth1beta3 = INITVALUE; + CCTK_REAL PDstandardNth2beta3 = INITVALUE; + CCTK_REAL PDstandardNth3beta3 = INITVALUE; + CCTK_REAL PDstandardNth11beta3 = INITVALUE; + CCTK_REAL PDstandardNth22beta3 = INITVALUE; + CCTK_REAL PDstandardNth33beta3 = INITVALUE; + CCTK_REAL PDstandardNth12beta3 = INITVALUE; + CCTK_REAL PDstandardNth13beta3 = INITVALUE; + CCTK_REAL PDstandardNth21beta3 = INITVALUE; + CCTK_REAL PDstandardNth23beta3 = INITVALUE; + CCTK_REAL PDstandardNth31beta3 = INITVALUE; + CCTK_REAL PDstandardNth32beta3 = INITVALUE; + CCTK_REAL PDstandardNth1gt11 = INITVALUE; + CCTK_REAL PDstandardNth2gt11 = INITVALUE; + CCTK_REAL PDstandardNth3gt11 = INITVALUE; + CCTK_REAL PDstandardNth11gt11 = INITVALUE; + CCTK_REAL PDstandardNth22gt11 = INITVALUE; + CCTK_REAL PDstandardNth33gt11 = INITVALUE; + CCTK_REAL PDstandardNth12gt11 = INITVALUE; + CCTK_REAL PDstandardNth13gt11 = INITVALUE; + CCTK_REAL PDstandardNth21gt11 = INITVALUE; + CCTK_REAL PDstandardNth23gt11 = INITVALUE; + CCTK_REAL PDstandardNth31gt11 = INITVALUE; + CCTK_REAL PDstandardNth32gt11 = INITVALUE; + CCTK_REAL PDstandardNth1gt12 = INITVALUE; + CCTK_REAL PDstandardNth2gt12 = INITVALUE; + CCTK_REAL PDstandardNth3gt12 = INITVALUE; + CCTK_REAL PDstandardNth11gt12 = INITVALUE; + CCTK_REAL PDstandardNth22gt12 = INITVALUE; + CCTK_REAL PDstandardNth33gt12 = INITVALUE; + CCTK_REAL PDstandardNth12gt12 = INITVALUE; + CCTK_REAL PDstandardNth13gt12 = INITVALUE; + CCTK_REAL PDstandardNth21gt12 = INITVALUE; + CCTK_REAL PDstandardNth23gt12 = INITVALUE; + CCTK_REAL PDstandardNth31gt12 = INITVALUE; + CCTK_REAL PDstandardNth32gt12 = INITVALUE; + CCTK_REAL PDstandardNth1gt13 = INITVALUE; + CCTK_REAL PDstandardNth2gt13 = INITVALUE; + CCTK_REAL PDstandardNth3gt13 = INITVALUE; + CCTK_REAL PDstandardNth11gt13 = INITVALUE; + CCTK_REAL PDstandardNth22gt13 = INITVALUE; + CCTK_REAL PDstandardNth33gt13 = INITVALUE; + CCTK_REAL PDstandardNth12gt13 = INITVALUE; + CCTK_REAL PDstandardNth13gt13 = INITVALUE; + CCTK_REAL PDstandardNth21gt13 = INITVALUE; + CCTK_REAL PDstandardNth23gt13 = INITVALUE; + CCTK_REAL PDstandardNth31gt13 = INITVALUE; + CCTK_REAL PDstandardNth32gt13 = INITVALUE; + CCTK_REAL PDstandardNth1gt22 = INITVALUE; + CCTK_REAL PDstandardNth2gt22 = INITVALUE; + CCTK_REAL PDstandardNth3gt22 = INITVALUE; + CCTK_REAL PDstandardNth11gt22 = INITVALUE; + CCTK_REAL PDstandardNth22gt22 = INITVALUE; + CCTK_REAL PDstandardNth33gt22 = INITVALUE; + CCTK_REAL PDstandardNth12gt22 = INITVALUE; + CCTK_REAL PDstandardNth13gt22 = INITVALUE; + CCTK_REAL PDstandardNth21gt22 = INITVALUE; + CCTK_REAL PDstandardNth23gt22 = INITVALUE; + CCTK_REAL PDstandardNth31gt22 = INITVALUE; + CCTK_REAL PDstandardNth32gt22 = INITVALUE; + CCTK_REAL PDstandardNth1gt23 = INITVALUE; + CCTK_REAL PDstandardNth2gt23 = INITVALUE; + CCTK_REAL PDstandardNth3gt23 = INITVALUE; + CCTK_REAL PDstandardNth11gt23 = INITVALUE; + CCTK_REAL PDstandardNth22gt23 = INITVALUE; + CCTK_REAL PDstandardNth33gt23 = INITVALUE; + CCTK_REAL PDstandardNth12gt23 = INITVALUE; + CCTK_REAL PDstandardNth13gt23 = INITVALUE; + CCTK_REAL PDstandardNth21gt23 = INITVALUE; + CCTK_REAL PDstandardNth23gt23 = INITVALUE; + CCTK_REAL PDstandardNth31gt23 = INITVALUE; + CCTK_REAL PDstandardNth32gt23 = INITVALUE; + CCTK_REAL PDstandardNth1gt33 = INITVALUE; + CCTK_REAL PDstandardNth2gt33 = INITVALUE; + CCTK_REAL PDstandardNth3gt33 = INITVALUE; + CCTK_REAL PDstandardNth11gt33 = INITVALUE; + CCTK_REAL PDstandardNth22gt33 = INITVALUE; + CCTK_REAL PDstandardNth33gt33 = INITVALUE; + CCTK_REAL PDstandardNth12gt33 = INITVALUE; + CCTK_REAL PDstandardNth13gt33 = INITVALUE; + CCTK_REAL PDstandardNth21gt33 = INITVALUE; + CCTK_REAL PDstandardNth23gt33 = INITVALUE; + CCTK_REAL PDstandardNth31gt33 = INITVALUE; + CCTK_REAL PDstandardNth32gt33 = INITVALUE; + CCTK_REAL PDstandardNth1phi = INITVALUE; + CCTK_REAL PDstandardNth2phi = INITVALUE; + CCTK_REAL PDstandardNth3phi = INITVALUE; + CCTK_REAL PDstandardNth11phi = INITVALUE; + CCTK_REAL PDstandardNth22phi = INITVALUE; + CCTK_REAL PDstandardNth33phi = INITVALUE; + CCTK_REAL PDstandardNth12phi = INITVALUE; + CCTK_REAL PDstandardNth13phi = INITVALUE; + CCTK_REAL PDstandardNth21phi = INITVALUE; + CCTK_REAL PDstandardNth23phi = INITVALUE; + CCTK_REAL PDstandardNth31phi = INITVALUE; + CCTK_REAL PDstandardNth32phi = INITVALUE; + CCTK_REAL PDstandardNth1trK = INITVALUE; + CCTK_REAL PDstandardNth2trK = INITVALUE; + CCTK_REAL PDstandardNth3trK = INITVALUE; + CCTK_REAL PDstandardNth1Xt1 = INITVALUE; + CCTK_REAL PDstandardNth2Xt1 = INITVALUE; + CCTK_REAL PDstandardNth3Xt1 = INITVALUE; + CCTK_REAL PDstandardNth1Xt2 = INITVALUE; + CCTK_REAL PDstandardNth2Xt2 = INITVALUE; + CCTK_REAL PDstandardNth3Xt2 = INITVALUE; + CCTK_REAL PDstandardNth1Xt3 = INITVALUE; + CCTK_REAL PDstandardNth2Xt3 = INITVALUE; + CCTK_REAL PDstandardNth3Xt3 = INITVALUE; + + /* Assign local copies of grid functions */ + AL = A[index]; + alphaL = alpha[index]; + At11L = At11[index]; + At12L = At12[index]; + At13L = At13[index]; + At22L = At22[index]; + At23L = At23[index]; + At33L = At33[index]; + B1L = B1[index]; + B2L = B2[index]; + B3L = B3[index]; + beta1L = beta1[index]; + beta2L = beta2[index]; + beta3L = beta3[index]; + dJ111L = dJ111[index]; + dJ112L = dJ112[index]; + dJ113L = dJ113[index]; + dJ122L = dJ122[index]; + dJ123L = dJ123[index]; + dJ133L = dJ133[index]; + dJ211L = dJ211[index]; + dJ212L = dJ212[index]; + dJ213L = dJ213[index]; + dJ222L = dJ222[index]; + dJ223L = dJ223[index]; + dJ233L = dJ233[index]; + dJ311L = dJ311[index]; + dJ312L = dJ312[index]; + dJ313L = dJ313[index]; + dJ322L = dJ322[index]; + dJ323L = dJ323[index]; + dJ333L = dJ333[index]; + eTttL = eTtt[index]; + eTtxL = eTtx[index]; + eTtyL = eTty[index]; + eTtzL = eTtz[index]; + eTxxL = eTxx[index]; + eTxyL = eTxy[index]; + eTxzL = eTxz[index]; + eTyyL = eTyy[index]; + eTyzL = eTyz[index]; + eTzzL = eTzz[index]; + gt11L = gt11[index]; + gt12L = gt12[index]; + gt13L = gt13[index]; + gt22L = gt22[index]; + gt23L = gt23[index]; + gt33L = gt33[index]; + J11L = J11[index]; + J12L = J12[index]; + J13L = J13[index]; + J21L = J21[index]; + J22L = J22[index]; + J23L = J23[index]; + J31L = J31[index]; + J32L = J32[index]; + J33L = J33[index]; + phiL = phi[index]; + trKL = trK[index]; + trKrhsL = trKrhs[index]; + Xt1L = Xt1[index]; + Xt1rhsL = Xt1rhs[index]; + Xt2L = Xt2[index]; + Xt2rhsL = Xt2rhs[index]; + Xt3L = Xt3[index]; + Xt3rhsL = Xt3rhs[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + PDstandardNth1alpha = PDstandardNth1(alpha, i, j, k); + PDstandardNth2alpha = PDstandardNth2(alpha, i, j, k); + PDstandardNth3alpha = PDstandardNth3(alpha, i, j, k); + PDstandardNth11alpha = PDstandardNth11(alpha, i, j, k); + PDstandardNth22alpha = PDstandardNth22(alpha, i, j, k); + PDstandardNth33alpha = PDstandardNth33(alpha, i, j, k); + PDstandardNth12alpha = PDstandardNth12(alpha, i, j, k); + PDstandardNth13alpha = PDstandardNth13(alpha, i, j, k); + PDstandardNth23alpha = PDstandardNth23(alpha, i, j, k); + PDstandardNth1At11 = PDstandardNth1(At11, i, j, k); + PDstandardNth2At11 = PDstandardNth2(At11, i, j, k); + PDstandardNth3At11 = PDstandardNth3(At11, i, j, k); + PDstandardNth1At12 = PDstandardNth1(At12, i, j, k); + PDstandardNth2At12 = PDstandardNth2(At12, i, j, k); + PDstandardNth3At12 = PDstandardNth3(At12, i, j, k); + PDstandardNth1At13 = PDstandardNth1(At13, i, j, k); + PDstandardNth2At13 = PDstandardNth2(At13, i, j, k); + PDstandardNth3At13 = PDstandardNth3(At13, i, j, k); + PDstandardNth1At22 = PDstandardNth1(At22, i, j, k); + PDstandardNth2At22 = PDstandardNth2(At22, i, j, k); + PDstandardNth3At22 = PDstandardNth3(At22, i, j, k); + PDstandardNth1At23 = PDstandardNth1(At23, i, j, k); + PDstandardNth2At23 = PDstandardNth2(At23, i, j, k); + PDstandardNth3At23 = PDstandardNth3(At23, i, j, k); + PDstandardNth1At33 = PDstandardNth1(At33, i, j, k); + PDstandardNth2At33 = PDstandardNth2(At33, i, j, k); + PDstandardNth3At33 = PDstandardNth3(At33, i, j, k); + PDstandardNth1B1 = PDstandardNth1(B1, i, j, k); + PDstandardNth2B1 = PDstandardNth2(B1, i, j, k); + PDstandardNth3B1 = PDstandardNth3(B1, i, j, k); + PDstandardNth1B2 = PDstandardNth1(B2, i, j, k); + PDstandardNth2B2 = PDstandardNth2(B2, i, j, k); + PDstandardNth3B2 = PDstandardNth3(B2, i, j, k); + PDstandardNth1B3 = PDstandardNth1(B3, i, j, k); + PDstandardNth2B3 = PDstandardNth2(B3, i, j, k); + PDstandardNth3B3 = PDstandardNth3(B3, i, j, k); + PDstandardNth1beta1 = PDstandardNth1(beta1, i, j, k); + PDstandardNth2beta1 = PDstandardNth2(beta1, i, j, k); + PDstandardNth3beta1 = PDstandardNth3(beta1, i, j, k); + PDstandardNth11beta1 = PDstandardNth11(beta1, i, j, k); + PDstandardNth22beta1 = PDstandardNth22(beta1, i, j, k); + PDstandardNth33beta1 = PDstandardNth33(beta1, i, j, k); + PDstandardNth12beta1 = PDstandardNth12(beta1, i, j, k); + PDstandardNth13beta1 = PDstandardNth13(beta1, i, j, k); + PDstandardNth23beta1 = PDstandardNth23(beta1, i, j, k); + PDstandardNth1beta2 = PDstandardNth1(beta2, i, j, k); + PDstandardNth2beta2 = PDstandardNth2(beta2, i, j, k); + PDstandardNth3beta2 = PDstandardNth3(beta2, i, j, k); + PDstandardNth11beta2 = PDstandardNth11(beta2, i, j, k); + PDstandardNth22beta2 = PDstandardNth22(beta2, i, j, k); + PDstandardNth33beta2 = PDstandardNth33(beta2, i, j, k); + PDstandardNth12beta2 = PDstandardNth12(beta2, i, j, k); + PDstandardNth13beta2 = PDstandardNth13(beta2, i, j, k); + PDstandardNth23beta2 = PDstandardNth23(beta2, i, j, k); + PDstandardNth1beta3 = PDstandardNth1(beta3, i, j, k); + PDstandardNth2beta3 = PDstandardNth2(beta3, i, j, k); + PDstandardNth3beta3 = PDstandardNth3(beta3, i, j, k); + PDstandardNth11beta3 = PDstandardNth11(beta3, i, j, k); + PDstandardNth22beta3 = PDstandardNth22(beta3, i, j, k); + PDstandardNth33beta3 = PDstandardNth33(beta3, i, j, k); + PDstandardNth12beta3 = PDstandardNth12(beta3, i, j, k); + PDstandardNth13beta3 = PDstandardNth13(beta3, i, j, k); + PDstandardNth23beta3 = PDstandardNth23(beta3, i, j, k); + PDstandardNth1gt11 = PDstandardNth1(gt11, i, j, k); + PDstandardNth2gt11 = PDstandardNth2(gt11, i, j, k); + PDstandardNth3gt11 = PDstandardNth3(gt11, i, j, k); + PDstandardNth11gt11 = PDstandardNth11(gt11, i, j, k); + PDstandardNth22gt11 = PDstandardNth22(gt11, i, j, k); + PDstandardNth33gt11 = PDstandardNth33(gt11, i, j, k); + PDstandardNth12gt11 = PDstandardNth12(gt11, i, j, k); + PDstandardNth13gt11 = PDstandardNth13(gt11, i, j, k); + PDstandardNth23gt11 = PDstandardNth23(gt11, i, j, k); + PDstandardNth1gt12 = PDstandardNth1(gt12, i, j, k); + PDstandardNth2gt12 = PDstandardNth2(gt12, i, j, k); + PDstandardNth3gt12 = PDstandardNth3(gt12, i, j, k); + PDstandardNth11gt12 = PDstandardNth11(gt12, i, j, k); + PDstandardNth22gt12 = PDstandardNth22(gt12, i, j, k); + PDstandardNth33gt12 = PDstandardNth33(gt12, i, j, k); + PDstandardNth12gt12 = PDstandardNth12(gt12, i, j, k); + PDstandardNth13gt12 = PDstandardNth13(gt12, i, j, k); + PDstandardNth23gt12 = PDstandardNth23(gt12, i, j, k); + PDstandardNth1gt13 = PDstandardNth1(gt13, i, j, k); + PDstandardNth2gt13 = PDstandardNth2(gt13, i, j, k); + PDstandardNth3gt13 = PDstandardNth3(gt13, i, j, k); + PDstandardNth11gt13 = PDstandardNth11(gt13, i, j, k); + PDstandardNth22gt13 = PDstandardNth22(gt13, i, j, k); + PDstandardNth33gt13 = PDstandardNth33(gt13, i, j, k); + PDstandardNth12gt13 = PDstandardNth12(gt13, i, j, k); + PDstandardNth13gt13 = PDstandardNth13(gt13, i, j, k); + PDstandardNth23gt13 = PDstandardNth23(gt13, i, j, k); + PDstandardNth1gt22 = PDstandardNth1(gt22, i, j, k); + PDstandardNth2gt22 = PDstandardNth2(gt22, i, j, k); + PDstandardNth3gt22 = PDstandardNth3(gt22, i, j, k); + PDstandardNth11gt22 = PDstandardNth11(gt22, i, j, k); + PDstandardNth22gt22 = PDstandardNth22(gt22, i, j, k); + PDstandardNth33gt22 = PDstandardNth33(gt22, i, j, k); + PDstandardNth12gt22 = PDstandardNth12(gt22, i, j, k); + PDstandardNth13gt22 = PDstandardNth13(gt22, i, j, k); + PDstandardNth23gt22 = PDstandardNth23(gt22, i, j, k); + PDstandardNth1gt23 = PDstandardNth1(gt23, i, j, k); + PDstandardNth2gt23 = PDstandardNth2(gt23, i, j, k); + PDstandardNth3gt23 = PDstandardNth3(gt23, i, j, k); + PDstandardNth11gt23 = PDstandardNth11(gt23, i, j, k); + PDstandardNth22gt23 = PDstandardNth22(gt23, i, j, k); + PDstandardNth33gt23 = PDstandardNth33(gt23, i, j, k); + PDstandardNth12gt23 = PDstandardNth12(gt23, i, j, k); + PDstandardNth13gt23 = PDstandardNth13(gt23, i, j, k); + PDstandardNth23gt23 = PDstandardNth23(gt23, i, j, k); + PDstandardNth1gt33 = PDstandardNth1(gt33, i, j, k); + PDstandardNth2gt33 = PDstandardNth2(gt33, i, j, k); + PDstandardNth3gt33 = PDstandardNth3(gt33, i, j, k); + PDstandardNth11gt33 = PDstandardNth11(gt33, i, j, k); + PDstandardNth22gt33 = PDstandardNth22(gt33, i, j, k); + PDstandardNth33gt33 = PDstandardNth33(gt33, i, j, k); + PDstandardNth12gt33 = PDstandardNth12(gt33, i, j, k); + PDstandardNth13gt33 = PDstandardNth13(gt33, i, j, k); + PDstandardNth23gt33 = PDstandardNth23(gt33, i, j, k); + PDstandardNth1phi = PDstandardNth1(phi, i, j, k); + PDstandardNth2phi = PDstandardNth2(phi, i, j, k); + PDstandardNth3phi = PDstandardNth3(phi, i, j, k); + PDstandardNth11phi = PDstandardNth11(phi, i, j, k); + PDstandardNth22phi = PDstandardNth22(phi, i, j, k); + PDstandardNth33phi = PDstandardNth33(phi, i, j, k); + PDstandardNth12phi = PDstandardNth12(phi, i, j, k); + PDstandardNth13phi = PDstandardNth13(phi, i, j, k); + PDstandardNth23phi = PDstandardNth23(phi, i, j, k); + PDstandardNth1trK = PDstandardNth1(trK, i, j, k); + PDstandardNth2trK = PDstandardNth2(trK, i, j, k); + PDstandardNth3trK = PDstandardNth3(trK, i, j, k); + PDstandardNth1Xt1 = PDstandardNth1(Xt1, i, j, k); + PDstandardNth2Xt1 = PDstandardNth2(Xt1, i, j, k); + PDstandardNth3Xt1 = PDstandardNth3(Xt1, i, j, k); + PDstandardNth1Xt2 = PDstandardNth1(Xt2, i, j, k); + PDstandardNth2Xt2 = PDstandardNth2(Xt2, i, j, k); + PDstandardNth3Xt2 = PDstandardNth3(Xt2, i, j, k); + PDstandardNth1Xt3 = PDstandardNth1(Xt3, i, j, k); + PDstandardNth2Xt3 = PDstandardNth2(Xt3, i, j, k); + PDstandardNth3Xt3 = PDstandardNth3(Xt3, i, j, k); + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + detgt = 1; + + gtu11 = INV(detgt)*(gt22L*gt33L - SQR(gt23L)); + + gtu21 = (gt13L*gt23L - gt12L*gt33L)*INV(detgt); + + gtu31 = (-(gt13L*gt22L) + gt12L*gt23L)*INV(detgt); + + gtu22 = INV(detgt)*(gt11L*gt33L - SQR(gt13L)); + + gtu32 = (gt12L*gt13L - gt11L*gt23L)*INV(detgt); + + gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); + + Gt111 = khalf*((gtu11*J11L - gtu21*J12L - gtu31*J13L)*PDstandardNth1gt11 + + (gtu11*J21L - gtu21*J22L - gtu31*J23L)*PDstandardNth2gt11 + + (gtu11*J31L - gtu21*J32L - gtu31*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) + + J21L*(gtu21*PDstandardNth2gt12 + gtu31*PDstandardNth2gt13) + + J31L*(gtu21*PDstandardNth3gt12 + gtu31*PDstandardNth3gt13))); + + Gt211 = khalf*((gtu21*J11L - gtu22*J12L - gtu32*J13L)*PDstandardNth1gt11 + + (gtu21*J21L - gtu22*J22L - gtu32*J23L)*PDstandardNth2gt11 + + (gtu21*J31L - gtu22*J32L - gtu32*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) + + J21L*(gtu22*PDstandardNth2gt12 + gtu32*PDstandardNth2gt13) + + J31L*(gtu22*PDstandardNth3gt12 + gtu32*PDstandardNth3gt13))); + + Gt311 = khalf*((gtu31*J11L - gtu32*J12L - gtu33*J13L)*PDstandardNth1gt11 + + (gtu31*J21L - gtu32*J22L - gtu33*J23L)*PDstandardNth2gt11 + + (gtu31*J31L - gtu32*J32L - gtu33*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) + + J21L*(gtu32*PDstandardNth2gt12 + gtu33*PDstandardNth2gt13) + + J31L*(gtu32*PDstandardNth3gt12 + gtu33*PDstandardNth3gt13))); + + Gt112 = khalf*(gtu11*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu21*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu31*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt212 = khalf*(gtu21*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu22*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu32*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt312 = khalf*(gtu31*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu32*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu33*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt113 = khalf*(gtu11*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu21*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu31*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt213 = khalf*(gtu21*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu22*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu32*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt313 = khalf*(gtu31*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu32*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu33*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt122 = khalf*(gtu11*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu21*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu31*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt222 = khalf*(gtu21*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu22*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu32*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt322 = khalf*(gtu31*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu32*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu33*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt123 = khalf*(gtu21*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu11*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu31*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt223 = khalf*(gtu22*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu21*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu32*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt323 = khalf*(gtu32*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu31*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu33*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt133 = khalf*(gtu11*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu21*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu31*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Gt233 = khalf*(gtu21*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu22*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu32*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Gt333 = khalf*(gtu31*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu32*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu33*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Xtn1 = Gt111*gtu11 + Gt122*gtu22 + + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33; + + Xtn2 = Gt211*gtu11 + Gt222*gtu22 + + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33; + + Xtn3 = Gt311*gtu11 + Gt322*gtu22 + + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33; + + Rt11 = (Gt113*(gt13L*Gt312 + 3*(gt12L*Gt212 + gt13L*Gt312)) + + gt12L*(Gt213*(4*Gt112 + 2*Gt222) + Gt212*(Gt113 + 2*Gt223) + + 2*(Gt233*Gt312 + Gt223*Gt313)) + + gt11L*(6*Gt112*Gt113 + 2*(Gt122*Gt213 + Gt133*Gt312 + + Gt123*(Gt212 + Gt313))) + + gt13L*(2*Gt213*Gt322 + Gt313*(4*Gt112 + 2*Gt323)) + + 2*(Gt213*(Gt212*gt22L + gt23L*Gt312) + + Gt212*(gt23L*Gt313 + gt13L*Gt323) + Gt312*(gt13L*Gt333 + Gt313*gt33L)) + )*gtu32 + J11L*(gt11L*PDstandardNth1Xt1 + gt12L*PDstandardNth1Xt2 + + gt13L*PDstandardNth1Xt3) + + J21L*(gt11L*PDstandardNth2Xt1 + gt12L*PDstandardNth2Xt2 + + gt13L*PDstandardNth2Xt3) + + J31L*(gt11L*PDstandardNth3Xt1 + gt12L*PDstandardNth3Xt2 + + gt13L*PDstandardNth3Xt3) + + (Gt111*gt11L + gt12L*Gt211 + gt13L*Gt311)*Xtn1 + + (Gt112*gt11L + gt12L*Gt212 + gt13L*Gt312)*Xtn2 + + (Gt113*gt11L + gt12L*Gt213 + gt13L*Gt313)*Xtn3 + + gtu21*(Gt112*(gt13L*Gt311 + 3*(gt12L*Gt211 + gt13L*Gt311)) + + gt11L*(Gt112*(6*Gt111 + 2*Gt212) + + 2*(Gt122*Gt211 + Gt123*Gt311 + Gt113*Gt312)) + + 2*(Gt212*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + + gt13L*(Gt211*Gt322 + Gt311*Gt323)) + + Gt312*(gt13L*(4*Gt111 + 2*Gt313) + 2*(Gt211*gt23L + Gt311*gt33L)) + + gt12L*(4*Gt111*Gt212 + Gt211*(Gt112 + 2*Gt222) + + 2*(Gt223*Gt311 + Gt213*Gt312 + SQR(Gt212)))) + + gtu11*(4*Gt111*(gt12L*Gt211 + gt13L*Gt311) + + 2*(gt12L*(Gt211*Gt212 + Gt213*Gt311) + + Gt211*(gt23L*Gt311 + gt13L*Gt312) + gt13L*Gt311*Gt313) + + gt11L*(2*(Gt112*Gt211 + Gt113*Gt311) + 3*SQR(Gt111)) + + gt22L*SQR(Gt211) + gt33L*SQR(Gt311)) + + gtu22*(4*Gt112*(gt12L*Gt212 + gt13L*Gt312) + + 2*(gt12L*(Gt212*Gt222 + Gt223*Gt312) + + Gt212*(gt23L*Gt312 + gt13L*Gt322) + gt13L*Gt312*Gt323) + + gt11L*(2*(Gt122*Gt212 + Gt123*Gt312) + 3*SQR(Gt112)) + + gt22L*SQR(Gt212) + gt33L*SQR(Gt312)) + + gtu33*(4*Gt113*(gt12L*Gt213 + gt13L*Gt313) + + 2*(gt12L*(Gt213*Gt223 + Gt233*Gt313) + + Gt213*(gt23L*Gt313 + gt13L*Gt323) + gt13L*Gt313*Gt333) + + gt11L*(2*(Gt123*Gt213 + Gt133*Gt313) + 3*SQR(Gt113)) + + gt22L*SQR(Gt213) + gt33L*SQR(Gt313)) + + gtu31*(Gt113*(gt13L*Gt311 + 3*(gt12L*Gt211 + gt13L*Gt311)) + + gt11L*(2*(Gt123*Gt211 + Gt112*Gt213 + Gt133*Gt311) + + Gt113*(6*Gt111 + 2*Gt313)) + + gt12L*(Gt211*(Gt113 + 2*Gt223) + 2*Gt233*Gt311 + + Gt213*(4*Gt111 + 2*(Gt212 + Gt313))) + + 2*(Gt213*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + gt13L*Gt311*Gt333 + + Gt313*(Gt211*gt23L + Gt311*gt33L)) + + gt13L*(4*Gt111*Gt313 + 2*(Gt211*Gt323 + SQR(Gt313)))) + + khalf*(-2*(gtu21*(J11L*J12L*PDstandardNth11gt11 + + J12L*J21L*PDstandardNth12gt11 + J11L*J22L*PDstandardNth12gt11 + + J12L*J31L*PDstandardNth13gt11 + J11L*J32L*PDstandardNth13gt11 + + dJ112L*PDstandardNth1gt11 + J21L*J22L*PDstandardNth22gt11 + + J22L*J31L*PDstandardNth23gt11 + J21L*J32L*PDstandardNth23gt11 + + dJ212L*PDstandardNth2gt11 + J31L*J32L*PDstandardNth33gt11 + + dJ312L*PDstandardNth3gt11) + + gtu31*(J11L*J13L*PDstandardNth11gt11 + + J13L*J21L*PDstandardNth12gt11 + J11L*J23L*PDstandardNth12gt11 + + J13L*J31L*PDstandardNth13gt11 + J11L*J33L*PDstandardNth13gt11 + + dJ113L*PDstandardNth1gt11 + J21L*J23L*PDstandardNth22gt11 + + J23L*J31L*PDstandardNth23gt11 + J21L*J33L*PDstandardNth23gt11 + + dJ213L*PDstandardNth2gt11 + J31L*J33L*PDstandardNth33gt11 + + dJ313L*PDstandardNth3gt11) + + gtu32*(J12L*J13L*PDstandardNth11gt11 + + J13L*J22L*PDstandardNth12gt11 + J12L*J23L*PDstandardNth12gt11 + + J13L*J32L*PDstandardNth13gt11 + J12L*J33L*PDstandardNth13gt11 + + dJ123L*PDstandardNth1gt11 + J22L*J23L*PDstandardNth22gt11 + + J23L*J32L*PDstandardNth23gt11 + J22L*J33L*PDstandardNth23gt11 + + dJ223L*PDstandardNth2gt11 + J32L*J33L*PDstandardNth33gt11 + + dJ323L*PDstandardNth3gt11)) - + gtu11*(2*J11L*J21L*PDstandardNth12gt11 + + 2*J11L*J31L*PDstandardNth13gt11 + dJ111L*PDstandardNth1gt11 + + 2*J21L*J31L*PDstandardNth23gt11 + dJ211L*PDstandardNth2gt11 + + dJ311L*PDstandardNth3gt11 + PDstandardNth11gt11*SQR(J11L) + + PDstandardNth22gt11*SQR(J21L) + PDstandardNth33gt11*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt11 + + 2*J12L*J32L*PDstandardNth13gt11 + dJ122L*PDstandardNth1gt11 + + 2*J22L*J32L*PDstandardNth23gt11 + dJ222L*PDstandardNth2gt11 + + dJ322L*PDstandardNth3gt11 + PDstandardNth11gt11*SQR(J12L) + + PDstandardNth22gt11*SQR(J22L) + PDstandardNth33gt11*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt11 + + 2*J13L*J33L*PDstandardNth13gt11 + dJ133L*PDstandardNth1gt11 + + 2*J23L*J33L*PDstandardNth23gt11 + dJ233L*PDstandardNth2gt11 + + dJ333L*PDstandardNth3gt11 + PDstandardNth11gt11*SQR(J13L) + + PDstandardNth22gt11*SQR(J23L) + PDstandardNth33gt11*SQR(J33L))); + + Rt12 = khalf*((gt12L*J11L + gt11L*J12L)*PDstandardNth1Xt1 + + (gt22L*J11L + gt12L*J12L)*PDstandardNth1Xt2 + + (gt23L*J11L + gt13L*J12L)*PDstandardNth1Xt3 + + (gt12L*J21L + gt11L*J22L)*PDstandardNth2Xt1 + + (gt22L*J21L + gt12L*J22L)*PDstandardNth2Xt2 + + (gt23L*J21L + gt13L*J22L)*PDstandardNth2Xt3 - + 2*(gtu21*(J11L*J12L*PDstandardNth11gt12 + J12L*J21L*PDstandardNth12gt12 + + J11L*J22L*PDstandardNth12gt12 + J12L*J31L*PDstandardNth13gt12 + + J11L*J32L*PDstandardNth13gt12 + dJ112L*PDstandardNth1gt12 + + J21L*J22L*PDstandardNth22gt12 + J22L*J31L*PDstandardNth23gt12 + + J21L*J32L*PDstandardNth23gt12 + dJ212L*PDstandardNth2gt12 + + J31L*J32L*PDstandardNth33gt12 + dJ312L*PDstandardNth3gt12) + + gtu31*(J11L*J13L*PDstandardNth11gt12 + J13L*J21L*PDstandardNth12gt12 + + J11L*J23L*PDstandardNth12gt12 + J13L*J31L*PDstandardNth13gt12 + + J11L*J33L*PDstandardNth13gt12 + dJ113L*PDstandardNth1gt12 + + J21L*J23L*PDstandardNth22gt12 + J23L*J31L*PDstandardNth23gt12 + + J21L*J33L*PDstandardNth23gt12 + dJ213L*PDstandardNth2gt12 + + J31L*J33L*PDstandardNth33gt12 + dJ313L*PDstandardNth3gt12) + + gtu32*(J12L*J13L*PDstandardNth11gt12 + J13L*J22L*PDstandardNth12gt12 + + J12L*J23L*PDstandardNth12gt12 + J13L*J32L*PDstandardNth13gt12 + + J12L*J33L*PDstandardNth13gt12 + dJ123L*PDstandardNth1gt12 + + J22L*J23L*PDstandardNth22gt12 + J23L*J32L*PDstandardNth23gt12 + + J22L*J33L*PDstandardNth23gt12 + dJ223L*PDstandardNth2gt12 + + J32L*J33L*PDstandardNth33gt12 + dJ323L*PDstandardNth3gt12)) + + (gt12L*J31L + gt11L*J32L)*PDstandardNth3Xt1 + + (gt22L*J31L + gt12L*J32L)*PDstandardNth3Xt2 + + (gt23L*J31L + gt13L*J32L)*PDstandardNth3Xt3 + + (Gt112*gt11L + Gt111*gt12L + gt12L*Gt212 + Gt211*gt22L + gt23L*Gt311 + + gt13L*Gt312)*Xtn1 + (gt11L*Gt122 + Gt112*gt12L + gt12L*Gt222 + + Gt212*gt22L + gt23L*Gt312 + gt13L*Gt322)*Xtn2 + + (gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + + gt13L*Gt323)*Xtn3 + 2*((Gt123*gt12L*Gt211 + Gt113*gt12L*Gt212 + + 2*Gt112*gt12L*Gt213 + gt12L*Gt212*Gt223 + Gt212*Gt213*gt22L + + Gt211*Gt223*gt22L + gt12L*Gt133*Gt311 + gt22L*Gt233*Gt311 + + Gt113*gt13L*Gt312 + gt12L*Gt233*Gt312 + Gt213*gt23L*Gt312 + + gt11L*(2*Gt112*Gt113 + Gt123*Gt212 + Gt133*Gt312) + + 2*Gt112*gt13L*Gt313 + Gt212*gt23L*Gt313 + + Gt111*(Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + + gt13L*Gt212*Gt323 + Gt211*gt23L*Gt323 + gt23L*Gt311*Gt333 + + gt13L*Gt312*Gt333 + Gt312*Gt313*gt33L)*gtu31 + + (Gt123*gt12L*Gt212 + 2*Gt122*gt12L*Gt213 + Gt113*gt12L*Gt222 + + gt12L*Gt222*Gt223 + Gt213*Gt222*gt22L + Gt212*Gt223*gt22L + + gt12L*Gt133*Gt312 + gt22L*Gt233*Gt312 + 2*Gt122*gt13L*Gt313 + + Gt222*gt23L*Gt313 + Gt112* + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + Gt113*gt13L*Gt322 + + gt12L*Gt233*Gt322 + Gt213*gt23L*Gt322 + + gt11L*(2*Gt113*Gt122 + Gt123*Gt222 + Gt133*Gt322) + + gt13L*Gt222*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt312*Gt333 + + gt13L*Gt322*Gt333 + Gt313*Gt322*gt33L)*gtu32 + + gtu11*(3*Gt112*gt12L*Gt211 + 2*Gt211*Gt212*gt22L + Gt113*gt12L*Gt311 + + 2*Gt112*gt13L*Gt311 + Gt213*gt22L*Gt311 + Gt212*gt23L*Gt311 + + gt13L*Gt212*Gt312 + gt12L*Gt213*Gt312 + 2*Gt211*gt23L*Gt312 + + gt11L*(2*Gt111*Gt112 + Gt112*Gt212 + Gt113*Gt312) + + Gt111*(gt12L*Gt212 + Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + + gt23L*Gt311*Gt313 + gt13L*Gt312*Gt313 + Gt311*Gt312*gt33L + + gt12L*SQR(Gt111) + gt12L*SQR(Gt212)) + + gtu21*(Gt112*gt11L*Gt222 + Gt112*Gt211*gt22L + Gt211*Gt222*gt22L + + 2*Gt122*gt13L*Gt311 + Gt112*gt23L*Gt311 + Gt222*gt23L*Gt311 + + gt13L*Gt222*Gt312 + Gt213*gt22L*Gt312 + Gt212*gt23L*Gt312 + + gt23L*Gt312*Gt313 + Gt113*gt11L*Gt322 + Gt211*gt23L*Gt322 + + gt13L*Gt313*Gt322 + Gt111* + (2*gt11L*Gt122 + Gt112*gt12L + gt12L*Gt222 + gt13L*Gt322) + + gt12L*(2*Gt122*Gt211 + Gt112*Gt212 + Gt212*Gt222 + Gt113*Gt312 + + Gt213*Gt322) + Gt311*Gt322*gt33L + gt22L*SQR(Gt212)) + + gtu22*(gt11L*Gt122*Gt222 + 2*Gt212*Gt222*gt22L + 2*Gt122*gt13L*Gt312 + + Gt223*gt22L*Gt312 + Gt222*gt23L*Gt312 + gt11L*Gt123*Gt322 + + gt13L*Gt222*Gt322 + 2*Gt212*gt23L*Gt322 + + Gt112*(2*gt11L*Gt122 + gt12L*Gt222 + Gt212*gt22L + gt23L*Gt312 + + gt13L*Gt322) + gt23L*Gt312*Gt323 + gt13L*Gt322*Gt323 + + Gt312*Gt322*gt33L + gt12L*SQR(Gt112) + + gt12L*(3*Gt122*Gt212 + Gt123*Gt312 + Gt223*Gt322 + SQR(Gt222))) + + gtu33*(gt11L*Gt123*Gt223 + 2*Gt213*Gt223*gt22L + 2*Gt123*gt13L*Gt313 + + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + gt11L*Gt133*Gt323 + + gt13L*Gt223*Gt323 + 2*Gt213*gt23L*Gt323 + + Gt113*(2*gt11L*Gt123 + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + + gt13L*Gt323) + gt23L*Gt313*Gt333 + gt13L*Gt323*Gt333 + + Gt313*Gt323*gt33L + gt12L*SQR(Gt113) + + gt12L*(3*Gt123*Gt213 + Gt133*Gt313 + Gt233*Gt323 + SQR(Gt223))) + + gtu21*(Gt122*gt12L*Gt211 + 3*Gt112*gt12L*Gt212 + gt12L*Gt212*Gt222 + + Gt211*Gt222*gt22L + Gt123*gt12L*Gt311 + Gt223*gt22L*Gt311 + + 3*Gt112*gt13L*Gt312 + gt12L*Gt223*Gt312 + 2*Gt212*gt23L*Gt312 + + Gt111*(Gt112*gt12L + Gt212*gt22L + gt23L*Gt312) + + gt13L*Gt212*Gt322 + Gt211*gt23L*Gt322 + gt23L*Gt311*Gt323 + + gt13L*Gt312*Gt323 + gt11L* + (Gt122*Gt212 + Gt123*Gt312 + 2*SQR(Gt112)) + gt22L*SQR(Gt212) + + gt33L*SQR(Gt312)) + gtu31* + (Gt112*gt11L*Gt223 + Gt113*Gt211*gt22L + Gt212*Gt213*gt22L + + Gt211*Gt223*gt22L + 2*Gt123*gt13L*Gt311 + Gt113*gt23L*Gt311 + + Gt223*gt23L*Gt311 + gt13L*Gt223*Gt312 + Gt213*gt23L*Gt312 + + Gt213*gt22L*Gt313 + Gt113*gt11L*Gt323 + Gt211*gt23L*Gt323 + + gt13L*Gt313*Gt323 + Gt111* + (2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + + gt12L*(2*Gt123*Gt211 + Gt112*Gt213 + Gt212*Gt223 + Gt113*Gt313 + + Gt213*Gt323) + Gt311*Gt323*gt33L + gt23L*SQR(Gt313)) + + gtu32*(gt11L*Gt122*Gt223 + Gt113*Gt212*gt22L + Gt213*Gt222*gt22L + + Gt212*Gt223*gt22L + 2*Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + + Gt223*gt23L*Gt312 + Gt223*gt22L*Gt313 + gt13L*Gt223*Gt322 + + Gt213*gt23L*Gt322 + gt11L*Gt123*Gt323 + Gt212*gt23L*Gt323 + + gt23L*Gt313*Gt323 + Gt112* + (2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + + gt12L*(Gt122*Gt213 + Gt123*(2*Gt212 + Gt313) + + Gt223*(Gt222 + Gt323)) + Gt312*Gt323*gt33L + gt13L*SQR(Gt323)))\ + - gtu11*(2*J11L*J21L*PDstandardNth12gt12 + + 2*J11L*J31L*PDstandardNth13gt12 + dJ111L*PDstandardNth1gt12 + + 2*J21L*J31L*PDstandardNth23gt12 + dJ211L*PDstandardNth2gt12 + + dJ311L*PDstandardNth3gt12 + PDstandardNth11gt12*SQR(J11L) + + PDstandardNth22gt12*SQR(J21L) + PDstandardNth33gt12*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt12 + + 2*J12L*J32L*PDstandardNth13gt12 + dJ122L*PDstandardNth1gt12 + + 2*J22L*J32L*PDstandardNth23gt12 + dJ222L*PDstandardNth2gt12 + + dJ322L*PDstandardNth3gt12 + PDstandardNth11gt12*SQR(J12L) + + PDstandardNth22gt12*SQR(J22L) + PDstandardNth33gt12*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt12 + + 2*J13L*J33L*PDstandardNth13gt12 + dJ133L*PDstandardNth1gt12 + + 2*J23L*J33L*PDstandardNth23gt12 + dJ233L*PDstandardNth2gt12 + + dJ333L*PDstandardNth3gt12 + PDstandardNth11gt12*SQR(J13L) + + PDstandardNth22gt12*SQR(J23L) + PDstandardNth33gt12*SQR(J33L))); + + Rt13 = khalf*((gt13L*J11L + gt11L*J13L)*PDstandardNth1Xt1 + + (gt23L*J11L + gt12L*J13L)*PDstandardNth1Xt2 + + (gt33L*J11L + gt13L*J13L)*PDstandardNth1Xt3 + + (gt13L*J21L + gt11L*J23L)*PDstandardNth2Xt1 + + (gt23L*J21L + gt12L*J23L)*PDstandardNth2Xt2 + + (gt33L*J21L + gt13L*J23L)*PDstandardNth2Xt3 - + 2*(gtu21*(J11L*J12L*PDstandardNth11gt13 + J12L*J21L*PDstandardNth12gt13 + + J11L*J22L*PDstandardNth12gt13 + J12L*J31L*PDstandardNth13gt13 + + J11L*J32L*PDstandardNth13gt13 + dJ112L*PDstandardNth1gt13 + + J21L*J22L*PDstandardNth22gt13 + J22L*J31L*PDstandardNth23gt13 + + J21L*J32L*PDstandardNth23gt13 + dJ212L*PDstandardNth2gt13 + + J31L*J32L*PDstandardNth33gt13 + dJ312L*PDstandardNth3gt13) + + gtu31*(J11L*J13L*PDstandardNth11gt13 + J13L*J21L*PDstandardNth12gt13 + + J11L*J23L*PDstandardNth12gt13 + J13L*J31L*PDstandardNth13gt13 + + J11L*J33L*PDstandardNth13gt13 + dJ113L*PDstandardNth1gt13 + + J21L*J23L*PDstandardNth22gt13 + J23L*J31L*PDstandardNth23gt13 + + J21L*J33L*PDstandardNth23gt13 + dJ213L*PDstandardNth2gt13 + + J31L*J33L*PDstandardNth33gt13 + dJ313L*PDstandardNth3gt13) + + gtu32*(J12L*J13L*PDstandardNth11gt13 + J13L*J22L*PDstandardNth12gt13 + + J12L*J23L*PDstandardNth12gt13 + J13L*J32L*PDstandardNth13gt13 + + J12L*J33L*PDstandardNth13gt13 + dJ123L*PDstandardNth1gt13 + + J22L*J23L*PDstandardNth22gt13 + J23L*J32L*PDstandardNth23gt13 + + J22L*J33L*PDstandardNth23gt13 + dJ223L*PDstandardNth2gt13 + + J32L*J33L*PDstandardNth33gt13 + dJ323L*PDstandardNth3gt13)) + + (gt13L*J31L + gt11L*J33L)*PDstandardNth3Xt1 + + (gt23L*J31L + gt12L*J33L)*PDstandardNth3Xt2 + + (gt33L*J31L + gt13L*J33L)*PDstandardNth3Xt3 + + (Gt113*gt11L + Gt111*gt13L + gt12L*Gt213 + Gt211*gt23L + gt13L*Gt313 + + Gt311*gt33L)*Xtn1 + (gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + + Gt212*gt23L + gt13L*Gt323 + Gt312*gt33L)*Xtn2 + + (gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + Gt213*gt23L + gt13L*Gt333 + + Gt313*gt33L)*Xtn3 + 2*((Gt122*gt13L*Gt211 + 2*Gt113*gt12L*Gt212 + + Gt112*gt12L*Gt213 + gt12L*Gt213*Gt222 + Gt212*Gt213*gt22L + + Gt211*Gt222*gt23L + Gt123*gt13L*Gt311 + Gt223*gt23L*Gt311 + + 2*Gt113*gt13L*Gt312 + Gt213*gt23L*Gt312 + Gt112*gt13L*Gt313 + + gt12L*Gt223*Gt313 + Gt212*gt23L*Gt313 + + gt11L*(2*Gt112*Gt113 + Gt122*Gt213 + Gt123*Gt313) + + gt13L*Gt213*Gt322 + gt13L*Gt313*Gt323 + Gt312*Gt313*gt33L + + Gt211*Gt322*gt33L + Gt311*Gt323*gt33L + + Gt111*(Gt112*gt13L + Gt212*gt23L + Gt312*gt33L))*gtu21 + + (Gt122*gt13L*Gt213 + gt11L*Gt122*Gt233 + Gt212*gt22L*Gt233 + + Gt113*Gt212*gt23L + Gt213*Gt222*gt23L + 2*Gt133*gt13L*Gt312 + + Gt233*gt23L*Gt312 + Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + + gt13L*Gt233*Gt322 + gt11L*Gt123*Gt333 + Gt212*gt23L*Gt333 + + gt13L*Gt323*Gt333 + Gt112* + (2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + + gt12L*(2*Gt133*Gt212 + Gt222*Gt233 + Gt223*Gt333) + + Gt113*Gt312*gt33L + Gt213*Gt322*gt33L + Gt313*Gt323*gt33L + + Gt312*Gt333*gt33L)*gtu32 + + gtu21*(2*Gt123*gt12L*Gt211 + Gt112*gt13L*Gt212 + gt12L*Gt212*Gt223 + + Gt211*Gt223*gt22L + Gt112*Gt211*gt23L + 2*Gt123*gt13L*Gt311 + + Gt223*gt23L*Gt311 + Gt113*gt13L*Gt312 + gt13L*Gt223*Gt312 + + Gt213*gt23L*Gt312 + gt12L*Gt213*Gt323 + Gt211*gt23L*Gt323 + + gt13L*Gt313*Gt323 + gt11L* + (2*Gt111*Gt123 + Gt112*Gt223 + Gt113*Gt323) + + Gt111*(Gt112*gt13L + gt12L*Gt223 + gt13L*Gt323) + + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + Gt312*Gt313*gt33L + + Gt311*Gt323*gt33L + gt23L*SQR(Gt212)) + + gtu32*(Gt123*gt13L*Gt212 + 2*Gt123*gt12L*Gt213 + Gt113*gt12L*Gt223 + + Gt213*Gt223*gt22L + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + + Gt233*gt23L*Gt312 + 2*Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + + Gt113*gt13L*Gt323 + gt13L*Gt223*Gt323 + gt12L*Gt233*Gt323 + + Gt213*gt23L*Gt323 + gt11L* + (2*Gt113*Gt123 + Gt123*Gt223 + Gt133*Gt323) + gt13L*Gt323*Gt333 + + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L + + Gt112*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + gt12L*SQR(Gt223))\ + + gtu11*(2*Gt113*gt12L*Gt211 + Gt112*gt13L*Gt211 + + gt12L*Gt212*Gt213 + Gt211*Gt213*gt22L + Gt211*Gt212*gt23L + + 3*Gt113*gt13L*Gt311 + 2*Gt213*gt23L*Gt311 + gt13L*Gt213*Gt312 + + gt12L*Gt213*Gt313 + Gt211*gt23L*Gt313 + + gt11L*(2*Gt111*Gt113 + Gt112*Gt213 + Gt113*Gt313) + + Gt211*Gt312*gt33L + 2*Gt311*Gt313*gt33L + + Gt111*(gt12L*Gt213 + Gt211*gt23L + gt13L*Gt313 + Gt311*gt33L) + + gt13L*SQR(Gt111) + gt13L*SQR(Gt313)) + + gtu31*(Gt112*gt13L*Gt213 + Gt112*gt11L*Gt233 + Gt211*gt22L*Gt233 + + Gt113*Gt211*gt23L + Gt212*Gt213*gt23L + 2*Gt133*gt13L*Gt311 + + Gt233*gt23L*Gt311 + gt13L*Gt233*Gt312 + Gt113*gt13L*Gt313 + + Gt213*gt23L*Gt313 + Gt113*gt11L*Gt333 + Gt211*gt23L*Gt333 + + gt13L*Gt313*Gt333 + Gt111* + (2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + + gt12L*(2*Gt133*Gt211 + Gt212*Gt233 + Gt213*Gt333) + + Gt113*Gt311*gt33L + Gt213*Gt312*gt33L + Gt311*Gt333*gt33L + + gt33L*SQR(Gt313)) + gtu31* + (Gt123*gt13L*Gt211 + 3*Gt113*gt12L*Gt213 + gt12L*Gt213*Gt223 + + Gt211*Gt223*gt23L + Gt133*gt13L*Gt311 + Gt233*gt23L*Gt311 + + 3*Gt113*gt13L*Gt313 + gt12L*Gt233*Gt313 + 2*Gt213*gt23L*Gt313 + + gt13L*Gt213*Gt323 + gt13L*Gt313*Gt333 + Gt211*Gt323*gt33L + + Gt311*Gt333*gt33L + Gt111* + (Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + + gt11L*(Gt123*Gt213 + Gt133*Gt313 + 2*SQR(Gt113)) + + gt22L*SQR(Gt213) + gt33L*SQR(Gt313)) + + gtu22*(2*Gt123*gt12L*Gt212 + Gt122*gt13L*Gt212 + gt12L*Gt222*Gt223 + + Gt212*Gt223*gt22L + Gt212*Gt222*gt23L + 3*Gt123*gt13L*Gt312 + + 2*Gt223*gt23L*Gt312 + gt13L*Gt223*Gt322 + gt12L*Gt223*Gt323 + + Gt212*gt23L*Gt323 + gt11L* + (2*Gt112*Gt123 + Gt122*Gt223 + Gt123*Gt323) + Gt212*Gt322*gt33L + + 2*Gt312*Gt323*gt33L + + Gt112*(gt12L*Gt223 + Gt212*gt23L + gt13L*Gt323 + Gt312*gt33L) + + gt13L*SQR(Gt112) + gt13L*SQR(Gt323)) + + gtu33*(2*gt12L*Gt133*Gt213 + Gt123*gt13L*Gt213 + gt11L*Gt123*Gt233 + + gt12L*Gt223*Gt233 + Gt213*gt22L*Gt233 + Gt213*Gt223*gt23L + + 3*Gt133*gt13L*Gt313 + 2*Gt233*gt23L*Gt313 + gt13L*Gt233*Gt323 + + gt11L*Gt133*Gt333 + gt12L*Gt233*Gt333 + Gt213*gt23L*Gt333 + + Gt213*Gt323*gt33L + 2*Gt313*Gt333*gt33L + + Gt113*(2*gt11L*Gt133 + gt12L*Gt233 + Gt213*gt23L + gt13L*Gt333 + + Gt313*gt33L) + gt13L*SQR(Gt113) + gt13L*SQR(Gt333))) - + gtu11*(2*J11L*J21L*PDstandardNth12gt13 + + 2*J11L*J31L*PDstandardNth13gt13 + dJ111L*PDstandardNth1gt13 + + 2*J21L*J31L*PDstandardNth23gt13 + dJ211L*PDstandardNth2gt13 + + dJ311L*PDstandardNth3gt13 + PDstandardNth11gt13*SQR(J11L) + + PDstandardNth22gt13*SQR(J21L) + PDstandardNth33gt13*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt13 + + 2*J12L*J32L*PDstandardNth13gt13 + dJ122L*PDstandardNth1gt13 + + 2*J22L*J32L*PDstandardNth23gt13 + dJ222L*PDstandardNth2gt13 + + dJ322L*PDstandardNth3gt13 + PDstandardNth11gt13*SQR(J12L) + + PDstandardNth22gt13*SQR(J22L) + PDstandardNth33gt13*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt13 + + 2*J13L*J33L*PDstandardNth13gt13 + dJ133L*PDstandardNth1gt13 + + 2*J23L*J33L*PDstandardNth23gt13 + dJ233L*PDstandardNth2gt13 + + dJ333L*PDstandardNth3gt13 + PDstandardNth11gt13*SQR(J13L) + + PDstandardNth22gt13*SQR(J23L) + PDstandardNth33gt13*SQR(J33L))); + + Rt22 = (Gt223*(3*Gt112*gt12L + 6*Gt212*gt22L + 4*gt23L*Gt312) + + Gt123*(Gt112*gt11L + gt12L*(2*Gt111 + 4*Gt212) + + 2*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312)) + + Gt112*(gt11L*Gt123 + gt12L*(2*Gt113 + Gt223) + + 2*(Gt213*gt22L + gt23L*Gt313) + gt13L*Gt323) + + 2*(Gt113*gt12L*Gt323 + Gt312* + (gt12L*Gt133 + gt22L*Gt233 + gt23L*Gt333)) + + Gt323*(Gt112*gt13L + 4*Gt212*gt23L + + 2*(Gt213*gt22L + gt23L*Gt313 + Gt312*gt33L)))*gtu31 + + J12L*(gt12L*PDstandardNth1Xt1 + gt22L*PDstandardNth1Xt2 + + gt23L*PDstandardNth1Xt3) + + J22L*(gt12L*PDstandardNth2Xt1 + gt22L*PDstandardNth2Xt2 + + gt23L*PDstandardNth2Xt3) + + J32L*(gt12L*PDstandardNth3Xt1 + gt22L*PDstandardNth3Xt2 + + gt23L*PDstandardNth3Xt3) + + (Gt112*gt12L + Gt212*gt22L + gt23L*Gt312)*Xtn1 + + (Gt122*gt12L + Gt222*gt22L + gt23L*Gt322)*Xtn2 + + (Gt123*gt12L + Gt223*gt22L + gt23L*Gt323)*Xtn3 + + gtu21*(Gt222*(3*Gt112*gt12L + 6*Gt212*gt22L + 4*gt23L*Gt312) + + Gt122*(Gt112*gt11L + gt12L*(2*Gt111 + 4*Gt212) + + 2*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312)) + + Gt112*(gt11L*Gt122 + gt12L*Gt222 + 2*(Gt212*gt22L + gt23L*Gt312) + + gt13L*Gt322) + Gt322*(Gt112*gt13L + 4*Gt212*gt23L + + 2*(Gt213*gt22L + gt23L*Gt313 + Gt312*gt33L)) + + 2*(Gt312*(Gt123*gt12L + Gt223*gt22L + gt23L*Gt323) + + gt12L*(Gt113*Gt322 + SQR(Gt112)))) + + gtu11*(Gt112*(gt12L*(2*Gt111 + 4*Gt212) + + 2*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312)) + + Gt312*(2*(Gt113*gt12L + Gt213*gt22L) + gt23L*(4*Gt212 + 2*Gt313)) + + gt11L*SQR(Gt112) + 3*gt22L*SQR(Gt212) + gt33L*SQR(Gt312)) + + gtu22*(Gt122*(gt12L*(2*Gt112 + 4*Gt222) + + 2*(Gt212*gt22L + gt23L*Gt312 + gt13L*Gt322)) + + Gt322*(2*(Gt123*gt12L + Gt223*gt22L) + gt23L*(4*Gt222 + 2*Gt323)) + + gt11L*SQR(Gt122) + 3*gt22L*SQR(Gt222) + gt33L*SQR(Gt322)) + + gtu33*(Gt123*(gt12L*(2*Gt113 + 4*Gt223) + + 2*(Gt213*gt22L + gt23L*Gt313 + gt13L*Gt323)) + + Gt323*(2*(gt12L*Gt133 + gt22L*Gt233) + gt23L*(4*Gt223 + 2*Gt333)) + + gt11L*SQR(Gt123) + 3*gt22L*SQR(Gt223) + gt33L*SQR(Gt323)) + + gtu32*(gt22L*(2*(Gt122*Gt213 + Gt233*Gt322) + Gt223*(6*Gt222 + 2*Gt323)) + + 4*(gt12L*(Gt123*Gt222 + Gt122*Gt223) + + gt23L*(Gt223*Gt322 + Gt222*Gt323)) + + 2*(Gt123*(Gt112*gt12L + Gt212*gt22L + gt23L*Gt312 + gt13L*Gt322) + + gt12L*(Gt133*Gt322 + Gt123*Gt323) + + Gt122*(gt11L*Gt123 + Gt113*gt12L + gt23L*Gt313 + gt13L*Gt323) + + Gt322*(gt23L*Gt333 + Gt323*gt33L) + gt23L*SQR(Gt323))) + + khalf*(-2*(gtu21*(J11L*J12L*PDstandardNth11gt22 + + J12L*J21L*PDstandardNth12gt22 + J11L*J22L*PDstandardNth12gt22 + + J12L*J31L*PDstandardNth13gt22 + J11L*J32L*PDstandardNth13gt22 + + dJ112L*PDstandardNth1gt22 + J21L*J22L*PDstandardNth22gt22 + + J22L*J31L*PDstandardNth23gt22 + J21L*J32L*PDstandardNth23gt22 + + dJ212L*PDstandardNth2gt22 + J31L*J32L*PDstandardNth33gt22 + + dJ312L*PDstandardNth3gt22) + + gtu31*(J11L*J13L*PDstandardNth11gt22 + + J13L*J21L*PDstandardNth12gt22 + J11L*J23L*PDstandardNth12gt22 + + J13L*J31L*PDstandardNth13gt22 + J11L*J33L*PDstandardNth13gt22 + + dJ113L*PDstandardNth1gt22 + J21L*J23L*PDstandardNth22gt22 + + J23L*J31L*PDstandardNth23gt22 + J21L*J33L*PDstandardNth23gt22 + + dJ213L*PDstandardNth2gt22 + J31L*J33L*PDstandardNth33gt22 + + dJ313L*PDstandardNth3gt22) + + gtu32*(J12L*J13L*PDstandardNth11gt22 + + J13L*J22L*PDstandardNth12gt22 + J12L*J23L*PDstandardNth12gt22 + + J13L*J32L*PDstandardNth13gt22 + J12L*J33L*PDstandardNth13gt22 + + dJ123L*PDstandardNth1gt22 + J22L*J23L*PDstandardNth22gt22 + + J23L*J32L*PDstandardNth23gt22 + J22L*J33L*PDstandardNth23gt22 + + dJ223L*PDstandardNth2gt22 + J32L*J33L*PDstandardNth33gt22 + + dJ323L*PDstandardNth3gt22)) - + gtu11*(2*J11L*J21L*PDstandardNth12gt22 + + 2*J11L*J31L*PDstandardNth13gt22 + dJ111L*PDstandardNth1gt22 + + 2*J21L*J31L*PDstandardNth23gt22 + dJ211L*PDstandardNth2gt22 + + dJ311L*PDstandardNth3gt22 + PDstandardNth11gt22*SQR(J11L) + + PDstandardNth22gt22*SQR(J21L) + PDstandardNth33gt22*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt22 + + 2*J12L*J32L*PDstandardNth13gt22 + dJ122L*PDstandardNth1gt22 + + 2*J22L*J32L*PDstandardNth23gt22 + dJ222L*PDstandardNth2gt22 + + dJ322L*PDstandardNth3gt22 + PDstandardNth11gt22*SQR(J12L) + + PDstandardNth22gt22*SQR(J22L) + PDstandardNth33gt22*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt22 + + 2*J13L*J33L*PDstandardNth13gt22 + dJ133L*PDstandardNth1gt22 + + 2*J23L*J33L*PDstandardNth23gt22 + dJ233L*PDstandardNth2gt22 + + dJ333L*PDstandardNth3gt22 + PDstandardNth11gt22*SQR(J13L) + + PDstandardNth22gt22*SQR(J23L) + PDstandardNth33gt22*SQR(J33L))); + + Rt23 = khalf*((gt13L*J12L + gt12L*J13L)*PDstandardNth1Xt1 + + (gt23L*J12L + gt22L*J13L)*PDstandardNth1Xt2 + + (gt33L*J12L + gt23L*J13L)*PDstandardNth1Xt3 + + (gt13L*J22L + gt12L*J23L)*PDstandardNth2Xt1 + + (gt23L*J22L + gt22L*J23L)*PDstandardNth2Xt2 + + (gt33L*J22L + gt23L*J23L)*PDstandardNth2Xt3 - + 2*(gtu21*(J11L*J12L*PDstandardNth11gt23 + J12L*J21L*PDstandardNth12gt23 + + J11L*J22L*PDstandardNth12gt23 + J12L*J31L*PDstandardNth13gt23 + + J11L*J32L*PDstandardNth13gt23 + dJ112L*PDstandardNth1gt23 + + J21L*J22L*PDstandardNth22gt23 + J22L*J31L*PDstandardNth23gt23 + + J21L*J32L*PDstandardNth23gt23 + dJ212L*PDstandardNth2gt23 + + J31L*J32L*PDstandardNth33gt23 + dJ312L*PDstandardNth3gt23) + + gtu31*(J11L*J13L*PDstandardNth11gt23 + J13L*J21L*PDstandardNth12gt23 + + J11L*J23L*PDstandardNth12gt23 + J13L*J31L*PDstandardNth13gt23 + + J11L*J33L*PDstandardNth13gt23 + dJ113L*PDstandardNth1gt23 + + J21L*J23L*PDstandardNth22gt23 + J23L*J31L*PDstandardNth23gt23 + + J21L*J33L*PDstandardNth23gt23 + dJ213L*PDstandardNth2gt23 + + J31L*J33L*PDstandardNth33gt23 + dJ313L*PDstandardNth3gt23) + + gtu32*(J12L*J13L*PDstandardNth11gt23 + J13L*J22L*PDstandardNth12gt23 + + J12L*J23L*PDstandardNth12gt23 + J13L*J32L*PDstandardNth13gt23 + + J12L*J33L*PDstandardNth13gt23 + dJ123L*PDstandardNth1gt23 + + J22L*J23L*PDstandardNth22gt23 + J23L*J32L*PDstandardNth23gt23 + + J22L*J33L*PDstandardNth23gt23 + dJ223L*PDstandardNth2gt23 + + J32L*J33L*PDstandardNth33gt23 + dJ323L*PDstandardNth3gt23)) + + (gt13L*J32L + gt12L*J33L)*PDstandardNth3Xt1 + + (gt23L*J32L + gt22L*J33L)*PDstandardNth3Xt2 + + (gt33L*J32L + gt23L*J33L)*PDstandardNth3Xt3 + + (Gt113*gt12L + Gt112*gt13L + Gt213*gt22L + Gt212*gt23L + gt23L*Gt313 + + Gt312*gt33L)*Xtn1 + (Gt123*gt12L + Gt122*gt13L + Gt223*gt22L + + Gt222*gt23L + gt23L*Gt323 + Gt322*gt33L)*Xtn2 + + (gt12L*Gt133 + Gt123*gt13L + gt22L*Gt233 + Gt223*gt23L + gt23L*Gt333 + + Gt323*gt33L)*Xtn3 + 2*((Gt112*gt11L*Gt123 + Gt111*Gt123*gt12L + + Gt111*Gt122*gt13L + Gt123*gt12L*Gt212 + Gt112*gt13L*Gt222 + + 2*Gt112*gt12L*Gt223 + Gt123*Gt211*gt22L + 2*Gt212*Gt223*gt22L + + Gt122*Gt211*gt23L + Gt212*Gt222*gt23L + Gt123*gt23L*Gt311 + + Gt123*gt13L*Gt312 + 2*Gt223*gt23L*Gt312 + Gt113*gt13L*Gt322 + + Gt213*gt23L*Gt322 + Gt113*gt12L*Gt323 + Gt112*gt13L*Gt323 + + Gt213*gt22L*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt313*Gt323 + + Gt122*Gt311*gt33L + Gt222*Gt312*gt33L + Gt313*Gt322*gt33L + + Gt312*Gt323*gt33L)*gtu21 + + (Gt112*gt11L*Gt133 + Gt111*gt12L*Gt133 + Gt111*Gt123*gt13L + + gt12L*Gt133*Gt212 + Gt112*gt13L*Gt223 + Gt133*Gt211*gt22L + + 2*Gt112*gt12L*Gt233 + 2*Gt212*gt22L*Gt233 + Gt123*Gt211*gt23L + + Gt212*Gt223*gt23L + Gt133*gt23L*Gt311 + Gt133*gt13L*Gt312 + + 2*Gt233*gt23L*Gt312 + Gt113*gt13L*Gt323 + Gt213*gt23L*Gt323 + + Gt113*gt12L*Gt333 + Gt112*gt13L*Gt333 + Gt213*gt22L*Gt333 + + Gt212*gt23L*Gt333 + gt23L*Gt313*Gt333 + Gt123*Gt311*gt33L + + Gt223*Gt312*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L)*gtu31 + + gtu21*(Gt113*gt11L*Gt122 + Gt122*gt13L*Gt212 + 2*Gt122*gt12L*Gt213 + + Gt113*gt12L*Gt222 + Gt113*Gt212*gt22L + 2*Gt213*Gt222*gt22L + + Gt212*Gt222*gt23L + Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + + Gt223*gt23L*Gt312 + Gt123*gt12L*Gt313 + Gt122*gt13L*Gt313 + + Gt223*gt22L*Gt313 + Gt222*gt23L*Gt313 + Gt113*gt13L*Gt322 + + 2*Gt213*gt23L*Gt322 + gt23L*Gt313*Gt323 + Gt212*Gt322*gt33L + + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L + + Gt112*(Gt113*gt12L + Gt212*gt23L + Gt312*gt33L) + gt13L*SQR(Gt112))\ + + gtu31*(2*Gt213*Gt223*gt22L + Gt112*Gt213*gt23L + + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + + gt12L*Gt133*Gt313 + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + + Gt123*(2*gt12L*Gt213 + gt13L*(Gt212 + Gt313)) + + 2*Gt213*gt23L*Gt323 + + Gt113*(gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + Gt213*gt22L + + gt23L*Gt313 + gt13L*Gt323) + gt23L*Gt313*Gt333 + + Gt112*Gt313*gt33L + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + + Gt312*Gt333*gt33L + gt12L*SQR(Gt113)) + + gtu11*(Gt112*Gt113*gt11L + Gt111*Gt113*gt12L + Gt111*Gt112*gt13L + + Gt113*gt12L*Gt212 + Gt112*gt13L*Gt212 + 2*Gt112*gt12L*Gt213 + + Gt113*Gt211*gt22L + 2*Gt212*Gt213*gt22L + Gt112*Gt211*gt23L + + Gt113*gt23L*Gt311 + 2*Gt113*gt13L*Gt312 + 3*Gt213*gt23L*Gt312 + + Gt113*gt12L*Gt313 + Gt112*gt13L*Gt313 + Gt213*gt22L*Gt313 + + Gt212*gt23L*Gt313 + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + + 2*Gt312*Gt313*gt33L + gt23L*SQR(Gt212) + gt23L*SQR(Gt313)) + + gtu22*(gt11L*Gt122*Gt123 + Gt112*Gt123*gt12L + Gt112*Gt122*gt13L + + Gt123*gt12L*Gt222 + Gt122*gt13L*Gt222 + 2*Gt122*gt12L*Gt223 + + Gt123*Gt212*gt22L + 2*Gt222*Gt223*gt22L + Gt122*Gt212*gt23L + + Gt123*gt23L*Gt312 + 2*Gt123*gt13L*Gt322 + 3*Gt223*gt23L*Gt322 + + Gt123*gt12L*Gt323 + Gt122*gt13L*Gt323 + Gt223*gt22L*Gt323 + + Gt222*gt23L*Gt323 + Gt122*Gt312*gt33L + Gt222*Gt322*gt33L + + 2*Gt322*Gt323*gt33L + gt23L*SQR(Gt222) + gt23L*SQR(Gt323)) + + gtu32*(gt11L*Gt122*Gt133 + Gt112*gt12L*Gt133 + Gt112*Gt123*gt13L + + gt12L*Gt133*Gt222 + Gt122*gt13L*Gt223 + Gt133*Gt212*gt22L + + 2*Gt122*gt12L*Gt233 + 2*Gt222*gt22L*Gt233 + Gt123*Gt212*gt23L + + Gt222*Gt223*gt23L + Gt133*gt23L*Gt312 + Gt133*gt13L*Gt322 + + 2*Gt233*gt23L*Gt322 + Gt123*gt13L*Gt323 + Gt223*gt23L*Gt323 + + Gt123*gt12L*Gt333 + Gt122*gt13L*Gt333 + Gt223*gt22L*Gt333 + + Gt222*gt23L*Gt333 + gt23L*Gt323*Gt333 + Gt123*Gt312*gt33L + + Gt223*Gt322*gt33L + Gt322*Gt333*gt33L + gt33L*SQR(Gt323)) + + gtu32*(Gt113*Gt123*gt12L + Gt113*Gt122*gt13L + Gt123*gt13L*Gt222 + + 3*Gt123*gt12L*Gt223 + Gt123*Gt213*gt22L + Gt122*Gt213*gt23L + + Gt222*Gt223*gt23L + Gt123*gt23L*Gt313 + Gt133*gt13L*Gt322 + + Gt233*gt23L*Gt322 + gt12L*Gt133*Gt323 + 2*Gt123*gt13L*Gt323 + + gt22L*Gt233*Gt323 + 3*Gt223*gt23L*Gt323 + gt23L*Gt323*Gt333 + + Gt122*Gt313*gt33L + Gt222*Gt323*gt33L + Gt322*Gt333*gt33L + + gt11L*SQR(Gt123) + 2*gt22L*SQR(Gt223) + gt33L*SQR(Gt323)) + + gtu33*(gt11L*Gt123*Gt133 + Gt113*gt12L*Gt133 + Gt113*Gt123*gt13L + + gt12L*Gt133*Gt223 + Gt123*gt13L*Gt223 + Gt133*Gt213*gt22L + + 2*Gt123*gt12L*Gt233 + 2*Gt223*gt22L*Gt233 + Gt123*Gt213*gt23L + + Gt133*gt23L*Gt313 + 2*Gt133*gt13L*Gt323 + 3*Gt233*gt23L*Gt323 + + gt12L*Gt133*Gt333 + Gt123*gt13L*Gt333 + gt22L*Gt233*Gt333 + + Gt223*gt23L*Gt333 + Gt123*Gt313*gt33L + Gt223*Gt323*gt33L + + 2*Gt323*Gt333*gt33L + gt23L*SQR(Gt223) + gt23L*SQR(Gt333))) - + gtu11*(2*J11L*J21L*PDstandardNth12gt23 + + 2*J11L*J31L*PDstandardNth13gt23 + dJ111L*PDstandardNth1gt23 + + 2*J21L*J31L*PDstandardNth23gt23 + dJ211L*PDstandardNth2gt23 + + dJ311L*PDstandardNth3gt23 + PDstandardNth11gt23*SQR(J11L) + + PDstandardNth22gt23*SQR(J21L) + PDstandardNth33gt23*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt23 + + 2*J12L*J32L*PDstandardNth13gt23 + dJ122L*PDstandardNth1gt23 + + 2*J22L*J32L*PDstandardNth23gt23 + dJ222L*PDstandardNth2gt23 + + dJ322L*PDstandardNth3gt23 + PDstandardNth11gt23*SQR(J12L) + + PDstandardNth22gt23*SQR(J22L) + PDstandardNth33gt23*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt23 + + 2*J13L*J33L*PDstandardNth13gt23 + dJ133L*PDstandardNth1gt23 + + 2*J23L*J33L*PDstandardNth23gt23 + dJ233L*PDstandardNth2gt23 + + dJ333L*PDstandardNth3gt23 + PDstandardNth11gt23*SQR(J13L) + + PDstandardNth22gt23*SQR(J23L) + PDstandardNth33gt23*SQR(J33L))); + + Rt33 = (4*((Gt123*gt13L + Gt223*gt23L)*Gt313 + + (Gt113*gt13L + Gt213*gt23L)*Gt323) + + (2*Gt213*Gt322 + 6*Gt313*Gt323)*gt33L + + 2*(gt13L*(Gt122*Gt213 + Gt112*Gt223) + + Gt213*(Gt223*gt22L + Gt222*gt23L) + + Gt123*(Gt111*gt13L + gt12L*Gt213 + Gt211*gt23L + Gt311*gt33L) + + Gt223*(Gt212*gt23L + Gt312*gt33L) + + Gt113*(gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + Gt212*gt23L + + Gt312*gt33L)))*gtu21 + + J13L*(gt13L*PDstandardNth1Xt1 + gt23L*PDstandardNth1Xt2 + + gt33L*PDstandardNth1Xt3) + + J23L*(gt13L*PDstandardNth2Xt1 + gt23L*PDstandardNth2Xt2 + + gt33L*PDstandardNth2Xt3) + + J33L*(gt13L*PDstandardNth3Xt1 + gt23L*PDstandardNth3Xt2 + + gt33L*PDstandardNth3Xt3) + + (Gt113*gt13L + Gt213*gt23L + Gt313*gt33L)*Xtn1 + + (Gt123*gt13L + Gt223*gt23L + Gt323*gt33L)*Xtn2 + + (Gt133*gt13L + Gt233*gt23L + Gt333*gt33L)*Xtn3 + + gtu31*(Gt133*(Gt113*gt11L + 2*(Gt111*gt13L + gt12L*Gt213 + Gt211*gt23L) + + 4*gt13L*Gt313) + Gt333* + (3*Gt113*gt13L + 4*Gt213*gt23L + 6*Gt313*gt33L) + + Gt233*(Gt113*gt12L + 4*gt23L*Gt313 + + 2*(Gt213*gt22L + Gt212*gt23L + Gt312*gt33L)) + + Gt113*(gt11L*Gt133 + gt12L*Gt233 + gt13L*Gt333 + + 2*(Gt213*gt23L + Gt313*gt33L)) + + 2*(Gt133*Gt311*gt33L + Gt213*(Gt223*gt23L + Gt323*gt33L) + + gt13L*(Gt123*Gt213 + Gt112*Gt233 + SQR(Gt113)))) + + gtu32*(4*((Gt133*gt13L + Gt233*gt23L)*Gt323 + + (Gt123*gt13L + Gt223*gt23L)*Gt333) + + Gt323*(2*Gt223 + 6*Gt333)*gt33L + + 2*(Gt133*(Gt112*gt13L + gt12L*Gt223 + Gt212*gt23L + Gt312*gt33L) + + Gt123*(gt11L*Gt133 + gt13L*(Gt113 + Gt223) + gt12L*Gt233 + + Gt213*gt23L + Gt313*gt33L) + + Gt233*(Gt122*gt13L + Gt223*gt22L + Gt222*gt23L + Gt322*gt33L) + + gt23L*SQR(Gt223))) + gtu11* + (4*(Gt113*gt13L + Gt213*gt23L)*Gt313 + + 2*(Gt113*(Gt111*gt13L + gt12L*Gt213 + Gt211*gt23L + Gt311*gt33L) + + Gt213*(Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)) + gt11L*SQR(Gt113) + + gt22L*SQR(Gt213) + 3*gt33L*SQR(Gt313)) + + gtu22*(4*(Gt123*gt13L + Gt223*gt23L)*Gt323 + + 2*(Gt123*(Gt112*gt13L + gt12L*Gt223 + Gt212*gt23L + Gt312*gt33L) + + Gt223*(Gt122*gt13L + Gt222*gt23L + Gt322*gt33L)) + gt11L*SQR(Gt123) + + gt22L*SQR(Gt223) + 3*gt33L*SQR(Gt323)) + + gtu33*(4*(Gt133*gt13L + Gt233*gt23L)*Gt333 + + 2*(Gt133*(Gt113*gt13L + gt12L*Gt233 + Gt213*gt23L + Gt313*gt33L) + + Gt233*(Gt123*gt13L + Gt223*gt23L + Gt323*gt33L)) + gt11L*SQR(Gt133) + + gt22L*SQR(Gt233) + 3*gt33L*SQR(Gt333)) + + khalf*(-2*(gtu21*(J11L*J12L*PDstandardNth11gt33 + + J12L*J21L*PDstandardNth12gt33 + J11L*J22L*PDstandardNth12gt33 + + J12L*J31L*PDstandardNth13gt33 + J11L*J32L*PDstandardNth13gt33 + + dJ112L*PDstandardNth1gt33 + J21L*J22L*PDstandardNth22gt33 + + J22L*J31L*PDstandardNth23gt33 + J21L*J32L*PDstandardNth23gt33 + + dJ212L*PDstandardNth2gt33 + J31L*J32L*PDstandardNth33gt33 + + dJ312L*PDstandardNth3gt33) + + gtu31*(J11L*J13L*PDstandardNth11gt33 + + J13L*J21L*PDstandardNth12gt33 + J11L*J23L*PDstandardNth12gt33 + + J13L*J31L*PDstandardNth13gt33 + J11L*J33L*PDstandardNth13gt33 + + dJ113L*PDstandardNth1gt33 + J21L*J23L*PDstandardNth22gt33 + + J23L*J31L*PDstandardNth23gt33 + J21L*J33L*PDstandardNth23gt33 + + dJ213L*PDstandardNth2gt33 + J31L*J33L*PDstandardNth33gt33 + + dJ313L*PDstandardNth3gt33) + + gtu32*(J12L*J13L*PDstandardNth11gt33 + + J13L*J22L*PDstandardNth12gt33 + J12L*J23L*PDstandardNth12gt33 + + J13L*J32L*PDstandardNth13gt33 + J12L*J33L*PDstandardNth13gt33 + + dJ123L*PDstandardNth1gt33 + J22L*J23L*PDstandardNth22gt33 + + J23L*J32L*PDstandardNth23gt33 + J22L*J33L*PDstandardNth23gt33 + + dJ223L*PDstandardNth2gt33 + J32L*J33L*PDstandardNth33gt33 + + dJ323L*PDstandardNth3gt33)) - + gtu11*(2*J11L*J21L*PDstandardNth12gt33 + + 2*J11L*J31L*PDstandardNth13gt33 + dJ111L*PDstandardNth1gt33 + + 2*J21L*J31L*PDstandardNth23gt33 + dJ211L*PDstandardNth2gt33 + + dJ311L*PDstandardNth3gt33 + PDstandardNth11gt33*SQR(J11L) + + PDstandardNth22gt33*SQR(J21L) + PDstandardNth33gt33*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt33 + + 2*J12L*J32L*PDstandardNth13gt33 + dJ122L*PDstandardNth1gt33 + + 2*J22L*J32L*PDstandardNth23gt33 + dJ222L*PDstandardNth2gt33 + + dJ322L*PDstandardNth3gt33 + PDstandardNth11gt33*SQR(J12L) + + PDstandardNth22gt33*SQR(J22L) + PDstandardNth33gt33*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt33 + + 2*J13L*J33L*PDstandardNth13gt33 + dJ133L*PDstandardNth1gt33 + + 2*J23L*J33L*PDstandardNth23gt33 + dJ233L*PDstandardNth2gt33 + + dJ333L*PDstandardNth3gt33 + PDstandardNth11gt33*SQR(J13L) + + PDstandardNth22gt33*SQR(J23L) + PDstandardNth33gt33*SQR(J33L))); + + Rphi11 = -2*((dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L)* + PDstandardNth1phi + 2*(J11L* + (J21L*PDstandardNth12phi + J31L*PDstandardNth13phi) + + J21L*J31L*PDstandardNth23phi) + + (dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L)*PDstandardNth2phi + + (dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L)*PDstandardNth3phi + + PDstandardNth11phi*SQR(J11L) + PDstandardNth22phi*SQR(J21L) + + PDstandardNth33phi*SQR(J31L) + + gt11L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt11L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)) + + 4*SQR(J11L*PDstandardNth1phi + J21L*PDstandardNth2phi + + J31L*PDstandardNth3phi); + + Rphi12 = 4*(J11L*PDstandardNth1phi + J21L*PDstandardNth2phi + + J31L*PDstandardNth3phi)*(J12L*PDstandardNth1phi + + J22L*PDstandardNth2phi + J32L*PDstandardNth3phi) - + 2*(J12L*(J11L*PDstandardNth11phi + J21L*PDstandardNth12phi + + J31L*PDstandardNth13phi) + + J11L*(J22L*PDstandardNth12phi + J32L*PDstandardNth13phi) + + (dJ112L - Gt112*J11L - Gt212*J12L - Gt312*J13L)*PDstandardNth1phi + + J22L*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi) + + (dJ212L - Gt112*J21L - Gt212*J22L - Gt312*J23L)*PDstandardNth2phi + + J32L*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi) + + (dJ312L - Gt112*J31L - Gt212*J32L - Gt312*J33L)*PDstandardNth3phi + + gt12L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt12L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)); + + Rphi13 = 4*(J11L*PDstandardNth1phi + J21L*PDstandardNth2phi + + J31L*PDstandardNth3phi)*(J13L*PDstandardNth1phi + + J23L*PDstandardNth2phi + J33L*PDstandardNth3phi) - + 2*(J13L*(J11L*PDstandardNth11phi + J21L*PDstandardNth12phi + + J31L*PDstandardNth13phi) + + J11L*(J23L*PDstandardNth12phi + J33L*PDstandardNth13phi) + + (dJ113L - Gt113*J11L - Gt213*J12L - Gt313*J13L)*PDstandardNth1phi + + J23L*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi) + + (dJ213L - Gt113*J21L - Gt213*J22L - Gt313*J23L)*PDstandardNth2phi + + J33L*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi) + + (dJ313L - Gt113*J31L - Gt213*J32L - Gt313*J33L)*PDstandardNth3phi + + gt13L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt13L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)); + + Rphi22 = -2*((dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L)* + PDstandardNth1phi + 2*(J12L* + (J22L*PDstandardNth12phi + J32L*PDstandardNth13phi) + + J22L*J32L*PDstandardNth23phi) + + (dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L)*PDstandardNth2phi + + (dJ322L - Gt122*J31L - Gt222*J32L - Gt322*J33L)*PDstandardNth3phi + + PDstandardNth11phi*SQR(J12L) + PDstandardNth22phi*SQR(J22L) + + PDstandardNth33phi*SQR(J32L) + + gt22L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt22L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)) + + 4*SQR(J12L*PDstandardNth1phi + J22L*PDstandardNth2phi + + J32L*PDstandardNth3phi); + + Rphi23 = 4*(J12L*PDstandardNth1phi + J22L*PDstandardNth2phi + + J32L*PDstandardNth3phi)*(J13L*PDstandardNth1phi + + J23L*PDstandardNth2phi + J33L*PDstandardNth3phi) - + 2*(J13L*(J12L*PDstandardNth11phi + J22L*PDstandardNth12phi + + J32L*PDstandardNth13phi) + + J12L*(J23L*PDstandardNth12phi + J33L*PDstandardNth13phi) + + (dJ123L - Gt123*J11L - Gt223*J12L - Gt323*J13L)*PDstandardNth1phi + + J23L*(J22L*PDstandardNth22phi + J32L*PDstandardNth23phi) + + (dJ223L - Gt123*J21L - Gt223*J22L - Gt323*J23L)*PDstandardNth2phi + + J33L*(J22L*PDstandardNth23phi + J32L*PDstandardNth33phi) + + (dJ323L - Gt123*J31L - Gt223*J32L - Gt323*J33L)*PDstandardNth3phi + + gt23L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt23L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)); + + Rphi33 = -2*((dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L)* + PDstandardNth1phi + 2*(J13L* + (J23L*PDstandardNth12phi + J33L*PDstandardNth13phi) + + J23L*J33L*PDstandardNth23phi) + + (dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L)*PDstandardNth2phi + + (dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L)*PDstandardNth3phi + + PDstandardNth11phi*SQR(J13L) + PDstandardNth22phi*SQR(J23L) + + PDstandardNth33phi*SQR(J33L) + + gt33L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt33L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)) + + 4*SQR(J13L*PDstandardNth1phi + J23L*PDstandardNth2phi + + J33L*PDstandardNth3phi); + + Atm11 = At11L*gtu11 + At12L*gtu21 + At13L*gtu31; + + Atm21 = At11L*gtu21 + At12L*gtu22 + At13L*gtu32; + + Atm31 = At11L*gtu31 + At12L*gtu32 + At13L*gtu33; + + Atm12 = At12L*gtu11 + At22L*gtu21 + At23L*gtu31; + + Atm22 = At12L*gtu21 + At22L*gtu22 + At23L*gtu32; + + Atm32 = At12L*gtu31 + At22L*gtu32 + At23L*gtu33; + + Atm13 = At13L*gtu11 + At23L*gtu21 + At33L*gtu31; + + Atm23 = At13L*gtu21 + At23L*gtu22 + At33L*gtu32; + + Atm33 = At13L*gtu31 + At23L*gtu32 + At33L*gtu33; + + Atu11 = Atm11*gtu11 + Atm12*gtu21 + Atm13*gtu31; + + Atu21 = Atm11*gtu21 + Atm12*gtu22 + Atm13*gtu32; + + Atu31 = Atm11*gtu31 + Atm12*gtu32 + Atm13*gtu33; + + Atu22 = Atm21*gtu21 + Atm22*gtu22 + Atm23*gtu32; + + Atu32 = Atm21*gtu31 + Atm22*gtu32 + Atm23*gtu33; + + Atu33 = Atm31*gtu31 + Atm32*gtu32 + Atm33*gtu33; + + e4phi = exp(4*phiL); + + em4phi = INV(e4phi); + + g11 = e4phi*gt11L; + + g12 = e4phi*gt12L; + + g13 = e4phi*gt13L; + + g22 = e4phi*gt22L; + + g23 = e4phi*gt23L; + + g33 = e4phi*gt33L; + + gu11 = em4phi*gtu11; + + gu21 = em4phi*gtu21; + + gu31 = em4phi*gtu31; + + gu22 = em4phi*gtu22; + + gu32 = em4phi*gtu32; + + gu33 = em4phi*gtu33; + + G111 = Gt111 + 2*(-((-2*J11L + gt11L*gtu11*J11L + gt11L*gtu21*J12L + + gt11L*gtu31*J13L)*PDstandardNth1phi) - + (-2*J21L + gt11L*gtu11*J21L + gt11L*gtu21*J22L + gt11L*gtu31*J23L)* + PDstandardNth2phi - (-2*J31L + gt11L*gtu11*J31L + gt11L*gtu21*J32L + + gt11L*gtu31*J33L)*PDstandardNth3phi); + + G211 = Gt211 + 2*gt11L*(-((gtu21*J11L + gtu22*J12L + gtu32*J13L)* + PDstandardNth1phi) - (gtu21*J21L + gtu22*J22L + gtu32*J23L)* + PDstandardNth2phi - (gtu21*J31L + gtu22*J32L + gtu32*J33L)* + PDstandardNth3phi); + + G311 = Gt311 + 2*gt11L*(-((gtu31*J11L + gtu32*J12L + gtu33*J13L)* + PDstandardNth1phi) - (gtu31*J21L + gtu32*J22L + gtu33*J23L)* + PDstandardNth2phi - (gtu31*J31L + gtu32*J32L + gtu33*J33L)* + PDstandardNth3phi); + + G112 = Gt112 + 2*((J12L - gt12L*(gtu11*J11L + gtu21*J12L + gtu31*J13L))* + PDstandardNth1phi + (J22L - + gt12L*(gtu11*J21L + gtu21*J22L + gtu31*J23L))*PDstandardNth2phi + + (J32L - gt12L*(gtu11*J31L + gtu21*J32L + gtu31*J33L))*PDstandardNth3phi); + + G212 = Gt212 + 2*((J11L - gt12L*(gtu21*J11L + gtu22*J12L + gtu32*J13L))* + PDstandardNth1phi + (J21L - + gt12L*(gtu21*J21L + gtu22*J22L + gtu32*J23L))*PDstandardNth2phi + + (J31L - gt12L*(gtu21*J31L + gtu22*J32L + gtu32*J33L))*PDstandardNth3phi); + + G312 = Gt312 + 2*gt12L*(-((gtu31*J11L + gtu32*J12L + gtu33*J13L)* + PDstandardNth1phi) - (gtu31*J21L + gtu32*J22L + gtu33*J23L)* + PDstandardNth2phi - (gtu31*J31L + gtu32*J32L + gtu33*J33L)* + PDstandardNth3phi); + + G113 = Gt113 + 2*((J13L - gt13L*(gtu11*J11L + gtu21*J12L + gtu31*J13L))* + PDstandardNth1phi + (J23L - + gt13L*(gtu11*J21L + gtu21*J22L + gtu31*J23L))*PDstandardNth2phi + + (J33L - gt13L*(gtu11*J31L + gtu21*J32L + gtu31*J33L))*PDstandardNth3phi); + + G213 = Gt213 + 2*gt13L*(-((gtu21*J11L + gtu22*J12L + gtu32*J13L)* + PDstandardNth1phi) - (gtu21*J21L + gtu22*J22L + gtu32*J23L)* + PDstandardNth2phi - (gtu21*J31L + gtu22*J32L + gtu32*J33L)* + PDstandardNth3phi); + + G313 = Gt313 + 2*((J11L - gt13L*(gtu31*J11L + gtu32*J12L + gtu33*J13L))* + PDstandardNth1phi + (J21L - + gt13L*(gtu31*J21L + gtu32*J22L + gtu33*J23L))*PDstandardNth2phi + + (J31L - gt13L*(gtu31*J31L + gtu32*J32L + gtu33*J33L))*PDstandardNth3phi); + + G122 = Gt122 + 2*gt22L*(-((gtu11*J11L + gtu21*J12L + gtu31*J13L)* + PDstandardNth1phi) - (gtu11*J21L + gtu21*J22L + gtu31*J23L)* + PDstandardNth2phi - (gtu11*J31L + gtu21*J32L + gtu31*J33L)* + PDstandardNth3phi); + + G222 = Gt222 + 2*(-((-2*J12L + gt22L*(gtu21*J11L + gtu22*J12L + gtu32*J13L))* + PDstandardNth1phi) - (gt22L*gtu21*J21L - 2*J22L + gt22L*gtu22*J22L + + gt22L*gtu32*J23L)*PDstandardNth2phi - + (gt22L*gtu21*J31L - 2*J32L + gt22L*gtu22*J32L + gt22L*gtu32*J33L)* + PDstandardNth3phi); + + G322 = Gt322 + 2*gt22L*(-((gtu31*J11L + gtu32*J12L + gtu33*J13L)* + PDstandardNth1phi) - (gtu31*J21L + gtu32*J22L + gtu33*J23L)* + PDstandardNth2phi - (gtu31*J31L + gtu32*J32L + gtu33*J33L)* + PDstandardNth3phi); + + G123 = Gt123 + 2*gt23L*(-((gtu11*J11L + gtu21*J12L + gtu31*J13L)* + PDstandardNth1phi) - (gtu11*J21L + gtu21*J22L + gtu31*J23L)* + PDstandardNth2phi - (gtu11*J31L + gtu21*J32L + gtu31*J33L)* + PDstandardNth3phi); + + G223 = Gt223 + 2*((J13L - gt23L*(gtu21*J11L + gtu22*J12L + gtu32*J13L))* + PDstandardNth1phi + (J23L - + gt23L*(gtu21*J21L + gtu22*J22L + gtu32*J23L))*PDstandardNth2phi + + (J33L - gt23L*(gtu21*J31L + gtu22*J32L + gtu32*J33L))*PDstandardNth3phi); + + G323 = Gt323 + 2*((J12L - gt23L*(gtu31*J11L + gtu32*J12L + gtu33*J13L))* + PDstandardNth1phi + (J22L - + gt23L*(gtu31*J21L + gtu32*J22L + gtu33*J23L))*PDstandardNth2phi + + (J32L - gt23L*(gtu31*J31L + gtu32*J32L + gtu33*J33L))*PDstandardNth3phi); + + G133 = Gt133 + 2*gt33L*(-((gtu11*J11L + gtu21*J12L + gtu31*J13L)* + PDstandardNth1phi) - (gtu11*J21L + gtu21*J22L + gtu31*J23L)* + PDstandardNth2phi - (gtu11*J31L + gtu21*J32L + gtu31*J33L)* + PDstandardNth3phi); + + G233 = Gt233 + 2*gt33L*(-((gtu21*J11L + gtu22*J12L + gtu32*J13L)* + PDstandardNth1phi) - (gtu21*J21L + gtu22*J22L + gtu32*J23L)* + PDstandardNth2phi - (gtu21*J31L + gtu22*J32L + gtu32*J33L)* + PDstandardNth3phi); + + G333 = Gt333 + 2*(-((-2*J13L + gt33L*(gtu31*J11L + gtu32*J12L + gtu33*J13L))* + PDstandardNth1phi) - (gt33L*gtu31*J21L + gt33L*gtu32*J22L - 2*J23L + + gt33L*gtu33*J23L)*PDstandardNth2phi - + (gt33L*gtu31*J31L + gt33L*gtu32*J32L - 2*J33L + gt33L*gtu33*J33L)* + PDstandardNth3phi); + + R11 = Rphi11 + Rt11; + + R12 = Rphi12 + Rt12; + + R13 = Rphi13 + Rt13; + + R22 = Rphi22 + Rt22; + + R23 = Rphi23 + Rt23; + + R33 = Rphi33 + Rt33; + + T00 = eTttL; + + T01 = eTtxL; + + T02 = eTtyL; + + T03 = eTtzL; + + T11 = eTxxL; + + T12 = eTxyL; + + T13 = eTxzL; + + T22 = eTyyL; + + T23 = eTyzL; + + T33 = eTzzL; + + rho = pow(alphaL,-2)*(T00 - 2*(beta2L*T02 + beta3L*T03) + + 2*(beta1L*(-T01 + beta2L*T12 + beta3L*T13) + beta2L*beta3L*T23) + + T11*SQR(beta1L) + T22*SQR(beta2L) + T33*SQR(beta3L)); + + S1 = (-T01 + beta1L*T11 + beta2L*T12 + beta3L*T13)*INV(alphaL); + + S2 = (-T02 + beta1L*T12 + beta2L*T22 + beta3L*T23)*INV(alphaL); + + S3 = (-T03 + beta1L*T13 + beta2L*T23 + beta3L*T33)*INV(alphaL); + + trS = gu11*T11 + gu22*T22 + 2*(gu21*T12 + gu31*T13 + gu32*T23) + gu33*T33; + + phirhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1phi + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2phi + + (J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3)/6. + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3phi - + (alphaL*trKL)/6.; + + gt11rhsL = -2*alphaL*At11L + (beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1gt11 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2gt11 - gt11L*ktwothird* + (J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3) + + 2*(J11L*(gt11L*PDstandardNth1beta1 + gt12L*PDstandardNth1beta2 + + gt13L*PDstandardNth1beta3) + + J21L*(gt11L*PDstandardNth2beta1 + gt12L*PDstandardNth2beta2 + + gt13L*PDstandardNth2beta3) + + J31L*(gt11L*PDstandardNth3beta1 + gt12L*PDstandardNth3beta2 + + gt13L*PDstandardNth3beta3)) + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3gt11; + + gt12rhsL = -2*alphaL*At12L + (gt12L*J11L + gt11L*J12L)*PDstandardNth1beta1 + + (gt22L*J11L + gt12L*J12L)*PDstandardNth1beta2 + + (gt23L*J11L + gt13L*J12L)*PDstandardNth1beta3 + + (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1gt12 + + (gt12L*J21L + gt11L*J22L)*PDstandardNth2beta1 + + (gt22L*J21L + gt12L*J22L)*PDstandardNth2beta2 + + (gt23L*J21L + gt13L*J22L)*PDstandardNth2beta3 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2gt12 + + (gt12L*J31L + gt11L*J32L)*PDstandardNth3beta1 + + (gt22L*J31L + gt12L*J32L)*PDstandardNth3beta2 + + (gt23L*J31L + gt13L*J32L)*PDstandardNth3beta3 - + gt12L*ktwothird*(J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3) + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3gt12; + + gt13rhsL = -2*alphaL*At13L + (gt13L*J11L + gt11L*J13L)*PDstandardNth1beta1 + + (gt23L*J11L + gt12L*J13L)*PDstandardNth1beta2 + + (gt33L*J11L + gt13L*J13L)*PDstandardNth1beta3 + + (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1gt13 + + (gt13L*J21L + gt11L*J23L)*PDstandardNth2beta1 + + (gt23L*J21L + gt12L*J23L)*PDstandardNth2beta2 + + (gt33L*J21L + gt13L*J23L)*PDstandardNth2beta3 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2gt13 + + (gt13L*J31L + gt11L*J33L)*PDstandardNth3beta1 + + (gt23L*J31L + gt12L*J33L)*PDstandardNth3beta2 + + (gt33L*J31L + gt13L*J33L)*PDstandardNth3beta3 - + gt13L*ktwothird*(J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3) + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3gt13; + + gt22rhsL = -2*alphaL*At22L + (beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1gt22 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2gt22 - gt22L*ktwothird* + (J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3) + + 2*(J12L*(gt12L*PDstandardNth1beta1 + gt22L*PDstandardNth1beta2 + + gt23L*PDstandardNth1beta3) + + J22L*(gt12L*PDstandardNth2beta1 + gt22L*PDstandardNth2beta2 + + gt23L*PDstandardNth2beta3) + + J32L*(gt12L*PDstandardNth3beta1 + gt22L*PDstandardNth3beta2 + + gt23L*PDstandardNth3beta3)) + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3gt22; + + gt23rhsL = -2*alphaL*At23L + (gt13L*J12L + gt12L*J13L - gt23L*J11L*ktwothird)* + PDstandardNth1beta1 + (gt22L*J13L + gt23L*J12L*kthird)* + PDstandardNth1beta2 + (gt33L*J12L + gt23L*J13L*kthird)* + PDstandardNth1beta3 + (beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1gt23 + (gt13L*J22L + gt12L*J23L - gt23L*J21L*ktwothird)* + PDstandardNth2beta1 + (gt22L*J23L + gt23L*J22L*kthird)* + PDstandardNth2beta2 + (gt33L*J22L + gt23L*J23L*kthird)* + PDstandardNth2beta3 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2gt23 + (gt13L*J32L + gt12L*J33L - gt23L*J31L*ktwothird)* + PDstandardNth3beta1 + (gt22L*J33L + gt23L*J32L*kthird)* + PDstandardNth3beta2 + (gt33L*J32L + gt23L*J33L*kthird)* + PDstandardNth3beta3 + (beta1L*J31L + beta2L*J32L + beta3L*J33L)* + PDstandardNth3gt23; + + gt33rhsL = -2*alphaL*At33L + (beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1gt33 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2gt33 - gt33L*ktwothird* + (J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3) + + 2*(J13L*(gt13L*PDstandardNth1beta1 + gt23L*PDstandardNth1beta2 + + gt33L*PDstandardNth1beta3) + + J23L*(gt13L*PDstandardNth2beta1 + gt23L*PDstandardNth2beta2 + + gt33L*PDstandardNth2beta3) + + J33L*(gt13L*PDstandardNth3beta1 + gt23L*PDstandardNth3beta2 + + gt33L*PDstandardNth3beta3)) + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3gt33; + + Xt1rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1Xt1 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2Xt1 - + 2*((Atu11*J11L + Atu21*J12L + Atu31*J13L)*PDstandardNth1alpha + + (Atu11*J21L + Atu21*J22L + Atu31*J23L)*PDstandardNth2alpha + + (Atu11*J31L + Atu21*J32L + Atu31*J33L)*PDstandardNth3alpha) + + 2*(gtu21*(J11L*J12L*PDstandardNth11beta1 + J12L*J21L*PDstandardNth12beta1 + + J11L*J22L*PDstandardNth12beta1 + J12L*J31L*PDstandardNth13beta1 + + J11L*J32L*PDstandardNth13beta1 + dJ112L*PDstandardNth1beta1 + + J21L*J22L*PDstandardNth22beta1 + J22L*J31L*PDstandardNth23beta1 + + J21L*J32L*PDstandardNth23beta1 + dJ212L*PDstandardNth2beta1 + + J31L*J32L*PDstandardNth33beta1 + dJ312L*PDstandardNth3beta1) + + gtu31*(J11L*J13L*PDstandardNth11beta1 + J13L*J21L*PDstandardNth12beta1 + + J11L*J23L*PDstandardNth12beta1 + J13L*J31L*PDstandardNth13beta1 + + J11L*J33L*PDstandardNth13beta1 + dJ113L*PDstandardNth1beta1 + + J21L*J23L*PDstandardNth22beta1 + J23L*J31L*PDstandardNth23beta1 + + J21L*J33L*PDstandardNth23beta1 + dJ213L*PDstandardNth2beta1 + + J31L*J33L*PDstandardNth33beta1 + dJ313L*PDstandardNth3beta1) + + gtu32*(J12L*J13L*PDstandardNth11beta1 + J13L*J22L*PDstandardNth12beta1 + + J12L*J23L*PDstandardNth12beta1 + J13L*J32L*PDstandardNth13beta1 + + J12L*J33L*PDstandardNth13beta1 + dJ123L*PDstandardNth1beta1 + + J22L*J23L*PDstandardNth22beta1 + J23L*J32L*PDstandardNth23beta1 + + J22L*J33L*PDstandardNth23beta1 + dJ223L*PDstandardNth2beta1 + + J32L*J33L*PDstandardNth33beta1 + dJ323L*PDstandardNth3beta1) + + alphaL*(Atu11*Gt111 + 2*Atu21*Gt112 + 2*Atu31*Gt113 + Atu22*Gt122 + + 2*Atu32*Gt123 + Atu33*Gt133 + + 6*((Atu11*J11L + Atu21*J12L + Atu31*J13L)*PDstandardNth1phi + + (Atu11*J21L + Atu21*J22L + Atu31*J23L)*PDstandardNth2phi + + (Atu11*J31L + Atu21*J32L + Atu31*J33L)*PDstandardNth3phi) - + ktwothird*((gtu11*J11L + gtu21*J12L + gtu31*J13L)*PDstandardNth1trK + + (gtu11*J21L + gtu21*J22L + gtu31*J23L)*PDstandardNth2trK + + (gtu11*J31L + gtu21*J32L + gtu31*J33L)*PDstandardNth3trK))) + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3Xt1 - + 50.26548245743669181540229413247204614715*alphaL* + (gtu11*S1 + gtu21*S2 + gtu31*S3) + + ktwothird*(J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3)*Xtn1 - + PDstandardNth1beta1*(J11L*Xtn1 + J12L*Xtn2 + J13L*Xtn3) - + PDstandardNth2beta1*(J21L*Xtn1 + J22L*Xtn2 + J23L*Xtn3) - + PDstandardNth3beta1*(J31L*Xtn1 + J32L*Xtn2 + J33L*Xtn3) + + gtu11*(2*J11L*J21L*PDstandardNth12beta1 + + 2*J11L*J31L*PDstandardNth13beta1 + dJ111L*PDstandardNth1beta1 + + 2*J21L*J31L*PDstandardNth23beta1 + dJ211L*PDstandardNth2beta1 + + dJ311L*PDstandardNth3beta1 + PDstandardNth11beta1*SQR(J11L) + + PDstandardNth22beta1*SQR(J21L) + PDstandardNth33beta1*SQR(J31L)) + + gtu22*(2*J12L*J22L*PDstandardNth12beta1 + + 2*J12L*J32L*PDstandardNth13beta1 + dJ122L*PDstandardNth1beta1 + + 2*J22L*J32L*PDstandardNth23beta1 + dJ222L*PDstandardNth2beta1 + + dJ322L*PDstandardNth3beta1 + PDstandardNth11beta1*SQR(J12L) + + PDstandardNth22beta1*SQR(J22L) + PDstandardNth33beta1*SQR(J32L)) + + gtu33*(2*J13L*J23L*PDstandardNth12beta1 + + 2*J13L*J33L*PDstandardNth13beta1 + dJ133L*PDstandardNth1beta1 + + 2*J23L*J33L*PDstandardNth23beta1 + dJ233L*PDstandardNth2beta1 + + dJ333L*PDstandardNth3beta1 + PDstandardNth11beta1*SQR(J13L) + + PDstandardNth22beta1*SQR(J23L) + PDstandardNth33beta1*SQR(J33L)) + + kthird*(gtu11*(J11L*J12L*PDstandardNth11beta2 + + J11L*J13L*PDstandardNth11beta3 + 2*J11L*J21L*PDstandardNth12beta1 + + J12L*J21L*PDstandardNth12beta2 + J11L*J22L*PDstandardNth12beta2 + + J13L*J21L*PDstandardNth12beta3 + J11L*J23L*PDstandardNth12beta3 + + 2*J11L*J31L*PDstandardNth13beta1 + J12L*J31L*PDstandardNth13beta2 + + J11L*J32L*PDstandardNth13beta2 + J13L*J31L*PDstandardNth13beta3 + + J11L*J33L*PDstandardNth13beta3 + dJ111L*PDstandardNth1beta1 + + dJ112L*PDstandardNth1beta2 + dJ113L*PDstandardNth1beta3 + + J21L*J22L*PDstandardNth22beta2 + J21L*J23L*PDstandardNth22beta3 + + 2*J21L*J31L*PDstandardNth23beta1 + J22L*J31L*PDstandardNth23beta2 + + J21L*J32L*PDstandardNth23beta2 + J23L*J31L*PDstandardNth23beta3 + + J21L*J33L*PDstandardNth23beta3 + dJ211L*PDstandardNth2beta1 + + dJ212L*PDstandardNth2beta2 + dJ213L*PDstandardNth2beta3 + + J31L*J32L*PDstandardNth33beta2 + J31L*J33L*PDstandardNth33beta3 + + dJ311L*PDstandardNth3beta1 + dJ312L*PDstandardNth3beta2 + + dJ313L*PDstandardNth3beta3 + PDstandardNth11beta1*SQR(J11L) + + PDstandardNth22beta1*SQR(J21L) + PDstandardNth33beta1*SQR(J31L)) + + gtu21*(J11L*J12L*PDstandardNth11beta1 + J12L*J13L*PDstandardNth11beta3 + + J12L*J21L*PDstandardNth12beta1 + J11L*J22L*PDstandardNth12beta1 + + 2*J12L*J22L*PDstandardNth12beta2 + J13L*J22L*PDstandardNth12beta3 + + J12L*J23L*PDstandardNth12beta3 + J12L*J31L*PDstandardNth13beta1 + + J11L*J32L*PDstandardNth13beta1 + 2*J12L*J32L*PDstandardNth13beta2 + + J13L*J32L*PDstandardNth13beta3 + J12L*J33L*PDstandardNth13beta3 + + dJ112L*PDstandardNth1beta1 + dJ122L*PDstandardNth1beta2 + + dJ123L*PDstandardNth1beta3 + J21L*J22L*PDstandardNth22beta1 + + J22L*J23L*PDstandardNth22beta3 + J22L*J31L*PDstandardNth23beta1 + + J21L*J32L*PDstandardNth23beta1 + 2*J22L*J32L*PDstandardNth23beta2 + + J23L*J32L*PDstandardNth23beta3 + J22L*J33L*PDstandardNth23beta3 + + dJ212L*PDstandardNth2beta1 + dJ222L*PDstandardNth2beta2 + + dJ223L*PDstandardNth2beta3 + J31L*J32L*PDstandardNth33beta1 + + J32L*J33L*PDstandardNth33beta3 + dJ312L*PDstandardNth3beta1 + + dJ322L*PDstandardNth3beta2 + dJ323L*PDstandardNth3beta3 + + PDstandardNth11beta2*SQR(J12L) + PDstandardNth22beta2*SQR(J22L) + + PDstandardNth33beta2*SQR(J32L)) + + gtu31*(J11L*J13L*PDstandardNth11beta1 + J12L*J13L*PDstandardNth11beta2 + + J13L*J21L*PDstandardNth12beta1 + J11L*J23L*PDstandardNth12beta1 + + J13L*J22L*PDstandardNth12beta2 + J12L*J23L*PDstandardNth12beta2 + + 2*J13L*J23L*PDstandardNth12beta3 + J13L*J31L*PDstandardNth13beta1 + + J11L*J33L*PDstandardNth13beta1 + J13L*J32L*PDstandardNth13beta2 + + J12L*J33L*PDstandardNth13beta2 + 2*J13L*J33L*PDstandardNth13beta3 + + dJ113L*PDstandardNth1beta1 + dJ123L*PDstandardNth1beta2 + + dJ133L*PDstandardNth1beta3 + J21L*J23L*PDstandardNth22beta1 + + J22L*J23L*PDstandardNth22beta2 + J23L*J31L*PDstandardNth23beta1 + + J21L*J33L*PDstandardNth23beta1 + J23L*J32L*PDstandardNth23beta2 + + J22L*J33L*PDstandardNth23beta2 + 2*J23L*J33L*PDstandardNth23beta3 + + dJ213L*PDstandardNth2beta1 + dJ223L*PDstandardNth2beta2 + + dJ233L*PDstandardNth2beta3 + J31L*J33L*PDstandardNth33beta1 + + J32L*J33L*PDstandardNth33beta2 + dJ313L*PDstandardNth3beta1 + + dJ323L*PDstandardNth3beta2 + dJ333L*PDstandardNth3beta3 + + PDstandardNth11beta3*SQR(J13L) + PDstandardNth22beta3*SQR(J23L) + + PDstandardNth33beta3*SQR(J33L))); + + Xt2rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1Xt2 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2Xt2 - + 2*((Atu21*J11L + Atu22*J12L + Atu32*J13L)*PDstandardNth1alpha + + (Atu21*J21L + Atu22*J22L + Atu32*J23L)*PDstandardNth2alpha + + (Atu21*J31L + Atu22*J32L + Atu32*J33L)*PDstandardNth3alpha) + + 2*(gtu21*(J11L*J12L*PDstandardNth11beta2 + J12L*J21L*PDstandardNth12beta2 + + J11L*J22L*PDstandardNth12beta2 + J12L*J31L*PDstandardNth13beta2 + + J11L*J32L*PDstandardNth13beta2 + dJ112L*PDstandardNth1beta2 + + J21L*J22L*PDstandardNth22beta2 + J22L*J31L*PDstandardNth23beta2 + + J21L*J32L*PDstandardNth23beta2 + dJ212L*PDstandardNth2beta2 + + J31L*J32L*PDstandardNth33beta2 + dJ312L*PDstandardNth3beta2) + + gtu31*(J11L*J13L*PDstandardNth11beta2 + J13L*J21L*PDstandardNth12beta2 + + J11L*J23L*PDstandardNth12beta2 + J13L*J31L*PDstandardNth13beta2 + + J11L*J33L*PDstandardNth13beta2 + dJ113L*PDstandardNth1beta2 + + J21L*J23L*PDstandardNth22beta2 + J23L*J31L*PDstandardNth23beta2 + + J21L*J33L*PDstandardNth23beta2 + dJ213L*PDstandardNth2beta2 + + J31L*J33L*PDstandardNth33beta2 + dJ313L*PDstandardNth3beta2) + + gtu32*(J12L*J13L*PDstandardNth11beta2 + J13L*J22L*PDstandardNth12beta2 + + J12L*J23L*PDstandardNth12beta2 + J13L*J32L*PDstandardNth13beta2 + + J12L*J33L*PDstandardNth13beta2 + dJ123L*PDstandardNth1beta2 + + J22L*J23L*PDstandardNth22beta2 + J23L*J32L*PDstandardNth23beta2 + + J22L*J33L*PDstandardNth23beta2 + dJ223L*PDstandardNth2beta2 + + J32L*J33L*PDstandardNth33beta2 + dJ323L*PDstandardNth3beta2) + + alphaL*(Atu11*Gt211 + 2*Atu21*Gt212 + 2*Atu31*Gt213 + Atu22*Gt222 + + 2*Atu32*Gt223 + Atu33*Gt233 + + 6*((Atu21*J11L + Atu22*J12L + Atu32*J13L)*PDstandardNth1phi + + (Atu21*J21L + Atu22*J22L + Atu32*J23L)*PDstandardNth2phi + + (Atu21*J31L + Atu22*J32L + Atu32*J33L)*PDstandardNth3phi) - + ktwothird*((gtu21*J11L + gtu22*J12L + gtu32*J13L)*PDstandardNth1trK + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*PDstandardNth2trK + + (gtu21*J31L + gtu22*J32L + gtu32*J33L)*PDstandardNth3trK))) + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3Xt2 - + 50.26548245743669181540229413247204614715*alphaL* + (gtu21*S1 + gtu22*S2 + gtu32*S3) + + ktwothird*(J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3)*Xtn2 - + PDstandardNth1beta2*(J11L*Xtn1 + J12L*Xtn2 + J13L*Xtn3) - + PDstandardNth2beta2*(J21L*Xtn1 + J22L*Xtn2 + J23L*Xtn3) - + PDstandardNth3beta2*(J31L*Xtn1 + J32L*Xtn2 + J33L*Xtn3) + + gtu11*(2*J11L*J21L*PDstandardNth12beta2 + + 2*J11L*J31L*PDstandardNth13beta2 + dJ111L*PDstandardNth1beta2 + + 2*J21L*J31L*PDstandardNth23beta2 + dJ211L*PDstandardNth2beta2 + + dJ311L*PDstandardNth3beta2 + PDstandardNth11beta2*SQR(J11L) + + PDstandardNth22beta2*SQR(J21L) + PDstandardNth33beta2*SQR(J31L)) + + gtu22*(2*J12L*J22L*PDstandardNth12beta2 + + 2*J12L*J32L*PDstandardNth13beta2 + dJ122L*PDstandardNth1beta2 + + 2*J22L*J32L*PDstandardNth23beta2 + dJ222L*PDstandardNth2beta2 + + dJ322L*PDstandardNth3beta2 + PDstandardNth11beta2*SQR(J12L) + + PDstandardNth22beta2*SQR(J22L) + PDstandardNth33beta2*SQR(J32L)) + + gtu33*(2*J13L*J23L*PDstandardNth12beta2 + + 2*J13L*J33L*PDstandardNth13beta2 + dJ133L*PDstandardNth1beta2 + + 2*J23L*J33L*PDstandardNth23beta2 + dJ233L*PDstandardNth2beta2 + + dJ333L*PDstandardNth3beta2 + PDstandardNth11beta2*SQR(J13L) + + PDstandardNth22beta2*SQR(J23L) + PDstandardNth33beta2*SQR(J33L)) + + kthird*(gtu21*(J11L*J12L*PDstandardNth11beta2 + + J11L*J13L*PDstandardNth11beta3 + 2*J11L*J21L*PDstandardNth12beta1 + + J12L*J21L*PDstandardNth12beta2 + J11L*J22L*PDstandardNth12beta2 + + J13L*J21L*PDstandardNth12beta3 + J11L*J23L*PDstandardNth12beta3 + + 2*J11L*J31L*PDstandardNth13beta1 + J12L*J31L*PDstandardNth13beta2 + + J11L*J32L*PDstandardNth13beta2 + J13L*J31L*PDstandardNth13beta3 + + J11L*J33L*PDstandardNth13beta3 + dJ111L*PDstandardNth1beta1 + + dJ112L*PDstandardNth1beta2 + dJ113L*PDstandardNth1beta3 + + J21L*J22L*PDstandardNth22beta2 + J21L*J23L*PDstandardNth22beta3 + + 2*J21L*J31L*PDstandardNth23beta1 + J22L*J31L*PDstandardNth23beta2 + + J21L*J32L*PDstandardNth23beta2 + J23L*J31L*PDstandardNth23beta3 + + J21L*J33L*PDstandardNth23beta3 + dJ211L*PDstandardNth2beta1 + + dJ212L*PDstandardNth2beta2 + dJ213L*PDstandardNth2beta3 + + J31L*J32L*PDstandardNth33beta2 + J31L*J33L*PDstandardNth33beta3 + + dJ311L*PDstandardNth3beta1 + dJ312L*PDstandardNth3beta2 + + dJ313L*PDstandardNth3beta3 + PDstandardNth11beta1*SQR(J11L) + + PDstandardNth22beta1*SQR(J21L) + PDstandardNth33beta1*SQR(J31L)) + + gtu22*(J11L*J12L*PDstandardNth11beta1 + J12L*J13L*PDstandardNth11beta3 + + J12L*J21L*PDstandardNth12beta1 + J11L*J22L*PDstandardNth12beta1 + + 2*J12L*J22L*PDstandardNth12beta2 + J13L*J22L*PDstandardNth12beta3 + + J12L*J23L*PDstandardNth12beta3 + J12L*J31L*PDstandardNth13beta1 + + J11L*J32L*PDstandardNth13beta1 + 2*J12L*J32L*PDstandardNth13beta2 + + J13L*J32L*PDstandardNth13beta3 + J12L*J33L*PDstandardNth13beta3 + + dJ112L*PDstandardNth1beta1 + dJ122L*PDstandardNth1beta2 + + dJ123L*PDstandardNth1beta3 + J21L*J22L*PDstandardNth22beta1 + + J22L*J23L*PDstandardNth22beta3 + J22L*J31L*PDstandardNth23beta1 + + J21L*J32L*PDstandardNth23beta1 + 2*J22L*J32L*PDstandardNth23beta2 + + J23L*J32L*PDstandardNth23beta3 + J22L*J33L*PDstandardNth23beta3 + + dJ212L*PDstandardNth2beta1 + dJ222L*PDstandardNth2beta2 + + dJ223L*PDstandardNth2beta3 + J31L*J32L*PDstandardNth33beta1 + + J32L*J33L*PDstandardNth33beta3 + dJ312L*PDstandardNth3beta1 + + dJ322L*PDstandardNth3beta2 + dJ323L*PDstandardNth3beta3 + + PDstandardNth11beta2*SQR(J12L) + PDstandardNth22beta2*SQR(J22L) + + PDstandardNth33beta2*SQR(J32L)) + + gtu32*(J11L*J13L*PDstandardNth11beta1 + J12L*J13L*PDstandardNth11beta2 + + J13L*J21L*PDstandardNth12beta1 + J11L*J23L*PDstandardNth12beta1 + + J13L*J22L*PDstandardNth12beta2 + J12L*J23L*PDstandardNth12beta2 + + 2*J13L*J23L*PDstandardNth12beta3 + J13L*J31L*PDstandardNth13beta1 + + J11L*J33L*PDstandardNth13beta1 + J13L*J32L*PDstandardNth13beta2 + + J12L*J33L*PDstandardNth13beta2 + 2*J13L*J33L*PDstandardNth13beta3 + + dJ113L*PDstandardNth1beta1 + dJ123L*PDstandardNth1beta2 + + dJ133L*PDstandardNth1beta3 + J21L*J23L*PDstandardNth22beta1 + + J22L*J23L*PDstandardNth22beta2 + J23L*J31L*PDstandardNth23beta1 + + J21L*J33L*PDstandardNth23beta1 + J23L*J32L*PDstandardNth23beta2 + + J22L*J33L*PDstandardNth23beta2 + 2*J23L*J33L*PDstandardNth23beta3 + + dJ213L*PDstandardNth2beta1 + dJ223L*PDstandardNth2beta2 + + dJ233L*PDstandardNth2beta3 + J31L*J33L*PDstandardNth33beta1 + + J32L*J33L*PDstandardNth33beta2 + dJ313L*PDstandardNth3beta1 + + dJ323L*PDstandardNth3beta2 + dJ333L*PDstandardNth3beta3 + + PDstandardNth11beta3*SQR(J13L) + PDstandardNth22beta3*SQR(J23L) + + PDstandardNth33beta3*SQR(J33L))); + + Xt3rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1Xt3 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2Xt3 - + 2*((Atu31*J11L + Atu32*J12L + Atu33*J13L)*PDstandardNth1alpha + + (Atu31*J21L + Atu32*J22L + Atu33*J23L)*PDstandardNth2alpha + + (Atu31*J31L + Atu32*J32L + Atu33*J33L)*PDstandardNth3alpha) + + 2*(gtu21*(J11L*J12L*PDstandardNth11beta3 + J12L*J21L*PDstandardNth12beta3 + + J11L*J22L*PDstandardNth12beta3 + J12L*J31L*PDstandardNth13beta3 + + J11L*J32L*PDstandardNth13beta3 + dJ112L*PDstandardNth1beta3 + + J21L*J22L*PDstandardNth22beta3 + J22L*J31L*PDstandardNth23beta3 + + J21L*J32L*PDstandardNth23beta3 + dJ212L*PDstandardNth2beta3 + + J31L*J32L*PDstandardNth33beta3 + dJ312L*PDstandardNth3beta3) + + gtu31*(J11L*J13L*PDstandardNth11beta3 + J13L*J21L*PDstandardNth12beta3 + + J11L*J23L*PDstandardNth12beta3 + J13L*J31L*PDstandardNth13beta3 + + J11L*J33L*PDstandardNth13beta3 + dJ113L*PDstandardNth1beta3 + + J21L*J23L*PDstandardNth22beta3 + J23L*J31L*PDstandardNth23beta3 + + J21L*J33L*PDstandardNth23beta3 + dJ213L*PDstandardNth2beta3 + + J31L*J33L*PDstandardNth33beta3 + dJ313L*PDstandardNth3beta3) + + gtu32*(J12L*J13L*PDstandardNth11beta3 + J13L*J22L*PDstandardNth12beta3 + + J12L*J23L*PDstandardNth12beta3 + J13L*J32L*PDstandardNth13beta3 + + J12L*J33L*PDstandardNth13beta3 + dJ123L*PDstandardNth1beta3 + + J22L*J23L*PDstandardNth22beta3 + J23L*J32L*PDstandardNth23beta3 + + J22L*J33L*PDstandardNth23beta3 + dJ223L*PDstandardNth2beta3 + + J32L*J33L*PDstandardNth33beta3 + dJ323L*PDstandardNth3beta3) + + alphaL*(Atu11*Gt311 + 2*Atu21*Gt312 + 2*Atu31*Gt313 + Atu22*Gt322 + + 2*Atu32*Gt323 + Atu33*Gt333 + + 6*((Atu31*J11L + Atu32*J12L + Atu33*J13L)*PDstandardNth1phi + + (Atu31*J21L + Atu32*J22L + Atu33*J23L)*PDstandardNth2phi + + (Atu31*J31L + Atu32*J32L + Atu33*J33L)*PDstandardNth3phi) - + ktwothird*((gtu31*J11L + gtu32*J12L + gtu33*J13L)*PDstandardNth1trK + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*PDstandardNth2trK + + (gtu31*J31L + gtu32*J32L + gtu33*J33L)*PDstandardNth3trK))) + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3Xt3 - + 50.26548245743669181540229413247204614715*alphaL* + (gtu31*S1 + gtu32*S2 + gtu33*S3) + + ktwothird*(J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3)*Xtn3 - + PDstandardNth1beta3*(J11L*Xtn1 + J12L*Xtn2 + J13L*Xtn3) - + PDstandardNth2beta3*(J21L*Xtn1 + J22L*Xtn2 + J23L*Xtn3) - + PDstandardNth3beta3*(J31L*Xtn1 + J32L*Xtn2 + J33L*Xtn3) + + gtu11*(2*J11L*J21L*PDstandardNth12beta3 + + 2*J11L*J31L*PDstandardNth13beta3 + dJ111L*PDstandardNth1beta3 + + 2*J21L*J31L*PDstandardNth23beta3 + dJ211L*PDstandardNth2beta3 + + dJ311L*PDstandardNth3beta3 + PDstandardNth11beta3*SQR(J11L) + + PDstandardNth22beta3*SQR(J21L) + PDstandardNth33beta3*SQR(J31L)) + + gtu22*(2*J12L*J22L*PDstandardNth12beta3 + + 2*J12L*J32L*PDstandardNth13beta3 + dJ122L*PDstandardNth1beta3 + + 2*J22L*J32L*PDstandardNth23beta3 + dJ222L*PDstandardNth2beta3 + + dJ322L*PDstandardNth3beta3 + PDstandardNth11beta3*SQR(J12L) + + PDstandardNth22beta3*SQR(J22L) + PDstandardNth33beta3*SQR(J32L)) + + gtu33*(2*J13L*J23L*PDstandardNth12beta3 + + 2*J13L*J33L*PDstandardNth13beta3 + dJ133L*PDstandardNth1beta3 + + 2*J23L*J33L*PDstandardNth23beta3 + dJ233L*PDstandardNth2beta3 + + dJ333L*PDstandardNth3beta3 + PDstandardNth11beta3*SQR(J13L) + + PDstandardNth22beta3*SQR(J23L) + PDstandardNth33beta3*SQR(J33L)) + + kthird*(gtu31*(J11L*J12L*PDstandardNth11beta2 + + J11L*J13L*PDstandardNth11beta3 + 2*J11L*J21L*PDstandardNth12beta1 + + J12L*J21L*PDstandardNth12beta2 + J11L*J22L*PDstandardNth12beta2 + + J13L*J21L*PDstandardNth12beta3 + J11L*J23L*PDstandardNth12beta3 + + 2*J11L*J31L*PDstandardNth13beta1 + J12L*J31L*PDstandardNth13beta2 + + J11L*J32L*PDstandardNth13beta2 + J13L*J31L*PDstandardNth13beta3 + + J11L*J33L*PDstandardNth13beta3 + dJ111L*PDstandardNth1beta1 + + dJ112L*PDstandardNth1beta2 + dJ113L*PDstandardNth1beta3 + + J21L*J22L*PDstandardNth22beta2 + J21L*J23L*PDstandardNth22beta3 + + 2*J21L*J31L*PDstandardNth23beta1 + J22L*J31L*PDstandardNth23beta2 + + J21L*J32L*PDstandardNth23beta2 + J23L*J31L*PDstandardNth23beta3 + + J21L*J33L*PDstandardNth23beta3 + dJ211L*PDstandardNth2beta1 + + dJ212L*PDstandardNth2beta2 + dJ213L*PDstandardNth2beta3 + + J31L*J32L*PDstandardNth33beta2 + J31L*J33L*PDstandardNth33beta3 + + dJ311L*PDstandardNth3beta1 + dJ312L*PDstandardNth3beta2 + + dJ313L*PDstandardNth3beta3 + PDstandardNth11beta1*SQR(J11L) + + PDstandardNth22beta1*SQR(J21L) + PDstandardNth33beta1*SQR(J31L)) + + gtu32*(J11L*J12L*PDstandardNth11beta1 + J12L*J13L*PDstandardNth11beta3 + + J12L*J21L*PDstandardNth12beta1 + J11L*J22L*PDstandardNth12beta1 + + 2*J12L*J22L*PDstandardNth12beta2 + J13L*J22L*PDstandardNth12beta3 + + J12L*J23L*PDstandardNth12beta3 + J12L*J31L*PDstandardNth13beta1 + + J11L*J32L*PDstandardNth13beta1 + 2*J12L*J32L*PDstandardNth13beta2 + + J13L*J32L*PDstandardNth13beta3 + J12L*J33L*PDstandardNth13beta3 + + dJ112L*PDstandardNth1beta1 + dJ122L*PDstandardNth1beta2 + + dJ123L*PDstandardNth1beta3 + J21L*J22L*PDstandardNth22beta1 + + J22L*J23L*PDstandardNth22beta3 + J22L*J31L*PDstandardNth23beta1 + + J21L*J32L*PDstandardNth23beta1 + 2*J22L*J32L*PDstandardNth23beta2 + + J23L*J32L*PDstandardNth23beta3 + J22L*J33L*PDstandardNth23beta3 + + dJ212L*PDstandardNth2beta1 + dJ222L*PDstandardNth2beta2 + + dJ223L*PDstandardNth2beta3 + J31L*J32L*PDstandardNth33beta1 + + J32L*J33L*PDstandardNth33beta3 + dJ312L*PDstandardNth3beta1 + + dJ322L*PDstandardNth3beta2 + dJ323L*PDstandardNth3beta3 + + PDstandardNth11beta2*SQR(J12L) + PDstandardNth22beta2*SQR(J22L) + + PDstandardNth33beta2*SQR(J32L)) + + gtu33*(J11L*J13L*PDstandardNth11beta1 + J12L*J13L*PDstandardNth11beta2 + + J13L*J21L*PDstandardNth12beta1 + J11L*J23L*PDstandardNth12beta1 + + J13L*J22L*PDstandardNth12beta2 + J12L*J23L*PDstandardNth12beta2 + + 2*J13L*J23L*PDstandardNth12beta3 + J13L*J31L*PDstandardNth13beta1 + + J11L*J33L*PDstandardNth13beta1 + J13L*J32L*PDstandardNth13beta2 + + J12L*J33L*PDstandardNth13beta2 + 2*J13L*J33L*PDstandardNth13beta3 + + dJ113L*PDstandardNth1beta1 + dJ123L*PDstandardNth1beta2 + + dJ133L*PDstandardNth1beta3 + J21L*J23L*PDstandardNth22beta1 + + J22L*J23L*PDstandardNth22beta2 + J23L*J31L*PDstandardNth23beta1 + + J21L*J33L*PDstandardNth23beta1 + J23L*J32L*PDstandardNth23beta2 + + J22L*J33L*PDstandardNth23beta2 + 2*J23L*J33L*PDstandardNth23beta3 + + dJ213L*PDstandardNth2beta1 + dJ223L*PDstandardNth2beta2 + + dJ233L*PDstandardNth2beta3 + J31L*J33L*PDstandardNth33beta1 + + J32L*J33L*PDstandardNth33beta2 + dJ313L*PDstandardNth3beta1 + + dJ323L*PDstandardNth3beta2 + dJ333L*PDstandardNth3beta3 + + PDstandardNth11beta3*SQR(J13L) + PDstandardNth22beta3*SQR(J23L) + + PDstandardNth33beta3*SQR(J33L))); + + trKrhsL = (-(dJ111L*gu11) - 2*dJ112L*gu21 - dJ122L*gu22 - 2*dJ113L*gu31 - + 2*dJ123L*gu32 - dJ133L*gu33 + G111*gu11*J11L + 2*G112*gu21*J11L + + G122*gu22*J11L + 2*G113*gu31*J11L + 2*G123*gu32*J11L + G133*gu33*J11L + + G211*gu11*J12L + 2*G212*gu21*J12L + G222*gu22*J12L + 2*G213*gu31*J12L + + 2*G223*gu32*J12L + G233*gu33*J12L + G311*gu11*J13L + 2*G312*gu21*J13L + + G322*gu22*J13L + 2*G313*gu31*J13L + 2*G323*gu32*J13L + G333*gu33*J13L)* + PDstandardNth1alpha + (beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1trK + (-(dJ211L*gu11) - 2*dJ212L*gu21 - dJ222L*gu22 - + 2*dJ213L*gu31 - 2*dJ223L*gu32 - dJ233L*gu33 + G111*gu11*J21L + + 2*G112*gu21*J21L + G122*gu22*J21L + 2*G113*gu31*J21L + + 2*G123*gu32*J21L + G133*gu33*J21L + G211*gu11*J22L + 2*G212*gu21*J22L + + G222*gu22*J22L + 2*G213*gu31*J22L + 2*G223*gu32*J22L + G233*gu33*J22L + + G311*gu11*J23L + 2*G312*gu21*J23L + G322*gu22*J23L + 2*G313*gu31*J23L + + 2*G323*gu32*J23L + G333*gu33*J23L)*PDstandardNth2alpha + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2trK - + dJ311L*gu11*PDstandardNth3alpha - dJ322L*gu22*PDstandardNth3alpha - + 2*dJ313L*gu31*PDstandardNth3alpha - 2*dJ323L*gu32*PDstandardNth3alpha - + dJ333L*gu33*PDstandardNth3alpha + G111*gu11*J31L*PDstandardNth3alpha + + G122*gu22*J31L*PDstandardNth3alpha + 2*G113*gu31*J31L*PDstandardNth3alpha + + 2*G123*gu32*J31L*PDstandardNth3alpha + G133*gu33*J31L*PDstandardNth3alpha + + G211*gu11*J32L*PDstandardNth3alpha + 2*G212*gu21*J32L*PDstandardNth3alpha + + G222*gu22*J32L*PDstandardNth3alpha + 2*G213*gu31*J32L*PDstandardNth3alpha + + 2*G223*gu32*J32L*PDstandardNth3alpha + G233*gu33*J32L*PDstandardNth3alpha + + G311*gu11*J33L*PDstandardNth3alpha + 2*G312*gu21*J33L*PDstandardNth3alpha + + G322*gu22*J33L*PDstandardNth3alpha + 2*G313*gu31*J33L*PDstandardNth3alpha + + 2*G323*gu32*J33L*PDstandardNth3alpha + G333*gu33*J33L*PDstandardNth3alpha - + 2*(gu21*J11L*J12L*PDstandardNth11alpha + + gu31*J11L*J13L*PDstandardNth11alpha + + gu32*J12L*J13L*PDstandardNth11alpha + + gu11*J11L*J21L*PDstandardNth12alpha + + gu21*J12L*J21L*PDstandardNth12alpha + + gu31*J13L*J21L*PDstandardNth12alpha + + gu21*J11L*J22L*PDstandardNth12alpha + + gu22*J12L*J22L*PDstandardNth12alpha + + gu32*J13L*J22L*PDstandardNth12alpha + + gu31*J11L*J23L*PDstandardNth12alpha + + gu32*J12L*J23L*PDstandardNth12alpha + + gu33*J13L*J23L*PDstandardNth12alpha + + gu11*J11L*J31L*PDstandardNth13alpha + + gu21*J12L*J31L*PDstandardNth13alpha + + gu31*J13L*J31L*PDstandardNth13alpha + + gu21*J11L*J32L*PDstandardNth13alpha + + gu22*J12L*J32L*PDstandardNth13alpha + + gu32*J13L*J32L*PDstandardNth13alpha + + gu31*J11L*J33L*PDstandardNth13alpha + + gu32*J12L*J33L*PDstandardNth13alpha + + gu33*J13L*J33L*PDstandardNth13alpha + + gu21*J21L*J22L*PDstandardNth22alpha + + gu31*J21L*J23L*PDstandardNth22alpha + + gu32*J22L*J23L*PDstandardNth22alpha + + gu11*J21L*J31L*PDstandardNth23alpha + + gu21*J22L*J31L*PDstandardNth23alpha + + gu31*J23L*J31L*PDstandardNth23alpha + + gu21*J21L*J32L*PDstandardNth23alpha + + gu22*J22L*J32L*PDstandardNth23alpha + + gu32*J23L*J32L*PDstandardNth23alpha + + gu31*J21L*J33L*PDstandardNth23alpha + + gu32*J22L*J33L*PDstandardNth23alpha + + gu33*J23L*J33L*PDstandardNth23alpha + + gu21*J31L*J32L*PDstandardNth33alpha + + gu31*J31L*J33L*PDstandardNth33alpha + + gu32*J32L*J33L*PDstandardNth33alpha + dJ312L*gu21*PDstandardNth3alpha) + + 2*(alphaL*Atm12*Atm21 + alphaL*Atm13*Atm31 + alphaL*Atm23*Atm32 + + G112*gu21*J31L*PDstandardNth3alpha) + beta1L*J31L*PDstandardNth3trK + + beta2L*J32L*PDstandardNth3trK + beta3L*J33L*PDstandardNth3trK + + 12.56637061435917295385057353311801153679*alphaL*rho + + 12.56637061435917295385057353311801153679*alphaL*trS + alphaL*SQR(Atm11) + + alphaL*SQR(Atm22) + alphaL*SQR(Atm33) - + gu11*PDstandardNth11alpha*SQR(J11L) - gu22*PDstandardNth11alpha*SQR(J12L) - + gu33*PDstandardNth11alpha*SQR(J13L) - gu11*PDstandardNth22alpha*SQR(J21L) - + gu22*PDstandardNth22alpha*SQR(J22L) - gu33*PDstandardNth22alpha*SQR(J23L) - + gu11*PDstandardNth33alpha*SQR(J31L) - gu22*PDstandardNth33alpha*SQR(J32L) - + gu33*PDstandardNth33alpha*SQR(J33L) + alphaL*kthird*SQR(trKL); + + Ats11 = (-dJ111L + G111*J11L + G211*J12L + G311*J13L)*PDstandardNth1alpha - + 2*(J11L*J21L*PDstandardNth12alpha + J11L*J31L*PDstandardNth13alpha + + J21L*J31L*PDstandardNth23alpha) + + (-dJ211L + G111*J21L + G211*J22L + G311*J23L)*PDstandardNth2alpha + + (-dJ311L + G111*J31L + G211*J32L + G311*J33L)*PDstandardNth3alpha + + alphaL*R11 - PDstandardNth11alpha*SQR(J11L) - + PDstandardNth22alpha*SQR(J21L) - PDstandardNth33alpha*SQR(J31L); + + Ats12 = -(J11L*J12L*PDstandardNth11alpha) - J12L*J21L*PDstandardNth12alpha - + J11L*J22L*PDstandardNth12alpha - J12L*J31L*PDstandardNth13alpha - + J11L*J32L*PDstandardNth13alpha + + (-dJ112L + G112*J11L + G212*J12L + G312*J13L)*PDstandardNth1alpha - + J21L*J22L*PDstandardNth22alpha - J22L*J31L*PDstandardNth23alpha - + J21L*J32L*PDstandardNth23alpha + + (-dJ212L + G112*J21L + G212*J22L + G312*J23L)*PDstandardNth2alpha - + J31L*J32L*PDstandardNth33alpha - dJ312L*PDstandardNth3alpha + + G112*J31L*PDstandardNth3alpha + G212*J32L*PDstandardNth3alpha + + G312*J33L*PDstandardNth3alpha + alphaL*R12; + + Ats13 = -(J11L*J13L*PDstandardNth11alpha) - J13L*J21L*PDstandardNth12alpha - + J11L*J23L*PDstandardNth12alpha - J13L*J31L*PDstandardNth13alpha - + J11L*J33L*PDstandardNth13alpha + + (-dJ113L + G113*J11L + G213*J12L + G313*J13L)*PDstandardNth1alpha - + J21L*J23L*PDstandardNth22alpha - J23L*J31L*PDstandardNth23alpha - + J21L*J33L*PDstandardNth23alpha + + (-dJ213L + G113*J21L + G213*J22L + G313*J23L)*PDstandardNth2alpha - + J31L*J33L*PDstandardNth33alpha - dJ313L*PDstandardNth3alpha + + G113*J31L*PDstandardNth3alpha + G213*J32L*PDstandardNth3alpha + + G313*J33L*PDstandardNth3alpha + alphaL*R13; + + Ats22 = (-dJ122L + G122*J11L + G222*J12L + G322*J13L)*PDstandardNth1alpha - + 2*(J12L*J22L*PDstandardNth12alpha + J12L*J32L*PDstandardNth13alpha + + J22L*J32L*PDstandardNth23alpha) + + (-dJ222L + G122*J21L + G222*J22L + G322*J23L)*PDstandardNth2alpha + + (-dJ322L + G122*J31L + G222*J32L + G322*J33L)*PDstandardNth3alpha + + alphaL*R22 - PDstandardNth11alpha*SQR(J12L) - + PDstandardNth22alpha*SQR(J22L) - PDstandardNth33alpha*SQR(J32L); + + Ats23 = -(J12L*J13L*PDstandardNth11alpha) - J13L*J22L*PDstandardNth12alpha - + J12L*J23L*PDstandardNth12alpha - J13L*J32L*PDstandardNth13alpha - + J12L*J33L*PDstandardNth13alpha + + (-dJ123L + G123*J11L + G223*J12L + G323*J13L)*PDstandardNth1alpha - + J22L*J23L*PDstandardNth22alpha - J23L*J32L*PDstandardNth23alpha - + J22L*J33L*PDstandardNth23alpha + + (-dJ223L + G123*J21L + G223*J22L + G323*J23L)*PDstandardNth2alpha - + J32L*J33L*PDstandardNth33alpha - dJ323L*PDstandardNth3alpha + + G123*J31L*PDstandardNth3alpha + G223*J32L*PDstandardNth3alpha + + G323*J33L*PDstandardNth3alpha + alphaL*R23; + + Ats33 = (-dJ133L + G133*J11L + G233*J12L + G333*J13L)*PDstandardNth1alpha - + 2*(J13L*J23L*PDstandardNth12alpha + J13L*J33L*PDstandardNth13alpha + + J23L*J33L*PDstandardNth23alpha) + + (-dJ233L + G133*J21L + G233*J22L + G333*J23L)*PDstandardNth2alpha + + (-dJ333L + G133*J31L + G233*J32L + G333*J33L)*PDstandardNth3alpha + + alphaL*R33 - PDstandardNth11alpha*SQR(J13L) - + PDstandardNth22alpha*SQR(J23L) - PDstandardNth33alpha*SQR(J33L); + + trAts = Ats11*gu11 + Ats22*gu22 + 2*(Ats12*gu21 + Ats13*gu31 + Ats23*gu32) + + Ats33*gu33; + + At11rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1At11 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2At11 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3At11 - + At11L*ktwothird*(J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3) + + 2*(J11L*(At11L*PDstandardNth1beta1 + At12L*PDstandardNth1beta2 + + At13L*PDstandardNth1beta3) + + J21L*(At11L*PDstandardNth2beta1 + At12L*PDstandardNth2beta2 + + At13L*PDstandardNth2beta3) + + J31L*(At11L*PDstandardNth3beta1 + At12L*PDstandardNth3beta2 + + At13L*PDstandardNth3beta3)) + + alphaL*(-2*(At11L*Atm11 + At12L*Atm21 + At13L*Atm31) + At11L*trKL) + + em4phi*(Ats11 - g11*kthird*trAts - + 25.13274122871834590770114706623602307358*alphaL*(T11 - g11*kthird*trS)); + + At12rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1At12 + + (0.3333333333333333333333333333333333333333*At12L*J11L + At11L*J12L)* + PDstandardNth1beta1 + (At22L*J11L + + 0.3333333333333333333333333333333333333333*At12L*J12L)* + PDstandardNth1beta2 + (At23L*J11L + At13L*J12L - + 0.6666666666666666666666666666666666666667*At12L*J13L)* + PDstandardNth1beta3 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2At12 + (0.3333333333333333333333333333333333333333*At12L* + J21L + At11L*J22L)*PDstandardNth2beta1 + + (At22L*J21L + 0.3333333333333333333333333333333333333333*At12L*J22L)* + PDstandardNth2beta2 + (At23L*J21L + At13L*J22L - + 0.6666666666666666666666666666666666666667*At12L*J23L)* + PDstandardNth2beta3 + (beta1L*J31L + beta2L*J32L + beta3L*J33L)* + PDstandardNth3At12 + (0.3333333333333333333333333333333333333333*At12L* + J31L + At11L*J32L)*PDstandardNth3beta1 + + (At22L*J31L + 0.3333333333333333333333333333333333333333*At12L*J32L)* + PDstandardNth3beta2 + (At23L*J31L + At13L*J32L - + 0.6666666666666666666666666666666666666667*At12L*J33L)* + PDstandardNth3beta3 + alphaL* + (-2.*(At11L*Atm12 + At12L*Atm22 + At13L*Atm32) + At12L*trKL) + + em4phi*(Ats12 - 0.3333333333333333333333333333333333333333*g12*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T12 + + 8.377580409572781969233715688745341024526*g12*trS)); + + At13rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1At13 + + (0.3333333333333333333333333333333333333333*At13L*J11L + At11L*J13L)* + PDstandardNth1beta1 + (At23L*J11L - + 0.6666666666666666666666666666666666666667*At13L*J12L + At12L*J13L)* + PDstandardNth1beta2 + (At33L*J11L + + 0.3333333333333333333333333333333333333333*At13L*J13L)* + PDstandardNth1beta3 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2At13 + (0.3333333333333333333333333333333333333333*At13L* + J21L + At11L*J23L)*PDstandardNth2beta1 + + (At23L*J21L - 0.6666666666666666666666666666666666666667*At13L*J22L + + At12L*J23L)*PDstandardNth2beta2 + + (At33L*J21L + 0.3333333333333333333333333333333333333333*At13L*J23L)* + PDstandardNth2beta3 + (beta1L*J31L + beta2L*J32L + beta3L*J33L)* + PDstandardNth3At13 + (0.3333333333333333333333333333333333333333*At13L* + J31L + At11L*J33L)*PDstandardNth3beta1 + + (At23L*J31L - 0.6666666666666666666666666666666666666667*At13L*J32L + + At12L*J33L)*PDstandardNth3beta2 + + (At33L*J31L + 0.3333333333333333333333333333333333333333*At13L*J33L)* + PDstandardNth3beta3 + alphaL* + (-2.*(At11L*Atm13 + At12L*Atm23 + At13L*Atm33) + At13L*trKL) + + em4phi*(Ats13 - 0.3333333333333333333333333333333333333333*g13*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T13 + + 8.377580409572781969233715688745341024526*g13*trS)); + + At22rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1At22 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2At22 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3At22 - + At22L*ktwothird*(J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3) + + 2*(J12L*(At12L*PDstandardNth1beta1 + At22L*PDstandardNth1beta2 + + At23L*PDstandardNth1beta3) + + J22L*(At12L*PDstandardNth2beta1 + At22L*PDstandardNth2beta2 + + At23L*PDstandardNth2beta3) + + J32L*(At12L*PDstandardNth3beta1 + At22L*PDstandardNth3beta2 + + At23L*PDstandardNth3beta3)) + + alphaL*(-2*(At12L*Atm12 + At22L*Atm22 + At23L*Atm32) + At22L*trKL) + + em4phi*(Ats22 - g22*kthird*trAts - + 25.13274122871834590770114706623602307358*alphaL*(T22 - g22*kthird*trS)); + + At23rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1At23 + + (-0.6666666666666666666666666666666666666667*At23L*J11L + At13L*J12L + + At12L*J13L)*PDstandardNth1beta1 + + (0.3333333333333333333333333333333333333333*At23L*J12L + At22L*J13L)* + PDstandardNth1beta2 + (At33L*J12L + + 0.3333333333333333333333333333333333333333*At23L*J13L)* + PDstandardNth1beta3 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2At23 + (-0.6666666666666666666666666666666666666667*At23L* + J21L + At13L*J22L + At12L*J23L)*PDstandardNth2beta1 + + (0.3333333333333333333333333333333333333333*At23L*J22L + At22L*J23L)* + PDstandardNth2beta2 + (At33L*J22L + + 0.3333333333333333333333333333333333333333*At23L*J23L)* + PDstandardNth2beta3 + (beta1L*J31L + beta2L*J32L + beta3L*J33L)* + PDstandardNth3At23 + (-0.6666666666666666666666666666666666666667*At23L* + J31L + At13L*J32L + At12L*J33L)*PDstandardNth3beta1 + + (0.3333333333333333333333333333333333333333*At23L*J32L + At22L*J33L)* + PDstandardNth3beta2 + (At33L*J32L + + 0.3333333333333333333333333333333333333333*At23L*J33L)* + PDstandardNth3beta3 + alphaL* + (-2.*(At12L*Atm13 + At22L*Atm23 + At23L*Atm33) + At23L*trKL) + + em4phi*(Ats23 - 0.3333333333333333333333333333333333333333*g23*trAts + + alphaL*(-25.13274122871834590770114706623602307358*T23 + + 8.377580409572781969233715688745341024526*g23*trS)); + + At33rhsL = (beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1At33 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2At33 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3At33 - + At33L*ktwothird*(J11L*PDstandardNth1beta1 + J12L*PDstandardNth1beta2 + + J13L*PDstandardNth1beta3 + J21L*PDstandardNth2beta1 + + J22L*PDstandardNth2beta2 + J23L*PDstandardNth2beta3 + + J31L*PDstandardNth3beta1 + J32L*PDstandardNth3beta2 + + J33L*PDstandardNth3beta3) + + 2*(J13L*(At13L*PDstandardNth1beta1 + At23L*PDstandardNth1beta2 + + At33L*PDstandardNth1beta3) + + J23L*(At13L*PDstandardNth2beta1 + At23L*PDstandardNth2beta2 + + At33L*PDstandardNth2beta3) + + J33L*(At13L*PDstandardNth3beta1 + At23L*PDstandardNth3beta2 + + At33L*PDstandardNth3beta3)) + + alphaL*(-2*(At13L*Atm13 + At23L*Atm23 + At33L*Atm33) + At33L*trKL) + + em4phi*(Ats33 - g33*kthird*trAts - + 25.13274122871834590770114706623602307358*alphaL*(T33 - g33*kthird*trS)); + + alpharhsL = LapseAdvectionCoeff* + ((beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1alpha + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2alpha + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3alpha) + + harmonicF*(AL*(-1 + LapseAdvectionCoeff) - LapseAdvectionCoeff*trKL)* + pow(alphaL,harmonicN); + + ArhsL = (-1 + LapseAdvectionCoeff)*(AL*AlphaDriver - trKrhsL); + + beta1rhsL = ((beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1beta1 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2beta1 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3beta1)* + ShiftAdvectionCoeff + B1L*ShiftGammaCoeff; + + beta2rhsL = ((beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1beta2 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2beta2 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3beta2)* + ShiftAdvectionCoeff + B2L*ShiftGammaCoeff; + + beta3rhsL = ((beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1beta3 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2beta3 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3beta3)* + ShiftAdvectionCoeff + B3L*ShiftGammaCoeff; + + B1rhsL = -(B1L*BetaDriver) + (beta1L* + (J11L*(PDstandardNth1B1 - PDstandardNth1Xt1) + + J21L*(PDstandardNth2B1 - PDstandardNth2Xt1) + + J31L*(PDstandardNth3B1 - PDstandardNth3Xt1)) + + beta2L*(J12L*(PDstandardNth1B1 - PDstandardNth1Xt1) + + J22L*(PDstandardNth2B1 - PDstandardNth2Xt1) + + J32L*(PDstandardNth3B1 - PDstandardNth3Xt1)) + + beta3L*(J13L*(PDstandardNth1B1 - PDstandardNth1Xt1) + + J23L*(PDstandardNth2B1 - PDstandardNth2Xt1) + + J33L*(PDstandardNth3B1 - PDstandardNth3Xt1)))*ShiftAdvectionCoeff + + Xt1rhsL; + + B2rhsL = -(B2L*BetaDriver) + (beta1L* + (J11L*(PDstandardNth1B2 - PDstandardNth1Xt2) + + J21L*(PDstandardNth2B2 - PDstandardNth2Xt2) + + J31L*(PDstandardNth3B2 - PDstandardNth3Xt2)) + + beta2L*(J12L*(PDstandardNth1B2 - PDstandardNth1Xt2) + + J22L*(PDstandardNth2B2 - PDstandardNth2Xt2) + + J32L*(PDstandardNth3B2 - PDstandardNth3Xt2)) + + beta3L*(J13L*(PDstandardNth1B2 - PDstandardNth1Xt2) + + J23L*(PDstandardNth2B2 - PDstandardNth2Xt2) + + J33L*(PDstandardNth3B2 - PDstandardNth3Xt2)))*ShiftAdvectionCoeff + + Xt2rhsL; + + B3rhsL = -(B3L*BetaDriver) + (beta1L* + (J11L*(PDstandardNth1B3 - PDstandardNth1Xt3) + + J21L*(PDstandardNth2B3 - PDstandardNth2Xt3) + + J31L*(PDstandardNth3B3 - PDstandardNth3Xt3)) + + beta2L*(J12L*(PDstandardNth1B3 - PDstandardNth1Xt3) + + J22L*(PDstandardNth2B3 - PDstandardNth2Xt3) + + J32L*(PDstandardNth3B3 - PDstandardNth3Xt3)) + + beta3L*(J13L*(PDstandardNth1B3 - PDstandardNth1Xt3) + + J23L*(PDstandardNth2B3 - PDstandardNth2Xt3) + + J33L*(PDstandardNth3B3 - PDstandardNth3Xt3)))*ShiftAdvectionCoeff + + Xt3rhsL; + + + /* Copy local copies back to grid functions */ + alpharhs[index] = alpharhsL; + Arhs[index] = ArhsL; + At11rhs[index] = At11rhsL; + At12rhs[index] = At12rhsL; + At13rhs[index] = At13rhsL; + At22rhs[index] = At22rhsL; + At23rhs[index] = At23rhsL; + At33rhs[index] = At33rhsL; + B1rhs[index] = B1rhsL; + B2rhs[index] = B2rhsL; + B3rhs[index] = B3rhsL; + beta1rhs[index] = beta1rhsL; + beta2rhs[index] = beta2rhsL; + beta3rhs[index] = beta3rhsL; + gt11rhs[index] = gt11rhsL; + gt12rhs[index] = gt12rhsL; + gt13rhs[index] = gt13rhsL; + gt22rhs[index] = gt22rhsL; + gt23rhs[index] = gt23rhsL; + gt33rhs[index] = gt33rhsL; + phirhs[index] = phirhsL; + trKrhs[index] = trKrhsL; + Xt1rhs[index] = Xt1rhsL; + Xt2rhs[index] = Xt2rhsL; + Xt3rhs[index] = Xt3rhsL; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_RHS); +} + +void ML_BSSN_MP_RHS(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverInterior(cctkGH, &ML_BSSN_MP_RHS_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_RHSBoundary.c b/ML_BSSN_MP/src/ML_BSSN_MP_RHSBoundary.c new file mode 100644 index 0000000..74b8727 --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_RHSBoundary.c @@ -0,0 +1,467 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_RHSBoundary_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_RHSBoundary_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_RHSBoundary_calc_every != ML_BSSN_MP_RHSBoundary_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_RHSBoundary, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + CCTK_REAL detgt = INITVALUE; + CCTK_REAL em4phi = INITVALUE; + CCTK_REAL gtu11 = INITVALUE, gtu21 = INITVALUE, gtu22 = INITVALUE, gtu31 = INITVALUE, gtu32 = INITVALUE, gtu33 = INITVALUE; + CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; + CCTK_REAL nlen = INITVALUE, nlen2 = INITVALUE; + CCTK_REAL nn1 = INITVALUE, nn2 = INITVALUE, nn3 = INITVALUE; + CCTK_REAL nu1 = INITVALUE, nu2 = INITVALUE, nu3 = INITVALUE; + CCTK_REAL su1 = INITVALUE, su2 = INITVALUE, su3 = INITVALUE; + CCTK_REAL vg = INITVALUE; + + /* Declare local copies of grid functions */ + CCTK_REAL AL = INITVALUE; + CCTK_REAL alphaL = INITVALUE, alpharhsL = INITVALUE; + CCTK_REAL ArhsL = INITVALUE; + CCTK_REAL At11L = INITVALUE, At11rhsL = INITVALUE, At12L = INITVALUE, At12rhsL = INITVALUE, At13L = INITVALUE, At13rhsL = INITVALUE; + CCTK_REAL At22L = INITVALUE, At22rhsL = INITVALUE, At23L = INITVALUE, At23rhsL = INITVALUE, At33L = INITVALUE, At33rhsL = INITVALUE; + CCTK_REAL B1L = INITVALUE, B1rhsL = INITVALUE, B2L = INITVALUE, B2rhsL = INITVALUE, B3L = INITVALUE, B3rhsL = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta1rhsL = INITVALUE, beta2L = INITVALUE, beta2rhsL = INITVALUE, beta3L = INITVALUE, beta3rhsL = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt11rhsL = INITVALUE, gt12L = INITVALUE, gt12rhsL = INITVALUE, gt13L = INITVALUE, gt13rhsL = INITVALUE; + CCTK_REAL gt22L = INITVALUE, gt22rhsL = INITVALUE, gt23L = INITVALUE, gt23rhsL = INITVALUE, gt33L = INITVALUE, gt33rhsL = INITVALUE; + CCTK_REAL phiL = INITVALUE, phirhsL = INITVALUE; + CCTK_REAL trKL = INITVALUE, trKrhsL = INITVALUE; + CCTK_REAL Xt1L = INITVALUE, Xt1rhsL = INITVALUE, Xt2L = INITVALUE, Xt2rhsL = INITVALUE, Xt3L = INITVALUE, Xt3rhsL = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + CCTK_REAL PDMinus1A = INITVALUE; + CCTK_REAL PDMinus2A = INITVALUE; + CCTK_REAL PDMinus3A = INITVALUE; + CCTK_REAL PDMinus1alpha = INITVALUE; + CCTK_REAL PDMinus2alpha = INITVALUE; + CCTK_REAL PDMinus3alpha = INITVALUE; + CCTK_REAL PDMinus1At11 = INITVALUE; + CCTK_REAL PDMinus2At11 = INITVALUE; + CCTK_REAL PDMinus3At11 = INITVALUE; + CCTK_REAL PDMinus1At12 = INITVALUE; + CCTK_REAL PDMinus2At12 = INITVALUE; + CCTK_REAL PDMinus3At12 = INITVALUE; + CCTK_REAL PDMinus1At13 = INITVALUE; + CCTK_REAL PDMinus2At13 = INITVALUE; + CCTK_REAL PDMinus3At13 = INITVALUE; + CCTK_REAL PDMinus1At22 = INITVALUE; + CCTK_REAL PDMinus2At22 = INITVALUE; + CCTK_REAL PDMinus3At22 = INITVALUE; + CCTK_REAL PDMinus1At23 = INITVALUE; + CCTK_REAL PDMinus2At23 = INITVALUE; + CCTK_REAL PDMinus3At23 = INITVALUE; + CCTK_REAL PDMinus1At33 = INITVALUE; + CCTK_REAL PDMinus2At33 = INITVALUE; + CCTK_REAL PDMinus3At33 = INITVALUE; + CCTK_REAL PDMinus1B1 = INITVALUE; + CCTK_REAL PDMinus2B1 = INITVALUE; + CCTK_REAL PDMinus3B1 = INITVALUE; + CCTK_REAL PDMinus1B2 = INITVALUE; + CCTK_REAL PDMinus2B2 = INITVALUE; + CCTK_REAL PDMinus3B2 = INITVALUE; + CCTK_REAL PDMinus1B3 = INITVALUE; + CCTK_REAL PDMinus2B3 = INITVALUE; + CCTK_REAL PDMinus3B3 = INITVALUE; + CCTK_REAL PDMinus1beta1 = INITVALUE; + CCTK_REAL PDMinus2beta1 = INITVALUE; + CCTK_REAL PDMinus3beta1 = INITVALUE; + CCTK_REAL PDMinus1beta2 = INITVALUE; + CCTK_REAL PDMinus2beta2 = INITVALUE; + CCTK_REAL PDMinus3beta2 = INITVALUE; + CCTK_REAL PDMinus1beta3 = INITVALUE; + CCTK_REAL PDMinus2beta3 = INITVALUE; + CCTK_REAL PDMinus3beta3 = INITVALUE; + CCTK_REAL PDMinus1gt11 = INITVALUE; + CCTK_REAL PDMinus2gt11 = INITVALUE; + CCTK_REAL PDMinus3gt11 = INITVALUE; + CCTK_REAL PDMinus1gt12 = INITVALUE; + CCTK_REAL PDMinus2gt12 = INITVALUE; + CCTK_REAL PDMinus3gt12 = INITVALUE; + CCTK_REAL PDMinus1gt13 = INITVALUE; + CCTK_REAL PDMinus2gt13 = INITVALUE; + CCTK_REAL PDMinus3gt13 = INITVALUE; + CCTK_REAL PDMinus1gt22 = INITVALUE; + CCTK_REAL PDMinus2gt22 = INITVALUE; + CCTK_REAL PDMinus3gt22 = INITVALUE; + CCTK_REAL PDMinus1gt23 = INITVALUE; + CCTK_REAL PDMinus2gt23 = INITVALUE; + CCTK_REAL PDMinus3gt23 = INITVALUE; + CCTK_REAL PDMinus1gt33 = INITVALUE; + CCTK_REAL PDMinus2gt33 = INITVALUE; + CCTK_REAL PDMinus3gt33 = INITVALUE; + CCTK_REAL PDMinus1phi = INITVALUE; + CCTK_REAL PDMinus2phi = INITVALUE; + CCTK_REAL PDMinus3phi = INITVALUE; + CCTK_REAL PDMinus1trK = INITVALUE; + CCTK_REAL PDMinus2trK = INITVALUE; + CCTK_REAL PDMinus3trK = INITVALUE; + CCTK_REAL PDMinus1Xt1 = INITVALUE; + CCTK_REAL PDMinus2Xt1 = INITVALUE; + CCTK_REAL PDMinus3Xt1 = INITVALUE; + CCTK_REAL PDMinus1Xt2 = INITVALUE; + CCTK_REAL PDMinus2Xt2 = INITVALUE; + CCTK_REAL PDMinus3Xt2 = INITVALUE; + CCTK_REAL PDMinus1Xt3 = INITVALUE; + CCTK_REAL PDMinus2Xt3 = INITVALUE; + CCTK_REAL PDMinus3Xt3 = INITVALUE; + + /* Assign local copies of grid functions */ + AL = A[index]; + alphaL = alpha[index]; + At11L = At11[index]; + At12L = At12[index]; + At13L = At13[index]; + At22L = At22[index]; + At23L = At23[index]; + At33L = At33[index]; + B1L = B1[index]; + B2L = B2[index]; + B3L = B3[index]; + beta1L = beta1[index]; + beta2L = beta2[index]; + beta3L = beta3[index]; + gt11L = gt11[index]; + gt12L = gt12[index]; + gt13L = gt13[index]; + gt22L = gt22[index]; + gt23L = gt23[index]; + gt33L = gt33[index]; + phiL = phi[index]; + trKL = trK[index]; + Xt1L = Xt1[index]; + Xt2L = Xt2[index]; + Xt3L = Xt3[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + PDMinus1A = PDMinus1(A, i, j, k); + PDMinus2A = PDMinus2(A, i, j, k); + PDMinus3A = PDMinus3(A, i, j, k); + PDMinus1alpha = PDMinus1(alpha, i, j, k); + PDMinus2alpha = PDMinus2(alpha, i, j, k); + PDMinus3alpha = PDMinus3(alpha, i, j, k); + PDMinus1At11 = PDMinus1(At11, i, j, k); + PDMinus2At11 = PDMinus2(At11, i, j, k); + PDMinus3At11 = PDMinus3(At11, i, j, k); + PDMinus1At12 = PDMinus1(At12, i, j, k); + PDMinus2At12 = PDMinus2(At12, i, j, k); + PDMinus3At12 = PDMinus3(At12, i, j, k); + PDMinus1At13 = PDMinus1(At13, i, j, k); + PDMinus2At13 = PDMinus2(At13, i, j, k); + PDMinus3At13 = PDMinus3(At13, i, j, k); + PDMinus1At22 = PDMinus1(At22, i, j, k); + PDMinus2At22 = PDMinus2(At22, i, j, k); + PDMinus3At22 = PDMinus3(At22, i, j, k); + PDMinus1At23 = PDMinus1(At23, i, j, k); + PDMinus2At23 = PDMinus2(At23, i, j, k); + PDMinus3At23 = PDMinus3(At23, i, j, k); + PDMinus1At33 = PDMinus1(At33, i, j, k); + PDMinus2At33 = PDMinus2(At33, i, j, k); + PDMinus3At33 = PDMinus3(At33, i, j, k); + PDMinus1B1 = PDMinus1(B1, i, j, k); + PDMinus2B1 = PDMinus2(B1, i, j, k); + PDMinus3B1 = PDMinus3(B1, i, j, k); + PDMinus1B2 = PDMinus1(B2, i, j, k); + PDMinus2B2 = PDMinus2(B2, i, j, k); + PDMinus3B2 = PDMinus3(B2, i, j, k); + PDMinus1B3 = PDMinus1(B3, i, j, k); + PDMinus2B3 = PDMinus2(B3, i, j, k); + PDMinus3B3 = PDMinus3(B3, i, j, k); + PDMinus1beta1 = PDMinus1(beta1, i, j, k); + PDMinus2beta1 = PDMinus2(beta1, i, j, k); + PDMinus3beta1 = PDMinus3(beta1, i, j, k); + PDMinus1beta2 = PDMinus1(beta2, i, j, k); + PDMinus2beta2 = PDMinus2(beta2, i, j, k); + PDMinus3beta2 = PDMinus3(beta2, i, j, k); + PDMinus1beta3 = PDMinus1(beta3, i, j, k); + PDMinus2beta3 = PDMinus2(beta3, i, j, k); + PDMinus3beta3 = PDMinus3(beta3, i, j, k); + PDMinus1gt11 = PDMinus1(gt11, i, j, k); + PDMinus2gt11 = PDMinus2(gt11, i, j, k); + PDMinus3gt11 = PDMinus3(gt11, i, j, k); + PDMinus1gt12 = PDMinus1(gt12, i, j, k); + PDMinus2gt12 = PDMinus2(gt12, i, j, k); + PDMinus3gt12 = PDMinus3(gt12, i, j, k); + PDMinus1gt13 = PDMinus1(gt13, i, j, k); + PDMinus2gt13 = PDMinus2(gt13, i, j, k); + PDMinus3gt13 = PDMinus3(gt13, i, j, k); + PDMinus1gt22 = PDMinus1(gt22, i, j, k); + PDMinus2gt22 = PDMinus2(gt22, i, j, k); + PDMinus3gt22 = PDMinus3(gt22, i, j, k); + PDMinus1gt23 = PDMinus1(gt23, i, j, k); + PDMinus2gt23 = PDMinus2(gt23, i, j, k); + PDMinus3gt23 = PDMinus3(gt23, i, j, k); + PDMinus1gt33 = PDMinus1(gt33, i, j, k); + PDMinus2gt33 = PDMinus2(gt33, i, j, k); + PDMinus3gt33 = PDMinus3(gt33, i, j, k); + PDMinus1phi = PDMinus1(phi, i, j, k); + PDMinus2phi = PDMinus2(phi, i, j, k); + PDMinus3phi = PDMinus3(phi, i, j, k); + PDMinus1trK = PDMinus1(trK, i, j, k); + PDMinus2trK = PDMinus2(trK, i, j, k); + PDMinus3trK = PDMinus3(trK, i, j, k); + PDMinus1Xt1 = PDMinus1(Xt1, i, j, k); + PDMinus2Xt1 = PDMinus2(Xt1, i, j, k); + PDMinus3Xt1 = PDMinus3(Xt1, i, j, k); + PDMinus1Xt2 = PDMinus1(Xt2, i, j, k); + PDMinus2Xt2 = PDMinus2(Xt2, i, j, k); + PDMinus3Xt2 = PDMinus3(Xt2, i, j, k); + PDMinus1Xt3 = PDMinus1(Xt3, i, j, k); + PDMinus2Xt3 = PDMinus2(Xt3, i, j, k); + PDMinus3Xt3 = PDMinus3(Xt3, i, j, k); + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + detgt = 1; + + gtu11 = INV(detgt)*(gt22L*gt33L - SQR(gt23L)); + + gtu21 = (gt13L*gt23L - gt12L*gt33L)*INV(detgt); + + gtu31 = (-(gt13L*gt22L) + gt12L*gt23L)*INV(detgt); + + gtu22 = INV(detgt)*(gt11L*gt33L - SQR(gt13L)); + + gtu32 = (gt12L*gt13L - gt11L*gt23L)*INV(detgt); + + gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); + + em4phi = exp(-4*phiL); + + gu11 = em4phi*gtu11; + + gu21 = em4phi*gtu21; + + gu31 = em4phi*gtu31; + + gu22 = em4phi*gtu22; + + gu32 = em4phi*gtu32; + + gu33 = em4phi*gtu33; + + nn1 = normal[0]; + + nn2 = normal[1]; + + nn3 = normal[2]; + + nu1 = gu11*nn1 + gu21*nn2 + gu31*nn3; + + nu2 = gu21*nn1 + gu22*nn2 + gu32*nn3; + + nu3 = gu31*nn1 + gu32*nn2 + gu33*nn3; + + nlen2 = nn1*nu1 + nn2*nu2 + nn3*nu3; + + nlen = pow(nlen2,0.5); + + su1 = nu1*INV(nlen); + + su2 = nu2*INV(nlen); + + su3 = nu3*INV(nlen); + + vg = pow(harmonicF,0.5); + + phirhsL = -((PDMinus1phi*su1 + PDMinus2phi*su2 + PDMinus3phi*su3)*vg); + + gt11rhsL = -(PDMinus1gt11*su1) - PDMinus2gt11*su2 - PDMinus3gt11*su3; + + gt12rhsL = -(PDMinus1gt12*su1) - PDMinus2gt12*su2 - PDMinus3gt12*su3; + + gt13rhsL = -(PDMinus1gt13*su1) - PDMinus2gt13*su2 - PDMinus3gt13*su3; + + gt22rhsL = -(PDMinus1gt22*su1) - PDMinus2gt22*su2 - PDMinus3gt22*su3; + + gt23rhsL = -(PDMinus1gt23*su1) - PDMinus2gt23*su2 - PDMinus3gt23*su3; + + gt33rhsL = -(PDMinus1gt33*su1) - PDMinus2gt33*su2 - PDMinus3gt33*su3; + + trKrhsL = -((PDMinus1trK*su1 + PDMinus2trK*su2 + PDMinus3trK*su3)*vg); + + At11rhsL = -(PDMinus1At11*su1) - PDMinus2At11*su2 - PDMinus3At11*su3; + + At12rhsL = -(PDMinus1At12*su1) - PDMinus2At12*su2 - PDMinus3At12*su3; + + At13rhsL = -(PDMinus1At13*su1) - PDMinus2At13*su2 - PDMinus3At13*su3; + + At22rhsL = -(PDMinus1At22*su1) - PDMinus2At22*su2 - PDMinus3At22*su3; + + At23rhsL = -(PDMinus1At23*su1) - PDMinus2At23*su2 - PDMinus3At23*su3; + + At33rhsL = -(PDMinus1At33*su1) - PDMinus2At33*su2 - PDMinus3At33*su3; + + Xt1rhsL = -(PDMinus1Xt1*su1) - PDMinus2Xt1*su2 - PDMinus3Xt1*su3; + + Xt2rhsL = -(PDMinus1Xt2*su1) - PDMinus2Xt2*su2 - PDMinus3Xt2*su3; + + Xt3rhsL = -(PDMinus1Xt3*su1) - PDMinus2Xt3*su2 - PDMinus3Xt3*su3; + + alpharhsL = -((PDMinus1alpha*su1 + PDMinus2alpha*su2 + PDMinus3alpha*su3)*vg); + + ArhsL = -((PDMinus1A*su1 + PDMinus2A*su2 + PDMinus3A*su3)*vg); + + beta1rhsL = -(PDMinus1beta1*su1) - PDMinus2beta1*su2 - PDMinus3beta1*su3; + + beta2rhsL = -(PDMinus1beta2*su1) - PDMinus2beta2*su2 - PDMinus3beta2*su3; + + beta3rhsL = -(PDMinus1beta3*su1) - PDMinus2beta3*su2 - PDMinus3beta3*su3; + + B1rhsL = -(PDMinus1B1*su1) - PDMinus2B1*su2 - PDMinus3B1*su3; + + B2rhsL = -(PDMinus1B2*su1) - PDMinus2B2*su2 - PDMinus3B2*su3; + + B3rhsL = -(PDMinus1B3*su1) - PDMinus2B3*su2 - PDMinus3B3*su3; + + + /* Copy local copies back to grid functions */ + alpharhs[index] = alpharhsL; + Arhs[index] = ArhsL; + At11rhs[index] = At11rhsL; + At12rhs[index] = At12rhsL; + At13rhs[index] = At13rhsL; + At22rhs[index] = At22rhsL; + At23rhs[index] = At23rhsL; + At33rhs[index] = At33rhsL; + B1rhs[index] = B1rhsL; + B2rhs[index] = B2rhsL; + B3rhs[index] = B3rhsL; + beta1rhs[index] = beta1rhsL; + beta2rhs[index] = beta2rhsL; + beta3rhs[index] = beta3rhsL; + gt11rhs[index] = gt11rhsL; + gt12rhs[index] = gt12rhsL; + gt13rhs[index] = gt13rhsL; + gt22rhs[index] = gt22rhsL; + gt23rhs[index] = gt23rhsL; + gt33rhs[index] = gt33rhsL; + phirhs[index] = phirhsL; + trKrhs[index] = trKrhsL; + Xt1rhs[index] = Xt1rhsL; + Xt2rhs[index] = Xt2rhsL; + Xt3rhs[index] = Xt3rhsL; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_RHSBoundary); +} + +void ML_BSSN_MP_RHSBoundary(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverBoundary(cctkGH, &ML_BSSN_MP_RHSBoundary_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_boundary.c b/ML_BSSN_MP/src/ML_BSSN_MP_boundary.c new file mode 100644 index 0000000..ee60f76 --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_boundary.c @@ -0,0 +1,228 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_boundary_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_boundary_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_boundary_calc_every != ML_BSSN_MP_boundary_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_boundary, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + + /* Declare local copies of grid functions */ + CCTK_REAL AL = INITVALUE; + CCTK_REAL alphaL = INITVALUE; + CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE; + CCTK_REAL B1L = INITVALUE, B2L = INITVALUE, B3L = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE; + CCTK_REAL phiL = INITVALUE; + CCTK_REAL trKL = INITVALUE; + CCTK_REAL Xt1L = INITVALUE, Xt2L = INITVALUE, Xt3L = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + + /* Assign local copies of grid functions */ + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + phiL = 0; + + gt11L = 1; + + gt12L = 0; + + gt13L = 0; + + gt22L = 1; + + gt23L = 0; + + gt33L = 1; + + trKL = 0; + + At11L = 0; + + At12L = 0; + + At13L = 0; + + At22L = 0; + + At23L = 0; + + At33L = 0; + + Xt1L = 0; + + Xt2L = 0; + + Xt3L = 0; + + alphaL = 1; + + AL = 0; + + beta1L = 0; + + beta2L = 0; + + beta3L = 0; + + B1L = 0; + + B2L = 0; + + B3L = 0; + + + /* Copy local copies back to grid functions */ + A[index] = AL; + alpha[index] = alphaL; + At11[index] = At11L; + At12[index] = At12L; + At13[index] = At13L; + At22[index] = At22L; + At23[index] = At23L; + At33[index] = At33L; + B1[index] = B1L; + B2[index] = B2L; + B3[index] = B3L; + beta1[index] = beta1L; + beta2[index] = beta2L; + beta3[index] = beta3L; + gt11[index] = gt11L; + gt12[index] = gt12L; + gt13[index] = gt13L; + gt22[index] = gt22L; + gt23[index] = gt23L; + gt33[index] = gt33L; + phi[index] = phiL; + trK[index] = trKL; + Xt1[index] = Xt1L; + Xt2[index] = Xt2L; + Xt3[index] = Xt3L; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_boundary); +} + +void ML_BSSN_MP_boundary(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverBoundaryWithGhosts(cctkGH, &ML_BSSN_MP_boundary_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_constraints.c b/ML_BSSN_MP/src/ML_BSSN_MP_constraints.c new file mode 100644 index 0000000..28abf31 --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_constraints.c @@ -0,0 +1,1983 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_constraints_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_constraints_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_constraints_calc_every != ML_BSSN_MP_constraints_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_constraints, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + CCTK_REAL Atm11 = INITVALUE, Atm12 = INITVALUE, Atm13 = INITVALUE, Atm21 = INITVALUE, Atm22 = INITVALUE, Atm23 = INITVALUE; + CCTK_REAL Atm31 = INITVALUE, Atm32 = INITVALUE, Atm33 = INITVALUE; + CCTK_REAL detgt = INITVALUE; + CCTK_REAL e4phi = INITVALUE; + CCTK_REAL em4phi = INITVALUE; + CCTK_REAL Gt111 = INITVALUE, Gt112 = INITVALUE, Gt113 = INITVALUE, Gt122 = INITVALUE, Gt123 = INITVALUE, Gt133 = INITVALUE; + CCTK_REAL Gt211 = INITVALUE, Gt212 = INITVALUE, Gt213 = INITVALUE, Gt222 = INITVALUE, Gt223 = INITVALUE, Gt233 = INITVALUE; + CCTK_REAL Gt311 = INITVALUE, Gt312 = INITVALUE, Gt313 = INITVALUE, Gt322 = INITVALUE, Gt323 = INITVALUE, Gt333 = INITVALUE; + CCTK_REAL gtu11 = INITVALUE, gtu21 = INITVALUE, gtu22 = INITVALUE, gtu31 = INITVALUE, gtu32 = INITVALUE, gtu33 = INITVALUE; + CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; + CCTK_REAL R11 = INITVALUE, R12 = INITVALUE, R13 = INITVALUE, R22 = INITVALUE, R23 = INITVALUE, R33 = INITVALUE; + CCTK_REAL rho = INITVALUE; + CCTK_REAL Rphi11 = INITVALUE, Rphi12 = INITVALUE, Rphi13 = INITVALUE, Rphi22 = INITVALUE, Rphi23 = INITVALUE, Rphi33 = INITVALUE; + CCTK_REAL Rt11 = INITVALUE, Rt12 = INITVALUE, Rt13 = INITVALUE, Rt22 = INITVALUE, Rt23 = INITVALUE, Rt33 = INITVALUE; + CCTK_REAL S1 = INITVALUE, S2 = INITVALUE, S3 = INITVALUE; + CCTK_REAL T00 = INITVALUE, T01 = INITVALUE, T02 = INITVALUE, T03 = INITVALUE, T11 = INITVALUE, T12 = INITVALUE; + CCTK_REAL T13 = INITVALUE, T22 = INITVALUE, T23 = INITVALUE, T33 = INITVALUE; + CCTK_REAL trR = INITVALUE; + + /* Declare local copies of grid functions */ + CCTK_REAL alphaL = INITVALUE; + CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE; + CCTK_REAL cAL = INITVALUE; + CCTK_REAL cSL = INITVALUE; + CCTK_REAL cXt1L = INITVALUE, cXt2L = INITVALUE, cXt3L = INITVALUE; + CCTK_REAL dJ111L = INITVALUE, dJ112L = INITVALUE, dJ113L = INITVALUE, dJ122L = INITVALUE, dJ123L = INITVALUE, dJ133L = INITVALUE; + CCTK_REAL dJ211L = INITVALUE, dJ212L = INITVALUE, dJ213L = INITVALUE, dJ222L = INITVALUE, dJ223L = INITVALUE, dJ233L = INITVALUE; + CCTK_REAL dJ311L = INITVALUE, dJ312L = INITVALUE, dJ313L = INITVALUE, dJ322L = INITVALUE, dJ323L = INITVALUE, dJ333L = INITVALUE; + CCTK_REAL eTttL = INITVALUE; + CCTK_REAL eTtxL = INITVALUE; + CCTK_REAL eTtyL = INITVALUE; + CCTK_REAL eTtzL = INITVALUE; + CCTK_REAL eTxxL = INITVALUE; + CCTK_REAL eTxyL = INITVALUE; + CCTK_REAL eTxzL = INITVALUE; + CCTK_REAL eTyyL = INITVALUE; + CCTK_REAL eTyzL = INITVALUE; + CCTK_REAL eTzzL = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE; + CCTK_REAL HL = INITVALUE; + CCTK_REAL J11L = INITVALUE, J12L = INITVALUE, J13L = INITVALUE, J21L = INITVALUE, J22L = INITVALUE, J23L = INITVALUE; + CCTK_REAL J31L = INITVALUE, J32L = INITVALUE, J33L = INITVALUE; + CCTK_REAL M1L = INITVALUE, M2L = INITVALUE, M3L = INITVALUE; + CCTK_REAL phiL = INITVALUE; + CCTK_REAL trKL = INITVALUE; + CCTK_REAL Xt1L = INITVALUE, Xt2L = INITVALUE, Xt3L = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + CCTK_REAL PDstandardNth1At11 = INITVALUE; + CCTK_REAL PDstandardNth2At11 = INITVALUE; + CCTK_REAL PDstandardNth3At11 = INITVALUE; + CCTK_REAL PDstandardNth1At12 = INITVALUE; + CCTK_REAL PDstandardNth2At12 = INITVALUE; + CCTK_REAL PDstandardNth3At12 = INITVALUE; + CCTK_REAL PDstandardNth1At13 = INITVALUE; + CCTK_REAL PDstandardNth2At13 = INITVALUE; + CCTK_REAL PDstandardNth3At13 = INITVALUE; + CCTK_REAL PDstandardNth1At22 = INITVALUE; + CCTK_REAL PDstandardNth2At22 = INITVALUE; + CCTK_REAL PDstandardNth3At22 = INITVALUE; + CCTK_REAL PDstandardNth1At23 = INITVALUE; + CCTK_REAL PDstandardNth2At23 = INITVALUE; + CCTK_REAL PDstandardNth3At23 = INITVALUE; + CCTK_REAL PDstandardNth1At33 = INITVALUE; + CCTK_REAL PDstandardNth2At33 = INITVALUE; + CCTK_REAL PDstandardNth3At33 = INITVALUE; + CCTK_REAL PDstandardNth1gt11 = INITVALUE; + CCTK_REAL PDstandardNth2gt11 = INITVALUE; + CCTK_REAL PDstandardNth3gt11 = INITVALUE; + CCTK_REAL PDstandardNth11gt11 = INITVALUE; + CCTK_REAL PDstandardNth22gt11 = INITVALUE; + CCTK_REAL PDstandardNth33gt11 = INITVALUE; + CCTK_REAL PDstandardNth12gt11 = INITVALUE; + CCTK_REAL PDstandardNth13gt11 = INITVALUE; + CCTK_REAL PDstandardNth21gt11 = INITVALUE; + CCTK_REAL PDstandardNth23gt11 = INITVALUE; + CCTK_REAL PDstandardNth31gt11 = INITVALUE; + CCTK_REAL PDstandardNth32gt11 = INITVALUE; + CCTK_REAL PDstandardNth1gt12 = INITVALUE; + CCTK_REAL PDstandardNth2gt12 = INITVALUE; + CCTK_REAL PDstandardNth3gt12 = INITVALUE; + CCTK_REAL PDstandardNth11gt12 = INITVALUE; + CCTK_REAL PDstandardNth22gt12 = INITVALUE; + CCTK_REAL PDstandardNth33gt12 = INITVALUE; + CCTK_REAL PDstandardNth12gt12 = INITVALUE; + CCTK_REAL PDstandardNth13gt12 = INITVALUE; + CCTK_REAL PDstandardNth21gt12 = INITVALUE; + CCTK_REAL PDstandardNth23gt12 = INITVALUE; + CCTK_REAL PDstandardNth31gt12 = INITVALUE; + CCTK_REAL PDstandardNth32gt12 = INITVALUE; + CCTK_REAL PDstandardNth1gt13 = INITVALUE; + CCTK_REAL PDstandardNth2gt13 = INITVALUE; + CCTK_REAL PDstandardNth3gt13 = INITVALUE; + CCTK_REAL PDstandardNth11gt13 = INITVALUE; + CCTK_REAL PDstandardNth22gt13 = INITVALUE; + CCTK_REAL PDstandardNth33gt13 = INITVALUE; + CCTK_REAL PDstandardNth12gt13 = INITVALUE; + CCTK_REAL PDstandardNth13gt13 = INITVALUE; + CCTK_REAL PDstandardNth21gt13 = INITVALUE; + CCTK_REAL PDstandardNth23gt13 = INITVALUE; + CCTK_REAL PDstandardNth31gt13 = INITVALUE; + CCTK_REAL PDstandardNth32gt13 = INITVALUE; + CCTK_REAL PDstandardNth1gt22 = INITVALUE; + CCTK_REAL PDstandardNth2gt22 = INITVALUE; + CCTK_REAL PDstandardNth3gt22 = INITVALUE; + CCTK_REAL PDstandardNth11gt22 = INITVALUE; + CCTK_REAL PDstandardNth22gt22 = INITVALUE; + CCTK_REAL PDstandardNth33gt22 = INITVALUE; + CCTK_REAL PDstandardNth12gt22 = INITVALUE; + CCTK_REAL PDstandardNth13gt22 = INITVALUE; + CCTK_REAL PDstandardNth21gt22 = INITVALUE; + CCTK_REAL PDstandardNth23gt22 = INITVALUE; + CCTK_REAL PDstandardNth31gt22 = INITVALUE; + CCTK_REAL PDstandardNth32gt22 = INITVALUE; + CCTK_REAL PDstandardNth1gt23 = INITVALUE; + CCTK_REAL PDstandardNth2gt23 = INITVALUE; + CCTK_REAL PDstandardNth3gt23 = INITVALUE; + CCTK_REAL PDstandardNth11gt23 = INITVALUE; + CCTK_REAL PDstandardNth22gt23 = INITVALUE; + CCTK_REAL PDstandardNth33gt23 = INITVALUE; + CCTK_REAL PDstandardNth12gt23 = INITVALUE; + CCTK_REAL PDstandardNth13gt23 = INITVALUE; + CCTK_REAL PDstandardNth21gt23 = INITVALUE; + CCTK_REAL PDstandardNth23gt23 = INITVALUE; + CCTK_REAL PDstandardNth31gt23 = INITVALUE; + CCTK_REAL PDstandardNth32gt23 = INITVALUE; + CCTK_REAL PDstandardNth1gt33 = INITVALUE; + CCTK_REAL PDstandardNth2gt33 = INITVALUE; + CCTK_REAL PDstandardNth3gt33 = INITVALUE; + CCTK_REAL PDstandardNth11gt33 = INITVALUE; + CCTK_REAL PDstandardNth22gt33 = INITVALUE; + CCTK_REAL PDstandardNth33gt33 = INITVALUE; + CCTK_REAL PDstandardNth12gt33 = INITVALUE; + CCTK_REAL PDstandardNth13gt33 = INITVALUE; + CCTK_REAL PDstandardNth21gt33 = INITVALUE; + CCTK_REAL PDstandardNth23gt33 = INITVALUE; + CCTK_REAL PDstandardNth31gt33 = INITVALUE; + CCTK_REAL PDstandardNth32gt33 = INITVALUE; + CCTK_REAL PDstandardNth1phi = INITVALUE; + CCTK_REAL PDstandardNth2phi = INITVALUE; + CCTK_REAL PDstandardNth3phi = INITVALUE; + CCTK_REAL PDstandardNth11phi = INITVALUE; + CCTK_REAL PDstandardNth22phi = INITVALUE; + CCTK_REAL PDstandardNth33phi = INITVALUE; + CCTK_REAL PDstandardNth12phi = INITVALUE; + CCTK_REAL PDstandardNth13phi = INITVALUE; + CCTK_REAL PDstandardNth21phi = INITVALUE; + CCTK_REAL PDstandardNth23phi = INITVALUE; + CCTK_REAL PDstandardNth31phi = INITVALUE; + CCTK_REAL PDstandardNth32phi = INITVALUE; + CCTK_REAL PDstandardNth1trK = INITVALUE; + CCTK_REAL PDstandardNth2trK = INITVALUE; + CCTK_REAL PDstandardNth3trK = INITVALUE; + CCTK_REAL PDstandardNth1Xt1 = INITVALUE; + CCTK_REAL PDstandardNth2Xt1 = INITVALUE; + CCTK_REAL PDstandardNth3Xt1 = INITVALUE; + CCTK_REAL PDstandardNth1Xt2 = INITVALUE; + CCTK_REAL PDstandardNth2Xt2 = INITVALUE; + CCTK_REAL PDstandardNth3Xt2 = INITVALUE; + CCTK_REAL PDstandardNth1Xt3 = INITVALUE; + CCTK_REAL PDstandardNth2Xt3 = INITVALUE; + CCTK_REAL PDstandardNth3Xt3 = INITVALUE; + + /* Assign local copies of grid functions */ + alphaL = alpha[index]; + At11L = At11[index]; + At12L = At12[index]; + At13L = At13[index]; + At22L = At22[index]; + At23L = At23[index]; + At33L = At33[index]; + beta1L = beta1[index]; + beta2L = beta2[index]; + beta3L = beta3[index]; + dJ111L = dJ111[index]; + dJ112L = dJ112[index]; + dJ113L = dJ113[index]; + dJ122L = dJ122[index]; + dJ123L = dJ123[index]; + dJ133L = dJ133[index]; + dJ211L = dJ211[index]; + dJ212L = dJ212[index]; + dJ213L = dJ213[index]; + dJ222L = dJ222[index]; + dJ223L = dJ223[index]; + dJ233L = dJ233[index]; + dJ311L = dJ311[index]; + dJ312L = dJ312[index]; + dJ313L = dJ313[index]; + dJ322L = dJ322[index]; + dJ323L = dJ323[index]; + dJ333L = dJ333[index]; + eTttL = eTtt[index]; + eTtxL = eTtx[index]; + eTtyL = eTty[index]; + eTtzL = eTtz[index]; + eTxxL = eTxx[index]; + eTxyL = eTxy[index]; + eTxzL = eTxz[index]; + eTyyL = eTyy[index]; + eTyzL = eTyz[index]; + eTzzL = eTzz[index]; + gt11L = gt11[index]; + gt12L = gt12[index]; + gt13L = gt13[index]; + gt22L = gt22[index]; + gt23L = gt23[index]; + gt33L = gt33[index]; + J11L = J11[index]; + J12L = J12[index]; + J13L = J13[index]; + J21L = J21[index]; + J22L = J22[index]; + J23L = J23[index]; + J31L = J31[index]; + J32L = J32[index]; + J33L = J33[index]; + phiL = phi[index]; + trKL = trK[index]; + Xt1L = Xt1[index]; + Xt2L = Xt2[index]; + Xt3L = Xt3[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + PDstandardNth1At11 = PDstandardNth1(At11, i, j, k); + PDstandardNth2At11 = PDstandardNth2(At11, i, j, k); + PDstandardNth3At11 = PDstandardNth3(At11, i, j, k); + PDstandardNth1At12 = PDstandardNth1(At12, i, j, k); + PDstandardNth2At12 = PDstandardNth2(At12, i, j, k); + PDstandardNth3At12 = PDstandardNth3(At12, i, j, k); + PDstandardNth1At13 = PDstandardNth1(At13, i, j, k); + PDstandardNth2At13 = PDstandardNth2(At13, i, j, k); + PDstandardNth3At13 = PDstandardNth3(At13, i, j, k); + PDstandardNth1At22 = PDstandardNth1(At22, i, j, k); + PDstandardNth2At22 = PDstandardNth2(At22, i, j, k); + PDstandardNth3At22 = PDstandardNth3(At22, i, j, k); + PDstandardNth1At23 = PDstandardNth1(At23, i, j, k); + PDstandardNth2At23 = PDstandardNth2(At23, i, j, k); + PDstandardNth3At23 = PDstandardNth3(At23, i, j, k); + PDstandardNth1At33 = PDstandardNth1(At33, i, j, k); + PDstandardNth2At33 = PDstandardNth2(At33, i, j, k); + PDstandardNth3At33 = PDstandardNth3(At33, i, j, k); + PDstandardNth1gt11 = PDstandardNth1(gt11, i, j, k); + PDstandardNth2gt11 = PDstandardNth2(gt11, i, j, k); + PDstandardNth3gt11 = PDstandardNth3(gt11, i, j, k); + PDstandardNth11gt11 = PDstandardNth11(gt11, i, j, k); + PDstandardNth22gt11 = PDstandardNth22(gt11, i, j, k); + PDstandardNth33gt11 = PDstandardNth33(gt11, i, j, k); + PDstandardNth12gt11 = PDstandardNth12(gt11, i, j, k); + PDstandardNth13gt11 = PDstandardNth13(gt11, i, j, k); + PDstandardNth23gt11 = PDstandardNth23(gt11, i, j, k); + PDstandardNth1gt12 = PDstandardNth1(gt12, i, j, k); + PDstandardNth2gt12 = PDstandardNth2(gt12, i, j, k); + PDstandardNth3gt12 = PDstandardNth3(gt12, i, j, k); + PDstandardNth11gt12 = PDstandardNth11(gt12, i, j, k); + PDstandardNth22gt12 = PDstandardNth22(gt12, i, j, k); + PDstandardNth33gt12 = PDstandardNth33(gt12, i, j, k); + PDstandardNth12gt12 = PDstandardNth12(gt12, i, j, k); + PDstandardNth13gt12 = PDstandardNth13(gt12, i, j, k); + PDstandardNth23gt12 = PDstandardNth23(gt12, i, j, k); + PDstandardNth1gt13 = PDstandardNth1(gt13, i, j, k); + PDstandardNth2gt13 = PDstandardNth2(gt13, i, j, k); + PDstandardNth3gt13 = PDstandardNth3(gt13, i, j, k); + PDstandardNth11gt13 = PDstandardNth11(gt13, i, j, k); + PDstandardNth22gt13 = PDstandardNth22(gt13, i, j, k); + PDstandardNth33gt13 = PDstandardNth33(gt13, i, j, k); + PDstandardNth12gt13 = PDstandardNth12(gt13, i, j, k); + PDstandardNth13gt13 = PDstandardNth13(gt13, i, j, k); + PDstandardNth23gt13 = PDstandardNth23(gt13, i, j, k); + PDstandardNth1gt22 = PDstandardNth1(gt22, i, j, k); + PDstandardNth2gt22 = PDstandardNth2(gt22, i, j, k); + PDstandardNth3gt22 = PDstandardNth3(gt22, i, j, k); + PDstandardNth11gt22 = PDstandardNth11(gt22, i, j, k); + PDstandardNth22gt22 = PDstandardNth22(gt22, i, j, k); + PDstandardNth33gt22 = PDstandardNth33(gt22, i, j, k); + PDstandardNth12gt22 = PDstandardNth12(gt22, i, j, k); + PDstandardNth13gt22 = PDstandardNth13(gt22, i, j, k); + PDstandardNth23gt22 = PDstandardNth23(gt22, i, j, k); + PDstandardNth1gt23 = PDstandardNth1(gt23, i, j, k); + PDstandardNth2gt23 = PDstandardNth2(gt23, i, j, k); + PDstandardNth3gt23 = PDstandardNth3(gt23, i, j, k); + PDstandardNth11gt23 = PDstandardNth11(gt23, i, j, k); + PDstandardNth22gt23 = PDstandardNth22(gt23, i, j, k); + PDstandardNth33gt23 = PDstandardNth33(gt23, i, j, k); + PDstandardNth12gt23 = PDstandardNth12(gt23, i, j, k); + PDstandardNth13gt23 = PDstandardNth13(gt23, i, j, k); + PDstandardNth23gt23 = PDstandardNth23(gt23, i, j, k); + PDstandardNth1gt33 = PDstandardNth1(gt33, i, j, k); + PDstandardNth2gt33 = PDstandardNth2(gt33, i, j, k); + PDstandardNth3gt33 = PDstandardNth3(gt33, i, j, k); + PDstandardNth11gt33 = PDstandardNth11(gt33, i, j, k); + PDstandardNth22gt33 = PDstandardNth22(gt33, i, j, k); + PDstandardNth33gt33 = PDstandardNth33(gt33, i, j, k); + PDstandardNth12gt33 = PDstandardNth12(gt33, i, j, k); + PDstandardNth13gt33 = PDstandardNth13(gt33, i, j, k); + PDstandardNth23gt33 = PDstandardNth23(gt33, i, j, k); + PDstandardNth1phi = PDstandardNth1(phi, i, j, k); + PDstandardNth2phi = PDstandardNth2(phi, i, j, k); + PDstandardNth3phi = PDstandardNth3(phi, i, j, k); + PDstandardNth11phi = PDstandardNth11(phi, i, j, k); + PDstandardNth22phi = PDstandardNth22(phi, i, j, k); + PDstandardNth33phi = PDstandardNth33(phi, i, j, k); + PDstandardNth12phi = PDstandardNth12(phi, i, j, k); + PDstandardNth13phi = PDstandardNth13(phi, i, j, k); + PDstandardNth23phi = PDstandardNth23(phi, i, j, k); + PDstandardNth1trK = PDstandardNth1(trK, i, j, k); + PDstandardNth2trK = PDstandardNth2(trK, i, j, k); + PDstandardNth3trK = PDstandardNth3(trK, i, j, k); + PDstandardNth1Xt1 = PDstandardNth1(Xt1, i, j, k); + PDstandardNth2Xt1 = PDstandardNth2(Xt1, i, j, k); + PDstandardNth3Xt1 = PDstandardNth3(Xt1, i, j, k); + PDstandardNth1Xt2 = PDstandardNth1(Xt2, i, j, k); + PDstandardNth2Xt2 = PDstandardNth2(Xt2, i, j, k); + PDstandardNth3Xt2 = PDstandardNth3(Xt2, i, j, k); + PDstandardNth1Xt3 = PDstandardNth1(Xt3, i, j, k); + PDstandardNth2Xt3 = PDstandardNth2(Xt3, i, j, k); + PDstandardNth3Xt3 = PDstandardNth3(Xt3, i, j, k); + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + detgt = 1; + + gtu11 = INV(detgt)*(gt22L*gt33L - SQR(gt23L)); + + gtu21 = (gt13L*gt23L - gt12L*gt33L)*INV(detgt); + + gtu31 = (-(gt13L*gt22L) + gt12L*gt23L)*INV(detgt); + + gtu22 = INV(detgt)*(gt11L*gt33L - SQR(gt13L)); + + gtu32 = (gt12L*gt13L - gt11L*gt23L)*INV(detgt); + + gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); + + Gt111 = khalf*((gtu11*J11L - gtu21*J12L - gtu31*J13L)*PDstandardNth1gt11 + + (gtu11*J21L - gtu21*J22L - gtu31*J23L)*PDstandardNth2gt11 + + (gtu11*J31L - gtu21*J32L - gtu31*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) + + J21L*(gtu21*PDstandardNth2gt12 + gtu31*PDstandardNth2gt13) + + J31L*(gtu21*PDstandardNth3gt12 + gtu31*PDstandardNth3gt13))); + + Gt211 = khalf*((gtu21*J11L - gtu22*J12L - gtu32*J13L)*PDstandardNth1gt11 + + (gtu21*J21L - gtu22*J22L - gtu32*J23L)*PDstandardNth2gt11 + + (gtu21*J31L - gtu22*J32L - gtu32*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) + + J21L*(gtu22*PDstandardNth2gt12 + gtu32*PDstandardNth2gt13) + + J31L*(gtu22*PDstandardNth3gt12 + gtu32*PDstandardNth3gt13))); + + Gt311 = khalf*((gtu31*J11L - gtu32*J12L - gtu33*J13L)*PDstandardNth1gt11 + + (gtu31*J21L - gtu32*J22L - gtu33*J23L)*PDstandardNth2gt11 + + (gtu31*J31L - gtu32*J32L - gtu33*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) + + J21L*(gtu32*PDstandardNth2gt12 + gtu33*PDstandardNth2gt13) + + J31L*(gtu32*PDstandardNth3gt12 + gtu33*PDstandardNth3gt13))); + + Gt112 = khalf*(gtu11*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu21*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu31*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt212 = khalf*(gtu21*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu22*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu32*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt312 = khalf*(gtu31*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu32*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu33*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt113 = khalf*(gtu11*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu21*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu31*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt213 = khalf*(gtu21*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu22*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu32*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt313 = khalf*(gtu31*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu32*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu33*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt122 = khalf*(gtu11*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu21*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu31*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt222 = khalf*(gtu21*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu22*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu32*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt322 = khalf*(gtu31*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu32*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu33*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt123 = khalf*(gtu21*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu11*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu31*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt223 = khalf*(gtu22*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu21*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu32*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt323 = khalf*(gtu32*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu31*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu33*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt133 = khalf*(gtu11*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu21*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu31*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Gt233 = khalf*(gtu21*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu22*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu32*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Gt333 = khalf*(gtu31*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu32*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu33*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Rt11 = (Gt113*(gt13L*Gt312 + 3*(gt12L*Gt212 + gt13L*Gt312)) + + gt12L*(Gt213*(4*Gt112 + 2*Gt222) + Gt212*(Gt113 + 2*Gt223) + + 2*(Gt233*Gt312 + Gt223*Gt313)) + + gt11L*(6*Gt112*Gt113 + 2*(Gt122*Gt213 + Gt133*Gt312 + + Gt123*(Gt212 + Gt313))) + + gt13L*(2*Gt213*Gt322 + Gt313*(4*Gt112 + 2*Gt323)) + + 2*(Gt213*(Gt212*gt22L + gt23L*Gt312) + + Gt212*(gt23L*Gt313 + gt13L*Gt323) + Gt312*(gt13L*Gt333 + Gt313*gt33L)) + )*gtu32 + J11L*(gt11L*PDstandardNth1Xt1 + gt12L*PDstandardNth1Xt2 + + gt13L*PDstandardNth1Xt3) + + J21L*(gt11L*PDstandardNth2Xt1 + gt12L*PDstandardNth2Xt2 + + gt13L*PDstandardNth2Xt3) + + J31L*(gt11L*PDstandardNth3Xt1 + gt12L*PDstandardNth3Xt2 + + gt13L*PDstandardNth3Xt3) + + (Gt111*gt11L + gt12L*Gt211 + gt13L*Gt311)*Xt1L + + (Gt112*gt11L + gt12L*Gt212 + gt13L*Gt312)*Xt2L + + (Gt113*gt11L + gt12L*Gt213 + gt13L*Gt313)*Xt3L + + gtu21*(Gt112*(gt13L*Gt311 + 3*(gt12L*Gt211 + gt13L*Gt311)) + + gt11L*(Gt112*(6*Gt111 + 2*Gt212) + + 2*(Gt122*Gt211 + Gt123*Gt311 + Gt113*Gt312)) + + 2*(Gt212*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + + gt13L*(Gt211*Gt322 + Gt311*Gt323)) + + Gt312*(gt13L*(4*Gt111 + 2*Gt313) + 2*(Gt211*gt23L + Gt311*gt33L)) + + gt12L*(4*Gt111*Gt212 + Gt211*(Gt112 + 2*Gt222) + + 2*(Gt223*Gt311 + Gt213*Gt312 + SQR(Gt212)))) + + gtu11*(4*Gt111*(gt12L*Gt211 + gt13L*Gt311) + + 2*(gt12L*(Gt211*Gt212 + Gt213*Gt311) + + Gt211*(gt23L*Gt311 + gt13L*Gt312) + gt13L*Gt311*Gt313) + + gt11L*(2*(Gt112*Gt211 + Gt113*Gt311) + 3*SQR(Gt111)) + + gt22L*SQR(Gt211) + gt33L*SQR(Gt311)) + + gtu22*(4*Gt112*(gt12L*Gt212 + gt13L*Gt312) + + 2*(gt12L*(Gt212*Gt222 + Gt223*Gt312) + + Gt212*(gt23L*Gt312 + gt13L*Gt322) + gt13L*Gt312*Gt323) + + gt11L*(2*(Gt122*Gt212 + Gt123*Gt312) + 3*SQR(Gt112)) + + gt22L*SQR(Gt212) + gt33L*SQR(Gt312)) + + gtu33*(4*Gt113*(gt12L*Gt213 + gt13L*Gt313) + + 2*(gt12L*(Gt213*Gt223 + Gt233*Gt313) + + Gt213*(gt23L*Gt313 + gt13L*Gt323) + gt13L*Gt313*Gt333) + + gt11L*(2*(Gt123*Gt213 + Gt133*Gt313) + 3*SQR(Gt113)) + + gt22L*SQR(Gt213) + gt33L*SQR(Gt313)) + + gtu31*(Gt113*(gt13L*Gt311 + 3*(gt12L*Gt211 + gt13L*Gt311)) + + gt11L*(2*(Gt123*Gt211 + Gt112*Gt213 + Gt133*Gt311) + + Gt113*(6*Gt111 + 2*Gt313)) + + gt12L*(Gt211*(Gt113 + 2*Gt223) + 2*Gt233*Gt311 + + Gt213*(4*Gt111 + 2*(Gt212 + Gt313))) + + 2*(Gt213*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + gt13L*Gt311*Gt333 + + Gt313*(Gt211*gt23L + Gt311*gt33L)) + + gt13L*(4*Gt111*Gt313 + 2*(Gt211*Gt323 + SQR(Gt313)))) + + khalf*(-2*(gtu21*(J11L*J12L*PDstandardNth11gt11 + + J12L*J21L*PDstandardNth12gt11 + J11L*J22L*PDstandardNth12gt11 + + J12L*J31L*PDstandardNth13gt11 + J11L*J32L*PDstandardNth13gt11 + + dJ112L*PDstandardNth1gt11 + J21L*J22L*PDstandardNth22gt11 + + J22L*J31L*PDstandardNth23gt11 + J21L*J32L*PDstandardNth23gt11 + + dJ212L*PDstandardNth2gt11 + J31L*J32L*PDstandardNth33gt11 + + dJ312L*PDstandardNth3gt11) + + gtu31*(J11L*J13L*PDstandardNth11gt11 + + J13L*J21L*PDstandardNth12gt11 + J11L*J23L*PDstandardNth12gt11 + + J13L*J31L*PDstandardNth13gt11 + J11L*J33L*PDstandardNth13gt11 + + dJ113L*PDstandardNth1gt11 + J21L*J23L*PDstandardNth22gt11 + + J23L*J31L*PDstandardNth23gt11 + J21L*J33L*PDstandardNth23gt11 + + dJ213L*PDstandardNth2gt11 + J31L*J33L*PDstandardNth33gt11 + + dJ313L*PDstandardNth3gt11) + + gtu32*(J12L*J13L*PDstandardNth11gt11 + + J13L*J22L*PDstandardNth12gt11 + J12L*J23L*PDstandardNth12gt11 + + J13L*J32L*PDstandardNth13gt11 + J12L*J33L*PDstandardNth13gt11 + + dJ123L*PDstandardNth1gt11 + J22L*J23L*PDstandardNth22gt11 + + J23L*J32L*PDstandardNth23gt11 + J22L*J33L*PDstandardNth23gt11 + + dJ223L*PDstandardNth2gt11 + J32L*J33L*PDstandardNth33gt11 + + dJ323L*PDstandardNth3gt11)) - + gtu11*(2*J11L*J21L*PDstandardNth12gt11 + + 2*J11L*J31L*PDstandardNth13gt11 + dJ111L*PDstandardNth1gt11 + + 2*J21L*J31L*PDstandardNth23gt11 + dJ211L*PDstandardNth2gt11 + + dJ311L*PDstandardNth3gt11 + PDstandardNth11gt11*SQR(J11L) + + PDstandardNth22gt11*SQR(J21L) + PDstandardNth33gt11*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt11 + + 2*J12L*J32L*PDstandardNth13gt11 + dJ122L*PDstandardNth1gt11 + + 2*J22L*J32L*PDstandardNth23gt11 + dJ222L*PDstandardNth2gt11 + + dJ322L*PDstandardNth3gt11 + PDstandardNth11gt11*SQR(J12L) + + PDstandardNth22gt11*SQR(J22L) + PDstandardNth33gt11*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt11 + + 2*J13L*J33L*PDstandardNth13gt11 + dJ133L*PDstandardNth1gt11 + + 2*J23L*J33L*PDstandardNth23gt11 + dJ233L*PDstandardNth2gt11 + + dJ333L*PDstandardNth3gt11 + PDstandardNth11gt11*SQR(J13L) + + PDstandardNth22gt11*SQR(J23L) + PDstandardNth33gt11*SQR(J33L))); + + Rt12 = khalf*((gt12L*J11L + gt11L*J12L)*PDstandardNth1Xt1 + + (gt22L*J11L + gt12L*J12L)*PDstandardNth1Xt2 + + (gt23L*J11L + gt13L*J12L)*PDstandardNth1Xt3 + + (gt12L*J21L + gt11L*J22L)*PDstandardNth2Xt1 + + (gt22L*J21L + gt12L*J22L)*PDstandardNth2Xt2 + + (gt23L*J21L + gt13L*J22L)*PDstandardNth2Xt3 - + 2*(gtu21*(J11L*J12L*PDstandardNth11gt12 + J12L*J21L*PDstandardNth12gt12 + + J11L*J22L*PDstandardNth12gt12 + J12L*J31L*PDstandardNth13gt12 + + J11L*J32L*PDstandardNth13gt12 + dJ112L*PDstandardNth1gt12 + + J21L*J22L*PDstandardNth22gt12 + J22L*J31L*PDstandardNth23gt12 + + J21L*J32L*PDstandardNth23gt12 + dJ212L*PDstandardNth2gt12 + + J31L*J32L*PDstandardNth33gt12 + dJ312L*PDstandardNth3gt12) + + gtu31*(J11L*J13L*PDstandardNth11gt12 + J13L*J21L*PDstandardNth12gt12 + + J11L*J23L*PDstandardNth12gt12 + J13L*J31L*PDstandardNth13gt12 + + J11L*J33L*PDstandardNth13gt12 + dJ113L*PDstandardNth1gt12 + + J21L*J23L*PDstandardNth22gt12 + J23L*J31L*PDstandardNth23gt12 + + J21L*J33L*PDstandardNth23gt12 + dJ213L*PDstandardNth2gt12 + + J31L*J33L*PDstandardNth33gt12 + dJ313L*PDstandardNth3gt12) + + gtu32*(J12L*J13L*PDstandardNth11gt12 + J13L*J22L*PDstandardNth12gt12 + + J12L*J23L*PDstandardNth12gt12 + J13L*J32L*PDstandardNth13gt12 + + J12L*J33L*PDstandardNth13gt12 + dJ123L*PDstandardNth1gt12 + + J22L*J23L*PDstandardNth22gt12 + J23L*J32L*PDstandardNth23gt12 + + J22L*J33L*PDstandardNth23gt12 + dJ223L*PDstandardNth2gt12 + + J32L*J33L*PDstandardNth33gt12 + dJ323L*PDstandardNth3gt12)) + + (gt12L*J31L + gt11L*J32L)*PDstandardNth3Xt1 + + (gt22L*J31L + gt12L*J32L)*PDstandardNth3Xt2 + + (gt23L*J31L + gt13L*J32L)*PDstandardNth3Xt3 + + (Gt112*gt11L + Gt111*gt12L + gt12L*Gt212 + Gt211*gt22L + gt23L*Gt311 + + gt13L*Gt312)*Xt1L + (gt11L*Gt122 + Gt112*gt12L + gt12L*Gt222 + + Gt212*gt22L + gt23L*Gt312 + gt13L*Gt322)*Xt2L + + (gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + + gt13L*Gt323)*Xt3L + 2*((Gt123*gt12L*Gt211 + Gt113*gt12L*Gt212 + + 2*Gt112*gt12L*Gt213 + gt12L*Gt212*Gt223 + Gt212*Gt213*gt22L + + Gt211*Gt223*gt22L + gt12L*Gt133*Gt311 + gt22L*Gt233*Gt311 + + Gt113*gt13L*Gt312 + gt12L*Gt233*Gt312 + Gt213*gt23L*Gt312 + + gt11L*(2*Gt112*Gt113 + Gt123*Gt212 + Gt133*Gt312) + + 2*Gt112*gt13L*Gt313 + Gt212*gt23L*Gt313 + + Gt111*(Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + + gt13L*Gt212*Gt323 + Gt211*gt23L*Gt323 + gt23L*Gt311*Gt333 + + gt13L*Gt312*Gt333 + Gt312*Gt313*gt33L)*gtu31 + + (Gt123*gt12L*Gt212 + 2*Gt122*gt12L*Gt213 + Gt113*gt12L*Gt222 + + gt12L*Gt222*Gt223 + Gt213*Gt222*gt22L + Gt212*Gt223*gt22L + + gt12L*Gt133*Gt312 + gt22L*Gt233*Gt312 + 2*Gt122*gt13L*Gt313 + + Gt222*gt23L*Gt313 + Gt112* + (Gt113*gt12L + Gt213*gt22L + gt23L*Gt313) + Gt113*gt13L*Gt322 + + gt12L*Gt233*Gt322 + Gt213*gt23L*Gt322 + + gt11L*(2*Gt113*Gt122 + Gt123*Gt222 + Gt133*Gt322) + + gt13L*Gt222*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt312*Gt333 + + gt13L*Gt322*Gt333 + Gt313*Gt322*gt33L)*gtu32 + + gtu11*(3*Gt112*gt12L*Gt211 + 2*Gt211*Gt212*gt22L + Gt113*gt12L*Gt311 + + 2*Gt112*gt13L*Gt311 + Gt213*gt22L*Gt311 + Gt212*gt23L*Gt311 + + gt13L*Gt212*Gt312 + gt12L*Gt213*Gt312 + 2*Gt211*gt23L*Gt312 + + gt11L*(2*Gt111*Gt112 + Gt112*Gt212 + Gt113*Gt312) + + Gt111*(gt12L*Gt212 + Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312) + + gt23L*Gt311*Gt313 + gt13L*Gt312*Gt313 + Gt311*Gt312*gt33L + + gt12L*SQR(Gt111) + gt12L*SQR(Gt212)) + + gtu21*(Gt112*gt11L*Gt222 + Gt112*Gt211*gt22L + Gt211*Gt222*gt22L + + 2*Gt122*gt13L*Gt311 + Gt112*gt23L*Gt311 + Gt222*gt23L*Gt311 + + gt13L*Gt222*Gt312 + Gt213*gt22L*Gt312 + Gt212*gt23L*Gt312 + + gt23L*Gt312*Gt313 + Gt113*gt11L*Gt322 + Gt211*gt23L*Gt322 + + gt13L*Gt313*Gt322 + Gt111* + (2*gt11L*Gt122 + Gt112*gt12L + gt12L*Gt222 + gt13L*Gt322) + + gt12L*(2*Gt122*Gt211 + Gt112*Gt212 + Gt212*Gt222 + Gt113*Gt312 + + Gt213*Gt322) + Gt311*Gt322*gt33L + gt22L*SQR(Gt212)) + + gtu22*(gt11L*Gt122*Gt222 + 2*Gt212*Gt222*gt22L + 2*Gt122*gt13L*Gt312 + + Gt223*gt22L*Gt312 + Gt222*gt23L*Gt312 + gt11L*Gt123*Gt322 + + gt13L*Gt222*Gt322 + 2*Gt212*gt23L*Gt322 + + Gt112*(2*gt11L*Gt122 + gt12L*Gt222 + Gt212*gt22L + gt23L*Gt312 + + gt13L*Gt322) + gt23L*Gt312*Gt323 + gt13L*Gt322*Gt323 + + Gt312*Gt322*gt33L + gt12L*SQR(Gt112) + + gt12L*(3*Gt122*Gt212 + Gt123*Gt312 + Gt223*Gt322 + SQR(Gt222))) + + gtu33*(gt11L*Gt123*Gt223 + 2*Gt213*Gt223*gt22L + 2*Gt123*gt13L*Gt313 + + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + gt11L*Gt133*Gt323 + + gt13L*Gt223*Gt323 + 2*Gt213*gt23L*Gt323 + + Gt113*(2*gt11L*Gt123 + gt12L*Gt223 + Gt213*gt22L + gt23L*Gt313 + + gt13L*Gt323) + gt23L*Gt313*Gt333 + gt13L*Gt323*Gt333 + + Gt313*Gt323*gt33L + gt12L*SQR(Gt113) + + gt12L*(3*Gt123*Gt213 + Gt133*Gt313 + Gt233*Gt323 + SQR(Gt223))) + + gtu21*(Gt122*gt12L*Gt211 + 3*Gt112*gt12L*Gt212 + gt12L*Gt212*Gt222 + + Gt211*Gt222*gt22L + Gt123*gt12L*Gt311 + Gt223*gt22L*Gt311 + + 3*Gt112*gt13L*Gt312 + gt12L*Gt223*Gt312 + 2*Gt212*gt23L*Gt312 + + Gt111*(Gt112*gt12L + Gt212*gt22L + gt23L*Gt312) + + gt13L*Gt212*Gt322 + Gt211*gt23L*Gt322 + gt23L*Gt311*Gt323 + + gt13L*Gt312*Gt323 + gt11L* + (Gt122*Gt212 + Gt123*Gt312 + 2*SQR(Gt112)) + gt22L*SQR(Gt212) + + gt33L*SQR(Gt312)) + gtu31* + (Gt112*gt11L*Gt223 + Gt113*Gt211*gt22L + Gt212*Gt213*gt22L + + Gt211*Gt223*gt22L + 2*Gt123*gt13L*Gt311 + Gt113*gt23L*Gt311 + + Gt223*gt23L*Gt311 + gt13L*Gt223*Gt312 + Gt213*gt23L*Gt312 + + Gt213*gt22L*Gt313 + Gt113*gt11L*Gt323 + Gt211*gt23L*Gt323 + + gt13L*Gt313*Gt323 + Gt111* + (2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + + gt12L*(2*Gt123*Gt211 + Gt112*Gt213 + Gt212*Gt223 + Gt113*Gt313 + + Gt213*Gt323) + Gt311*Gt323*gt33L + gt23L*SQR(Gt313)) + + gtu32*(gt11L*Gt122*Gt223 + Gt113*Gt212*gt22L + Gt213*Gt222*gt22L + + Gt212*Gt223*gt22L + 2*Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + + Gt223*gt23L*Gt312 + Gt223*gt22L*Gt313 + gt13L*Gt223*Gt322 + + Gt213*gt23L*Gt322 + gt11L*Gt123*Gt323 + Gt212*gt23L*Gt323 + + gt23L*Gt313*Gt323 + Gt112* + (2*gt11L*Gt123 + Gt113*gt12L + gt12L*Gt223 + gt13L*Gt323) + + gt12L*(Gt122*Gt213 + Gt123*(2*Gt212 + Gt313) + + Gt223*(Gt222 + Gt323)) + Gt312*Gt323*gt33L + gt13L*SQR(Gt323)))\ + - gtu11*(2*J11L*J21L*PDstandardNth12gt12 + + 2*J11L*J31L*PDstandardNth13gt12 + dJ111L*PDstandardNth1gt12 + + 2*J21L*J31L*PDstandardNth23gt12 + dJ211L*PDstandardNth2gt12 + + dJ311L*PDstandardNth3gt12 + PDstandardNth11gt12*SQR(J11L) + + PDstandardNth22gt12*SQR(J21L) + PDstandardNth33gt12*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt12 + + 2*J12L*J32L*PDstandardNth13gt12 + dJ122L*PDstandardNth1gt12 + + 2*J22L*J32L*PDstandardNth23gt12 + dJ222L*PDstandardNth2gt12 + + dJ322L*PDstandardNth3gt12 + PDstandardNth11gt12*SQR(J12L) + + PDstandardNth22gt12*SQR(J22L) + PDstandardNth33gt12*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt12 + + 2*J13L*J33L*PDstandardNth13gt12 + dJ133L*PDstandardNth1gt12 + + 2*J23L*J33L*PDstandardNth23gt12 + dJ233L*PDstandardNth2gt12 + + dJ333L*PDstandardNth3gt12 + PDstandardNth11gt12*SQR(J13L) + + PDstandardNth22gt12*SQR(J23L) + PDstandardNth33gt12*SQR(J33L))); + + Rt13 = khalf*((gt13L*J11L + gt11L*J13L)*PDstandardNth1Xt1 + + (gt23L*J11L + gt12L*J13L)*PDstandardNth1Xt2 + + (gt33L*J11L + gt13L*J13L)*PDstandardNth1Xt3 + + (gt13L*J21L + gt11L*J23L)*PDstandardNth2Xt1 + + (gt23L*J21L + gt12L*J23L)*PDstandardNth2Xt2 + + (gt33L*J21L + gt13L*J23L)*PDstandardNth2Xt3 - + 2*(gtu21*(J11L*J12L*PDstandardNth11gt13 + J12L*J21L*PDstandardNth12gt13 + + J11L*J22L*PDstandardNth12gt13 + J12L*J31L*PDstandardNth13gt13 + + J11L*J32L*PDstandardNth13gt13 + dJ112L*PDstandardNth1gt13 + + J21L*J22L*PDstandardNth22gt13 + J22L*J31L*PDstandardNth23gt13 + + J21L*J32L*PDstandardNth23gt13 + dJ212L*PDstandardNth2gt13 + + J31L*J32L*PDstandardNth33gt13 + dJ312L*PDstandardNth3gt13) + + gtu31*(J11L*J13L*PDstandardNth11gt13 + J13L*J21L*PDstandardNth12gt13 + + J11L*J23L*PDstandardNth12gt13 + J13L*J31L*PDstandardNth13gt13 + + J11L*J33L*PDstandardNth13gt13 + dJ113L*PDstandardNth1gt13 + + J21L*J23L*PDstandardNth22gt13 + J23L*J31L*PDstandardNth23gt13 + + J21L*J33L*PDstandardNth23gt13 + dJ213L*PDstandardNth2gt13 + + J31L*J33L*PDstandardNth33gt13 + dJ313L*PDstandardNth3gt13) + + gtu32*(J12L*J13L*PDstandardNth11gt13 + J13L*J22L*PDstandardNth12gt13 + + J12L*J23L*PDstandardNth12gt13 + J13L*J32L*PDstandardNth13gt13 + + J12L*J33L*PDstandardNth13gt13 + dJ123L*PDstandardNth1gt13 + + J22L*J23L*PDstandardNth22gt13 + J23L*J32L*PDstandardNth23gt13 + + J22L*J33L*PDstandardNth23gt13 + dJ223L*PDstandardNth2gt13 + + J32L*J33L*PDstandardNth33gt13 + dJ323L*PDstandardNth3gt13)) + + (gt13L*J31L + gt11L*J33L)*PDstandardNth3Xt1 + + (gt23L*J31L + gt12L*J33L)*PDstandardNth3Xt2 + + (gt33L*J31L + gt13L*J33L)*PDstandardNth3Xt3 + + (Gt113*gt11L + Gt111*gt13L + gt12L*Gt213 + Gt211*gt23L + gt13L*Gt313 + + Gt311*gt33L)*Xt1L + (gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + + Gt212*gt23L + gt13L*Gt323 + Gt312*gt33L)*Xt2L + + (gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + Gt213*gt23L + gt13L*Gt333 + + Gt313*gt33L)*Xt3L + 2*((Gt122*gt13L*Gt211 + 2*Gt113*gt12L*Gt212 + + Gt112*gt12L*Gt213 + gt12L*Gt213*Gt222 + Gt212*Gt213*gt22L + + Gt211*Gt222*gt23L + Gt123*gt13L*Gt311 + Gt223*gt23L*Gt311 + + 2*Gt113*gt13L*Gt312 + Gt213*gt23L*Gt312 + Gt112*gt13L*Gt313 + + gt12L*Gt223*Gt313 + Gt212*gt23L*Gt313 + + gt11L*(2*Gt112*Gt113 + Gt122*Gt213 + Gt123*Gt313) + + gt13L*Gt213*Gt322 + gt13L*Gt313*Gt323 + Gt312*Gt313*gt33L + + Gt211*Gt322*gt33L + Gt311*Gt323*gt33L + + Gt111*(Gt112*gt13L + Gt212*gt23L + Gt312*gt33L))*gtu21 + + (Gt122*gt13L*Gt213 + gt11L*Gt122*Gt233 + Gt212*gt22L*Gt233 + + Gt113*Gt212*gt23L + Gt213*Gt222*gt23L + 2*Gt133*gt13L*Gt312 + + Gt233*gt23L*Gt312 + Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + + gt13L*Gt233*Gt322 + gt11L*Gt123*Gt333 + Gt212*gt23L*Gt333 + + gt13L*Gt323*Gt333 + Gt112* + (2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + + gt12L*(2*Gt133*Gt212 + Gt222*Gt233 + Gt223*Gt333) + + Gt113*Gt312*gt33L + Gt213*Gt322*gt33L + Gt313*Gt323*gt33L + + Gt312*Gt333*gt33L)*gtu32 + + gtu21*(2*Gt123*gt12L*Gt211 + Gt112*gt13L*Gt212 + gt12L*Gt212*Gt223 + + Gt211*Gt223*gt22L + Gt112*Gt211*gt23L + 2*Gt123*gt13L*Gt311 + + Gt223*gt23L*Gt311 + Gt113*gt13L*Gt312 + gt13L*Gt223*Gt312 + + Gt213*gt23L*Gt312 + gt12L*Gt213*Gt323 + Gt211*gt23L*Gt323 + + gt13L*Gt313*Gt323 + gt11L* + (2*Gt111*Gt123 + Gt112*Gt223 + Gt113*Gt323) + + Gt111*(Gt112*gt13L + gt12L*Gt223 + gt13L*Gt323) + + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + Gt312*Gt313*gt33L + + Gt311*Gt323*gt33L + gt23L*SQR(Gt212)) + + gtu32*(Gt123*gt13L*Gt212 + 2*Gt123*gt12L*Gt213 + Gt113*gt12L*Gt223 + + Gt213*Gt223*gt22L + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + + Gt233*gt23L*Gt312 + 2*Gt123*gt13L*Gt313 + Gt223*gt23L*Gt313 + + Gt113*gt13L*Gt323 + gt13L*Gt223*Gt323 + gt12L*Gt233*Gt323 + + Gt213*gt23L*Gt323 + gt11L* + (2*Gt113*Gt123 + Gt123*Gt223 + Gt133*Gt323) + gt13L*Gt323*Gt333 + + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L + + Gt112*(Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + gt12L*SQR(Gt223))\ + + gtu11*(2*Gt113*gt12L*Gt211 + Gt112*gt13L*Gt211 + + gt12L*Gt212*Gt213 + Gt211*Gt213*gt22L + Gt211*Gt212*gt23L + + 3*Gt113*gt13L*Gt311 + 2*Gt213*gt23L*Gt311 + gt13L*Gt213*Gt312 + + gt12L*Gt213*Gt313 + Gt211*gt23L*Gt313 + + gt11L*(2*Gt111*Gt113 + Gt112*Gt213 + Gt113*Gt313) + + Gt211*Gt312*gt33L + 2*Gt311*Gt313*gt33L + + Gt111*(gt12L*Gt213 + Gt211*gt23L + gt13L*Gt313 + Gt311*gt33L) + + gt13L*SQR(Gt111) + gt13L*SQR(Gt313)) + + gtu31*(Gt112*gt13L*Gt213 + Gt112*gt11L*Gt233 + Gt211*gt22L*Gt233 + + Gt113*Gt211*gt23L + Gt212*Gt213*gt23L + 2*Gt133*gt13L*Gt311 + + Gt233*gt23L*Gt311 + gt13L*Gt233*Gt312 + Gt113*gt13L*Gt313 + + Gt213*gt23L*Gt313 + Gt113*gt11L*Gt333 + Gt211*gt23L*Gt333 + + gt13L*Gt313*Gt333 + Gt111* + (2*gt11L*Gt133 + Gt113*gt13L + gt12L*Gt233 + gt13L*Gt333) + + gt12L*(2*Gt133*Gt211 + Gt212*Gt233 + Gt213*Gt333) + + Gt113*Gt311*gt33L + Gt213*Gt312*gt33L + Gt311*Gt333*gt33L + + gt33L*SQR(Gt313)) + gtu31* + (Gt123*gt13L*Gt211 + 3*Gt113*gt12L*Gt213 + gt12L*Gt213*Gt223 + + Gt211*Gt223*gt23L + Gt133*gt13L*Gt311 + Gt233*gt23L*Gt311 + + 3*Gt113*gt13L*Gt313 + gt12L*Gt233*Gt313 + 2*Gt213*gt23L*Gt313 + + gt13L*Gt213*Gt323 + gt13L*Gt313*Gt333 + Gt211*Gt323*gt33L + + Gt311*Gt333*gt33L + Gt111* + (Gt113*gt13L + Gt213*gt23L + Gt313*gt33L) + + gt11L*(Gt123*Gt213 + Gt133*Gt313 + 2*SQR(Gt113)) + + gt22L*SQR(Gt213) + gt33L*SQR(Gt313)) + + gtu22*(2*Gt123*gt12L*Gt212 + Gt122*gt13L*Gt212 + gt12L*Gt222*Gt223 + + Gt212*Gt223*gt22L + Gt212*Gt222*gt23L + 3*Gt123*gt13L*Gt312 + + 2*Gt223*gt23L*Gt312 + gt13L*Gt223*Gt322 + gt12L*Gt223*Gt323 + + Gt212*gt23L*Gt323 + gt11L* + (2*Gt112*Gt123 + Gt122*Gt223 + Gt123*Gt323) + Gt212*Gt322*gt33L + + 2*Gt312*Gt323*gt33L + + Gt112*(gt12L*Gt223 + Gt212*gt23L + gt13L*Gt323 + Gt312*gt33L) + + gt13L*SQR(Gt112) + gt13L*SQR(Gt323)) + + gtu33*(2*gt12L*Gt133*Gt213 + Gt123*gt13L*Gt213 + gt11L*Gt123*Gt233 + + gt12L*Gt223*Gt233 + Gt213*gt22L*Gt233 + Gt213*Gt223*gt23L + + 3*Gt133*gt13L*Gt313 + 2*Gt233*gt23L*Gt313 + gt13L*Gt233*Gt323 + + gt11L*Gt133*Gt333 + gt12L*Gt233*Gt333 + Gt213*gt23L*Gt333 + + Gt213*Gt323*gt33L + 2*Gt313*Gt333*gt33L + + Gt113*(2*gt11L*Gt133 + gt12L*Gt233 + Gt213*gt23L + gt13L*Gt333 + + Gt313*gt33L) + gt13L*SQR(Gt113) + gt13L*SQR(Gt333))) - + gtu11*(2*J11L*J21L*PDstandardNth12gt13 + + 2*J11L*J31L*PDstandardNth13gt13 + dJ111L*PDstandardNth1gt13 + + 2*J21L*J31L*PDstandardNth23gt13 + dJ211L*PDstandardNth2gt13 + + dJ311L*PDstandardNth3gt13 + PDstandardNth11gt13*SQR(J11L) + + PDstandardNth22gt13*SQR(J21L) + PDstandardNth33gt13*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt13 + + 2*J12L*J32L*PDstandardNth13gt13 + dJ122L*PDstandardNth1gt13 + + 2*J22L*J32L*PDstandardNth23gt13 + dJ222L*PDstandardNth2gt13 + + dJ322L*PDstandardNth3gt13 + PDstandardNth11gt13*SQR(J12L) + + PDstandardNth22gt13*SQR(J22L) + PDstandardNth33gt13*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt13 + + 2*J13L*J33L*PDstandardNth13gt13 + dJ133L*PDstandardNth1gt13 + + 2*J23L*J33L*PDstandardNth23gt13 + dJ233L*PDstandardNth2gt13 + + dJ333L*PDstandardNth3gt13 + PDstandardNth11gt13*SQR(J13L) + + PDstandardNth22gt13*SQR(J23L) + PDstandardNth33gt13*SQR(J33L))); + + Rt22 = (Gt223*(3*Gt112*gt12L + 6*Gt212*gt22L + 4*gt23L*Gt312) + + Gt123*(Gt112*gt11L + gt12L*(2*Gt111 + 4*Gt212) + + 2*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312)) + + Gt112*(gt11L*Gt123 + gt12L*(2*Gt113 + Gt223) + + 2*(Gt213*gt22L + gt23L*Gt313) + gt13L*Gt323) + + 2*(Gt113*gt12L*Gt323 + Gt312* + (gt12L*Gt133 + gt22L*Gt233 + gt23L*Gt333)) + + Gt323*(Gt112*gt13L + 4*Gt212*gt23L + + 2*(Gt213*gt22L + gt23L*Gt313 + Gt312*gt33L)))*gtu31 + + J12L*(gt12L*PDstandardNth1Xt1 + gt22L*PDstandardNth1Xt2 + + gt23L*PDstandardNth1Xt3) + + J22L*(gt12L*PDstandardNth2Xt1 + gt22L*PDstandardNth2Xt2 + + gt23L*PDstandardNth2Xt3) + + J32L*(gt12L*PDstandardNth3Xt1 + gt22L*PDstandardNth3Xt2 + + gt23L*PDstandardNth3Xt3) + + (Gt112*gt12L + Gt212*gt22L + gt23L*Gt312)*Xt1L + + (Gt122*gt12L + Gt222*gt22L + gt23L*Gt322)*Xt2L + + (Gt123*gt12L + Gt223*gt22L + gt23L*Gt323)*Xt3L + + gtu21*(Gt222*(3*Gt112*gt12L + 6*Gt212*gt22L + 4*gt23L*Gt312) + + Gt122*(Gt112*gt11L + gt12L*(2*Gt111 + 4*Gt212) + + 2*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312)) + + Gt112*(gt11L*Gt122 + gt12L*Gt222 + 2*(Gt212*gt22L + gt23L*Gt312) + + gt13L*Gt322) + Gt322*(Gt112*gt13L + 4*Gt212*gt23L + + 2*(Gt213*gt22L + gt23L*Gt313 + Gt312*gt33L)) + + 2*(Gt312*(Gt123*gt12L + Gt223*gt22L + gt23L*Gt323) + + gt12L*(Gt113*Gt322 + SQR(Gt112)))) + + gtu11*(Gt112*(gt12L*(2*Gt111 + 4*Gt212) + + 2*(Gt211*gt22L + gt23L*Gt311 + gt13L*Gt312)) + + Gt312*(2*(Gt113*gt12L + Gt213*gt22L) + gt23L*(4*Gt212 + 2*Gt313)) + + gt11L*SQR(Gt112) + 3*gt22L*SQR(Gt212) + gt33L*SQR(Gt312)) + + gtu22*(Gt122*(gt12L*(2*Gt112 + 4*Gt222) + + 2*(Gt212*gt22L + gt23L*Gt312 + gt13L*Gt322)) + + Gt322*(2*(Gt123*gt12L + Gt223*gt22L) + gt23L*(4*Gt222 + 2*Gt323)) + + gt11L*SQR(Gt122) + 3*gt22L*SQR(Gt222) + gt33L*SQR(Gt322)) + + gtu33*(Gt123*(gt12L*(2*Gt113 + 4*Gt223) + + 2*(Gt213*gt22L + gt23L*Gt313 + gt13L*Gt323)) + + Gt323*(2*(gt12L*Gt133 + gt22L*Gt233) + gt23L*(4*Gt223 + 2*Gt333)) + + gt11L*SQR(Gt123) + 3*gt22L*SQR(Gt223) + gt33L*SQR(Gt323)) + + gtu32*(gt22L*(2*(Gt122*Gt213 + Gt233*Gt322) + Gt223*(6*Gt222 + 2*Gt323)) + + 4*(gt12L*(Gt123*Gt222 + Gt122*Gt223) + + gt23L*(Gt223*Gt322 + Gt222*Gt323)) + + 2*(Gt123*(Gt112*gt12L + Gt212*gt22L + gt23L*Gt312 + gt13L*Gt322) + + gt12L*(Gt133*Gt322 + Gt123*Gt323) + + Gt122*(gt11L*Gt123 + Gt113*gt12L + gt23L*Gt313 + gt13L*Gt323) + + Gt322*(gt23L*Gt333 + Gt323*gt33L) + gt23L*SQR(Gt323))) + + khalf*(-2*(gtu21*(J11L*J12L*PDstandardNth11gt22 + + J12L*J21L*PDstandardNth12gt22 + J11L*J22L*PDstandardNth12gt22 + + J12L*J31L*PDstandardNth13gt22 + J11L*J32L*PDstandardNth13gt22 + + dJ112L*PDstandardNth1gt22 + J21L*J22L*PDstandardNth22gt22 + + J22L*J31L*PDstandardNth23gt22 + J21L*J32L*PDstandardNth23gt22 + + dJ212L*PDstandardNth2gt22 + J31L*J32L*PDstandardNth33gt22 + + dJ312L*PDstandardNth3gt22) + + gtu31*(J11L*J13L*PDstandardNth11gt22 + + J13L*J21L*PDstandardNth12gt22 + J11L*J23L*PDstandardNth12gt22 + + J13L*J31L*PDstandardNth13gt22 + J11L*J33L*PDstandardNth13gt22 + + dJ113L*PDstandardNth1gt22 + J21L*J23L*PDstandardNth22gt22 + + J23L*J31L*PDstandardNth23gt22 + J21L*J33L*PDstandardNth23gt22 + + dJ213L*PDstandardNth2gt22 + J31L*J33L*PDstandardNth33gt22 + + dJ313L*PDstandardNth3gt22) + + gtu32*(J12L*J13L*PDstandardNth11gt22 + + J13L*J22L*PDstandardNth12gt22 + J12L*J23L*PDstandardNth12gt22 + + J13L*J32L*PDstandardNth13gt22 + J12L*J33L*PDstandardNth13gt22 + + dJ123L*PDstandardNth1gt22 + J22L*J23L*PDstandardNth22gt22 + + J23L*J32L*PDstandardNth23gt22 + J22L*J33L*PDstandardNth23gt22 + + dJ223L*PDstandardNth2gt22 + J32L*J33L*PDstandardNth33gt22 + + dJ323L*PDstandardNth3gt22)) - + gtu11*(2*J11L*J21L*PDstandardNth12gt22 + + 2*J11L*J31L*PDstandardNth13gt22 + dJ111L*PDstandardNth1gt22 + + 2*J21L*J31L*PDstandardNth23gt22 + dJ211L*PDstandardNth2gt22 + + dJ311L*PDstandardNth3gt22 + PDstandardNth11gt22*SQR(J11L) + + PDstandardNth22gt22*SQR(J21L) + PDstandardNth33gt22*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt22 + + 2*J12L*J32L*PDstandardNth13gt22 + dJ122L*PDstandardNth1gt22 + + 2*J22L*J32L*PDstandardNth23gt22 + dJ222L*PDstandardNth2gt22 + + dJ322L*PDstandardNth3gt22 + PDstandardNth11gt22*SQR(J12L) + + PDstandardNth22gt22*SQR(J22L) + PDstandardNth33gt22*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt22 + + 2*J13L*J33L*PDstandardNth13gt22 + dJ133L*PDstandardNth1gt22 + + 2*J23L*J33L*PDstandardNth23gt22 + dJ233L*PDstandardNth2gt22 + + dJ333L*PDstandardNth3gt22 + PDstandardNth11gt22*SQR(J13L) + + PDstandardNth22gt22*SQR(J23L) + PDstandardNth33gt22*SQR(J33L))); + + Rt23 = khalf*((gt13L*J12L + gt12L*J13L)*PDstandardNth1Xt1 + + (gt23L*J12L + gt22L*J13L)*PDstandardNth1Xt2 + + (gt33L*J12L + gt23L*J13L)*PDstandardNth1Xt3 + + (gt13L*J22L + gt12L*J23L)*PDstandardNth2Xt1 + + (gt23L*J22L + gt22L*J23L)*PDstandardNth2Xt2 + + (gt33L*J22L + gt23L*J23L)*PDstandardNth2Xt3 - + 2*(gtu21*(J11L*J12L*PDstandardNth11gt23 + J12L*J21L*PDstandardNth12gt23 + + J11L*J22L*PDstandardNth12gt23 + J12L*J31L*PDstandardNth13gt23 + + J11L*J32L*PDstandardNth13gt23 + dJ112L*PDstandardNth1gt23 + + J21L*J22L*PDstandardNth22gt23 + J22L*J31L*PDstandardNth23gt23 + + J21L*J32L*PDstandardNth23gt23 + dJ212L*PDstandardNth2gt23 + + J31L*J32L*PDstandardNth33gt23 + dJ312L*PDstandardNth3gt23) + + gtu31*(J11L*J13L*PDstandardNth11gt23 + J13L*J21L*PDstandardNth12gt23 + + J11L*J23L*PDstandardNth12gt23 + J13L*J31L*PDstandardNth13gt23 + + J11L*J33L*PDstandardNth13gt23 + dJ113L*PDstandardNth1gt23 + + J21L*J23L*PDstandardNth22gt23 + J23L*J31L*PDstandardNth23gt23 + + J21L*J33L*PDstandardNth23gt23 + dJ213L*PDstandardNth2gt23 + + J31L*J33L*PDstandardNth33gt23 + dJ313L*PDstandardNth3gt23) + + gtu32*(J12L*J13L*PDstandardNth11gt23 + J13L*J22L*PDstandardNth12gt23 + + J12L*J23L*PDstandardNth12gt23 + J13L*J32L*PDstandardNth13gt23 + + J12L*J33L*PDstandardNth13gt23 + dJ123L*PDstandardNth1gt23 + + J22L*J23L*PDstandardNth22gt23 + J23L*J32L*PDstandardNth23gt23 + + J22L*J33L*PDstandardNth23gt23 + dJ223L*PDstandardNth2gt23 + + J32L*J33L*PDstandardNth33gt23 + dJ323L*PDstandardNth3gt23)) + + (gt13L*J32L + gt12L*J33L)*PDstandardNth3Xt1 + + (gt23L*J32L + gt22L*J33L)*PDstandardNth3Xt2 + + (gt33L*J32L + gt23L*J33L)*PDstandardNth3Xt3 + + (Gt113*gt12L + Gt112*gt13L + Gt213*gt22L + Gt212*gt23L + gt23L*Gt313 + + Gt312*gt33L)*Xt1L + (Gt123*gt12L + Gt122*gt13L + Gt223*gt22L + + Gt222*gt23L + gt23L*Gt323 + Gt322*gt33L)*Xt2L + + (gt12L*Gt133 + Gt123*gt13L + gt22L*Gt233 + Gt223*gt23L + gt23L*Gt333 + + Gt323*gt33L)*Xt3L + 2*((Gt112*gt11L*Gt123 + Gt111*Gt123*gt12L + + Gt111*Gt122*gt13L + Gt123*gt12L*Gt212 + Gt112*gt13L*Gt222 + + 2*Gt112*gt12L*Gt223 + Gt123*Gt211*gt22L + 2*Gt212*Gt223*gt22L + + Gt122*Gt211*gt23L + Gt212*Gt222*gt23L + Gt123*gt23L*Gt311 + + Gt123*gt13L*Gt312 + 2*Gt223*gt23L*Gt312 + Gt113*gt13L*Gt322 + + Gt213*gt23L*Gt322 + Gt113*gt12L*Gt323 + Gt112*gt13L*Gt323 + + Gt213*gt22L*Gt323 + Gt212*gt23L*Gt323 + gt23L*Gt313*Gt323 + + Gt122*Gt311*gt33L + Gt222*Gt312*gt33L + Gt313*Gt322*gt33L + + Gt312*Gt323*gt33L)*gtu21 + + (Gt112*gt11L*Gt133 + Gt111*gt12L*Gt133 + Gt111*Gt123*gt13L + + gt12L*Gt133*Gt212 + Gt112*gt13L*Gt223 + Gt133*Gt211*gt22L + + 2*Gt112*gt12L*Gt233 + 2*Gt212*gt22L*Gt233 + Gt123*Gt211*gt23L + + Gt212*Gt223*gt23L + Gt133*gt23L*Gt311 + Gt133*gt13L*Gt312 + + 2*Gt233*gt23L*Gt312 + Gt113*gt13L*Gt323 + Gt213*gt23L*Gt323 + + Gt113*gt12L*Gt333 + Gt112*gt13L*Gt333 + Gt213*gt22L*Gt333 + + Gt212*gt23L*Gt333 + gt23L*Gt313*Gt333 + Gt123*Gt311*gt33L + + Gt223*Gt312*gt33L + Gt313*Gt323*gt33L + Gt312*Gt333*gt33L)*gtu31 + + gtu21*(Gt113*gt11L*Gt122 + Gt122*gt13L*Gt212 + 2*Gt122*gt12L*Gt213 + + Gt113*gt12L*Gt222 + Gt113*Gt212*gt22L + 2*Gt213*Gt222*gt22L + + Gt212*Gt222*gt23L + Gt123*gt13L*Gt312 + Gt113*gt23L*Gt312 + + Gt223*gt23L*Gt312 + Gt123*gt12L*Gt313 + Gt122*gt13L*Gt313 + + Gt223*gt22L*Gt313 + Gt222*gt23L*Gt313 + Gt113*gt13L*Gt322 + + 2*Gt213*gt23L*Gt322 + gt23L*Gt313*Gt323 + Gt212*Gt322*gt33L + + Gt313*Gt322*gt33L + Gt312*Gt323*gt33L + + Gt112*(Gt113*gt12L + Gt212*gt23L + Gt312*gt33L) + gt13L*SQR(Gt112))\ + + gtu31*(2*Gt213*Gt223*gt22L + Gt112*Gt213*gt23L + + Gt212*Gt223*gt23L + Gt133*gt13L*Gt312 + Gt233*gt23L*Gt312 + + gt12L*Gt133*Gt313 + gt22L*Gt233*Gt313 + Gt223*gt23L*Gt313 + + Gt123*(2*gt12L*Gt213 + gt13L*(Gt212 + Gt313)) + + 2*Gt213*gt23L*Gt323 + + Gt113*(gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + Gt213*gt22L + + gt23L*Gt313 + gt13L*Gt323) + gt23L*Gt313*Gt333 + + Gt112*Gt313*gt33L + Gt212*Gt323*gt33L + Gt313*Gt323*gt33L + + Gt312*Gt333*gt33L + gt12L*SQR(Gt113)) + + gtu11*(Gt112*Gt113*gt11L + Gt111*Gt113*gt12L + Gt111*Gt112*gt13L + + Gt113*gt12L*Gt212 + Gt112*gt13L*Gt212 + 2*Gt112*gt12L*Gt213 + + Gt113*Gt211*gt22L + 2*Gt212*Gt213*gt22L + Gt112*Gt211*gt23L + + Gt113*gt23L*Gt311 + 2*Gt113*gt13L*Gt312 + 3*Gt213*gt23L*Gt312 + + Gt113*gt12L*Gt313 + Gt112*gt13L*Gt313 + Gt213*gt22L*Gt313 + + Gt212*gt23L*Gt313 + Gt112*Gt311*gt33L + Gt212*Gt312*gt33L + + 2*Gt312*Gt313*gt33L + gt23L*SQR(Gt212) + gt23L*SQR(Gt313)) + + gtu22*(gt11L*Gt122*Gt123 + Gt112*Gt123*gt12L + Gt112*Gt122*gt13L + + Gt123*gt12L*Gt222 + Gt122*gt13L*Gt222 + 2*Gt122*gt12L*Gt223 + + Gt123*Gt212*gt22L + 2*Gt222*Gt223*gt22L + Gt122*Gt212*gt23L + + Gt123*gt23L*Gt312 + 2*Gt123*gt13L*Gt322 + 3*Gt223*gt23L*Gt322 + + Gt123*gt12L*Gt323 + Gt122*gt13L*Gt323 + Gt223*gt22L*Gt323 + + Gt222*gt23L*Gt323 + Gt122*Gt312*gt33L + Gt222*Gt322*gt33L + + 2*Gt322*Gt323*gt33L + gt23L*SQR(Gt222) + gt23L*SQR(Gt323)) + + gtu32*(gt11L*Gt122*Gt133 + Gt112*gt12L*Gt133 + Gt112*Gt123*gt13L + + gt12L*Gt133*Gt222 + Gt122*gt13L*Gt223 + Gt133*Gt212*gt22L + + 2*Gt122*gt12L*Gt233 + 2*Gt222*gt22L*Gt233 + Gt123*Gt212*gt23L + + Gt222*Gt223*gt23L + Gt133*gt23L*Gt312 + Gt133*gt13L*Gt322 + + 2*Gt233*gt23L*Gt322 + Gt123*gt13L*Gt323 + Gt223*gt23L*Gt323 + + Gt123*gt12L*Gt333 + Gt122*gt13L*Gt333 + Gt223*gt22L*Gt333 + + Gt222*gt23L*Gt333 + gt23L*Gt323*Gt333 + Gt123*Gt312*gt33L + + Gt223*Gt322*gt33L + Gt322*Gt333*gt33L + gt33L*SQR(Gt323)) + + gtu32*(Gt113*Gt123*gt12L + Gt113*Gt122*gt13L + Gt123*gt13L*Gt222 + + 3*Gt123*gt12L*Gt223 + Gt123*Gt213*gt22L + Gt122*Gt213*gt23L + + Gt222*Gt223*gt23L + Gt123*gt23L*Gt313 + Gt133*gt13L*Gt322 + + Gt233*gt23L*Gt322 + gt12L*Gt133*Gt323 + 2*Gt123*gt13L*Gt323 + + gt22L*Gt233*Gt323 + 3*Gt223*gt23L*Gt323 + gt23L*Gt323*Gt333 + + Gt122*Gt313*gt33L + Gt222*Gt323*gt33L + Gt322*Gt333*gt33L + + gt11L*SQR(Gt123) + 2*gt22L*SQR(Gt223) + gt33L*SQR(Gt323)) + + gtu33*(gt11L*Gt123*Gt133 + Gt113*gt12L*Gt133 + Gt113*Gt123*gt13L + + gt12L*Gt133*Gt223 + Gt123*gt13L*Gt223 + Gt133*Gt213*gt22L + + 2*Gt123*gt12L*Gt233 + 2*Gt223*gt22L*Gt233 + Gt123*Gt213*gt23L + + Gt133*gt23L*Gt313 + 2*Gt133*gt13L*Gt323 + 3*Gt233*gt23L*Gt323 + + gt12L*Gt133*Gt333 + Gt123*gt13L*Gt333 + gt22L*Gt233*Gt333 + + Gt223*gt23L*Gt333 + Gt123*Gt313*gt33L + Gt223*Gt323*gt33L + + 2*Gt323*Gt333*gt33L + gt23L*SQR(Gt223) + gt23L*SQR(Gt333))) - + gtu11*(2*J11L*J21L*PDstandardNth12gt23 + + 2*J11L*J31L*PDstandardNth13gt23 + dJ111L*PDstandardNth1gt23 + + 2*J21L*J31L*PDstandardNth23gt23 + dJ211L*PDstandardNth2gt23 + + dJ311L*PDstandardNth3gt23 + PDstandardNth11gt23*SQR(J11L) + + PDstandardNth22gt23*SQR(J21L) + PDstandardNth33gt23*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt23 + + 2*J12L*J32L*PDstandardNth13gt23 + dJ122L*PDstandardNth1gt23 + + 2*J22L*J32L*PDstandardNth23gt23 + dJ222L*PDstandardNth2gt23 + + dJ322L*PDstandardNth3gt23 + PDstandardNth11gt23*SQR(J12L) + + PDstandardNth22gt23*SQR(J22L) + PDstandardNth33gt23*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt23 + + 2*J13L*J33L*PDstandardNth13gt23 + dJ133L*PDstandardNth1gt23 + + 2*J23L*J33L*PDstandardNth23gt23 + dJ233L*PDstandardNth2gt23 + + dJ333L*PDstandardNth3gt23 + PDstandardNth11gt23*SQR(J13L) + + PDstandardNth22gt23*SQR(J23L) + PDstandardNth33gt23*SQR(J33L))); + + Rt33 = (4*((Gt123*gt13L + Gt223*gt23L)*Gt313 + + (Gt113*gt13L + Gt213*gt23L)*Gt323) + + (2*Gt213*Gt322 + 6*Gt313*Gt323)*gt33L + + 2*(gt13L*(Gt122*Gt213 + Gt112*Gt223) + + Gt213*(Gt223*gt22L + Gt222*gt23L) + + Gt123*(Gt111*gt13L + gt12L*Gt213 + Gt211*gt23L + Gt311*gt33L) + + Gt223*(Gt212*gt23L + Gt312*gt33L) + + Gt113*(gt11L*Gt123 + Gt112*gt13L + gt12L*Gt223 + Gt212*gt23L + + Gt312*gt33L)))*gtu21 + + J13L*(gt13L*PDstandardNth1Xt1 + gt23L*PDstandardNth1Xt2 + + gt33L*PDstandardNth1Xt3) + + J23L*(gt13L*PDstandardNth2Xt1 + gt23L*PDstandardNth2Xt2 + + gt33L*PDstandardNth2Xt3) + + J33L*(gt13L*PDstandardNth3Xt1 + gt23L*PDstandardNth3Xt2 + + gt33L*PDstandardNth3Xt3) + + (Gt113*gt13L + Gt213*gt23L + Gt313*gt33L)*Xt1L + + (Gt123*gt13L + Gt223*gt23L + Gt323*gt33L)*Xt2L + + (Gt133*gt13L + Gt233*gt23L + Gt333*gt33L)*Xt3L + + gtu31*(Gt133*(Gt113*gt11L + 2*(Gt111*gt13L + gt12L*Gt213 + Gt211*gt23L) + + 4*gt13L*Gt313) + Gt333* + (3*Gt113*gt13L + 4*Gt213*gt23L + 6*Gt313*gt33L) + + Gt233*(Gt113*gt12L + 4*gt23L*Gt313 + + 2*(Gt213*gt22L + Gt212*gt23L + Gt312*gt33L)) + + Gt113*(gt11L*Gt133 + gt12L*Gt233 + gt13L*Gt333 + + 2*(Gt213*gt23L + Gt313*gt33L)) + + 2*(Gt133*Gt311*gt33L + Gt213*(Gt223*gt23L + Gt323*gt33L) + + gt13L*(Gt123*Gt213 + Gt112*Gt233 + SQR(Gt113)))) + + gtu32*(4*((Gt133*gt13L + Gt233*gt23L)*Gt323 + + (Gt123*gt13L + Gt223*gt23L)*Gt333) + + Gt323*(2*Gt223 + 6*Gt333)*gt33L + + 2*(Gt133*(Gt112*gt13L + gt12L*Gt223 + Gt212*gt23L + Gt312*gt33L) + + Gt123*(gt11L*Gt133 + gt13L*(Gt113 + Gt223) + gt12L*Gt233 + + Gt213*gt23L + Gt313*gt33L) + + Gt233*(Gt122*gt13L + Gt223*gt22L + Gt222*gt23L + Gt322*gt33L) + + gt23L*SQR(Gt223))) + gtu11* + (4*(Gt113*gt13L + Gt213*gt23L)*Gt313 + + 2*(Gt113*(Gt111*gt13L + gt12L*Gt213 + Gt211*gt23L + Gt311*gt33L) + + Gt213*(Gt112*gt13L + Gt212*gt23L + Gt312*gt33L)) + gt11L*SQR(Gt113) + + gt22L*SQR(Gt213) + 3*gt33L*SQR(Gt313)) + + gtu22*(4*(Gt123*gt13L + Gt223*gt23L)*Gt323 + + 2*(Gt123*(Gt112*gt13L + gt12L*Gt223 + Gt212*gt23L + Gt312*gt33L) + + Gt223*(Gt122*gt13L + Gt222*gt23L + Gt322*gt33L)) + gt11L*SQR(Gt123) + + gt22L*SQR(Gt223) + 3*gt33L*SQR(Gt323)) + + gtu33*(4*(Gt133*gt13L + Gt233*gt23L)*Gt333 + + 2*(Gt133*(Gt113*gt13L + gt12L*Gt233 + Gt213*gt23L + Gt313*gt33L) + + Gt233*(Gt123*gt13L + Gt223*gt23L + Gt323*gt33L)) + gt11L*SQR(Gt133) + + gt22L*SQR(Gt233) + 3*gt33L*SQR(Gt333)) + + khalf*(-2*(gtu21*(J11L*J12L*PDstandardNth11gt33 + + J12L*J21L*PDstandardNth12gt33 + J11L*J22L*PDstandardNth12gt33 + + J12L*J31L*PDstandardNth13gt33 + J11L*J32L*PDstandardNth13gt33 + + dJ112L*PDstandardNth1gt33 + J21L*J22L*PDstandardNth22gt33 + + J22L*J31L*PDstandardNth23gt33 + J21L*J32L*PDstandardNth23gt33 + + dJ212L*PDstandardNth2gt33 + J31L*J32L*PDstandardNth33gt33 + + dJ312L*PDstandardNth3gt33) + + gtu31*(J11L*J13L*PDstandardNth11gt33 + + J13L*J21L*PDstandardNth12gt33 + J11L*J23L*PDstandardNth12gt33 + + J13L*J31L*PDstandardNth13gt33 + J11L*J33L*PDstandardNth13gt33 + + dJ113L*PDstandardNth1gt33 + J21L*J23L*PDstandardNth22gt33 + + J23L*J31L*PDstandardNth23gt33 + J21L*J33L*PDstandardNth23gt33 + + dJ213L*PDstandardNth2gt33 + J31L*J33L*PDstandardNth33gt33 + + dJ313L*PDstandardNth3gt33) + + gtu32*(J12L*J13L*PDstandardNth11gt33 + + J13L*J22L*PDstandardNth12gt33 + J12L*J23L*PDstandardNth12gt33 + + J13L*J32L*PDstandardNth13gt33 + J12L*J33L*PDstandardNth13gt33 + + dJ123L*PDstandardNth1gt33 + J22L*J23L*PDstandardNth22gt33 + + J23L*J32L*PDstandardNth23gt33 + J22L*J33L*PDstandardNth23gt33 + + dJ223L*PDstandardNth2gt33 + J32L*J33L*PDstandardNth33gt33 + + dJ323L*PDstandardNth3gt33)) - + gtu11*(2*J11L*J21L*PDstandardNth12gt33 + + 2*J11L*J31L*PDstandardNth13gt33 + dJ111L*PDstandardNth1gt33 + + 2*J21L*J31L*PDstandardNth23gt33 + dJ211L*PDstandardNth2gt33 + + dJ311L*PDstandardNth3gt33 + PDstandardNth11gt33*SQR(J11L) + + PDstandardNth22gt33*SQR(J21L) + PDstandardNth33gt33*SQR(J31L)) - + gtu22*(2*J12L*J22L*PDstandardNth12gt33 + + 2*J12L*J32L*PDstandardNth13gt33 + dJ122L*PDstandardNth1gt33 + + 2*J22L*J32L*PDstandardNth23gt33 + dJ222L*PDstandardNth2gt33 + + dJ322L*PDstandardNth3gt33 + PDstandardNth11gt33*SQR(J12L) + + PDstandardNth22gt33*SQR(J22L) + PDstandardNth33gt33*SQR(J32L)) - + gtu33*(2*J13L*J23L*PDstandardNth12gt33 + + 2*J13L*J33L*PDstandardNth13gt33 + dJ133L*PDstandardNth1gt33 + + 2*J23L*J33L*PDstandardNth23gt33 + dJ233L*PDstandardNth2gt33 + + dJ333L*PDstandardNth3gt33 + PDstandardNth11gt33*SQR(J13L) + + PDstandardNth22gt33*SQR(J23L) + PDstandardNth33gt33*SQR(J33L))); + + Rphi11 = -2*((dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L)* + PDstandardNth1phi + 2*(J11L* + (J21L*PDstandardNth12phi + J31L*PDstandardNth13phi) + + J21L*J31L*PDstandardNth23phi) + + (dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L)*PDstandardNth2phi + + (dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L)*PDstandardNth3phi + + PDstandardNth11phi*SQR(J11L) + PDstandardNth22phi*SQR(J21L) + + PDstandardNth33phi*SQR(J31L) + + gt11L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt11L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)) + + 4*SQR(J11L*PDstandardNth1phi + J21L*PDstandardNth2phi + + J31L*PDstandardNth3phi); + + Rphi12 = 4*(J11L*PDstandardNth1phi + J21L*PDstandardNth2phi + + J31L*PDstandardNth3phi)*(J12L*PDstandardNth1phi + + J22L*PDstandardNth2phi + J32L*PDstandardNth3phi) - + 2*(J12L*(J11L*PDstandardNth11phi + J21L*PDstandardNth12phi + + J31L*PDstandardNth13phi) + + J11L*(J22L*PDstandardNth12phi + J32L*PDstandardNth13phi) + + (dJ112L - Gt112*J11L - Gt212*J12L - Gt312*J13L)*PDstandardNth1phi + + J22L*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi) + + (dJ212L - Gt112*J21L - Gt212*J22L - Gt312*J23L)*PDstandardNth2phi + + J32L*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi) + + (dJ312L - Gt112*J31L - Gt212*J32L - Gt312*J33L)*PDstandardNth3phi + + gt12L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt12L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)); + + Rphi13 = 4*(J11L*PDstandardNth1phi + J21L*PDstandardNth2phi + + J31L*PDstandardNth3phi)*(J13L*PDstandardNth1phi + + J23L*PDstandardNth2phi + J33L*PDstandardNth3phi) - + 2*(J13L*(J11L*PDstandardNth11phi + J21L*PDstandardNth12phi + + J31L*PDstandardNth13phi) + + J11L*(J23L*PDstandardNth12phi + J33L*PDstandardNth13phi) + + (dJ113L - Gt113*J11L - Gt213*J12L - Gt313*J13L)*PDstandardNth1phi + + J23L*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi) + + (dJ213L - Gt113*J21L - Gt213*J22L - Gt313*J23L)*PDstandardNth2phi + + J33L*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi) + + (dJ313L - Gt113*J31L - Gt213*J32L - Gt313*J33L)*PDstandardNth3phi + + gt13L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt13L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)); + + Rphi22 = -2*((dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L)* + PDstandardNth1phi + 2*(J12L* + (J22L*PDstandardNth12phi + J32L*PDstandardNth13phi) + + J22L*J32L*PDstandardNth23phi) + + (dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L)*PDstandardNth2phi + + (dJ322L - Gt122*J31L - Gt222*J32L - Gt322*J33L)*PDstandardNth3phi + + PDstandardNth11phi*SQR(J12L) + PDstandardNth22phi*SQR(J22L) + + PDstandardNth33phi*SQR(J32L) + + gt22L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt22L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)) + + 4*SQR(J12L*PDstandardNth1phi + J22L*PDstandardNth2phi + + J32L*PDstandardNth3phi); + + Rphi23 = 4*(J12L*PDstandardNth1phi + J22L*PDstandardNth2phi + + J32L*PDstandardNth3phi)*(J13L*PDstandardNth1phi + + J23L*PDstandardNth2phi + J33L*PDstandardNth3phi) - + 2*(J13L*(J12L*PDstandardNth11phi + J22L*PDstandardNth12phi + + J32L*PDstandardNth13phi) + + J12L*(J23L*PDstandardNth12phi + J33L*PDstandardNth13phi) + + (dJ123L - Gt123*J11L - Gt223*J12L - Gt323*J13L)*PDstandardNth1phi + + J23L*(J22L*PDstandardNth22phi + J32L*PDstandardNth23phi) + + (dJ223L - Gt123*J21L - Gt223*J22L - Gt323*J23L)*PDstandardNth2phi + + J33L*(J22L*PDstandardNth23phi + J32L*PDstandardNth33phi) + + (dJ323L - Gt123*J31L - Gt223*J32L - Gt323*J33L)*PDstandardNth3phi + + gt23L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt23L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)); + + Rphi33 = -2*((dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L)* + PDstandardNth1phi + 2*(J13L* + (J23L*PDstandardNth12phi + J33L*PDstandardNth13phi) + + J23L*J33L*PDstandardNth23phi) + + (dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L)*PDstandardNth2phi + + (dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L)*PDstandardNth3phi + + PDstandardNth11phi*SQR(J13L) + PDstandardNth22phi*SQR(J23L) + + PDstandardNth33phi*SQR(J33L) + + gt33L*((2*(dJ112L*gtu21 + dJ113L*gtu31 + dJ123L*gtu32) + + gtu11*(dJ111L - Gt111*J11L - Gt211*J12L - Gt311*J13L) + + gtu22*(dJ122L - Gt122*J11L - Gt222*J12L - Gt322*J13L) + + gtu33*(dJ133L - Gt133*J11L - Gt233*J12L - Gt333*J13L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J11L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J12L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J13L))* + PDstandardNth1phi + (2* + (dJ212L*gtu21 + dJ213L*gtu31 + dJ223L*gtu32) + + gtu11*(dJ211L - Gt111*J21L - Gt211*J22L - Gt311*J23L) + + gtu22*(dJ222L - Gt122*J21L - Gt222*J22L - Gt322*J23L) + + gtu33*(dJ233L - Gt133*J21L - Gt233*J22L - Gt333*J23L) - + 2*((Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32)*J21L + + (Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32)*J22L + + (Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32)*J23L))* + PDstandardNth2phi + (dJ322L*gtu22 + + 2*(dJ313L*gtu31 + dJ323L*gtu32) + + (-2*Gt112*gtu21 - Gt122*gtu22)*J31L + + (-2*Gt212*gtu21 - Gt222*gtu22)*J32L + + (-2*Gt312*gtu21 - Gt322*gtu22)*J33L + + gtu11*(dJ311L - Gt111*J31L - Gt211*J32L - Gt311*J33L) + + gtu33*(dJ333L - Gt133*J31L - Gt233*J32L - Gt333*J33L) - + 2*((Gt113*gtu31 + Gt123*gtu32)*J31L + + (Gt213*gtu31 + Gt223*gtu32)*J32L + + (Gt313*gtu31 + Gt323*gtu32)*J33L))*PDstandardNth3phi + + 2*((gtu21*J11L*J22L + gtu31*(J13L*J21L + J11L*J23L))* + PDstandardNth12phi + + (gtu21*J11L*J32L + gtu31*(J13L*J31L + J11L*J33L))* + PDstandardNth13phi + + J11L*((gtu21*J12L + gtu31*J13L)*PDstandardNth11phi + + gtu11*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + J12L*(gtu32*J13L*PDstandardNth11phi + + gtu21*(J21L*PDstandardNth12phi + J31L*PDstandardNth13phi)) + + (gtu11*J21L*J31L + (gtu22*J22L + gtu32*J23L)*J32L + + (gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth23phi + + J22L*((gtu22*J12L + gtu32*J13L)*PDstandardNth12phi + + (gtu21*J21L + gtu32*J23L)*PDstandardNth22phi + + gtu21*J31L*PDstandardNth23phi) + + J23L*((gtu32*J12L + gtu33*J13L)*PDstandardNth12phi + + gtu31*(J21L*PDstandardNth22phi + J31L*PDstandardNth23phi)) + + J32L*((gtu22*J12L + gtu32*J13L)*PDstandardNth13phi + + gtu32*J33L*PDstandardNth33phi + + gtu21*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + J33L*((gtu32*J12L + gtu33*J13L)*PDstandardNth13phi + + gtu31*(J21L*PDstandardNth23phi + J31L*PDstandardNth33phi)) + + dJ312L*gtu21*PDstandardNth3phi) + + PDstandardNth11phi*(gtu11*SQR(J11L) + gtu22*SQR(J12L) + + gtu33*SQR(J13L)) + PDstandardNth22phi* + (gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L)) + + PDstandardNth33phi*(gtu11*SQR(J31L) + gtu22*SQR(J32L) + + gtu33*SQR(J33L)))) - + 4*gt33L*(2*(((gtu11*J21L + gtu21*J22L + gtu31*J23L)*J31L + + (gtu21*J21L + gtu22*J22L + gtu32*J23L)*J32L + + (gtu31*J21L + gtu32*J22L + gtu33*J23L)*J33L)*PDstandardNth2phi* + PDstandardNth3phi + PDstandardNth1phi* + (((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J21L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J22L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J23L)*PDstandardNth2phi\ + + ((gtu11*J11L + gtu21*J12L + gtu31*J13L)*J31L + + (gtu21*J11L + gtu22*J12L + gtu32*J13L)*J32L + + (gtu31*J11L + gtu32*J12L + gtu33*J13L)*J33L)*PDstandardNth3phi)) + + (2*(gtu32*J12L*J13L + J11L*(gtu21*J12L + gtu31*J13L)) + + gtu11*SQR(J11L) + gtu22*SQR(J12L) + gtu33*SQR(J13L))* + SQR(PDstandardNth1phi) + + (2*(gtu32*J22L*J23L + J21L*(gtu21*J22L + gtu31*J23L)) + + gtu11*SQR(J21L) + gtu22*SQR(J22L) + gtu33*SQR(J23L))* + SQR(PDstandardNth2phi) + + (2*(gtu32*J32L*J33L + J31L*(gtu21*J32L + gtu31*J33L)) + + gtu11*SQR(J31L) + gtu22*SQR(J32L) + gtu33*SQR(J33L))* + SQR(PDstandardNth3phi)) + + 4*SQR(J13L*PDstandardNth1phi + J23L*PDstandardNth2phi + + J33L*PDstandardNth3phi); + + e4phi = exp(4*phiL); + + em4phi = INV(e4phi); + + gu11 = em4phi*gtu11; + + gu21 = em4phi*gtu21; + + gu31 = em4phi*gtu31; + + gu22 = em4phi*gtu22; + + gu32 = em4phi*gtu32; + + gu33 = em4phi*gtu33; + + R11 = Rphi11 + Rt11; + + R12 = Rphi12 + Rt12; + + R13 = Rphi13 + Rt13; + + R22 = Rphi22 + Rt22; + + R23 = Rphi23 + Rt23; + + R33 = Rphi33 + Rt33; + + trR = gu11*R11 + gu22*R22 + 2*(gu21*R12 + gu31*R13 + gu32*R23) + gu33*R33; + + Atm11 = At11L*gtu11 + At12L*gtu21 + At13L*gtu31; + + Atm21 = At11L*gtu21 + At12L*gtu22 + At13L*gtu32; + + Atm31 = At11L*gtu31 + At12L*gtu32 + At13L*gtu33; + + Atm12 = At12L*gtu11 + At22L*gtu21 + At23L*gtu31; + + Atm22 = At12L*gtu21 + At22L*gtu22 + At23L*gtu32; + + Atm32 = At12L*gtu31 + At22L*gtu32 + At23L*gtu33; + + Atm13 = At13L*gtu11 + At23L*gtu21 + At33L*gtu31; + + Atm23 = At13L*gtu21 + At23L*gtu22 + At33L*gtu32; + + Atm33 = At13L*gtu31 + At23L*gtu32 + At33L*gtu33; + + T00 = eTttL; + + T01 = eTtxL; + + T02 = eTtyL; + + T03 = eTtzL; + + T11 = eTxxL; + + T12 = eTxyL; + + T13 = eTxzL; + + T22 = eTyyL; + + T23 = eTyzL; + + T33 = eTzzL; + + rho = pow(alphaL,-2)*(T00 - 2*(beta2L*T02 + beta3L*T03) + + 2*(beta1L*(-T01 + beta2L*T12 + beta3L*T13) + beta2L*beta3L*T23) + + T11*SQR(beta1L) + T22*SQR(beta2L) + T33*SQR(beta3L)); + + S1 = (-T01 + beta1L*T11 + beta2L*T12 + beta3L*T13)*INV(alphaL); + + S2 = (-T02 + beta1L*T12 + beta2L*T22 + beta3L*T23)*INV(alphaL); + + S3 = (-T03 + beta1L*T13 + beta2L*T23 + beta3L*T33)*INV(alphaL); + + HL = -2.*(Atm12*Atm21 + Atm13*Atm31 + Atm23*Atm32) - + 50.26548245743669181540229413247204614715*rho + trR - + 1.*(SQR(Atm11) + SQR(Atm22) + SQR(Atm33)) + + 0.6666666666666666666666666666666666666667*SQR(trKL); + + M1L = gtu11*(-2*At11L*Gt111 - 2*At12L*Gt211 - 2*At13L*Gt311 + + J11L*PDstandardNth1At11 + 6*At11L*J11L*PDstandardNth1phi + + J21L*PDstandardNth2At11 + 6*At11L*J21L*PDstandardNth2phi + + J31L*PDstandardNth3At11 + 6*At11L*J31L*PDstandardNth3phi) - + gtu21*(At12L*Gt111 + At11L*Gt112 + At22L*Gt211 + At12L*Gt212 + + At23L*Gt311 + At13L*Gt312 - J11L*PDstandardNth1At12 - + 6*At12L*J11L*PDstandardNth1phi - J21L*PDstandardNth2At12 - + 6*At12L*J21L*PDstandardNth2phi - J31L*PDstandardNth3At12 - + 6*At12L*J31L*PDstandardNth3phi) - + gtu31*(At13L*Gt111 + At11L*Gt113 + At23L*Gt211 + At12L*Gt213 + + At33L*Gt311 + At13L*Gt313 - J11L*PDstandardNth1At13 - + 6*At13L*J11L*PDstandardNth1phi - J21L*PDstandardNth2At13 - + 6*At13L*J21L*PDstandardNth2phi - J31L*PDstandardNth3At13 - + 6*At13L*J31L*PDstandardNth3phi) + + gtu21*(-2*At11L*Gt112 - 2*At12L*Gt212 - 2*At13L*Gt312 + + J12L*PDstandardNth1At11 + 6*At11L*J12L*PDstandardNth1phi + + J22L*PDstandardNth2At11 + 6*At11L*J22L*PDstandardNth2phi + + J32L*PDstandardNth3At11 + 6*At11L*J32L*PDstandardNth3phi) - + gtu22*(At12L*Gt112 + At11L*Gt122 + At22L*Gt212 + At12L*Gt222 + + At23L*Gt312 + At13L*Gt322 - J12L*PDstandardNth1At12 - + 6*At12L*J12L*PDstandardNth1phi - J22L*PDstandardNth2At12 - + 6*At12L*J22L*PDstandardNth2phi - J32L*PDstandardNth3At12 - + 6*At12L*J32L*PDstandardNth3phi) - + gtu32*(At13L*Gt112 + At11L*Gt123 + At23L*Gt212 + At12L*Gt223 + + At33L*Gt312 + At13L*Gt323 - J12L*PDstandardNth1At13 - + 6*At13L*J12L*PDstandardNth1phi - J22L*PDstandardNth2At13 - + 6*At13L*J22L*PDstandardNth2phi - J32L*PDstandardNth3At13 - + 6*At13L*J32L*PDstandardNth3phi) + + gtu31*(-2*At11L*Gt113 - 2*At12L*Gt213 - 2*At13L*Gt313 + + J13L*PDstandardNth1At11 + 6*At11L*J13L*PDstandardNth1phi + + J23L*PDstandardNth2At11 + 6*At11L*J23L*PDstandardNth2phi + + J33L*PDstandardNth3At11 + 6*At11L*J33L*PDstandardNth3phi) - + gtu32*(At12L*Gt113 + At11L*Gt123 + At22L*Gt213 + At12L*Gt223 + + At23L*Gt313 + At13L*Gt323 - J13L*PDstandardNth1At12 - + 6*At12L*J13L*PDstandardNth1phi - J23L*PDstandardNth2At12 - + 6*At12L*J23L*PDstandardNth2phi - J33L*PDstandardNth3At12 - + 6*At12L*J33L*PDstandardNth3phi) - + gtu33*(At13L*Gt113 + At11L*Gt133 + At23L*Gt213 + At12L*Gt233 + + At33L*Gt313 + At13L*Gt333 - J13L*PDstandardNth1At13 - + 6*At13L*J13L*PDstandardNth1phi - J23L*PDstandardNth2At13 - + 6*At13L*J23L*PDstandardNth2phi - J33L*PDstandardNth3At13 - + 6*At13L*J33L*PDstandardNth3phi) - + ktwothird*(J11L*PDstandardNth1trK + J21L*PDstandardNth2trK + + J31L*PDstandardNth3trK) - 25.13274122871834590770114706623602307358*S1; + + M2L = -(gtu11*(At12L*Gt111 + At11L*Gt112 + At22L*Gt211 + At12L*Gt212 + + At23L*Gt311 + At13L*Gt312 - J11L*PDstandardNth1At12 - + 6*At12L*J11L*PDstandardNth1phi - J21L*PDstandardNth2At12 - + 6*At12L*J21L*PDstandardNth2phi - J31L*PDstandardNth3At12 - + 6*At12L*J31L*PDstandardNth3phi)) + + gtu21*(-2*At12L*Gt112 - 2*At22L*Gt212 - 2*At23L*Gt312 + + J11L*PDstandardNth1At22 + 6*At22L*J11L*PDstandardNth1phi + + J21L*PDstandardNth2At22 + 6*At22L*J21L*PDstandardNth2phi + + J31L*PDstandardNth3At22 + 6*At22L*J31L*PDstandardNth3phi) - + gtu31*(At13L*Gt112 + At12L*Gt113 + At23L*Gt212 + At22L*Gt213 + + At33L*Gt312 + At23L*Gt313 - J11L*PDstandardNth1At23 - + 6*At23L*J11L*PDstandardNth1phi - J21L*PDstandardNth2At23 - + 6*At23L*J21L*PDstandardNth2phi - J31L*PDstandardNth3At23 - + 6*At23L*J31L*PDstandardNth3phi) - + gtu21*(At12L*Gt112 + At11L*Gt122 + At22L*Gt212 + At12L*Gt222 + + At23L*Gt312 + At13L*Gt322 - J12L*PDstandardNth1At12 - + 6*At12L*J12L*PDstandardNth1phi - J22L*PDstandardNth2At12 - + 6*At12L*J22L*PDstandardNth2phi - J32L*PDstandardNth3At12 - + 6*At12L*J32L*PDstandardNth3phi) + + gtu22*(-2*At12L*Gt122 - 2*At22L*Gt222 - 2*At23L*Gt322 + + J12L*PDstandardNth1At22 + 6*At22L*J12L*PDstandardNth1phi + + J22L*PDstandardNth2At22 + 6*At22L*J22L*PDstandardNth2phi + + J32L*PDstandardNth3At22 + 6*At22L*J32L*PDstandardNth3phi) - + gtu32*(At13L*Gt122 + At12L*Gt123 + At23L*Gt222 + At22L*Gt223 + + At33L*Gt322 + At23L*Gt323 - J12L*PDstandardNth1At23 - + 6*At23L*J12L*PDstandardNth1phi - J22L*PDstandardNth2At23 - + 6*At23L*J22L*PDstandardNth2phi - J32L*PDstandardNth3At23 - + 6*At23L*J32L*PDstandardNth3phi) - + gtu31*(At12L*Gt113 + At11L*Gt123 + At22L*Gt213 + At12L*Gt223 + + At23L*Gt313 + At13L*Gt323 - J13L*PDstandardNth1At12 - + 6*At12L*J13L*PDstandardNth1phi - J23L*PDstandardNth2At12 - + 6*At12L*J23L*PDstandardNth2phi - J33L*PDstandardNth3At12 - + 6*At12L*J33L*PDstandardNth3phi) + + gtu32*(-2*At12L*Gt123 - 2*At22L*Gt223 - 2*At23L*Gt323 + + J13L*PDstandardNth1At22 + 6*At22L*J13L*PDstandardNth1phi + + J23L*PDstandardNth2At22 + 6*At22L*J23L*PDstandardNth2phi + + J33L*PDstandardNth3At22 + 6*At22L*J33L*PDstandardNth3phi) - + gtu33*(At13L*Gt123 + At12L*Gt133 + At23L*Gt223 + At22L*Gt233 + + At33L*Gt323 + At23L*Gt333 - J13L*PDstandardNth1At23 - + 6*At23L*J13L*PDstandardNth1phi - J23L*PDstandardNth2At23 - + 6*At23L*J23L*PDstandardNth2phi - J33L*PDstandardNth3At23 - + 6*At23L*J33L*PDstandardNth3phi) - + ktwothird*(J12L*PDstandardNth1trK + J22L*PDstandardNth2trK + + J32L*PDstandardNth3trK) - 25.13274122871834590770114706623602307358*S2; + + M3L = -(gtu11*(At13L*Gt111 + At11L*Gt113 + At23L*Gt211 + At12L*Gt213 + + At33L*Gt311 + At13L*Gt313 - J11L*PDstandardNth1At13 - + 6*At13L*J11L*PDstandardNth1phi - J21L*PDstandardNth2At13 - + 6*At13L*J21L*PDstandardNth2phi - J31L*PDstandardNth3At13 - + 6*At13L*J31L*PDstandardNth3phi)) - + gtu21*(At13L*Gt112 + At12L*Gt113 + At23L*Gt212 + At22L*Gt213 + + At33L*Gt312 + At23L*Gt313 - J11L*PDstandardNth1At23 - + 6*At23L*J11L*PDstandardNth1phi - J21L*PDstandardNth2At23 - + 6*At23L*J21L*PDstandardNth2phi - J31L*PDstandardNth3At23 - + 6*At23L*J31L*PDstandardNth3phi) + + gtu31*(-2*At13L*Gt113 - 2*At23L*Gt213 - 2*At33L*Gt313 + + J11L*PDstandardNth1At33 + 6*At33L*J11L*PDstandardNth1phi + + J21L*PDstandardNth2At33 + 6*At33L*J21L*PDstandardNth2phi + + J31L*PDstandardNth3At33 + 6*At33L*J31L*PDstandardNth3phi) - + gtu21*(At13L*Gt112 + At11L*Gt123 + At23L*Gt212 + At12L*Gt223 + + At33L*Gt312 + At13L*Gt323 - J12L*PDstandardNth1At13 - + 6*At13L*J12L*PDstandardNth1phi - J22L*PDstandardNth2At13 - + 6*At13L*J22L*PDstandardNth2phi - J32L*PDstandardNth3At13 - + 6*At13L*J32L*PDstandardNth3phi) - + gtu22*(At13L*Gt122 + At12L*Gt123 + At23L*Gt222 + At22L*Gt223 + + At33L*Gt322 + At23L*Gt323 - J12L*PDstandardNth1At23 - + 6*At23L*J12L*PDstandardNth1phi - J22L*PDstandardNth2At23 - + 6*At23L*J22L*PDstandardNth2phi - J32L*PDstandardNth3At23 - + 6*At23L*J32L*PDstandardNth3phi) + + gtu32*(-2*At13L*Gt123 - 2*At23L*Gt223 - 2*At33L*Gt323 + + J12L*PDstandardNth1At33 + 6*At33L*J12L*PDstandardNth1phi + + J22L*PDstandardNth2At33 + 6*At33L*J22L*PDstandardNth2phi + + J32L*PDstandardNth3At33 + 6*At33L*J32L*PDstandardNth3phi) - + gtu31*(At13L*Gt113 + At11L*Gt133 + At23L*Gt213 + At12L*Gt233 + + At33L*Gt313 + At13L*Gt333 - J13L*PDstandardNth1At13 - + 6*At13L*J13L*PDstandardNth1phi - J23L*PDstandardNth2At13 - + 6*At13L*J23L*PDstandardNth2phi - J33L*PDstandardNth3At13 - + 6*At13L*J33L*PDstandardNth3phi) - + gtu32*(At13L*Gt123 + At12L*Gt133 + At23L*Gt223 + At22L*Gt233 + + At33L*Gt323 + At23L*Gt333 - J13L*PDstandardNth1At23 - + 6*At23L*J13L*PDstandardNth1phi - J23L*PDstandardNth2At23 - + 6*At23L*J23L*PDstandardNth2phi - J33L*PDstandardNth3At23 - + 6*At23L*J33L*PDstandardNth3phi) + + gtu33*(-2*At13L*Gt133 - 2*At23L*Gt233 - 2*At33L*Gt333 + + J13L*PDstandardNth1At33 + 6*At33L*J13L*PDstandardNth1phi + + J23L*PDstandardNth2At33 + 6*At33L*J23L*PDstandardNth2phi + + J33L*PDstandardNth3At33 + 6*At33L*J33L*PDstandardNth3phi) - + ktwothird*(J13L*PDstandardNth1trK + J23L*PDstandardNth2trK + + J33L*PDstandardNth3trK) - 25.13274122871834590770114706623602307358*S3; + + cSL = Log(detgt); + + cXt1L = Gt111*gtu11 + Gt122*gtu22 + + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33 - Xt1L; + + cXt2L = Gt211*gtu11 + Gt222*gtu22 + + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33 - Xt2L; + + cXt3L = Gt311*gtu11 + Gt322*gtu22 + + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33 - Xt3L; + + cAL = At11L*gtu11 + At22L*gtu22 + + 2*(At12L*gtu21 + At13L*gtu31 + At23L*gtu32) + At33L*gtu33; + + + /* Copy local copies back to grid functions */ + cA[index] = cAL; + cS[index] = cSL; + cXt1[index] = cXt1L; + cXt2[index] = cXt2L; + cXt3[index] = cXt3L; + H[index] = HL; + M1[index] = M1L; + M2[index] = M2L; + M3[index] = M3L; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_constraints); +} + +void ML_BSSN_MP_constraints(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverInterior(cctkGH, &ML_BSSN_MP_constraints_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_constraints_boundary.c b/ML_BSSN_MP/src/ML_BSSN_MP_constraints_boundary.c new file mode 100644 index 0000000..0a4636c --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_constraints_boundary.c @@ -0,0 +1,158 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_constraints_boundary_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_constraints_boundary_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_constraints_boundary_calc_every != ML_BSSN_MP_constraints_boundary_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_constraints_boundary, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + + /* Declare local copies of grid functions */ + CCTK_REAL HL = INITVALUE; + CCTK_REAL M1L = INITVALUE, M2L = INITVALUE, M3L = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + + /* Assign local copies of grid functions */ + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + HL = 0; + + M1L = 0; + + M2L = 0; + + M3L = 0; + + + /* Copy local copies back to grid functions */ + H[index] = HL; + M1[index] = M1L; + M2[index] = M2L; + M3[index] = M3L; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_constraints_boundary); +} + +void ML_BSSN_MP_constraints_boundary(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverBoundaryWithGhosts(cctkGH, &ML_BSSN_MP_constraints_boundary_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBase.c b/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBase.c new file mode 100644 index 0000000..b0942a3 --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBase.c @@ -0,0 +1,283 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_convertFromADMBase_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_convertFromADMBase_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_convertFromADMBase_calc_every != ML_BSSN_MP_convertFromADMBase_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_convertFromADMBase, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + CCTK_REAL detg = INITVALUE; + CCTK_REAL em4phi = INITVALUE; + CCTK_REAL g11 = INITVALUE, g12 = INITVALUE, g13 = INITVALUE, g22 = INITVALUE, g23 = INITVALUE, g33 = INITVALUE; + CCTK_REAL gu11 = INITVALUE, gu21 = INITVALUE, gu22 = INITVALUE, gu31 = INITVALUE, gu32 = INITVALUE, gu33 = INITVALUE; + CCTK_REAL K11 = INITVALUE, K12 = INITVALUE, K13 = INITVALUE, K22 = INITVALUE, K23 = INITVALUE, K33 = INITVALUE; + + /* Declare local copies of grid functions */ + CCTK_REAL alpL = INITVALUE; + CCTK_REAL alphaL = INITVALUE; + CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE; + CCTK_REAL betaxL = INITVALUE; + CCTK_REAL betayL = INITVALUE; + CCTK_REAL betazL = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE; + CCTK_REAL gxxL = INITVALUE; + CCTK_REAL gxyL = INITVALUE; + CCTK_REAL gxzL = INITVALUE; + CCTK_REAL gyyL = INITVALUE; + CCTK_REAL gyzL = INITVALUE; + CCTK_REAL gzzL = INITVALUE; + CCTK_REAL kxxL = INITVALUE; + CCTK_REAL kxyL = INITVALUE; + CCTK_REAL kxzL = INITVALUE; + CCTK_REAL kyyL = INITVALUE; + CCTK_REAL kyzL = INITVALUE; + CCTK_REAL kzzL = INITVALUE; + CCTK_REAL phiL = INITVALUE; + CCTK_REAL trKL = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + + /* Assign local copies of grid functions */ + alpL = alp[index]; + betaxL = betax[index]; + betayL = betay[index]; + betazL = betaz[index]; + gxxL = gxx[index]; + gxyL = gxy[index]; + gxzL = gxz[index]; + gyyL = gyy[index]; + gyzL = gyz[index]; + gzzL = gzz[index]; + kxxL = kxx[index]; + kxyL = kxy[index]; + kxzL = kxz[index]; + kyyL = kyy[index]; + kyzL = kyz[index]; + kzzL = kzz[index]; + phiL = phi[index]; + trKL = trK[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + g11 = gxxL; + + g12 = gxyL; + + g13 = gxzL; + + g22 = gyyL; + + g23 = gyzL; + + g33 = gzzL; + + detg = 2*g12*g13*g23 + g33*(g11*g22 - SQR(g12)) - g22*SQR(g13) - g11*SQR(g23); + + gu11 = INV(detg)*(g22*g33 - SQR(g23)); + + gu21 = (g13*g23 - g12*g33)*INV(detg); + + gu31 = (-(g13*g22) + g12*g23)*INV(detg); + + gu22 = INV(detg)*(g11*g33 - SQR(g13)); + + gu32 = (g12*g13 - g11*g23)*INV(detg); + + gu33 = INV(detg)*(g11*g22 - SQR(g12)); + + phiL = Log(detg)/12.; + + em4phi = exp(-4*phiL); + + gt11L = em4phi*g11; + + gt12L = em4phi*g12; + + gt13L = em4phi*g13; + + gt22L = em4phi*g22; + + gt23L = em4phi*g23; + + gt33L = em4phi*g33; + + K11 = kxxL; + + K12 = kxyL; + + K13 = kxzL; + + K22 = kyyL; + + K23 = kyzL; + + K33 = kzzL; + + trKL = gu11*K11 + gu22*K22 + 2*(gu21*K12 + gu31*K13 + gu32*K23) + gu33*K33; + + At11L = em4phi*(K11 - g11*kthird*trKL); + + At12L = em4phi*(K12 - g12*kthird*trKL); + + At13L = em4phi*(K13 - g13*kthird*trKL); + + At22L = em4phi*(K22 - g22*kthird*trKL); + + At23L = em4phi*(K23 - g23*kthird*trKL); + + At33L = em4phi*(K33 - g33*kthird*trKL); + + alphaL = alpL; + + beta1L = betaxL; + + beta2L = betayL; + + beta3L = betazL; + + + /* Copy local copies back to grid functions */ + alpha[index] = alphaL; + At11[index] = At11L; + At12[index] = At12L; + At13[index] = At13L; + At22[index] = At22L; + At23[index] = At23L; + At33[index] = At33L; + beta1[index] = beta1L; + beta2[index] = beta2L; + beta3[index] = beta3L; + gt11[index] = gt11L; + gt12[index] = gt12L; + gt13[index] = gt13L; + gt22[index] = gt22L; + gt23[index] = gt23L; + gt33[index] = gt33L; + phi[index] = phiL; + trK[index] = trKL; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_convertFromADMBase); +} + +void ML_BSSN_MP_convertFromADMBase(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_MP_convertFromADMBase_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBaseGamma.c b/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBaseGamma.c new file mode 100644 index 0000000..58a1e45 --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_convertFromADMBaseGamma.c @@ -0,0 +1,462 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_convertFromADMBaseGamma_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_convertFromADMBaseGamma_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_convertFromADMBaseGamma_calc_every != ML_BSSN_MP_convertFromADMBaseGamma_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_convertFromADMBaseGamma, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + CCTK_REAL detgt = INITVALUE; + CCTK_REAL Gt111 = INITVALUE, Gt112 = INITVALUE, Gt113 = INITVALUE, Gt122 = INITVALUE, Gt123 = INITVALUE, Gt133 = INITVALUE; + CCTK_REAL Gt211 = INITVALUE, Gt212 = INITVALUE, Gt213 = INITVALUE, Gt222 = INITVALUE, Gt223 = INITVALUE, Gt233 = INITVALUE; + CCTK_REAL Gt311 = INITVALUE, Gt312 = INITVALUE, Gt313 = INITVALUE, Gt322 = INITVALUE, Gt323 = INITVALUE, Gt333 = INITVALUE; + CCTK_REAL gtu11 = INITVALUE, gtu21 = INITVALUE, gtu22 = INITVALUE, gtu31 = INITVALUE, gtu32 = INITVALUE, gtu33 = INITVALUE; + + /* Declare local copies of grid functions */ + CCTK_REAL AL = INITVALUE; + CCTK_REAL alphaL = INITVALUE; + CCTK_REAL B1L = INITVALUE, B2L = INITVALUE, B3L = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE; + CCTK_REAL dtalpL = INITVALUE; + CCTK_REAL dtbetaxL = INITVALUE; + CCTK_REAL dtbetayL = INITVALUE; + CCTK_REAL dtbetazL = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE; + CCTK_REAL J11L = INITVALUE, J12L = INITVALUE, J13L = INITVALUE, J21L = INITVALUE, J22L = INITVALUE, J23L = INITVALUE; + CCTK_REAL J31L = INITVALUE, J32L = INITVALUE, J33L = INITVALUE; + CCTK_REAL Xt1L = INITVALUE, Xt2L = INITVALUE, Xt3L = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + CCTK_REAL PDstandardNth1beta1 = INITVALUE; + CCTK_REAL PDstandardNth2beta1 = INITVALUE; + CCTK_REAL PDstandardNth3beta1 = INITVALUE; + CCTK_REAL PDstandardNth1beta2 = INITVALUE; + CCTK_REAL PDstandardNth2beta2 = INITVALUE; + CCTK_REAL PDstandardNth3beta2 = INITVALUE; + CCTK_REAL PDstandardNth1beta3 = INITVALUE; + CCTK_REAL PDstandardNth2beta3 = INITVALUE; + CCTK_REAL PDstandardNth3beta3 = INITVALUE; + CCTK_REAL PDstandardNth1gt11 = INITVALUE; + CCTK_REAL PDstandardNth2gt11 = INITVALUE; + CCTK_REAL PDstandardNth3gt11 = INITVALUE; + CCTK_REAL PDstandardNth1gt12 = INITVALUE; + CCTK_REAL PDstandardNth2gt12 = INITVALUE; + CCTK_REAL PDstandardNth3gt12 = INITVALUE; + CCTK_REAL PDstandardNth1gt13 = INITVALUE; + CCTK_REAL PDstandardNth2gt13 = INITVALUE; + CCTK_REAL PDstandardNth3gt13 = INITVALUE; + CCTK_REAL PDstandardNth1gt22 = INITVALUE; + CCTK_REAL PDstandardNth2gt22 = INITVALUE; + CCTK_REAL PDstandardNth3gt22 = INITVALUE; + CCTK_REAL PDstandardNth1gt23 = INITVALUE; + CCTK_REAL PDstandardNth2gt23 = INITVALUE; + CCTK_REAL PDstandardNth3gt23 = INITVALUE; + CCTK_REAL PDstandardNth1gt33 = INITVALUE; + CCTK_REAL PDstandardNth2gt33 = INITVALUE; + CCTK_REAL PDstandardNth3gt33 = INITVALUE; + + /* Assign local copies of grid functions */ + alphaL = alpha[index]; + beta1L = beta1[index]; + beta2L = beta2[index]; + beta3L = beta3[index]; + dtalpL = dtalp[index]; + dtbetaxL = dtbetax[index]; + dtbetayL = dtbetay[index]; + dtbetazL = dtbetaz[index]; + gt11L = gt11[index]; + gt12L = gt12[index]; + gt13L = gt13[index]; + gt22L = gt22[index]; + gt23L = gt23[index]; + gt33L = gt33[index]; + J11L = J11[index]; + J12L = J12[index]; + J13L = J13[index]; + J21L = J21[index]; + J22L = J22[index]; + J23L = J23[index]; + J31L = J31[index]; + J32L = J32[index]; + J33L = J33[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + PDstandardNth1beta1 = PDstandardNth1(beta1, i, j, k); + PDstandardNth2beta1 = PDstandardNth2(beta1, i, j, k); + PDstandardNth3beta1 = PDstandardNth3(beta1, i, j, k); + PDstandardNth1beta2 = PDstandardNth1(beta2, i, j, k); + PDstandardNth2beta2 = PDstandardNth2(beta2, i, j, k); + PDstandardNth3beta2 = PDstandardNth3(beta2, i, j, k); + PDstandardNth1beta3 = PDstandardNth1(beta3, i, j, k); + PDstandardNth2beta3 = PDstandardNth2(beta3, i, j, k); + PDstandardNth3beta3 = PDstandardNth3(beta3, i, j, k); + PDstandardNth1gt11 = PDstandardNth1(gt11, i, j, k); + PDstandardNth2gt11 = PDstandardNth2(gt11, i, j, k); + PDstandardNth3gt11 = PDstandardNth3(gt11, i, j, k); + PDstandardNth1gt12 = PDstandardNth1(gt12, i, j, k); + PDstandardNth2gt12 = PDstandardNth2(gt12, i, j, k); + PDstandardNth3gt12 = PDstandardNth3(gt12, i, j, k); + PDstandardNth1gt13 = PDstandardNth1(gt13, i, j, k); + PDstandardNth2gt13 = PDstandardNth2(gt13, i, j, k); + PDstandardNth3gt13 = PDstandardNth3(gt13, i, j, k); + PDstandardNth1gt22 = PDstandardNth1(gt22, i, j, k); + PDstandardNth2gt22 = PDstandardNth2(gt22, i, j, k); + PDstandardNth3gt22 = PDstandardNth3(gt22, i, j, k); + PDstandardNth1gt23 = PDstandardNth1(gt23, i, j, k); + PDstandardNth2gt23 = PDstandardNth2(gt23, i, j, k); + PDstandardNth3gt23 = PDstandardNth3(gt23, i, j, k); + PDstandardNth1gt33 = PDstandardNth1(gt33, i, j, k); + PDstandardNth2gt33 = PDstandardNth2(gt33, i, j, k); + PDstandardNth3gt33 = PDstandardNth3(gt33, i, j, k); + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + detgt = 1; + + gtu11 = INV(detgt)*(gt22L*gt33L - SQR(gt23L)); + + gtu21 = (gt13L*gt23L - gt12L*gt33L)*INV(detgt); + + gtu31 = (-(gt13L*gt22L) + gt12L*gt23L)*INV(detgt); + + gtu22 = INV(detgt)*(gt11L*gt33L - SQR(gt13L)); + + gtu32 = (gt12L*gt13L - gt11L*gt23L)*INV(detgt); + + gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); + + Gt111 = khalf*((gtu11*J11L - gtu21*J12L - gtu31*J13L)*PDstandardNth1gt11 + + (gtu11*J21L - gtu21*J22L - gtu31*J23L)*PDstandardNth2gt11 + + (gtu11*J31L - gtu21*J32L - gtu31*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu21*PDstandardNth1gt12 + gtu31*PDstandardNth1gt13) + + J21L*(gtu21*PDstandardNth2gt12 + gtu31*PDstandardNth2gt13) + + J31L*(gtu21*PDstandardNth3gt12 + gtu31*PDstandardNth3gt13))); + + Gt211 = khalf*((gtu21*J11L - gtu22*J12L - gtu32*J13L)*PDstandardNth1gt11 + + (gtu21*J21L - gtu22*J22L - gtu32*J23L)*PDstandardNth2gt11 + + (gtu21*J31L - gtu22*J32L - gtu32*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu22*PDstandardNth1gt12 + gtu32*PDstandardNth1gt13) + + J21L*(gtu22*PDstandardNth2gt12 + gtu32*PDstandardNth2gt13) + + J31L*(gtu22*PDstandardNth3gt12 + gtu32*PDstandardNth3gt13))); + + Gt311 = khalf*((gtu31*J11L - gtu32*J12L - gtu33*J13L)*PDstandardNth1gt11 + + (gtu31*J21L - gtu32*J22L - gtu33*J23L)*PDstandardNth2gt11 + + (gtu31*J31L - gtu32*J32L - gtu33*J33L)*PDstandardNth3gt11 + + 2*(J11L*(gtu32*PDstandardNth1gt12 + gtu33*PDstandardNth1gt13) + + J21L*(gtu32*PDstandardNth2gt12 + gtu33*PDstandardNth2gt13) + + J31L*(gtu32*PDstandardNth3gt12 + gtu33*PDstandardNth3gt13))); + + Gt112 = khalf*(gtu11*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu21*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu31*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt212 = khalf*(gtu21*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu22*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu32*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt312 = khalf*(gtu31*(J12L*PDstandardNth1gt11 + J22L*PDstandardNth2gt11 + + J32L*PDstandardNth3gt11) + + gtu32*(J11L*PDstandardNth1gt22 + J21L*PDstandardNth2gt22 + + J31L*PDstandardNth3gt22) + + gtu33*(-(J13L*PDstandardNth1gt12) + J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 - J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 - + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23)); + + Gt113 = khalf*(gtu11*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu21*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu31*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt213 = khalf*(gtu21*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu22*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu32*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt313 = khalf*(gtu31*(J13L*PDstandardNth1gt11 + J23L*PDstandardNth2gt11 + + J33L*PDstandardNth3gt11) + + gtu32*(J13L*PDstandardNth1gt12 - J12L*PDstandardNth1gt13 + + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 - + J22L*PDstandardNth2gt13 + J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 - J32L*PDstandardNth3gt13 + + J31L*PDstandardNth3gt23) + + gtu33*(J11L*PDstandardNth1gt33 + J21L*PDstandardNth2gt33 + + J31L*PDstandardNth3gt33)); + + Gt122 = khalf*(gtu11*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu21*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu31*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt222 = khalf*(gtu21*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu22*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu32*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt322 = khalf*(gtu31*(-(J11L*PDstandardNth1gt22) + + 2*(J12L*PDstandardNth1gt12 + J22L*PDstandardNth2gt12) - + J21L*PDstandardNth2gt22 + 2*J32L*PDstandardNth3gt12 - + J31L*PDstandardNth3gt22) + + gtu32*(J12L*PDstandardNth1gt22 + J22L*PDstandardNth2gt22 + + J32L*PDstandardNth3gt22) - + gtu33*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22 - + 2*(J12L*PDstandardNth1gt23 + J22L*PDstandardNth2gt23 + + J32L*PDstandardNth3gt23))); + + Gt123 = khalf*(gtu21*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu11*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu31*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt223 = khalf*(gtu22*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu21*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu32*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt323 = khalf*(gtu32*(J13L*PDstandardNth1gt22 + J23L*PDstandardNth2gt22 + + J33L*PDstandardNth3gt22) + + gtu31*(J13L*PDstandardNth1gt12 + J12L*PDstandardNth1gt13 - + J11L*PDstandardNth1gt23 + J23L*PDstandardNth2gt12 + + J22L*PDstandardNth2gt13 - J21L*PDstandardNth2gt23 + + J33L*PDstandardNth3gt12 + J32L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt23) + + gtu33*(J12L*PDstandardNth1gt33 + J22L*PDstandardNth2gt33 + + J32L*PDstandardNth3gt33)); + + Gt133 = khalf*(gtu11*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu21*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu31*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Gt233 = khalf*(gtu21*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu22*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu32*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Gt333 = khalf*(gtu31*(-(J11L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt13 + J23L*PDstandardNth2gt13) - + J21L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt13 - + J31L*PDstandardNth3gt33) + + gtu32*(-(J12L*PDstandardNth1gt33) + + 2*(J13L*PDstandardNth1gt23 + J23L*PDstandardNth2gt23) - + J22L*PDstandardNth2gt33 + 2*J33L*PDstandardNth3gt23 - + J32L*PDstandardNth3gt33) + + gtu33*(J13L*PDstandardNth1gt33 + J23L*PDstandardNth2gt33 + + J33L*PDstandardNth3gt33)); + + Xt1L = Gt111*gtu11 + Gt122*gtu22 + + 2*(Gt112*gtu21 + Gt113*gtu31 + Gt123*gtu32) + Gt133*gtu33; + + Xt2L = Gt211*gtu11 + Gt222*gtu22 + + 2*(Gt212*gtu21 + Gt213*gtu31 + Gt223*gtu32) + Gt233*gtu33; + + Xt3L = Gt311*gtu11 + Gt322*gtu22 + + 2*(Gt312*gtu21 + Gt313*gtu31 + Gt323*gtu32) + Gt333*gtu33; + + AL = -(dtalpL*(-1 + LapseAdvectionCoeff)*INV(harmonicF)*pow(alphaL,-harmonicN)); + + B1L = (dtbetaxL - ((beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1beta1 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2beta1 + (beta1L*J31L + beta2L*J32L + beta3L*J33L)* + PDstandardNth3beta1)*ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); + + B2L = (dtbetayL - ((beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1beta2 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2beta2 + (beta1L*J31L + beta2L*J32L + beta3L*J33L)* + PDstandardNth3beta2)*ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); + + B3L = (dtbetazL - ((beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1beta3 + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2beta3 + (beta1L*J31L + beta2L*J32L + beta3L*J33L)* + PDstandardNth3beta3)*ShiftAdvectionCoeff)*INV(ShiftGammaCoeff); + + + /* Copy local copies back to grid functions */ + A[index] = AL; + B1[index] = B1L; + B2[index] = B2L; + B3[index] = B3L; + Xt1[index] = Xt1L; + Xt2[index] = Xt2L; + Xt3[index] = Xt3L; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_convertFromADMBaseGamma); +} + +void ML_BSSN_MP_convertFromADMBaseGamma(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverInterior(cctkGH, &ML_BSSN_MP_convertFromADMBaseGamma_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_convertToADMBase.c b/ML_BSSN_MP/src/ML_BSSN_MP_convertToADMBase.c new file mode 100644 index 0000000..6e4bb02 --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_convertToADMBase.c @@ -0,0 +1,320 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_convertToADMBase_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_convertToADMBase_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_convertToADMBase_calc_every != ML_BSSN_MP_convertToADMBase_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_convertToADMBase, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + CCTK_REAL e4phi = INITVALUE; + CCTK_REAL g11 = INITVALUE, g12 = INITVALUE, g13 = INITVALUE, g22 = INITVALUE, g23 = INITVALUE, g33 = INITVALUE; + CCTK_REAL K11 = INITVALUE, K12 = INITVALUE, K13 = INITVALUE, K22 = INITVALUE, K23 = INITVALUE, K33 = INITVALUE; + + /* Declare local copies of grid functions */ + CCTK_REAL AL = INITVALUE; + CCTK_REAL alpL = INITVALUE; + CCTK_REAL alphaL = INITVALUE; + CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE; + CCTK_REAL B1L = INITVALUE, B2L = INITVALUE, B3L = INITVALUE; + CCTK_REAL beta1L = INITVALUE, beta2L = INITVALUE, beta3L = INITVALUE; + CCTK_REAL betaxL = INITVALUE; + CCTK_REAL betayL = INITVALUE; + CCTK_REAL betazL = INITVALUE; + CCTK_REAL dtalpL = INITVALUE; + CCTK_REAL dtbetaxL = INITVALUE; + CCTK_REAL dtbetayL = INITVALUE; + CCTK_REAL dtbetazL = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE; + CCTK_REAL gxxL = INITVALUE; + CCTK_REAL gxyL = INITVALUE; + CCTK_REAL gxzL = INITVALUE; + CCTK_REAL gyyL = INITVALUE; + CCTK_REAL gyzL = INITVALUE; + CCTK_REAL gzzL = INITVALUE; + CCTK_REAL J11L = INITVALUE, J12L = INITVALUE, J13L = INITVALUE, J21L = INITVALUE, J22L = INITVALUE, J23L = INITVALUE; + CCTK_REAL J31L = INITVALUE, J32L = INITVALUE, J33L = INITVALUE; + CCTK_REAL kxxL = INITVALUE; + CCTK_REAL kxyL = INITVALUE; + CCTK_REAL kxzL = INITVALUE; + CCTK_REAL kyyL = INITVALUE; + CCTK_REAL kyzL = INITVALUE; + CCTK_REAL kzzL = INITVALUE; + CCTK_REAL phiL = INITVALUE; + CCTK_REAL trKL = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + CCTK_REAL PDstandardNth1alpha = INITVALUE; + CCTK_REAL PDstandardNth2alpha = INITVALUE; + CCTK_REAL PDstandardNth3alpha = INITVALUE; + CCTK_REAL PDstandardNth1beta1 = INITVALUE; + CCTK_REAL PDstandardNth2beta1 = INITVALUE; + CCTK_REAL PDstandardNth3beta1 = INITVALUE; + + /* Assign local copies of grid functions */ + AL = A[index]; + alphaL = alpha[index]; + At11L = At11[index]; + At12L = At12[index]; + At13L = At13[index]; + At22L = At22[index]; + At23L = At23[index]; + At33L = At33[index]; + B1L = B1[index]; + B2L = B2[index]; + B3L = B3[index]; + beta1L = beta1[index]; + beta2L = beta2[index]; + beta3L = beta3[index]; + gt11L = gt11[index]; + gt12L = gt12[index]; + gt13L = gt13[index]; + gt22L = gt22[index]; + gt23L = gt23[index]; + gt33L = gt33[index]; + J11L = J11[index]; + J12L = J12[index]; + J13L = J13[index]; + J21L = J21[index]; + J22L = J22[index]; + J23L = J23[index]; + J31L = J31[index]; + J32L = J32[index]; + J33L = J33[index]; + phiL = phi[index]; + trKL = trK[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + PDstandardNth1alpha = PDstandardNth1(alpha, i, j, k); + PDstandardNth2alpha = PDstandardNth2(alpha, i, j, k); + PDstandardNth3alpha = PDstandardNth3(alpha, i, j, k); + PDstandardNth1beta1 = PDstandardNth1(beta1, i, j, k); + PDstandardNth2beta1 = PDstandardNth2(beta1, i, j, k); + PDstandardNth3beta1 = PDstandardNth3(beta1, i, j, k); + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + e4phi = exp(4*phiL); + + g11 = e4phi*gt11L; + + g12 = e4phi*gt12L; + + g13 = e4phi*gt13L; + + g22 = e4phi*gt22L; + + g23 = e4phi*gt23L; + + g33 = e4phi*gt33L; + + gxxL = g11; + + gxyL = g12; + + gxzL = g13; + + gyyL = g22; + + gyzL = g23; + + gzzL = g33; + + K11 = At11L*e4phi + g11*kthird*trKL; + + K12 = At12L*e4phi + g12*kthird*trKL; + + K13 = At13L*e4phi + g13*kthird*trKL; + + K22 = At22L*e4phi + g22*kthird*trKL; + + K23 = At23L*e4phi + g23*kthird*trKL; + + K33 = At33L*e4phi + g33*kthird*trKL; + + kxxL = K11; + + kxyL = K12; + + kxzL = K13; + + kyyL = K22; + + kyzL = K23; + + kzzL = K33; + + alpL = alphaL; + + betaxL = beta1L; + + betayL = beta2L; + + betazL = beta3L; + + dtalpL = LapseAdvectionCoeff*((beta1L*J11L + beta2L*J12L + beta3L*J13L)* + PDstandardNth1alpha + (beta1L*J21L + beta2L*J22L + beta3L*J23L)* + PDstandardNth2alpha + (beta1L*J31L + beta2L*J32L + beta3L*J33L)* + PDstandardNth3alpha) + harmonicF* + (AL*(-1 + LapseAdvectionCoeff) - LapseAdvectionCoeff*trKL)* + pow(alphaL,harmonicN); + + dtbetaxL = ((beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1beta1 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2beta1 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3beta1)* + ShiftAdvectionCoeff + B1L*ShiftGammaCoeff; + + dtbetayL = ((beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1beta1 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2beta1 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3beta1)* + ShiftAdvectionCoeff + B2L*ShiftGammaCoeff; + + dtbetazL = ((beta1L*J11L + beta2L*J12L + beta3L*J13L)*PDstandardNth1beta1 + + (beta1L*J21L + beta2L*J22L + beta3L*J23L)*PDstandardNth2beta1 + + (beta1L*J31L + beta2L*J32L + beta3L*J33L)*PDstandardNth3beta1)* + ShiftAdvectionCoeff + B3L*ShiftGammaCoeff; + + + /* Copy local copies back to grid functions */ + alp[index] = alpL; + betax[index] = betaxL; + betay[index] = betayL; + betaz[index] = betazL; + dtalp[index] = dtalpL; + dtbetax[index] = dtbetaxL; + dtbetay[index] = dtbetayL; + dtbetaz[index] = dtbetazL; + gxx[index] = gxxL; + gxy[index] = gxyL; + gxz[index] = gxzL; + gyy[index] = gyyL; + gyz[index] = gyzL; + gzz[index] = gzzL; + kxx[index] = kxxL; + kxy[index] = kxyL; + kxz[index] = kxzL; + kyy[index] = kyyL; + kyz[index] = kyzL; + kzz[index] = kzzL; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_convertToADMBase); +} + +void ML_BSSN_MP_convertToADMBase(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverInterior(cctkGH, &ML_BSSN_MP_convertToADMBase_Body); +} diff --git a/ML_BSSN_MP/src/ML_BSSN_MP_enforce.c b/ML_BSSN_MP/src/ML_BSSN_MP_enforce.c new file mode 100644 index 0000000..fae01b8 --- /dev/null +++ b/ML_BSSN_MP/src/ML_BSSN_MP_enforce.c @@ -0,0 +1,196 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void ML_BSSN_MP_enforce_Body(cGH const * const cctkGH, CCTK_INT const dir, CCTK_INT const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], CCTK_INT const min[3], CCTK_INT const max[3], CCTK_INT const n_subblock_gfs, CCTK_REAL * const subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL p1o2dx = INITVALUE; + CCTK_REAL p1o2dy = INITVALUE; + CCTK_REAL p1o2dz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + CCTK_REAL pm1o2dx = INITVALUE; + CCTK_REAL pm1o2dy = INITVALUE; + CCTK_REAL pm1o2dz = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering ML_BSSN_MP_enforce_Body"); + } + + if (cctk_iteration % ML_BSSN_MP_enforce_calc_every != ML_BSSN_MP_enforce_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + p1o2dx = khalf*INV(dx); + p1o2dy = khalf*INV(dy); + p1o2dz = khalf*INV(dz); + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + pm1o2dx = -(khalf*INV(dx)); + pm1o2dy = -(khalf*INV(dy)); + pm1o2dz = -(khalf*INV(dz)); + + /* Loop over the grid points */ + #pragma omp parallel + LC_LOOP3 (ML_BSSN_MP_enforce, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + CCTK_REAL detgt = INITVALUE; + CCTK_REAL gtu11 = INITVALUE, gtu21 = INITVALUE, gtu22 = INITVALUE, gtu31 = INITVALUE, gtu32 = INITVALUE, gtu33 = INITVALUE; + CCTK_REAL trAt = INITVALUE; + + /* Declare local copies of grid functions */ + CCTK_REAL At11L = INITVALUE, At12L = INITVALUE, At13L = INITVALUE, At22L = INITVALUE, At23L = INITVALUE, At33L = INITVALUE; + CCTK_REAL gt11L = INITVALUE, gt12L = INITVALUE, gt13L = INITVALUE, gt22L = INITVALUE, gt23L = INITVALUE, gt33L = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + + /* Assign local copies of grid functions */ + At11L = At11[index]; + At12L = At12[index]; + At13L = At13[index]; + At22L = At22[index]; + At23L = At23[index]; + At33L = At33[index]; + gt11L = gt11[index]; + gt12L = gt12[index]; + gt13L = gt13[index]; + gt22L = gt22[index]; + gt23L = gt23[index]; + gt33L = gt33[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + detgt = 1; + + gtu11 = INV(detgt)*(gt22L*gt33L - SQR(gt23L)); + + gtu21 = (gt13L*gt23L - gt12L*gt33L)*INV(detgt); + + gtu31 = (-(gt13L*gt22L) + gt12L*gt23L)*INV(detgt); + + gtu22 = INV(detgt)*(gt11L*gt33L - SQR(gt13L)); + + gtu32 = (gt12L*gt13L - gt11L*gt23L)*INV(detgt); + + gtu33 = INV(detgt)*(gt11L*gt22L - SQR(gt12L)); + + trAt = At11L*gtu11 + At22L*gtu22 + + 2*(At12L*gtu21 + At13L*gtu31 + At23L*gtu32) + At33L*gtu33; + + At11L = At11L - gt11L*kthird*trAt; + + At12L = At12L - gt12L*kthird*trAt; + + At13L = At13L - gt13L*kthird*trAt; + + At22L = At22L - gt22L*kthird*trAt; + + At23L = At23L - gt23L*kthird*trAt; + + At33L = At33L - gt33L*kthird*trAt; + + + /* Copy local copies back to grid functions */ + At11[index] = At11L; + At12[index] = At12L; + At13[index] = At13L; + At22[index] = At22L; + At23[index] = At23L; + At33[index] = At33L; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (ML_BSSN_MP_enforce); +} + +void ML_BSSN_MP_enforce(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverEverything(cctkGH, &ML_BSSN_MP_enforce_Body); +} diff --git a/ML_BSSN_MP/src/RegisterMoL.c b/ML_BSSN_MP/src/RegisterMoL.c new file mode 100644 index 0000000..27712c3 --- /dev/null +++ b/ML_BSSN_MP/src/RegisterMoL.c @@ -0,0 +1,44 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" + +void ML_BSSN_MP_RegisterVars(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + CCTK_INT ierr = 0; + + /* Register all the evolved grid functions with MoL */ + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::At11"), CCTK_VarIndex("ML_BSSN_MP::At11rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::At12"), CCTK_VarIndex("ML_BSSN_MP::At12rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::At13"), CCTK_VarIndex("ML_BSSN_MP::At13rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::At22"), CCTK_VarIndex("ML_BSSN_MP::At22rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::At23"), CCTK_VarIndex("ML_BSSN_MP::At23rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::At33"), CCTK_VarIndex("ML_BSSN_MP::At33rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::A"), CCTK_VarIndex("ML_BSSN_MP::Arhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::B1"), CCTK_VarIndex("ML_BSSN_MP::B1rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::B2"), CCTK_VarIndex("ML_BSSN_MP::B2rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::B3"), CCTK_VarIndex("ML_BSSN_MP::B3rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::Xt1"), CCTK_VarIndex("ML_BSSN_MP::Xt1rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::Xt2"), CCTK_VarIndex("ML_BSSN_MP::Xt2rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::Xt3"), CCTK_VarIndex("ML_BSSN_MP::Xt3rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::alpha"), CCTK_VarIndex("ML_BSSN_MP::alpharhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::phi"), CCTK_VarIndex("ML_BSSN_MP::phirhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::gt11"), CCTK_VarIndex("ML_BSSN_MP::gt11rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::gt12"), CCTK_VarIndex("ML_BSSN_MP::gt12rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::gt13"), CCTK_VarIndex("ML_BSSN_MP::gt13rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::gt22"), CCTK_VarIndex("ML_BSSN_MP::gt22rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::gt23"), CCTK_VarIndex("ML_BSSN_MP::gt23rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::gt33"), CCTK_VarIndex("ML_BSSN_MP::gt33rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::beta1"), CCTK_VarIndex("ML_BSSN_MP::beta1rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::beta2"), CCTK_VarIndex("ML_BSSN_MP::beta2rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::beta3"), CCTK_VarIndex("ML_BSSN_MP::beta3rhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_BSSN_MP::trK"), CCTK_VarIndex("ML_BSSN_MP::trKrhs")); + return; +} diff --git a/ML_BSSN_MP/src/RegisterSymmetries.c b/ML_BSSN_MP/src/RegisterSymmetries.c new file mode 100644 index 0000000..30c3111 --- /dev/null +++ b/ML_BSSN_MP/src/RegisterSymmetries.c @@ -0,0 +1,192 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "Symmetry.h" + +void ML_BSSN_MP_RegisterSymmetries(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* array holding symmetry definitions */ + CCTK_INT sym[3]; + + + /* Register symmetries of grid functions */ + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::At11"); + + sym[0] = -1; + sym[1] = -1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::At12"); + + sym[0] = -1; + sym[1] = 1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::At13"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::At22"); + + sym[0] = 1; + sym[1] = -1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::At23"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::At33"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::A"); + + sym[0] = -1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::B1"); + + sym[0] = 1; + sym[1] = -1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::B2"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::B3"); + + sym[0] = -1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::Xt1"); + + sym[0] = 1; + sym[1] = -1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::Xt2"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::Xt3"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::alpha"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::phi"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::gt11"); + + sym[0] = -1; + sym[1] = -1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::gt12"); + + sym[0] = -1; + sym[1] = 1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::gt13"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::gt22"); + + sym[0] = 1; + sym[1] = -1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::gt23"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::gt33"); + + sym[0] = -1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::beta1"); + + sym[0] = 1; + sym[1] = -1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::beta2"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::beta3"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::trK"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::cS"); + + sym[0] = -1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::cXt1"); + + sym[0] = 1; + sym[1] = -1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::cXt2"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::cXt3"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::cA"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::H"); + + sym[0] = -1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::M1"); + + sym[0] = 1; + sym[1] = -1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::M2"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = -1; + SetCartSymVN(cctkGH, sym, "ML_BSSN_MP::M3"); + +} diff --git a/ML_BSSN_MP/src/Startup.c b/ML_BSSN_MP/src/Startup.c new file mode 100644 index 0000000..20fe44f --- /dev/null +++ b/ML_BSSN_MP/src/Startup.c @@ -0,0 +1,13 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#include "cctk.h" + +int ML_BSSN_MP_Startup(void) +{ + const char * banner = "ML_BSSN_MP"; + CCTK_RegisterBanner(banner); + return 0; +} diff --git a/ML_BSSN_MP/src/make.code.defn b/ML_BSSN_MP/src/make.code.defn new file mode 100644 index 0000000..9662756 --- /dev/null +++ b/ML_BSSN_MP/src/make.code.defn @@ -0,0 +1,6 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + +SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c ML_BSSN_MP_Minkowski.c ML_BSSN_MP_convertFromADMBase.c ML_BSSN_MP_convertFromADMBaseGamma.c ML_BSSN_MP_RHS.c ML_BSSN_MP_RHSBoundary.c ML_BSSN_MP_enforce.c ML_BSSN_MP_boundary.c ML_BSSN_MP_convertToADMBase.c ML_BSSN_MP_ADMBaseBoundary.c ML_BSSN_MP_constraints.c ML_BSSN_MP_constraints_boundary.c Boundaries.c diff --git a/ML_BSSN_MP_Helper/configuration.ccl b/ML_BSSN_MP_Helper/configuration.ccl new file mode 100644 index 0000000..aecb1c4 --- /dev/null +++ b/ML_BSSN_MP_Helper/configuration.ccl @@ -0,0 +1 @@ +REQUIRES THORNS: CoordGauge diff --git a/ML_BSSN_MP_Helper/interface.ccl b/ML_BSSN_MP_Helper/interface.ccl new file mode 100644 index 0000000..f8409dd --- /dev/null +++ b/ML_BSSN_MP_Helper/interface.ccl @@ -0,0 +1,8 @@ +IMPLEMENTS: ML_BSSN_MP_Helper + +INHERITS: ADMBase CoordGauge ML_BSSN_MP + + + +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) +USES FUNCTION Boundary_SelectGroupForBC diff --git a/ML_BSSN_MP_Helper/param.ccl b/ML_BSSN_MP_Helper/param.ccl new file mode 100644 index 0000000..e7642dc --- /dev/null +++ b/ML_BSSN_MP_Helper/param.ccl @@ -0,0 +1,11 @@ +SHARES: ADMBase + +USES KEYWORD evolution_method + +SHARES: GenericFD + +USES CCTK_INT boundary_width + +SHARES: ML_BSSN_MP + +USES CCTK_INT timelevels diff --git a/ML_BSSN_MP_Helper/schedule.ccl b/ML_BSSN_MP_Helper/schedule.ccl new file mode 100644 index 0000000..79799bc --- /dev/null +++ b/ML_BSSN_MP_Helper/schedule.ccl @@ -0,0 +1,83 @@ +if (CCTK_EQUALS (evolution_method, "ML_BSSN_MP")) { + + if (timelevels == 1) { + STORAGE: ADMBase::metric[1] + STORAGE: ADMBase::curv[1] + STORAGE: ADMBase::lapse[1] + STORAGE: ADMBase::shift[1] + STORAGE: ADMBase::dtlapse[1] + STORAGE: ADMBase::dtshift[1] + } else if (timelevels == 2) { + STORAGE: ADMBase::metric[2] + STORAGE: ADMBase::curv[2] + STORAGE: ADMBase::lapse[2] + STORAGE: ADMBase::shift[2] + STORAGE: ADMBase::dtlapse[2] + STORAGE: ADMBase::dtshift[2] + } else if (timelevels == 3) { + STORAGE: ADMBase::metric[3] + STORAGE: ADMBase::curv[3] + STORAGE: ADMBase::lapse[3] + STORAGE: ADMBase::shift[3] + STORAGE: ADMBase::dtlapse[3] + STORAGE: ADMBase::dtshift[3] + } + + SCHEDULE ML_BSSN_MP_RegisterSlicing AT startup + { + LANG: C + OPTIONS: meta + } "Register slicing" + + SCHEDULE ML_BSSN_MP_UnsetCheckpointTags AT basegrid + { + LANG: C + OPTIONS: meta + } "Don't checkpoint ADMBase variables" + + + + SCHEDULE GROUP ML_BSSN_MP_evolCalcGroup IN MoL_CalcRHS + { + } "Calculate BSSN RHS" + + SCHEDULE GROUP ML_BSSN_MP_evolCalcGroup AT analysis + { + TRIGGERS: ML_BSSN_MP::ML_log_confacrhs + TRIGGERS: ML_BSSN_MP::ML_metricrhs + TRIGGERS: ML_BSSN_MP::ML_Gammarhs + TRIGGERS: ML_BSSN_MP::ML_trace_curvrhs + TRIGGERS: ML_BSSN_MP::ML_curvrhs + TRIGGERS: ML_BSSN_MP::ML_lapserhs + TRIGGERS: ML_BSSN_MP::ML_dtlapserhs + TRIGGERS: ML_BSSN_MP::ML_shiftrhs + TRIGGERS: ML_BSSN_MP::ML_dtshiftrhs + } "Calculate BSSN RHS" + + + + SCHEDULE GROUP ML_BSSN_MP_constraintsCalcGroup AT analysis + { + TRIGGERS: ML_BSSN_MP::ML_Ham + TRIGGERS: ML_BSSN_MP::ML_mom + } "Calculate BSSN constraints" + + + + SCHEDULE ML_BSSN_MP_SelectBCsADMBase IN MoL_PostStep AFTER ML_BSSN_MP_convertToADMBase + { + LANG: C + OPTIONS: level + SYNC: ADMBase::metric + SYNC: ADMBase::curv + SYNC: ADMBase::lapse + SYNC: ADMBase::shift + SYNC: ADMBase::dtlapse + SYNC: ADMBase::dtshift + } "Apply boundary conditions to ADMBase variables" + + SCHEDULE GROUP ApplyBCs AS ML_BSSN_MP_ApplyBCsADMBase IN MoL_PostStep AFTER ML_BSSN_MP_SelectBCsADMBase + { + } "Apply boundary conditions to ADMBase variables" + +} diff --git a/ML_BSSN_MP_Helper/src/RegisterSlicing.c b/ML_BSSN_MP_Helper/src/RegisterSlicing.c new file mode 100644 index 0000000..e9ebf81 --- /dev/null +++ b/ML_BSSN_MP_Helper/src/RegisterSlicing.c @@ -0,0 +1,10 @@ +#include <cctk.h> + +#include "CactusEinstein/CoordGauge/src/Slicing.h" + +int +ML_BSSN_MP_RegisterSlicing (void) +{ + Einstein_RegisterSlicing ("ML_BSSN_MP"); + return 0; +} diff --git a/ML_BSSN_MP_Helper/src/SelectBCsADMBase.c b/ML_BSSN_MP_Helper/src/SelectBCsADMBase.c new file mode 100644 index 0000000..4a1c095 --- /dev/null +++ b/ML_BSSN_MP_Helper/src/SelectBCsADMBase.c @@ -0,0 +1,28 @@ +#include <cctk.h> +#include <cctk_Arguments.h> +#include <cctk_Parameters.h> + +static void +select_bcs (cGH const * restrict cctkGH, char const * restrict gn); + +void +ML_BSSN_MP_SelectBCsADMBase (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + + select_bcs (cctkGH, "ADMBase::metric"); + select_bcs (cctkGH, "ADMBase::curv"); + select_bcs (cctkGH, "ADMBase::lapse"); + select_bcs (cctkGH, "ADMBase::shift"); + select_bcs (cctkGH, "ADMBase::dtlapse"); + select_bcs (cctkGH, "ADMBase::dtshift"); +} + +static void +select_bcs (cGH const * restrict const cctkGH, char const * restrict const gn) +{ + DECLARE_CCTK_PARAMETERS; + + Boundary_SelectGroupForBC + (cctkGH, CCTK_ALL_FACES, boundary_width, -1, gn, "none"); +} diff --git a/ML_BSSN_MP_Helper/src/UnsetCheckpointTags.c b/ML_BSSN_MP_Helper/src/UnsetCheckpointTags.c new file mode 100644 index 0000000..b16e9eb --- /dev/null +++ b/ML_BSSN_MP_Helper/src/UnsetCheckpointTags.c @@ -0,0 +1,38 @@ +#include <cctk.h> +#include <cctk_Arguments.h> +#include <cctk_Parameters.h> +#include <util_Table.h> + +#include <assert.h> + +static void +unset_checkpoint_tag (char const * restrict gn); + +void +ML_BSSN_MP_UnsetCheckpointTags (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + DECLARE_CCTK_PARAMETERS; + + unset_checkpoint_tag ("ADMBase::metric"); + unset_checkpoint_tag ("ADMBase::curv"); + unset_checkpoint_tag ("ADMBase::lapse"); + unset_checkpoint_tag ("ADMBase::shift"); + unset_checkpoint_tag ("ADMBase::dtlapse"); + unset_checkpoint_tag ("ADMBase::dtshift"); +} + +static void +unset_checkpoint_tag (char const * restrict const gn) +{ + assert (gn); + + int const gi = CCTK_GroupIndex (gn); + assert (gi >= 0); + + int const table = CCTK_GroupTagsTableI (gi); + assert (table >= 0); + + int const ierr = Util_TableSetString (table, "no", "Checkpoint"); + assert (! ierr); +} diff --git a/ML_BSSN_MP_Helper/src/make.code.defn b/ML_BSSN_MP_Helper/src/make.code.defn new file mode 100644 index 0000000..12fb65d --- /dev/null +++ b/ML_BSSN_MP_Helper/src/make.code.defn @@ -0,0 +1,2 @@ +# -*-Makefile-*- +SRCS = SelectBCsADMBase.c RegisterSlicing.c UnsetCheckpointTags.c diff --git a/ML_FOWaveToy/param.ccl b/ML_FOWaveToy/param.ccl index 884e9d5..23b9ba7 100644 --- a/ML_FOWaveToy/param.ccl +++ b/ML_FOWaveToy/param.ccl @@ -19,9 +19,9 @@ USES CCTK_INT MoL_Num_Evolved_Vars USES CCTK_INT MoL_Num_Constrained_Vars restricted: -CCTK_REAL verbose "verbose" +CCTK_INT verbose "verbose" { - "*:*" :: "" + *:* :: "" } 0 restricted: diff --git a/ML_FOWaveToy/src/WTFO_RHS.c b/ML_FOWaveToy/src/WTFO_RHS.c index e0e3c11..2d59334 100644 --- a/ML_FOWaveToy/src/WTFO_RHS.c +++ b/ML_FOWaveToy/src/WTFO_RHS.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -118,19 +121,8 @@ void WTFO_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3] subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])) ; /* Declare shorthands */ - CCTK_REAL Jinv11 = INITVALUE, Jinv12 = INITVALUE, Jinv13 = INITVALUE, Jinv21 = INITVALUE, Jinv22 = INITVALUE, Jinv23 = INITVALUE; - CCTK_REAL Jinv31 = INITVALUE, Jinv32 = INITVALUE, Jinv33 = INITVALUE; /* Declare local copies of grid functions */ - CCTK_REAL dadxL = INITVALUE; - CCTK_REAL dadyL = INITVALUE; - CCTK_REAL dadzL = INITVALUE; - CCTK_REAL dbdxL = INITVALUE; - CCTK_REAL dbdyL = INITVALUE; - CCTK_REAL dbdzL = INITVALUE; - CCTK_REAL dcdxL = INITVALUE; - CCTK_REAL dcdyL = INITVALUE; - CCTK_REAL dcdzL = INITVALUE; CCTK_REAL rhoL = INITVALUE, rhorhsL = INITVALUE; CCTK_REAL urhsL = INITVALUE; CCTK_REAL v1L = INITVALUE, v1rhsL = INITVALUE, v2L = INITVALUE, v2rhsL = INITVALUE, v3L = INITVALUE, v3rhsL = INITVALUE; @@ -141,25 +133,10 @@ void WTFO_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3] CCTK_REAL PDstandardNth2rho = INITVALUE; CCTK_REAL PDstandardNth3rho = INITVALUE; CCTK_REAL PDstandardNth1v1 = INITVALUE; - CCTK_REAL PDstandardNth2v1 = INITVALUE; - CCTK_REAL PDstandardNth3v1 = INITVALUE; - CCTK_REAL PDstandardNth1v2 = INITVALUE; CCTK_REAL PDstandardNth2v2 = INITVALUE; - CCTK_REAL PDstandardNth3v2 = INITVALUE; - CCTK_REAL PDstandardNth1v3 = INITVALUE; - CCTK_REAL PDstandardNth2v3 = INITVALUE; CCTK_REAL PDstandardNth3v3 = INITVALUE; /* Assign local copies of grid functions */ - dadxL = dadx[index]; - dadyL = dady[index]; - dadzL = dadz[index]; - dbdxL = dbdx[index]; - dbdyL = dbdy[index]; - dbdzL = dbdz[index]; - dcdxL = dcdx[index]; - dcdyL = dcdy[index]; - dcdzL = dcdz[index]; rhoL = rho[index]; v1L = v1[index]; v2L = v2[index]; @@ -174,47 +151,21 @@ void WTFO_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3] PDstandardNth2rho = PDstandardNth2(rho, i, j, k); PDstandardNth3rho = PDstandardNth3(rho, i, j, k); PDstandardNth1v1 = PDstandardNth1(v1, i, j, k); - PDstandardNth2v1 = PDstandardNth2(v1, i, j, k); - PDstandardNth3v1 = PDstandardNth3(v1, i, j, k); - PDstandardNth1v2 = PDstandardNth1(v2, i, j, k); PDstandardNth2v2 = PDstandardNth2(v2, i, j, k); - PDstandardNth3v2 = PDstandardNth3(v2, i, j, k); - PDstandardNth1v3 = PDstandardNth1(v3, i, j, k); - PDstandardNth2v3 = PDstandardNth2(v3, i, j, k); PDstandardNth3v3 = PDstandardNth3(v3, i, j, k); /* Precompute derivatives (old style) */ /* Calculate temporaries and grid functions */ - Jinv11 = dadxL; - - Jinv12 = dadyL; - - Jinv13 = dadzL; - - Jinv21 = dbdxL; - - Jinv22 = dbdyL; - - Jinv23 = dbdzL; - - Jinv31 = dcdxL; - - Jinv32 = dcdyL; - - Jinv33 = dcdzL; - urhsL = rhoL; - rhorhsL = Jinv11*PDstandardNth1v1 + Jinv12*PDstandardNth1v2 + Jinv13*PDstandardNth1v3 + Jinv21*PDstandardNth2v1 + - Jinv22*PDstandardNth2v2 + Jinv23*PDstandardNth2v3 + Jinv31*PDstandardNth3v1 + Jinv32*PDstandardNth3v2 + - Jinv33*PDstandardNth3v3; + rhorhsL = PDstandardNth1v1 + PDstandardNth2v2 + PDstandardNth3v3; - v1rhsL = Jinv11*PDstandardNth1rho + Jinv21*PDstandardNth2rho + Jinv31*PDstandardNth3rho; + v1rhsL = PDstandardNth1rho; - v2rhsL = Jinv12*PDstandardNth1rho + Jinv22*PDstandardNth2rho + Jinv32*PDstandardNth3rho; + v2rhsL = PDstandardNth2rho; - v3rhsL = Jinv13*PDstandardNth1rho + Jinv23*PDstandardNth2rho + Jinv33*PDstandardNth3rho; + v3rhsL = PDstandardNth3rho; /* Copy local copies back to grid functions */ diff --git a/ML_FOWaveToy/src/WTFO_constraints.c b/ML_FOWaveToy/src/WTFO_constraints.c index c84180b..bec53e2 100644 --- a/ML_FOWaveToy/src/WTFO_constraints.c +++ b/ML_FOWaveToy/src/WTFO_constraints.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -118,44 +121,21 @@ void WTFO_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL n subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])) ; /* Declare shorthands */ - CCTK_REAL Jinv11 = INITVALUE, Jinv12 = INITVALUE, Jinv13 = INITVALUE, Jinv21 = INITVALUE, Jinv22 = INITVALUE, Jinv23 = INITVALUE; - CCTK_REAL Jinv31 = INITVALUE, Jinv32 = INITVALUE, Jinv33 = INITVALUE; /* Declare local copies of grid functions */ - CCTK_REAL dadxL = INITVALUE; - CCTK_REAL dadyL = INITVALUE; - CCTK_REAL dadzL = INITVALUE; - CCTK_REAL dbdxL = INITVALUE; - CCTK_REAL dbdyL = INITVALUE; - CCTK_REAL dbdzL = INITVALUE; - CCTK_REAL dcdxL = INITVALUE; - CCTK_REAL dcdyL = INITVALUE; - CCTK_REAL dcdzL = INITVALUE; CCTK_REAL v1L = INITVALUE, v2L = INITVALUE, v3L = INITVALUE; CCTK_REAL w1L = INITVALUE, w2L = INITVALUE, w3L = INITVALUE; /* Declare precomputed derivatives*/ /* Declare derivatives */ - CCTK_REAL PDstandardNth1v1 = INITVALUE; CCTK_REAL PDstandardNth2v1 = INITVALUE; CCTK_REAL PDstandardNth3v1 = INITVALUE; CCTK_REAL PDstandardNth1v2 = INITVALUE; - CCTK_REAL PDstandardNth2v2 = INITVALUE; CCTK_REAL PDstandardNth3v2 = INITVALUE; CCTK_REAL PDstandardNth1v3 = INITVALUE; CCTK_REAL PDstandardNth2v3 = INITVALUE; - CCTK_REAL PDstandardNth3v3 = INITVALUE; /* Assign local copies of grid functions */ - dadxL = dadx[index]; - dadyL = dady[index]; - dadzL = dadz[index]; - dbdxL = dbdx[index]; - dbdyL = dbdy[index]; - dbdzL = dbdz[index]; - dcdxL = dcdx[index]; - dcdyL = dcdy[index]; - dcdzL = dcdz[index]; v1L = v1[index]; v2L = v2[index]; v3L = v3[index]; @@ -165,45 +145,21 @@ void WTFO_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL n /* Include user supplied include files */ /* Precompute derivatives (new style) */ - PDstandardNth1v1 = PDstandardNth1(v1, i, j, k); PDstandardNth2v1 = PDstandardNth2(v1, i, j, k); PDstandardNth3v1 = PDstandardNth3(v1, i, j, k); PDstandardNth1v2 = PDstandardNth1(v2, i, j, k); - PDstandardNth2v2 = PDstandardNth2(v2, i, j, k); PDstandardNth3v2 = PDstandardNth3(v2, i, j, k); PDstandardNth1v3 = PDstandardNth1(v3, i, j, k); PDstandardNth2v3 = PDstandardNth2(v3, i, j, k); - PDstandardNth3v3 = PDstandardNth3(v3, i, j, k); /* Precompute derivatives (old style) */ /* Calculate temporaries and grid functions */ - Jinv11 = dadxL; + w1L = -PDstandardNth2v3 + PDstandardNth3v2; - Jinv12 = dadyL; + w2L = PDstandardNth1v3 - PDstandardNth3v1; - Jinv13 = dadzL; - - Jinv21 = dbdxL; - - Jinv22 = dbdyL; - - Jinv23 = dbdzL; - - Jinv31 = dcdxL; - - Jinv32 = dcdyL; - - Jinv33 = dcdzL; - - w1L = Jinv13*PDstandardNth1v2 - Jinv12*PDstandardNth1v3 + Jinv23*PDstandardNth2v2 - Jinv22*PDstandardNth2v3 + - Jinv33*PDstandardNth3v2 - Jinv32*PDstandardNth3v3; - - w2L = -(Jinv13*PDstandardNth1v1) + Jinv11*PDstandardNth1v3 - Jinv23*PDstandardNth2v1 + Jinv21*PDstandardNth2v3 - - Jinv33*PDstandardNth3v1 + Jinv31*PDstandardNth3v3; - - w3L = Jinv12*PDstandardNth1v1 - Jinv11*PDstandardNth1v2 + Jinv22*PDstandardNth2v1 - Jinv21*PDstandardNth2v2 + - Jinv32*PDstandardNth3v1 - Jinv31*PDstandardNth3v2; + w3L = -PDstandardNth1v2 + PDstandardNth2v1; /* Copy local copies back to grid functions */ diff --git a/ML_FOWavetoy/param.ccl b/ML_FOWavetoy/param.ccl index 3066b49..54d2d6e 100644 --- a/ML_FOWavetoy/param.ccl +++ b/ML_FOWavetoy/param.ccl @@ -19,9 +19,9 @@ USES CCTK_INT MoL_Num_Evolved_Vars USES CCTK_INT MoL_Num_Constrained_Vars restricted: -CCTK_REAL verbose "verbose" +CCTK_INT verbose "verbose" { - "*:*" :: "" + *:* :: "" } 0 restricted: diff --git a/ML_FOWavetoy/src/WTFO_Gaussian.c b/ML_FOWavetoy/src/WTFO_Gaussian.c index 8e3e4d3..49f0d26 100644 --- a/ML_FOWavetoy/src/WTFO_Gaussian.c +++ b/ML_FOWavetoy/src/WTFO_Gaussian.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" diff --git a/ML_FOWavetoy/src/WTFO_RHS.c b/ML_FOWavetoy/src/WTFO_RHS.c index 12be3a1..c7107eb 100644 --- a/ML_FOWavetoy/src/WTFO_RHS.c +++ b/ML_FOWavetoy/src/WTFO_RHS.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -118,19 +121,8 @@ void WTFO_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3] subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])) ; /* Declare shorthands */ - CCTK_REAL Jinv11 = INITVALUE, Jinv12 = INITVALUE, Jinv13 = INITVALUE, Jinv21 = INITVALUE, Jinv22 = INITVALUE, Jinv23 = INITVALUE; - CCTK_REAL Jinv31 = INITVALUE, Jinv32 = INITVALUE, Jinv33 = INITVALUE; /* Declare local copies of grid functions */ - CCTK_REAL dadxL = INITVALUE; - CCTK_REAL dadyL = INITVALUE; - CCTK_REAL dadzL = INITVALUE; - CCTK_REAL dbdxL = INITVALUE; - CCTK_REAL dbdyL = INITVALUE; - CCTK_REAL dbdzL = INITVALUE; - CCTK_REAL dcdxL = INITVALUE; - CCTK_REAL dcdyL = INITVALUE; - CCTK_REAL dcdzL = INITVALUE; CCTK_REAL rhoL = INITVALUE, rhorhsL = INITVALUE; CCTK_REAL urhsL = INITVALUE; CCTK_REAL v1L = INITVALUE, v1rhsL = INITVALUE, v2L = INITVALUE, v2rhsL = INITVALUE, v3L = INITVALUE, v3rhsL = INITVALUE; @@ -141,25 +133,10 @@ void WTFO_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3] CCTK_REAL PDstandardNth2rho = INITVALUE; CCTK_REAL PDstandardNth3rho = INITVALUE; CCTK_REAL PDstandardNth1v1 = INITVALUE; - CCTK_REAL PDstandardNth2v1 = INITVALUE; - CCTK_REAL PDstandardNth3v1 = INITVALUE; - CCTK_REAL PDstandardNth1v2 = INITVALUE; CCTK_REAL PDstandardNth2v2 = INITVALUE; - CCTK_REAL PDstandardNth3v2 = INITVALUE; - CCTK_REAL PDstandardNth1v3 = INITVALUE; - CCTK_REAL PDstandardNth2v3 = INITVALUE; CCTK_REAL PDstandardNth3v3 = INITVALUE; /* Assign local copies of grid functions */ - dadxL = dadx[index]; - dadyL = dady[index]; - dadzL = dadz[index]; - dbdxL = dbdx[index]; - dbdyL = dbdy[index]; - dbdzL = dbdz[index]; - dcdxL = dcdx[index]; - dcdyL = dcdy[index]; - dcdzL = dcdz[index]; rhoL = rho[index]; v1L = v1[index]; v2L = v2[index]; @@ -174,47 +151,21 @@ void WTFO_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3] PDstandardNth2rho = PDstandardNth2(rho, i, j, k); PDstandardNth3rho = PDstandardNth3(rho, i, j, k); PDstandardNth1v1 = PDstandardNth1(v1, i, j, k); - PDstandardNth2v1 = PDstandardNth2(v1, i, j, k); - PDstandardNth3v1 = PDstandardNth3(v1, i, j, k); - PDstandardNth1v2 = PDstandardNth1(v2, i, j, k); PDstandardNth2v2 = PDstandardNth2(v2, i, j, k); - PDstandardNth3v2 = PDstandardNth3(v2, i, j, k); - PDstandardNth1v3 = PDstandardNth1(v3, i, j, k); - PDstandardNth2v3 = PDstandardNth2(v3, i, j, k); PDstandardNth3v3 = PDstandardNth3(v3, i, j, k); /* Precompute derivatives (old style) */ /* Calculate temporaries and grid functions */ - Jinv11 = dadxL; - - Jinv12 = dadyL; - - Jinv13 = dadzL; - - Jinv21 = dbdxL; - - Jinv22 = dbdyL; - - Jinv23 = dbdzL; - - Jinv31 = dcdxL; - - Jinv32 = dcdyL; - - Jinv33 = dcdzL; - urhsL = rhoL; - rhorhsL = Jinv11*PDstandardNth1v1 + Jinv12*PDstandardNth1v2 + Jinv13*PDstandardNth1v3 + Jinv21*PDstandardNth2v1 + - Jinv22*PDstandardNth2v2 + Jinv23*PDstandardNth2v3 + Jinv31*PDstandardNth3v1 + Jinv32*PDstandardNth3v2 + - Jinv33*PDstandardNth3v3; + rhorhsL = PDstandardNth1v1 + PDstandardNth2v2 + PDstandardNth3v3; - v1rhsL = Jinv11*PDstandardNth1rho + Jinv21*PDstandardNth2rho + Jinv31*PDstandardNth3rho; + v1rhsL = PDstandardNth1rho; - v2rhsL = Jinv12*PDstandardNth1rho + Jinv22*PDstandardNth2rho + Jinv32*PDstandardNth3rho; + v2rhsL = PDstandardNth2rho; - v3rhsL = Jinv13*PDstandardNth1rho + Jinv23*PDstandardNth2rho + Jinv33*PDstandardNth3rho; + v3rhsL = PDstandardNth3rho; /* Copy local copies back to grid functions */ diff --git a/ML_FOWavetoy/src/WTFO_constraints.c b/ML_FOWavetoy/src/WTFO_constraints.c index f725310..77f9384 100644 --- a/ML_FOWavetoy/src/WTFO_constraints.c +++ b/ML_FOWavetoy/src/WTFO_constraints.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -118,44 +121,21 @@ void WTFO_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL n subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])) ; /* Declare shorthands */ - CCTK_REAL Jinv11 = INITVALUE, Jinv12 = INITVALUE, Jinv13 = INITVALUE, Jinv21 = INITVALUE, Jinv22 = INITVALUE, Jinv23 = INITVALUE; - CCTK_REAL Jinv31 = INITVALUE, Jinv32 = INITVALUE, Jinv33 = INITVALUE; /* Declare local copies of grid functions */ - CCTK_REAL dadxL = INITVALUE; - CCTK_REAL dadyL = INITVALUE; - CCTK_REAL dadzL = INITVALUE; - CCTK_REAL dbdxL = INITVALUE; - CCTK_REAL dbdyL = INITVALUE; - CCTK_REAL dbdzL = INITVALUE; - CCTK_REAL dcdxL = INITVALUE; - CCTK_REAL dcdyL = INITVALUE; - CCTK_REAL dcdzL = INITVALUE; CCTK_REAL v1L = INITVALUE, v2L = INITVALUE, v3L = INITVALUE; CCTK_REAL w1L = INITVALUE, w2L = INITVALUE, w3L = INITVALUE; /* Declare precomputed derivatives*/ /* Declare derivatives */ - CCTK_REAL PDstandardNth1v1 = INITVALUE; CCTK_REAL PDstandardNth2v1 = INITVALUE; CCTK_REAL PDstandardNth3v1 = INITVALUE; CCTK_REAL PDstandardNth1v2 = INITVALUE; - CCTK_REAL PDstandardNth2v2 = INITVALUE; CCTK_REAL PDstandardNth3v2 = INITVALUE; CCTK_REAL PDstandardNth1v3 = INITVALUE; CCTK_REAL PDstandardNth2v3 = INITVALUE; - CCTK_REAL PDstandardNth3v3 = INITVALUE; /* Assign local copies of grid functions */ - dadxL = dadx[index]; - dadyL = dady[index]; - dadzL = dadz[index]; - dbdxL = dbdx[index]; - dbdyL = dbdy[index]; - dbdzL = dbdz[index]; - dcdxL = dcdx[index]; - dcdyL = dcdy[index]; - dcdzL = dcdz[index]; v1L = v1[index]; v2L = v2[index]; v3L = v3[index]; @@ -165,45 +145,21 @@ void WTFO_constraints_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL n /* Include user supplied include files */ /* Precompute derivatives (new style) */ - PDstandardNth1v1 = PDstandardNth1(v1, i, j, k); PDstandardNth2v1 = PDstandardNth2(v1, i, j, k); PDstandardNth3v1 = PDstandardNth3(v1, i, j, k); PDstandardNth1v2 = PDstandardNth1(v2, i, j, k); - PDstandardNth2v2 = PDstandardNth2(v2, i, j, k); PDstandardNth3v2 = PDstandardNth3(v2, i, j, k); PDstandardNth1v3 = PDstandardNth1(v3, i, j, k); PDstandardNth2v3 = PDstandardNth2(v3, i, j, k); - PDstandardNth3v3 = PDstandardNth3(v3, i, j, k); /* Precompute derivatives (old style) */ /* Calculate temporaries and grid functions */ - Jinv11 = dadxL; + w1L = -PDstandardNth2v3 + PDstandardNth3v2; - Jinv12 = dadyL; + w2L = PDstandardNth1v3 - PDstandardNth3v1; - Jinv13 = dadzL; - - Jinv21 = dbdxL; - - Jinv22 = dbdyL; - - Jinv23 = dbdzL; - - Jinv31 = dcdxL; - - Jinv32 = dcdyL; - - Jinv33 = dcdzL; - - w1L = Jinv13*PDstandardNth1v2 - Jinv12*PDstandardNth1v3 + Jinv23*PDstandardNth2v2 - Jinv22*PDstandardNth2v3 + - Jinv33*PDstandardNth3v2 - Jinv32*PDstandardNth3v3; - - w2L = -(Jinv13*PDstandardNth1v1) + Jinv11*PDstandardNth1v3 - Jinv23*PDstandardNth2v1 + Jinv21*PDstandardNth2v3 - - Jinv33*PDstandardNth3v1 + Jinv31*PDstandardNth3v3; - - w3L = Jinv12*PDstandardNth1v1 - Jinv11*PDstandardNth1v2 + Jinv22*PDstandardNth2v1 - Jinv21*PDstandardNth2v2 + - Jinv32*PDstandardNth3v1 - Jinv31*PDstandardNth3v2; + w3L = -PDstandardNth1v2 + PDstandardNth2v1; /* Copy local copies back to grid functions */ diff --git a/ML_WaveToy/param.ccl b/ML_WaveToy/param.ccl index d32c338..d341963 100644 --- a/ML_WaveToy/param.ccl +++ b/ML_WaveToy/param.ccl @@ -19,9 +19,9 @@ USES CCTK_INT MoL_Num_Evolved_Vars USES CCTK_INT MoL_Num_Constrained_Vars restricted: -CCTK_REAL verbose "verbose" +CCTK_INT verbose "verbose" { - "*:*" :: "" + *:* :: "" } 0 restricted: diff --git a/ML_WaveToy/src/WT_Gaussian.c b/ML_WaveToy/src/WT_Gaussian.c index 26dba99..075b622 100644 --- a/ML_WaveToy/src/WT_Gaussian.c +++ b/ML_WaveToy/src/WT_Gaussian.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" diff --git a/ML_WaveToy/src/WT_RHS.c b/ML_WaveToy/src/WT_RHS.c index 9755093..2409a58 100644 --- a/ML_WaveToy/src/WT_RHS.c +++ b/ML_WaveToy/src/WT_RHS.c @@ -5,7 +5,10 @@ #define KRANC_C +#include <assert.h> #include <math.h> +#include <stdio.h> +#include <stdlib.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -118,55 +121,18 @@ void WT_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])) ; /* Declare shorthands */ - CCTK_REAL dJinv111 = INITVALUE, dJinv122 = INITVALUE, dJinv133 = INITVALUE, dJinv211 = INITVALUE, dJinv222 = INITVALUE, dJinv233 = INITVALUE; - CCTK_REAL dJinv311 = INITVALUE, dJinv322 = INITVALUE, dJinv333 = INITVALUE; - CCTK_REAL Jinv11 = INITVALUE, Jinv12 = INITVALUE, Jinv13 = INITVALUE, Jinv21 = INITVALUE, Jinv22 = INITVALUE, Jinv23 = INITVALUE; - CCTK_REAL Jinv31 = INITVALUE, Jinv32 = INITVALUE, Jinv33 = INITVALUE; /* Declare local copies of grid functions */ - CCTK_REAL dadxL = INITVALUE; - CCTK_REAL dadyL = INITVALUE; - CCTK_REAL dadzL = INITVALUE; - CCTK_REAL dbdxL = INITVALUE; - CCTK_REAL dbdyL = INITVALUE; - CCTK_REAL dbdzL = INITVALUE; - CCTK_REAL dcdxL = INITVALUE; - CCTK_REAL dcdyL = INITVALUE; - CCTK_REAL dcdzL = INITVALUE; - CCTK_REAL ddadxdxL = INITVALUE; - CCTK_REAL ddadydyL = INITVALUE; - CCTK_REAL ddadzdzL = INITVALUE; CCTK_REAL rhoL = INITVALUE, rhorhsL = INITVALUE; CCTK_REAL uL = INITVALUE, urhsL = INITVALUE; /* Declare precomputed derivatives*/ /* Declare derivatives */ - CCTK_REAL PDstandardNth1u = INITVALUE; - CCTK_REAL PDstandardNth2u = INITVALUE; - CCTK_REAL PDstandardNth3u = INITVALUE; CCTK_REAL PDstandardNth11u = INITVALUE; CCTK_REAL PDstandardNth22u = INITVALUE; CCTK_REAL PDstandardNth33u = INITVALUE; - CCTK_REAL PDstandardNth12u = INITVALUE; - CCTK_REAL PDstandardNth13u = INITVALUE; - CCTK_REAL PDstandardNth21u = INITVALUE; - CCTK_REAL PDstandardNth23u = INITVALUE; - CCTK_REAL PDstandardNth31u = INITVALUE; - CCTK_REAL PDstandardNth32u = INITVALUE; /* Assign local copies of grid functions */ - dadxL = dadx[index]; - dadyL = dady[index]; - dadzL = dadz[index]; - dbdxL = dbdx[index]; - dbdyL = dbdy[index]; - dbdzL = dbdz[index]; - dcdxL = dcdx[index]; - dcdyL = dcdy[index]; - dcdzL = dcdz[index]; - ddadxdxL = ddadxdx[index]; - ddadydyL = ddadydy[index]; - ddadzdzL = ddadzdz[index]; rhoL = rho[index]; uL = u[index]; @@ -175,65 +141,16 @@ void WT_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], /* Include user supplied include files */ /* Precompute derivatives (new style) */ - PDstandardNth1u = PDstandardNth1(u, i, j, k); - PDstandardNth2u = PDstandardNth2(u, i, j, k); - PDstandardNth3u = PDstandardNth3(u, i, j, k); PDstandardNth11u = PDstandardNth11(u, i, j, k); PDstandardNth22u = PDstandardNth22(u, i, j, k); PDstandardNth33u = PDstandardNth33(u, i, j, k); - PDstandardNth12u = PDstandardNth12(u, i, j, k); - PDstandardNth13u = PDstandardNth13(u, i, j, k); - PDstandardNth23u = PDstandardNth23(u, i, j, k); /* Precompute derivatives (old style) */ /* Calculate temporaries and grid functions */ - Jinv11 = dadxL; - - Jinv12 = dadyL; - - Jinv13 = dadzL; - - Jinv21 = dbdxL; - - Jinv22 = dbdyL; - - Jinv23 = dbdzL; - - Jinv31 = dcdxL; - - Jinv32 = dcdyL; - - Jinv33 = dcdzL; - - dJinv111 = ddadxdxL; - - dJinv122 = ddadydyL; - - dJinv133 = ddadzdzL; - - dJinv211 = ddadxdxL; - - dJinv222 = ddadydyL; - - dJinv233 = ddadzdzL; - - dJinv311 = ddadxdxL; - - dJinv322 = ddadydyL; - - dJinv333 = ddadzdzL; - urhsL = rhoL; - rhorhsL = (dJinv111 + dJinv122 + dJinv133)*PDstandardNth1u + - 2*((Jinv11*Jinv21 + Jinv12*Jinv22 + Jinv13*Jinv23)*PDstandardNth12u + - (Jinv11*Jinv31 + Jinv12*Jinv32 + Jinv13*Jinv33)*PDstandardNth13u + - (Jinv21*Jinv31 + Jinv22*Jinv32 + Jinv23*Jinv33)*PDstandardNth23u) + - (dJinv211 + dJinv222 + dJinv233)*PDstandardNth2u + (dJinv311 + dJinv322 + dJinv333)*PDstandardNth3u + - PDstandardNth11u*(SQR(Jinv11) + SQR(Jinv12) + SQR(Jinv13)) + - PDstandardNth22u*(SQR(Jinv21) + SQR(Jinv22) + SQR(Jinv23)) + - PDstandardNth33u*(SQR(Jinv31) + SQR(Jinv32) + SQR(Jinv33)); + rhorhsL = PDstandardNth11u + PDstandardNth22u + PDstandardNth33u; /* Copy local copies back to grid functions */ @@ -1,14 +1,19 @@ # -*-Makefile-*- -all: McLachlan.out McLachlanW.out WaveToy.out +all: McLachlan_ADM.out McLachlan_BSSN.out McLachlanW.out WaveToy.out @echo @echo "The Cactus thorns are up to date." @echo -McLachlan.out: McLachlan.m - rm -rf ML_ADM ML_BSSN +McLachlan_ADM.out: McLachlan_ADM.m +# rm -rf ML_ADM* +# ./runmath.sh $^ +# for thorn in ML_ADM*; do ./copy-if-changed.sh $$thorn ../$$thorn; done + +McLachlan_BSSN.out: McLachlan_BSSN.m + rm -rf ML_BSSN* ./runmath.sh $^ - for thorn in ML_ADM ML_BSSN; do ./copy-if-changed.sh $$thorn ../$$thorn; done + for thorn in ML_BSSN*; do ./copy-if-changed.sh $$thorn ../$$thorn; done McLachlanW.out: McLachlanW.m rm -rf ML_BSSNW @@ -31,8 +36,11 @@ WaveToy.out: WaveToy.m for thorn in ML_WaveToy ML_FOWaveToy; do ./copy-if-changed.sh $$thorn ../$$thorn; done clean: - rm -rf McLachlan.out McLachlan.err ML_ADM ML_BSSN - rm -rf McLachlanW.out McLachlanW.err ML_BSSNW + rm -rf McLachlan_ADM.out McLachlan_ADM.err ML_ADM* + rm -rf McLachlan_BSSN.out McLachlan_BSSN.err ML_BSSN* + rm -rf McLachlanW.out McLachlanW.err + rm -rf McLachlanUp.out McLachlanUp.err + rm -rf McLachlan6.out McLachlan6.err rm -rf WaveToy.out WaveToy.err ML_WaveToy ML_FOWaveToy .PHONY: all clean diff --git a/m/McLachlan_ADM.m b/m/McLachlan_ADM.m new file mode 100644 index 0000000..a79ac88 --- /dev/null +++ b/m/McLachlan_ADM.m @@ -0,0 +1,385 @@ +$Path = Join[$Path, {"~/Calpha/kranc/Tools/CodeGen", + "~/Calpha/kranc/Tools/MathematicaMisc"}]; + +Get["KrancThorn`"]; + +SetEnhancedTimes[False]; +SetSourceLanguage["C"]; + +(******************************************************************************) +(* Options *) +(******************************************************************************) + +(* derivative order: 2, 4, 6, 8, ... *) +derivOrder = 4; + +(* useGlobalDerivs: True or False *) +useGlobalDerivs = False; + +(* timelevels: 2 or 3 + (keep this at 3; this is better chosen with a run-time parameter) *) +evolutionTimelevels = 3; + +(* matter: 0 or 1 *) +addMatter = 0; + + + +prefix = "ML_"; +suffix = + If [useGlobalDerivs, "_MP", ""] <> + If [derivOrder!=4, "_O" <> ToString[derivOrder], ""] <> + If [evolutionTimelevels!=3, "_TL" <> ToString[evolutionTimelevels], ""] <> + If [addMatter!=0, "_M", ""]; + +ADM = prefix <> "ADM" <> suffix; + +(******************************************************************************) +(* Derivatives *) +(******************************************************************************) + +KD = KroneckerDelta; + +derivatives = +{ + PDstandardNth[i_] -> StandardCenteredDifferenceOperator[1,derivOrder/2,i], + PDstandardNth[i_, i_] -> StandardCenteredDifferenceOperator[2,derivOrder/2,i], + PDstandardNth[i_, j_] -> StandardCenteredDifferenceOperator[1,derivOrder/2,i] + StandardCenteredDifferenceOperator[1,derivOrder/2,j] +}; + +FD = PDstandardNth; + +If [useGlobalDerivs, + DefineJacobian[PD, FD, J, dJ], + DefineJacobian[PD, FD, KD, Zero3]]; + + + +(******************************************************************************) +(* Tensors *) +(******************************************************************************) + +(* Register the tensor quantities with the TensorTools package *) +Map [DefineTensor, + {J, dJ, + g, K, alpha, beta, H, M, detg, gu, G, R, trR, Km, trK, + T00, T0, T, rho, S}]; + +Map [AssertSymmetricIncreasing, + {g[la,lb], K[la,lb], R[la,lb], + T[la,lb]}]; +AssertSymmetricIncreasing [dJ[ua,lb,lc], lb, lc]; +AssertSymmetricIncreasing [G[ua,lb,lc], lb, lc]; + +DefineConnection [CD, PD, G]; + +Map [DefineTensor, + {gxx, gxy, gxz, gyy, gyz, gzz, + kxx, kxy, kxz, kyy, kyz, kzz, + alp, + dtalp, + betax, betay, betaz, + dtbetax, dtbetay, dtbetaz, + eTtt, + eTtx, eTty, eTtz, + eTxx, eTxy, eTxz, eTyy, eTyz, eTzz}]; + +(******************************************************************************) +(* Expressions *) +(******************************************************************************) + +detgExpr = Det [MatrixOfComponents [g [la,lb]]]; +ddetgExpr[la_] = + Sum [D[Det[MatrixOfComponents[g[la, lb]]], X] PD[X, la], + {X, Union[Flatten[MatrixOfComponents[g[la, lb]]]]}]; + +pi = N[Pi,40]; + +(******************************************************************************) +(* Groups *) +(******************************************************************************) + +SetGroupTimelevels[g_,tl_] = Join[g, {Timelevels -> tl}]; + +evolvedGroups = + {SetGroupName [CreateGroupFromTensor [g[la,lb]], prefix <> "metric"], + SetGroupName [CreateGroupFromTensor [K[la,lb]], prefix <> "curv" ], + SetGroupName [CreateGroupFromTensor [alpha ], prefix <> "lapse" ], + SetGroupName [CreateGroupFromTensor [beta[ua]], prefix <> "shift" ]}; +evaluatedGroups = + {SetGroupName [CreateGroupFromTensor [H ], prefix <> "Ham"], + SetGroupName [CreateGroupFromTensor [M[la]], prefix <> "mom"]}; + +declaredGroups = Join [evolvedGroups, evaluatedGroups]; +declaredGroupNames = Map [First, declaredGroups]; + + + +extraGroups = + {{"ADMBase::metric", {gxx, gxy, gxz, gyy, gyz, gzz}}, + {"ADMBase::curv", {kxx, kxy, kxz, kyy, kyz, kzz}}, + {"ADMBase::lapse", {alp}}, + {"ADMBase::dtlapse", {dtalp}}, + {"ADMBase::shift", {betax, betay, betaz}}, + {"ADMBase::dtshift", {dtbetax, dtbetay, dtbetaz}}, + {"TmunuBase::stress_energy_scalar", {eTtt}}, + {"TmunuBase::stress_energy_vector", {eTtx, eTty, eTtz}}, + {"TmunuBase::stress_energy_tensor", {eTxx, eTxy, eTxz, eTyy, eTyz, eTzz}}, + {"Coordinates::jacobian", {J11, J12, J13, J21, J22, J23, J31, J32, J33}}, + {"Coordinates::jacobian2", {dJ111, dJ112, dJ113, dJ122, dJ123, dJ133, + dJ211, dJ212, dJ213, dJ222, dJ223, dJ233, + dJ311, dJ312, dJ313, dJ322, dJ323, dJ333}} +}; + + + +groups = Join [declaredGroups, extraGroups]; + +(******************************************************************************) +(* Initial data *) +(******************************************************************************) + +initialCalc = +{ + Name -> ADM <> "_Minkowski", + Schedule -> {"IN ADMBase_InitialData"}, + ConditionalOnKeyword -> {"my_initial_data", "Minkowski"}, + Equations -> + { + g[la,lb] -> KD[la,lb], + K[la,lb] -> 0, + alpha -> 1, + beta[ua] -> 0 + } +} + +(******************************************************************************) +(* Convert from ADMBase *) +(******************************************************************************) + +convertFromADMBaseCalc = +{ + Name -> ADM <> "_convertFromADMBase", + Schedule -> {"AT initial AFTER ADMBase_PostInitial"}, + ConditionalOnKeyword -> {"my_initial_data", "ADMBase"}, + Equations -> + { + g11 -> gxx, + g12 -> gxy, + g13 -> gxz, + g22 -> gyy, + g23 -> gyz, + g33 -> gzz, + K11 -> kxx, + K12 -> kxy, + K13 -> kxz, + K22 -> kyy, + K23 -> kyz, + K33 -> kzz, + (* TODO: this is incomplete; it ignores dtalp and dtbeta^i *) + alpha -> alp, + beta1 -> betax, + beta2 -> betay, + beta3 -> betaz + } +} + +(******************************************************************************) +(* Convert to ADMBase *) +(******************************************************************************) + +convertToADMBaseCalc = +{ + Name -> ADM <> "_convertToADMBase", + Schedule -> {"IN MoL_PostStep AFTER " <> ADM <> "_ApplyBCs"}, + Equations -> + { + gxx -> g11, + gxy -> g12, + gxz -> g13, + gyy -> g22, + gyz -> g23, + gzz -> g33, + kxx -> K11, + kxy -> K12, + kxz -> K13, + kyy -> K22, + kyz -> K23, + kzz -> K33, + (* TODO: this is wrong; it sets dtalp and dtbeta^i incorrectly *) + alp -> alpha, + dtalp -> 0, + betax -> beta1, + betay -> beta2, + betaz -> beta3, + dtbetax -> 0, + dtbetay -> 0, + dtbetaz -> 0 + } +} + +(******************************************************************************) +(* Evolution equations *) +(******************************************************************************) + +evolCalc = +{ + Name -> ADM <> "_RHS", + Schedule -> {"IN MoL_CalcRHS", "AT analysis"}, + Where -> Interior, + Shorthands -> {detg, gu[ua,ub], G[ua,lb,lc], R[la,lb], Km[ua,lb], trK}, + Equations -> + { + detg -> detgExpr, + gu[ua,ub] -> 1/detg detgExpr MatrixInverse [g[ua,ub]], + G[ua,lb,lc] -> 1/2 gu[ua,ud] + (PD[g[lb,ld],lc] + PD[g[lc,ld],lb] - PD[g[lb,lc],ld]), + R[la,lb] -> G[u1,l2,la] G[u2,l1,lb] - G[u1,la,lb] G[u2,l1,l2] + + 1/2 gu[u1,u2] (- PD[g[l1,l2],la,lb] + PD[g[l1,la],l2,lb] + - PD[g[la,lb],l1,l2] + PD[g[l2,lb],l1,la]), + Km[ua,lb] -> gu[ua,uc] K[lc,lb], + trK -> Km[ua,la], + + dot[g[la,lb]] -> -2 alpha K[la,lb] + + Lie[g[la,lb], beta], + dot[K[la,lb]] -> - CD[alpha,la,lb] + + alpha (+ R[la,lb] + K[la,lb] trK - 2 K[la,lc] Km[uc,lb]) + + Lie[K[la,lb], beta], + dot[alpha] -> 0, + dot[beta[ua]] -> 0 + } +} + +(******************************************************************************) +(* Boundary conditions *) +(******************************************************************************) + +boundaryCalc = +{ + Name -> ADM <> "_boundary", + Schedule -> {"IN MoL_PostStep"}, + ConditionalOnKeyword -> {"my_boundary_condition", "Minkowski"}, + Where -> BoundaryWithGhosts, + Equations -> + { + g[la,lb] -> KD[la,lb], + K[la,lb] -> 0, + alpha -> 1, + beta[ua] -> 0 + } +} + +(******************************************************************************) +(* Constraint equations *) +(******************************************************************************) + +constraintsCalc = +{ + Name -> ADM <> "_constraints", + Schedule -> {"AT analysis"}, + TriggerGroups -> {prefix <> "Ham", prefix <> "mom"}, + Where -> Interior, + Shorthands -> {detg, gu[ua,ub], G[ua,lb,lc], R[la,lb], trR, Km[ua,lb], trK}, + Equations -> + { + detg -> detgExpr, + gu[ua,ub] -> 1/detg detgExpr MatrixInverse[g[ua,ub]], + G[ua,lb,lc] -> 1/2 gu[ua,ud] + (PD[g[lb,ld],lc] + PD[g[lc,ld],lb] - PD[g[lb,lc],ld]), + R[la,lb] -> G[u1,l2,la] G[l1,lb,u2] - G[u1,la,lb] G[l1,l2,u2] + + 1/2 gu[u1,u2] (- PD[g[l1,l2],la,lb] + PD[g[l1,la],l2,lb] + - PD[g[la,lb],l1,l2] + PD[g[l2,lb],l1,la]), + trR -> R[la,lb] gu[ua,ub], + Km[ua,lb] -> gu[ua,uc] K[lc,lb], + trK -> Km[ua,la], + + H -> trR - Km[ua,lb] Km[ub,la] + trK^2, + M[la] -> gu[ub,uc] (CD[K[lc,la], lb] - CD[K[lc,lb], la]) + } +} + +constraintsBoundaryCalc = +{ + Name -> ADM <> "_constraints_boundary", + Schedule -> {"AT analysis AFTER " <> ADM <> "_constraints"}, + (* TriggerGroups -> {prefix <> "Ham", prefix <> "mom"}, *) + Where -> BoundaryWithGhosts, + Equations -> + { + H -> 0, + M[la] -> 0 + } +} + +(******************************************************************************) +(* Implementations *) +(******************************************************************************) + +inheritedImplementations = + Join[{"ADMBase"}, + If [addMatter!=0, {"TmunuBase"}, {}], + If [useGlobalDerivs, {"Coordinates"}, {}]]; + +(******************************************************************************) +(* Parameters *) +(******************************************************************************) + +extendedKeywordParameters = +{ + { + Name -> "ADMBase::evolution_method", + AllowedValues -> {BSSN} + }, + { + Name -> "ADMBase::lapse_evolution_method", + AllowedValues -> {BSSN} + }, + { + Name -> "ADMBase::shift_evolution_method", + AllowedValues -> {BSSN} + } +}; + +keywordParameters = +{ + { + Name -> "my_initial_data", + (* Visibility -> "restricted", *) + (* Description -> "ddd", *) + AllowedValues -> {"ADMBase", "Minkowski"}, + Default -> "ADMBase" + }, + { + Name -> "my_boundary_condition", + (* Visibility -> "restricted", *) + (* Description -> "ddd", *) + AllowedValues -> {"none", "Minkowski"}, + Default -> "none" + } +}; + +(******************************************************************************) +(* Construct the thorns *) +(******************************************************************************) + +calculations = +{ + initialCalc, + convertFromADMBaseCalc, + evolCalc, + boundaryCalc, + convertToADMBaseCalc, + constraintsCalc, + constraintsBoundaryCalc +}; + +CreateKrancThornTT [groups, ".", ADM, + Calculations -> calculations, + DeclaredGroups -> declaredGroupNames, + PartialDerivatives -> derivatives, + EvolutionTimelevels -> evolutionTimelevels, + UseLoopControl -> True, + InheritedImplementations -> inheritedImplementations, + KeywordParameters -> keywordParameters +]; diff --git a/m/McLachlan.m b/m/McLachlan_BSSN.m index 88259fb..09e78af 100644 --- a/m/McLachlan.m +++ b/m/McLachlan_BSSN.m @@ -1,5 +1,5 @@ -$Path = Join[$Path, {"~/Calpha/Kranc/Tools/CodeGen", - "~/Calpha/Kranc/Tools/MathematicaMisc"}]; +$Path = Join[$Path, {"~/Calpha/kranc/Tools/CodeGen", + "~/Calpha/kranc/Tools/MathematicaMisc"}]; Get["KrancThorn`"]; @@ -7,38 +7,50 @@ SetEnhancedTimes[False]; SetSourceLanguage["C"]; (******************************************************************************) +(* Options *) +(******************************************************************************) + +createCode[derivOrder_, useGlobalDerivs_, evolutionTimelevels_, addMatter_] := +Module[{}, + +prefix = "ML_"; +suffix = + If [useGlobalDerivs, "_MP", ""] <> + If [derivOrder!=4, "_O" <> ToString[derivOrder], ""] <> + If [evolutionTimelevels!=3, "_TL" <> ToString[evolutionTimelevels], ""] <> + If [addMatter==0, "_V", ""]; + +BSSN = prefix <> "BSSN" <> suffix; + +(******************************************************************************) (* Derivatives *) (******************************************************************************) KD = KroneckerDelta; -(* derivative order: 2, 4, 6, 8, ... *) -derivOrder = 4; - derivatives = { PDstandardNth[i_] -> StandardCenteredDifferenceOperator[1,derivOrder/2,i], PDstandardNth[i_, i_] -> StandardCenteredDifferenceOperator[2,derivOrder/2,i], PDstandardNth[i_, j_] -> StandardCenteredDifferenceOperator[1,derivOrder/2,i] - StandardCenteredDifferenceOperator[1,derivOrder/2,j] + StandardCenteredDifferenceOperator[1,derivOrder/2,j], + +(* + PDPlus [i_] -> (+1) (-1 + shift[i]^(+1)) / spacing[i], + PDMinus [i_] -> (-1) (-1 + shift[i]^(-1)) / spacing[i] +*) + PDPlus [i_] -> StandardUpwindDifferenceOperator[1,0,derivOrder/2,i], + PDMinus [i_] -> StandardUpwindDifferenceOperator[1,derivOrder/2,0,i] }; -(* local derivatives *) -PDloc = PDstandardNth; +FD = PDstandardNth; -(* global derivatives *) -PDglob[var_,lx_] := Jinv[u1,lx] PDloc[var,l1]; -PDglob[var_,lx_,ly_] := - dJinv[u1,lx,ly] PDloc[var,l1] + Jinv[u1,lx] Jinv[u2,ly] PDloc[var,l1,l2]; +ResetJacobians; +If [useGlobalDerivs, + DefineJacobian[PD, FD, J, dJ], + DefineJacobian[PD, FD, KD, Zero3]]; -UseGlobalDerivs = False; -PD := If [UseGlobalDerivs, PDglob, PDloc]; -(* timelevels: 2 or 3 *) -evolutionTimelevels = 3; - -(* matter: 0 or 1 *) -addMatter = 0; (******************************************************************************) (* Tensors *) @@ -46,10 +58,19 @@ addMatter = 0; (* Register the tensor quantities with the TensorTools package *) Map [DefineTensor, - {g, K, alpha, beta, H, M, detg, gu, G, R, trR, Km, trK, + {normal, tangentA, tangentB, dir, + nn, nu, nlen, nlen2, su, vg, + xx, rr, th, ph, + J, dJ, + g, K, alpha, beta, H, M, detg, gu, G, R, trR, Km, trK, phi, gt, At, Xt, Xtn, A, B, Atm, Atu, trA, Ats, trAts, cXt, cS, cA, e4phi, em4phi, ddetg, detgt, gtu, ddetgt, dgtu, ddgtu, Gt, Rt, Rphi, gK, - T00, T0, T, rho, S}]; + T00, T0, T, rho, S, + Psi0re, Psi0im, Psi1re, Psi1im, Psi2re, Psi2im, Psi3re, Psi3im, + Psi4re, Psi4im, + er, eth, eph, mm1A, mm1L, mm1, mm2A, mm2B, mm2L, mm2, + ssA, ssB, ssC, ssL, ss, ss0, tt, ss0, kk, nn, kk0, nn0, mmre, mmim, + EE, BB}]; (* NOTE: It seems as if Lie[.,.] did not take these tensor weights into account. Presumably, CD[.,.] and CDt[.,.] don't do this either. *) @@ -63,6 +84,7 @@ SetTensorAttribute[cS, TensorWeight, +2 ]; Map [AssertSymmetricIncreasing, {g[la,lb], K[la,lb], R[la,lb], gt[la,lb], At[la,lb], Ats[la,lb], Rt[la,lb], Rphi[la,lb], T[la,lb]}]; +AssertSymmetricIncreasing [dJ[ua,lb,lc], lb, lc]; AssertSymmetricIncreasing [G[ua,lb,lc], lb, lc]; AssertSymmetricIncreasing [Gt[ua,lb,lc], lb, lc]; AssertSymmetricIncreasing [gK[la,lb,lc], la, lb]; @@ -108,37 +130,25 @@ pi = N[Pi,40]; SetGroupTimelevels[g_,tl_] = Join[g, {Timelevels -> tl}]; evolvedGroups = - {SetGroupName [CreateGroupFromTensor [g[la,lb]], "ml_metric"], - SetGroupName [CreateGroupFromTensor [K[la,lb]], "ml_curv" ], - SetGroupName [CreateGroupFromTensor [alpha ], "ml_lapse" ], - SetGroupName [CreateGroupFromTensor [beta[ua]], "ml_shift" ]}; + {SetGroupName [CreateGroupFromTensor [phi ], prefix <> "log_confac"], + SetGroupName [CreateGroupFromTensor [gt[la,lb]], prefix <> "metric" ], + SetGroupName [CreateGroupFromTensor [Xt[ua] ], prefix <> "Gamma" ], + SetGroupName [CreateGroupFromTensor [trK ], prefix <> "trace_curv"], + SetGroupName [CreateGroupFromTensor [At[la,lb]], prefix <> "curv" ], + SetGroupName [CreateGroupFromTensor [alpha ], prefix <> "lapse" ], + SetGroupName [CreateGroupFromTensor [A ], prefix <> "dtlapse" ], + SetGroupName [CreateGroupFromTensor [beta[ua] ], prefix <> "shift" ], + SetGroupName [CreateGroupFromTensor [B[ua] ], prefix <> "dtshift" ]}; evaluatedGroups = - {SetGroupName [CreateGroupFromTensor [H ], "Ham"], - SetGroupName [CreateGroupFromTensor [M[la]], "mom"]}; + {SetGroupName [CreateGroupFromTensor [H ], prefix <> "Ham"], + SetGroupName [CreateGroupFromTensor [M[la] ], prefix <> "mom"], + SetGroupName [CreateGroupFromTensor [cS ], prefix <> "cons_detg"], + SetGroupName [CreateGroupFromTensor [cXt[ua]], prefix <> "cons_Gamma"], + SetGroupName [CreateGroupFromTensor [cA ], prefix <> "cons_traceA"]}; declaredGroups = Join [evolvedGroups, evaluatedGroups]; declaredGroupNames = Map [First, declaredGroups]; -evolvedGroupsBSSN = - {SetGroupName [CreateGroupFromTensor [phi ], "ML_log_confac"], - SetGroupName [CreateGroupFromTensor [gt[la,lb]], "ML_metric" ], - SetGroupName [CreateGroupFromTensor [Xt[ua] ], "ML_Gamma" ], - SetGroupName [CreateGroupFromTensor [trK ], "ML_trace_curv"], - SetGroupName [CreateGroupFromTensor [At[la,lb]], "ML_curv" ], - SetGroupName [CreateGroupFromTensor [alpha ], "ML_lapse" ], - SetGroupName [CreateGroupFromTensor [A ], "ML_dtlapse" ], - SetGroupName [CreateGroupFromTensor [beta[ua] ], "ML_shift" ], - SetGroupName [CreateGroupFromTensor [B[ua] ], "ML_dtshift" ]}; -evaluatedGroupsBSSN = - {SetGroupName [CreateGroupFromTensor [H ], "Ham"], - SetGroupName [CreateGroupFromTensor [M[la] ], "mom"], - SetGroupName [CreateGroupFromTensor [cS ], "cons_detg"], - SetGroupName [CreateGroupFromTensor [cXt[ua]], "cons_Gamma"], - SetGroupName [CreateGroupFromTensor [cA ], "cons_traceA"]}; - -declaredGroupsBSSN = Join [evolvedGroupsBSSN, evaluatedGroupsBSSN]; -declaredGroupNamesBSSN = Map [First, declaredGroupsBSSN]; - extraGroups = @@ -150,12 +160,16 @@ extraGroups = {"ADMBase::dtshift", {dtbetax, dtbetay, dtbetaz}}, {"TmunuBase::stress_energy_scalar", {eTtt}}, {"TmunuBase::stress_energy_vector", {eTtx, eTty, eTtz}}, - {"TmunuBase::stress_energy_tensor", {eTxx, eTxy, eTxz, eTyy, eTyz, eTzz}}}; + {"TmunuBase::stress_energy_tensor", {eTxx, eTxy, eTxz, eTyy, eTyz, eTzz}}, + {"Coordinates::jacobian", {J11, J12, J13, J21, J22, J23, J31, J32, J33}}, + {"Coordinates::jacobian2", {dJ111, dJ112, dJ113, dJ122, dJ123, dJ133, + dJ211, dJ212, dJ213, dJ222, dJ223, dJ233, + dJ311, dJ312, dJ313, dJ322, dJ323, dJ333}} +}; groups = Join [declaredGroups, extraGroups]; -groupsBSSN = Join [declaredGroupsBSSN, extraGroups]; (******************************************************************************) (* Initial data *) @@ -163,21 +177,7 @@ groupsBSSN = Join [declaredGroupsBSSN, extraGroups]; initialCalc = { - Name -> "ML_ADM_Minkowski", - Schedule -> {"IN ADMBase_InitialData"}, - ConditionalOnKeyword -> {"my_initial_data", "Minkowski"}, - Equations -> - { - g[la,lb] -> KD[la,lb], - K[la,lb] -> 0, - alpha -> 1, - beta[ua] -> 0 - } -} - -initialCalcBSSN = -{ - Name -> "ML_BSSN_Minkowski", + Name -> BSSN <> "_Minkowski", Schedule -> {"IN ADMBase_InitialData"}, ConditionalOnKeyword -> {"my_initial_data", "Minkowski"}, Equations -> @@ -192,7 +192,7 @@ initialCalcBSSN = beta[ua] -> 0, B[ua] -> 0 } -} +}; (******************************************************************************) (* Convert from ADMBase *) @@ -200,34 +200,7 @@ initialCalcBSSN = convertFromADMBaseCalc = { - Name -> "ML_ADM_convertFromADMBase", - Schedule -> {"AT initial AFTER ADMBase_PostInitial"}, - ConditionalOnKeyword -> {"my_initial_data", "ADMBase"}, - Equations -> - { - g11 -> gxx, - g12 -> gxy, - g13 -> gxz, - g22 -> gyy, - g23 -> gyz, - g33 -> gzz, - K11 -> kxx, - K12 -> kxy, - K13 -> kxz, - K22 -> kyy, - K23 -> kyz, - K33 -> kzz, - (* TODO: this is incomplete; it ignores dtalp and dtbeta^i *) - alpha -> alp, - beta1 -> betax, - beta2 -> betay, - beta3 -> betaz - } -} - -convertFromADMBaseCalcBSSN = -{ - Name -> "ML_BSSN_convertFromADMBase", + Name -> BSSN <> "_convertFromADMBase", Schedule -> {"AT initial AFTER ADMBase_PostInitial"}, ConditionalOnKeyword -> {"my_initial_data", "ADMBase"}, Shorthands -> {g[la,lb], detg, gu[ua,ub], em4phi, K[la,lb]}, @@ -263,12 +236,12 @@ convertFromADMBaseCalcBSSN = beta2 -> betay, beta3 -> betaz } -} +}; -convertFromADMBaseGammaCalcBSSN = +convertFromADMBaseGammaCalc = { - Name -> "ML_BSSN_convertFromADMBaseGamma", - Schedule -> {"AT initial AFTER ML_BSSN_convertFromADMBase"}, + Name -> BSSN <> "_convertFromADMBaseGamma", + Schedule -> {"AT initial AFTER " <> BSSN <> "_convertFromADMBase"}, ConditionalOnKeyword -> {"my_initial_data", "ADMBase"}, Where -> Interior, Shorthands -> {detgt, gtu[ua,ub], Gt[ua,lb,lc]}, @@ -289,7 +262,7 @@ convertFromADMBaseGammaCalcBSSN = B3 -> 1/ShiftGammaCoeff (dtbetaz - ShiftAdvectionCoeff beta[ua] PD[beta3,la]) } -} +}; (******************************************************************************) (* Convert to ADMBase *) @@ -297,39 +270,50 @@ convertFromADMBaseGammaCalcBSSN = convertToADMBaseCalc = { - Name -> "ML_ADM_convertToADMBase", - Schedule -> {"IN MoL_PostStep AFTER (ML_ADM_ApplyBCs ML_ADM_boundary)"}, + Name -> BSSN <> "_convertToADMBase", + Schedule -> {"IN MoL_PostStep AFTER (" <> BSSN <> "_ApplyBCs " <> BSSN <> "_enforce)"}, + ConditionalOnKeyword -> {"evolution_method", BSSN}, + Where -> Interior, + Shorthands -> {e4phi, g[la,lb], K[la,lb]}, Equations -> { - gxx -> g11, - gxy -> g12, - gxz -> g13, - gyy -> g22, - gyz -> g23, - gzz -> g33, - kxx -> K11, - kxy -> K12, - kxz -> K13, - kyy -> K22, - kyz -> K23, - kzz -> K33, - (* TODO: this is wrong; it sets dtalp and dtbeta^i incorrectly *) - alp -> alpha, - dtalp -> 0, - betax -> beta1, - betay -> beta2, - betaz -> beta3, - dtbetax -> 0, - dtbetay -> 0, - dtbetaz -> 0 + e4phi -> Exp [4 phi], + g[la,lb] -> e4phi gt[la,lb], + gxx -> g11, + gxy -> g12, + gxz -> g13, + gyy -> g22, + gyz -> g23, + gzz -> g33, + K[la,lb] -> e4phi At[la,lb] + (1/3) g[la,lb] trK, + kxx -> K11, + kxy -> K12, + kxz -> K13, + kyy -> K22, + kyz -> K23, + kzz -> K33, + alp -> alpha, + betax -> beta1, + betay -> beta2, + betaz -> beta3, + (* see RHS *) + dtalp -> - harmonicF alpha^harmonicN + ((1 - LapseAdvectionCoeff) A + LapseAdvectionCoeff trK) + + LapseAdvectionCoeff beta[ua] PD[alpha,la], + dtbetax -> + ShiftGammaCoeff B1 + + ShiftAdvectionCoeff beta[ub] PD[beta[ua],lb], + dtbetay -> + ShiftGammaCoeff B2 + + ShiftAdvectionCoeff beta[ub] PD[beta[ua],lb], + dtbetaz -> + ShiftGammaCoeff B3 + + ShiftAdvectionCoeff beta[ub] PD[beta[ua],lb] } -} +}; -convertToADMBaseCalcBSSN = +convertToADMBaseLapseShiftCalc = { - Name -> "ML_BSSN_convertToADMBase", - Schedule -> {"IN MoL_PostStep AFTER (ML_BSSN_ApplyBCs ML_BSSN_boundary ML_BSSN_enforce)"}, - ConditionalOnKeyword -> {"evolution_method", "ML_BSSN"}, + Name -> BSSN <> "_convertToADMBase", + Schedule -> {"IN MoL_PostStep AFTER (" <> BSSN <> "_ApplyBCs " <> BSSN <> "_enforce)"}, + ConditionalOnKeyword -> {"evolution_method", BSSN}, Where -> Interior, Shorthands -> {e4phi, g[la,lb], K[la,lb]}, Equations -> @@ -364,12 +348,12 @@ convertToADMBaseCalcBSSN = dtbetaz -> + ShiftGammaCoeff B3 + ShiftAdvectionCoeff beta[ub] PD[beta[ua],lb] } -} +}; -boundaryCalcADMBaseBSSN = +boundaryCalcADMBase = { - Name -> "ML_BSSN_ADMBaseBoundary", - Schedule -> {"IN MoL_PostStep AFTER ML_BSSN_convertToADMBase"}, + Name -> BSSN <> "_ADMBaseBoundary", + Schedule -> {"IN MoL_PostStep AFTER " <> BSSN <> "_convertToADMBase"}, ConditionalOnKeyword -> {"my_boundary_condition", "Minkowski"}, Where -> BoundaryWithGhosts, Equations -> @@ -395,7 +379,7 @@ boundaryCalcADMBaseBSSN = dtbetay -> 0, dtbetaz -> 0 } -} +}; (******************************************************************************) (* Evolution equations *) @@ -403,36 +387,8 @@ boundaryCalcADMBaseBSSN = evolCalc = { - Name -> "ML_ADM_RHS", - Schedule -> {"IN MoL_CalcRHS", "AT analysis"}, - Where -> Interior, - Shorthands -> {detg, gu[ua,ub], G[ua,lb,lc], R[la,lb], Km[ua,lb], trK}, - Equations -> - { - detg -> detgExpr, - gu[ua,ub] -> 1/detg detgExpr MatrixInverse [g[ua,ub]], - G[ua,lb,lc] -> 1/2 gu[ua,ud] - (PD[g[lb,ld],lc] + PD[g[lc,ld],lb] - PD[g[lb,lc],ld]), - R[la,lb] -> G[u1,l2,la] G[u2,l1,lb] - G[u1,la,lb] G[u2,l1,l2] - + 1/2 gu[u1,u2] (- PD[g[l1,l2],la,lb] + PD[g[l1,la],l2,lb] - - PD[g[la,lb],l1,l2] + PD[g[l2,lb],l1,la]), - Km[ua,lb] -> gu[ua,uc] K[lc,lb], - trK -> Km[ua,la], - - dot[g[la,lb]] -> -2 alpha K[la,lb] - + Lie[g[la,lb], beta], - dot[K[la,lb]] -> - CD[alpha,la,lb] - + alpha (+ R[la,lb] + K[la,lb] trK - 2 K[la,lc] Km[uc,lb]) - + Lie[K[la,lb], beta], - dot[alpha] -> 0, - dot[beta[ua]] -> 0 - } -} - -evolCalcBSSN = -{ - Name -> "ML_BSSN_RHS", - Schedule -> {"IN ML_BSSN_evolCalcGroup"}, + Name -> BSSN <> "_RHS", + Schedule -> {"IN " <> BSSN <> "_evolCalcGroup"}, Where -> Interior, Shorthands -> {detgt, ddetgt[la], gtu[ua,ub], dgtu[ua,ub,lc], ddgtu[ua,ub,lc,ld], Gt[ua,lb,lc], @@ -468,16 +424,7 @@ evolCalcBSSN = + gtu[ul,um] (+ Gt[uk,ll,li] gt[lj,ln] Gt[un,lk,lm] + Gt[uk,ll,lj] gt[li,ln] Gt[un,lk,lm] + Gt[uk,li,lm] gt[lk,ln] Gt[un,ll,lj]), -(* Rt[li,lj] -> (1/2) (- gtu[ul,um] PD[gt[li,lj],ll,lm] - + gt[lk,li] PD[Xt[uk],lj] + - + gt[lk,lj] PD[Xt[uk],li] - + Xtn[uk] gt[li,ln] Gt[un,lj,lk] - + Xtn[uk] gt[lj,ln] Gt[un,li,lk]) - + gtu[ul,um] (+ Gt[uk,ll,li] gt[lj,ln] Gt[un,lk,lm] - + Gt[uk,ll,lj] gt[li,ln] Gt[un,lk,lm] - + Gt[uk,li,lm] gt[lk,ln] Gt[un,ll,lj]), *) (* PRD 62, 044034 (2000), eqn. (15) *) - (* TODO: Check that CDt takes the tensor weight of phi into account *) Rphi[li,lj] -> - 2 CDt[phi,lj,li] - 2 gt[li,lj] gtu[ul,un] CDt[phi,ll,ln] + 4 CDt[phi,li] CDt[phi,lj] @@ -492,10 +439,6 @@ evolCalcBSSN = detg -> detgExpr, (* gu[ua,ub] -> 1/detg detgExpr MatrixInverse [g[ua,ub]], *) gu[ua,ub] -> em4phi gtu[ua,ub], -(* ddetg[la] -> 12 detg PD[phi,la], - G[ua,lb,lc] -> Gt[ua,lb,lc] - + 1/(6 detg) (KD[ua,lb] ddetg[lc] + KD[ua,lc] ddetg[lb] - - gtu[ua,ud] gt[lb,lc] ddetg[ld]), *) G[ua,lb,lc] -> Gt[ua,lb,lc] + 2 (KD[ua,lb] PD[phi,lc] + KD[ua,lc] PD[phi,lb] - gtu[ua,ud] gt[lb,lc] PD[phi,ld]), @@ -535,18 +478,6 @@ evolCalcBSSN = dot[gt[la,lb]] -> - 2 alpha At[la,lb] + Lie[gt[la,lb], beta] - (2/3) gt[la,lb] PD[beta[uc],lc], (* PRD 62, 044034 (2000), eqn. (20) *) -(* dot[Xt[ui]] -> - 2 Atu[ui,uj] PD[alpha,lj] - + 2 alpha (+ Gt[ui,lj,lk] Atu[uk,uj] - - (2/3) gtu[ui,uj] PD[trK,lj] - + 6 Atu[ui,uj] PD[phi,lj]) - - (+ (+ PD[beta[ul],lj] dgtu[ui,uj,ll] - + beta[ul] ddgtu[ui,uj,ll,lj]) - - 2 (+ dgtu[um,uj,lj] PD[beta[ui],lm] - + dgtu[um,ui,lj] PD[beta[uj],lm] - + gtu[um,uj] PD[beta[ui],lm,lj] - + gtu[um,ui] PD[beta[uj],lm,lj]) - + (2/3) (+ dgtu[ui,uj,lj] PD[beta[ul],ll] - + gtu[ui,uj] PD[beta[ul],ll,lj])), *) (* PRD 67 084023 (2003), eqn (26) *) dot[Xt[ui]] -> - 2 Atu[ui,uj] PD[alpha,lj] + 2 alpha (+ Gt[ui,lj,lk] Atu[uk,uj] @@ -566,7 +497,7 @@ evolCalcBSSN = + Lie[trK, beta] (* Equation (4.21) in Baumgarte & Shapiro (Phys. Rept. 376 (2003) 41-131) *) + addMatter (4 pi alpha (rho + trS)), - + (* PRD 62, 044034 (2000), eqn. (12) *) (* TODO: use Hamiltonian constraint to make tracefree *) Ats[la,lb] -> - CD[alpha,la,lb] + alpha R[la,lb], @@ -583,8 +514,6 @@ evolCalcBSSN = dot[alpha] -> - harmonicF alpha^harmonicN ( (1 - LapseAdvectionCoeff) A + LapseAdvectionCoeff trK) + LapseAdvectionCoeff beta[ua] PD[alpha,la], - (* TODO: is the above Lie derivative correct? *) - dot[A] -> (1 - LapseAdvectionCoeff) (dot[trK] - AlphaDriver A), (* dot[beta[ua]] -> eta Xt[ua], *) (* dot[beta[ua]] -> ShiftGammaCoeff alpha^ShiftAlphaPower B[ua], *) @@ -595,15 +524,50 @@ evolCalcBSSN = dot[B[ua]] -> + dot[Xt[ua]] - BetaDriver B[ua] + ShiftAdvectionCoeff beta[ub] (+ PD[B[ua],lb] - PD[Xt[ua],lb]) - (* TODO: is there a Lie derivative of the shift missing? *) } -} +}; -enforceCalcBSSN = +RHSBoundaryCalc = { - Name -> "ML_BSSN_enforce", - Schedule -> {"IN MoL_PostStep BEFORE ML_BSSN_BoundConds"}, - ConditionalOnKeyword -> {"evolution_method", "ML_BSSN"}, + Name -> BSSN <> "_RHSBoundary", + Schedule -> {"IN MoL_RHSBoundaries"}, + ConditionalOnKeyword -> {"my_rhs_boundary_condition", "radiative"}, + Where -> Boundary, + Shorthands -> {detgt, gtu[ua,ub], em4phi, gu[ua,ub], + nn[la], nu[ua], nlen, nlen2, su[ua], + vg}, + Equations -> + { + detgt -> 1 (* detgtExpr *), + gtu[ua,ub] -> 1/detgt detgtExpr MatrixInverse [gt[ua,ub]], + em4phi -> Exp [-4 phi], + gu[ua,ub] -> em4phi gtu[ua,ub], + + nn[la] -> normal[la], + nu[ua] -> gu[ua,ub] nn[lb], + nlen2 -> nu[ua] nn[la], + nlen -> Sqrt [nlen2], + su[ua] -> nu[ua] / nlen, + + vg -> Sqrt[harmonicF], + + dot[phi] -> - vg su[uc] PDMinus[phi ,lc], + dot[gt[la,lb]] -> - su[uc] PDMinus[gt[la,lb],lc], + dot[trK] -> - vg su[uc] PDMinus[trK ,lc], + dot[At[la,lb]] -> - su[uc] PDMinus[At[la,lb],lc], + dot[Xt[ua]] -> - su[uc] PDMinus[Xt[ua] ,lc], + dot[alpha] -> - vg su[uc] PDMinus[alpha ,lc], + dot[A] -> - vg su[uc] PDMinus[A ,lc], + dot[beta[ua]] -> - su[uc] PDMinus[beta[ua] ,lc], + dot[B[ua]] -> - su[uc] PDMinus[B[ua] ,lc] + } +}; + +enforceCalc = +{ + Name -> BSSN <> "_enforce", + Schedule -> {"IN MoL_PostStep BEFORE " <> BSSN <> "_BoundConds"}, + ConditionalOnKeyword -> {"evolution_method", BSSN}, Shorthands -> {detgt, gtu[ua,ub], trAt}, Equations -> { @@ -616,7 +580,7 @@ enforceCalcBSSN = alpha -> Max[alpha, 10^(-10)] *) } -} +}; (******************************************************************************) (* Boundary conditions *) @@ -624,22 +588,7 @@ enforceCalcBSSN = boundaryCalc = { - Name -> "ML_ADM_boundary", - Schedule -> {"IN MoL_PostStep"}, - ConditionalOnKeyword -> {"my_boundary_condition", "Minkowski"}, - Where -> BoundaryWithGhosts, - Equations -> - { - g[la,lb] -> KD[la,lb], - K[la,lb] -> 0, - alpha -> 1, - beta[ua] -> 0 - } -} - -boundaryCalcBSSN = -{ - Name -> "ML_BSSN_boundary", + Name -> BSSN <> "_boundary", Schedule -> {"IN MoL_PostStep"}, ConditionalOnKeyword -> {"my_boundary_condition", "Minkowski"}, Where -> BoundaryWithGhosts, @@ -655,7 +604,7 @@ boundaryCalcBSSN = beta[ua] -> 0, B[ua] -> 0 } -} +}; (******************************************************************************) (* Constraint equations *) @@ -663,46 +612,8 @@ boundaryCalcBSSN = constraintsCalc = { - Name -> "ML_ADM_constraints", - Schedule -> {"AT analysis"}, - TriggerGroups -> {"Ham", "mom"}, - Where -> Interior, - Shorthands -> {detg, gu[ua,ub], G[ua,lb,lc], R[la,lb], trR, Km[ua,lb], trK}, - Equations -> - { - detg -> detgExpr, - gu[ua,ub] -> 1/detg detgExpr MatrixInverse[g[ua,ub]], - G[ua,lb,lc] -> 1/2 gu[ua,ud] - (PD[g[lb,ld],lc] + PD[g[lc,ld],lb] - PD[g[lb,lc],ld]), - R[la,lb] -> G[u1,l2,la] G[l1,lb,u2] - G[u1,la,lb] G[l1,l2,u2] - + 1/2 gu[u1,u2] (- PD[g[l1,l2],la,lb] + PD[g[l1,la],l2,lb] - - PD[g[la,lb],l1,l2] + PD[g[l2,lb],l1,la]), - trR -> R[la,lb] gu[ua,ub], - Km[ua,lb] -> gu[ua,uc] K[lc,lb], - trK -> Km[ua,la], - - H -> trR - Km[ua,lb] Km[ub,la] + trK^2, - M[la] -> gu[ub,uc] (CD[K[lc,la], lb] - CD[K[lc,lb], la]) - } -} - -constraintsBoundaryCalc = -{ - Name -> "ML_ADM_constraints_boundary", - Schedule -> {"AT analysis AFTER ML_ADM_constraints"}, - (* TriggerGroups -> {"Ham", "mom"}, *) - Where -> BoundaryWithGhosts, - Equations -> - { - H -> 0, - M[la] -> 0 - } -} - -constraintsCalcBSSN = -{ - Name -> "ML_BSSN_constraints", - Schedule -> {"IN ML_BSSN_constraintsCalcGroup"}, + Name -> BSSN <> "_constraints", + Schedule -> {"IN " <> BSSN <> "_constraintsCalcGroup"}, Where -> Interior, Shorthands -> {detgt, ddetgt[la], gtu[ua,ub], Gt[ua,lb,lc], e4phi, em4phi, g[la,lb], detg, gu[ua,ub], ddetg[la], G[ua,lb,lc], @@ -824,25 +735,28 @@ constraintsCalcBSSN = (* trace A-tilde *) cA -> gtu[ua,ub] At[la,lb] } -} +}; -constraintsBoundaryCalcBSSN = +constraintsBoundaryCalc = { - Name -> "ML_BSSN_constraints_boundary", - Schedule -> {"IN ML_BSSN_constraintsCalcGroup AFTER ML_BSSN_constraints"}, + Name -> BSSN <> "_constraints_boundary", + Schedule -> {"IN " <> BSSN <> "_constraintsCalcGroup AFTER " <> BSSN <> "_constraints"}, Where -> BoundaryWithGhosts, Equations -> { H -> 0, M[la] -> 0 } -} +}; (******************************************************************************) (* Implementations *) (******************************************************************************) -inheritedImplementations = {"ADMBase", "TmunuBase"}; +inheritedImplementations = + Join[{"ADMBase"}, + If [addMatter!=0, {"TmunuBase"}, {}], + If [useGlobalDerivs, {"Coordinates"}, {}]]; (******************************************************************************) (* Parameters *) @@ -854,15 +768,15 @@ extendedKeywordParameters = { { Name -> "ADMBase::evolution_method", - AllowedValues -> {"ML_BSSN"} + AllowedValues -> {BSSN} }, { Name -> "ADMBase::lapse_evolution_method", - AllowedValues -> {"ML_BSSN"} + AllowedValues -> {BSSN} }, { Name -> "ADMBase::shift_evolution_method", - AllowedValues -> {"ML_BSSN"} + AllowedValues -> {BSSN} } }; @@ -876,6 +790,13 @@ keywordParameters = Default -> "ADMBase" }, { + Name -> "my_rhs_boundary_condition", + (* Visibility -> "restricted", *) + (* Description -> "ddd", *) + AllowedValues -> {"none", "radiative"}, + Default -> "none" + }, + { Name -> "my_boundary_condition", (* Visibility -> "restricted", *) (* Description -> "ddd", *) @@ -933,18 +854,22 @@ realParameters = (* Construct the thorns *) (******************************************************************************) -calculations = +calculations = { initialCalc, convertFromADMBaseCalc, + convertFromADMBaseGammaCalc, evolCalc, + RHSBoundaryCalc, + enforceCalc, boundaryCalc, convertToADMBaseCalc, + boundaryCalcADMBase, constraintsCalc, constraintsBoundaryCalc }; -CreateKrancThornTT [groups, ".", "ML_ADM", +CreateKrancThornTT [groups, ".", BSSN, Calculations -> calculations, DeclaredGroups -> declaredGroupNames, PartialDerivatives -> derivatives, @@ -952,33 +877,26 @@ CreateKrancThornTT [groups, ".", "ML_ADM", UseLoopControl -> True, InheritedImplementations -> inheritedImplementations, InheritedKeywordParameters -> inheritedKeywordParameters, - KeywordParameters -> keywordParameters -]; - -calculationsBSSN = -{ - initialCalcBSSN, - convertFromADMBaseCalcBSSN, - convertFromADMBaseGammaCalcBSSN, - evolCalcBSSN, - enforceCalcBSSN, - boundaryCalcBSSN, - convertToADMBaseCalcBSSN, - boundaryCalcADMBaseBSSN, - constraintsCalcBSSN, - constraintsBoundaryCalcBSSN -}; - -CreateKrancThornTT [groupsBSSN, ".", "ML_BSSN", - Calculations -> calculationsBSSN, - DeclaredGroups -> declaredGroupNamesBSSN, - PartialDerivatives -> derivatives, - EvolutionTimelevels -> evolutionTimelevels, - UseLoopControl -> True, - InheritedImplementations -> inheritedImplementations, - InheritedKeywordParameters -> inheritedKeywordParameters, ExtendedKeywordParameters -> extendedKeywordParameters, KeywordParameters -> keywordParameters, IntParameters -> intParameters, RealParameters -> realParameters ]; + +]; + + + +(******************************************************************************) +(* Options *) +(******************************************************************************) + +(* derivative order: 2, 4, 6, 8, ... *) +(* useGlobalDerivs: False or True *) +(* timelevels: 2 or 3 + (keep this at 3; this is better chosen with a run-time parameter) *) +(* matter: 0 or 1 + (matter seems cheap; it should be always enabled) *) + +createCode[4, False, 3, 1]; +createCode[4, True, 3, 1]; diff --git a/m/WaveToy.m b/m/WaveToy.m index 481080e..a00df0f 100644 --- a/m/WaveToy.m +++ b/m/WaveToy.m @@ -1,5 +1,5 @@ -$Path = Join[$Path, {"~/Calpha/Kranc/Tools/CodeGen", - "~/Calpha/Kranc/Tools/MathematicaMisc"}]; +$Path = Join[$Path, {"~/Calpha/kranc/Tools/CodeGen", + "~/Calpha/kranc/Tools/MathematicaMisc"}]; Get["KrancThorn`"]; @@ -43,7 +43,7 @@ PDglob[var_,lx_] := Jinv[u1,lx] PDloc[var,l1]; PDglob[var_,lx_,ly_] := dJinv[u1,lx,ly] PDloc[var,l1] + Jinv[u1,lx] Jinv[u2,ly] PDloc[var,l1,l2]; -UseGlobalDerivs = True; +UseGlobalDerivs = False; PD := If [UseGlobalDerivs, PDglob, PDloc]; (* timelevels *) diff --git a/par/ks_bssn_evol.par b/par/ks_bssn_evol.par index 66660ec..fe2531d 100644 --- a/par/ks_bssn_evol.par +++ b/par/ks_bssn_evol.par @@ -64,11 +64,11 @@ IOScalar::outScalar_vars = " ADMBase::curv ADMBase::lapse ADMBase::shift - ML_BSSN::Ham - ML_BSSN::mom - ML_BSSN::cons_detg - ML_BSSN::cons_Gamma - ML_BSSN::cons_traceA + ML_BSSN::ML_Ham + ML_BSSN::ML_mom + ML_BSSN::ML_cons_detg + ML_BSSN::ML_cons_Gamma + ML_BSSN::ML_cons_traceA " # ML_BSSN::ML_log_confac # ML_BSSN::ML_metric @@ -119,11 +119,11 @@ IOASCII::out1D_vars = " ADMBase::curv ADMBase::lapse ADMBase::shift - ML_BSSN::Ham - ML_BSSN::mom - ML_BSSN::cons_detg - ML_BSSN::cons_Gamma - ML_BSSN::cons_traceA + ML_BSSN::ML_Ham + ML_BSSN::ML_mom + ML_BSSN::ML_cons_detg + ML_BSSN::ML_cons_Gamma + ML_BSSN::ML_cons_traceA IsolatedHorizon::ih_shapes IsolatedHorizon::ih_newman_penrose IsolatedHorizon::ih_weyl_scalars @@ -254,6 +254,8 @@ ADMBase::evolution_method = "ML_BSSN" ADMBase::lapse_evolution_method = "ML_BSSN" ADMBase::shift_evolution_method = "ML_BSSN" +ML_BSSN_MP_O2::timelevels = 2 + ML_BSSN::my_boundary_condition = "Minkowski" ML_BSSN::harmonicN = 1 # 1+log @@ -261,15 +263,15 @@ ML_BSSN::harmonicF = 2.0 # 1+log ML_BSSN::ShiftGammaCoeff = 0.75 ML_BSSN::BetaDriver = 0.5 -#ML_BSSN::ML_log_confac_bound = "radiative" -#ML_BSSN::ML_metric_bound = "radiative" -#ML_BSSN::ML_Gamma_bound = "radiative" -#ML_BSSN::ML_trace_curv_bound = "radiative" -#ML_BSSN::ML_curv_bound = "radiative" -#ML_BSSN::ML_lapse_bound = "radiative" -#ML_BSSN::ML_dtlapse_bound = "radiative" -#ML_BSSN::ML_shift_bound = "radiative" -#ML_BSSN::ML_dtshift_bound = "radiative" +ML_BSSN::ML_log_confac_bound = "none" +ML_BSSN::ML_metric_bound = "none" +ML_BSSN::ML_Gamma_bound = "none" +ML_BSSN::ML_trace_curv_bound = "none" +ML_BSSN::ML_curv_bound = "none" +ML_BSSN::ML_lapse_bound = "none" +ML_BSSN::ML_dtlapse_bound = "none" +ML_BSSN::ML_shift_bound = "none" +ML_BSSN::ML_dtshift_bound = "none" #--- Dissipation diff --git a/par/m_bssn.par b/par/m_bssn.par index 61616fc..f32af64 100644 --- a/par/m_bssn.par +++ b/par/m_bssn.par @@ -1,11 +1,12 @@ ActiveThorns = " Boundary CartGrid3D CoordBase IOUtil InitBase MoL SymBase - ADMBase + ADMBase ADMCoupling ADMMacros StaticConformal + TmunuBase NaNChecker Carpet CarpetIOASCII CarpetIOBasic CarpetIOScalar CarpetLib CarpetReduce LoopControl Formaline GSL GenericFD - ML_BSSN + ML_BSSN ML_BSSN_Helper " @@ -51,11 +52,11 @@ IOScalar::outScalar_vars = " ML_BSSN::cons_detg ML_BSSN::cons_Gamma ML_BSSN::cons_traceA - ML_BSSN::log_confacrhs - ML_BSSN::metricrhs - ML_BSSN::Gammarhs - ML_BSSN::trace_curvrhs - ML_BSSN::curvrhs + ML_BSSN::ML_log_confacrhs + ML_BSSN::ML_metricrhs + ML_BSSN::ML_Gammarhs + ML_BSSN::ML_trace_curvrhs + ML_BSSN::ML_curvrhs " IOASCII::out1D_every = 1 @@ -65,9 +66,9 @@ IOASCII::out1D_vars = " ML_BSSN::cons_detg ML_BSSN::cons_Gamma ML_BSSN::cons_traceA - ML_BSSN::log_confacrhs - ML_BSSN::metricrhs - ML_BSSN::Gammarhs - ML_BSSN::trace_curvrhs - ML_BSSN::curvrhs + ML_BSSN::ML_log_confacrhs + ML_BSSN::ML_metricrhs + ML_BSSN::ML_Gammarhs + ML_BSSN::ML_trace_curvrhs + ML_BSSN::ML_curvrhs " |