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

2017-01-25 Thread Gopalakrishnan, Krishnakumar
Hi Dan, Thanks a lot for your reply. Based on this, Ian and I have a further question. Is it possible to instruct FiPy to discretise only the spatial domain, leaving the time-domain continuous? Ian and I are planning to implement the standard method of lines for our problem at hand. Although we

Question on accessing internal matrices of the system being solved

2017-01-11 Thread Gopalakrishnan, Krishnakumar
Hi, I was wondering if there is a way to access the internal matrices of the system of equations formulated by Fipy , given the coefficient terms of the general conservation equation. Let's say I have a simple diffusion equation (eg. Heat equation). I can hand-code the differentiation matrix a

Question on time-marching scheme in Fipy

2016-10-10 Thread Gopalakrishnan, Krishnakumar
Hello, I have a pretty naïve question about the time-marching scheme used within fipy. In general, we step through time using a while loop, with some dt. However, I am quite interested in knowing about the specific time-stepping scheme itself. I know that mesh.examples.diffusion.mesh1D expl

RE: FiPy sweep convergence bottoms out

2016-09-27 Thread Gopalakrishnan, Krishnakumar
ng out. Under-relaxation factors, or > solver-changes don't seem to work. > > In fact, for certain under-relaxation factors (including 1.0 for 2 of the > variables), it breaks the simulation, and produces NaNs right from the first > sweep. > > Krishna

RE: FiPy sweep convergence bottoms out

2016-09-27 Thread Gopalakrishnan, Krishnakumar
on a semi-log plot (or equivalently plot the log of residual vs sweep number) to more clearly show the value of the small residuals, as the plots in that link make it look to me like the residuals all go to zero. Ray On Tue, Sep 27, 2016 at 12:42 PM, Gopalakrishnan, Krishnakumar

FiPy sweep convergence bottoms out

2016-09-27 Thread Gopalakrishnan, Krishnakumar
Hi, We are solving a system of 5 coupled non-linear PDEs. As shown in this plot of residuals vs. sweep count https://imperialcollegelondon.box.com/s/9davbq2gq5eani98xuuj2cw9tmz4mbu3 , our residuals die down very slowly, i.e. the solver bottoms out. The drop in all the residuals is linear at

RE: Dynamic under-relaxation factors for FiPy sweep

2016-09-19 Thread Gopalakrishnan, Krishnakumar
Hi Dan, Thanks for your suggestion to use the ResidualTerm as per your gist posting https://gist.github.com/guyer/f29c759fd7f0f01363b8483c7bc644cb of the Newton's method. When I try to implement the Newton's method into my code, python interpreter gives the following error message TypeError:

Interesting (perhaps unique) approach to parallelising FiPy sweeps

2016-09-16 Thread Gopalakrishnan, Krishnakumar
Hello, In our present system of equations, we sweep 8 loosely coupled PDEs defined in 5 meshes, until their residues die down to an acceptable value. Upon profiling the code, it's clear that the sweep function is a major computational bottleneck. We tried MPI parallelism, but that didn't work

RE: Applying Two Different Diffusion Coefficients at Single FV Face

2016-09-16 Thread Gopalakrishnan, Krishnakumar
Thank you, Dr Guyer and Raymond, That was quite helpful Krishna & Ian -Original Message- From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of Guyer, Jonathan E. Dr. (Fed) Sent: Friday, September 16, 2016 8:11 PM To: FIPY Subject: Re: Applying Two Different Diffusio

RE: Applying Two Different Diffusion Coefficients at Single FV Face

2016-09-16 Thread Gopalakrishnan, Krishnakumar
Hi Raymond, Thanks a lot for your inputs. We have been working along the same lines that you have suggested. There is a slightly more complication that wasn’t fully discussed (intentionally, to keep it simple, and to find out if any other options existed). Assuming that we are working on a no

JOR solver to help in accelerating sweeps?

2016-09-15 Thread Gopalakrishnan, Krishnakumar
Hello, We have a specific question about how a solver helps in accelerating convergence of a loosely coupled system of PDEs. Due to the fundamentally different properties/behaviour/geometry, we have a loosely coupled system of 8 PDEs defined along 5 different meshes, with data manually copied

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

2016-09-12 Thread Gopalakrishnan, Krishnakumar
gt; > > 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: &g

RE: Essential trilinos packages for Fipy

2016-09-01 Thread Gopalakrishnan, Krishnakumar
Thank you. 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 2:27 PM To: FIPY Subject: Re: Essent

Dynamic under-relaxation factors for FiPy sweep

2016-08-29 Thread Gopalakrishnan, Krishnakumar
I am trying to sweep for 8 field variables in FiPy, until all their residues die down to appreciably small values. Currently, the convergence of this iterative loop is very slow. I have fixed under-relaxation implemented right now, but looking for implementing a dynamic under-relaxation factor

Unable to use .solve method for Coupling Boundary Condition of one PDE with source term of another PDE

2016-08-08 Thread Gopalakrishnan, Krishnakumar
Hi all, We have been working on modifying Jonathan's gist* code (crazycoupling2.ipynb) of how to couple the PDEs along the upper boundary of a 2D mesh, i.e. wherein one PDE is along the x-axis and the oth

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

2016-07-26 Thread Gopalakrishnan, Krishnakumar
f another PDE The source in Poisson's equation determines the curvature of the solution. Neumann boundary conditions determine the slope at the boundaries. There are still infinitely many solutions that satisfy those conditions. > On Jul 23, 2016, at 7:47 AM, Gopalakrishnan, Krishnaku

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

2016-07-23 Thread Gopalakrishnan, Krishnakumar
uple of attempts at this > problem at: > > https://gist.github.com/guyer/bb199559c00f6047d466daa18554d83d > > > >> On Jul 9, 2016, at 1:37 PM, Gopalakrishnan, Krishnakumar >> wrote: >> >> Hi, >> >> **We’re sorry, the previous posting omitted the com

RE: casting implicit Boundary Conditions in FiPy

2016-07-14 Thread Gopalakrishnan, Krishnakumar
implementing some 1D test cases to double check. I always do this no matter how much I trust the code. -Original Message- From: Gopalakrishnan, Krishnakumar Sent: Friday, July 1, 2016 7:44 PM To: 'fipy@nist.gov' Subject: RE: casting implicit Boundary Conditions in FiPy Hi Dan,

Casting non-linear source terms in FiPy

2016-07-13 Thread Gopalakrishnan, Krishnakumar
Hello, I have an equation of the form: nabla.(D grad (phi)) = exp(a*phi - K) - exp(-(b*phi - K)) The diffusion coefficient is simply 'D'. But how do I cast the non-linear source term? i.e. what is the syntax to use in the code? In the examples, I did not notice any non-linear source term. '

RE: Possibility of setting NaN constraints for CellVariable ?

2016-07-13 Thread Gopalakrishnan, Krishnakumar
Dear Raymond, Jonathan and Dan, Thanks a lot for all your replies. Indeed this works ! Setting the diffusion coefficient to all interior faces helps a lot. Thanks for your help once again. Krishna -Original Message- From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Beha

Possibility of setting NaN constraints for CellVariable ?

2016-07-13 Thread Gopalakrishnan, Krishnakumar
Hello, I have a regular 2D Cartesian uniformly spaced mesh. Due to some peculiarities of the physical system that I am currently working with, the variable of interest in one of my PDEs, (fiPy CellVariable), is undefined in certain interior node locations, i.e. we need to constrain them to a

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

2016-07-09 Thread Gopalakrishnan, Krishnakumar
Hi, **We're sorry, the previous posting omitted the complete definition of the boundary condition for the 2nd PDE, and also a couple of typos are fixed below. We have a system of equations, wherein the BC of one PDE couples with the source term of another PDE. We have a regular 2D unit g

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

2016-07-09 Thread Gopalakrishnan, Krishnakumar
Hi, We have a system of equations, wherein the BC of one PDE couples with the source term of another PDE. We have a regular 2D unit grid in x and y. There are two PDEs to be solved a)The first PDE (elliptic diffusion problem) is defined only at y = 1, acting along the x-axis (i.e. i

How do we handle logarithmic partial derivatives in FiPy

2016-07-06 Thread Gopalakrishnan, Krishnakumar
Hello, One of the PDEs in my (1D) system has the following form, a*d_phi1/dx + b*d_(ln_phi2)/dx + c*d_(phi3)/dt == d i.e. the PDE is defined such that one of the spatial derivatives is with respect to the natural logarithm of the field variable to be solved for. I don't think a simple chang

RE: casting implicit Boundary Conditions in FiPy

2016-07-01 Thread Gopalakrishnan, Krishnakumar
l Wheeler Sent: 23 June 2016 15:24 To: Multiple recipients of list Subject: Re: casting implicit Boundary Conditions in FiPy On Fri, Jun 17, 2016 at 5:36 PM, Gopalakrishnan, Krishnakumar wrote: > > My problem models the solid diffusion in a spherical particle. Matter > diffuses fro

RE: casting implicit Boundary Conditions in FiPy

2016-06-17 Thread Gopalakrishnan, Krishnakumar
e 2016 14:50 To: Multiple recipients of list Subject: Re: casting implicit Boundary Conditions in FiPy On Thu, Jun 16, 2016 at 12:35 PM, Gopalakrishnan, Krishnakumar mailto:k.gopalakrishna...@imperial.ac.uk>> wrote: > Thanks. > > Yes, this Is indeed only first order

RE: casting implicit Boundary Conditions in FiPy

2016-06-17 Thread Gopalakrishnan, Krishnakumar
0 AM, Daniel Wheeler > mailto:daniel.wheel...@gmail.com>> wrote: > > On Thu, Jun 16, 2016 at 12:35 PM, Gopalakrishnan, Krishnakumar > mailto:k.gopalakrishna...@imperial.ac.uk>> > wrote: >> Thanks. >> >> Yes, this Is indeed only first order accurate. I v

RE: casting implicit Boundary Conditions in FiPy

2016-06-16 Thread Gopalakrishnan, Krishnakumar
ing ? Krishna -Original Message- From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of Daniel Wheeler Sent: 15 June 2016 17:50 To: Multiple recipients of list Subject: Re: casting implicit Boundary Conditions in FiPy On Wed, Jun 15, 2016 at 7:27 AM, Gopalakrishnan, Krishnakumar

RE: casting implicit Boundary Conditions in FiPy

2016-06-15 Thread Gopalakrishnan, Krishnakumar
ic BC eq = TransientTerm() == DiffusionTerm(coeff=D) timeStep = 0.9 * dx**2 / (2 * D) steps = 800 viewer = Viewer(vars=phi, datamax=1., datamin=0.) for step in range(steps): eq.solve(var=phi, dt=timeStep) viewer.plot() Cheers, Ray On Thu, Jun 9, 2016 at 11:44 AM, Gopalakrishnan, Krishnak

RE: casting implicit Boundary Conditions in FiPy

2016-06-14 Thread Gopalakrishnan, Krishnakumar
licit Boundary Conditions in FiPy On Sun, Jun 12, 2016 at 8:14 AM, Gopalakrishnan, Krishnakumar mailto:k.gopalakrishna...@imperial.ac.uk>> wrote: > > 1. The backward Euler method is used in formulating the equation, > "n.grad(phi) = k * (phi_P + n.grad(phi) * dx / 2) " .

Re: casting implicit Boundary Conditions in FiPy

2016-06-12 Thread Gopalakrishnan, Krishnakumar
lue], mesh.facesRight) # This is the problematic BC eq = TransientTerm() == DiffusionTerm(coeff=D) timeStep = 0.9 * dx**2 / (2 * D) steps = 800 viewer = Viewer(vars=phi, datamax=1., datamin=0.) for step in range(steps): eq.solve(var=phi, dt=timeStep) viewer.plot() Cheers, Ray On Thu, Jun

