[MOAB-dev] r2924 - in MOAB/trunk/tools/iMesh/python: . doc tools

jvporter at wisc.edu jvporter at wisc.edu
Tue Jun 2 18:10:04 CDT 2009


Author: jvporter
Date: 2009-06-02 18:10:03 -0500 (Tue, 02 Jun 2009)
New Revision: 2924

Added:
   MOAB/trunk/tools/iMesh/python/doc/intro.rst
Modified:
   MOAB/trunk/tools/iMesh/python/doc/conf.py
   MOAB/trunk/tools/iMesh/python/doc/ibase.rst
   MOAB/trunk/tools/iMesh/python/doc/imesh.rst
   MOAB/trunk/tools/iMesh/python/doc/index.rst
   MOAB/trunk/tools/iMesh/python/setup.py
   MOAB/trunk/tools/iMesh/python/tools/volume.py
Log:
* Bump the PyTAPS version number
* Clean up the volume ratio tool
* Add more documentation


Modified: MOAB/trunk/tools/iMesh/python/doc/conf.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/doc/conf.py	2009-06-01 21:21:49 UTC (rev 2923)
+++ MOAB/trunk/tools/iMesh/python/doc/conf.py	2009-06-02 23:10:03 UTC (rev 2924)
@@ -45,9 +45,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = '0.1'
+version = '1.0'
 # The full version, including alpha/beta/rc tags.
-release = '0.1'
+release = '1.0b1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

Modified: MOAB/trunk/tools/iMesh/python/doc/ibase.rst
===================================================================
--- MOAB/trunk/tools/iMesh/python/doc/ibase.rst	2009-06-01 21:21:49 UTC (rev 2923)
+++ MOAB/trunk/tools/iMesh/python/doc/ibase.rst	2009-06-02 23:10:03 UTC (rev 2924)
@@ -3,6 +3,7 @@
 =================
 
 .. module:: itaps.iBase
+   :synopsis: Utilities and definitions used in multiple ITAPS core interfaces.
 
 Type
 ====

Modified: MOAB/trunk/tools/iMesh/python/doc/imesh.rst
===================================================================
--- MOAB/trunk/tools/iMesh/python/doc/imesh.rst	2009-06-01 21:21:49 UTC (rev 2923)
+++ MOAB/trunk/tools/iMesh/python/doc/imesh.rst	2009-06-02 23:10:03 UTC (rev 2924)
@@ -3,6 +3,8 @@
 =================
 
 .. module:: itaps.iMesh
+   :synopsis: Basic services to manage a discrete mesh composed of sets of
+              entities.
 
 Mesh
 ====

Modified: MOAB/trunk/tools/iMesh/python/doc/index.rst
===================================================================
--- MOAB/trunk/tools/iMesh/python/doc/index.rst	2009-06-01 21:21:49 UTC (rev 2923)
+++ MOAB/trunk/tools/iMesh/python/doc/index.rst	2009-06-02 23:10:03 UTC (rev 2924)
@@ -8,6 +8,7 @@
 .. toctree::
    :maxdepth: 2
 
+   intro
    build
    ibase
    imesh

Added: MOAB/trunk/tools/iMesh/python/doc/intro.rst
===================================================================
--- MOAB/trunk/tools/iMesh/python/doc/intro.rst	                        (rev 0)
+++ MOAB/trunk/tools/iMesh/python/doc/intro.rst	2009-06-02 23:10:03 UTC (rev 2924)
@@ -0,0 +1,14 @@
+==============
+ Introduction
+==============
+
+An Example
+==========
+
+Below is a short (but complete) example of how one might use PyTAPS. The example
+accepts two mesh files (one pre- and one post-deformation) and calculates the
+volumes of the regions in each mesh. From there, it then determines the ratios
+of the volumes of each region and graphs them (or optionally prints the raw data
+to the console).
+
+.. literalinclude :: ../tools/volume.py
\ No newline at end of file

Modified: MOAB/trunk/tools/iMesh/python/setup.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/setup.py	2009-06-01 21:21:49 UTC (rev 2923)
+++ MOAB/trunk/tools/iMesh/python/setup.py	2009-06-02 23:10:03 UTC (rev 2924)
@@ -16,7 +16,7 @@
 
 
 setup(name = 'PyTAPS',
-      version = '0.1',
+      version = '1.0b1',
       description = 'Python bindings for iBase and iMesh interfaces',
       author = 'Jim Porter',
       author_email = 'jvporter at wisc.edu',

Modified: MOAB/trunk/tools/iMesh/python/tools/volume.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/tools/volume.py	2009-06-01 21:21:49 UTC (rev 2923)
+++ MOAB/trunk/tools/iMesh/python/tools/volume.py	2009-06-02 23:10:03 UTC (rev 2924)
@@ -26,10 +26,7 @@
            subvolume(coords[0], coords[1], coords[4], coords[5], coords[7]) + \
            subvolume(coords[1], coords[2], coords[5], coords[6], coords[7])
 
-def calc_volume(filename):
-    mesh = iMesh.Mesh()
-    mesh.load(filename)
-
+def calc_volume(mesh):
     volume = ndarray(mesh.rootSet.getNumOfType(iBase.Type.region), float_)
     x=0
     for i in mesh.rootSet.iterate(iBase.Type.region, iMesh.Topology.all):
@@ -55,13 +52,19 @@
     print 'Usage: python volume.py [opts] file1 file2'
     exit(1)
 
-volume_pre  = calc_volume(sys.argv[1])
-volume_post = calc_volume(sys.argv[2])
+mesh_pre = iMesh.Mesh()
+mesh_pre.load(args[0])
+mesh_post = iMesh.Mesh()
+mesh_post.load(args[1])
 
-if len(volume_pre) != len(volume_post):
+if mesh_pre. rootSet.getNumOfType(iBase.Type.region) != \
+   mesh_post.rootSet.getNumOfType(iBase.Type.region):
     print 'volume.py: Meshes should have the same number of regions'
     exit(1)
 
+volume_pre  = calc_volume(mesh_pre)
+volume_post = calc_volume(mesh_post)
+
 volume_diff = volume_pre / volume_post
 
 if options.raw:



More information about the moab-dev mailing list