← Back to team overview

dolfin team mailing list archive

UserFunction::interpolate(real* values)

 

Hi,

I may have found a bug in the interpolation method for the UserFunction. In the private data there is a uint size that gets initialized to 1 in the constructor, but, as near as I can tell, does not get set anywhere else. When I try and do something like <f is a member of a BodyForce class that returns a 3D force vector and is derived from Function, thus its a UserFunction> real* xx = new real[mesh.numVertices];
   f.interpolate(xx);


I get a memory error from glibc. To make a long (painful) story short(er), I realized that in the interpolation function, local_values was of size 1 and needed to be of size 3. So I hard coded in a 3 in place of size, and things magically got better. Unfortunately, it is not clear to me how to fix this in the general case. If anyone has a suggestion, I'd be happy to try it out.

-Jake


Follow ups