38 template <
typename T,
typename T_GRID>
43 template <
typename T,
typename T_GRID>
48 template <
typename T,
typename T_GRID>
53 const auto &grid = levelset.
grid();
54 const auto &velocity = levelset_velocity.
velocity();
57 auto &phi = levelset.
phi();
58 auto &psi = levelset.
psi();
63 for (
int i = 0; i < num_cells[0]; ++i)
64 for (
int j = 0; j < num_cells[1]; ++j)
65 for (
int k = 0; k < num_cells[2]; ++k) x_root(i, j, k) = grid(i, j, k) - velocity(i, j, k) * dt;
73 const auto &identity_mat = T_GRID::identity_mat;
75 for (
int i = 0; i < num_cells[0]; ++i)
76 for (
int j = 0; j < num_cells[1]; ++j)
77 for (
int k = 0; k < num_cells[2]; ++k) x_root_grad(i, j, k) = identity_mat - velocity_grad(i, j, k) * dt;
83 for (
int i = 0; i < num_cells[0]; ++i)
84 for (
int j = 0; j < num_cells[1]; ++j)
85 for (
int k = 0; k < num_cells[2]; ++k) {
86 phi(i, j, k) = phi_interp_prev(i, j, k);
87 psi(i, j, k) = x_root_grad(i, j, k).dot(psi_interp_prev(i, j, k));
Array< T_GRID, T > & phi()
Array< T_GRID, Vec3< T > > & psiInterpPrev()
Array< T_GRID, Vec3< T > > & psi()
Array< T_GRID, Mat3< T > > & velocityGradient()
const T_GRID & grid() const
void compute(const T dt, const CPU::LevelsetVelocity< T_GRID, T > &levelset_velocity, GALS::CPU::Levelset< T_GRID, T > &levelset)
Array< T_GRID, Vec3< T > > & velocity()
Array< T_GRID, T > & phiInterpPrev()