← Back to team overview

dolfin team mailing list archive

Behaviour of Function::vector() on instance of Function subclass

 

If I subclass Function and implement eval, then
call vector() on an object of my class, a vector
is created but initialized to zero. I would rather
expect that the function is evaluated in the function space:

GenericVector& Function::vector()
 {
   // Initialize vector of dofs if not initialized
   if (!_vector)
+  {
     init();
+    interpolate(*_vector, *_function_space);
+  }

   dolfin_assert(_vector);
   return *_vector;
}


But I'm not sure what kind of side effects this can have on other code?

Martin


Follow ups