Charge based boundary element fast multipole method. The charge-based formulation of the boundary element method (BEM) is a dimensionality reduction numerical technique that is used to model quasistatic electromagnetic phenomena in highly complex conducting media (targeting, e.g., the human brain) with a very large (up to approximately 1 billion) number of unknowns. The charge-based BEM solves an integral equation of the potential theory written in terms of the induced surface charge density. This formulation is naturally combined with fast multipole method (FMM) acceleration, and the entire method is known as charge-based BEM-FMM. The combination of BEM and FMM is a common technique in different areas of computational electromagnetics and, in the context of bioelectromagnetism, it provides improvements over the finite element method.

Historical development 
Along with more common electric potential-based BEM, the quasistatic charge-based BEM, derived in terms of the single-layer (charge) density, for a single-compartment medium has been known in the potential theory since the beginning of the 20th century. For multi-compartment conducting media, the surface charge density formulation first appeared in discretized form (for faceted interfaces) in the 1964 paper by Gelernter and Swihart. A subsequent continuous form, including time-dependent and dielectric effects, appeared in the 1967 paper by Barnard, Duck, and Lynn. The charge-based BEM has also been formulated for conducting, dielectric, and magnetic media,  and used in different applications.

In 2009, Greengard et al. successfully applied the charge-based BEM with fast multipole acceleration to molecular electrostatics of dielectrics. A similar approach to realistic modeling of the human brain with multiple conducting compartments was first described by Makarov et al. in 2018. Along with this, the BEM-based multilevel fast multipole method has been widely used in radar and antenna studies at microwave frequencies as well as in acoustics.

Physical background - surface charges in biological media 
The charge-based BEM is based on the concept of an impressed (or primary) electric field  and a secondary electric field . The impressed field is usually known a priori or is trivial to find. For the human brain, the impressed electric field can be classified as one of the following:
 A conservative field  derived from an impressed density of EEG or MEG current sources in a homogeneous infinite medium with the conductivity  at the source location;
 An instantaneous solenoidal field  of an induction coil obtained from Faraday's law of induction in a homogeneous infinite medium (air), when transcranial magnetic stimulation (TMS) problems are concerned;
 A surface field derived from an impressed surface current density  of current electrodes injecting electric current at a boundary of a compartment with conductivity  when transcranial direct-current stimulation (tDCS) or deep brain stimulation (DBS) are concerned;
 A conservative field  of charges deposited on voltage electrodes for tDCS or DBS. This specific problem requires a coupled treatment since these charges will depend on the environment;
 In application to multiscale modeling, a field  obtained from any other macroscopic numerical solution in a small (mesoscale or microscale) spatial domain within the brain. For example, a constant field can be used.
When the impressed field is "turned on", free charges located within a conducting volume  immediately begin to redistribute and accumulate at the boundaries (interfaces) of regions of different conductivity in . A surface charge density  appears on the conductivity interfaces. This charge density induces a secondary conservative electric field  following Coulomb's law.

One example is a human under a direct current powerline with the known field   directed down. The superior surface of the human's conducting body will be charged negatively while its inferior portion is charged positively. These surface charges create a secondary electric field that effectively cancels or blocks the primary field everywhere in the body so that no current will flow within the body under DC steady state conditions.

Another example is a human head with electrodes attached. At any conductivity interface with a normal vector  pointing from an "inside" (-) compartment of conductivity to an "outside" (+) compartment of conductivity , Kirchhoff's current law requires continuity of the normal component of the electric current density. This leads to the interfacial boundary condition in the form

for every facet at a triangulated interface. As long as  are different from each other, the two normal components of the electric field, , must also be different. Such a jump across the interface is only possible when a sheet of surface charge exists at that interface. Thus, if an electric current or voltage is applied, the surface charge density follows.

The goal of the numerical analysis is to find the unknown surface charge distribution and thus the total electric field  (and the total electric potential if required) anywhere in space.

System of equations for surface charges 
Below, a derivation is given based on Gauss's law and Coulomb's law. All conductivity interfaces, denoted by , are discretized into planar triangular facets  with centers . Assume that an -th facet with the normal vector  and area  carries a uniform surface charge density . If a volumetric tetrahedral mesh were present, the charged facets would belong to tetrahedra with different conductivity values. We first compute the electric field  at the point , for  i.e., just outside facet 𝑚 at its center. This field contains three contributions:

