Sunday, July 14, 2013

Update on GSoC DUNE psurface work #2

Last week I am writing the code that take psurface object and writes its domain surface in vtk format. You can find the code  here git://gitorious.org/~xiaoxueiris/psurface/xiaoxueiriss-psurface.git.
It is a C-style code.  I only create some functions to treat the psurface subject.
The input is the psurface with format:
1.Patches
2.BaseGridVertexCoordss
3.BaseGridTriangles
and Plane graphs on each base grid triangles, saved as a list of nodes and a list of edges:
5. nodes
6.ParameterEdges
7.EdgePoint.
The out put is  the legency unstructured grid vtk file. The corner nodes of the triangles and the other nodes(intersection node, touching nodes, and interior nodes) are represented by d-dimensional float. The vtk file contain two kinds of cells: the triangle cell represent the BaseGridTriangle and the edge cell represent the list of edges on the triangle.  The information of the patches number and image position is not stored into vtk.

I have not test this code yet. I will use the 3 .am file to test if it works. 
There is two place that the code can be improved: 1)write it in a more object-oriented way, like dune-grid/dune/grid/io/file/vtk/vtkwriter.hh 2)write the output as XML File Formats instead of a legency one.



Tuesday, July 9, 2013

Update on GSoC DUNE psurface work

Last week my mentor Oliver Sander gives me a very detailed working plan on my project. Current I am working on the first point of the detailed plan.

"1. Write a command-line tool that can take a psurface object and write its domain surface in vtk format (which can be read by paraview). 
- Please call the program 'psurface-convert' - VTK seems to be pretty big, and I don't think I want a vtk dependence for psurface. In dune-grid/dune/grid/io/file/vtk/vtkwriter.hh there is code that writes grids in vtk format withoutexternal dependencies. That should get you started. 
 - You'll need a psurface object to tesTriangleTypet with. The easiest way toe sh=path, and use the code in AmiraMeshIO.cpp"

The file dune-grid/dune/grid/io/file/vtk/vtkwriter.hh have the class VTKWritter which takes data from class template GridView and write it into vtu format with 4 output choice( ascii, base64,appended raw, appended base 64). It fills the cell data, vertex data, position of the vertices and connectivity arrays into vtu files. 

We can read psurface subject from the Amiramesh file. Psurface project have the members triangular array, vertex array and edge array which store, the information needed to create vtk files. I created the class VTUp. In VTUp class, functions are defined to read psurface elements by elements. 

we have two vtk output file choice, the unstructured grid vtk file or the polygonal data vtk file.The polygonal dataset consists of arbitrary combinations 
of vertices, points, lines and triangular strips. The unstructured grid dataset consists of arbitrary combinations of any possible cell type. So this two is chosen to be the output format of vtk file.

I have not finished the code for #1 yet.  I hope I can make it work by Thursday. 

I have some trouble in clone the git code from
/gitorious.org/psurface/psurface.git. makedist.sh is missing in the code downloaded. The version I am using the psurface code from the DUNE website.