← Back to team overview

dolfin team mailing list archive

[noreply@xxxxxxxxxxxxx: [Branch ~dolfin-core/dolfin/main] Rev 5681: Added pretty print for MeshEntities in Python]

 

I find that to be a very efficient way to write code: first describe a
feature in a book chapter and then it gets magically implemented in
DOLFIN while I sleep. :-)

--
Anders
--- Begin Message ---
------------------------------------------------------------
revno: 5681
committer: Johan Hake <hake.dev@xxxxxxxxx>
branch nick: dolfin
timestamp: Mon 2011-02-14 20:50:43 -0800
message:
  Added pretty print for MeshEntities in Python
    -- Implementing features claimed by the comming DOLFIN chapter :)
modified:
  dolfin/swig/mesh_pre.i


--
lp:dolfin
https://code.launchpad.net/~dolfin-core/dolfin/main

Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
=== modified file 'dolfin/swig/mesh_pre.i'
--- dolfin/swig/mesh_pre.i	2011-01-31 17:20:27 +0000
+++ dolfin/swig/mesh_pre.i	2011-02-15 04:50:43 +0000
@@ -8,7 +8,7 @@
 // Modified by Johan Hake 2008-2009
 //
 // First added:  2006-09-20
-// Last changed: 2011-01-31
+// Last changed: 2011-02-14
 
 //=============================================================================
 // SWIG directives for the DOLFIN Mesh kernel module (pre)
@@ -166,6 +166,10 @@
     def entities(self, dim):
         """ Return number of incident mesh entities of given topological dimension"""
         return self.mesh().topology()(self.dim(), dim)(self.index())
+    
+    def __str__(self):
+        """Pretty print of MeshEntity"""
+        return self.str(0)
 %}
 }
 


--- End Message ---

Follow ups