1. Problems of electrostatics in spatially periodic media naturally arise in physical chemistry and material science when the state of a system is controlled by applying an electric field [1]. The numerical solution of electrostatic problems is based mainly on three groups of methods, namely: (a) finite difference methods; (b) projective methods, such as variants of the Galerkin method; and (c) integral equation methods [25]. Along with them, spectral methods are used in a number of specific problems, in which case the sought solution is represented as an expansion in terms of eigenfunctions of the corresponding differential operator [4]. The spectral approach is effective for problems with periodic boundary conditions in a homogeneous medium, since the analytical solution can then be represented in the form of an expansion in terms of trigonometric functions. However, the situation is different in the case of inhomogeneous media, since the trigonometric functions are generally not the eigenfunctions of the differential operator of the problem in that case. Nevertheless, in spatially periodic problems, the trigonometric basis remains attractive for solution representation in the form of a linear combination of trigonometric functions when the characteristics of the medium are smoothly varying functions. In this paper, an analogue of the pseudospectral approach applied to problems in the theory of polymers [6] is proposed for solving electrostatic problems in spatially periodic dielectric media with smoothly varying permittivity. Based on this approach and the fast Fourier transform, a high-accuracy low-cost iterative method is developed for computing the electric field potential and strength.

2. The electric field potential Φ(r) in a medium with a sufficiently smooth positive permittivity ε(r), where r = (x, y, z) is the radius vector, satisfies the elliptic partial differential equation [1]

$${\text{div}}(\varepsilon ({\mathbf{r}}){\text{grad}}\Phi ({\mathbf{r}})) = \nabla \cdot (\varepsilon ({\mathbf{r}})\nabla \Phi ({\mathbf{r}})) = 0.$$
(1)

In the case of an inhomogeneous dielectric placed in an initially uniform electric field, it is convenient to represent the sought potential Φ(r) in the form

$$\Phi ({\mathbf{r}}) = \varphi ({\mathbf{r}}) - ({{{\mathbf{E}}}_{0}},{\mathbf{r}}),$$
(2)

where E0 is the electric field strength in a homogeneous dielectric medium with permittivity equal to the mean value \(\bar {\varepsilon }\) of the permittivity ε(r) and φ(r) is an additional potential. Substituting the right-hand side of (2) into Eq. (1) leads to the equation

$${{\nabla }^{2}}\varphi ({\mathbf{r}}) = ({{{\mathbf{E}}}_{0}} - \nabla \varphi ({\mathbf{r}}),\nabla \ln \varepsilon ({\mathbf{r}})).$$
(3)

The desired additional potential φ(r) on the right-hand side of (2) satisfies the following periodic boundary conditions in the spatially periodic dielectric medium:

$$\begin{gathered} f({\mathbf{r}} + {{n}_{1}}{{{\mathbf{a}}}_{1}} + {{n}_{2}}{{{\mathbf{a}}}_{2}} + {{n}_{3}}{{{\mathbf{a}}}_{3}}) = f({\mathbf{r}}),\quad {{n}_{k}} \in Z, \\ V = {\text{|}}({{{\mathbf{a}}}_{1}},[{{{\mathbf{a}}}_{2}},{{{\mathbf{a}}}_{3}}]){\text{|}} > 0, \\ \end{gathered} $$
(4)

where f is either ε(r) or φ(r), Z is the set of integers, and {ak} is a basis in E3.

Note that the Poisson equation for the function φ(r), i.e.,

$${{\nabla }^{2}}\varphi ({\mathbf{r}}) = \rho ({\mathbf{r}}),$$
(5)

where φ(r) and ρ(r) satisfy the periodic conditions (4), determines the solution up to a constant component. Therefore, Eq. (5) has a unique solution in the subspace of potentials φ(r) with a zero mean. For such a solution of problem (5) with a zero constant component and boundary conditions (4), we use the notation

$$\varphi ({\mathbf{r}}) = {{\nabla }^{{ - 2}}}\rho ({\mathbf{r}}).$$
(6)

Equation (3) also determines the additional potential φ(r) up to a constant component, whose value can be set, without loss of physical generality, to zero. Substituting the right-hand side of Eq. (3) for the function ρ(r) in Eq. (6), we obtain another form of Eq. (3):

$$\varphi ({\mathbf{r}}) = {{\nabla }^{{ - 2}}}({{{\mathbf{E}}}_{0}} - \nabla \varphi ({\mathbf{r}}),\nabla \ln \varepsilon ({\mathbf{r}})) = F[\varphi ({\mathbf{r}});\varepsilon ({\mathbf{r}})].$$
(7)

In contrast to Eq. (3), Eq. (7) implies that the constant component of the potential φ(r) is zero.

Equation (7) with periodic boundary conditions can be solved by applying the Picard iteration method with a positive parameter τ:

$$\begin{gathered} {{\varphi }_{{k + 1}}}({\mathbf{r}}) = (1 - \tau ){{\varphi }_{k}}({\mathbf{r}}) + \tau F[{{\varphi }_{k}}({\mathbf{r}});\varepsilon ({\mathbf{r}})],\quad \tau \in (0,1], \\ {{\varphi }_{0}}({\mathbf{r}}) = 0 \\ \end{gathered} $$
(8)

or by applying other, more rapidly convergent iterative methods, including multilayered ones [7, 8].

3. Consider an efficient method for computing the operator F[φ(r); ε(r)] with the help of the fast Fourier transform (FFT). For this purpose, we introduce a reciprocal (inverse) basis {bj} determined by the conditions

$$({{{\mathbf{a}}}_{k}},{{{\mathbf{b}}}_{j}}) = {{\delta }_{{kj}}},\quad k,j = 1,2,3,$$
(9)

where δkj is the Kronecker delta. Every sufficiently smooth periodic real-valued function f(r) can be expanded in a uniformly convergent trigonometric Fourier series, which can be termwise differentiated (i.e., the Fourier series for the derivatives are also uniformly convergent):

$$\begin{gathered} f({\mathbf{r}}) = \sum\limits_{\mathbf{m}}^{} {{{f}_{{\mathbf{m}}}}\exp (i{{{\mathbf{q}}}_{{\mathbf{m}}}}{\mathbf{r}}),} \\ {{{\mathbf{q}}}_{{\mathbf{m}}}} = 2\pi ({{m}_{1}}{{{\mathbf{b}}}_{1}} + {{m}_{2}}{{{\mathbf{b}}}_{2}} + {{m}_{3}}{{{\mathbf{b}}}_{3}}),\quad {{m}_{k}} \in Z, \\ \end{gathered} $$
(10)

where m = (m1, m2, m3) is an integer vector, Z is the set of integers, and the coefficients of series (10) are given by the equalities

$$\begin{gathered} {{f}_{{\mathbf{m}}}} = {{V}^{{ - 1}}}\int\limits_\Pi ^{} {f({\mathbf{r}})\exp ( - i{{{\mathbf{q}}}_{{\mathbf{m}}}}{\mathbf{r}})d{\mathbf{r}},} \\ \Pi = \{ {\mathbf{r}}:{\mathbf{r}} = {{x}_{1}}{{{\mathbf{a}}}_{1}} + {{x}_{2}}{{{\mathbf{a}}}_{2}} + {{x}_{3}}{{{\mathbf{a}}}_{3}};0 \leqslant {{x}_{k}} \leqslant 1\} . \\ \end{gathered} $$
(11)

The following differential operators (gradient and Laplacian) as applied to a sufficiently smooth function f(r) can also be expressed in the form of uniformly convergent Fourier series:

$$\begin{gathered} \nabla f({\mathbf{r}}) = i\sum\limits_{\mathbf{m}}^{} {{{{\mathbf{q}}}_{{\mathbf{m}}}}{{f}_{{\mathbf{m}}}}} \exp (i{{{\mathbf{q}}}_{{\mathbf{m}}}}{\mathbf{r}}), \\ {{\nabla }^{2}}f({\mathbf{r}}) = - \sum\limits_{\mathbf{m}}^{} {{\text{|}}{{{\mathbf{q}}}_{{\mathbf{m}}}}{{{\text{|}}}^{2}}{{f}_{{\mathbf{m}}}}\exp (i{{{\mathbf{q}}}_{{\mathbf{m}}}}{\mathbf{r}}).} \\ \end{gathered} $$
(12)

The inverse of the Laplacian on the set of functions with a zero mean is given by the formula

$${{\nabla }^{{ - 2}}}f({\mathbf{r}}) = - \sum\limits_{{\mathbf{m}} \ne 0}^{} {{\text{|}}{{{\mathbf{q}}}_{{\mathbf{m}}}}{{{\text{|}}}^{{ - 2}}}{{f}_{{\mathbf{m}}}}\exp (i{{{\mathbf{q}}}_{{\mathbf{m}}}}{\mathbf{r}}).} $$
(13)

Relations (10)–(13) underlie high-accuracy computations of the gradient and the Laplacian of the function on a uniform grid with the help of the discrete Fourier transform when the high-frequency harmonics of the function can be neglected.

To compute the Fourier coefficients in (12), we use the rectangle rule on a uniform grid in the parallelepiped Π:

$${{{\mathbf{r}}}_{{\mathbf{n}}}} = \sum\limits_{k = 1}^3 {x_{k}^{{({{n}_{k}})}}{{{\mathbf{a}}}_{k}},} $$
(14)

where

$$\begin{gathered} x_{k}^{{({{n}_{k}})}} = {{n}_{k}}{\text{/}}{{N}_{k}},\quad {{n}_{k}} = 0,1,...,{{N}_{k}} - 1, \\ k = 1,2,3, \\ \end{gathered} $$
(15)

setting

$$\begin{gathered} {{f}_{{\mathbf{m}}}} = {{({{N}_{1}}{{N}_{2}}{{N}_{3}})}^{{ - 1}}}\sum\limits_{\mathbf{n}}^{} {f({{{\mathbf{r}}}_{{\mathbf{n}}}})} \exp \left( { - 2\pi i\sum\limits_{k = 1}^3 {{{m}_{k}}{{n}_{k}}{\text{/}}{{N}_{k}}} } \right), \\ {\mathbf{m}},{\mathbf{n}} \in {\mathbf{N}}, \\ \end{gathered} $$
(16)

where N denotes a finite set of integer vectors m and n with nonnegative integer components described by relations (15). Note that the rectangle rule on a straight line interval for trigonometric polynomials is closely related to the Gaussian quadrature rules for Chebyshev polynomials [9], namely, the rectangle rule on a uniform grid with N nodes is exact for trigonometric polynomials of degree n, where n < N/2 thus, it plays the role of a high-accuracy Gaussian formula on the set of periodic functions.

Equality (16) is the discrete Fourier transform of the grid function f(rn) up to a multiplicative constant. The grid function f(rn) is recovered from its coefficients (16) with the help of the inverse discrete Fourier transform:

$$\begin{gathered} f({{{\mathbf{r}}}_{{\mathbf{n}}}}) = \sum\limits_{\mathbf{m}}^{} {{{{\mathbf{r}}}_{{\mathbf{m}}}}} \exp \left( {2\pi i\sum\limits_{k = 1}^3 {{{m}_{k}}{{n}_{k}}{\text{/}}{{N}_{k}}} } \right), \\ {\mathbf{m}},{\mathbf{n}} \in {\mathbf{N}}. \\ \end{gathered} $$
(17)

Relations (16) and (17) allow us to use the FFT algorithm for high-accuracy low-cost computation of the Fourier coefficients and for the recovery of the original grid function from the computed coefficients. The Fourier coefficients of the discrete analogues of the gradient \(\tilde {\nabla }\)fm, the Laplacian \({{\tilde {\nabla }}^{2}}\)fm (see (12)), and the Laplacian inverse \({{\tilde {\nabla }}^{{ - 2}}}\)fm (see (13)) for the grid function f(rn) are calculated using the relations

$$\tilde {\nabla }{{f}_{{\mathbf{m}}}} = i{{{\mathbf{q}}}_{{{\mathbf{j}}({\mathbf{m}})}}}{{f}_{{{\mathbf{j}}({\mathbf{m}})}}},\quad {{\tilde {\nabla }}^{2}}{{f}_{{\mathbf{m}}}} = - {\text{|}}{{{\mathbf{q}}}_{{{\mathbf{j}}({\mathbf{m}})}}}{{{\text{|}}}^{2}}{{f}_{{{\mathbf{j}}({\mathbf{m}})}}}$$
(18)

and

$${{\tilde {\nabla }}^{{ - 2}}}{{f}_{{\mathbf{m}}}} = \left\{ \begin{gathered} - {\text{|}}{{{\mathbf{q}}}_{{{\mathbf{j}}({\mathbf{m}})}}}{{{\text{|}}}^{{ - 2}}}{{f}_{{{\mathbf{j}}({\mathbf{m}})}}},\quad {\text{|}}{{{\mathbf{q}}}_{{{\mathbf{j}}({\mathbf{m}})}}}{\text{|}} > 0 \hfill \\ 0,\quad {\text{|}}{{{\mathbf{q}}}_{{{\mathbf{j}}({\mathbf{m}})}}}{\text{|}} = 0, \hfill \\ \end{gathered} \right.$$
(19)

respectively, where

$${\mathbf{j}}({\mathbf{m}}) = (j({{m}_{1}},{{N}_{1}}),j({{m}_{2}},{{N}_{2}}),j({{m}_{3}},{{N}_{3}})),$$
(20)
$$j(m,N) = \left\{ \begin{gathered} m,\quad 2m \leqslant N \hfill \\ m - N,\quad 2m > N. \hfill \\ \end{gathered} \right.$$
(21)

The discrete analogues of the gradient, Laplacian, and Laplacian inverse of the grid function f(rn) are computed using formula (17) for the inverse discrete Fourier transform with the coefficients fm replaced by the coefficients \(\tilde {\nabla }\)fm, \({{\tilde {\nabla }}^{2}}\)fm, and \({{\tilde {\nabla }}^{{ - 2}}}\)fm, respectively, which are given by (18)–(21).

Note that the discrete analogues (18)–(21) of the differential operators have advantages over their widespread difference approximations [2]. They coincide with the original operators (12) and (13) at grid points (14), (15) on the set of finite linear combinations of trigonometric functions of form (10) if the index components of the harmonics satisfy the inequalities 2mk < Nk (k = 1, 2, 3). Moreover, these linear combinations can be used to calculate the functions and the corresponding operators (12) and (13) not only at grid nodes, but also at arbitrary points of the parallelepi-ped Π.

Remark. The expansion coefficients in the trigonometric Fourier series of the function lnε(r) in Eq. (7) must tend to zero rather quickly. To simplify the understanding of the conditions imposed on the spectrum of the function lnε(r), we consider the one-dimensional equation (7). If the step size of a uniform spatial grid is equal to h, then the spatial Nyquist frequency is (2h)–1. Therefore, the step size h is chosen so that the partial trigonometric sum of the Fourier series of the vector function ∇lnε(r), with harmonics involving wave numbers q satisfying the inequality |q| ≤ πh–1 approximates the original series and its derivative with sufficient accuracy determined by the particular application. Note that the right-hand side of Eq. (7) involves the scalar product of the gradients of lnε(r) and the sought additional potential φ(r). If each of these functions contains harmonics with the wave number modulus πh–1, then their scalar product can contain harmonics with the wave number modulus 2πh–1, i.e., can include spatial frequencies exceeding the Nyquist frequency. Therefore, the constraint on the mesh size must be at least doubled: the significant harmonics of lnε(r) (i.e., ones that carry significant information on the function) must include only wave vectors with |q| ≤ π(2h)–1. In the case of the multidimensional equation (7), by q we mean each of the independent components of the wave vector qm.

The procedure for computing the right-hand side of Eq. (7) can be briefly described as follows.

Step 1. The function f(rn) is sequentially set equal to φ(rn) and lnε(rn), and each time the discrete Fourier transform (16) is applied to it for computing the Fourier coefficients fm. Here, the vector coefficients \(\tilde {\nabla }\)fm are found according to the left formula in (18) and the discrete analogue of the gradient \(\tilde {\nabla }\)f(rn) is computed using to formula (17), in which the scalar coefficients fm are replaced by the vector coefficients \(\tilde {\nabla }\)fm.

Step 2. Compute the scalar product ρ(rn) = (E0\(\tilde {\nabla }\)φ(rn), \(\tilde {\nabla }\)lnε(rn)), where the vectors \(\tilde {\nabla }\)φ(rn) and \(\tilde {\nabla }\)lnε(rn) were found at the preceding step, and set the function f(rn) equal to ρ(rn), applying to it the discrete Fourier transform (16) for computing the Fourier coefficients fm. Here, the quantities \({{\tilde {\nabla }}^{{ - 2}}}\)fm are found according to formula (19) and the discrete analogue of the Laplacian inverse \({{\tilde {\nabla }}^{{ - 2}}}\)f(rn) = \({{\tilde {\nabla }}^{{ - 2}}}\)ρ(rn) is calculated using formula (17), in which the coefficients fm are replaced by the coefficients \({{\tilde {\nabla }}^{{ - 2}}}\)fm.

Performing two steps described above yields the values of the right-hand side F[φ(r); ε(r)] of Eq. (7) computed at grid nodes (14). Next, Eq. (7) is solved numerically using iterative process (8) or another method, for example, from [7, 8].

The computational complexity of the direct (16) and inverse (17) discrete Fourier transforms based on FFT is estimated as O(MlogM) operations, where M = N1N2N3. Due to this estimate and the possibility of efficient parallelization of the FFT algorithms [10], three-dimensional electrostatic problems in periodic dielectric media can be solved in real time by iterative methods with a large number of grid nodes in the parallelepiped Π.

4. The algorithm proposed above was used to compute the electric field in one- and three-dimensional spatially periodic dielectric model media consisting of components A and B characterized by permittivity εA and εB, respectively.

First, we consider a one-dimensional medium with lamellar morphology. The volume fractions of the components A and B are specified as

$$\begin{gathered} {{\eta }_{A}}(x) = \frac{1}{2}[1 + \cos (2\pi x)], \\ {{\eta }_{B}}(x) = 1 - {{\eta }_{A}}(x),\quad - \infty < x < + \infty , \\ \end{gathered} $$
(22)

respectively. The local permittivity of the medium is defined as

$$\begin{gathered} \varepsilon (x) = {{\varepsilon }_{A}}{{\eta }_{A}}(x) + {{\varepsilon }_{B}}{{\eta }_{B}}(x), \\ {{\varepsilon }_{A}} = 4.5,\quad {{\varepsilon }_{B}} = 2.5. \\ \end{gathered} $$
(23)

The uniform electric field E0 = 1 is assumed to be aligned with the x axis. In this case, Eq. (3) for the additional potential φ(x) becomes

$${{\varphi }_{{xx}}}(x) = ({{E}_{0}} - {{\varphi }_{x}}(x),{{(\ln \varepsilon (x))}_{x}}),\quad {{E}_{0}} = 1$$
(24)

with the periodic boundary condition φ(x + 1) = φ(x).

To apply the numerical algorithm described in Steps 2 and 3, we introduce a uniform grid xn = n/N (n = 0, 1, …, N – 1) on the interval [0, 1], where N = 2k (k = 1, 2, …, 10). The trigonometric Fourier series expansion of the function (lnε(x))x = εx(x)/ε(x) (in terms of the functions exp(inx)) has coefficients that converge rapidly to zero, so that, for |n| ≤ 20, the partial sum of this series approximates the function (lnε(x))x up to 12–13 significant digits. A further increase in the number of series terms in the case of the standard mantissa length 16 for real numbers is not reasonable, since it does not improve the numerical accuracy, because harmonics with high indices contain only noise with characteristic amplitude values of ~10–15. The summation of such series is a well-known ill-posed problem [11]. An analysis of the harmonics of the numerical solution φ(x) and its first derivative φx(x) shows that their maximum achieved numerical accuracy is 12–14 significant digits. Therefore, to compute the Fourier coefficients of these functions, it is sufficient to use grids with the number of nodes equal to N = 32, 64 and to use partial sums of their trigonometric series including harmonics with |n| ≤ 20. Grids with large numbers N of nodes do not improve the numerical accuracy. As an illustration, Fig. 1 presents the electric field strength (Fig. 1a)

$$E(x) = - {{\Phi }_{x}}(x) = {{E}_{0}} - {{\varphi }_{x}}(x)$$
(25)

and the energy density of the electric field (Fig. 1b)

$${{\rho }_{E}}(x) = \frac{1}{2}\varepsilon (x){{E}^{2}}(x).$$
(26)
Fig. 1.
figure 1

(a) Strength E(x) and (b) the energy density ρE(x) of the electric field determined by Eqs. (25) and (26).

Now we compute the electric field in a three-dimensional spatially periodic dielectric medium with diamond morphology [12]. The volume fractions of the components A and B used in the computations have the form

$$\begin{gathered} {{\eta }_{A}}({\mathbf{r}}) = 0.5 + 0.044[\cos (2\pi (x + y - z)) \\ \, + \cos (2\pi (x - y + z)) \\ + \cos (2\pi ( - x + y + z)) - \cos (2\pi (x + y + z))], \\ - \infty < x,y,z < + \infty , \\ {{\eta }_{B}}({\mathbf{r}}) = 1 - {{\eta }_{A}}({\mathbf{r}}), \\ \end{gathered} $$
(27)

and the permittivity of the medium is specified as

$$\varepsilon ({\mathbf{r}}) = {{\varepsilon }_{A}}{{\eta }_{A}}({\mathbf{r}}) + {{\varepsilon }_{B}}{{\eta }_{B}}({\mathbf{r}}),\quad {{\varepsilon }_{A}} = 4.5,\quad {{\varepsilon }_{B}} = 2.5.$$
(28)

The numerical algorithm proposed above is used to compute the additional potential φ(r) satisfying Eq. (3) and the periodic conditions

$$f(x + {{n}_{1}},y + {{n}_{2}},z + {{n}_{3}}) = f(x,y,z),\quad {{n}_{k}} \in Z.$$
(29)

The numerical solution was determined on a uniform grid in a unit cube with 323 or 643 nodes. The accuracy of the computed electric field strength at any point of the cube was 6 and 10 significant digits, respectively. For numerical convergence of the iterations with relative accuracy of 10–13, we used 9 iterations of the Ng method [7] or 12 iterations of the successive approximation method (8) with τ = 1.

Figure 2 presents level surface of the electric field energy density

$$\begin{gathered} {{\rho }_{E}}({\mathbf{r}}) = \frac{1}{2}\varepsilon ({\mathbf{r}}){\text{|}}{{{\mathbf{E}}}_{0}} - \nabla \varphi ({\mathbf{r}}){{{\text{|}}}^{2}} = \overline {{{\rho }_{E}}({\mathbf{r}})} = 1.738, \\ {{{\mathbf{E}}}_{0}} = (1,0,0), \\ \end{gathered} $$
(26)

where \(\overline {{{\rho }_{E}}({\mathbf{r}})} \) denotes the mean value of ρE(r) in the unit cube.

Fig. 2.
figure 2

Surface of the level ρE(r) = 1.738 electric field energy density in a cube of edge size 2 containing eight elementary unit cubes. The X, Y, and Z axes are aligned with the edges of the cube.

To conclude, we note once again that, for a fixed number of grid nodes, the accuracy of the numerical solution depends substantially on the rate at which the Fourier coefficients of the function lnε(r) decay with increasing indices of harmonics. The solution is computed more accurately when the rate of decay of the Fourier coefficients is higher.

The above-proposed method for solving Eq. (1) can also be used in the case of other boundary conditions that effectively reduce to periodic ones, such as homogeneous Dirichlet boundary conditions and reflection conditions.