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;
#define _ArraySetValue_(x, size, value)
double interp_coeffs[_IB_NNODES_]
Structure containing variables for immersed boundary implementation.
Structure defining a facet map.
Structures and function definitions for immersed boundaries.
MPI related function definitions.
double interp_coeffs_ns[_IB_NNODES_]
int interp_nodes_ns[_IB_NNODES_]
int interp_nodes[_IB_NNODES_]
Contains structure definition for hypar.
Contains macros and function definitions for common array operations.
Structure of MPI-related variables.
int IBComputeNormalGradient(void *, void *, const double *const, int, double **const)
Structure containing all solver-specific variables and functions.