Hi Francesc, Thanks a lot for your answer. I meant unstructured meshes. I can nowhere find any examples on this case with HDF5 in general and PyTables in particular (only some obscure info on some HDF5 Mesh API that is 4 years old since last modification). My case is: one big unstructured mesh is split into sub-meshes, some calculations are performed on each sub-mesh resulting in some solutions (scalars or vectors) per node and/or per element. Such meshes have to be merged back at the end in a smart way such that the duplicate nodes (that will be there on sub-domains boundaries) are corrected for. Therefore, I would split my question into 2 subquestions:
- where can I get started with HDF5/PyTables and unstructured meshes, handling scalars and vectors per node and element, - can I merge/append such meshes while avoiding duplicate nodes and ensuring consistent numbering of elements. Thanks a lot for any hints, - Dominik Francesc Altet wrote: > Hi Dominik, > > El dj 21 de 06 del 2007 a les 14:26 +0200, en/na Dominik Szczerba va > escriure: >> Hi, >> Is there an easy way to merge hdf5 datasets in pytables? > > What kind of datasets? The most easy way for merging Table objects is > Table.whereAppend() method. See: > > http://www.pytables.org/docs/manual/ch04.html#Table_methods > > for more info. > > For Array objects, you can always iterate over one array and append it > row to row to the other. Look at this example: > > In [1]:import numpy > In [2]:import tables > In [3]:f=tables.openFile('/tmp/test.h5', 'w') > In [4]:e1=f.createEArray(f.root, 'array1', tables.Float64Atom(), > shape=(0,300)) > In [5]:e2=f.createEArray(f.root, 'array2', tables.Float64Atom(), > shape=(0,300)) > In [6]:e1.append(numpy.empty(shape=(200,300)))In > [7]:e2.append(numpy.empty(shape=(200,300))) > In [8]:for row in e1: > ...: e2.append(row[numpy.newaxis,:]) # append e1 rows to e2 > ...: > In [9]:e2 > Out[9]: > /array2 (EArray(400L, 300)) '' > atom := Float64Atom(shape=(), dflt=0.0) > maindim := 0 > flavor := 'numpy' > byteorder := 'little' > > Of course, you can always add complexity to the "for row in e1:" loop in > order to conveniently filter the desired subset of rows. > >> I cannot google it out anywhere. >> I have unstructured sub-meshes coming from domain decomposition and I >> want to stich them back together. They share some nodes on the >> sub-domain boundaries so I want to stitch them in a clever way (like >> AppendDatasets and CleanToGrid in Paraview). Any options available? > > I have no experience with Paraview. If the solution above doesn't work > for you, ask again please. > -- Dominik Szczerba, Ph.D. Computer Vision Lab CH-8092 Zurich http://www.vision.ee.ethz.ch/~domi ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Pytables-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pytables-users
