Skip to content

Commit

Permalink
TestRKAB fixed parameters for the standing wave evolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Sanches committed Oct 18, 2024
1 parent b9acfca commit 2ad092a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 90 deletions.
8 changes: 4 additions & 4 deletions TestRKAB/par/gaussian.par
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ActiveThorns = "

###### Settings ######
$final_time = 10.0
$out_every_time = 0.5
$out_every_time = 0.25

$start = -1.0
$end = 1.0
Expand All @@ -19,11 +19,11 @@ $cfl = 0.25
$dx = ($end - $start)/$ncells
$dt = $cfl * $dx

$itlast = $final_time / $dt
$out_every_it = $out_every_time / $dt
$itlast = ceil($final_time / $dt)
$out_every_it = ceil($out_every_time / $dt)

TestRKAB::initial_condition = "Gaussian"
TestRKAB::gaussian_width = 0.17677669529 # sqrt(2)*W = 0.25
TestRKAB::gaussian_width = $cfl / sqrt(2)

CarpetX::poison_undefined_values = no
CarpetX::verbose = no
Expand Down
42 changes: 26 additions & 16 deletions TestRKAB/par/standing.par
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,48 @@ ActiveThorns = "

###### Settings ######
$final_time = 10.0
$out_every_time = 0.5

$start = -1.0
$end = 1.0
$out_every_time = 0.25

$ncells = 80
$cfl = 0.25

$num_waves = 1
######################

$dx = ($end - $start)/$ncells
# We are using a 5 point centered stencil
$ghost_size = 2

# Make sure that the distance between the leftmost ghost and the right boundary is 2 pi
$boundary = ($ncells * $pi) / ($ncells + $ghost_size)

# Make sure that we fit one period in between the boundaries
$wave_k = ($ncells + $ghost_size) * (2.0 * $num_waves - 1.0) / (2.0 * $ncells * $pi)

$dx = 2.0 * $boundary / $ncells
$dt = $cfl * $dx

$itlast = $final_time / $dt
$out_every_it = $out_every_time / $dt
$itlast = ceil($final_time / $dt)
$out_every_it = ceil($out_every_time / $dt)

TestRKAB::initial_condition = "standing wave"
TestRKAB::amplitude = 1.0
TestRKAB::standing_wave_kx = 0.75
TestRKAB::standing_wave_ky = 0.75
TestRKAB::standing_wave_kz = 0.75
TestRKAB::standing_wave_kx = $wave_k
TestRKAB::standing_wave_ky = $wave_k
TestRKAB::standing_wave_kz = $wave_k

CarpetX::poison_undefined_values = no
CarpetX::verbose = no

Cactus::cctk_show_schedule = yes
Cactus::presync_mode = "mixed-error"

CarpetX::xmin = $start
CarpetX::ymin = $start
CarpetX::zmin = $start
CarpetX::xmin = -$boundary
CarpetX::ymin = -$boundary
CarpetX::zmin = -$boundary

CarpetX::xmax = $end
CarpetX::ymax = $end
CarpetX::zmax = $end
CarpetX::xmax = $boundary
CarpetX::ymax = $boundary
CarpetX::zmax = $boundary

CarpetX::ncells_x = $ncells
CarpetX::ncells_y = $ncells
Expand All @@ -51,6 +59,8 @@ CarpetX::periodic_x = yes
CarpetX::periodic_y = yes
CarpetX::periodic_z = yes

CarpetX::ghost_size = $ghost_size

CarpetX::dtfac = $cfl

CarpetX::blocking_factor_x = 1
Expand Down
64 changes: 0 additions & 64 deletions TestRKAB/par/time.par

This file was deleted.

7 changes: 1 addition & 6 deletions TestRKAB/src/testrkab.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <cstddef>
#include <iterator>
#include <loop_device.hxx>

#include <sum.hxx>
Expand All @@ -9,9 +7,6 @@
#include <cctk_Arguments.h>
#include <cctk_Parameters.h>

#include <array>
#include <cassert>
#include <cmath>
#include <limits>

#include "standing_wave.hxx"
Expand All @@ -30,7 +25,7 @@ static inline auto fd_c_1_4(const Loop::PointDesc &p,
const auto num{gf(p.I - 2 * p.DI[d]) - 8.0 * gf(p.I - 1 * p.DI[d]) +
8.0 * gf(p.I + 1 * p.DI[d]) - 1.0 * gf(p.I + 2 * p.DI[d])};
const auto den{1.0 / (12.0 * p.DX[d])};
return den * num;
return num * den;
}

// Scheduled functions
Expand Down

0 comments on commit 2ad092a

Please sign in to comment.