Class Fields

Class Documentation

class Fields

Fields class for electromagnetic fields.

This class is used to store the electromagnetic fields data. The fields data is stored in the Mesh class objects.

Currently we store 3D electromagnetic fields for these variables:

  • Electric fields: \(\mathbf{E} = (E_x, E_y, E_z)\)

  • Magnetic fields: \(\mathbf{B} = (B_x, B_y, B_z)\)

The relative spacing between the fields points are stored as \(\mathrm{d}\mathbf{r}_{\mathbf{Q}}\) as a multiple of the mesh spacing \(\mathrm{d}\mathbf{r}\).

For the Yee grid we have:

  • \(E_x\) at \((0.5, 0, 0)\)

  • \(E_y\) at \((0, 0.5, 0)\)

  • \(E_z\) at \((0, 0, 0.5)\)

  • \(B_x\) at \((0, 0.5, 0.5)\)

  • \(B_y\) at \((0.5, 0, 0.5)\)

  • \(B_z\) at \((0.5, 0.5, 0)\)

Note

In the next release, current will also be stored.

Public Functions

inline Fields()
inline Fields(const Fields &fields)
inline Fields(const MeshSize &domain_size)
inline Fields(Fields &&other) noexcept
inline Fields(int nx, int ny, int nz, int ngx, int ngy, int ngz)
~Fields() = default
inline void InitializeMesh()
inline void SyncSize()

Public Members

Mesh<double> bx
Mesh<double> by
Mesh<double> bz
Mesh<double> ex
Mesh<double> ey
Mesh<double> ez
MeshSize size = {1, 1, 1, 1, 0, 0, 0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0}

Friends

inline friend void swap(Fields &first, Fields &second) noexcept