Theory and introduction
Since ancient times people had wondered what makes amber rubbed with fur to attract small light objects and what makes lodestones, naturally magnetized pieces of the mineral magnetite, to attract iron. Nowadays we do have an answer that the force comes from magnetization or polarization gradient. However, even for linear materials, the computation of the force is challenging as the body itself perturbs the field. Fortunately, boundary integral methods can save our day [1], which are implemented in this library and can be used to calculate the field and so also a force at an arbitrary object's surface.
To start with we introduce a potential ψ whose gradient is either electric or magnetic field. In the absence of singularities (charges, dipoles and etc.) the potential satisfies Laplace equation Δψ=0. It is well known from the Green theorem that Laplace equation can also be written in integral form:
This integral is flexible in the sense that we can wrap the surface around singularities, infinity and objects, and we can apply it to the interior of objects with linear properties.
Let's consider the system shown in the figure:
We have singularities denoted by $S_n$, object $\Omega$ and infinity $\infty$. Since at infinity the field perturbation from the object is vanishingly small we can set it equal to the free field. Similarly, the field near the singularity approaches the field of the singularity, and we can neglect the effects of the body. Thus we have an identity:
where the left side is integral over the surface of singularities and infinity, and the right side is the field in the absence of bodies.
To model the field in the presence of bodies, we only need to set appropriate boundary conditions, which are:
which implies a linear material. Applying the boundary integral to the interior of the object and matching boundary conditions with the exterior surface, we arrive at the useful formula:
That we can use to obtain a boundary integral equation for the potential:
where we used identity $\int_{\partial \Omega} \frac{\partial}{\partial n_x} \frac{1}{|\boldsymbol x - \boldsymbol y|} dS_{\boldsymbol x}=0$ for regularization.
Another way of writing the Laplace equation in the BIE form is as follows:
From a similar argument, we obtain
And from boundary conditions, we can get a formula:
That we substitute back to obtain:
which corresponds to a Biot-Savarat integral over the surface current. In numerics, a regularized version is used (for derivation see [1]):
Implementation and API
The boundary integral equations are solved with the collocation method on a triangular mesh. The simplest quadrature ∫ΔfdS=(f1+f2+f3)/3 is used for all nonsingular elements. Whereas for Biot-Savarat integral for normal derivatives, a weakly singular quadrature is implemented to deal with elements near the singularity. To obtain tangential derivatives of the potential, we do numerical differentiation of previously calculated potential and use least squares to solve the overdetermined system.
LaplaceBIE.normalderivatives
— Method.normalderivatives(points,normals,topology,P∇ψ,μ,∇ψ0::Function; eps=0.0001, NP=100)
Calculates ∇ψ.n approached to the object surface from interior region. To use the function surface properties points
, normals
and topology
are required. To use the function it is required to have a tangential field components (see tangentialderivatives
and surfacepotential
), boundary jump condition μ and a gradient of external free field.
LaplaceBIE.surfacepotential
— Method.surfacepotential(points,normals,topology,μ,ψ0::Function)
Returns a surface field for a given shape defined by a triangular mesh with points
, normals
and topology
and for a boundary conditions where ∇ψ has a jump in th e normal direction charectarized with μ and for the external free field given by a potential ψ0.
LaplaceBIE.tangentderivatives
— Method.tangentderivatives(points,normals,topology,ψ)
Returns tangential derivative P∇ψ for a shape defined by points
, normals
and topology
.
Erdmanis, J. & Kitenbergs, G. & Perzynski, R. & Cebers, A. (2017) Magnetic micro-droplet in rotating field: numerical simulation and comparison with experiment