Re: [Libmesh-devel] Casting issues

2009-02-09 Thread Derek Gaston
On Feb 9, 2009, at 1:43 PM, Roy Stogner wrote: > Apparently the compiler can't figure out where to find a vtable > pointer unless it at least knows what the root base class is you're > pointing to, and it can't figure out how to do a proper cast (at least > in the context of multiple inheritance)

Re: [Libmesh-devel] Casting issues

2009-02-09 Thread Roy Stogner
On Mon, 9 Feb 2009, Derek Gaston wrote: > Why can't you cast a void pointer to a class pointer dynamically? > Seems odd to me... so I'm probably doing something wrong. Apparently the compiler can't figure out where to find a vtable pointer unless it at least knows what the root base class is you

[Libmesh-devel] Casting issues

2009-02-09 Thread Derek Gaston
To revisit the discussion on casting last week... I just ran across this issue: error: cannot dynamic_cast ‘oldvar’ (of type ‘void*’) to type ‘class Preconditioner*’ (source is not a pointer to class) The offending code is: PetscErrorCode __libmesh_petsc_preconditioner_setup (void * ctx)

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Derek Gaston
On Feb 9, 2009, at 9:18 AM, John Peterson wrote: > Short answer: check out aclocal.m4 around line 869. We just use grep > and sed to figure out what the petsc version is during configure. You > could probably do the same for HYPRE_foo... I just committed a configure test for Hypre that will def

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread John Peterson
On Mon, Feb 9, 2009 at 9:55 AM, Derek Gaston wrote: > So it looks like we only snoop petscconf in our Makefile(.in). Should I > just snoop for HYPRE_LIB there and add a -DPETSC_HAS_HYPRE to our compile > line? Or should I go snoop petscconf manually during configure so a #define > can get set in

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Roy Stogner
On Mon, 9 Feb 2009, Derek Gaston wrote: > Does anyone know how to snoop to see if Petsc is configured with Hypre > support? I don't see a simple #define HAS_HYPRE or some such anywhere > in the Petsc source. Does PETSc end up including any HYPRE headers from the PETSc headers? If so then #ifdef

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Derek Gaston
So it looks like we only snoop petscconf in our Makefile(.in). Should I just snoop for HYPRE_LIB there and add a -DPETSC_HAS_HYPRE to our compile line? Or should I go snoop petscconf manually during configure so a #define can get set in libmesh_configure.h? Derek -

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Derek Gaston
On Feb 9, 2009, at 8:46 AM, John Peterson wrote: > Looks like HYPRE_INCLUDE and HYPRE_LIB will be set in > > $PETSC_DIR/bmake/${PETSC_ARCH}/petscconf > > if it's there. That was as of 2.3.1. Thanks John... I'll work up a configure test for this. Derek -

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread John Peterson
On Mon, Feb 9, 2009 at 9:35 AM, Derek Gaston wrote: > Does anyone know how to snoop to see if Petsc is configured with Hypre > support? I don't see a simple #define HAS_HYPRE or some such anywhere in > the Petsc source. Looks like HYPRE_INCLUDE and HYPRE_LIB will be set in $PETSC_DIR/bmake/${PE

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Derek Gaston
Does anyone know how to snoop to see if Petsc is configured with Hypre support? I don't see a simple #define HAS_HYPRE or some such anywhere in the Petsc source. Thanks, Derek On Feb 9, 2009, at 2:42 AM, Tim Kroeger wrote: > Dear Derek, > > On Fri, 6 Feb 2009, Derek Gaston wrote: > >> Ok -

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Derek Gaston
On Feb 9, 2009, at 2:46 AM, Tim Kroeger wrote: > Just to briefly join in the preconditioner discussion: Have you also > thought about something like a ShellPreconditioner class > (analogously to the ShellMatrix)? It's not that I would need it > now, but someone (perhaps me) might need it in

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Derek Gaston
I'll take care of this immediately... thanks for pointing it out. I looked at the code and thought that that function would be present regardless of whether or not you configured Petsc with Hypre... guess I was wrong. Thanks! Derek On Feb 9, 2009, at 2:42 AM, Tim Kroeger wrote: > Dear De

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Tim Kroeger
Dear Derek/Roy, Just to briefly join in the preconditioner discussion: Have you also thought about something like a ShellPreconditioner class (analogously to the ShellMatrix)? It's not that I would need it now, but someone (perhaps me) might need it in the future, and it would certainly be ni

Re: [Libmesh-devel] Preconditioner Base Class

2009-02-09 Thread Tim Kroeger
Dear Derek, On Fri, 6 Feb 2009, Derek Gaston wrote: > Ok - I went ahead and committed that so that I can work on the next > step... Unfortunately, it doesn't link for me. I get: /home/tim/fem-libs/libMesh/libmesh-svn/libmesh/lib/i686-pc-linux-gnu_opt/libmesh.so: undefined reference to `PCHYPR