← Back to team overview

dolfin team mailing list archive

Re: function dim

 

On Mon, Apr 16, 2007 at 12:48:28PM +0200, Garth N. Wells wrote:
> 
> 
> Anders Logg wrote:
> > On Mon, Apr 16, 2007 at 12:25:22PM +0200, Garth N. Wells wrote:
> >> For the function Function::dim,
> >>
> >>      /// Return the dimension of the value space for axis i
> >>      uint dim(unsigned int i) const;
> >>
> >> what does i correspond to? I don't understand the comment.
> >>
> >> Garth
> > 
> > The functions can generally be tensor-valued, so say that you have a
> > matrix-valued function. Then rank() returns 2 and dim() can be called
> > with argument i=0 or i=1 to return the number of rows and columns.
> >
> 
> ok.
> 
> > The size of the array values in the interpolate() function (to be used
> > by the file formats for output) should be computed as
> > 
> >     uint size = 1;
> >     for (uint i = 0; i < f.rank(); i++)
> >       size *= f.dim(i);
> >
> 
> Isn't this for a single cell only? Should the first line be
> 
>    uint size = mesh.numVertices();
> 
> Garth

Correct!

/Anders


References