Hi Jamie,

The simplest way might be just to take a basic grid and just "switch
off" the simulation outside of the black zone. This can be achieved by
including a transient term in the equation and setting the coefficient
to be large in the white zone and zero or something small in the black
zone. That would be an easy first attempt to solve the problem. Of
course this approach has a lot of redundancy, but would be a good
first step. You may have to interpolate the A and B values to a
coarser grid for this approach to be feasible.

It is possible in FiPy to combine grid's into odd shaped
non-rectangular grids. You could do this with say 20 or 30 smaller
grids to better isolate the black region. I still think that you want
to interpolate the values of A and B so you have control over the grid
density. You don't necessarily need a grid density at the sample
density. Also, you will still need the trick with the Transient Term.
Furthermore, the grids must align and not overlap. It will take quite
a bit of programming to set this up so that you have control over the
grid density and the number of subgrids to isolate the black region.

Gmsh will probably be happy meshing the black region, but will
probably use triangles rather than a grid.

To summarize use the first approach to make things work right and then
refine with the second approach.

Hope it helps.

On Tue, Jun 7, 2016 at 1:46 PM, James Pringle <jprin...@unh.edu> wrote:
> Dear mailing list & developers --
>
>     I am looking for hints on the best way to proceed in creating a
> grid/mesh for a rather complex geometry. I am just looking for which method
> (Gmsh or something else?) to start with, so I can most efficiently start
> coding without exploring blind alleys.
>
> I am solving an elliptic/advective problem of the form
>
>         0=J(Psi,A(x,y)) + \Del(B(x,y)*\Del Psi)
>
> where Psi is the variable to solve for, and A(x,y) and B(x,y) are
> coefficients known on a set of discrete points shown as black in
> https://dl.dropboxusercontent.com/u/382250/Grid01.png . The black appears
> solid because the grid is dense.
>
> The locations of the points where the coefficients are known define the
> grid. The number of points is large (911130 points) and they are evenly
> spaced where they exist. Note that there are holes in the domain that
> represent actual islands in the ocean.
>
> I am happy to keep the resolution of the grid/mesh equal to the spacing of
> the points where the coefficients are known.
>
> What is the best way to approach creating a grid for this problem? I would
> love code, of course, but would be very happy with suggestions of the best
> way to start.
>
> Thanks
> Jamie Pringle
> University of New Hampshire
>
> _______________________________________________
> fipy mailing list
> fipy@nist.gov
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>



-- 
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