DMSetInitialGuess

sets a function to compute an initial guess vector entries for the solvers

Synopsis

#include "petscdm.h"     
PetscErrorCode  DMSetInitialGuess(DM dm,PetscErrorCode (*f)(DM,Vec))
Logically Collective on DM

Input Parameter

dm - the DM object to destroy
f - the function to compute the initial guess

See Also

DMView(), DMCreateGlobalVector(), DMGetInterpolation(), DMGetColoring(), DMGetMatrix(), DMGetApplicationContext(), DMSetFunction(), DMSetJacobian()

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

Input Parameter

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.

See Also

DMView(), DMCreateGlobalVector(), DMGetInterpolation(), DMGetColoring(), DMGetMatrix(), DMGetApplicationContext(), DMSetInitialGuess(),
DMSetJacobian()

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

Input Parameter

dm - the DM object to destroy
f - the function to compute the matrix entries

See Also

DMView(), DMCreateGlobalVector(), DMGetInterpolation(), DMGetColoring(), DMGetMatrix(), DMGetApplicationContext(), DMSetInitialGuess(),
DMSetFunction()

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

Input Parameter

dm - the DM object to destroy
x - the vector to hold the initial guess values

See Also

DMView(), DMCreateGlobalVector(), DMGetInterpolation(), DMGetColoring(), DMGetMatrix(), DMGetApplicationContext(), DMSetRhs(), DMSetMat()

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

Examples

src/ksp/ksp/examples/tutorials/ex45.c.html
src/ksp/ksp/examples/tutorials/ex45f.F.html