#include "petscdm.h" PetscErrorCode DMSetInitialGuess(DM dm,PetscErrorCode (*f)(DM,Vec))Logically Collective on DM
dm | - the DM object to destroy | |
f | - the function to compute the initial guess |
C@*/ PetscErrorCode DMSetInitialGuess(DM dm,PetscErrorCode (*f)(DM,Vec)) { PetscFunctionBegin; dm->ops->initialguess = f; PetscFunctionReturn(0); }
#undef __FUNCT__ #define __FUNCT__ "DMSetFunction" /*@C DMSetFunction - sets a function to compute the right hand side vector entries for the KSP solver or nonlinear function for SNES
Logically Collective on DM
dm | - the DM object | |
f | - the function to compute (use PETSC_NULL to cancel a previous function that was set) |
Notes: This sets both the function for function evaluations and the function used to compute Jacobians via finite differences if no Jacobian computer is provided with DMSetJacobian(). Canceling cancels the function, but not the function used to compute the Jacobian.
C@*/ PetscErrorCode DMSetFunction(DM dm,PetscErrorCode (*f)(DM,Vec,Vec)) { PetscFunctionBegin; dm->ops->function = f; if (f) { dm->ops->functionj = f; } PetscFunctionReturn(0); }
#undef __FUNCT__ #define __FUNCT__ "DMSetJacobian" /*@C DMSetJacobian - sets a function to compute the matrix entries for the KSP solver or Jacobian for SNES
Logically Collective on DM
dm | - the DM object to destroy | |
f | - the function to compute the matrix entries |
C@*/ PetscErrorCode DMSetJacobian(DM dm,PetscErrorCode (*f)(DM,Vec,Mat,Mat,MatStructure*)) { PetscFunctionBegin; dm->ops->jacobian = f; PetscFunctionReturn(0); }
#undef __FUNCT__ #define __FUNCT__ "DMComputeInitialGuess" /*@ DMComputeInitialGuess - computes an initial guess vector entries for the KSP solvers
Collective on DM
dm | - the DM object to destroy | |
x | - the vector to hold the initial guess values |
Level:intermediate
Location:src/dm/interface/dm.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages