the yee scheme ( also known as finite - difference time - domain , or fdtd ) was introduced in  @xcite and remains one of the most successful numerical methods used in the field of computational electromagnetics , particularly in the area of microwave problems . although it is not a `` high - order '' method , it is still preferred for many applications because it preserves important structural features of maxwell s equations that other methods fail to capture . among these distinguishing attributes
are that the gauss constraint @xmath1 is exactly conserved in a discrete sense , and electrostatic solutions of the form @xmath2 indeed remain stationary in time ( see * ? ? ?
* ) . in this paper
, we show that these desirable properties are direct consequences of the variational and discrete differential structure of the yee scheme , which mirrors the geometry of maxwell s equations .
moreover , we will show how to construct other variational methods that , as a result , share these same numerical properties , while at the same time applying to more general domains .
geometric numerical integrators have been used primarily for the simulation of classical mechanical systems , where features such as symplecticity , conservation of momentum , and conservation of energy are essential .
( for a survey of various methods and applications , see  @xcite . ) among these , _ variational integrators _ are developed by discretizing the lagrangian variational principle of a system , and then requiring that numerical trajectories satisfy a discrete version of hamilton s stationary - action principle .
these methods are automatically symplectic , and they exactly preserve discrete momenta associated to symmetries of the lagrangian : for instance , systems with translational invariance will conserve a discrete linear momentum , those with rotational invariance will conserve a discrete angular momentum , etc .
in addition , variational integrators can be seen to display good long - time energy behavior , without artificial numerical damping ( see * ? ? ? * for a comprehensive overview of key results ) .
this variational approach was extended to discretizing general multisymplectic field theories , with an application to nonlinear wave equations , in  @xcite and  @xcite , which developed the multisymplectic approach for continuum mechanics .
building on this work , @xcite introduced _ asynchronous variational integrators _
( avis ) , with which it becomes possible to choose a different time step size for each element of the spatial mesh , while still preserving the same variational and geometric structure as uniform - time - stepping schemes .
these methods were implemented and shown to be not only practical , but in many cases superior to existing methods for problems such as nonlinear elastodynamics .
some further developments are given in  @xcite .
while there have been attempts to apply the existing avi theory to computational electromagnetics , these efforts encountered a fundamental obstacle .
the key symmetry of maxwell s equations is not rotational or translational symmetry , as in mechanics , but a _ differential gauge symmetry_. without taking additional care to preserve this gauge structure , even variational integrators can not be expected to capture the geometry of maxwell s equations . as will be explained , we overcome this obstacle by combining variational methods with discrete differential forms and operators .
this differential / gauge structure also turns out to be important for the numerical performance of the method , and is one of the hallmarks of the yee scheme .      as motivation , consider the basic relation @xmath3 , where @xmath4 is the magnetic flux and @xmath5 is the magnetic vector potential . because of the vector calculus identities @xmath6 and @xmath7 , this equation has two immediate and important consequences .
first , @xmath4 is automatically divergence - free .
second , any transformation @xmath8 has no effect on @xmath4 ; this describes a gauge symmetry , for which the associated conserved momentum is @xmath9 ( which must be zero by gauss law ) .
a similar argument also explains the invariance of electrostatic solutions , since @xmath10 is curl - free and invariant under constant shifts in the scalar potential @xmath11 .
therefore , a proper variational integrator for electromagnetism should also preserve a discrete analog of these differential identities .    this can be done by viewing the objects of electromagnetism not as vector fields , but as _ differential forms _ in @xmath0-dimensional spacetime , as is typically done in the literature on classical field theory . using a discrete exterior calculus ( called dec ) as the framework to discretize these differential forms , we find that the resulting variational integrators automatically respect discrete differential identities such as @xmath12 ( which encapsulates the previous div - curl - grad relations ) and stokes theorem .
consequently , they also respect the gauge symmetry of maxwell s equations , and therefore preserve the associated discrete momentum .
the yee scheme , as we will show , is a method of precisely this type , which gives a new explanation for many of its previously observed _ a posteriori _ numerical qualities .
for instance , one of its notable features is that the electric field @xmath13 and magnetic field @xmath14 do not live at the same discrete space or time locations , but at separate nodes on a staggered lattice .
the reason why this particular setup leads to improved numerics is not obvious : if we view @xmath13 and @xmath14 simply as vector fields in @xmath15-space  the exact same type of mathematical object
why should nt they live at the same points ? indeed , many finite element method ( fem ) approaches do exactly this , resulting in a `` nodal '' discretization .
however , from the perspective of differential forms in spacetime , it becomes clear that the staggered - grid approach is more faithful to the structure of maxwell s equations : as we will see , @xmath13 and @xmath14 come from objects that are dual to one another ( the spacetime forms @xmath16 and @xmath17 ) , and hence they naturally live on two staggered , dual meshes .    the argument for this approach is not merely a matter of theoretical interest : the geometry of maxwell s equations has important practical implications for numerical performance . for instance , the vector - field - based discretization , used in nodal fem , results in spurious @xmath15-d artifacts due to its failure to respect the underlying geometric structure . the yee scheme , on the other hand , produces resonance spectra in agreement with theory , without spurious modes ( see * ? ? ? * ) .
furthermore , it has been shown in  @xcite that staggered - grid methods can be used to develop fast numerical methods for electromagnetism , even for problems in heterogeneous media with highly discontinuous material parameters such as conductivity and permeability .    by developing a structure - preserving , geometric discretization of maxwell s equations ,
not only can we better understand the yee scheme and its characteristic advantages , but we can also construct more general methods that share its desirable properties .
this family of methods includes the `` yee - like '' scheme of  @xcite , which presented the first extension of yee s scheme to unstructured grids ( e.g. , simplicial meshes rather than rectangular lattices ) .
general methods like these are highly desirable : rectangular meshes are not always practical or appropriate to use in applications where domains with curved and oblique boundaries are needed ( see , for instance * ? ? ?
* ) . by allowing general discretizations while still preserving geometry , one can combine the best attributes of the fem and yee schemes .      using dec as a structure - preserving , geometric framework for general discrete meshes ,
we have obtained the following results :    1 .
the yee scheme is actually a variational integrator : that is , it can be obtained by applying hamilton s principle of stationary action to a discrete lagrangian .
2 .   consequently
, the yee scheme is _
multisymplectic _ and _ preserves discrete momentum maps _
( i.e. , conserved quantities analogous to the continuous case of electromagnetism ) . in particular
, the gauss constraint is understood as a discrete momentum map of this integrator , while the preservation of electrostatic potential solutions corresponds to the identity @xmath18 , where @xmath19 is the discrete exterior derivative operator .
we also create a foundation for more general schemes , allowing _
arbitrary discretizations of spacetime _
, not just uniform time steps on a spatial mesh .
one such scheme , introduced here , is a new asynchronous variational integrator ( avi ) for maxwell s equations , where each spatial element is assigned its own time step size and evolves `` asynchronously '' with its neighbors .
this means that one can choose to take small steps where greater refinement is needed , while still using larger steps for other elements .
since refining one part of the mesh does not restrict the time steps taken elsewhere , an avi can be computationally efficient and numerically stable with fewer total iterations .
in addition to the avi scheme , we briefly sketch how completely covariant spacetime integrators for electromagnetism can be implemented , without even requiring a 3 + 1 split into space and time components .
we will begin by reviewing maxwell s equations : first developing the differential forms expression from a lagrangian variational principle , and next showing how this is equivalent to the familiar vector calculus formulation .
we will then motivate the use of dec for computational electromagnetics , explaining how electromagnetic quantities can be modeled using discrete differential forms and operators on a spacetime mesh .
these dec tools will then be used to set up the discrete maxwell s equations , and to show that the resulting numerical algorithm yields the yee and bossavit  kettunen schemes as special cases , as well as a new avi method .
finally , we will demonstrate that the discrete maxwell s equations can also be derived from a discrete variational principle , and will explore its other discrete geometric properties , including multisymplecticity and momentum map preservation .
this section quickly reviews the differential forms approach to electromagnetism , in preparation for the associated discrete formulation given in the next section . for more details
, the reader can refer to  @xcite and  @xcite .
maxwell s equations , without free sources of charge or current , are traditionally expressed in terms of four vector fields in @xmath15-space : the electric field @xmath13 , magnetic field @xmath14 , electric flux density @xmath20 , and magnetic flux density @xmath4 . to translate these into the language of differential forms , we begin by replacing the electric field with a @xmath21-form @xmath22 and the magnetic flux density by a @xmath23-form @xmath24 .
these have the coordinate expressions @xmath25 where @xmath26 and @xmath27 . the motivation for choosing @xmath22 as a @xmath21-form and @xmath24 as a @xmath23-form comes from the integral formulation of faraday s law , @xmath28 where @xmath13 is integrated over curves and @xmath4 is integrated over surfaces .
similarly , ampre s law , @xmath29 integrates @xmath14 over curves and @xmath20 over surfaces , so we can likewise introduce a @xmath21-form @xmath30 and a @xmath23-form @xmath31 .
now , @xmath13 and @xmath4 are related to @xmath20 and @xmath14 through the usual constitutive relations @xmath32 as shown in  @xcite , we can view @xmath33 and @xmath34 as corresponding to hodge operators @xmath35 and @xmath36 , which map the @xmath21-form `` fields '' to @xmath23-form `` fluxes '' in space .
therefore , this is compatible with viewing @xmath22 and @xmath30 as @xmath21-forms , and @xmath31 and @xmath24 as @xmath23-forms .
note that in a vacuum , with @xmath37 and @xmath38 constant , one can simply express the equations in terms of @xmath13 and @xmath4 , choosing appropriate geometrized units such that @xmath39 , and hence ignoring the distinction between @xmath13 and @xmath20 and between @xmath4 and @xmath14 .
this is typically the most familiar form of maxwell s equations , and the one that most students of electromagnetism first encounter . in this presentation
, we will restrict ourselves to the vacuum case with geometrized units ; for geometric clarity , however , we will always distinguish between the @xmath21-forms @xmath22 and @xmath30 and the @xmath23-forms @xmath31 and @xmath24 .
finally , we can incorporate free sources of charge and current by introducing the _ charge density @xmath15-form _ @xmath40 , as well as the _ current density @xmath23-form _ @xmath41 .
these are required to satisfy the continuity of charge condition @xmath42 , which can be understood as a conservation law ( in the finite volume sense ) .      in lorentzian spacetime
, we can now combine @xmath22 and @xmath24 into a single object , the faraday @xmath23-form @xmath43 there is a theoretical advantage to combining the electric field and magnetic flux into a single spacetime object : this way , electromagnetic phenomena can be described in a relativistically covariant way , without favoring a particular split of spacetime into space and time components .
in fact , we can turn the previous construction around : take @xmath16 to be the fundamental object , with @xmath22 and @xmath24 only emerging when we choose a particular coordinate frame . taking the hodge star of @xmath16
, we also get a dual @xmath23-form @xmath44 called the maxwell @xmath23-form .
the equation @xmath17 describes the dual relationship between @xmath22 and @xmath24 on one hand , and @xmath31 and @xmath30 on the other , that is expressed in the constitutive relations .
likewise , the charge density @xmath45 and current density @xmath46 can be combined into a single spacetime object , the source @xmath15-form @xmath47 having defined @xmath48 in this way , the continuity of charge condition simply requires that @xmath48 be closed , i.e. , @xmath49 .
let @xmath50 be the electromagnetic potential @xmath21-form , satisfying @xmath51 , over the spacetime manifold @xmath52 .
then define the @xmath0-form lagrangian density @xmath53 and its associated action functional @xmath54 = \int _ x \mathcal{l}.\ ] ] now , take a variation @xmath55 of @xmath50 , where @xmath55 vanishes on the boundary @xmath56 .
then the variation of the action functional along @xmath55 is @xmath57 \cdot \alpha & = \left . \frac{\mathrm{d }      } { \mathrm{d } \epsilon } \right\rvert _ { \epsilon = 0 } s[a + \epsilon    \alpha ] \\    & = \int _ x \left ( - \mathrm{d } \alpha \wedge * \mathrm{d } a + \alpha      \wedge \mathcal{j } \right ) \\    & = \int _ x \alpha \wedge \left ( - \mathrm{d } { * \mathrm{d}a } +      \mathcal{j } \right ) , \end{aligned}\ ] ] where in this last equality we have integrated by parts , using the fact that @xmath55 vanishes on the boundary .
hamilton s principle of stationary action requires this variation to be equal to zero for arbitrary @xmath55 , thus implying the electromagnetic euler  lagrange equation , @xmath58      since @xmath59 , then clearly is equivalent to @xmath60 .
furthermore , since @xmath61 , it follows that @xmath62 .
hence , maxwell s equations with respect to the maxwell and faraday @xmath23-forms can be written as @xmath63    suppose now we choose the standard coordinate system @xmath64 on minkowski space @xmath65 , and define @xmath22 and @xmath24 through the relation @xmath66 .
then a straightforward calculation shows that is equivalent to @xmath67 likewise , if @xmath68 , then is equivalent to @xmath69 hence this lagrangian , differential forms approach to maxwell s equations is _ strictly equivalent _ to the more classical vector calculus formulation in smooth spacetime .
however , in discrete spacetime , we will see that the differential forms version is _ not _ equivalent to an arbitrary vector field discretization , but rather implies a particular choice of discrete objects .
we can also derive maxwell s equations by using a mixed variational principle , similar to the hamilton
pontryagin principle introduced by @xcite for classical lagrangian mechanics . to do this
, we treat @xmath50 and @xmath16 as separate fields , while @xmath70 acts as a lagrange multiplier , weakly enforcing the constraint @xmath71 .
define the extended action to be @xmath72 = \int _ x \left [   - \frac{1}{2 } f \wedge * f + a \wedge      \mathcal{j } + \left ( f - \mathrm{d } a \right ) \wedge g \right ] .\ ] ] then , taking the variation of the action along some @xmath73 ( vanishing on @xmath56 ) , we have @xmath74 \cdot \left ( \alpha , \phi , \gamma \right ) & =    \int _ x \left [ - \phi \wedge * f + \alpha \wedge \mathcal{j } +      \left ( \phi - \mathrm{d } \alpha \right ) \wedge g + \left ( f -        \mathrm{d } a \right ) \wedge \gamma \right ] \\    & = \int _ x \left [ \alpha \wedge \left ( \mathcal{j } - \mathrm{d } g      \right ) + \phi \wedge \left ( g - * f \right ) + \left ( f -        \mathrm{d } a \right ) \wedge
\gamma \right ] .\end{aligned}\ ] ] therefore , setting this equal to zero , we get the equations @xmath75 this is precisely equivalent to maxwell s equations , as derived above
. however , this approach provides some additional insight into the geometric structure of electromagnetics : the gauge condition @xmath51 and constitutive relations @xmath17 are _ explicitly included in the equations of motion _ , as a direct result of the variational principle .      when solving an initial value problem , it is not necessary to use all of maxwell s equations to evolve the system forward in time .
in fact , the curl equations and automatically conserve the quantities @xmath76 and @xmath77 . therefore , the divergence equations and can be viewed simply as constraints on initial conditions , while the curl equations completely describe the time evolution of the system .
there are a number of ways to see why we can justify eliminating the divergence equations .
a straightforward way is to take the divergence of equations and . since @xmath78 , we are left with @xmath79 therefore , if the divergence constraints are satisfied at the initial time , then they are satisfied for all time , since the divergence terms are constant .
another approach is to notice that maxwell s equations depend only on the exterior derivative @xmath80 of the electromagnetic potential , and not on the value of @xmath50 itself .
therefore , the system has a _ gauge symmetry _ :
any gauge transformation @xmath81 leaves @xmath80 , and hence maxwell s equations , unchanged .
choosing a time coordinate , we can then partially fix the gauge so that the electric scalar potential @xmath82 ( the so - called weyl gauge or temporal gauge ) , and so @xmath50 has only spatial components .
in fact , these three remaining components correspond to those of the usual vector potential @xmath5 .
the reduced euler
lagrange equations in this gauge consist only of , while the remaining gauge symmetry @xmath83 yields a momentum map that automatically preserves @xmath84 in time .
equations and are automatically preserved by the identity @xmath85 ; they are not actually part of the euler  lagrange equations . a more detailed exposition of these calculations will be given in .
in this section , we give a quick review of the fundamental objects and operations of discrete exterior calculus ( dec ) , a structure - preserving calculus of discrete differential forms . by construction ,
dec automatically preserves a number of important geometric structures , and hence it provides a fully discrete analog of the tools used in the previous section to express the differential forms version of maxwell s equations . in subsequent sections , we will use this framework to formulate maxwell s equations discretely , emulating the continuous version .
modern computational electromagnetism started in the 1960s , when the finite element method ( fem ) , based on _ nodal basis functions _ , was used successfully to discretize the differential equations governing @xmath23-d static problems formulated in terms of a scalar potential .
unfortunately , the initial success of the fem approach appeared unable to carry over to @xmath15-d problems without spurious numerical artifacts . with the introduction of _ edge elements _ in  @xcite came the realization that a better discretization of the geometric structure of maxwell s electromagnetic theory was key to overcoming this obstacle ( see  @xcite for more historical details ) .
mathematical tools developed by weyl and whitney in the 1950s , in the context of algebraic topology , turned out to provide the necessary foundations on which robust numerical techniques for electromagnetism can be built , as detailed in  @xcite .      in this section ,
we show how to define differential forms and operators on a discrete mesh , in preparation to use this framework for computational modeling of classical fields . by construction
, the calculus of discrete differential forms automatically preserves a number of important geometric structures , including stokes theorem , integration by parts ( with a proper treatment of boundaries ) , the de  rham complex , poincar duality , poincar s lemma , and hodge theory .
therefore , this provides a suitable foundation for the coordinate - free discretization of geometric field theories . in subsequent chapters
, we will also use these discrete differential forms as the space of fields on which we will define discrete lagrangian variational principles .
the particular `` flavor '' of discrete differential forms and operators we will be using is known as _ discrete exterior calculus _ , or _
dec _ for short ; see @xcite .
( for related efforts in this direction , see also  @xcite and  @xcite . ) guided by cartan s exterior calculus of differential forms on smooth manifolds , dec is a discrete calculus developed , _ ab initio _
, on discrete manifolds , so as to maintain the covariant nature of the quantities involved .
this computational tool is based on the notion of discrete chains and cochains , used as basic building blocks for compatible discretizations of important geometric structures such as the de  rham complex @xcite .
the chain and cochain representations are not only attractive from a computational perspective due to their conceptual simplicity and elegance ; as we will see , they also originate from a theoretical framework defined by  @xcite , who introduced the whitney and de  rham maps that establish an isomorphism between simplicial cochains and lipschitz differential forms .
dec is concerned with problems in which the smooth @xmath86-dimensional manifold @xmath52 is replaced by a discrete mesh  precisely , by a cell complex that is manifold , admits a metric , and is orientable .
the simplest example of such a mesh is a finite simplicial complex , such as a triangulation of a @xmath23-dimensional surface .
we will generally denote the complex by @xmath87 , and a cell in the complex by @xmath88 .
given a mesh @xmath87 , one can construct a _ dual mesh _
@xmath89 , where each @xmath90-cell @xmath91 corresponds to a dual @xmath92-cell @xmath93 .
( @xmath89 is `` dual '' to @xmath94 in the sense of a graph dual . )
one way to do this is as follows : place a dual vertex at the circumcenter of each @xmath86-simplex , then connect two dual vertices by an edge wherever the corresponding @xmath86-simplices share an @xmath95-simplex , and so on .
this is called the _ circumcentric dual _ , and it has the important property that primal and dual cells are automatically orthogonal to one another , which is advantageous when defining an inner product ( as we will see later in this section ) .
for example , the circumcentric dual of a delaunay triangulation , with the euclidean metric , is its corresponding voronoi diagram ( see ) . for more on the dual relationship between delaunay triangulations and voronoi diagrams ,
a standard reference is  @xcite .
a similar construction of the circumcenter can be carried out for higher - dimensional euclidean simplicial complexes , as well as for simplicial meshes in minkowski space .
note that , in both the euclidean and lorentzian cases , the circumcenter may actually lie _ outside _ the simplex if it has a very bad aspect ratio , underscoring the importance of mesh quality for good numerical results .
there are alternative ways to define the dual mesh  for example , placing dual vertices at the barycenter rather than the circumcenter  but we will use the circumcentric dual unless otherwise noted . note that a refined definition of the dual mesh , where dual cells at the boundary are restricted to @xmath87 , will be discussed in   to allow proper enforcement of boundary conditions in computational electromagnetics
.    -d simplicial mesh ( left ) , we can construct its circumcentric dual mesh , called the voronoi diagram of the primal mesh ( right ) . in bold , we show one particular primal edge @xmath96 ( left ) and its corresponding dual edge @xmath97 ( right ) ; the convex hull of these cells @xmath98 is shaded dark grey . ]
the fundamental objects of dec are discrete differential forms .
a discrete @xmath90-form @xmath99 assigns a real number to each oriented @xmath90-dimensional cell @xmath100 in the mesh @xmath87 .
( the superscripts @xmath90 are not actually required by the notation , but they are often useful as reminders of what order of form or cell we are dealing with . ) this value is denoted by @xmath101 , and can be thought of as the value of @xmath102 `` integrated over '' the element @xmath100 , i.e. , @xmath103 for example , @xmath104-forms assign values to vertices , @xmath21-forms assign values to edges , etc . we can extend this to integrate over discrete paths by linearity : simply add the form s values on each cell in the path , taking care to flip the sign if the path is oriented opposite the cell .
formally , these `` paths '' of @xmath90-dimensional elements are called _ chains _ , and discrete differential forms are _ cochains _ , where @xmath105 is the pairing between cochains and chains .
differential forms can be defined either on the mesh @xmath87 or on its dual @xmath89
. we will refer to these as _ primal forms _ and _ dual forms _ respectively .
note that there is a natural correspondence between primal @xmath90-forms and dual @xmath92-forms , since each primal @xmath90-cell has a dual @xmath92-cell .
this is an important property that will be used below to define the discrete hodge star operator .
the discrete exterior derivative @xmath19 is constructed to satisfy stokes theorem , which in the continuous sense is written @xmath106 therefore , if @xmath55 is a discrete differential @xmath90-form , then the @xmath107-form @xmath108 is defined on any @xmath109-chain @xmath91 by @xmath110 where @xmath111 is the @xmath112-chain boundary of @xmath113 .
for this reason , @xmath19 is often called the _ coboundary _ operator in cohomology theory .
the discrete hodge star transforms @xmath90-forms on the primal mesh into @xmath92-forms on the dual mesh , and vice - versa . in our setup
, we will use the so - called diagonal ( or mass - lumped ) approximation of the hodge star @xcite because of its simplicity , but note that higher - order accurate versions can be substituted . given a discrete form @xmath55 , its _ hodge star _
@xmath114 is defined by the relation @xmath115 where @xmath116 and @xmath117 are the volumes of these elements , and @xmath118 is the causality operator , which equals @xmath119 when @xmath113 is spacelike and @xmath120 otherwise .
( for more information on alternative discrete hodge operators , the reader may refer to , e.g. , @xcite . )
define the _ @xmath121 inner product _
@xmath122 between two primal @xmath90-forms to be @xmath123 where the sum is taken over all @xmath90-dimensional elements @xmath91 , and @xmath124 is the @xmath86-dimensional convex hull of @xmath125 ( see  ) .
the final equality holds as a result of using the circumcentric dual , since @xmath91 and @xmath126 are orthogonal to one another , and hence @xmath127 .
( indeed , this is one of the advantages of using the circumcentric dual , since one only needs to store volume information about the primal and dual cells themselves , and not about these primal - dual convex hulls . )
this inner product can be expressed in terms of @xmath128 , as in the continuous case , for a particular choice of the discrete primal - dual wedge product ; see  @xcite .
note that since we have already defined a discrete version of the operators @xmath129 and @xmath130 , we immediately have a discrete codifferential @xmath131 , with the same formal expression as given previously .
see   for a visual diagram of primal and dual discrete forms , along with the corresponding operators @xmath132 , for the case where @xmath87 is a @xmath15-d tetrahedral mesh .    -d simplicial mesh . in the top row
, we see how a discrete @xmath90-form lives on @xmath90-cells of the primal mesh , for @xmath133 ; the bottom row shows the location of the corresponding dual @xmath92-forms on the dual mesh .
the differential operators @xmath129 and @xmath131 map `` horizontally '' between @xmath90 and @xmath134 forms , while the hodge star @xmath130 and its inverse @xmath135 map `` vertically '' between primal and dual forms . ]
dec can be implemented simply and efficiently using linear algebra .
a @xmath90-form @xmath55 can be stored as a vector , where its entries are the values of @xmath55 on each @xmath90-cell of the mesh .
that is , given a list of @xmath90-cells @xmath136 , the entries of the vector are @xmath137 .
the exterior derivative @xmath129 , taking @xmath90-forms to @xmath134-forms , is then represented as a matrix : in fact , it is precisely the _ incidence matrix _ between @xmath90-cells and @xmath134-cells in the mesh , with sparse entries @xmath138 .
the hodge star taking primal @xmath90-forms to dual @xmath92-forms becomes a square matrix , and in the case of the diagonal hodge star , it is the diagonal matrix with entries @xmath139 .
the discrete inner product is then simply the hodge star matrix taken as a quadratic form .    because of this straightforward isomorphism between dec and linear algebra , problems posed in the language of dec can take advantage of existing numerical linear algebra codes . for more details on programming and implementation , refer to  @xcite .
particular care is required to properly enforce initial and boundary conditions on the discrete spacetime boundary @xmath140 .
for example , in electromagnetism , we may wish to set initial conditions for @xmath22 and @xmath24 at time @xmath141  but while @xmath24 is defined on @xmath142 at @xmath141 , @xmath22 is not .
in fact , as we will see , @xmath22 lives on edges that are extruded between the time slices @xmath143 and @xmath144 , so unless we modify our definitions , we can only initialize @xmath22 at the half - step @xmath145 .
( this half - step issue also arises with the standard yee scheme . )
there are some applications where it may be acceptable to initialize @xmath22 and @xmath24 at separate times ( for example , when the fields are initialized randomly and integrated for a long time to compute a resonance spectrum ) , but we wish to be able to handle the more general case .
although our previous exposition of dec thus far applies anywhere away from a boundary , notions as simple as `` dual cell '' need to be defined carefully on or near @xmath140 .    for a primal mesh @xmath87 , the dual mesh @xmath146 is defined as _
the voronoi dual of @xmath87 restricted to @xmath87_. this truncates the portion of the dual cells extending outside of @xmath147 ; compare with the earlier .
this new definition results in the addition of a dual vertex at the circumcenter of each boundary @xmath95-simplex , in addition to the interior @xmath86-simplices as previously defined . to complete the dual mesh @xmath146
, we add a dual edge between adjacent dual vertices on the boundary , as well as between dual boundary vertices and their neighboring interior dual vertices , and proceed similarly with higher - dimensional dual cells . for intuition , one can imagine the @xmath95-dimensional boundary to be a vanishingly thin @xmath86-dimensional shell .
that is , each boundary @xmath148-simplex can be thought of as a prismal @xmath90-cell that has been `` squashed flat '' along the boundary normal direction .
this process is quite similar to the use of `` ghost cells '' at the boundary , as is commonly done for finite volume methods ( see * ? ? ?
note that these additional dual cells provide the boundary @xmath149 with its own dual mesh @xmath150 .
in fact , the boundary of the dual is now equal to the dual of the boundary , i.e. , @xmath151 .
-d example , the dual mesh is properly defined near the boundary by adding dual vertices on the boundary edges . the restricted voronoi cells of the primal boundary vertices ( shaded at right ) thus have boundaries containing both dual edges ( dashed lines ) _ and _ primal boundary half - edges . ]
returning to the example of initial conditions on @xmath22 and @xmath24 , we recall that @xmath22 is defined on extruded faces normal to the time slice @xmath143 .
therefore , thanks to the proper restriction of the voronoi diagram to the domain , we can now define @xmath22 on _ edges _ in @xmath152 at time @xmath143 , where these edges can be understood as vanishingly thin faces ( i.e. , extruded between some @xmath153 and @xmath143 for @xmath154 ) .
notice finally that with this construction of @xmath146 , there is a dual relationship between dirichlet conditions on the dual mesh and neumann conditions on the primal mesh , e.g. , between primal fields and dual fluxes , as expected .
with the dual mesh properly defined , dual forms can now be defined on the boundary .
therefore , the discrete duality between @xmath155 and @xmath156 can be generalized to include nonvanishing boundary terms .
if @xmath55 is a primal @xmath148-form and @xmath157 is a primal @xmath90-form , then @xmath158 in the boundary integral , @xmath55 is still a primal @xmath148-form on @xmath159 , while @xmath160 is an @xmath92-form taken on the boundary dual @xmath161 .
formula is readily proved using the familiar method of discrete `` summation by parts , '' and thus agrees with the integration by parts formula for smooth differential forms .
in this section , we explain how to obtain numerical algorithms for solving maxwell s equations with dec . to do so
, we will proceed in the following order .
first , we will find a sensible way to define the discrete forms @xmath16 , @xmath70 , and @xmath48 on a spacetime mesh .
next , we will use the dec version of the operators @xmath19 and @xmath162 to obtain the discrete maxwell s equations . while we havent yet shown that these equations are variational in the discrete sense
, we will show later in that the lagrangian derivation of the smooth maxwell s equations also holds with the dec operators , in precisely the same way .
finally , we will discuss how these equations can be used to define a numerical method for computational electromagnetics .    in particular , for a rectangular grid
, we will show that our setup results in the traditional yee scheme . for a general triangulation of space with equal time steps ,
the resulting scheme will be bossavit and kettunen s scheme .
we will then develop an avi method , where each spatial element can be assigned a different time step , and the time integration of maxwell s equations can be performed on the elements asynchronously .
finally , we will comment on the equations for fully generalized spacetime meshes , e.g. , an arbitrary meshing of @xmath163 by @xmath0-simplices .
note that the idea of discretizing maxwell s equations using spacetime cochains was mentioned in , e.g. ,  @xcite , as well as in a paper by  @xcite taking the more abstract perspective of higher - level `` @xmath164-form '' versions of electromagnetism and category theory .
suppose that we have a rectangular grid in @xmath165 , oriented along the axes @xmath64 . to simplify this exposition ( although it is not necessary ) ,
let us also suppose that the grid has uniform space and time steps @xmath166 . note that the dec setup applies directly to a non - simplicial rectangular mesh , since an @xmath86-rectangle does in fact have a circumcenter .
since @xmath16 is a @xmath23-form , its values should live on @xmath23-faces in this grid .
following the continuous expression of @xmath16 @xmath167 and due to the tensor product nature of the regular grid , the exact assignment of each @xmath23-face becomes simple : _ the six components of @xmath16 correspond precisely to the six types of @xmath23-faces in a @xmath0-d rectangular grid_. simply assign the values @xmath168 to faces parallel to the @xmath169-plane , @xmath170 to faces parallel to the @xmath171-plane , and @xmath172 to faces parallel to the @xmath173-plane .
likewise , assign @xmath174 to faces parallel to the @xmath175-plane , @xmath176 to faces parallel to the @xmath177-plane , and @xmath178 to faces parallel to the @xmath179-plane .
this is pictured in .
are stored on the primal @xmath23-faces of a @xmath0-d rectangular grid .
shown here are the three mixed space / time @xmath15-cells , and the one purely spatial @xmath15-cell ( lower right ) . ]
let us look at these values on the faces of a typical @xmath0-rectangle @xmath180 \times \left [ y _
l , y _ { l + 1 } \right ] \times \left [ z _ m , z _ { m + 1 } \right ] \times \left [ t _ n ,    t _ { n + 1 } \right ] $ ] . to simplify the notation
, we can index each value of @xmath16 by the midpoint of the @xmath23-face on which it lives : for example , @xmath181 is stored on the face @xmath182 \times \left\{y _ l\right\ } \times \left\{z _ m\right\ } \times \left [ t _ n , t _ { n + 1 } \right ]
$ ] , parallel to the @xmath183-plane .
hence , the following values are assigned to the corresponding faces : @xmath184 @xmath185 we see that a `` staggered grid '' arises from the fact that @xmath22 and @xmath24 naturally live on @xmath23-faces , not at vertices or @xmath0-cells .
the discrete equations of motion are , as in the continuous case , @xmath186 where now these equations are interpreted in the sense of dec .
let us first look at the dec interpretation of @xmath187 .
since @xmath188 is a discrete @xmath15-form , it takes values on the @xmath15-faces of each @xmath0-rectangle .
its values are as follows : @xmath189 @xmath190 @xmath191 @xmath192 setting each of these equal to zero , we arrive at the following four equations : @xmath193 @xmath194 @xmath195 and @xmath196 these equations are the discrete version of the equations @xmath197 moreover , since @xmath22 and @xmath24 are differential forms , this can also be seen as a discretization of the _ integral version _ of maxwell s equations as well ! because dec satisfies a discrete stokes theorem , this automatically preserves the equivalence between the differential and integral formulations of electromagnetism .    doing the same with the equation @xmath60 , evaluating on dual @xmath15-faces this time , we arrive at four more equations : @xmath198 @xmath199 @xmath200 and @xmath201 this results from storing @xmath202 on the dual grid , as shown in .
this set of equations is the discrete version of @xmath203     are stored on dual @xmath23-faces in a rectangular grid .
shown here are a mixed space / time dual @xmath15-cell ( left ) , corresponding to a spacelike primal edge ; and a purely spatial dual @xmath15-cell ( right ) , corresponding to a timelike primal edge .
there are also two other mixed space / time cells , as in , that are not shown here . ]    after eliminating the redundant divergence equations and ( see for details ) and making the substitutions @xmath204 , @xmath205 , the remaining equations are precisely the yee scheme , as formulated in  @xcite .
we now consider the case of an unstructured grid in space , but with uniform steps in time as advocated in , e.g. , @xcite .
suppose that , instead of a rectangular grid for both space and time , we have an arbitrary space discretization on which we would like to take uniform time steps .
( for example , we may be given a tetrahedral mesh of the spatial domain . )
this mesh contains two distinct types of @xmath23-faces .
first , there are triangular faces that live entirely in the space mesh at a single position in time .
every edge of such a face is spacelike  that is , it has positive length  so the causality operator defined in takes the value @xmath206 .
second , there are rectangular faces that live between time steps .
these faces consist of a single spacelike edge extruded by one time step . because they have one timelike edge , these faces satisfy @xmath207 .
again , the circumcentric - dual dec framework applies directly to this type of mesh , since the prismal extrusion of a @xmath15-simplex still has a circumcenter .
again , we can characterize the discrete values of @xmath16 by looking at the continuous expression @xmath208 therefore , let us assign @xmath24 to the purely spacelike faces and @xmath209 to the mixed space / time faces .
looking at @xmath17 shows that mixed dual faces should store @xmath210 and spacelike dual faces should store @xmath31 ; see .
is stored on primal @xmath23-faces ( left ) , while @xmath17 is stored on dual @xmath23-faces ( right ) .
shown here are the values on mixed space / time @xmath15-cells .
( the purely spatial @xmath15-cells , which correspond to the divergence equations and do not contribute to the equations of motion , are not shown . ) ]      as in  @xcite , we can store the values of each differential form over every spatial element in an array , using the method described in .
this leads to the arrays @xmath211 and @xmath212 at whole time steps @xmath86 , and @xmath213 and @xmath214 at half time steps .
let @xmath215 denote the edges - to - faces incidence matrix for the spatial domain .
that is , @xmath216 is the matrix corresponding to the discrete exterior derivative , taken only in space , from primal @xmath21-forms to primal @xmath23-forms .
similarly , the transpose @xmath217 corresponds to the exterior derivative from spatial dual @xmath21-forms to dual @xmath23-forms .
then the equation @xmath218 , evaluated on all prismal @xmath15-faces becomes @xmath219 likewise , the equation @xmath60 , evaluated on all space / time @xmath15-faces in the dual mesh , becomes @xmath220 we can also evaluate @xmath218 and @xmath221 on spacelike @xmath15-faces , e.g , tetrahedra ; these simply yield the discrete versions of the divergence conditions for @xmath24 and @xmath31 , which can be eliminated .
therefore , the dec scheme for such a mesh is equivalent to bossavit and kettunen s yee - like scheme ; additionally , when the spatial mesh is taken to be rectangular , this integrator reduces to the standard yee scheme .
however , we now have solid foundations to extend this integrator to handle asynchronous updates for improved efficiency .      instead of picking the same time step size for every element of the spatial mesh , as in the previous two sections , it is often more efficient to assign each element its own , optimized time step , as done in  @xcite for problems in elastodynamics . in this case , rather than the entire mesh evolving forward in time simultaneously , individual elements advance one - by - one , asynchronously  hence the name _ asynchronous variational integrator _
( avi ) . as we will prove in
, this asynchronous update process will maintain the variational nature of the integration scheme .
here , we again allow the spatial mesh to be unstructured .
after choosing a primal space mesh , assign each spatial @xmath23-face ( e.g. , triangle ) @xmath91 its own discrete time set @xmath222 for example , one might assign each face a fixed time step size @xmath223 , taking equal time steps _ within _ each element , but with @xmath224 varying _ across _ elements .
we further require for simplicity of explanation that , except for the initial time , no two faces take the same time step : that is , @xmath225 for @xmath226 .    in order to keep proper time at the edges @xmath227
where multiple faces with different time sets meet , we let @xmath228 therefore the mixed space - time @xmath23-faces , which correspond to the edge @xmath227 extruded over a time step , are assigned the set of intermediate times @xmath229 where @xmath230 .
the values stored on a primal avi mesh are shown in .        since @xmath231 when @xmath232 , each spatial edge @xmath227 takes more time steps than any one of its incident faces @xmath91 ; as a result , it is not possible in general to construct a circumcentric dual on the entire spacetime avi mesh , since the mesh is not prismal and hence the circumcenter may not exist . instead , we find the circumcentric dual to the _ spatial _ mesh , and assign same time steps to the primal and dual elements @xmath233 this results in well - defined primal and dual cells for each @xmath23-element in spacetime , and hence a hodge star for this order .
( a hodge star on forms of different order is not needed to formulate maxwell s equations . )
the equation @xmath218 , evaluated on a mixed space / time @xmath15-cell , becomes @xmath234 similarly , the equation @xmath60 becomes @xmath235 where @xmath236 equals @xmath21 when face @xmath91 has @xmath237 for some @xmath86 , and @xmath104 otherwise .
( that is , the indicator function `` picks out '' the incident face that lives at the same time step as this edge . )    solving an initial value problem can then be summarized by the following update loop :    1 .
pick the minimum time @xmath238 where @xmath239 has not yet been computed .
2 .   advance @xmath240 according to .
update @xmath241 .
4 .   advance @xmath242 on neighboring edges @xmath243 according to .
update @xmath244 .
as detailed in  @xcite for elastodynamics , the explicit avi update scheme can be implemented by selecting mesh elements from a priority queue , sorted by time , and iterating forward . however , as written above , the scheme is not strictly iterative , since depends on past values of @xmath22 .
this can be easily fixed by rewriting the avi scheme to advance in the variables @xmath50 and @xmath22 instead , where the potential @xmath50 effectively stores the cumulative contribution of @xmath245 to the value of @xmath246 on neighboring faces .
compared to the avi for elasticity , @xmath50 plays the role of the positions @xmath247 , while @xmath22 plays the role of the ( negative ) velocities @xmath248 .
the algorithm is given as pseudocode in .
note that if all elements take uniform time steps , the avi reduces to the bossavit
kettunen scheme .    ' '' ''    @xmath249 _ //
store initial field values and times _ @xmath250 compute the next update time @xmath251 @xmath252.push@xmath253 _ //
push element onto queue with its next update time _
@xmath254 @xmath252.pop ( ) _ //
pop next element @xmath91 and time @xmath255 from queue _ @xmath256 _ // update neighboring values of @xmath50 at time @xmath255 _
@xmath257 @xmath258 @xmath259 @xmath260 @xmath261 @xmath262 _ // update element s time _ compute the next update time @xmath263 @xmath252.push@xmath264 _ // schedule @xmath91 for next update _    ' '' ''      we first present a simple numerical example demonstrating the good energy behavior of our asynchronous integrator .
the avi was used to integrate in time over a @xmath23-d rectangular cavity with perfectly electrically conducting ( pec ) boundaries , so that @xmath22 vanishes at the boundary of the domain .
@xmath22 was given random values at the initial time , so as to excite all frequency modes , and integrated for 8 seconds .
each spatial element was given a time step equal to 1/10 of the stability - limiting time step determined by the cfl condition .
this simulation was done for two different spatial discretizations .
the first is a uniform discretization so that each element has identical time step size , which coincides exactly with the yee scheme .
the second discretization randomly partitioned the @xmath265- and @xmath266-axes , so that each element has completely unique spatial dimensions and time step size , and so the update rule is truly asynchronous .
the energy plot for the uniform yee discretization is shown in , while the energy for the random discretization is shown in . even for a completely random , irregular mesh , our asynchronous integrator displays near - energy preservation qualities .
such numerical behavior stems from the variational nature of our integrator , which will be detailed in .
in addition , we tested the performance of the avi method with regard to computing the resonant frequencies of a @xmath15-d rectangular cavity , but using an _ unstructured _ tetrahedral spatial mesh .
while the resonant frequencies are relatively simple to compute analytically , nodal finite element methods are well known to produce spurious modes for this type of simulation . by contrast , as shown in  , the avi simulation produces a resonance spectrum in close agreement with theory .
furthermore , by refining the mesh close to the spatial boundary , while using a coarser discretization in the interior , we were able to achieve these results with less computational effort than a uniformly fine mesh would require , since the time steps were selected to be proportional to the respective element sizes .      finally , we look at the most general possible case : an arbitrary discretization of spacetime , such as a simplicial @xmath0-complex .
such a mesh is completely relativistically covariant , so that @xmath16 can not be objectively separated into the components @xmath22 and @xmath24 without a coordinate frame . in most engineering applications ,
relativistic effects are insignificant , so a 3 + 1 mesh ( as in the previous subsections ) is almost always adequate , and avoids the additional complications of spacetime mesh construction . still , we expect that there are scientific applications where a covariant discretization of electromagnetism may be very useful .
for example , many implementations of numerical general relativity ( using regge calculus for instance ) are formulated on simplicial @xmath0-complexes ; one might wish to simulate the interaction of gravity with the electromagnetic field , or charged matter , on such a mesh .
first , a quick caution on mesh construction : since the lorentz metric is not positive definite , it is possible to create edges that have length @xmath104 , despite connecting two distinct points in @xmath267 ( so - called `` null '' or `` lightlike '' edges ) .
meshes containing such edges are degenerate
akin to a euclidean mesh containing a triangle with two identical points . in particular
, the dec hodge star is undefined for @xmath104-volume elements ( due to division by zero ) . even without @xmath104-volume elements ,
it is still possible for a spacetime mesh to violate causality , so extra care should be taken .
methods to construct causality - respecting spacetime meshes over a given spatial domain can be found in , e.g. ,  @xcite and  @xcite .
when the mesh contains no inherent choice of a time direction , there is no canonical way to split @xmath16 into @xmath22 and @xmath24 .
therefore , one must set up the problem by assigning values of @xmath16 directly to @xmath23-cells ( or equivalently , assigning values of @xmath50 to @xmath21-cells ) .
for initial boundary value problems , one might choose to have the initial and final time steps be prismal , so that @xmath22 and @xmath24 can be used for initial and final values , while the internal discretization is general .
the equations @xmath218 and @xmath60 can be implemented directly in dec . since
this mesh is generally unstructured , there is no simple algorithm as the ones we presented above . instead , the equations on @xmath16 results in a sparse linear system which , given proper boundary conditions , can be solved globally with direct or iterative solvers .
however , it is clear that the previous three examples that the methods of yee , bossavit
kettunen , and our avi integrator are special cases where the global solution is particularly simple to compute via synchronous or asynchronous time updates .
it is known that , while variational integrators in mechanics do not preserve energy exactly , they have excellent energy behavior , in that it tends to oscillate close to the exact value .
this is only true , however , when the integrator takes time steps of uniform size ; adaptive and other non - uniform stepping approaches can give poor results unless additional measures are taken to enforce good energy behavior .
( see ( * ? ? ?
* chapter viii ) for a good discussion of this problem for mechanics applications . )
therefore , there is no reason to expect that _ arbitrary _ meshes of spacetime will yield energy results as good as the yee , bossavit
kettunen , and avi schemes .
however , if one is taking a truly covariant approach to spacetime , `` energy '' is not even defined without specifying a time coordinate .
likewise , one would not necessarily expect good energy behavior from the other methods with respect to an arbitrary transformation of spatial coordinates . which sort of mesh to choose is thus highly application - dependent .
in this section , we complete our exposition with a number of theoretical results about the discrete and continuous maxwell s equations .
in particular , we show that the dec formulation of electromagnetism derives from a discrete lagrangian variational principle , and that this formulation is consequently multisymplectic .
furthermore , we explore the gauge symmetry of maxwell s equations , and detail how a particular choice of gauge eliminates the equation for @xmath84 from the euler
lagrange equations , while preserving it automatically as a momentum map .
the discrete maxwell s equations are variational .    the idea of this proof is to emulate the derivation of the continuous maxwell s equations from . interpreting this in the sense of dec ,
we will obtain the discrete maxwell s equations .
given a discrete @xmath21-form @xmath50 and dual source @xmath15-form @xmath48 , define the discrete lagrangian @xmath0-form @xmath268 with the corresponding discrete action principle @xmath269 = \left\langle \mathcal{l } _ d , k \right\rangle .
\nonumber\ ] ] then , taking a discrete @xmath21-form variation @xmath55 vanishing on the boundary , the corresponding variation of the action is @xmath270 \cdot \alpha = \left\langle - \mathrm{d } \alpha      \wedge * \mathrm{d } a + \alpha \wedge \mathcal{j } , k \right\rangle =    \left\langle \alpha \wedge \left ( - \mathrm{d } { * \mathrm{d } a } +        \mathcal{j } \right ) , k \right\rangle   .
\nonumber\ ] ] ( here we use the bold @xmath271 to indicate that we are differentiating over the _ smooth space of discrete forms _
@xmath50 , as opposed to differentiating over discrete spacetime , for which we use @xmath19 . ) setting this equal to @xmath104 for all variations @xmath55 , the resulting discrete euler
lagrange equations are therefore @xmath272 .
defining the discrete @xmath23-forms @xmath71 and @xmath17 , this implies @xmath273 and @xmath274 , the discrete maxwell s equations .
the concept of _ multisymplecticity _ for lagrangian field theories was developed in  @xcite , where it was shown to arise from the boundary terms for general variations of the action , i.e. , those not restricted to vanish at the boundary .
as originally presented , the cartan form @xmath275 is an @xmath276-form , where the @xmath86-dimensional boundary integral is then obtained by contracting @xmath275 with a variation .
the multisymplectic @xmath277-form @xmath278 is then given by @xmath279 .
contracting @xmath278 with two arbitrary variations gives an @xmath86-form that vanishes when integrated over the boundary , a result called the _ multisymplectic form formula _ , which results from the identity @xmath280 .
in the special case of mechanics , where @xmath281 , the boundary consists of the initial and final time points ; hence , this implies the usual result that the symplectic @xmath23-form @xmath282 is preserved by the time flow .    alternatively , as communicated to us by  @xcite , one can view the cartan form @xmath283 as an @xmath86-form - valued @xmath21-form , and the multisymplectic form @xmath278 as an @xmath86-form - valued @xmath23-form .
therefore , one simply evaluates these forms on tangent variations to obtain a boundary integral , rather than taking contractions .
these two formulations are equivalent on smooth spaces .
however , we will adopt patrick s latter definition , since it is more easily adapted to problems on discrete meshes : @xmath284 and @xmath278 remain smooth @xmath21- and @xmath23-forms , respectively , but their @xmath86-form values are now taken to be discrete .
see for an illustration of the discrete multisymplectic form formula .
the discrete maxwell s equations are multisymplectic .
let @xmath285 be an arbitrary subcomplex , and consider the discrete action functional @xmath286 restricted to @xmath87 .
suppose now that we take a discrete variation @xmath55 , _ without _ requiring it to vanish on the boundary @xmath142 .
then variations of the action contain an additional boundary term @xmath270 \cdot \alpha = \left\langle \alpha \wedge \left (        - \mathrm{d } { * \mathrm{d } a } + \mathcal{j } \right ) , k \right\rangle     + \left\langle \alpha \wedge * d a , \partial k \right\rangle .
\nonumber\ ] ] restricting to the space of potentials @xmath50 that satisfy the discrete euler
lagrange equations , the first term vanishes , leaving only @xmath287    then we can define the _ cartan form _
@xmath288 by @xmath289 since @xmath290 takes a tangent vector @xmath55 and produces a discrete @xmath15-form on the boundary of the subcomplex , it is a _
smooth 1-form taking discrete @xmath15-form values_. now , since the _ space of discrete forms _ is itself actually continuous , we can take the exterior derivative in the smooth sense on both sides of .
evaluating along another first variation @xmath157 ( again restricted to the space of euler  lagrange solutions ) , we then get @xmath291 \cdot \alpha \cdot \beta = \left\langle      \mathbf{d } \theta \cdot \alpha \cdot \beta , \partial k    \right\rangle . \nonumber\ ] ] finally , defining the multisymplectic form @xmath292 , and using the fact that @xmath293 , we get the relation @xmath294 for all variations @xmath295 ; is a discrete version of the multisymplectic form formula .
since this holds for any subcomplex @xmath87 , it follows that these schemes are multisymplectic .
-d asynchronous - time mesh @xmath296 , where the shaded region is an arbitrary subcomplex @xmath285 .
given any two variations @xmath297 of the field , and the multisymplectic form @xmath298 , the formula states that @xmath299 vanishes when integrated over the boundary @xmath140 ( shown in bold ) . ]      we now explore the symmetry of maxwell s equations under gauge transformations .
this symmetry allows us to reduce the equations by eliminating the time component of @xmath50 ( for some chosen time coordinate ) , effectively fixing the electric scalar potential to zero . because this is an incomplete gauge
, there is a remaining gauge symmetry , and hence a conserved momentum map .
this conserved quantity turns out to be the charge density @xmath300 , which justifies its elimination from the euler  lagrange equations .
these calculations are done with differential forms and exterior calculus , hence they apply equally to the smooth and discrete cases of electromagnetism .
because maxwell s equations only depend on @xmath80 , they are invariant under gauge transformations of the form @xmath81 , where @xmath301 is any scalar function on spacetime .
if we fix a time coordinate , we can now choose the weyl gauge , so that the time component @xmath302 .
therefore , we can assume that @xmath303 in fact , @xmath304 are precisely the components of the familiar vector potential @xmath5 , i.e. , @xmath305 .
having fixed the gauge and chosen a time coordinate , we can now define two new `` partial exterior derivative '' operators , @xmath306 ( time ) and @xmath307 ( space ) , where @xmath308 . since @xmath50 contains no @xmath309 terms
, @xmath310 is a @xmath23-form containing only the space terms of @xmath311 , while @xmath312 contains the terms involving both space and time .
that is , @xmath313 restricted to this subspace of potentials , the lagrangian density then becomes @xmath314 next , varying the action along a restricted variation @xmath55 that vanishes on @xmath56 , @xmath315 \cdot \alpha & = \int _ x \left ( \mathrm{d } _ t \alpha      \wedge { d } - \mathrm{d } _ s \alpha \wedge h \wedge      \mathrm{d } t + \alpha \wedge j \wedge \mathrm{d } t    \right ) \label{eqn : weylaction}\\    & = \int _ x \alpha \wedge \left ( \mathrm{d } _ t d - \mathrm{d } _ s h      \wedge \mathrm{d } t + j \wedge \mathrm{d } t \right ) .\nonumber\end{aligned}\ ] ] setting this equal to zero by hamilton s principle , one immediately gets ampre s law as the sole euler  lagrange equation .
the divergence constraint @xmath316 , corresponding to gauss law , has been eliminated via the restriction to the weyl gauge .
let us restrict @xmath50 to be an euler  lagrange solution in the weyl gauge , but remove the previous requirement that variations @xmath55 be fixed at the initial time @xmath143 and final time @xmath317 .
then , varying the action along this new @xmath55 , the euler
lagrange term disappears , but we now pick up an additional boundary term due to integration by parts @xmath318 \cdot \alpha = \left . \int _ { \sigma } \alpha \wedge      { d } \,\right\rvert _ { t _ 0 } ^ { t _ f } , \ ] ] where @xmath319 denotes a cauchy surface of @xmath52 , corresponding to the spatial domain .
if we vary along a gauge transformation @xmath320 , then this becomes @xmath318 \cdot \mathrm{d }   _ s f = \left .
\sigma      \mathrm{d }   _ s f \wedge { d } \,\right\rvert _ { t _ 0 } ^ { t _ f }    = - \left .
\int _ \sigma f \wedge \mathrm{d } _ s { d } \,\right\rvert _ { t _ 0 }    ^ { t _ f } \ ] ] alternatively , plugging @xmath321 into , we get @xmath318 \cdot \mathrm{d }   _ s f = \int _ x \mathrm{d } _ s    f \wedge j \wedge \mathrm{d }   t    = - \int _ x f \wedge \mathrm{d }   _ s j
\wedge \mathrm{d }   t    = - \int _ x f \wedge \mathrm{d } _
t \rho    = - \left .
\int _ \sigma f \wedge
\rho \,\right\rvert _ { t _ 0 } ^ { t _ f }    .\ ] ] since these two expressions are equal , and @xmath301 is an arbitrary function , it follows that @xmath322 this indicates that @xmath323 is a conserved quantity , a momentum map , so if gauss law holds at the initial time , then it holds for all subsequent times as well .
it should be noted that the variational structure and symmetry of maxwell s equations may be affected by the boundary conditions that one chooses to impose .
there are many boundary conditions that one can specify independent of the initial values , such as the pec condition used in the numerical example in .
however , one can imagine more complicated boundary conditions where which the boundary interacts nontrivially with the interior of the domain  such as dissipative or forced boundary conditions , where energy / momentum is removed from or added to the system . in these cases
, one will obviously _ not _ conclude that the charge density @xmath324 is conserved , but more generally that the _ change _ in charge is related to the flux through the spatial boundary .
this is because , in the momentum map derivation above , the values of @xmath301 on the initial time slice causally affects its values on the spatial boundary at intermediate times , not just on the final time slice .
thus , the spatial part of @xmath56 can not be neglected for arbitrary boundary conditions .
the continued success of the yee scheme for many applications of computational electromagnetism , for over four decades , illustrates the value of structure - preserving numerical integrators for maxwell s equations .
recent advances by , among others , bossavit and kettunen , and gross and kotiuga , have demonstrated the important role of compatible spatial discretization using differential forms , allowing for yee - like schemes that apply on generalized spatial meshes . in this paper , we have extended this approach by considering discrete forms on _ spacetime _ , encapsulating both space and time discretization , and have derived a general family of geometric numerical integrators for maxwell s equations .
furthermore , since we have derived these integrators from a discrete variational principle , the resulting methods are provably multisymplectic and momentum - map - preserving , and they experimentally show correct global energy behavior . besides proving the variational nature of well - known techniques such as the yee and bossavit  kettunen schemes , we have also introduced a new asynchronous integrator , so that time step sizes can be taken non - uniformly over the spatial domain for increased efficiency , while still maintaining the desirable variational and energy behavior of the other methods .
one promising avenue for future work involves increasing the order of accuracy of these methods by deriving higher - order discrete hodge star operators .
while this would involve redefining the hodge star matrix to be non - diagonal , the discrete maxwell s equations would remain formally the same , and hence there would be no change in the variational or multisymplectic properties proven here .
we are currently exploring the development of a spectrally accurate spatial hodge star , which might make these geometric schemes competitive for applications where non - variational spectral codes are currently favored .
additionally , the recent work of  @xcite has shown that avis can be implemented as parallel algorithms for solid mechanics simulations .
this uses the fact that , due to the asynchronous update procedure , an element does not need information from every one of its neighbors at every time step , which lessens the need for communication among parallel nodes .
the resulting parallel avis , or pavis , can therefore take advantage of parallel computing architecture for improved efficiency .
it is reasonable to expect that the same might be done in the case of our electromagnetic avi .    while we have experimentally observed the fact that variational integrators exhibit near - energy conservation , little is known about this behavior from a theoretical standpoint . in the case of odes in mechanics
, backwards error analysis has shown that these methods exactly integrate a nearby smooth hamiltonian system , although not much known about how this relates to the discrete variational principle on the lagrangian side .
some initial work has been done in  @xcite to understand , also by a backward error analysis approach , why discrete multisymplectic methods also display good energy behavior .
finally , variational methods using discrete spacetime forms may be developed for field theories other than electromagnetism .
promising candidates include numerical general relativity and fluid dynamics , although the latter is complicated by the difficulty in finding a proper discretization of the infinite - dimensional diffeomorphism group .
if discrete lagrangian densities are developed for these theories , it should be straightforward to combine them with the electromagnetic lagrangian , resulting in numerical methods to simulate , e.g. , gravity coupled with an electromagnetic field , or the dynamics of a charged or magnetic fluid .
we would like to thank several people for their inspiration and suggestions .
first of all , alain bossavit for suggesting many years ago that we take the present dec approach to computational electromagnetism , and for his excellent lectures at caltech on the subject .
second , michael ortiz and eva kanso for their ongoing interactions on related topics and suggestions .
we also thank doug arnold , uri ascher , robert kotiuga , melvin leok , adrian lew , and matt west for their feedback and encouragement .
in addition , the @xmath15-d avi simulations shown in were programmed and implemented by patrick xia , as part of a summer undergraduate research fellowship at caltech .
desbrun , m. , a.  n. hirani , and j.  e. marsden ( 2003 ) , discrete exterior calculus for variational problems in computer vision and graphics . in _ proceedings of the 42nd ieee conference on decision and control ( cdc )
_ , volume  5 , pages 49024907 .
ieee press , washington , dc .
desbrun , m. , e.  kanso , and y.  tong ( 2008 ) , discrete differential forms for computational modeling . in _ discrete differential geometry _ , volume  38 of _ oberwolfach semin .
_ , pages 287324 .
birkhuser , basel .
elcott , s. , and p.  schrder ( 2005 ) , building your own dec at home . in _
siggraph 05 : acm siggraph 2005 courses_. acm press , new york .
http://dx.doi.org/10.1145/1198555.1198667[`doi:10.1145/1198555.1198667 ` ] .
erickson , j. , d.  guoy , j.  sullivan , and a.  ngr ( 2005 ) , building spacetime meshes over arbitrary spatial domains . _
engineering with computers _ , * 20 * ( 4 ) , 342353 .
http://dx.doi.org/10.1007/s00366-005-0303-0[`doi:10.1007/s00366-005-0303-0 ` ] .
gross , p.  w. , and p.  r. kotiuga ( 2004 ) , _ electromagnetic theory and computation : a topological approach _
, volume  48 of _ mathematical sciences research institute publications_. cambridge university press , cambridge .
hairer , e. , c.  lubich , and g.  wanner ( 2006 ) , _ geometric numerical integration _ , volume  31 of _ springer series in computational mathematics_. springer - verlag , berlin , second edition .
structure - preserving algorithms for ordinary differential equations .
wang , k. , weiwei , y.  tong , m.  desbrun , and p.  schrder ( 2006 ) , edge subdivision schemes and the construction of smooth vector fields . in _
siggraph 06 : acm siggraph 2006 papers _ ,
pages 10411048 .
acm press , new york .
http://dx.doi.org/10.1145/1179352.1141991[`doi:10.1145/1179352.1141991 ` ] .