asreeve | 3 Jul 21:17
Picon

Setting up a rank-1 cell variable


Daniel and Jonathan,

I'm having some difficulty setting up a rank 1 cell variable that needs to 
be updated during sweeps.

I have three rank 0 cell variables:

head (dependant variable)
Top and Bot (values are fixed)

I calculate a saturation state (still rank 0):
satState=(1.*(head>=Top)+(head<Top)*(head-Bot)/(Top-Bot))

I need to use this to calculate a directional property.

CellSat=CellVariable(mesh=mesh,rank=1,value=1)
CellSat1=CellSat*[satState,satState,satState]

This seams to work but takes quite a long time (~2 minutes for 55000 
cells). Is there a better way to do this? I've also tried:

CellSat=CellVariable(mesh=mesh,rank=1,value=[satState,satState,satState])

but this also takes a long time.

Andy

----------------------
Andrew Reeve
Dept. of Earth Science
University of Maine
Orono, ME 04469


Gmane