determine cell neighbors.

2016-06-29 Thread James Pringle
I have to find a group of contagious cells which match a certain criteria,
which involves values on the cell center. I can figure out which cell
centers meet the criteria.

However, from the mesh2D variable, how do I figure out which cells are
contiguous to a given cell? Must I build a data structure from
variable.mesh.cellFaceIDs?
Is not that connectivity stored somewhere?

I am sorry for what must be a very basic question, but I have been
searching for a while.

Thanks,
Jamie Pringle
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


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

2016-06-29 Thread Daniel Wheeler
On Tue, Jun 28, 2016 at 12:53 PM, Abhilash Mathews  wrote:
>
> eq1 = (TransientTerm(var=N1) == ImplicitSourceTerm(coeff=-2.*E1, var=P2) +
> ImplicitSourceTerm(coeff= -2.*E2, var=P1) + ImplicitSourceTerm(coeff=
> -1./(T1/TR), var=N1))
>
> eq2 = (TransientTerm(var=P1) == ImplicitSourceTerm(coeff=2.*E2, var=N1) +
> ImplicitSourceTerm(coeff= -1./(T2/TR), var=P1))
>
> eq3 = (TransientTerm(var=P1) == ImplicitSourceTerm(coeff=2.*E1, var=N1) +
> ImplicitSourceTerm(coeff= -1./(T2/TR), var=P2))
>
> eq4 = (CentralDifferenceConvectionTerm(coeff = ones, var=E1) ==
> ImplicitSourceTerm(coeff=constant3, var=P2) +
> ImplicitSourceTerm(coeff=-1./Ldiff, var=E1))
>
> eq5 = (CentralDifferenceConvectionTerm(coeff = ones, var=E2) ==
> ImplicitSourceTerm(coeff=constant3, var=P1) +
> ImplicitSourceTerm(coeff=-1./Ldiff, var=E2))

These are not great equations from FiPy's perspective as they are
purely convective. However, if you want to persist with FiPy, you may
want to use some sort of relaxation for the last two equations. One
thing you could do is add in a TransientTerm and DiffusionTerm with
small coefficients. Initially, just use coefficients of 1 to see if
actually having those terms helps the numerical stability. If that
helps, see if you can dial down those coefficients to get a more
physical solution or use other techniques that maintain the correct
physics.



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