← Back to team overview

dolfin team mailing list archive

Re: Applying Boundary conditions for eigenvalue problems

 

The problem is that I am not quite sure how to use it ...

The code I have at the moment is as follows:

    mesh = UnitSquare(1,1)

    mesh.refine()
    mesh.refine()

    element = FiniteElement("Nedelec", "triangle", order);

    v = TestFunction(element)
    u = TrialFunction(element)

    # assemble the mass and stiffness matrices
    # the bilinear form is defined as the transverse curl since it is
a two dimensional problem
    # a = dot(curl(v), curl(u))
    a = (vec(v.dx(0))[1] - vec(v.dx(1))[0])*(vec(u.dx(0))[1] - vec(u.dx(1))[0])

    (S) = assemble(a*dx, mesh)
    (T) = assemble(dot(v, u)*dx, mesh)

I then use S and T to solve the eigenvalue system S x = lambda T x

The reason I am having trouble is that this does not use the pde class
and I have not found an example that uses the DirichletBC class to
specify the boundary conditions for matrix assembly.

Thanks for the quick reply
Evan

On Tue, Jun 3, 2008 at 11:11 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> On Tue, Jun 03, 2008 at 11:06:16PM +0200, Evan Lezar wrote:
>> Hi there
>>
>> I have posted a couple of previous similar questions, but have had no
>> response, so I thought I'd try again.
>>
>> I am solving eigenvalue problems derived from Maxwell's equations
>> using pydolfin (or trying to) making use of the edge-based Nedelec
>> elements.  I am able to assemble the finite element matrices with no
>> problem, but I am struggling to apply the Dirichlet boundary
>> conditions on the mesh - basically I need to remove the rows and
>> columns of the matrices associated with the edges (in 2D, faces in 3D)
>> on the mesh boundary so that I can solve the resultant eigenvalue
>> problem.
>>
>> Any help in applying these boundary conditions would be much appreciated.
>>
>> Thanks
>> Evan
>
> Can't you just use the DirichletBC class?
>
> --
> Anders
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>



-- 
visit http://randomestrandom.blogspot.com


Follow ups

References