DMSetApplicationContext#

Set a user context into a DM object

Synopsis#

#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMSetApplicationContext(DM dm, PetscCtx ctx)

Not Collective

Input Parameters#

  • dm - the DM object

  • ctx - the user context

Note#

A user context is a way to pass problem specific information that is accessible whenever the DM is available In a multilevel solver, the user context is shared by all the DM in the hierarchy; it is thus not advisable to store objects that represent discretized quantities inside the context.

Fortran Notes#

This only works when the context is a Fortran derived type or a PetscObject. Declare ctx with

  type(tUsertype), pointer :: ctx

See Also#

DM Basics, DM, DMGetApplicationContext(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix()

Level#

intermediate

Location#

src/dm/interface/dm.c

Examples#

src/ksp/ksp/tutorials/ex73.c
src/snes/tutorials/ex55.c
src/snes/tutorials/ex22.c
src/ksp/ksp/tutorials/ex66.c
src/snes/tutorials/ex19.c
src/ksp/ksp/tutorials/ex36.cxx
src/ksp/ksp/tutorials/ex35.cxx
src/snes/tutorials/ex13.c
src/ksp/ksp/tutorials/ex28.c
src/ksp/ksp/tutorials/ex50.c


Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages