aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45>2014-04-15 19:49:28 +0000
committerrhaas <rhaas@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45>2014-04-15 19:49:28 +0000
commit51e2133c922057fcb2fb856fcbde63ea3f5d517f (patch)
treee89e7edc731d8d1b5535a1971638cdc691a494f4
parent77c73cf674a94f4e2057544ad7e91ade52e21416 (diff)
GRHydro: add Trivial (copy) reconstruct
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/GRHydro/trunk@625 c83d129a-5a75-4d5a-9c4d-ed3a5855bf45
-rw-r--r--src/GRHydro_TrivialReconstruct.cc34
-rw-r--r--src/GRHydro_TrivialReconstruct.hh20
-rw-r--r--src/make.code.defn1
3 files changed, 55 insertions, 0 deletions
diff --git a/src/GRHydro_TrivialReconstruct.cc b/src/GRHydro_TrivialReconstruct.cc
new file mode 100644
index 0000000..be3d1c5
--- /dev/null
+++ b/src/GRHydro_TrivialReconstruct.cc
@@ -0,0 +1,34 @@
+#include <cmath>
+#include "cctk.h"
+#include "cctk_Parameters.h"
+#include "cctk_Arguments.h"
+#include "cctk_Functions.h"
+
+#include "GRHydro_TrivialReconstruct.hh"
+#include "GRHydro_Reconstruct_drv_impl.hh"
+
+using namespace std;
+
+
+/**
+ Trivial first-order reconstruction operator.
+*/
+template <int dir>
+void GRHydro_TrivialReconstruct1d::
+apply(const int nx, const CCTK_REAL* const restrict a,
+ CCTK_REAL* const restrict aminus, CCTK_REAL* const restrict aplus,
+ const cGH* const cctkGH, const int j, const int k)
+{
+ for (int i=0; i < nx; ++i)
+ {
+ const int ijk = dir ==0 ? CCTK_GFINDEX3D(cctkGH, i , j, k) : dir ==1 ? CCTK_GFINDEX3D(cctkGH, j, i , k) : CCTK_GFINDEX3D(cctkGH, j, k, i );
+
+ // Trivial reconstruction!
+ aminus[ijk] = a[ijk];
+ aplus[ijk] = a[ijk];
+ }
+}
+
+// instantiate all copies we need, this way different operators can be compiled
+// in parallel. This must match the select routine in GRHydro_Reconstruct.cc
+INSTANTIATE_RECONSTRUCTION_OPERATOR(GRHydro_TrivialReconstruct1d)
diff --git a/src/GRHydro_TrivialReconstruct.hh b/src/GRHydro_TrivialReconstruct.hh
new file mode 100644
index 0000000..0ad330a
--- /dev/null
+++ b/src/GRHydro_TrivialReconstruct.hh
@@ -0,0 +1,20 @@
+#ifndef _GRHYDRO_TRIVIALRECONSTRUCT_HH
+#define _GRHYDRO_TRIVIALRECONSTRUCT_HH
+
+#include "cctk.h"
+
+/**
+ Trivial first-order reconstruction operator.
+*/
+struct GRHydro_TrivialReconstruct1d {
+template <int dir>
+static inline void apply(const int nx,
+ const CCTK_REAL* const restrict a,
+ CCTK_REAL* const restrict aminus,
+ CCTK_REAL* const restrict aplus,
+ const cGH* const cctkGH,
+ const int j, const int k
+ );
+}; // end struct
+
+#endif // _GRHYDRO_TRIVIALRECONSTRUCT_HH
diff --git a/src/make.code.defn b/src/make.code.defn
index 9b0c353..a7642c4 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -88,6 +88,7 @@ SRCS = Utils.F90 \
GRHydro_ePPM.cc \
GRHydro_PPMReconstruct_drv_opt.cc \
GRHydro_WENOReconstruct.cc \
+ GRHydro_TrivialReconstruct.cc \
GRHydro_MP5Reconstruct.cc \
GRHydro_Wrappers.F90 \
GRHydro_HLLE.cc