Dear Friends
I have come across the following
problem.
I created a circle with radius r
using Circle from mshr
and then generate_mesh
to subdivide the mesh
I realized after the eigenvalue for a free particle in a circle with radius 2.4...( first zero of J_0)
did not converge to 1 that most of the boundary points of the mesh do not fall
on the circle .
I am actually very dependent on the mesh generating functionality in FEniCS
and need this to work urgently.
The following code demonstrates the problem
testCircle.py
from mshr import *
from dolfin import *
import sys
n=eval(sys.argv[1])
c=Circle(Point(0.,0.),1)
m=generate_mesh(c,n)
no=1
V=FunctionSpace(m,"CG",no)
def boundary(x, on_boundary):
if on_boundary:
dr=sqrt(x[0]x[0]+x[1]x[1])-1.0
if abs(dr) < 1e-8:
print dr
return on_boundary
bc = DirichletBC(V, Expression('0'), boundary)
u=TrialFunction(V)
v=TestFunction(V)
a=uvdx
b=v*dx
A,_=assemble_system(a,b,bc)
==========================
running this from the command line with
python testCircle.py 100 only finds
32 points that are exactly on the circle.
Any help will be much appreciated.
regards
Moritz