tpism_IceGrid.i - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
 (HTM) git clone git://src.adamsgaard.dk/pism
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
       tpism_IceGrid.i (791B)
       ---
            1 %{
            2 #include "util/IceGrid.hh"
            3 %}
            4 
            5 %extend pism::IceGrid
            6 {
            7     %pythoncode {
            8     def points(self):
            9         """Iterate over tuples ``(i,j)`` of nodes owned by the current processor."""
           10         for i in range(self.xs(),self.xs()+self.xm()):
           11             for j in range(self.ys(),self.ys()+self.ym()):
           12                 yield (i,j)
           13     def points_with_ghosts(self,nGhosts=0):
           14         for i in range(self.xs()-nGhosts,self.xs()+self.xm()+nGhosts):
           15             for j in range(self.ys()-nGhosts,self.ys()+self.ym()+nGhosts):
           16                 yield (i,j)
           17     def coords(self):
           18         for i in range(self.xs(),self.xs()+self.xm()):
           19             for j in range(self.ys(),self.ys()+self.ym()):
           20                 yield (i,j,self.x(i),self.y(j))
           21     }
           22 }
           23 
           24 %shared_ptr(pism::IceGrid);
           25 %include "util/IceGrid.hh"