Re: fipy python 2.7

2017-11-13 Thread Guyer, Jonathan E. Dr. (Fed)
Not noise. We'll amend the instructions to make this clear. > On Nov 9, 2017, at 5:25 PM, James Pringle wrote: > > Worked fine. > Thank you, and apologize for the noise > Jamie > > On Thu, Nov 9, 2017 at 3:44 AM, Benny Malengier > wrote: > I suppose the normal way adding python=2.7 > to the

Re: 2D anisotropic unstructured mesh and non-classical FV schemes

2017-10-18 Thread Guyer, Jonathan E. Dr. (Fed)
Daniel is much better versed in the nuances of FV schemes than I am, but I did want to question one assertion you made: > On Oct 16, 2017, at 6:16 PM, F Hssn wrote: > > If you wish to use an unstructured Delaunay mesh, it has > to be isotropic (equilateral triangles) or near-isotropic otherwis

Re: 2 coupled convection equations - how to apply coundary conditions?

2017-10-04 Thread Guyer, Jonathan E. Dr. (Fed)
Welcome, Tanja. Your declaration of boundary conditions looks fine to me, other than being on the opposite faces (e.g., x=0 is facesLeft and x=L is facesRight) from your problem definition. FiPy is not well suited to solving purely hyperbolic PDEs and the combination of implicit solvers and st

Re: 2D Periodic Grid in Parallel

2017-09-25 Thread Guyer, Jonathan E. Dr. (Fed)
Jonathan - I see what you're talking about. Fixing (or even working around) has proven elusive so far, but I'm working on it. - Jon > On Sep 20, 2017, at 10:02 AM, Jonathan Smyth wrote: > > Hello, > > I am working on a 2D simulation of the drift-diffusion model for > semiconductors, and I'm

Re: FiPy Interest: Question about Diffusion and Convection Terms

2017-09-07 Thread Guyer, Jonathan E. Dr. (Fed)
Nicholas - Please see the end of https://www.ctcms.nist.gov/fipy/examples/diffusion/generated/examples.diffusion.mesh1D.html Search for the text "Often, the diffusivity is not only non-uniform, but also depends on the value of the variable" (the Search function built into the web page isn't wo

Re: PyTrilinos import error Mac OS

2017-08-25 Thread Guyer, Jonathan E. Dr. (Fed)
of 4 > mpi4py: processor 3 of 4 :: PyTrilinos: processor 3 of 4 :: FiPy: 6 cells on > processor 3 of 4 > mpi4py: processor 2 of 4 :: PyTrilinos: processor 2 of 4 :: FiPy: 6 cells on > processor 2 of 4 > > Thanks! > > Bill Seufzer, PhD > NASA Langley Research Center &g

Re: PyTrilinos import error Mac OS

2017-08-25 Thread Guyer, Jonathan E. Dr. (Fed)
Make that `activate ` on Windows > On Aug 25, 2017, at 12:54 PM, Guyer, Jonathan E. Dr. (Fed) > wrote: > > OK, multiple things are messed up here and I'm not sure any of them are > related to Apple possibly moving things. > > Things should work on Mac OS X and Linu

Re: PyTrilinos import error Mac OS

2017-08-25 Thread Guyer, Jonathan E. Dr. (Fed)
M, Guyer, Jonathan E. Dr. (Fed) > wrote: > > Apple moved something between 10.11 and 10.12. It looks like my rebuild for > 10.12 from a few weeks ago broke 10.11. I'll have to figure out how to post > both versions (and rebuild the 10.11 version at all). > > >> On Au

Re: PyTrilinos import error Mac OS

2017-08-22 Thread Guyer, Jonathan E. Dr. (Fed)
Apple moved something between 10.11 and 10.12. It looks like my rebuild for 10.12 from a few weeks ago broke 10.11. I'll have to figure out how to post both versions (and rebuild the 10.11 version at all). > On Aug 22, 2017, at 9:58 AM, Seufzer, William J. (LARC-D307) > wrote: > > I get the

Re: Convergence problem while increasing domain size

2017-07-25 Thread Guyer, Jonathan E. Dr. (Fed)
Clara - The mesh needs to be fine enough to resolve the interfaces. How thick is the phase interface for your parameters? Generally, you need O(10) grid points across the interface. - Jon > On Jul 25, 2017, at 1:50 PM, Clara Maurel wrote: > > Hello, > > Sorry in advance if my question is v

Re: Using FiPy to solve a 1D diffusion problem under a potential profile

2017-07-18 Thread Guyer, Jonathan E. Dr. (Fed)
Other than a change of sign on the ConvectionTerm, I don't see any problem with how you wrote your equation. There's not much to do to debug a seg fault, other than isolate what line of code is causing it. Comment out all the lines in your code and successively add them until the seg fault occu

Re: installation problem, Enthought Canopy: fipy/test generates errors and failures

2017-07-17 Thread Guyer, Jonathan E. Dr. (Fed)
Rupert - 3.1-17 isn't a version number that we generate (specifically, the -17 part). Where did you get it? Is this the version of FiPy in the Canopy distribution? The failures involving _indexShape are nothing to worry about. The output is not literally what FiPy was expecting (long integer v

Re: python 3

2017-06-07 Thread Guyer, Jonathan E. Dr. (Fed)
Yes. More likely to happen is that we'll add support for PETSc, but that's not imminent, either. > On Jun 7, 2017, at 3:08 PM, Michael J. Waters wrote: > > Hi Daniel, > > So FiPy running in Python 3 won't have MPI based parallelism until > PyTrilinos supports Python 3? > > Best, > > -Mike >

Re: solvers for elliptic equations with dominant lower order terms

2017-06-01 Thread Guyer, Jonathan E. Dr. (Fed)
Unfortunately, James notified me offline of a breakage in PyTrilinos on Macs. I need to find time to debug. - Jon > On Jun 1, 2017, at 11:37 AM, Daniel Wheeler wrote: > > Hi James, > > I don't have any hints for preconditioners, but using Trilinos's GMRES > and then systematically changing th

Re: Webinar

2017-05-23 Thread Guyer, Jonathan E. Dr. (Fed)
We have not done so, but do sometimes teach in the context of other workshops or summer schools. We'll take this under advisement. > On May 23, 2017, at 2:14 PM, Sergio Manzetti > wrote: > > Hi, do NIST organize or has organized a Webinar for beginners using FiPY? > > Best wishes > Sergio >

Re: Complex conjugates in FiPY

2017-05-23 Thread Guyer, Jonathan E. Dr. (Fed)
In (intentionally) provocative terms, PDEs with analytical solutions aren't good for anything. If I want to develop a qualitative understanding of the neutron flux and temperature in a nuclear reactor, I can make considerable headway with Bessel functions in cylindrically symmetric coordinates

Re: Complex conjugates in FiPY

2017-05-23 Thread Guyer, Jonathan E. Dr. (Fed)
Have you worked through the examples on our website and in our manual? > On May 23, 2017, at 9:58 AM, Sergio Manzetti > wrote: > > Dear Jonathan. Thank your for this clarification. Can you recommend me a > tutorial or a paper of numerical simuation which shows the use of the > numerical outp

Re: Complex conjugates in FiPY

2017-05-23 Thread Guyer, Jonathan E. Dr. (Fed)
> On May 23, 2017, at 8:05 AM, Sergio Manzetti > wrote: > > I am not sure what the script does, when one sets a phi value before the > given PDE...when I thought that the phi value was found exactly by FipY? Setting phi before solving the PDE is setting the initial condition. FiPy is designe

Re: Complex conjugates in FiPY

2017-05-23 Thread Guyer, Jonathan E. Dr. (Fed)
> On May 23, 2017, at 8:09 AM, Sergio Manzetti > wrote: > Were can one find the function that results as the solution to the given PDE > in FiPY? For isntance, if this solution was phi = sec²(x) can FiPY print it > out? No. FiPy is a numerical PDE solver. It knows nothing about your analyti

Re: Assign FaceVariable value based on submesh ID

2017-05-21 Thread Guyer, Jonathan E. Dr. (Fed)
Surface("top")) give me all the faces in this > domain (not just faces on one line). > > If I just use mesh.physicalFaces["Top"], it will just return error because > "Top" in my case is a "Physical Surface" not a "Physical Line". >

Re: Assign FaceVariable value based on submesh ID

2017-05-12 Thread Guyer, Jonathan E. Dr. (Fed)
There is also a .physicalFaces field defined for a gmsh mesh. > On May 11, 2017, at 6:39 PM, Zhekai Deng > wrote: > > Hi All, > > I wonder is there any way to specify the FaceVariable based on the naming > from gmsh ? For example, I name my sub domain in gmsh as "top" and "bottom". > In Fip

Re: How is discretization handled in 1D and 2D?

2017-05-09 Thread Guyer, Jonathan E. Dr. (Fed)
; S0 + ImplicitSourceTerm(coeff = S1) + noise / M_phi > > I deeply appreciate any help regarding this issue, > > Thank you and best regards, > Anders > > From: fipy-boun...@nist.gov on behalf of Guyer, > Jonathan E. Dr. (Fed) > Sent: Friday, May 5, 2017 9:58:02 PM

Re: How is discretization handled in 1D and 2D?

2017-05-05 Thread Guyer, Jonathan E. Dr. (Fed)
FiPy doesn't apply units explicitly (well, it can, but they don't propagate into the solver matrix and nobody uses them but me AFAICT). In 1D you can view cell volume as dx x 1 m x 1 m (m**3) face area as 1 m x 1 m (m**2) or cell volume as just dx (m) face area as dimensionless S

Re: bug in Neumann boundary condition to Laplacian

2017-05-05 Thread Guyer, Jonathan E. Dr. (Fed)
Jamie - Sorry it took so long to get back to this. I'd actually figured out what the issue was several days ago, but I haven't had time to verify and write anything up until now. The short answer is that you need to constrain the gradient of PsiInvert to be equal to the gradient of PsiTruth, b

Re: gradients on faces

2017-04-26 Thread Guyer, Jonathan E. Dr. (Fed)
the .faceGrad.constrain() is not constraining the solution to Poisson's > equation properly. I have given a clearer example of that in a follow on > email titled "bug in Neumann boundary condition to Laplacian" > > Thanks, > Jamie > > On Wed, Apr 26, 2017 at 12:06 PM

Re: gradients on faces

2017-04-26 Thread Guyer, Jonathan E. Dr. (Fed)
James - Thank you for your test script. It helped me understand what you were seeing and what behavior you were looking for. I've put together a notebook that I think concisely illustrates the source of the behavior you're encountering. https://gist.github.com/guyer/6b7699531f75b353f49a0cf36d

Re: Multiple Plots on One Viewer Not Working As expected

2017-04-21 Thread Guyer, Jonathan E. Dr. (Fed)
For some reason, I think FiPy is invoking a MultiViewer to display your two CellVariables, and MultiViewer doesn't support the filename= argument. My guess is that copy.deepcopy is resulting in two CellVariables defined on identical but different Meshes. FiPy does not attempt to view different M

Re: cauchy boundary condition

2017-04-14 Thread Guyer, Jonathan E. Dr. (Fed)
Thanks for the update. I did try to assign a Dirichlet and Neumann condition to the same boundary for a simple diffusion problem and found that it doesn't work. I'm pretty sure what I did was mathematically well-posed, but FiPy didn't like it. I haven't worked my way through the matrix discret

Re: Steppers

2017-02-23 Thread Guyer, Jonathan E. Dr. (Fed)
Nope. Those classes were written about a decade ago and have not been used since then, to my knowledge. I've tried a couple of times to implement some form of stepper class and found that it's easier to just implement the logic I want directly in the script. > On Feb 23, 2017, at 10:31 AM, Ad

Re: Question on accessing internal matrices of the system being solved

2017-02-09 Thread Guyer, Jonathan E. Dr. (Fed)
that you could > provide a code example? I'm afraid we don't know where to start in this case. > > With best regards, > > - Ian & Krishna > > > > -Original Message- > From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of &g

Re: Variable.getValue()

2017-02-09 Thread Guyer, Jonathan E. Dr. (Fed)
Anders - You should be able to do x = mesh.x[(phi == 0.5).value] or x = mesh.cellCenters[0, (phi == 0.5).value] or x = mesh.cellCenters[0][(phi == 0.5).value] Note: if you're doing something like a phase field or level set model you may find that phi isn't exactly 0.5, so you may wa

Re: Parallel speedup

2017-02-07 Thread Guyer, Jonathan E. Dr. (Fed)
To change the solver/preconditioner, I recommend >>> from fipy import LinearGMRESSolver, JacobiPreconditioner and then when you call solve() or sweep(), write ... eq.solve(phi, dt=dt, solver=LinearGMRESSolver(precon=JacobiPreconditioner())) I see the issue you report with the script as w

Re: Trilinos error in Anaconda installation in OsX

2017-02-07 Thread Guyer, Jonathan E. Dr. (Fed)
OK, thank you. I built on Sierra. I'll have to find an El Cap machine to test on to see what Apple changed in the Accelerate framework. > On Feb 6, 2017, at 4:05 PM, Adrian Jacobo > wrote: > > Jon > > Here is the error message I get when I try to run the Anaconda installation > of FiPy usin

Re: Parallel speedup

2017-02-06 Thread Guyer, Jonathan E. Dr. (Fed)
Adrian - You're running examples.cahnHilliard.mesh2DCoupled? There are a couple of issues with the example as posted: - There is a sign error in this example. It was fixed over a year ago, but never merged to master or released as a tarball. You can run our develop branch, or manually apply th

Re: Question on accessing internal matrices of the system being solved

2017-01-26 Thread Guyer, Jonathan E. Dr. (Fed)
I would imagine you could subclass TransientTerm such that it did not contribute to the matrix and RHS. > On Jan 25, 2017, at 2:16 PM, Gopalakrishnan, Krishnakumar > wrote: > > Hi Dan, > > Thanks a lot for your reply. Based on this, Ian and I have a further question. > > Is it possible to i

Re: Question on accessing internal matrices of the system being solved

2017-01-12 Thread Guyer, Jonathan E. Dr. (Fed)
By "display", I mean show a color map. It's not quantitative, but it can be useful to understand the stencil being generated. > On Jan 12, 2017, at 10:53 AM, Guyer, Jonathan E. Dr. (Fed) > wrote: > > In addition to this, if you define an environment variable >

Re: Question on accessing internal matrices of the system being solved

2017-01-12 Thread Guyer, Jonathan E. Dr. (Fed)
In addition to this, if you define an environment variable FIPY_DISPLAY_MATRIX, then FiPy will display the matrix and RHS vector. If FIPY_DISPLAY_MATRIX contains "terms", then the contribution of each term will be displayed before the aggregate matrix and vector are displayed. If FIPY_DISPLAY_M

Re: Mailing list archive

2016-11-28 Thread Guyer, Jonathan E. Dr. (Fed)
Yep. I started to do that awhile ago and got stymied by something or other. Time to get back to it. > On Nov 23, 2016, at 10:06 AM, Raymond Smith wrote: > > Oh, thanks! You may want to update the pointer on the FiPy website when you > get a chance to avoid having to deal with more of these sor

Re: source term with

2016-11-17 Thread Guyer, Jonathan E. Dr. (Fed)
I don't believe there's anything you can do with the solver to enforce this constraint, but you can just manually "fix" the concentration in your sweep/solve loop. This is how the "double obstacle potential" (infinite energy barrier at zero concentration) is algorithmically implemented in my fie

Re: Question on time-marching scheme in Fipy

2016-10-21 Thread Guyer, Jonathan E. Dr. (Fed)
yes > On Oct 20, 2016, at 10:55 AM, Campbell, Ian > wrote: > > Hi Daniel, > > With regards to your answer: > > "It's fully implicit unless the user sets it up in a different way" > > Just to confirm what I understand from this and from your 2009 paper, alpha > in FiPy is 1.0 by default, an

Re: sweep with more than one variable

2016-10-21 Thread Guyer, Jonathan E. Dr. (Fed)
Form a couple equation eqn = eqn_ux & eon_uy and then call eqn.sweep(...) on that. With coupled equations, you don't pass a variable to sweep. > On Oct 20, 2016, at 6:56 AM, Francisco Vega Reyes wrote: > > Hello, > > Is it possible to express in a simple way the sweep method for more than

Re: Memory Leakage & Object Build-up with FiPy Sweeps

2016-10-11 Thread Guyer, Jonathan E. Dr. (Fed)
I have access to their code. Ian, please provide an explicit recipe for demonstrating the leak with the code in your github repo. - Jon > On Oct 11, 2016, at 11:15 AM, Daniel Wheeler > wrote: > > Hi Ian, > > Could you possible post your code or a version of the code that demonstrates > the

Re: problem with my initial conditions

2016-10-05 Thread Guyer, Jonathan E. Dr. (Fed)
Good suggestion, but `u.value = ___` and `u.setValue(___)` *should* do the same thing in this instance. > On Oct 5, 2016, at 11:16 AM, Raymond Smith wrote: > > Hi, Damien. > > Try using u.setValue(0.5 + 0.5*sin(pi*x)*sin(pi*y)) and similarly for v. > These lines could naturally be placed righ

from math import *

2016-10-05 Thread Guyer, Jonathan E. Dr. (Fed)
I see the standard python math library imported a lot in examples provided by fipy users. Please don't do this. The math library supplies nothing useful for fipy (anything useful in math is available from numpy, which we provide as numerix). As seen in the example of M. Chudeau, math can ove

Re: problem with my initial conditions

2016-10-05 Thread Guyer, Jonathan E. Dr. (Fed)
I suspect the problem is that by doing `from math import *`, you are importing a version of the `sin` function that only operates on single numbers, not on fields. As a result, u and v get assigned uniform values. `from numpy import *` would be better. `from fipy.tools.numerix import *` would be

Re: FiPy sweep convergence bottoms out

2016-09-27 Thread Guyer, Jonathan E. Dr. (Fed)
p 27, 2016 at 3:57 PM, Guyer, Jonathan E. Dr. (Fed) > wrote: > I don't understand what you mean by "supra-linear trend in the semiology > plot". You show clear 2nd order convergence, which is what I would expect. > > > On Sep 27, 2016, at 4:37 PM, Krishna wrot

Re: FiPy sweep convergence bottoms out

2016-09-27 Thread Guyer, Jonathan E. Dr. (Fed)
I don't understand what you mean by "supra-linear trend in the semiology plot". You show clear 2nd order convergence, which is what I would expect. > On Sep 27, 2016, at 4:37 PM, Krishna wrote: > > As you can see, we need supra-linear trend in the semiology plot, such as to > continue with th

Re: Dynamic under-relaxation factors for FiPy sweep

2016-09-20 Thread Guyer, Jonathan E. Dr. (Fed)
There isn't enough here to tell what's going on. Can you show us the code? > On Sep 19, 2016, at 6:53 PM, Gopalakrishnan, Krishnakumar > wrote: > > Hi Dan, > > Thanks for your suggestion to use the ResidualTerm as per your gist posting > https://gist.github.com/guyer/f29c759fd7f0f01363b8483c7

Re: Applying Two Different Diffusion Coefficients at Single FV Face

2016-09-16 Thread Guyer, Jonathan E. Dr. (Fed)
Yes! > On Sep 16, 2016, at 2:18 PM, Raymond Smith wrote: > > A side note, here it may actually be more convenient to think about the D in > terms of the volumes, so you could also define it as a cell variable with > values specified as D1 when x<=1 and D2 when x>1, then use the > harmonicFace

Re: sources errors in advection/diffusion problems, and one solution

2016-09-16 Thread Guyer, Jonathan E. Dr. (Fed)
James - I think Daniel will have more insight into why this is happening and if there is anything to be done about it besides artificial relaxation, but I just want to say how much I appreciate your putting this together. This is a very lucid illustration. - Jon > On Sep 15, 2016, at 5:13 PM,

Re: Solving advection, segregation and diffusion equation

2016-09-14 Thread Guyer, Jonathan E. Dr. (Fed)
> On Sep 14, 2016, at 12:49 PM, Zhekai Deng > wrote: > > So, in my previous one, I only have constraints on left (fixed 0.5 inlet > concentration), top and bottom ( the boundary conditions that I applied), but > not boundary condition on the right. I have implemented an additional one on > t

Re: Solving advection, segregation and diffusion equation

2016-09-13 Thread Guyer, Jonathan E. Dr. (Fed)
Zhekai - 1. I think what you have is fine. Explicitly, I'd write: phi.faceGrad.constrain(..., where=mesh.facesTop | mesh.facesBottom) See http://www.ctcms.nist.gov/fipy/documentation/USAGE.html#applying-spatially-varying-boundary-conditions 2. For inlet/outlet conditions, please see the com

Re: Compiling Trilinos on Arch/Antegros Linux

2016-09-13 Thread Guyer, Jonathan E. Dr. (Fed)
Thanks, Michael! > On Sep 13, 2016, at 4:15 PM, Michael Waters wrote: > > Hello Everyone! > > I've compiled Trilinos on Antegros Linux. I'm sharing my build script > since it can be tedious to make one from scratch. > > cmake \ > -D TPL_ENABLE_MPI=ON \ > -D BUILD_SHARED_LIBS=ON \ >

Re: Coupling Boundary Condition of one PDE with source term of another PDE

2016-09-13 Thread Guyer, Jonathan E. Dr. (Fed)
d > > > In effect, my question is that, if the diffusion coefficient along all other > faces is set to zero, do we still need the coeff=[[[S, 0.], [0., 0.]]]) in > order to restrict the PDE to the axial direction ? > > > Best Regards > > Ian and Krishna >

Re: Essential trilinos packages for Fipy

2016-09-01 Thread Guyer, Jonathan E. Dr. (Fed)
. This helps. Doesn't Trilinos auto-detect MPI, Python and SWIG > file paths ? > > > Krishna > > -Original Message- > From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of > Guyer, Jonathan E. Dr. (Fed) > Sent: Thursday, September 1, 2016

Re: Essential trilinos packages for Fipy

2016-09-01 Thread Guyer, Jonathan E. Dr. (Fed)
I've been trying to get a conda build of trilinos (and other FiPy prerequisites) put together, but have not had time to ensure that the stack is robust on all platforms. If you're comfortable with conda, what I have is available from the 'guyer' channel at anaconda.org. My current trilinos buil

Re: Setting zero-flux external boundary conditions in FiPy 3

2016-08-29 Thread Guyer, Jonathan E. Dr. (Fed)
gt; P.S. Would you recommend "sweeping" in a time-evolving problem that's as > simple as the one in my script? > > On Mon, Aug 29, 2016 at 12:54 PM, Guyer, Jonathan E. Dr. (Fed) > wrote: > The script as you supplied it had the constraint commented out. You said the &g

Re: Setting zero-flux external boundary conditions in FiPy 3

2016-08-29 Thread Guyer, Jonathan E. Dr. (Fed)
gt; So if I understand correctly, what you're saying is that my script, as it is > now (without sweeping), is generating incorrect results even though the > solution appears conserved? ​ > > On Mon, Aug 29, 2016 at 9:55 AM, Guyer, Jonathan E. Dr. (Fed) > wrote: > E

Re: Unknown parallel running problem

2016-08-29 Thread Guyer, Jonathan E. Dr. (Fed)
phi1.globalValue will return the value over the entire domain > On Aug 29, 2016, at 10:50 AM, ronghai wu wrote: > > > > On 29/08/16 15:06, Guyer, Jonathan E. Dr. (Fed) wrote: >> Hard to say. Diagnosing parallel race conditions is neither easy nor >> entertainin

Re: Non-linear convection term

2016-08-29 Thread Guyer, Jonathan E. Dr. (Fed)
The particular issue you're having is that (0.5 * phi,) is not a rank-1 Variable, it's a tuple (list) of rank-0 Variable(s). FiPy doesn't know what to do with this. coeff=phi*[[0.5]] should do better. That said, FiPy is not well suited to hyperbolic problems and Jamie has pointed to some of th

Re: Setting zero-flux external boundary conditions in FiPy 3

2016-08-29 Thread Guyer, Jonathan E. Dr. (Fed)
exactly the same results. Is this because > FiPy assumes Robin BC if given no specification? > > Thanks, > Yun > > > On Thu, Aug 25, 2016 at 10:52 AM, Guyer, Jonathan E. Dr. (Fed) > wrote: > I'm not sure why you conclude from that example that > > va

Re: Unknown parallel running problem

2016-08-29 Thread Guyer, Jonathan E. Dr. (Fed)
Hard to say. Diagnosing parallel race conditions is neither easy nor entertaining. Could be that you just need a comm.Barrier() call before the comm.bcast() calls. One possible issue is that FiPy automatically partitions the mesh when it detects that it is running in parallel, so the result of

Re: Setting zero-flux external boundary conditions in FiPy 3

