Ignore:
Timestamp:
02/09/18 16:24:33 (6 years ago)
Author:
dubos
Message:

devel/unstructured : moved mesh partitioning code into meshes.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/Python/src/unstructured.pyx

    r674 r680  
    11import time 
    22import math 
    3 import dynamico.wrap as wrap 
    4 from dynamico.libs import libicosa 
     3import wrap 
     4from libs import libicosa 
     5from util import list_stencil 
    56 
    67from ctypes import c_void_p, c_int, c_double, c_bool 
     
    289290 
    290291# Helper functions and interface to ParMETIS 
    291 # list_stencil converts an adjacency graph from array format index[num_cells, MAX_EDGES] to compressed format 
    292292# loc_stencil returns the start/end indices (vtxdist) expected by ParMETIS 
    293293# i.e. index[start:end] with start=vtxdist[cell], end=vtxdist[cell+1] lists the edges of cell 'cell' 
     
    295295import numpy as np 
    296296 
    297 def list_stencil(degree, stencil, cond=lambda x:True): 
    298     for i in range(degree.size): 
    299         for j in range(degree[i]): 
    300             s=stencil[i,j] 
    301             if cond(s): yield stencil[i,j] 
    302                  
    303297def loc_stencil(degree, stencil): 
    304298    loc=0 
Note: See TracChangeset for help on using the changeset viewer.