Hi there,
I have the following problem:
Just a simple poisson problem; I need the stiffness matrices, so simply dot(grad(u),grad(v)) on a 2d mesh.
the type of mesh I’m using is mesh = UnitSquareMesh(10,10, “right”).
The problem is that when increase my number of elements, so a mesh 50x50, or 100x100, the entrie of the stiffness matrix do not change, while looking at the entries of the mass matrix, the scaling happens.
Now, I’m not a matematician, I just need the matrices to be studied, so Can you tell me what I’m doing wrong?
The code is as follows:
mesh = UnitSquareMesh(10,10, "right")
V = FunctionSpace(mesh, 'P', 1)
u_D = Expression('cos(x[0])', degree=2)
def boundary(x, on_boundary):
return on_boundary
bc = DirichletBC(V, u_D, boundary)
u = TrialFunction(V)
v = TestFunction(V)
f = Constant(-6.0)
a = dot(grad(u), grad(v))*dx
m = dot(u, v)*dx
L = f*v*dx
A = assemble(a)
A.array()