> i simply write out the entire solution vector using print:
>
> std::ofstream out ("Species.txt", std::ios::out|std::ios::app);
> solution_species.print(out);
> out << "\n";
> out.close();
>
> and the grid data doing something like
>
> 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;
>
> }
> }
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.
> 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).
Best
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.tamu.edu/~bangerth/
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii