On Nov 20, 2014, at 5:51 PM, Kyle Briton Lawlor <klawlor...@gmail.com> wrote:

> I am now trying to work with Neumann boundary conditions with this diffusion 
> problem. 
> I have come across the following implementation of Neumann BC’s:
> var.faceGrad.constrain(2 * mesh.faceNormals, where=mesh.exteriorFaces)
> However, I am using Gmsh2D() which “ has no attribute ‘faceNormals’ “. 
> Is there an equivalent sort of a function for Gmsh2D()?

What version of FiPy are you running?

  python -c "import fipy; print fipy.__version__"

I would guess 3.0.something. The documentation on our website is for FiPy 3.1, 
where mesh.faceNormals was introduced. Prior to that, it was mesh._faceNormals.


> Also, with the above line of code, instead of a value of 2, could I specify 
> something like sin(var). That is can I specify the boundary condition to 
> involve the solution variable at the boundary? 
> var.faceGrad.constrain(sin(var) * mesh.faceNormals, where=mesh.exteriorFaces)

var will need to be a FaceVariable, but yes, you should be able to do this.


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

Reply via email to