← Back to team overview

dolfin team mailing list archive

Re: saving and loading function

 

On Wednesday 07 January 2009 15:03:24 Anders Logg wrote:
> On Wed, Jan 07, 2009 at 02:49:17PM +0100, Johan Hake wrote:
> > On Wednesday 07 January 2009 14:28:09 Kent Andre wrote:
> > > It seems to me that the problem is that I have created two different
> > > FunctionSpaces that are actually the same and that the test
> > > in Function is a pointer check.
> > >
> > > One could of course make a better check based on e.g. a signature.
> > > This should be trivial to do. But I will end up with using
> > > a bit more memory than needed. Is this an acceptable solution ?
> >
> > A check for the signature is not enough. Eventually we have to check for
> > the meshes in the two files being the same too.
>
> Maybe we should add a signature() function for meshes also that
> returns some kind of checksum for the mesh?

That would be nice. No clue of how to do it though. 

Would it be worth to look at the potential reuse of one of the meshes too? 
Something like:

   d1 = Function("d1.xml")
   d2 = Function("d2.xml")
   d2.function_space().set_mesh(d1.function_space().mesh())


Johan


References