29 |
import numpy as np |
import numpy as np |
30 |
from esys.escript import Data |
from esys.escript import Data |
31 |
from esys.escript.pdetools import Locator |
from esys.escript.pdetools import Locator |
32 |
|
from cblib import toXYTuple |
33 |
|
|
34 |
# Calculate the location of quivers for a matplotlib plot |
# Calculate the location of quivers for a matplotlib plot |
35 |
# quivshape :: [x,y] :: number of quivers in x and y direction |
# quivshape :: [x,y] :: number of quivers in x and y direction |
53 |
qulocs = np.array(qulocs) #turn into a numpy array |
qulocs = np.array(qulocs) #turn into a numpy array |
54 |
return qu,qulocs |
return qu,qulocs |
55 |
|
|
|
|
|
|
|
|
|
|
|
|
# Extract the X and Y coordinates of an array |
|
|
# coords :: escript coordiantes from .getX function |
|
|
def toXYTuple(coords): |
|
|
coords = np.array(coords.toListOfTuples()) #convert to Tuple |
|
|
coordX = coords[:,0]; coordY = coords[:,1] #X and Y components. |
|
|
return coordX,coordY |
|
|
|
|
56 |
def toRegGrid(grid,domain,newx,newy,width,depth): |
def toRegGrid(grid,domain,newx,newy,width,depth): |
57 |
import pylab as pl |
import pylab as pl |
58 |
oldspacecoords=domain.getX() |
oldspacecoords=domain.getX() |