Hey Daniel,

No problem. That is what I get for emailing late Friday afternoon! I attach
a script that I wrote during the weekend that I thought worked well. It
seems to be a generic way to generate linear interpolation in a piecewise
manner for an arbitrary number of data points. It also uses the current
features of FiPy including the CellVariable.arithmeticFaceValue and the
FaceVariable.setValue commands. Is there anything wrong with this approach?

Thanks again for all your help.

Salomon


On Mon, Jan 7, 2013 at 11:59 AM, Daniel Wheeler
<[email protected]>wrote:

>
>
>
> On Sun, Jan 6, 2013 at 9:19 PM, Salomon Turgman Cohen 
> <[email protected]>wrote:
>
>> Hello all,
>>    After some experimentation it seems to me the values of facesphi do
>> update after every time step and that the approach outlined in the second
>> email is a valid one. If I attempt to use just phi as the variable used to
>> set D I get an error due to the difference in shapes between D and phi. It
>> seems that my second email outlines the correct method to use a coefficient
>> that depends in a piecewise fashion on the variable being solved (were the
>> coeff is defined at the cell faces). Please correct me if I am wrong.
>>
>
> Use the "cases" function I provided for piecewise operations. If you want
> D to be a FaceVariable then you can either submit phi.faceValue to "cases"
> or pass D.faceValue as the coefficient.
>
>
>
>>    Would it be worthwhile to expand the mesh1D diffusion example to
>> include a piecewise version of the final part of that example in which the
>> diffusion coefficient depends linearly on concentration? I am willing to
>> write a new version of the example and post it here if there is interest to
>> make the change.
>>
>
> Sounds like a good idea. Thanks. We probably need a better solution to
> piecewise dependency than the solution that I provided due to the inherent
> inefficiencies with the "<" and "*" method. Not sure what that would be
> though.
>
> Cheers
>
> --
> Daniel Wheeler
>
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
>


-- 
Salomon Turgman Cohen
Postdoctoral Associate
Cornell University
(919) 341-9650

Attachment: fordan.py
Description: Binary data

_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to