From 7d98be4ac485a53a03e9a2170f551e5905610fe4 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Thu, 23 Sep 2010 17:28:46 +0200 Subject: Examples: Add SimpleWave example --- Examples/SimpleWave.m | 39 +++++++++++++++ Examples/simplewave_sine.par | 110 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 Examples/SimpleWave.m create mode 100644 Examples/simplewave_sine.par (limited to 'Examples') 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" -- cgit v1.2.3