The following pages describe how to make charge distributions and current measurements within metals. Two simple examples are provided below.
Note: This analysis should only be applied to real metals (i.e. materials where it is reasonable to assume the material is a cloud of free electrons). This analysis will not work for PEC materials. 
Background
To calculate the charge distributions and current densities, we treat each metal as a cloud of free electrons, i.e. a plasma. To calculate the current density in a plasma we first recognize that all material properties within the FDTD simulation are implemented via an effective material permittivity:
$$D = \varepsilon _{material} E$$
For the purposes of this calculation, we assume there are two contributions to the material permittivity: the background permittivity (in this case, the permittivity of free space) plus the contribution from the current density.
$$D = (\varepsilon _0 + \varepsilon _{plasma}) E$$
The first term is Do, the displacement field that would exist in free space for the given electric field. The second term is proportional to the current J. For more details, see the notes below.
\begin{aligned} D & = \varepsilon _{material} E\\ & = \varepsilon _0 E + \varepsilon _{plasma} E\\ & = D_0 + \frac{iJ}{\omega} \end{aligned}
Solving the above equation for J, we get
\begin{aligned} J & = i \omega (D  D_0)\\ & = i \omega (\varepsilon _{material}  \varepsilon _0)E \end{aligned}
Note: The total material permittivity is created from two contributions: one from the polarization of the medium due to bound charge, and one from the current density due to free charge. Ampere's law can be written as
$$i \omega D_{background} = \nabla \times H  J$$
$$D_{background} = \varepsilon _0 E + P = \varepsilon _0 (1 + \chi) E$$
We can rewrite this equation as
\begin{aligned}i \omega D _{background} &= \nabla \times H  J \\ i \omega \left(D_{background} + \frac{iJ}{\omega} \right) &= \nabla \times H \\ i \omega D_{material} &= \nabla \times H \end{aligned}
and, assuming that J is proportional to E, we have
\begin{aligned} D_{material} &= \varepsilon _0 E + P + \frac{iJ}{\omega} \\ &=(\varepsilon _0 + \varepsilon _0 \chi + \varepsilon _{plasma}) E \\ &= \varepsilon _{material} E \end{aligned}
For plasma materials, such as metals, we have assumed that the susceptibility of the medium is 0 (i.e. P=0).
Charge and current in a nanoparticle
This page describes how to calculate the charge and current density inside metals. The associated simulation files use the current charge density analysis object for calculating these quantities. This analysis object can be found in the object library in the Advanced analysis section.
Example
The associated files section provide a 2D and 3D example simulation using the current charge density analysis groups. You can copy and paste these groups into your simulations or insert them directly from the object library.
Note : Mesh size and mesh refinement setting It is often necessary to use a small mesh size for simulation involving metals, particularly when the metals have rounded edges. The Conformal meshing algorithm feature can provide improved accuracy at interfaces, but it can also introduce additional errors into the simulation when applied to metal interfaces. Therefore, the default settings in FDTD is to apply the Conformal mesh to dielectric interfaces, but not to metal interfaces. In these particular example files, the mesh refinement option has been set to 'Conformal Variant 1' (CV1), rather than the default setting of 'Conformal Variant 0' (CV0), meaning that the conformal meshing algorithm will be applied at the metaldielectric interfaces. This change should only be made to your simulation file after careful convergence testing to confirm that the CV1 option gives better (i.e. more converged) results than CV0. Until you do this type of convergence testing, we recommend using the default CV0 option in your simulation. The factors that make CV1 appropriate for this simulation include:
For more information on the mesh refinement options, see Mesh refinement options . 
To reproduce the following figures, open and run usr_current_density_2D.fsp . After the simulation is complete, you can reproduce the following figures by visualizing the object data. The following results show the current and electric field data for lambda = 340nm. Also note that the image colorbar scales have been adjusted.
The X and Y components of the current density J.
These figures show the current flowing back and forth in the X direction as the wave propagates along the particle in the Y direction.
Also notice that the current is zero outside the particle, as expected.


The X and Y components of the Electric field.
The current density is proportional to the electric field, except for a 90 degree phase shift. 
The same analysis group also calculates the divergence of the electric field, which gives the total charge density. This is shown in the plot below, we can see that the charges are confined to the edge of the metal, as expected. The free charge density is calculated using rho = eps0*div(E). This assumes that the material is metal with no bound charges, hence eps0 is used instead of eps_material.
Note : Using symmetric/antisymmetric boundary condition If symmetric/antisymmetric boundary condition, make sure the symmetry condition (Analysis tab>Script tab) is specified in the analysis group to avoid matrix size mismatch between parameters used. 
Current in a wire
This page describes how to calculate the total current within a metal wire. The associated simulation file uses the induced current analysis group that can be added to your file from the Advanced Analysis section of the object library.
Example
The analysis group in the associated file uses Ampere's law to calculate the current induced in a metal wire by the incoming EM fields.
$$I = \int_L{H \cdot dL}  \frac{d \left( \int_S{D \cdot dS} \right) }{dt}$$
Note : This analysis object treats all metals as plasma materials, with a refractive index of 1. For the purposes of this calculation, metals are defined as materials with absorption. This generally works well when the background material is a nondispersive dielectric material (i.e. air or glass). However, if your background material is a dispersive (lossy) dielectric, the analysis script will need to be modified. 
To run this example, open the attached simulation file and enter the following script commands:
run;
runanalysis;
f=getdata("induced_current","f");
current=getdata("induced_current","I");
plot(f/1e9,abs(current),"f (GHz)","current","Induced current");