petsc-3.7.1 2016-05-15
Report Typos and Errors

PetscDSSetResidual

Set the pointwise residual function for a given test field

Synopsis

#include "petscds.h" 
PetscErrorCode PetscDSSetResidual(PetscDS prob, PetscInt f,
                                  void (*f0)(PetscInt dim, PetscInt Nf, PetscInt NfAux,
                                             const PetscInt uOff[], const PetscInt uOff_x[], const PetscScalar u[], const PetscScalar u_t[], const PetscScalar u_x[],
                                             const PetscInt aOff[], const PetscInt aOff_x[], const PetscScalar a[], const PetscScalar a_t[], const PetscScalar a_x[],
                                             PetscReal t, const PetscReal x[], PetscScalar f0[]),
                                  void (*f1)(PetscInt dim, PetscInt Nf, PetscInt NfAux,
                                             const PetscInt uOff[], const PetscInt uOff_x[], const PetscScalar u[], const PetscScalar u_t[], const PetscScalar u_x[],
                                             const PetscInt aOff[], const PetscInt aOff_x[], const PetscScalar a[], const PetscScalar a_t[], const PetscScalar a_x[],
                                             PetscReal t, const PetscReal x[], PetscScalar f1[]))
Not collective Many br

Input Parameters

prob - The PetscDS Many br
f - The test field number Many br
f0 - integrand for the test function term Many br
f1 - integrand for the test function gradient term Many br

Note: We are using a first order FEM model for the weak form

\int_\Omega \phi f_0(u, u_t, \nabla u, x, t) + \nabla\phi \cdot {\vec f}_1(u, u_t, \nabla u, x, t) Many br

The calling sequence for the callbacks f0 and f1 is given by

f0(PetscInt dim, PetscInt Nf, PetscInt NfAux,
   const PetscInt uOff[], const PetscInt uOff_x[], const PetscScalar u[], const PetscScalar u_t[], const PetscScalar u_x[],
   const PetscInt aOff[], const PetscInt aOff_x[], const PetscScalar a[], const PetscScalar a_t[], const PetscScalar a_x[],
   PetscReal t, const PetscReal x[], PetscScalar f0[])

dim - the spatial dimension Many br
Nf - the number of fields Many br
uOff - the offset into u[] and u_t[] for each field Many br
uOff_x - the offset into u_x[] for each field Many br
u - each field evaluated at the current point Many br
u_t - the time derivative of each field evaluated at the current point Many br
u_x - the gradient of each field evaluated at the current point Many br
aOff - the offset into a[] and a_t[] for each auxiliary field Many br
aOff_x - the offset into a_x[] for each auxiliary field Many br
a - each auxiliary field evaluated at the current point Many br
a_t - the time derivative of each auxiliary field evaluated at the current point Many br
a_x - the gradient of auxiliary each field evaluated at the current point Many br
t - current time Many br
x - coordinates of the current point Many br
f0 - output values at the current point Many br

Many br

See Also

PetscDSGetResidual()

Level:intermediate
Location:
src/dm/dt/interface/dtds.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/snes/examples/tutorials/ex12.c.html
src/snes/examples/tutorials/ex62.c.html
src/snes/examples/tutorials/ex77.c.html