Skip to content

Commit

Permalink
Z4co: remove physics.hxx
Browse files Browse the repository at this point in the history
  • Loading branch information
lwJi committed Jul 11, 2024
1 parent 762800f commit 115ce12
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 106 deletions.
1 change: 0 additions & 1 deletion Z4co/src/constraint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#endif

#include "derivs.hxx"
#include "physics.hxx"

#include <loop_device.hxx>
#include <simd.hxx>
Expand Down
2 changes: 0 additions & 2 deletions Z4co/src/enforce.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include "physics.hxx"

#include <loop_device.hxx>
#include <mat.hxx>
#include <simd.hxx>
Expand Down
2 changes: 0 additions & 2 deletions Z4co/src/initial1.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include "physics.hxx"

#include <loop_device.hxx>
#include <mat.hxx>
#include <simd.hxx>
Expand Down
24 changes: 23 additions & 1 deletion Z4co/src/initial2.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "derivs.hxx"
#include "physics.hxx"

#include <loop_device.hxx>
#include <simd.hxx>
Expand All @@ -16,6 +15,29 @@ using namespace Arith;
using namespace Loop;
using namespace std;

template <typename T, int D>
ARITH_INLINE ARITH_DEVICE ARITH_HOST constexpr vec<smat<T, D>, D>
calc_gammal(const smat<vec<T, D>, D> &dg) {
// Gammal_abc
return vec<smat<T, D>, D>([&](int a) ARITH_INLINE {
return smat<T, D>([&](int b, int c) ARITH_INLINE {
return (dg(a, b)(c) + dg(a, c)(b) - dg(b, c)(a)) / 2;
});
});
}

template <typename T, int D>
ARITH_INLINE ARITH_DEVICE ARITH_HOST constexpr vec<smat<T, D>, D>
calc_gamma(const smat<T, D> &gu, const vec<smat<T, D>, D> &Gammal) {
// Gamma^a_bc
return vec<smat<T, D>, D>([&](int a) ARITH_INLINE {
return smat<T, D>([&](int b, int c) ARITH_INLINE {
return sum<D>([&](int x)
ARITH_INLINE { return gu(a, x) * Gammal(x)(b, c); });
});
});
}

extern "C" void Z4co_Initial2(CCTK_ARGUMENTS) {
DECLARE_CCTK_ARGUMENTS_Z4co_Initial2;

Expand Down
99 changes: 0 additions & 99 deletions Z4co/src/physics.hxx

This file was deleted.

1 change: 0 additions & 1 deletion Z4co/src/rhs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// #define Power(x, y) (Arith::pown((x), (y)))

#include "derivs.hxx"
#include "physics.hxx"

#include <loop_device.hxx>
#include <mat.hxx>
Expand Down

0 comments on commit 115ce12

Please sign in to comment.