Attached script does not reproduce alleged problem. Instead it fails
with message
Traceback (most recent call last):
File "demo_adaptive-poisson.py", line 74, in <module>
gamma = abs(Efield.vector().array())
NameError: name 'Efield' is not defined
Could you fix it to reproduce the problem?
Jan
On Mon, 6 Jul 2015 11:41:20 +0000
Drew Parsons <[email protected]> wrote:
> Hi Fenics Folk,
>
> I'm not expert in Fenics/Dolfin, I'm evaluating to see if it can
> perform better than a calculation I've currently got implemented in
> octave (matlab).
>
> My problem in octave is that it fails to find the solution to
> Poisson's equation when the electric field is extremely large. It
> uses an adaptive spacing (1D mesh) but it complains that it can't make
> intervals any finer and reached the iteration limit. Perhaps Fenics
> can do a better job?
>
> So I'm testing your adaptive Poisson example,
> /usr/share/dolfin/demo/undocumented/adaptive-poisson/
> (maybe the documented auto-adaptive-poisson is better for me, but
> anyway).
>
> The demo works fine. It uses "gamma" as the criterion for mesh
> refinement, based on curvatures.
>
> I've replaced gamma in the example with the absolute value of the
> gradient,
> grad_u = project(grad(u), VectorFunctionSpace(mesh, "Lagrange",
> 1)) gamma = abs(Efield.vector().array())
>
> The error estimate E (E=gamma*gamma) doesn't make sense then, but mesh
> refinement should still work, right?
>
> Mesh refinement does work twice, but in the third iteration it fails
> with the error:
> *** Error: Unable to add cell using mesh editor.
> *** Reason: Vertex index (13) out of range [0, 11).
> *** Where: This error was encountered inside MeshEditor.cpp.
>
> The value of cell_markers going into refine() seems sensible, "3 cells
> out of 7 marked for refinement (42.9%)." So I don't understand why
> refine() would fail like this.
>
> So I wanted to check with you if this is a normal error or not. If it
> is normal than please tell me so and I'll keep studying the Fenics
> system.
>
> I'm attaching my python file, which is identical to the one in the
> adaptive-poisson example, apart from the change in definition of gamma
> (and a couple of print statements).
>
> I'm using DOLFIN version: 1.5.0 on Debian unstable.
>
> Thanks,
>
> Drew Parsons
>
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics