# Question about N1curl element boundary conditions

**URL:** <https://fenicsproject.discourse.group/t/question-about-n1curl-element-boundary-conditions/14324>\
**Category:** General\
**Created:** [April 18, 2024, 5:35pm UTC](https://fenicsproject.discourse.group/t/question-about-n1curl-element-boundary-conditions/14324 "2024-04-18T17:35:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathmo](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@mathmo](https://fenicsproject.discourse.group/u/mathmo)\
**Post date:** [April 18, 2024, 5:35pm UTC](https://fenicsproject.discourse.group/t/question-about-n1curl-element-boundary-conditions/14324/1 "2024-04-18T17:35:18Z")

</div>

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#](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!
