HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
PetscCleanup.cpp File Reference
#include <stdlib.h>
#include <petscinterface_struct.h>

Go to the source code of this file.

Functions

int PetscCleanup (void *obj)
 

Function Documentation

◆ PetscCleanup()

int PetscCleanup ( void *  obj)

Clean up allocations in the PETSc interface

Parameters
objObject of type PETScContext

Definition at line 12 of file PetscCleanup.cpp.

13 {
14  PETScContext *ctxt = (PETScContext*) obj;
15  for (int i = 0; i < ctxt->globalDOF.size(); i++) {
16  free(ctxt->globalDOF[i]);
17  }
18  ctxt->globalDOF.clear();
19  for (int i = 0; i < ctxt->points.size(); i++) {
20  free(ctxt->points[i]);
21  }
22  ctxt->points.clear();
23  if (ctxt->offsets) free(ctxt->offsets);
24  return(0);
25 }
std::vector< int * > points
Structure containing the variables for time-integration with PETSc.
std::vector< double * > globalDOF