[petsc-dev] PetscBag not a PetscObject?

Ethan Coon ecoon at lanl.gov
Tue May 10 12:28:10 CDT 2011


Attached is a patch to hack in an prefix for use with PetscBag.  Also
fixed the PetscBag examples to work.  

Note that the fortran example doesn't compile unless the PETSC_REAL
patch I sent in the previous example is included, as PETSC_REAL doesn't
seem to exist in either finclude/petscsysdef.h or petsc.mod.

Ethan

On Fri, 2011-04-08 at 21:55 -0500, Barry Smith wrote:

> At this time I vote that you add the PetscBagSetOptionsPrefix() directly for Bags and do not turn the Bag into a real PetscObject.
> 
>    Barry
> 
> On Apr 8, 2011, at 12:29 PM, Ethan Coon wrote:
> 
> > 
> > I'm using a couple of bags in an application, and that application is in
> > turn being used in a domain-decomposition algorithm with multiple
> > domains (each an instance of the application).  So I'd like to set the
> > options prefix of the bag, so that each application instance has its own
> > prefix and can be used with the same options "database."  Currently
> > PetscBag passes PETSC_NULL for the prefix.
> > 
> > To fix this, it looks like the best option would be to have a
> > PetscBagSetOptionsPrefix() in the same mold as everything else.  I added
> > this, and then found out that PetscBag isn't a PetscObject, in the sense
> > that it has no header or CLASS_ID (so PetscObjectSetOptionsPrefix()
> > doesn't work on a bag).
> > 
> > Is this the best way forward, to make PetscBag a PetscObject, with
> > CLASS_ID, etc?  And if so, is there a good example of this that I should
> > follow to do so?
> > 
> > Thanks,
> > 
> > Ethan
> > 
> > 
> > 
> > 
> > -- 
> > ------------------------------------
> > Ethan Coon
> > Post-Doctoral Researcher
> > Applied Mathematics - T-5
> > Los Alamos National Laboratory
> > 505-665-8289
> > 
> > http://www.ldeo.columbia.edu/~ecoon/
> > ------------------------------------
> > 
> 

-- 
------------------------------------
Ethan Coon
Post-Doctoral Researcher
Applied Mathematics - T-5
Los Alamos National Laboratory
505-665-8289

http://www.ldeo.columbia.edu/~ecoon/
------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: missing_PETSC_REAL
Type: text/x-patch
Size: 616 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110510/3e68f0b6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bagsetoptionsprefix
Type: text/x-patch
Size: 16446 bytes
Desc: 
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110510/3e68f0b6/attachment-0001.bin>


More information about the petsc-dev mailing list