Re: Memory leak using trilinos

2017-06-23 Thread Daniel Wheeler
Hi Zhekai,

There is some discussion on this issue, see
https://www.mail-archive.com/fipy@nist.gov/msg03564.html.

I don't think there was ever a resolution other than Mike's suggestion
of a restart from time to time.

Cheers,

Daniel

On Tue, Jun 20, 2017 at 11:39 AM, Zhekai Deng
 wrote:
> HI All,
>
> I think I run into some memory leak issues using trilinos as my solver both
> for serial and parallel case. The total memory goes up from initial around
> 300 MB to the my system memory limit (like 29 GB), and program stops. I have
> attached my example code below.
>
> Somethings I am not sure if I implement it correctly:
> 1. in the example code, I basically solve multiple equations at the same
> time. I use list, and append my CellVarible together
>
> 2. Similar, I use list and append my equation together
>
> 3. Create coupled equation by looping through the list element, and solve
> this coupled equation.
>
> 4. During the solution step, I loop through the list element, and do
> updateOld()
>
> The results of the numerical calculation looks correct to me, I just have
> this memory issue that prevent me from going longer time steps because I run
> out of  memory.
>
> I wonder is there any workaround/fix to this problem ?
>
> I am using the build from Anaconda repository, default trillions solver, and
> my OS is Ubuntu 16.04.
>
> ___
> 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 ]


Re: Time varying boundary conditions

2017-06-23 Thread Daniel Wheeler
Hi Adrian,

It's a little bit of a hack, but I got something to work, see below.
Unfortunately, I think you need to explicitly delete the fixed value
constraint from the CellVariable's faceConstraints list, which
requires some knowledge of FiPy's internals and remember the order in
which the constraints were added. I would be nice if "var.constrain"
returned some sort of constraint object which could be deleted.

Cheers,

Daniel


import fipy as fp

mesh = fp.Grid1D(nx=10)

var = fp.CellVariable(mesh=mesh, value=0.)

var.constrain(1., mesh.facesLeft)
var.constrain(0., mesh.facesRight)
eqn = fp.TransientTerm() == fp.DiffusionTerm()

viewer = fp.Viewer(var)

dt = 0.1

for _ in range(100):
eqn.solve(var, dt=dt)
viewer.plot()

del var.faceConstraints[0]

var.faceGrad.constrain(1., mesh.facesLeft)

for _ in range(1000):
eqn.solve(var, dt=dt)
viewer.plot()


On Wed, Jun 21, 2017 at 2:56 PM, Adrian Jacobo
 wrote:
> Hi All,
>
>   I have a problem where I would want to specify fixed value boundary
> conditions for times t conditions for t>=t0. The way I've implemented this is:
>
>
> a.constrain(a_0,(mesh.exteriorFaces))
>
> while t  if t > = t0:
>  a.faceGrad.constrain(0.,mesh.exteriorFaces)
>  eq.solve(dt=timeStepDuration)
>  t+=dt
>
> But what it seems to be happening is that the fixed value bc is not
> being overwritten by the fixed gradient one. How can I do to remove the
> fixed value bc? Is there a way to check the boundary conditions on a
> variable?
>
> Thanks,
> Adrian.
>
> ___
> 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 ]