dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #06954
Re: Function.vector() and solve()
2008/3/31, Anders Logg <logg@xxxxxxxxx>:
> On Sun, Mar 30, 2008 at 11:04:57PM +0200, Martin Sandve Alnæs wrote:
> > 2008/3/30, Anders Logg <logg@xxxxxxxxx>:
> > > On Sun, Mar 30, 2008 at 10:25:06PM +0200, Martin Sandve Alnæs wrote:
> > > > Then solve should be fixed to expect a GenericVector, what's the problem?
> > >
> > >
> > > Yes, but that needs some thinking. The solve() function needs to check
> > > what kind of arguments it gets and redirect to the correct backend.
> > > For example, if (A, x, b) are PETSc objects, then it needs to call a
> > > PETSc solver (which does not work through the GenericFoo interface).
> > >
> > > I guess you can work your magic try { dynamic_cast<...> } here?
> >
> > Sure, that should be easy. I'll look at it tomorrow.
>
>
> Fint!
>
> solve() ligger i dolfin/la/solve.{h,cpp}
Vector creates problems when testing the type of a GenericVector.
All code that wants to test the type of a GenericVector
will depend on Vector.
Do you really want all this type trouble just to be able to write
Vector v;
instead of
typedef FooVec Vector;
...
GenericVector *v = new Vector()
?
--
Martin
Follow ups
References