![]() |
programmer's documentation
|
#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_array_reduce.h"
Functions | |
void | cs_array_reduce_sum_l (cs_lnum_t n_elts, int dim, const cs_lnum_t *v_elt_list, const cs_real_t v[], double vsum[]) |
Compute sums of an n-dimensional cs_real_t array's components. More... | |
void | cs_array_reduce_simple_stats_l (cs_lnum_t n_elts, int dim, const cs_lnum_t *v_elt_list, const cs_real_t v[], double vmin[], double vmax[], double vsum[]) |
Compute simple local stats (minima, maxima, sum) of an n-dimensional cs_real_t array's components. More... | |
void | cs_array_reduce_simple_stats_l_w (cs_lnum_t n_elts, int dim, const cs_lnum_t *v_elt_list, const cs_lnum_t *w_elt_list, const cs_real_t v[], const cs_real_t w[], double vmin[], double vmax[], double vsum[], double wsum[]) |
Compute simple local stats (minima, maxima, sum, weighted sum) of an n-dimensional cs_real_t array's components for a given mesh location. More... | |
void cs_array_reduce_simple_stats_l | ( | cs_lnum_t | n_elts, |
int | dim, | ||
const cs_lnum_t * | v_elt_list, | ||
const cs_real_t | v[], | ||
double | vmin[], | ||
double | vmax[], | ||
double | vsum[] | ||
) |
Compute simple local stats (minima, maxima, sum) of an n-dimensional cs_real_t array's components.
The maximum allowed dimension is 9 (allowing for a rank-2 tensor). The array is interleaved.
For arrays of dimension 3, the statistics relative to the norm are also computed, and added at the end of the statistics arrays (which must be size dim+1).
The algorithm here is similar to that used for BLAS, but computes several quantities simultaneously for better cache behavior
[in] | n_elts | number of local elements |
[in] | dim | local array dimension (max: 9) |
[in] | v_elt_list | optional list of parent elements on which values are defined, or NULL |
[in] | v | pointer to array values |
[out] | vmin | resulting min array (size: dim, or 4 if dim = 3) |
[out] | vmax | resulting max array (size: dim, or 4 if dim = 3) |
[out] | vsum | resulting sum array (size: dim, or 4 if dim = 3) |
void cs_array_reduce_simple_stats_l_w | ( | cs_lnum_t | n_elts, |
int | dim, | ||
const cs_lnum_t * | v_elt_list, | ||
const cs_lnum_t * | w_elt_list, | ||
const cs_real_t | v[], | ||
const cs_real_t | w[], | ||
double | vmin[], | ||
double | vmax[], | ||
double | vsum[], | ||
double | wsum[] | ||
) |
Compute simple local stats (minima, maxima, sum, weighted sum) of an n-dimensional cs_real_t array's components for a given mesh location.
The maximum allowed dimension is 9 (allowing for a rank-2 tensor). The array is interleaved.
For arrays of dimension 3, the statistics relative to the norm are also computed, and added at the end of the statistics arrays (which must be size dim+1).
The algorithm here is similar to that used for BLAS, but computes several quantities simultaneously for better cache behavior
[in] | n_elts | number of local elements |
[in] | dim | local array dimension (max: 9) |
[in] | v_elt_list | optional list of parent elements on which values are defined, or NULL |
[in] | w_elt_list | optional list of parent elements on which weights are defined, or NULL; if v_elt_list is defined (ie. non-NULL),then w_elt_list = v_elt_list is assumed, so this parameter is ignored |
[in] | v | pointer to array values |
[in] | w | pointer to weights |
[out] | vmin | resulting min array (size: dim, or 4 if dim = 3) |
[out] | vmax | resulting max array (size: dim, or 4 if dim = 3) |
[out] | vsum | resulting sum array (size: dim, or 4 if dim = 3) |
[out] | wsum | resulting weighted sum array (size: dim, or 4 if dim = 3) |
void cs_array_reduce_sum_l | ( | cs_lnum_t | n_elts, |
int | dim, | ||
const cs_lnum_t * | v_elt_list, | ||
const cs_real_t | v[], | ||
double | vsum[] | ||
) |
Compute sums of an n-dimensional cs_real_t array's components.
The maximum allowed dimension is 9 (allowing for a rank-2 tensor). The array is interleaved.
For arrays of dimension 3, the statistics relative to the norm are also computed, and added at the end of the statistics arrays (which must be size dim+1).
The algorithm here is similar to that used for BLAS.
[in] | n_elts | number of local elements |
[in] | dim | local array dimension (max: 9) |
[in] | v_elt_list | optional list of parent elements on which values are defined, or NULL |
[in] | v | pointer to array values |
[out] | vsum | resulting sum array (size: dim, or 4 if dim = 3) |