Move implementation of vector_zero() to central location.
There is no need for each file to contain a separate, though trivial, implementation of this feature.
This commit is contained in:
parent
2985200ad5
commit
4a2b5e4e0e
13
coarse_sys.c
13
coarse_sys.c
@ -1054,19 +1054,6 @@ define_csr_sparsity(size_t nc, size_t m, struct bf_asm_data *bf_asm)
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* v = zeros([n, 1]) */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static void
|
||||
vector_zero(size_t n, double *v)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++) { v[i] = 0.0; }
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Assemble system of linear equations corresponding to local
|
||||
* discretisation of flow problem on domain connected to coarse face
|
||||
|
11
ifsh_ms.c
11
ifsh_ms.c
@ -348,17 +348,6 @@ ifsh_ms_impl_construct(grid_t *G ,
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static void
|
||||
vector_zero(size_t m, double *v)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < m; i++) { v[i] = 0.0; }
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static void
|
||||
average_flux(size_t nf, const int *N, double *flux) /* Poor name */
|
||||
|
13
sparse_sys.c
13
sparse_sys.c
@ -192,3 +192,16 @@ csrmatrix_zero(struct CSRMatrix *A)
|
||||
|
||||
for (i = 0; i < A->nnz; i++) { A->sa[i] = 0.0; }
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* v = zeros([n, 1]) */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void
|
||||
vector_zero(size_t n, double *v)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++) { v[i] = 0.0; }
|
||||
}
|
||||
|
@ -72,6 +72,12 @@ csrmatrix_delete(struct CSRMatrix *A);
|
||||
void
|
||||
csrmatrix_zero(struct CSRMatrix *A);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* v = zeros([n, 1]) */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void
|
||||
vector_zero(size_t n, double *v);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user