The continuous impressed electric field  itself;
 An electric field of the -th charged facet itself. Very close to the facet, it can be approximated as the electric field of an infinite sheet of uniform surface charge . By Gauss's Law, it is given by  where  is a background electrical permittivity;
 An electric field generated by all other facets , which we approximate as point charges of charge  at each center .
A similar treatment holds for the electric field  just inside facet 𝑚, but the electric field of the flat sheet of charge changes its sign. Using Coulomb's law to calculate the contribution of facets different from , we find

From this equation, we see that the normal component of the electric field indeed undergoes a jump through the charged interface. This is equivalent to a jump relation of the potential theory. As a second step, the two expressions for  are substituted into the interfacial boundary condition , applied to every facet 𝑚. This operation leads to a system of linear equations for unknown charge densities  which solves the problem:

where  is the electric conductivity contrast at the -th facet. The normalization constant  will cancel out after the solution is substituted in the expression for  and becomes redundant.

Application of fast multipole method 
For modern characterizations of brain topologies with ever-increasing levels of complexity, the above system of equations for  is very large; it is therefore solved iteratively. An initial guess for  is the last term on its right-hand side while the sum is ignored. Next, the sum is computed and the initial guess is refined, etc. This solution employs the simple Jacobi iterative method. The more rigorous generalized minimum residual method (GMRES) yields a much faster convergence of the BEM-FMM. In either case, the major work is in computing the underbraced sum in the system of equations above for every  at every iteration; this operation corresponds to a repetitive matrix-vector multiplication. However, one can recognize this sum as an electric field (times ) of  charges to be computed at  observation points. Such a computation is exactly the task of the fast multipole method, which performs fast matrix-by-vector multiplication in  or even  operations instead of . The FMM3D library realized in both Python and MATLAB can be used for this purpose. It is therefore unnecessary to form or store the dense system matrix typical for the standard BEM.

Continuous charge-based BEM. Near-field correction 
The system of equations formulated above is derived with the collocation method and is less accurate. The corresponding integral equation is obtained from the local jump relations of the potential theory  and the local interfacial boundary condition of normal electric current continuity. It is a Fredholm integral equation of the second kind

Its derivation does not involve Green's identities (integrations by parts) and is applicable to non-nested geometries. When the Galerkin method is applied and the same zeroth-order basis functions (with a constant charge density for each facet) are still used on triangulated interfaces, we obtain exactly the same discretization as before if we replace the double integrals over surfaces  and  of triangles  and , respectively, by

where  is the surface area of the triangle . This approximation is only valid when  is much larger than a typical facet size i.e., in the "far field". Otherwise, semi-analytical formulae and Gaussian quadratures for triangles should be used. Typically, 4 to 32 such neighbor integrals per facet should be precomputed, stored, and then used at every iteration. This is an important correction to the plain fast multipole method in the "near field" which should also be used in the simple discrete formulation derived above. Such a correction makes it possible to obtain an unconstrained numerical (but not anatomical) resolution in the brain.

Applications and limitations 
Applications of the charge-based BEM-FMM include modeling brain stimulation with near real-time accurate TMS computations as well as neurophysiological recordings. They also include modeling challenging mesoscale head topologies such as thin brain membranes (dura mater, arachnoid mater, and pia mater). This is particularly important for accurate transcranial direct-current stimulation and electroconvulsive therapy dosage predictions. The BEM-FMM allows for straightforward adaptive mesh refinement including multiple extracerebral brain compartments. Another application is modeling electric field perturbations within densely packed neuronal/axonal arbor. Such perturbations change the biophysical activating function. A charge-based BEM formulation is being developed for promising bi-domain biophysical modeling of axonal processes.

In its present form, the charge-based BEM-FMM is applicable to multi-compartment piecewise homogeneous media only; it cannot handle macroscopically anisotropic tissues. Additionally, the maximum number of facets (degrees of freedom) is limited to approximately  for typical academic computer hardware resources used as of 2023.

See also 
 Computational electromagnetics
 Boundary element method
 Fast multipole method
 Computational neuroscience
 Transcranial magnetic stimulation
 Transcranial direct-current stimulation
 Electroencephalography
 Magnetoencephalography

External links 
 A survey on integral equations for bioelectric modeling, preprint.
 Flatiron Institute - Simons Foundation FMM3D GitHub Project Site.

References 

Computational electromagnetics
Dimension reduction