> On Apr 8, 2019, at 11:30 AM, Dario Panada <dario.pan...@gmail.com> wrote: > I two initial numpy grids (n*n*n) where each value corresponds to a > source/sink. Eg: Given my source grid and coordinates (1,2,3) having value 5, > I want to set such value as a source in FiPy. That wasn't my question. When you publish your research, is your paper going to say "We put a source at array index (1,2,3)"? Why did you put it there? What physical process would you be modeling by having a source at index (1,2,3)? Would that physical process be changed by modeling a 40x40x40 grid? > I suppose I could build the entire vector of sources before and then doing a > single assignment to _array, but again you correctly mentioned that relying > on that is bad practice. If you assign to _array, I will change the FiPy codebase for the sole, spiteful purpose of breaking your code. > You mention: > > sourceGrid[..., i] = sourceRate > > Can I just please confirm what data type sourceGrid is? In the context of > defining the equation sourceGrid is a CellVariable > > eq = TransientTerm() == DiffusionTerm(coeff=D) + sourceGrid - sinkGrid > > Can sourceGrid/sinkGrid just be numpy arrays or even simple python lists? I > was under the impression they had to be CellVariable objects but could be > wrong. sourceGrid and sinkGrid must be CellVariables. _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: Setting CellVariable values
Guyer, Jonathan E. Dr. (Fed) via fipy Mon, 08 Apr 2019 11:31:03 -0700
- Setting CellVariable values Dario Panada
- Re: Setting CellVariable values Guyer, Jonathan E. Dr. (Fed) via fipy
- Re: Setting CellVariable va... Dario Panada
- Re: Setting CellVariabl... Martinus WERTS
- Re: Setting CellVar... Dario Panada
- Re: Setting CellVar... Guyer, Jonathan E. Dr. (Fed) via fipy
- Re: Setting CellVariabl... Guyer, Jonathan E. Dr. (Fed) via fipy
- Re: Setting CellVar... Dario Panada
- Re: Setting Ce... Guyer, Jonathan E. Dr. (Fed) via fipy
- Re: Settin... Dario Panada