On Thu, Jun 16, 2016 at 12:35 PM, Gopalakrishnan, Krishnakumar
<k.gopalakrishna...@imperial.ac.uk> wrote:
> Thanks.
>
> Yes, this Is indeed only first order accurate.  I verified this by 
> successively cutting my dx by half, running your code, and comparing against 
> the Mathematica generated result. Each time dx is cut by half, the error is 
> also proportionately halved.
>
> This code requires me to take unreasonably small dx values.  Since, neither 
> the solution, nor the gradients are available at each implicit time-steps, I 
> think that higher order schemes are probably ruled out.

I think you're right. It's not easy.

> I am thinking of using a variable mesh-sizing, let's say a log-spacing in 1D, 
> keeping a very fine spacing (ultra-small dx) for the last cell near the 
> boundary, and gradually taking bigger steps.  This is also physically 
> consistent with my problem, wherein all the action takes place close to the 
> boundary, and nothing much is happening at the middle or left edges.

Maybe it's possible to make the edge cell almost infinitely small and
have the rest of the cells evenly spaced.

> This brings me to another issue.  I don't see a way to import a 1D .msh file 
> generated by gmsh into FiPy.

I'm not sure if Gmsh does 1D meshes, you can always use a 2D mesh as a
1D mesh of course.

> Secondly,  I notice that there is an optimistic sounding  grid1DBuilder 
> method.   I couldn't find any help on how to use this method. Is this method 
> capable of creating the log-spaced mesh that I am considering ?

Note that Grid1D takes an array for dx. So you can do

    >>> mesh = fp.Grid1D(dx=[0.5, 1.0, 2.0])
    >>> print(mesh.cellCenters)
    [[ 0.25  1.   2.5 ]]

As long as you can calculate the grid spacing then you don't need Gmsh.

-- 
Daniel Wheeler

_______________________________________________
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