HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Compute normal gradient of a provided variable on immersed body surface. More...
#include <stdio.h>
#include <stdlib.h>
#include <arrayfunctions.h>
#include <immersedboundaries.h>
#include <mpivars.h>
#include <hypar.h>
Go to the source code of this file.
Functions | |
int | IBComputeNormalGradient (void *s, void *m, const double *const var, int nvars, double **const grad_var) |
Compute normal gradient of a provided variable on immersed body surface.
Definition in file IBComputeNormalGradient.c.
int IBComputeNormalGradient | ( | void * | s, |
void * | m, | ||
const double *const | var, | ||
int | nvars, | ||
double **const | grad_var | ||
) |
Calculate the normal gradient of a provided variables on the immersed body surface: for each "local facet", i.e., facets (of the immersed body surface) that lie within the local computational domain of this MPI rank, compute the normal gradient.
The variable should be a grid variable with size/layout the same as the solution variable (HyPar::u) with the appropriate number of ghost points.
If the incoming variable has multiple components, this function will calculate normal gradient of each component.
The grad var array should be NULL at input; at output, it will point to an array of size (ImmersedBoundary::nfacets_local X nvars) that contains the normal gradient at each local facet. If there are no local facets, it will remain NULL.
The gradient calculation is currently first-order.
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
var | Variable to compute the gradient of |
nvars | Number of components in var |
grad_var | Array to store the gradient; must be NULL at input |
Definition at line 33 of file IBComputeNormalGradient.c.