<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated" href="mailto:alexposts@free.fr">alexposts@free.fr</a> wrote:
<blockquote cite="mid:1172739408.45e69550f2cec@imp.free.fr" type="cite">
<pre wrap="">Hi,
I want to use VTK (with python : pyvtk) to visualize of 2 dimensional mesh (more
particulary adataptive mesh,</pre>
</blockquote>
<br>
VTK (and ParaView) support AMR data quite well. You will need something
that creates a vtkHierarchicalDataSet for you (2D or 3D)<br>
<br>
1)What is your data format? If that is already fixed, you will need to
write your own reader. Otherwise, you can use a VTK XML-based format<br>
<br>
2) VTK supports AMR where each grid is a VtkImageData. Regions of grids
which are "covered" by sub-grids at finer resolution are "blanked-out".<br>
<br>
A *.vtm file would look like this:<br>
<br>
<?xml version="1.0"?><br>
<VTKFile type="vtkHierarchicalBoxDataSet" version="0.1"
byte_order="LittleEndian" compressor="vtkZLibDataCompressor"><br>
<vtkHierarchicalBoxDataSet><br>
<RefinementRatio level="0" refinement="2"/><br>
<RefinementRatio level="1" refinement="4"/><br>
<DataSet group="0" dataset="0" amr_box="375 499 0 9 0 0"
file="amr2d/amr2d_3.vti"/><br>
<DataSet group="0" dataset="1" amr_box="500 624 0 9 0 0"
file="amr2d/amr2d_4.vti"/><br>
<DataSet group="1" dataset="0" amr_box="1014 1045 0 19 0 0"
file="amr2d/amr2d_8.vti"/><br>
<DataSet group="2" dataset="0" amr_box="4072 4167 0 79 0 0"
file="amr2d/amr2d_9.vti"/><br>
</vtkHierarchicalBoxDataSet><br>
</VTKFile><br>
<br>
you can see that the refinement ratio can change from one level to the
other (In this example, of a 3-level hierarchy, it is 2 and 4)<br>
each grid is defined as a standard <VTKFile type="ImageData">
file. The "group" id is the AMR level, and the amr_box represents the
coverage of the current grid with respect to the original grid in cell
coordinates. Each grid is stored in the sub-directory amr2d.<br>
<br>
I suggest looking at
<a class="moz-txt-link-freetext" href="http://www.vtk.org/doc/release/5.0/html/a01153.html">http://www.vtk.org/doc/release/5.0/html/a01153.html</a> for the
documentation of vtkAMRBox.<br>
<br>
You may also look here
<a class="moz-txt-link-freetext" href="http://www.paraview.org/doc/nightly/html/classvtkHierarchicalFractal.html">http://www.paraview.org/doc/nightly/html/classvtkHierarchicalFractal.html</a>
for an example of a source generating an AMR set.<br>
<br>
Example of a practical use can be found here
<a class="moz-txt-link-freetext" href="http://iacs.epfl.ch/colloqnum06/posters/18_Favre.pdf">http://iacs.epfl.ch/colloqnum06/posters/18_Favre.pdf</a><br>
<div class="moz-signature"><br>
-- <br>
<img src="cid:part1.01030801.09000008@cscs.ch" border="0"></div>
</body>
</html>