31 auto edges = get_edges();
36 edges.spans_phi_res.get_refs().for_each_ordered(
39 u32 val_cnt = edges.sizes.indexes.get(id_patch) * nvar;
44 "field too small on patch {}: expected at least {} values, got {}",
53 edges.res_ddot.data = shamalgs::collective::allreduce_sum(loc_val);
61 std::string tex = R
"tex(
62 Compute L2-norm squared of residual vector
64 {residual_dot} &= \sum_{i \in [0,N_{field})} {field}_i \cdot {field}_i
Squared L2 norm of a field, summed over all patches and ranks.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
u32 get_val_cnt() const
Get the number of values stored in the field.
Compute res_ddot <- sum_i <res_i, res_i> over the first sizes * nvar values of every patch on every r...
virtual std::string _impl_get_tex() const
get the tex of the node
void _impl_evaluate_internal()
evaluate the node
IEdge & get_rw_edge_base(int slot)
Get a reference to a read write edge and cast it to the type IEdge.
const IEdge & get_ro_edge_base(int slot)
Get a reference to a read only edge.
Provides functions to compute the sum of dot products of elements in a device buffer with themselves.
This header file contains utility functions related to exception handling in the code.
shambase::VecComponent< T > dot_sum(sham::DeviceBuffer< T > &buf1, u32 start_id, u32 end_id)
Compute the sum of dot products of elements in a device buffer with themselves.
void replace_all(std::string &inout, std::string_view what, std::string_view with)
replace all occurence of a search string with another
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
namespace for the basegodunov model modules