Hi,

I am new to fenics, but have been very much enjoying it the past week! I am wanting to try a 3D version of this worked example:

https://fenicsproject.org/olddocs/dolfin/2019.1.0/python/demos/maxwell-eigenvalues/demo_maxwell-eigenvalues.py.html?highlight=tangential%20boundary%20condition#

I think I have everything working, but just wanted to double check boundary conditions. Here is my code:

########################

from dolfin import *

import numpy as np

from numpy import where

import matplotlib.pyplot as plt

N = 8

mm = 1

mesh = UnitCubeMesh(N,N,N)

V1 = FunctionSpace(mesh,“N1curl”,mm)

bcs1 = [DirichletBC(V1, Constant((0.0,0.0,0.0)), DomainBoundary())]

u1 = TrialFunction(V1)

v1 = TestFunction(V1)

a1 = inner(curl(u1),curl(v1))*dx

b1 = inner(u1,v1)*dx

dummy = v1[0]*dx

A1 = PETScMatrix()

assemble_system(a1, dummy, bcs1, A_tensor=A1)

B1 = PETScMatrix()

assemble_system(b1, dummy, bcs1, A_tensor=B1)

[bc.zero(B1) for bc in bcs1]

########################

I then pass A1 and B1 to eigensolver and everything works great. My question: the boundary condition should be that elements u of the trial and test space should have u\times n=0 for outward normal n - have I understood the internal workings of fenics correctly (i.e., is the line where I define bcs1 correct)? Note also that I am playing around with the order mm too.

Many thanks!