[Dune-devel] Updates on psurface convert

Xiaoxue Gong xiaoxue198912 at gmail.com
Sun Aug 11 15:01:39 CEST 2013


Hi! I am sorry for the delay in this updates which is due to last Friday.
In last week I was working on this point of Oliver's plan:

3. Implement an HDF5-based file format for psurface objects

Nobody will be able to use your stuff as long as we rely on the
AmiraMesh format.
(The format itself is not a secret, but the support library is
difficult to come by).

- AmiraMesh is a general-purpose file format for all kinds of
visualization-related
data.  Read the file psurface/README to learn how psurface objects are stored in
AmiraMesh files.

- Familiarize yourself with HDF5 (http://www.hdfgroup.org/HDF5/)  Find a way to
store a psurface object in HDF5 instead of AmiraMesh.  Here it is okay to use
the HDF5 support library.

- Implement HDF5 reading and writing in psurface-convert


At this point you will already have achieved quite a few useful things.


My update includes:
1. Adding more information into hdf5 data.
After discussing with Markus and reading AmiraMeshIO.cpp again, I realize
that I did not store
enough data into hdf5 data format. So I add more data into the hdf5 output:
1) Vertices positions
2)Triangles index
3)numNodesAndEdgesArray(which have local information on planer graph of
each triangles)
4)Node positions( in world coordinate, triangle index and local coordinate)
5)Node type and Node Number
6)Parameter Edges(represented in two ways: with the index of its end points
in local index and in global index)
7)Nodes on 3 regular edges of each Triangular

2.Write the function that read psurface object from hdf5 file.
 This is implemented by two functions:
1)bool readHdf5Data(const char* filename)
2)bool initFromHDF5(psurface::PSurface<2,ctype>* psurf, const char*
filename, psurface::Surface* surf)
1) reads hdf5 file and store the data containing information 1)->7) to
vector arrays in class Hdf5IO(I changed the class name Hdf5PWrite to
Hdf5IO).  2) construct the psurface object with the vector arrays in
Hdf5IO.

If you have a look at the code I write, you might find that I stored to
much information into hdf5 file. For example, I store
Node position information in both world coordinate and the local
coordinate. The local coordinate is needed because we need to read psurface
object from the hdf5 file. The world coordinate is needed to display the
nodes in paraview. I am not sure is this kinds of information duplication
is OK or not.

I have complete most part of the code and updated the code with the new
comment in https://gitorious.org/gcos/psurface-convert(git://
gitorious.org/gcos/psurface-convert.git)
My understanding of the psurface object is like this: The psurface have 3
parts, the original surface P, the target surface S and the mapping F
between them. The Mapping is represented by F^-1(S) on P. F^-1m(P) is
stored in planar graphs on P. In order to display psurface object, we
should display both original surface, planar graphs on surface and the
target surface.*
*

I tested the hdf5 writing code with the 3 example file Oliver sends me
before. The first two files could be written to hdf5 file format. But I
have some trouble with the last one, with the error message "You're trying
to read a file in the old-style AmiraMesh format".**
This am file only contains information of base triangles and base vertex. I
have not test it with the psuface object with planar graph yet.

In the pdf file sander_psurface, there is one sentence " In particular,
when using PSurface from within Amira (see Section 5), an existing Amira
surface object can be used for S2 . A pointer to S2 is then handed to the
PSurfaceFactory. At this point, the graph on S1 is the empty graph, i.e.,
there is no mapping defined anywhere on S1. The actual mapping is specified
in a separate step."
Does it mean that we could not get any Amiramesh with planar graph?

My plan for this week is:
1) Solve the undefined reference error
2) Continue working on hdf5 write and reading code until it works.

Currently I have some problem posting blogs due to the Chinese net block
police. I will ask my friends to help me post it when he is available.

Best,
Xiaoxue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20130811/d93151fb/attachment.htm>


More information about the Dune-devel mailing list