Thanks for the tip. Right now, my code looks like following, where
Outlet_BC_value_new is being updated every time, so does the
Outlet_BC_value. It is my understanding that every timestep,
Outlet_BC_value_new is being over-write with new interpolated value, and
being assign to the Variable, which automatically update it with the phi
constrain. Is this somewhat similar to what you are suggesting for the
cache the memory space ?
Outlet_BC_value = Variable(value = 0.5, array = numerix.zeros((1,102)))
phi.constrain(Outlet_BC_value, where = mesh_2.exteriorFaces &
mesh_2.physicalFaces["Right"])
if for step in range(steps):
Outlet_BC_value_new = scipy.interpolate.griddata(points, values,
(xFace_2[a], yFace_2[a]), method='nearest')
Outlet_BC_value.setValue(Outlet_BC_value_new)
#Then solve equation
Best,
Zhekai
On Tue, Oct 25, 2016 at 11:44 AM, Daniel Wheeler <[email protected]>
wrote:
> On Tue, Oct 25, 2016 at 12:34 PM, Zhekai Deng
> <[email protected]> wrote:
> > Thank you. I implemented as you suggested and it works very good now.
> This
> > approach seems also applicable for the mesh that are not aligned in the
> > interface.
>
> Exactly. One thing though, it is probably a good idea to cache the
> mapping from one grid to the other as this is expensive to calculate
> (especially of you do this at every time step or sweep). We provided
> this functionality in FiPY, I'm not sure if Scipy lets you do that.
>
> --
> Daniel Wheeler
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]