30 template<
class Tvec,
class Tgr
idVec>
33 auto edges = get_edges();
35 edges.spans_block_cell_sizes.check_sizes(edges.sizes.indexes);
36 edges.spans_x.check_sizes(edges.sizes.indexes);
37 edges.spans_y.ensure_sizes(edges.sizes.indexes);
39 auto &q = shamsys::instance::get_compute_scheduler().get_queue();
41 edges.cell_neigh_graph.graph.for_each(
43 auto &cell_sizes_span = edges.spans_block_cell_sizes.get_spans().get(
id);
44 auto &x_span = edges.spans_x.get_spans().get(
id);
45 auto &y_span = edges.spans_y.get_spans().get(
id);
47 auto get_graph = [&](Direction dir) ->
const AMRGraph & {
51 const AMRGraph &graph_neigh_xp = get_graph(Direction::xp);
52 const AMRGraph &graph_neigh_xm = get_graph(Direction::xm);
53 const AMRGraph &graph_neigh_yp = get_graph(Direction::yp);
54 const AMRGraph &graph_neigh_ym = get_graph(Direction::ym);
55 const AMRGraph &graph_neigh_zp = get_graph(Direction::zp);
56 const AMRGraph &graph_neigh_zm = get_graph(Direction::zm);
58 u32 cell_count = edges.sizes.indexes.get(
id) * block_size;
73 [block_size = block_size](
75 const Tscal *__restrict cell_sizes,
76 const Tscal *__restrict x,
83 Tscal *__restrict y) {
94 y[cell_global_id] = x[cell_global_id] / weight;
99 template<
class Tvec,
class Tgr
idVec>
101 std::string tex = R
"tex(
102 Jacobi preconditioner
104 {spans_y}_i = {spans_x}_i / A_{ii}
108 replace_edges_tex_symbols(tex);
7-point stencil for the discrete Laplacian operator
Header file describing a Node Instance.
Diagonal preconditioner of the PCG Poisson solver.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
Compute y <- M^-1 x, being the diagonal of the matrix of NodeSpMVPoisson3D as given by jacobi_weight...
void _impl_evaluate_internal()
evaluate the node
virtual std::string _impl_get_tex() const
get the tex of the node
void kernel_call(sham::DeviceQueue &q, RefIn in, RefOut in_out, u32 n, Functor &&func, SourceLocation &&callsite=SourceLocation{})
Submit a kernel to a SYCL queue.
T & get_check_ref(const std::unique_ptr< T > &ptr, SourceLocation loc=SourceLocation())
Takes a std::unique_ptr and returns a reference to the object it holds. It throws a std::runtime_erro...
namespace for the basegodunov model modules
T jacobi_weight_7pt(const shambase::VecComponent< Tvec > *cell_sizes, const u32 block_size, const u32 cell_global_id, const AMRGraphLinkiterator &graph_iter_xp, const AMRGraphLinkiterator &graph_iter_xm, const AMRGraphLinkiterator &graph_iter_yp, const AMRGraphLinkiterator &graph_iter_ym, const AMRGraphLinkiterator &graph_iter_zp, const AMRGraphLinkiterator &graph_iter_zm)
Get the weight of the Jacobi preconditioner of the 7-point Laplacian.
This file contains the definition for the stacktrace related functionality.
shambase::details::BasicStackEntry StackEntry
Alias for shambase::details::BasicStackEntry.
A class that references multiple buffers or similar objects.