Maxwell`s equation in deal.ii

619 views
Skip to first unread message

Konstantin Ladutenko

unread,
Oct 9, 2016, 10:13:30 AM10/9/16
to deal.II User Group
Dear all,

I would like to solve Maxwell equations using deal.ii, however, it turns out that there too many information on this question to keep it in one head. So I have prepared a short review on the topic which should be useful for all newcomers looking for possibilities to solve Maxwell with deal.ii.

For some reason, my github account (https://github.com/kostyfisik) was blocked (I wrote to the support, still no answer).  Could anyone put the following content to deall.ii github wiki? Any additions and corrections are welcomed!

Best regards,
Konstantin Ladutenko

Wiki title: Maxwell's equations

**Disclaimer:** This page is written by a FEM novice, I hope it will finish up with a set of working examples for a code gallery. However, it can contain some obvious knowledge or simply wrong statements. Feel free to improve the page or e-mail me directly to k.lad...@metalab.ifmo.ru

# Rationale

Information about solving Maxwell equation using FEM (and Deal.II) is dispersed, this is an attempt to provide the whole picture in a single place.

# Frequency domain
Time harmonic Maxwell equation turns to be a Helmholtz equation.

### Available codes

* [step-7](http://dealii.org/developer/doxygen/deal.II/step_7.html) Non-homogeneous Neumann boundary conditions for the Helmholtz equation. Check the convergence with Method of Manufactured Solutions.
* [step-29](http://dealii.org/developer/doxygen/deal.II/step_29.html) Split complex valued functions into their real and imaginary parts. Uses absorbing boundary, however, the angle, when it stops working properly is not very big. See the reflection from "non-reflecting" boundary for the source located close to it.

* Ross Kynch done some work in this direction. There are a [testBC.cc (google group link)](https://groups.google.com/d/msg/dealii/ZJqmZgObysw/RfyFkbY0D9AJ) and [dealii/tests/fe/nedelec_non_rect_2d.cc](https://github.com/dealii/dealii/blob/master/tests/fe/nedelec_non_rect_2d.cc) solutions using Nedelec elements. 
An improvement (WIP) [PR #2240](https://github.com/dealii/dealii/pull/2240) "New Nedelec finite element: FE_NedelecSZ". [There is a topic](https://groups.google.com/d/msg/dealii/1g3YSUdPSGY/0oW3upegbqMJ) on the problem with face orientation of Nedelec elements (BTW, is it solved now in the current master of deal.ii?). He had also [published](https://github.com/rosskynch/MIT_Forward) a Deal.II solver for Eddy current. [One more topic](https://groups.google.com/d/msg/dealii/odXjp7U3y0s/qXjYyWAefhIJ) on assembly and preconditioning of Nedelec elements.
* [There is a topic](https://groups.google.com/d/msg/dealii/8SbZ04qLwdQ/UReeEYmUFsAJ) by Ce Qin with his source to solve time-harmonic Maxwell equation with complex coefficients using Nedelec elements on a rectangular mesh.
* Related topic to [Computing the curl of a solution vector field obtained from Nedelec elements](https://groups.google.com/d/msg/dealii/iWrNRAH8b6o/GHmCs2oLmtUJ) by David Fernández 
* [Topic by](https://groups.google.com/d/msg/dealii/xpW2-h326Bs/5Nhj9TzHKlgJ) Simon Schernthanner with some useful references.
* There is a  detailed report on [Nedelec elements](http://www.dealii.org/reports/nedelec/nedelec.pdf) (by Anna Schneebeli, University of Basel, Switzerland).   

### Possible extensions

* Use Raviart–Thomas elements to resolve high k cases. See https://arxiv.org/pdf/1111.0671.pdf for details. This paper uses the same boundary condition as step-29, so it should suffer from the same problems within the near-field region and for small incident angles.
* Use Nedelec elements with PML (perfectly matched layer) condition, see section 5 of the paper "Electromagnetic Scattering by Unbounded Rough Surfaces" by P. Li et al. [pdf](https://www.math.purdue.edu/~lipeijun/paper/2011/Li_Wu_Zheng_SIMA_2011.pdf). Conformal PML (CPML aka CIFS-PML) has proved to be close to ideal for near-field in FDTD method can deal this problem, for FEM application see the paper "Locally-Conformal Perfectly Matched Layer Implementation for Finite Element Mesh Truncation" by O. Ozgun et al., the follow-up by the same authors [pdf](http://journals.tubitak.gov.tr/elektrik/issues/elk-08-16-1/elk-16-1-6-0802-3.pdf) As soon as the reflection from the PML layer usually (at least for FDTD) comes from discretization of polynomial by a step function high-order (3 should be enough) elements in PML should be a game changer.

### Applied problems 

These problems are well known and can be used as starting point for many other problems. 
          
* Mie scattering on the sphere has a well known analytic solution. It is still of great interest our days with hundreds of publications every year. It is an open boundary problem, so it needs PML (see Ozgun papers above). A typical problem set can include a dielectric particle, plasmonic nanoparticle, core-shell case. Due to the curved boundary of the particle non-linear mapping of finite elements to the mesh is beneficial here to have a good accuracy on a coarse mesh.
* Cavity problem. A nice example can be to find several whispering modes in a ring resonator.
* Find a band-gap structure for a photonic crystal. Needs Bloch-periodic boundary condition.
* Simulate a wave Y-splitter in the photonic crystal waveguide.


# Time domain

## Wave equation
For a free space the problem can be solved as a [wave equation](https://en.wikipedia.org/wiki/Electromagnetic_wave_equation

### Available codes
* [step-23](http://dealii.org/developer/doxygen/deal.II/step_23.html) Wave in the box (all boundaries are reflecting)
* [step-24](http://dealii.org/developer/doxygen/deal.II/step_24.html) Extend step-23 with simple first order approximation to absorbing boundary condition (the reflection from the boundary is visible in linear scale, which is not acceptable for typical EM application with usual PML reflection in the range from -30dB to -110dB). 


* [step-25](http://dealii.org/developer/doxygen/deal.II/step_25.html) The sine-Gordon soliton equation, which is a nonlinear variant of the time dependent wave equation covered in step-23 and step-24.
* [step-48](http://dealii.org/developer/doxygen/deal.II/step_48.html) Explicit time stepping for the Sine–Gordon equation based on a diagonal mass matrix. Efficient implementation of (nonlinear) finite element operators.

### Applied problems

* Surface plasmon-polaritons wave, e.g. like in fig 2 it this [paper](http://iopscience.iop.org/article/10.1088/1367-2630/10/3/033035)
* It would be nice to have some example of non-trivial materials in time-domain, e.g. with dispersion, anisotropy, nonlinearity, etc...
* Solving Mie problem in time domain is a good task to verify the method (it will give the spectral response, which should be post processed with discrete Fourie transform).




Konstantin Ladutenko

unread,
Oct 9, 2016, 12:40:29 PM10/9/16
to deal.II User Group
Ok, I was unbanned, my initial attempt to review solving Maxwell`s equations with deal.ii is available in wiki.

Alexander

unread,
Oct 10, 2016, 3:02:21 PM10/10/16
to deal.II User Group
Hi Konstantin,
you may want to look at our work: http://library.seg.org/doi/abs/10.1190/geo2015-0013.1

It's a very efficient approach for frequency domain formulation, in particular for problems with < 100M DoFs. The FEM part in the aforementioned paper is written using deal.II.

Best,
Alexander

Konstantin Ladutenko

unread,
Oct 11, 2016, 4:33:01 AM10/11/16
to deal.II User Group
Hi Alexander,

I added a short description of your paper to https://github.com/dealii/dealii/wiki/Electromagnetic-problem and provided your reference, fill free to improve it and the page in general. 

I had also done a short review of a series of papers on time-domain, noticeably there is a great paper by Rieben, Rodrigue, and White in 2005 about solving it with high-order elements using a symplectic algorithm for time-stepping (probably you can find interesting). 

I have two short questions on your paper:
1) Why did you choose to use Deal.ii instead of MFEM, mentioned in the paper?
2) Did you considered to put your code into deal.ii code gallery? Making it open-sourced should increase the impact of your paper and will help the deal.ii community.

Best regards,
Kostya

Alexander

unread,
Oct 12, 2016, 9:25:28 AM10/12/16
to deal.II User Group
Konstantin,
1. I had already some experience with deal.II by the time we started to work on efficient solver and high-order implementation. It was the easiest way.

2. Going open-source properly requires a significant time investments. Since I'm not in a CS or applied math department, it's quite difficult to justify this time spending at this stage. But I hope to be able to do it one day.

Best,
Alexander

Konstantin Ladutenko

unread,
Oct 12, 2016, 5:08:07 PM10/12/16
to deal.II User Group
Alexander,

Thank you for your answer! It was a bit surprising as soon as the second author is a lead dev of MFEM.

I suppose that you are still using or going to use deal.ii, making a real-life example of its advanced usage to be public  will help the progress to go on. This way you will have a better tool in your hands and it worth to spend a fraction of the time you have already spent on developing the code. I believe that just pushing  the project to GitHub should not be too time-consuming, if you can provide a preprint of the paper - it will be a great piece of documentation to such kind of program.

There are very few examples of using Nedelec elements, mostly in deal.ii/test, any full-fledged example is really welcomed. I think that at some point deal.ii will become more covered with production level apps, able to solve challenging problems, making it much easier to start for engineers and physicist without a special education.

Best regards,
Kostya
Reply all
Reply to author
Forward
0 new messages