aboutsummaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2010-09-23 17:28:46 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2010-09-23 17:28:46 +0200
commit7d98be4ac485a53a03e9a2170f551e5905610fe4 (patch)
tree8a4eb7199fa089b534451a1d0ca757651e54a8e4 /Examples
parentb6ba7a8f6df740f658a05e25bec698d3fcee21c1 (diff)
Examples: Add SimpleWave example
Diffstat (limited to 'Examples')
-rw-r--r--Examples/SimpleWave.m39
-rw-r--r--Examples/simplewave_sine.par110
2 files changed, 149 insertions, 0 deletions
diff --git a/Examples/SimpleWave.m b/Examples/SimpleWave.m
new file mode 100644
index 0000000..1fbee69
--- /dev/null
+++ b/Examples/SimpleWave.m
@@ -0,0 +1,39 @@
+<< "KrancThorn.m";
+
+groups = {{"evolved_group", {phi, pi}}};
+
+derivatives =
+{
+ PDstandard2nd[i_] -> StandardCenteredDifferenceOperator[1,1,i],
+ PDstandard2nd[i_, i_] -> StandardCenteredDifferenceOperator[2,1,i]
+};
+
+PD = PDstandard2nd;
+
+initialSineCalc =
+{
+ Name -> "initial_sine",
+ Schedule -> {"AT INITIAL"},
+ Equations ->
+ {
+ phi -> Sin[2 Pi (x - t)],
+ pi -> -2 Pi Cos[2 Pi (x - t)]
+ }
+};
+
+evolveCalc =
+{
+ Name -> "calc_rhs",
+ Schedule -> {"in MoL_CalcRHS"},
+ Equations ->
+ {
+ dot[phi] -> pi,
+ dot[pi] -> Euc[ui,uj] PD[phi,li,lj]
+ }
+};
+
+CreateKrancThornTT[groups, ".",
+ "SimpleWave",
+ Calculations -> {initialSineCalc, evolveCalc},
+ PartialDerivatives -> derivatives,
+ DeclaredGroups -> {"evolved_group"}];
diff --git a/Examples/simplewave_sine.par b/Examples/simplewave_sine.par
new file mode 100644
index 0000000..f552f0f
--- /dev/null
+++ b/Examples/simplewave_sine.par
@@ -0,0 +1,110 @@
+#!/usr/bin/perl -W
+
+ActiveThorns = "
+Boundary
+Carpet
+CarpetIOASCII
+CarpetIOBasic
+CarpetIOScalar
+CarpetLib
+CarpetReduce
+CarpetSlab
+CartGrid3d
+CoordBase
+GenericFD
+IOUtil
+LoopControl
+MoL
+NanChecker
+Periodic
+SimpleWave
+Slab
+SymBase
+Time
+"
+
+#############################################################
+# Grid
+#############################################################
+
+CoordBase::domainsize = minmax
+
+CoordBase::xmin = 0
+CoordBase::ymin = 0
+CoordBase::zmin = 0
+
+CoordBase::xmax = 1
+CoordBase::ymax = 0.1
+CoordBase::zmax = 0.1
+
+CoordBase::dx = 0.05
+CoordBase::dy = 0.1
+CoordBase::dz = 0.1
+
+CoordBase::boundary_size_x_lower = 1
+CoordBase::boundary_size_y_lower = 1
+CoordBase::boundary_size_z_lower = 1
+CoordBase::boundary_shiftout_x_lower = 1
+CoordBase::boundary_shiftout_y_lower = 1
+CoordBase::boundary_shiftout_z_lower = 1
+
+CoordBase::boundary_size_x_upper = 1
+CoordBase::boundary_size_y_upper = 1
+CoordBase::boundary_size_z_upper = 1
+CoordBase::boundary_shiftout_x_upper = 0
+CoordBase::boundary_shiftout_y_upper = 0
+CoordBase::boundary_shiftout_z_upper = 0
+
+CartGrid3D::type = "coordbase"
+CartGrid3D::domain = "full"
+CartGrid3D::avoid_origin = "no"
+
+Periodic::periodic = "yes"
+
+#############################################################
+# Carpet
+#############################################################
+
+Carpet::ghost_size = 1
+Carpet::domain_from_coordbase = "yes"
+Carpet::max_refinement_levels = 1
+#Carpet::init_each_timelevel = "yes"
+Carpet::num_integrator_substeps = 4
+
+#############################################################
+# Time integration
+#############################################################
+
+Cactus::terminate = "time"
+Cactus::cctk_final_time = 1
+
+Time::dtfac = 0.5
+MethodOfLines::ode_method = "RK4"
+MethodOfLines::MoL_Intermediate_Steps = 4
+MethodOfLines::MoL_Num_Scratch_Levels = 1
+MethodOfLines::MoL_NaN_Check = "yes"
+
+#############################################################
+# Boundary conditions
+#############################################################
+
+SimpleWave::evolved_group_bound = "none"
+
+#############################################################
+# Output
+#############################################################
+
+IO::out_dir = $parfile
+IO::out_fileinfo = "all"
+
+CarpetIOBasic::outInfo_every = 1
+CarpetIOBasic::outInfo_vars = "SimpleWave::phi"
+
+IOASCII::out1D_every = 1
+IOASCII::out1D_x = "yes"
+IOASCII::out1D_y = "yes"
+IOASCII::out1D_z = "yes"
+IOASCII::out1D_vars = "SimpleWave::phi SimpleWave::pi"
+
+CarpetIOASCII::out_precision = 19
+CarpetIOASCII::out3D_ghosts = "yes"