35 const double*
const var,
37 double**
const grad_var
44 if (!solver->
flag_ib)
return(0);
46 if ((*grad_var) != NULL) {
47 fprintf(stderr,
"Error in IBComputeNormalGradient()\n");
48 fprintf(stderr,
" grad_var is not NULL on rank %d\n",
56 if (nfacets_local > 0) {
57 (*grad_var) = (
double*) calloc (nvars*nfacets_local,
sizeof(
double));
59 for (
int n = 0; n < nfacets_local; n++) {
69 for (k=0; k<nvars; k++) {
70 v_c[k] += ( alpha[j] * var[nvars*nodes[j]+k] );
79 for (k=0; k<nvars; k++) {
80 v_ns[k] += ( alpha[j] * var[nvars*nodes[j]+k] );
88 for (k=0; k<nvars; k++) {
89 double dv_dx = (v_ns[k] - v_c[k]) / fmap[n].dx;
90 double dv_dy = (v_ns[k] - v_c[k]) / fmap[n].dy;
91 double dv_dz = (v_ns[k] - v_c[k]) / fmap[n].dz;
92 (*grad_var)[n*nvars+k] = dv_dx*nx + dv_dy*ny + dv_dz*nz;
double interp_coeffs[_IB_NNODES_]
Structure defining a facet map.
Structure containing variables for immersed boundary implementation.
MPI related function definitions.
double interp_coeffs_ns[_IB_NNODES_]
int interp_nodes[_IB_NNODES_]
Structure containing all solver-specific variables and functions.
Contains structure definition for hypar.
#define _ArraySetValue_(x, size, value)
Structures and function definitions for immersed boundaries.
int interp_nodes_ns[_IB_NNODES_]
Structure of MPI-related variables.
int IBComputeNormalGradient(void *s, void *m, const double *const var, int nvars, double **const grad_var)
Contains macros and function definitions for common array operations.