2016-08-25 Thread Guyer, Jonathan E. Dr. (Fed)
I'm not sure why you conclude from that example that var.faceGrad.constrain(0, where=m.exteriorFaces) only applies to the advection component. Where does it say that? In the code you sent, with eq3 = TransientTerm() == DiffusionTerm(coeff=D)+ convection(coeff=faceVelocity) the flux is

Re: Diffusion-Convection-Reactive Chemisty

2016-07-28 Thread Guyer, Jonathan E. Dr. (Fed)
it and see if it changes my value. > > Thanks > > On Wed, Jul 27, 2016 at 10:37 PM, Guyer, Jonathan E. Dr. (Fed) > wrote: > I recommend you work through and check your units in all equations. I don't > have any intuition for what's a big value and what's small

Re: Complex PDE Coupling; Extending to a Further PDE

2016-07-27 Thread Guyer, Jonathan E. Dr. (Fed)
Q1: You should be able to solve some equations coupled and others uncoupled. You'll need to sweep them all together. Better would be to figure out how to couple them all. I don't recommend doing them uncoupled, I just couldn't quickly get it to work. Q2: In general, the coupled forms should con

Re: How to impose faceGrad.constrain with a numpy array ?

2016-07-27 Thread Guyer, Jonathan E. Dr. (Fed)
Try _Az.faceGrad.constrain( _By.arithmeticFaceValue * mesh._orientedFaceNormals, where = mesh.facesLeft) _Az.faceGrad.constrain(-_By.arithmeticFaceValue * mesh._orientedFaceNormals, where = mesh.facesRight) _Az.faceGrad.constrain(-_Bx.arithmeticFaceValue * mesh._orientedFaceNormals, wher

away for awhile

2016-07-27 Thread Guyer, Jonathan E. Dr. (Fed)
I'm going to be on leave without any email until the middle of August. Daniel should be back in the office next week. Replies from us may be slow for awhile. ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https

Re: Problem with string script input Gmsh

2016-07-27 Thread Guyer, Jonathan E. Dr. (Fed)
I think it's possible that Popen can't find gmsh, rather than not being able to find your .geo or .msh file. I'm not in a position to diagnose right now, but hopefully somebody familiar with Windows can help you diagnose. My approach would be to write some simple scripts, separate from FiPy, to

Re: Diffusion-Convection-Reactive Chemisty

2016-07-27 Thread Guyer, Jonathan E. Dr. (Fed)
to try and clarify things. As it > stands, the coefficients (D, k1, k2, keff) in the code give me a > concentration profile I expect but not a temperature one. > > Thank you, > > Daniel DeSantis > > On Thu, Jul 14, 2016 at 10:36 AM, Daniel DeSantis wrote: > Thank yo

Re: Coupling Boundary Condition of one PDE with source term of another PDE

2016-07-27 Thread Guyer, Jonathan E. Dr. (Fed)
or PDE1 since the PDE is implicit, i.e. the >> source term on the right is defined by f(w, a), where a is the CellVariable. >> This should pin down the value at the left boundary and hence make the >> physics valid. How can we massage your gist code to be amenable to this? >>

Re: Coupling Boundary Condition of one PDE with source term of another PDE

2016-07-26 Thread Guyer, Jonathan E. Dr. (Fed)
Variable. > This should pin down the value at the left boundary and hence make the > physics valid. How can we massage your gist code to be amenable to this? > > > Best Regards, > > Krishna > > > -Original Message----- > From: fipy-boun...@nist.gov [mailto

Re: faceGradAverage broken or I am confused?

2016-07-18 Thread Guyer, Jonathan E. Dr. (Fed)
I.e. > do they return the gradient or the gradient projected onto the unit normal to > the face? > >If it is the former, there is also a problem in faceGrad. > > Thanks! > Jamie > > On Mon, Jul 18, 2016 at 1:23 PM, Guyer, Jonathan E. Dr. (Fed) > wrote: > J

Re: faceGradAverage broken or I am confused?

2016-07-18 Thread Guyer, Jonathan E. Dr. (Fed)
James - I didn't even know we had a .faceGradAverage! The issue turns out to be with .grad (.faceGradAverage is calculated from .grad and .grad is calculated from .faceValue, whereas .faceGrad is calculated from .value (at cell centers)). Neither .grad nor .faceGradAverage is used in calculat

Re: Coupling Boundary Condition of one PDE with source term of another PDE

2016-07-14 Thread Guyer, Jonathan E. Dr. (Fed)
My gut reaction is that the second implementation is probably better, as it should be possible to make things more implicit and coupled, even though you're "wasting" calculation of PDE1 over most of the 2D domain where you don't care about it. > On Jul 14, 2016, at 11:1

Re: Coupling Boundary Condition of one PDE with source term of another PDE

2016-07-14 Thread Guyer, Jonathan E. Dr. (Fed)
> What’s the best way to implement this problem in FiPy? Don't! Assuming you won't take that advise, I've posted a couple of attempts at this problem at: https://gist.github.com/guyer/bb199559c00f6047d466daa18554d83d > On Jul 9, 2016, at 1:37 PM, Gopalakrishnan, Krishnakumar > wrote: >

Re: Diffusion-Convection-Reactive Chemisty

2016-07-13 Thread Guyer, Jonathan E. Dr. (Fed)
That should be OK. FiPy automatically maps the constraint onto the faceValue of a CellVariable. > On Jul 13, 2016, at 3:26 PM, Keller, Trevor (Fed) > wrote: > > Is the definition of C_a_BC correct? For a 1D grid, is the behavior of > C_a.constrain(C_a_BC, where=mesh.facesRight) > with a Ce

Re: Casting non-linear source terms in FiPy

2016-07-13 Thread Guyer, Jonathan E. Dr. (Fed)
The way you've written it is correct. There's no way to make such a term implicit, so just write it as it appears. > On Jul 13, 2016, at 12:26 PM, Gopalakrishnan, Krishnakumar > wrote: > > > Hello, > > I have an equation of the form: > > nabla.(D grad (phi)) = exp(a*phi – K) - exp(-(b*phi

Re: Possibility of setting NaN constraints for CellVariable ?

2016-07-13 Thread Guyer, Jonathan E. Dr. (Fed)
You can't do this. NaNs immediately propagate and will break your whole solution. If I had to do this, I would decouple this region from the other equations by zeroing out the coefficients of those other equations in the appropriate region. > On Jul 13, 2016, at 8:49 AM, Gopalakrishnan, Krishna

Re: How do we handle logarithmic partial derivatives in FiPy

2016-07-07 Thread Guyer, Jonathan E. Dr. (Fed)
b*d_(ln_phi2)/dx = (b / phi2) (d phi2 / dx) but because (1/phi2) appears outside the gradient, you still won't be able to handle this implicitly. I would just write an explicit source term: b*log(phi2).grad.mag > On Jul 6, 2016, at 3:13 PM, Gopalakrishnan, Krishnakumar > wrote: > > Hello,

Re: Gradient boundary conditions for spherical shell

2016-07-05 Thread Guyer, Jonathan E. Dr. (Fed)
Thanks for posting your realization about .faceNormals. For completeness, I would approach your problem by constructing your patch of spherical shell in 3D space, rather than trying to change the coefficients. See examples/cahnHilliard/sphere.py where we do exactly that. The key is to extrude t

Re: determine cell neighbors.

2016-07-01 Thread Guyer, Jonathan E. Dr. (Fed)
You want `mesh._cellToCellIDs`. This isn't a basic question at all. We don't encourage thinking about the discretized mesh and don't make it easy. _cellToCellIDs isn't documented anywhere as far as I can tell. > On Jun 29, 2016, at 4:07 PM, James Pringle wrote: > > I have to find a group of c

Re: Can I get the value of cellVariable at a certain cell via coordinate of cellCenter?

2016-07-01 Thread Guyer, Jonathan E. Dr. (Fed)
This is provided by the special `__call__` method of a CellVariable, which you would invoke with `var([[xval], [yval]])`. >>> help(fp.CellVariable.__call__) Help on method __call__ in module fipy.variables.cellVariable: __call__(self, points=None, order=0, nearestCellIDs=None) unbound fipy.var

Re: FiPy for nonlinear, coupled PDEs in multiple independent variables

2016-06-28 Thread Guyer, Jonathan E. Dr. (Fed)
> On Jun 27, 2016, at 6:44 PM, Abhilash Mathews wrote: > > Fair enough, thank you for the clarification. I've updated the code > accordingly: > When coupling the equations, should it be done separately for the partial > derivatives with respect to time and z (i.e. eq1, eq2, and eq3 are coupl

Re: FiPy for nonlinear, coupled PDEs in multiple independent variables

2016-06-27 Thread Guyer, Jonathan E. Dr. (Fed)
example of > cahnHiliard.mesh2Dcoupled closely and notice their mesh is x and y while I am > assigning mine as z (I am only considering one spatial variable at the > moment) and t. Without making the grid 2D, I was unable to set boundary > conditions for z and t. (I assume the

Re: FiPy for nonlinear, coupled PDEs in multiple independent variables

2016-06-27 Thread Guyer, Jonathan E. Dr. (Fed)
You have nothing here to actually couple the equations. At a minimum, you need to sweep each timestep to convergence. See: http://www.ctcms.nist.gov/fipy/documentation/FAQ.html#iterations-timesteps-and-sweeps-oh-my Better would be to formally couple the equations. See: http://www.ctcms.nis

Re: casting implicit Boundary Conditions in FiPy

2016-06-23 Thread Guyer, Jonathan E. Dr. (Fed)
> On Jun 23, 2016, at 10:23 AM, Daniel Wheeler > wrote: > > I'm not sure what the thinking is of your colleagues, but the size of > the elements has little or no impact on conservation. In finite > volume, the equations are conservative to at least the precision of > the linear solver (if not m

Re: bug in linearBicgstabSolver.py

2016-06-22 Thread Guyer, Jonathan E. Dr. (Fed)
That's terrible. Not to name any names, but Daniel did that about five years ago. I've submitted a fix at https://github.com/usnistgov/fipy/pull/497 > On Jun 21, 2016, at 9:22 PM, James Pringle wrote: > > The document string for fipy.solvers.scipy.linearBicgstabSolver.py claims it > takes th

Re: Trouble layering 2D plots using FiPy viewer functions

2016-06-21 Thread Guyer, Jonathan E. Dr. (Fed)
Plotting order can be hard to figure out in matplotlib. I suggest you use the custom viewer class in examples/phase/anisotropy.py as template, along these lines: class YunTauViewer(Matplotlib2DGridViewer): def __init__(self, phi, title=None, limits={}, **kwlimits): self.phi = p

Re: casting implicit Boundary Conditions in FiPy

2016-06-17 Thread Guyer, Jonathan E. Dr. (Fed)
Gmsh does do 1D meshes, and I've got experimental code that imports them, but it's not ready to merge, yet. In the meantime, this approach I've used for modeling semiconductor device contacts in 1D is probably better: n_thickness = 1e-6 # m p_thickness = 149e-6 # m grid_resolution = 5e-8

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread Guyer, Jonathan E. Dr. (Fed)
you, this is exactly what I need. Two more questions. > • Is the order of the vertices in faceVertexIDs important? > • Is the order of faces in cellFaceIDs important? Must they wind > clockwise or counterclockwise? > Thanks, > Jamie > > On Wed, Jun 15, 2016 at 1:56 P

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread Guyer, Jonathan E. Dr. (Fed)
Is the order of faces in cellFaceIDs important? Must they wind > clockwise or counterclockwise? > Thanks, > Jamie > > On Wed, Jun 15, 2016 at 1:56 PM, Guyer, Jonathan E. Dr. (Fed) > wrote: > The first three arguments to the Mesh2D constructor are (all that is) > re

Re: how to create large grid with holes and odd geometry

2016-06-15 Thread Guyer, Jonathan E. Dr. (Fed)
The first three arguments to the Mesh2D constructor are (all that is) required: class Mesh2D(Mesh): def __init__(self, vertexCoords, faceVertexIDs, cellFaceIDs, ...): All other arguments have default values assigned. For your case: vertexCoords is of shape (2, N) where N is the number

Re: casting implicit Boundary Conditions in FiPy

2016-06-15 Thread Guyer, Jonathan E. Dr. (Fed)
> On Jun 15, 2016, at 7:27 AM, Gopalakrishnan, Krishnakumar > wrote: > > Can we add this as a feature request in the project’s github page, perhaps > for a future release? By all means, please file issues on GitHub for any features you'd like or bugs you find. _

Re: how to create large grid with holes and odd geometry

2016-06-08 Thread Guyer, Jonathan E. Dr. (Fed)
; After I get the mesh, I was planing to reverse engineer the output of > fipy.meshes.gmshMesh.Gmsh2D to figure out how to get my mesh into fipy if you > don't mention something better. > > Thanks a bunch, > Jamie > > On Wed, Jun 8, 2016 at 1:46 PM, Guyer, Jonathan E. D

Re: how to create large grid with holes and odd geometry

2016-06-08 Thread Guyer, Jonathan E. Dr. (Fed)
If the domain were not so large and so sparse, I'd be inclined to create a simple, rectilinear Grid2D of the full extent and then use known coefficients to mask out (set B to zero?) the solution where you don't know/care. Assuming the axes are labeled in grid spacings (?), then your mesh would h

Re: Matrix coefficient for FiPy Transient Term

2016-06-08 Thread Guyer, Jonathan E. Dr. (Fed)
There's no need to create, extract, and reshape the result. Just use the mesh's y coordinates: TransientTerm(coeff=mesh.y**2) == DiffusionTerm(coeff=D) should work. > On Jun 8, 2016, at 9:01 AM, Gopalakrishnan, Krishnakumar > wrote: > > src="Re: newton iteration
l equation for \delta c). Do you > think is that feasible? > > Marcel > > El 13/05/16 a les 20:12, Guyer, Jonathan E. Dr. (Fed) ha escrit: >> I have posted an implementation at >> >> >> https://gist.github.com/guyer/f29c759fd7f0f01363b8483c7bc644cb >

Re: newton iteration

; analytical derivatives makes sense, though. > > Kris > > On Fri, May 13, 2016 at 12:12 PM, Guyer, Jonathan E. Dr. (Fed) > wrote: > I have posted an implementation at > > https://gist.github.com/guyer/f29c759fd7f0f01363b8483c7bc644cb > > I'm not sure the

Re: newton iteration

gt; On May 11, 2016, at 4:57 PM, Guyer, Jonathan E. Dr. (Fed) > wrote: > > I'm not sure I have anything posted publicly. I will put together a minimal > example. > >> On May 11, 2016, at 12:42 PM, Daniel Wheeler >> wrote: >> >> Hi Kris, >>

Re: newton iteration

I'm not sure I have anything posted publicly. I will put together a minimal example. > On May 11, 2016, at 12:42 PM, Daniel Wheeler > wrote: > > Hi Kris, > > FiPy doesn't have an automated way to do Newton iterations. You can > always construct your own Newton iteration scheme using the terms

<    1   2   3   4   5   >