Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: John Peterson <jwpeterson@gm...>  20081120 17:08:28

On Thu, Nov 20, 2008 at 8:18 AM, jurak <jurak@...> wrote: > Hi, > > ther is a small bug in function > > VTKIO::solution_to_vtk(const EquationSystems& es, vtkUnstructuredGrid*& > grid) > > in vtk_io.C. On line 320 > > data>SetNumberOfValues(sys.solution>size()); > > sets the number of values too high when there is more than one variable > in sys. > (Corresponding vtufile is then filled with some garbage values.) It > should be replaced by > > data>SetNumberOfValues(n_nodes); Hmm... I think that's pretty close, but what we really want is the number of degrees of freedom for variable "j" when we are in the jloop. For Lagrange FEs there is one DoF per node per variable, but this is not the case for other finite element types. Unfortunately, I can't remember off the top of my head how to find the total number of DoFs for a particular variable. It looks like DofMap::variable_{first,last}_local_dof () gives the first (resp. last) local degree of freedom index for a particular variable. This could probably be used to obtain the total number of dofs for a given variable, by summing the result across processors. This should really be in the library somewhere, so hopefully Ben or someone more knowledgeable will comment on the right way to do it. FYI, I don't think VTKIO::solution_to_vtk() is going to work right in parallel, anyway, since it will try to access nonlocal indices of the System::current_local_solution vector.  John 