Skip to content
Snippets Groups Projects
Commit 5e3684a6 authored by Marco D'Antonio's avatar Marco D'Antonio
Browse files

Curl computation always applies sources in kernel

parent 1493c1d0
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ void compute_field_curl(const entity_data_cpu& ed, ...@@ -63,7 +63,7 @@ void compute_field_curl(const entity_data_cpu& ed,
} }
} }
void compute_field_curl_sources(const entity_data_cpu& ed, void compute_field_curl(const entity_data_cpu& ed,
const vecxd& fx, const vecxd& fy, const vecxd& fz, double alpha, const vecxd& fx, const vecxd& fy, const vecxd& fz, double alpha,
vecxd& curl_fx, vecxd& curl_fy, vecxd& curl_fz, vecxd& curl_fx, vecxd& curl_fy, vecxd& curl_fz,
const vecxd& jx, const vecxd& jy, const vecxd& jz) const vecxd& jx, const vecxd& jy, const vecxd& jz)
......
...@@ -119,18 +119,8 @@ compute_curls(solver_state& state, const field& curr, field& next) ...@@ -119,18 +119,8 @@ compute_curls(solver_state& state, const field& curr, field& next)
for (const auto& ed : state.eds) for (const auto& ed : state.eds)
{ {
compute_field_curl(ed, curr.Ex, curr.Ey, curr.Ez, -1.0, next.Hx, next.Hy, next.Hz); compute_field_curl(ed, curr.Ex, curr.Ey, curr.Ez, -1.0, next.Hx, next.Hy, next.Hz);
#ifndef ADD_SOURCES
compute_field_curl(ed, curr.Hx, curr.Hy, curr.Hz, 1.0, next.Ex, next.Ey, next.Ez);
#else
compute_field_curl(ed, curr.Hx, curr.Hy, curr.Hz, 1.0, next.Ex, next.Ey, next.Ez, state.Jx_src, state.Jy_src, state.Jz_src); compute_field_curl(ed, curr.Hx, curr.Hy, curr.Hz, 1.0, next.Ex, next.Ey, next.Ez, state.Jx_src, state.Jy_src, state.Jz_src);
#endif
} }
#ifndef ADD_SOURCES
next.Ex -= state.Jx_src;
next.Ey -= state.Jy_src;
next.Ez -= state.Jz_src;
#endif
} }
static void static void
...@@ -147,18 +137,8 @@ compute_curls_H(solver_state& state, const field& curr, field& next) ...@@ -147,18 +137,8 @@ compute_curls_H(solver_state& state, const field& curr, field& next)
{ {
for (const auto& ed : state.eds) for (const auto& ed : state.eds)
{ {
#ifndef ADD_SOURCES
compute_field_curl(ed, curr.Hx, curr.Hy, curr.Hz, 1.0, next.Ex, next.Ey, next.Ez);
#else
compute_field_curl(ed, curr.Hx, curr.Hy, curr.Hz, 1.0, next.Ex, next.Ey, next.Ez, state.Jx_src, state.Jy_src, state.Jz_src); compute_field_curl(ed, curr.Hx, curr.Hy, curr.Hz, 1.0, next.Ex, next.Ey, next.Ez, state.Jx_src, state.Jy_src, state.Jz_src);
#endif
} }
#ifndef ADD_SOURCES
next.Ex -= state.Jx_src;
next.Ey -= state.Jy_src;
next.Ez -= state.Jz_src;
#endif
} }
#else #else
static void static void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment