Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewRadX: Prevent NewRadX from being applied at symmetry boundaries #39

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NewRadX/configuration.ccl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration definition for thorn NewRadX

REQUIRES Loop
REQUIRES CarpetX Loop

PROVIDES NewRadX
{
Expand Down
1 change: 1 addition & 0 deletions NewRadX/interface.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

IMPLEMENTS: NewRadX

USES INCLUDE HEADER: driver.hxx
USES INCLUDE HEADER: loop_device.hxx

INCLUDE HEADER: newradx.hxx in newradx.hxx
25 changes: 20 additions & 5 deletions NewRadX/src/newradx.cxx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include "newradx.hxx"
#include "loop.hxx"
#include "loop_device.hxx"
#include <cctk.h>
#include <cctk_Arguments_Checked.h>
#include <cmath>
#include "loop.hxx"
#include "loop_device.hxx"
#include "driver.hxx"
#include "newradx.hxx"

namespace NewRadX {

Expand Down Expand Up @@ -109,10 +110,24 @@ void NewRadX_Apply(const cGH *restrict const cctkGH,
assert(0);
};

const auto symmetries = CarpetX::ghext->patchdata.at(cctk_patch).symmetries;
const vect<vect<bool, Loop::dim>, 2> is_sym_bnd {
{
symmetries[0][0] != CarpetX::symmetry_t::none,
symmetries[0][1] != CarpetX::symmetry_t::none,
symmetries[0][2] != CarpetX::symmetry_t::none
},
{
symmetries[1][0] != CarpetX::symmetry_t::none,
symmetries[1][1] != CarpetX::symmetry_t::none,
symmetries[1][2] != CarpetX::symmetry_t::none
}
};

const Loop::GridDescBaseDevice grid(cctkGH);
grid.loop_outermost_int_device<0, 0, 0>(
grid.nghostzones,
[=] CCTK_DEVICE CCTK_HOST(const Loop::PointDesc &p)
grid.nghostzones, is_sym_bnd,
[=] CCTK_DEVICE(const Loop::PointDesc &p)
CCTK_ATTRIBUTE_ALWAYS_INLINE {
// The main part of the boundary condition assumes that we have an
// outgoing radial wave with some speed v0:
Expand Down
42 changes: 25 additions & 17 deletions TestNewRadX/test/scalarwave_newradx.par
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,66 @@ ActiveThorns = "
"

$nlevels = 1
$ncells = 30
$ncells = 20
$blocking_factor = 2

Cactus::cctk_show_schedule = "yes"
Cactus::cctk_full_warnings = "yes"

Cactus::presync_mode = "mixed-error"

Cactus::terminate = "time"
Cactus::cctk_final_time = 20
Cactus::terminate = "iteration"
Cactus::cctk_itlast = 30

CarpetX::ghost_size = 3
CarpetX::prolongation_type = "ddf"
CarpetX::prolongation_order = 1
CarpetX::verbose = no

CarpetX::xmin = -10 # + 0.123456789
CarpetX::ymin = -10 # + 0.223456789
CarpetX::zmin = -10 # + 0.323456789
CarpetX::xmax = +10 # + 0.123456789
CarpetX::ymax = +10 # + 0.223456789
CarpetX::zmax = +10 # + 0.323456789
CarpetX::xmin = -10
CarpetX::ymin = -10
CarpetX::zmin = 0
CarpetX::xmax = +10
CarpetX::ymax = +10
CarpetX::zmax = +10

CarpetX::ncells_x = $ncells
CarpetX::ncells_y = $ncells
CarpetX::ncells_x = $ncells * 2
CarpetX::ncells_y = $ncells * 2
CarpetX::ncells_z = $ncells

CarpetX::blocking_factor_x = $blocking_factor
CarpetX::blocking_factor_y = $blocking_factor
CarpetX::blocking_factor_z = $blocking_factor

CarpetX::boundary_x = "neumann"
CarpetX::boundary_x = "none"
CarpetX::boundary_y = "neumann"
CarpetX::boundary_z = "neumann"
CarpetX::boundary_upper_x = "neumann"
CarpetX::boundary_z = "none"
CarpetX::boundary_upper_x = "none"
CarpetX::boundary_upper_y = "neumann"
CarpetX::boundary_upper_z = "neumann"

CarpetX::reflection_x = "no"
CarpetX::reflection_y = "no"
CarpetX::reflection_z = "yes"

Driver::periodic = "yes"
Driver::periodic_x = "yes"
Driver::periodic_y = "no"
Driver::periodic_z = "no"

CarpetX::max_num_levels = $nlevels
CarpetX::regrid_every = 1
CarpetX::regrid_error_threshold = 0.08
Driver::regrid_error_threshold = 0.08

CarpetX::dtfac = 0.25

IO::parfile_write = "no"
IO::out_fileinfo = "axis labels"

IO::out_dir = $parfile
IO::out_every = 1
IO::out_every = 30

CarpetX::out_metadata = no
CarpetX::out_tsv_every = 30
CarpetX::out_tsv_vars = "
TestNewRadX::uu
TestNewRadX::vv
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
# 1:iteration 2:time 3:patch 4:level 5:i 6:j 7:k 8:x 9:y 10:z 11:uu_err 12:vv_err
0 0.0000000000000000e+00 0 0 -3 15 15 -1.2000000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 -2 15 15 -1.1333333333333334e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 -1 15 15 -1.0666666666666666e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 0 15 15 -1.0000000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 1 15 15 -9.3333333333333339e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 2 15 15 -8.6666666666666661e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 3 15 15 -8.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 4 15 15 -7.3333333333333339e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 5 15 15 -6.6666666666666670e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 6 15 15 -6.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 7 15 15 -5.3333333333333339e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 8 15 15 -4.6666666666666670e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 9 15 15 -4.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 10 15 15 -3.3333333333333339e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 11 15 15 -2.6666666666666670e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 12 15 15 -2.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 13 15 15 -1.3333333333333339e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 14 15 15 -6.6666666666666785e-01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 15 15 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 16 15 15 6.6666666666666607e-01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 17 15 15 1.3333333333333321e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 18 15 15 2.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 19 15 15 2.6666666666666661e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 20 15 15 3.3333333333333321e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 21 15 15 4.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 22 15 15 4.6666666666666661e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 23 15 15 5.3333333333333321e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 24 15 15 6.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 25 15 15 6.6666666666666643e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 26 15 15 7.3333333333333321e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 27 15 15 8.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 28 15 15 8.6666666666666643e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 29 15 15 9.3333333333333321e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 30 15 15 1.0000000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 31 15 15 1.0666666666666664e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 32 15 15 1.1333333333333332e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 33 15 15 1.2000000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 -3 20 0 -1.1500000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 -2 20 0 -1.1000000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 -1 20 0 -1.0500000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 0 20 0 -1.0000000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 1 20 0 -9.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 2 20 0 -9.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 3 20 0 -8.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 4 20 0 -8.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 5 20 0 -7.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 6 20 0 -7.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 7 20 0 -6.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 8 20 0 -6.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 9 20 0 -5.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 10 20 0 -5.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 11 20 0 -4.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 12 20 0 -4.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 13 20 0 -3.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 14 20 0 -3.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 15 20 0 -2.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 16 20 0 -2.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 17 20 0 -1.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 18 20 0 -1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 19 20 0 -5.0000000000000000e-01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 20 20 0 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 21 20 0 5.0000000000000000e-01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 22 20 0 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 23 20 0 1.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 24 20 0 2.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 25 20 0 2.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 26 20 0 3.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 27 20 0 3.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 28 20 0 4.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 29 20 0 4.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 30 20 0 5.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 31 20 0 5.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 32 20 0 6.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 33 20 0 6.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 34 20 0 7.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 35 20 0 7.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 36 20 0 8.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 37 20 0 8.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 38 20 0 9.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 39 20 0 9.5000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 40 20 0 1.0000000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 41 20 0 1.0500000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 42 20 0 1.1000000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
0 0.0000000000000000e+00 0 0 43 20 0 1.1500000000000000e+01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
Loading