[cig-commits] r7518 - cs/cigma/branches/cigma-0.9/contrib
luis at geodynamics.org
luis at geodynamics.org
Tue Jun 26 10:15:54 PDT 2007
Author: luis
Date: 2007-06-26 10:15:54 -0700 (Tue, 26 Jun 2007)
New Revision: 7518
Added:
cs/cigma/branches/cigma-0.9/contrib/bmssnog_hex8.py
Log:
darcs patch:
* Added script for importing linear hexahedral mesh with 1000m resolution
- This mesh is used in the bmssnog benchmark
Added: cs/cigma/branches/cigma-0.9/contrib/bmssnog_hex8.py
===================================================================
--- cs/cigma/branches/cigma-0.9/contrib/bmssnog_hex8.py 2007-06-26 17:14:38 UTC (rev 7517)
+++ cs/cigma/branches/cigma-0.9/contrib/bmssnog_hex8.py 2007-06-26 17:15:54 UTC (rev 7518)
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+# for the ascii data files, see the following url
+# http://geodynamics.org/cig/workinggroups/short/workarea/benchmarks/benchmark-strikeslip/results/bmssnog_1000m-pylith-np1-linhex.tar.bz2
+
+
+if __name__ == '__main__':
+
+ import numpy
+ import tables
+ from cigma.utils import readfrom
+
+ filename = 'bmssnog_hex8.h5'
+ coordinates_file = 'bmssnog_1000m_1.0.coord'
+ connectivity_file = 'bmssnog_1000m_1.0.connect'
+ (nno, nel) = (15625, 13824)
+
+ coordinates = numpy.zeros((nno,3), numpy.float32)
+ connectivity = numpy.zeros((nel,8), numpy.int32)
+
+ readfrom(coordinates_file, coordinates,
+ skip=6, factor=1.0, dtype=float, range=slice(1,4))
+
+ readfrom(connectivity_file, connectivity,
+ skip=3, offset=1, dtype=int, range=slice(4,12))
+
+ h5 = tables.openFile(filename, 'w')
+ resgroup = h5.createGroup('/', 'mesh_1000m')
+ h5.createArray(resgroup, 'coordinates', coordinates)
+ h5.createArray(resgroup, 'connectivity', connectivity)
+ h5.close()
+
+
+
More information about the cig-commits
mailing list