1#ifndef VIENNASHE_IO_INITIALGUESS_WRITER_HPP
2#define VIENNASHE_IO_INITIALGUESS_WRITER_HPP
24#include "viennagrid/accessor.hpp"
25#include "viennagrid/io/vtk_writer.hpp"
38 template<
typename MeshT,
typename QuanAssembler>
41 typedef typename viennagrid::result_of::vertex<MeshT>::type VertexType;
42 typedef typename viennagrid::result_of::const_vertex_range<MeshT>::type VertexContainer;
43 typedef typename viennagrid::result_of::iterator<VertexContainer>::type VertexIterator;
45 VertexContainer vertices(mesh);
46 std::vector<double> vtk_data(vertices.size());
47 for(VertexIterator vit = vertices.begin(); vit != vertices.end(); vit++)
49 vtk_data[vit->id().get()] = qas.current_guess_at(*vit);
52 viennagrid::io::vtk_writer<MeshT> my_vtk_writer;
53 my_vtk_writer.add_scalar_data_on_vertices(viennagrid::make_accessor<VertexType>(vtk_data), key);
54 my_vtk_writer(mesh, key);
void write_initial_guess(MeshT const &mesh, std::string const &key, QuanAssembler qas)
Writes the inital guess to a VTK file.
The main ViennaSHE namespace. All functionality resides inside this namespace.