Using petsc in user code

#DOMINIC DENVER JOHN CHANDAR# DOMI0002 at ntu.edu.sg
Thu Apr 30 01:25:32 CDT 2009


Hi,
 
         I have a C++ code in which I plan to call PETSc for solving a
system of equations. My doubt is regarding PETScInitialize() and
PETScFinalize().
For example, I have a class called classX
 
classX
{
 
public:
initialize();
finalize();
};
 
classX::initialize()
{
PetscInitialize(...)
..
..
more initializations..
}
 
classX::finalize()
{
PetscFinalize();
...
... 
}
 
main()
{
   classX  ob1, ob2 ; // 2 objects
 
    // Is the following acceptable ??
ob1.initialize();
ob2.initialize();
 
}
 
Do I need to call PetscInitialize() /PetscFinalize() for each object ? 
 
-Dominic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090430/56cbe7e1/attachment.htm>


More information about the petsc-users mailing list