<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">The vtkwritter does not make a copy of your data but<br>
stores a reference to the blockvector - so you are just<br>
adding the same reference again and again and when<br>
you call write the values that are in the block vector at that<br>
time are used.<br>
<br>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF968347"><font color="#000000" face="Tahoma" size="2"><b>From:</b> dune-bounces+a.s.dedner=warwick.ac.uk@dune-project.org [dune-bounces+a.s.dedner=warwick.ac.uk@dune-project.org] on behalf of DHIRENDRA VAIDYA [dhirendra22121987@gmail.com]<br>
<b>Sent:</b> Wednesday, April 18, 2012 7:14 PM<br>
<b>To:</b> dune@dune-project.org<br>
<b>Subject:</b> [Dune] vtkwriter in loop<br>
</font><br>
</div>
<div></div>
<div>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.<br>
<br>
code looks like this<br>
<br>
Dune::VTKWriter<GridView> vtkwriter(gv,Dune::VTKOptions::conforming);<br>
for(int i=0i<N;i++)<br>
{<br>
//blockvector gets modified here<br>
std::string blkv_str("blkvector");<br>
std::stringstream ss;<br>
ss<<i;<br>
blkv_str+=ss.str(); // generatrs string as blkvectori i.e i=0 string is blkvector0, for i=1 it is blkvector1<br>
vtkwriter.addVertexData(blockvector, blkv_str);<br>
}<br>
vtkwriter.write("blockvector", Dune::VTKOptions::ascii);<br>
<br clear="all">
but in .vtu file I get blkvectorN=blkvectorN-1.....=blkvector1=blkvector0<br>
-- <br>
Warm Regards,<br>
Dhirendra Vaidya<br>
VNIT Nagpur<br>
<br>
</div>
</div>
</div>
</body>
</html>