But how do you associate vertex locations with degrees of freedom in your
solution vector? They are unrelated, and if you ploy
solution(index)
at the point with index "index" then that could only by chance work.
Well I don't plot solution(index) at the point with index "index". I
plot the entire solution vector
against the entire geometry vector. Writing out the grid data by
for (; cell!=endc; ++cell)
{
for (unsigned int vertex=0;
vertex<GeometryInfo<dim>::vertices_per_cell; vertex++)
if (!vertices_hit [cell->vertex_index (vertex)])
{
point = cell->vertex (vertex) ;
index = cell->vertex_index(vertex);
out << "\t " << index << "\t " << point << "\n";
vertices_hit [cell->vertex_index (vertex)] = true;
}
}
the grid indices are not ordered by size, but they match exact with the
solution. Reshaping one of the vectors is not necessary. Just luck?
Ploting the solution over the grid data works well.
However, for the multi-component system writing out the BlockVector
solution_species
std::ofstream out ("Species.txt", std::ios::out|std::ios::app);
solution_species.block(0).print(out);
out << "\n";
out.close();
doesn't work anymore. The DoFs doesn't match with the grid data now.
Is there a simple way to associate the elements of
solution_species.block(0) with the grid points?
Not trivially. This mapping from degree of freedom index to physical location
is what the DataOut class is there for. You may also consider using the
DoFTools::map_dofs_to_support_points that for each degree of freedom tells
you what its interpolation point is (assuming your finite element has
interpolation points).
Okay - so I have to modify the output.
Thanks!
Natalie
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii