convergence problem with cgal PolygonalMeshGenerator
I am having some problem with the following example. When I run it with a square shaped domain the problem converges but when I run it with a mesh that looks this
||||
|||||||||||||||||
I get a bunch of nan a the problem does not converge. Can anyone confirm this?
****example****
from dolfin import *
parameters[
#mesh = UnitSquare(20,20)
t1 = 0.5
t2 = 0.5
w = 1.0
#
x1 = t1
x2 = x1+t2
#
vertices = [Point(0.0,0.0), Point(x1,0.0), Point(x1,
# uncomment below for square space mesh. Problem will converge.
#vertices = [Point(0.0,0.0), Point(0.5,0), Point(1.0,0),
# Point(1.0, 1.0), Point(0.5, 1.0), Point(0.0,1.0),
# Point(0.0,0.0)]
mesh = Mesh()
PolygonalMeshGe
plot(mesh)
Q = FunctionSpace(
W = MixedFunctionSp
u_func = Function(W)
u, un, up = split(u_func)
v, vn, vp = TestFunctions(W)
du_func = TrialFunction(W)
du, dun, dup = split(du_func)
h = CellSize(mesh)
beta = 1.0
delta = beta#*h*h*h
class Doping(Expression):
def eval(self, v, x):
if x[0] < 0.8:
v[0] = 100.0
else:
v[0] = -100.0
T = Constant(10.0)
n = exp((u-un)/T)
p = exp(-(u-up)/T)
d = Doping()
rho = p+d-n
mun = Constant(1.0)
mup = Constant(1.0)
L1 = delta*inner(
a1 = derivative(
L2 = delta*inner(
a2 = derivative(L2, u_func, du_func)
L3 = delta*inner(
a3 = derivative(
#bc_left0 = DirichletBC(
bc_left1 = DirichletBC(
bc_left2 = DirichletBC(
#bc_right0 = DirichletBC(
bc_right1 = DirichletBC(
bc_right2 = DirichletBC(
F = L1+L2+L3
J = a1+ a2+ a3
problem = NonlinearVariat
#newton_solver = problem.
#newton_
solver = NonlinearVariat
solver.
solver.
solver.
solver.
solver.
solver.
solver.solve()
u, un, up = split(u_func)
u = project(u)
un = project(un)
up = project(up)
plot(u, title='
v = plot(un,
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Garth Wells
- Solved:
- Last query:
- Last reply: