[Dune] vtkwriter in loop

DHIRENDRA VAIDYA dhirendra22121987 at gmail.com
Wed Apr 18 20:14:01 CEST 2012


I am writing program where a blockvector is geeting modified after every
iteration. I am wrting blockvector to .vtu file in every iteration. but
.vtu file replicates last entry of vector to all its previous.

code looks like this

 Dune::VTKWriter<GridView> vtkwriter(gv,Dune::VTKOptions::conforming);
for(int i=0i<N;i++)
{
//blockvector gets modified here
 std::string blkv_str("blkvector");
 std::stringstream ss;
 ss<<i;
 blkv_str+=ss.str(); // generatrs string as blkvectori i.e i=0 string is
blkvector0, for i=1 it is blkvector1
 vtkwriter.addVertexData(blockvector, blkv_str);
}
 vtkwriter.write("blockvector", Dune::VTKOptions::ascii);

but in .vtu file I get blkvectorN=blkvectorN-1.....=blkvector1=blkvector0
-- 
Warm Regards,
Dhirendra Vaidya
VNIT Nagpur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20120418/cdb02c08/attachment.htm>


More information about the Dune mailing list