On Thu, Nov 20, 2008 at 8:18 AM, jurak <[EMAIL PROTECTED]> 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 vtu-file 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
j-loop. 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 non-local indices of the
System::current_local_solution vector.
--
John
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users