RE: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Gopalakrishnan, Krishnakumar
) # This is the problematic BC eq = TransientTerm() == DiffusionTerm(coeff=D) timeStep = 0.9 * dx**2 / (2 * D) steps = 800 viewer = Viewer(vars=phi, datamax=1., datamin=0.) for step in range(steps): eq.solve(var=phi, dt=timeStep) viewer.plot() Cheers, Ray On Thu, Jun 9, 2016 at 11:

RE: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Gopalakrishnan, Krishnakumar
should be able to get the solution to the following problem using a Fourier series expansion: dc/dt = Laplacian(c) c(t=0) = 1 x=0: c = 0 x=1: c - dc/dx = 0 Ray On Thu, Jun 9, 2016 at 10:52 AM, Gopalakrishnan, Krishnakumar mailto:k.gopalakrishna...@imperial.ac.uk>> wrote: Hi Ray, Thanks f

RE: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Gopalakrishnan, Krishnakumar
implicit BC within the time-stepper loop, but that does not still help. Best Regards Krishna From: fipy-boun...@nist.gov<mailto:fipy-boun...@nist.gov> [mailto:fipy-boun...@nist.gov<mailto:fipy-boun...@nist.gov>] On Behalf Of Gopalakrishnan, Krishnakumar Sent: 08 June 2016 23

RE: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Gopalakrishnan, Krishnakumar
st Regards Krishna From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of Gopalakrishnan, Krishnakumar Sent: 08 June 2016 23:42 To: fipy@nist.gov Subject: RE: casting implicit Boundary Conditions in FiPy Hi Raymond, Sorry, it was a typo. Yes, It is indeed d (phi)/dx

RE: casting implicit Boundary Conditions in FiPy

2016-06-08 Thread Gopalakrishnan, Krishnakumar
ith hasOld set to True in the creation of the cell variable - In each time step, calculate the backward-Euler time derivative manually and then set the value of phi with the phi.constrain method. Ray On Wed, Jun 8, 2016 at 6:26 PM, Gopalakrishnan, Krishnakumar mailto:k.gopalakrishna...@impe

casting implicit Boundary Conditions in FiPy

2016-06-08 Thread Gopalakrishnan, Krishnakumar
I am trying to solve the standard fickean diffusion equation on a 1D uniform mesh in (0,1) $$\frac{\partial \phi}{\partial t} = \nabla.(D \nabla\phi)$$ with a suitable initial value for $\phi(x,t)$. The problem is that, one of my boundary conditions is implicit, i.e. is a function of the field

RE: Matrix coefficient for FiPy Transient Term

2016-06-08 Thread Gopalakrishnan, Krishnakumar
reate, 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="<a rel="nofollow" href="https

Matrix coefficient for FiPy Transient Term

2016-06-08 Thread Gopalakrishnan, Krishnakumar
https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js";> Hello, The following PDE is defined in a non-square 2D (x-y) cartesian grid (20 x 10) domain $$ \frac{\partial}{\partial t} (y^2 \phi(x,y,t)) = D \nabla^2 \phi(x,y,t) $$ wherein $y^2$ is the 'y' co-ordinate of my 2