<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JAMP</journal-id><journal-title-group><journal-title>Journal of Applied Mathematics and Physics</journal-title></journal-title-group><issn pub-type="epub">2327-4352</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jamp.2023.115086</article-id><article-id pub-id-type="publisher-id">JAMP-125127</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Helmholtz Decomposition of Vector Fields Using an Optimal Preconditioned Conjugate Gradient Algorithm
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Jorge</surname><given-names>Lopez</given-names></name><xref ref-type="aff" rid="aff1"><sub>1</sub></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><label>1</label><addr-line>UJAT, Tabasco, México</addr-line></aff><pub-date pub-type="epub"><day>05</day><month>05</month><year>2023</year></pub-date><volume>11</volume><issue>05</issue><fpage>1337</fpage><lpage>1348</lpage><history><date date-type="received"><day>14,</day>	<month>April</month>	<year>2023</year></date><date date-type="rev-recd"><day>22,</day>	<month>May</month>	<year>2023</year>	</date><date date-type="accepted"><day>25,</day>	<month>May</month>	<year>2023</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  In this article, we study numerically a Helmholtz decomposition methodology, based on a formulation of the mathematical model as a saddle-point problem. We use a preconditioned conjugate gradient algorithm, applied to an associated operator equation of elliptic type, to solve the problem. To solve the elliptic partial differential equations, we use a second order mixed finite element approximation for discretization. We show, using 2-D synthetic vector fields, that this approach, yields very accurate solutions at a low computational cost compared to traditional methods with the same order of approximation.
 
</p></abstract><kwd-group><kwd>Helmholtz Decomposition</kwd><kwd> Self-Adjoint Operator</kwd><kwd> Optimal Preconditioning</kwd><kwd> Finite Element</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Several problems and applications require a deep knowledge of a vector field over a region. An important tool in this context is the Helmholtz decomposition theorem (HDT) that guarantees, under certain hipothesis [<xref ref-type="bibr" rid="scirp.125127-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref2">2</xref>] , a unique decomposition of a vector field u defined in a domain Ω into its solenoidal u s and irrotational u p components. This is,</p><p>u = u s + u p ,     in   Ω   . (1)</p><p>This decomposition is important, for example, because the properties like incompressibility and vorticity can be studied directly by studying these components.</p><p>The application areas of the HD include (but are not restricted to) electromagnetism, linear elasticity, fluid mechanic [<xref ref-type="bibr" rid="scirp.125127-ref3">3</xref>] , astrophysics [<xref ref-type="bibr" rid="scirp.125127-ref4">4</xref>] , geophysics [<xref ref-type="bibr" rid="scirp.125127-ref5">5</xref>] , computer vision and robotic [<xref ref-type="bibr" rid="scirp.125127-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref7">7</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref8">8</xref>] , image processesing [<xref ref-type="bibr" rid="scirp.125127-ref9">9</xref>] . The HDT also establishes that the Helmoltz decomposition components can be obtained in terms of a vector potential (the solenoidal) and a scalar potential (the irrotational), solution of certain Poisson equations with different kinds of boundary conditions, one of them being u s ⋅ n = 0 , on Γ = ∂ Ω . These elliptic equations cannot be solved explicitly, so it is necessary to apply numerical methods to solve it. The most common mesh dependant methods are the finite element methods (FEM) [<xref ref-type="bibr" rid="scirp.125127-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref10">10</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref11">11</xref>] , Finite difference methods (FDM) [<xref ref-type="bibr" rid="scirp.125127-ref9">9</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref12">12</xref>] , Galerkin Formulation Using Finite Differences [<xref ref-type="bibr" rid="scirp.125127-ref13">13</xref>] , Fourier and Wavelets Domains [<xref ref-type="bibr" rid="scirp.125127-ref14">14</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref15">15</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref16">16</xref>] . Among the meshsless methods, we can mention the Smoothed Particle Hydrodynamics (SPH) [<xref ref-type="bibr" rid="scirp.125127-ref17">17</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref18">18</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref19">19</xref>] and the Statistical Learning Using Matrix-Valued Kernels [<xref ref-type="bibr" rid="scirp.125127-ref20">20</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref21">21</xref>] [<xref ref-type="bibr" rid="scirp.125127-ref22">22</xref>] .</p><p>The problem we are considering in this work is the numerical decomposition, in a given domain Ω , of a vector field u into its solenoidal and irrotational components with the more general boundary condition: u s ⋅ n = 0 is satisfied only in Γ N , a section of Γ where the solenoidal vector field is tangential to the boundary. This kind of boundary conditions appears, for example when we want to adjust vector fields from experimental or incomplete data. Let u be given and defined in the Lipschitz bounded domain Ω , with boundary Γ = Γ N ∪ Γ D . We want to solve numerically the following model:</p><p>u = u s + u p ,     in   Ω , (2)</p><p>∇ ⋅ u s = 0,     in   Ω , (3)</p><p>u p = ∇ p     in   Ω , (4)</p><p>u s ⋅ n = 0,     on   Γ N , (5)</p><p>where p is a scalar potential, n is the unitary outer vector, normal to the boundary Γ and Γ D = Γ − Γ N .</p><p>We apply a methodology based on the solution of saddle point problems to find simultaneously the pair ( u s , p ) (and consequently u p = u − u s ) by using an optimal preconditioned conjugate gradient algorithm combined with a mixed finite element method to solve elliptic problems. The associated stiffness matrix components are aproximated by a trapesoidal rule that produce a diagonal matrix so that the solution of the stiffness system is easy. This property together with the use of an optimal preconditioned resulted in a very fast algorithm.</p><p>The structure of this article is as follows: In Section 2, we consider the mathematical formulation of the problem and we describe the classical elliptic problems for scalar potentials allowing the decomposition. In Section 3, we describe the variational version of the problem. After reformulating the problem, we describe a preconditioned conjugate gradient (PCG-algorithm), where a mixed finite element method is used to solve the elliptic subproblems at each iteration. In Section 4, we present and discuss the numerical results, and finally, in Section 5, we give some concluding remarks.</p></sec><sec id="s2"><title>2. Mathematical Formulation of the Helmholtz Decomposition</title><p>The Helmholtz decomposition theorem [<xref ref-type="bibr" rid="scirp.125127-ref2">2</xref>] , establishes that if Ω ⊂ ℝ d ( d ≥ 2 ) is a bounded Lipschitz domain with boundary Γ , then, each u ∈ L 2 ( Ω ) have a unique Helmholtz decomposition</p><p>u = u s + u p , (6)</p><p>if we know that the solenoidal component satisfies u s ⋅ n = 0 in Γ , i.e. u s ∈ H d i v ( Ω ) and u p ∈ G ( Ω ) , where</p><p>H d i v ( Ω ) = { w ∈ H ( d i v ; Ω ) : ∇ ⋅ w = 0 &amp; w ⋅ n = 0   in   Γ } , (7)</p><p>H ( d i v ; Ω ) = { v ∈ L 2 ( Ω ) : ∇ ⋅ v ∈ L 2 ( Ω ) } (8)</p><p>and</p><p>G ( Ω ) = { v ∈ L 2 ( Ω ) : ∃   p ∈ L 2 ( Ω )   such   that   v = ∇ p } . (9)</p><p>Spaces H d i v ( Ω ) and G ( Ω ) are orthogonal in L 2 ( Ω ) .</p><p>If u ∈ H ( d i v ; Ω ) and the boundary condition u s ⋅ n = 0 in Γ is given, the irrotational vector field u p = ∇ p can be calculated by obtaining the scalar field p ( x ) ∈ H 1 ( Ω ) / ℝ , as solution of the Poisson problem with Neumann boundary condition</p><p>− Δ p = − ∇ ⋅ u ,     in   Ω , ∇ p ⋅ n = u ⋅ n ,     on   Γ , (10)</p><p>where H 1 ( Ω ) / ℝ = { v ∈ H 1 ( Ω ) : ∫ Ω     v ( x ) d x = 0 } .</p><p>If we first solve the elliptic problem (10) to find p ( x ) then we calculate u p = ∇ p and finally we calculate u s = u − u p .</p><p>In order to describe our methodology for finding the Helmholtz decomposition, we consider a given vector field u ∈ H ( d i v ; Ω ) satisfying (2)-(5). From (2), we have</p><p>u − u s = u p ,</p><p>or</p><p>u − u s = ∇ p ,     for   some   p ∈ L 2 ( Ω ) ,</p><p>From this,</p><p>∫ Ω ( u − u s ) ⋅ v d x = ∫ Ω     ∇ p ⋅ v d x ,   ∀   v ∈ H ( d i v ; Ω ) .</p><p>Since</p><p>∫ Ω     ∇ λ ⋅ v d x = ∫ Γ     λ v ⋅ n d γ − ∫ Ω     λ ∇ ⋅ v d x ,   ∀   v ∈ H ( d i v ; Ω ) ,   ∀   λ ∈ L 2 ( Ω ) ,</p><p>we can write (if p = 0 in Γ D and v ⋅ n = 0 on Γ N )</p><p>∫ Ω ( u − u s ) ⋅ v d x = − ∫ Ω     p ∇ ⋅ v d x ,   ∀   v ∈ V N ,</p><p>where V N is the space of vector fields defined as</p><p>V N = { v ∈ H ( d i v ; Ω ) : v ⋅ n = 0   on   Γ N } . (11)</p><p>Considering condition (3) we conclude that the pair ( u s ,   p ) ∈ V N &#215; L 2 ( Ω ) , satisfies</p><p>{ ∫ Ω ( u − u s ) ⋅ v d x = − ∫ Ω     p ∇ ⋅ v d x ,   ∀   v ∈ V N , ∫ Ω     q ∇ ⋅ u s d x = 0,   ∀   q ∈ L 2 ( Ω ) . (12)</p><p>Next section is devoted to find the pair ( u s ,   p ) ∈ V N &#215; L 2 ( Ω ) , satisfying (12).</p></sec><sec id="s3"><title>3. A Preconditioned Conjugate Gradient Algorithm</title><p>Following [<xref ref-type="bibr" rid="scirp.125127-ref23">23</xref>] , assume that ( u s , p ) is solution of problem (12) with</p><p>u − u s = u p . (13)</p><p>Considering that ∇ ⋅ u s = 0 , it follows that ∇ ⋅ u p = ∇ ⋅ u , so we have that p satisfies the following operational equation</p><p>A   p = ∇ ⋅ u , (14)</p><p>where A : L 2 ( Ω ) → L 2 ( Ω ) is the operator defined by</p><p>A   μ = ∇ ⋅ u μ , (15)</p><p>with u μ the solution of</p><p>{ u μ ∈ H ( d i v ; Ω ) , ∫ Ω     u μ ⋅ v d x = − ∫ Ω     μ ∇ ⋅ v d x ,     ∀   v ∈ V N . (16)</p><p>Note that subscript s in (13) have not the same meaning as p and μ in (16). The properties of operator A (linear, self-adjoint and strongly elliptic, [<xref ref-type="bibr" rid="scirp.125127-ref23">23</xref>] ), allow us to solve equation (14) by using a conjugate gradient algorithm operating in L 2 ( Ω ) . Also, we can use the optimal preconditioner B − 1 : L 2 ( Ω ) → L 2 ( Ω ) defined by</p><p>B q = ϕ q , (17)</p><p>where ϕ q solves the problem</p><p>∫ Ω     ∇ ϕ q ⋅ ∇ ψ d x = ∫ Ω     q   ψ d x ,     ∀   ψ ∈ H D 1 ( Ω ) , (18)</p><p>ϕ q = 0     on   Γ D , (19)</p><p>∇ ϕ q ⋅ n = 0     on   Γ N , (20)</p><p>with</p><p>H D 1 ( Ω ) = { ψ ∈ H 1 ( Ω ) : ψ = 0   on   Γ D } . (21)</p><p>Next we enumerate the three stages of the preconditioned conjugate gradient algorithm to solve the equation A p = b :</p><p>1) Initialization: p 0 given, g 0 = A   p 0 − b , g ^ 0 = B g 0 , d 0 = − g ^ 0 .</p><p>2) Descent: For m ≥ 0 , assuming we know p m , g m , g ^ m , d m , find p m + 1 , g m + 1 , g ^ m + 1 , d m + 1 by</p><p>p m + 1 = p m + α m d m where α m = 〈 g m , g ^ m 〉 / 〈 d m , A   d m 〉 .</p><p>g m + 1 = g m + α m   A   d m ,</p><p>g ^ m + 1 = g ^ m + α m B ( A   d m ) .</p><p>3) Test of convergence and new conjugate direction:</p><p>If 〈 g m + 1 , g ^ m + 1 〉 ≤ ε 〈 g 0 , g ^ 0 〉 , take p = p m + 1 and stop.</p><p>Else d m + 1 = − g ^ m + 1 + β m d m with β m = 〈 g m + 1 , g ^ m + 1 〉 〈 g m , g ^ m 〉</p><p>Do m = m + 1 and return to 2.</p><p>Using Equations (15)-(16), which define operator A, and Equations (17)-(18) which define operator B, the detailed preconditioned conjugate gradient algorithm (PCG) to obtain p and u s (and u p ) is as follows:</p><p>Initialization</p><p>1) Given p 0 ∈ L 2 ( Ω ) , solve</p><p>{ u p 0 ∈ H ( d i v ; Ω ) , ∫ Ω ( u p 0 ) ⋅ v d x = − ∫ Ω     p 0 ∇ ⋅ v d x ,   ∀   v ∈ V N .</p><p>2) Let g 0 = − ∇ ⋅ u 0 , where u 0 = − ( u p 0 − u ) .</p><p>3) Solve</p><p>{ ϕ 0 ∈ H D 1 ( Ω ) , ∫ Ω ( ∇ ϕ 0 ) ⋅ ∇ ψ d x = ∫ Ω     g 0 ψ d x ,   ∀   ψ ∈ H D 1 ( Ω ) .</p><p>4) Let g ^ 0 = ϕ 0 , d 0 = − g ^ 0 .</p><p>Descent</p><p>For m ≥ 0 , assuming p m , g m , g ^ m , d m , u m are known, compute p m + 1 , g m + 1 , g ^ m + 1 , d m + 1 and u m + 1 , using the following steps:</p><p>5) Solve</p><p>{ u m ∈ H ( d i v ; Ω ) , ∫ Ω ( u m ) ⋅ v d x = − ∫ Ω     d m ∇ ⋅ v d x ,   ∀   v ∈ V N .</p><p>6) Let g &#175; m = ∇ ⋅ u m .</p><p>7) Let α m = ∫ Ω     g m g ^ m d x / ∫ Ω     g &#175; m d m d x .</p><p>8) Solve</p><p>{ ϕ &#175; m ∈ H D 1 ( Ω ) , ∫ Ω ( ∇ ϕ &#175; m ) ⋅ ∇ ψ d x = ∫ Ω     g &#175; m ψ d x ,   ∀   ψ ∈ H D 1 ( Ω ) .</p><p>9) Set</p><p>p m + 1 = p m + α m   d m ,</p><p>u m + 1 = u m − α m   u m ,</p><p>g m + 1 = g m + α m   g &#175; m ,</p><p>g ^ m + 1 = g ^ m + α m   ϕ &#175; m .</p><p>Test of convergence and new descent direction</p><p>If ∫ Ω     g m + 1 g ^ m + 1 d x / ∫ Ω     g 0 g ^ 0 d x &lt; ε , then do p = p m + 1 , u s = u m + 1 and stop. Otherwise, do the following:</p><p>10) Compute β m = ∫ Ω     g m + 1 g ^ m + 1 d x / ∫ Ω     g m g ^ m d x</p><p>11) Set d m + 1 = − g ^ m + 1 + β m d m .</p><p>12) Do m = m + 1 and return to 5.</p><p>Note that in this algorithm, u s and p are computed simultaneously.</p><p>To approximate the functions belonging to the spaces V N and L 2 ( Ω ) , we make use of the Bercovier-Pironneau finite element approximation using two triangulation of Ω , the coarse mesh T 2 h and the fine mesh T h obtained from the coarse triangulation through a regular subdivision of each triangle T ∈ T 2 h , as shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>.</p><p>The vector-valued functions such as u s are approximated in the fine mesh and the scalar functions, such as p are approximated in the coarse mesh. Since u s is obtained on the fine mesh, its resolution is the same as that obtained when solving the elliptics problems (10) in T h .</p><p>To measure the global difference between the exact solenoidal field u s and the computed solenoidal field u s h we take the relative error</p><p>e s r = ‖ u s − u s h ‖ 2 ‖ u s ‖ 2 . (22)</p><p>Also, we computed the L 2 -norm of the divergence of u s h , ‖ ∇ ⋅ u s h ‖ L 2 ( Ω ) , which we denote by ndiv in the next section.</p></sec><sec id="s4"><title>4. Numerical Results</title><p>To show the performance of the PCG-algorithm we chose two synthetic vector fields. In Example 1 we consider a vector field satisfying the boundary condition</p><p>u s ⋅ n = 0 ,     on   Γ . (23)</p><p>In Example 2 we consider a vector field satisfying the boundary condition</p><p>u s ⋅ n = 0, (24)</p><p>but only in Γ N , a section of Γ .</p><p>All numerical calculations were done in a Toshiba PC: Portege R705, Windows 7, 64 Bits, Intel Processor CORE i3, 2.27 GHz, 3 GB Ram.</p><p>Example 1. We consider the 2D vector field</p><p>u ( x , y ) = u s ( x , y ) + u c ( x , y ) , Ω = ( − 1,1 ) &#215; ( − 1,1 ) , (25)</p><p>for which the solenoidal and irrotational components are</p><p>u s ( x , y ) = ( − sin ( π x ) cos ( π y ) , cos ( π x ) sin ( π y ) ) , (26)</p><p>u c ( x , y ) = ( π cos ( π ( x + y ) ) , π cos ( π ( x + y ) ) ) = ∇ ( sin ( π ( x + y ) ) ) . (27)</p><p>In this case,</p><p>u s ⋅ n = 0     in   Γ N = Γ . (28)</p><p>Consequently, Γ D = ∅ . To solve the elliptic problems in the PCG algorithm we use simultaneously a coarse triangular mesh T 2 h (blue in <xref ref-type="fig" rid="fig2">Figure 2</xref>) to approximate the scalar potential p and a fine triangular mesh T 2 h (red in <xref ref-type="fig" rid="fig2">Figure 2</xref>) to approximate the solenoidal component.</p><p>In <xref ref-type="fig" rid="fig3">Figure 3</xref>, we show the exact vector fields u ( x , y ) , u s ( x , y ) and u c ( x , y ) .</p><p>We want to see how well we can approximate the solenoidal component and the scalar potential p applying the PCG algorithm. A summary of the numerical results is shown in <xref ref-type="table" rid="table1">Table 1</xref>, where we show the relative error e s r of the solenoidal component, the L 2 -norm of the divergence ndiv of the solenoidal component, as well as the number of iterations to get convergence, up to the given tolerance ( ε = 10 − 4 ), for several mesh sizes.</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Numerical results for Example 1. ε = 10 − 4 </title></caption><table><tbody><thead><tr><th align="center" valign="middle"  rowspan="2"  >T h</th><th align="center" valign="middle"  colspan="3"  >CG-algorithm</th><th align="center" valign="middle"  colspan="3"  >PCG-algorithm</th></tr></thead><tr><td align="center" valign="middle" >e r</td><td align="center" valign="middle" >ndiv</td><td align="center" valign="middle" >iters.</td><td align="center" valign="middle" >e r</td><td align="center" valign="middle" >ndiv</td><td align="center" valign="middle" >iters.</td></tr><tr><td align="center" valign="middle" >33 &#215; 33</td><td align="center" valign="middle" >3.84E−2</td><td align="center" valign="middle" >1.65E−3</td><td align="center" valign="middle" >9</td><td align="center" valign="middle" >6.87E−2</td><td align="center" valign="middle" >4.55E−3</td><td align="center" valign="middle" >4</td></tr><tr><td align="center" valign="middle" >65 &#215; 65</td><td align="center" valign="middle" >1.65E−2</td><td align="center" valign="middle" >3.25E−4</td><td align="center" valign="middle" >18</td><td align="center" valign="middle" >8.50E−2</td><td align="center" valign="middle" >3.03E−3</td><td align="center" valign="middle" >3</td></tr><tr><td align="center" valign="middle" >129 &#215; 129</td><td align="center" valign="middle" >1.18E−2</td><td align="center" valign="middle" >1.22E−4</td><td align="center" valign="middle" >34</td><td align="center" valign="middle" >5.99E−2</td><td align="center" valign="middle" >1.08E−3</td><td align="center" valign="middle" >3</td></tr><tr><td align="center" valign="middle" >257 &#215; 257</td><td align="center" valign="middle" >7.57E−3</td><td align="center" valign="middle" >3.38E−5</td><td align="center" valign="middle" >67</td><td align="center" valign="middle" >8.90E−2</td><td align="center" valign="middle" >6.89E−4</td><td align="center" valign="middle" >2</td></tr></tbody></table></table-wrap><p>In <xref ref-type="fig" rid="fig4">Figure 4</xref>, we show the stream lines for the exact (left) and aproximated (right) solenoidal vector fields. In <xref ref-type="fig" rid="fig5">Figure 5</xref>, we show the exact (left) and approximated (right) p.</p><p>It is important to mention that the error bounds in <xref ref-type="table" rid="table1">Table 1</xref> were obtained using in the stop criterion of the conjugate gradient algorithm the relaxed value ε = 10 − 4 and the results can be improved if we use a more restrictive ε , as is shown in the next example.</p><p>Example 2. Here we consider the 2D vector field u ( x , y ) = ( x ,0 )</p><p>u ( x , y ) = u s ( x , y ) + u c ( x , y ) = ( x ,0 ) , Ω = ( 1,2 ) &#215; ( 0,1 ) , (29)</p><p>for which the solenoidal and irrotational components are</p><p>u s ( x , y ) = ( x , − y ) , (30)</p><p>u c ( x , y ) = ( 0, y ) = ∇ p ( x , y ) = ∇ ( y 2 / 2 + c ) ,   c   any   constant . (31)</p><p>In this example,</p><p>u s ⋅ n = 0     on   Γ N = { ( x , y ) ∈ ∂ Ω : y = 0 } , (32)</p><p>so that, Γ D is the top and vertical boundary of Ω . Our formulation implies that p = 0 in Γ D , but this is only possible in the top part of Γ D , and we do not want (and we are not able) to impose additional boundary conditions in p, so we impose exact boundary conditions in u s in the vertical boundary. <xref ref-type="table" rid="table2">Table 2</xref> shows the numerical results obtained for this test problem.</p><p>For comparison reasons we have repeated the calculations in example 2 but using a more restrictive stop tolerance of ε = 10 − 12 for the conjugate gradient</p><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> Numerical results for Example 2. ε = 10 − 4 </title></caption><table><tbody><thead><tr><th align="center" valign="middle"  rowspan="2"  >T h</th><th align="center" valign="middle"  colspan="3"  >CG-algorithm</th><th align="center" valign="middle"  colspan="3"  >PCG-algorithm</th></tr></thead><tr><td align="center" valign="middle" >e r</td><td align="center" valign="middle" >ndiv</td><td align="center" valign="middle" >iters.</td><td align="center" valign="middle" >e r</td><td align="center" valign="middle" >ndiv</td><td align="center" valign="middle" >iters.</td></tr><tr><td align="center" valign="middle" >33 &#215; 33</td><td align="center" valign="middle" >1.16E−3</td><td align="center" valign="middle" >1.24E−5</td><td align="center" valign="middle" >84</td><td align="center" valign="middle" >1.82E−3</td><td align="center" valign="middle" >6.19E−5</td><td align="center" valign="middle" >2</td></tr><tr><td align="center" valign="middle" >65 &#215; 65</td><td align="center" valign="middle" >5.04E−4</td><td align="center" valign="middle" >3.29E−6</td><td align="center" valign="middle" >170</td><td align="center" valign="middle" >6.40E−4</td><td align="center" valign="middle" >1.09E−5</td><td align="center" valign="middle" >2</td></tr><tr><td align="center" valign="middle" >129 &#215; 129</td><td align="center" valign="middle" >1.88E−4</td><td align="center" valign="middle" >9.04E−7</td><td align="center" valign="middle" >346</td><td align="center" valign="middle" >2.25E−4</td><td align="center" valign="middle" >1.93E−6</td><td align="center" valign="middle" >2</td></tr><tr><td align="center" valign="middle" >257 &#215; 257</td><td align="center" valign="middle" >9.25E−5</td><td align="center" valign="middle" >2.23E−7</td><td align="center" valign="middle" >695</td><td align="center" valign="middle" >9.93E−5</td><td align="center" valign="middle" >3.40E−7</td><td align="center" valign="middle" >2</td></tr></tbody></table></table-wrap><p>method with and without preconditioning. We also solved a problem equivalent to (10) but with exact (not diagonal) stiffness matrix. A summary of the numerical results with the three algorithms is shown in <xref ref-type="table" rid="table3">Table 3</xref>, where we show the relative solenoidal error e r , average of divergence mdiv, as well as the number of iterations to get convergence, up to the given tolerance ( ε = 10 − 12 , in the CG</p><table-wrap id="table3" ><label><xref ref-type="table" rid="table3">Table 3</xref></label><caption><title> Numerical results for Example 3. ε = 10 − 12 </title></caption><table><tbody><thead><tr><th align="center" valign="middle"  rowspan="2"  >T h</th><th align="center" valign="middle"  colspan="4"  >CG-algorithm</th><th align="center" valign="middle"  colspan="4"  >PCG-algorithm</th><th align="center" valign="middle" >E-alg</th></tr></thead><tr><td align="center" valign="middle" >e r</td><td align="center" valign="middle" >mdiv</td><td align="center" valign="middle" >iters.</td><td align="center" valign="middle" >CPUt</td><td align="center" valign="middle" >e r</td><td align="center" valign="middle" >mdiv</td><td align="center" valign="middle" >iters.</td><td align="center" valign="middle" >CPUt</td><td align="center" valign="middle" >CPUt</td></tr><tr><td align="center" valign="middle" >33 &#215; 33</td><td align="center" valign="middle" >3.1E−4</td><td align="center" valign="middle" >−7.6E−09</td><td align="center" valign="middle" >260</td><td align="center" valign="middle" >0.25</td><td align="center" valign="middle" >1.9E−3</td><td align="center" valign="middle" >−3.4E−6</td><td align="center" valign="middle" >6</td><td align="center" valign="middle" >0.03</td><td align="center" valign="middle" >0.01</td></tr><tr><td align="center" valign="middle" >65 &#215; 65</td><td align="center" valign="middle" >1.1E−4</td><td align="center" valign="middle" >−5.0E−10</td><td align="center" valign="middle" >498</td><td align="center" valign="middle" >1.18</td><td align="center" valign="middle" >6.9E−4</td><td align="center" valign="middle" >−4.5E−7</td><td align="center" valign="middle" >7</td><td align="center" valign="middle" >0.085</td><td align="center" valign="middle" >0.06</td></tr><tr><td align="center" valign="middle" >129 &#215; 129</td><td align="center" valign="middle" >4.0E−5</td><td align="center" valign="middle" >−2.7E−11</td><td align="center" valign="middle" >854</td><td align="center" valign="middle" >7.24</td><td align="center" valign="middle" >2.4E−4</td><td align="center" valign="middle" >−5.9E−8</td><td align="center" valign="middle" >7</td><td align="center" valign="middle" >0.26</td><td align="center" valign="middle" >0.73</td></tr><tr><td align="center" valign="middle" >257 &#215; 257</td><td align="center" valign="middle" >1.4E−5</td><td align="center" valign="middle" >−1.6E−12</td><td align="center" valign="middle" >1688</td><td align="center" valign="middle" >60.69</td><td align="center" valign="middle" >8.6E−5</td><td align="center" valign="middle" >−7.5E−9</td><td align="center" valign="middle" >7</td><td align="center" valign="middle" >1.96</td><td align="center" valign="middle" >15.75</td></tr></tbody></table></table-wrap><p>and PCG algorithms) for different mesh sizes. This table also contains the CPU time (sec) spent in each numerical experiment, and, in particular, in the last column the CPU time spent by solving the elliptic problem equivalent to (10). For this elliptic problem the results for e r and mdiv were not as good as those of the CG algorithms.</p><p>It is clear that the PCG-algorithm performs much better than the other algorithms. Another nice feature of the performance of the PCG-algorithm in this example is that the number of iterations is independent of the mesh size (7 iterations in each case). Also, the relative error between the computed and the exact solenoidal vector field is of the same order for the CG and PCG algorithms, with the largest difference occurring on the top boundary. For this example, we observe a loss of accuracy on the mean divergence when the PCG-algorithm is employed. Anyway, the mean divergence obtained with the PCG-algorithm is still very accurate, from a practical point of view, since we are using polynomial of degree 1 to approximate the unknowns.</p></sec><sec id="s5"><title>5. Conclusions</title><p>We have applied an optimal preconditioner for the conjugate gradient algorithm, to solve the operator equation associated with the saddle-point formulation of the Helmholtz decomposition problem. Numerical results show that the new preconditioned conjugate gradient algorithm, and its stable approximation by a mixed finite element discretization, preserve the good properties of the non-preconditioned conjugate gradient algorithm, but it is much faster, and produces much better results than the methods based on the elliptic problem (10). Some additional nice properties of this algorithm are:</p><p>● It enforces very accurately mass conservation in the computed vector fields, considering that the approximation is second order.</p><p>● The number of iterations is reduced from several hundreds to less than 7 in the examples considered in this article. Also, the number of iterations of the PCG-algorithm is almost independent with respect to mesh refinement, while the number of iterations in the non-preconditioned algorithm doubles at each mesh refinement in most cases. Therefore, there is a substantial reduction in the computational time in both examples. However, this behavior must be corroborated in 3-D problems with adaptive meshes in complex domains, and with millions of degrees of freedom, in order to have a better idea of the performance of the method with realistic scenarios.</p><p>● It is not necessary to impose boundary conditions on the multiplier p, as it is done with the elliptic approaches. Furthermore, post-processing the scalar potential to find the vectorial field from the multiplier is not required, since the multiplier and the solenoidal vector field are found simultaneously by the algorithm.</p><p>The application of the methodology presented here to the more realistic three-dimensional case is an extension of the present work.</p></sec><sec id="s6"><title>Acknowledgements</title><p>Sincere thanks to the members of JAMP for their professional attitude of high quality.</p></sec><sec id="s7"><title>Conflicts of Interest</title><p>The author declares no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s8"><title>Cite this paper</title><p>Lopez, J. (2023) Helmholtz Decomposition of Vector Fields Using an Optimal Preconditioned Conjugate Gradient Algorithm. Journal of Applied Mathematics and Physics, 11, 1337-1348. https://doi.org/10.4236/jamp.2023.115086</p></sec></body><back><ref-list><title>References</title><ref id="scirp.125127-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Agashe, S. (2021) New Formulas and Results for 3-Dimensional Vector Fields. Applied Mathematics, 12, 1058-1096. https://doi.org/10.4236/am.2021.1211069</mixed-citation></ref><ref id="scirp.125127-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Bhatia, H., Norgard, G., Pascucci, V. and Bremer, P. (2012) The Helmholtz-Hodge Decomposition—A Survey. IEEE Transactions on Visualization and Computer Graphics, 19, 1386-1404. https://doi.org/10.1109/TVCG.2012.316</mixed-citation></ref><ref id="scirp.125127-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Ahusborde, E., Azaez, M., Caltagirone, J.P., Gerritsma, M. and Lemoine, A. (2014) Discrete Hodge Helmholtz Decomposition. Monografas Matemáticas Garca de Galdeano, 39, 1-10.</mixed-citation></ref><ref id="scirp.125127-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Mansour, N.N., Kosovichev, A., Georgobiani, D., Wray, A. and Miesch, M. (2004) Turbulence Convection and Oscillations in the Sun. Proceedings of the SOHO14/GONG Workshop, New Haven, 12-16 July 2004, 164-171.</mixed-citation></ref><ref id="scirp.125127-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Akram, M. and Michel, V. (2010) Regularisation of the Helmholtz Decomposition and its Application to Geomagnetic Field Modelling. GEM—International Journal on Geomathematics, 1, 101-120. https://doi.org/10.1007/s13137-010-0001-y</mixed-citation></ref><ref id="scirp.125127-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Guo, Q., Mandal, M.K., Liu, G. and Kavanagh, K.M. (2006) Cardiac Video Analysis Using Hodge-Helmholtz Field Decomposition. Computers in Biology and Medicine, 36, 1-20. https://doi.org/10.1016/j.compbiomed.2004.06.011</mixed-citation></ref><ref id="scirp.125127-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Gao, H., Mandal, M., Guo, G. and Wan, J. (2010) Singular Point Detection Using Discrete Hodge Helmholtz Decomposition in Fingerprint Images. 2010 IEEE International Conference on Acoustics, Speech and Signal Processing, Dallas, 14-19 March 2010, 1094-1097. https://doi.org/10.1109/ICASSP.2010.5495348</mixed-citation></ref><ref id="scirp.125127-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Guo, Q., Mandal, M.K. and Li, M.Y. (2005) Efficient Hodge-Helmholtz Decomposition of Motion Fields. Pattern Recognition Letters, 26, 493-501. https://doi.org/10.1016/j.patrec.2004.08.008</mixed-citation></ref><ref id="scirp.125127-ref9"><label>9</label><mixed-citation publication-type="book" xlink:type="simple">Hinkle, J., Fletcher, P.T., Wang, B., Salter, B. and Joshi, S. (2009) 4D MAP Image Reconstruction Incorporating Organ Motion. In: Prince, J.L., Pham, D.L. and Myers, K.J., Eds., Information Processing in Medical Imaging, Springer, Heidelberg, 676-687. https://doi.org/10.1007/978-3-642-02498-6_56</mixed-citation></ref><ref id="scirp.125127-ref10"><label>10</label><mixed-citation publication-type="book" xlink:type="simple">Polthier, K. and Preu, E. (2003) Identifying Vector Fields Singularities Using a Discrete Hodge Decomposition. In: Hege, H.C. and Polthier, K., Eds., Visualization and Mathematics III, Springer, Heidelberg, 113-134. https://doi.org/10.1007/978-3-662-05105-4_6</mixed-citation></ref><ref id="scirp.125127-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Tong, Y., Lombeyda, S., Hirani, A. and Desbrun, M. (2003) Discrete Multiscale Vector Field Decomposition. ACM Transactions on Graphics, 22, 445-452. https://doi.org/10.1145/882262.882290</mixed-citation></ref><ref id="scirp.125127-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Foster, N. and Metaxas, D. (1997) Modeling the Motion of a Hot, Turbulent Gas. Proceedings of the 24th Annual Conference on Computer Graphics and Interactive Techniques, Los Angeles, 3-8 August 1997, 181-188. https://doi.org/10.1145/258734.258838</mixed-citation></ref><ref id="scirp.125127-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Ingber, M.S. and Kempka, S.N. (2001) A Galerkin Implementation of the Generalized Helmholtz Decomposition for Vorticity Formulations. Journal of Computational Physics, 169, 215-237. https://doi.org/10.1006/jcph.2001.6724</mixed-citation></ref><ref id="scirp.125127-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Deriaz, E. and Perrier, V. (2006) Divergence-Free and Curl-Free Wavelets in 2D and 3D: Application to Turbulent Flows. Journal of Turbulence, 7, 1-37. https://doi.org/10.1080/14685240500260547</mixed-citation></ref><ref id="scirp.125127-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Deriaz, E. and Perrier, V. (2008) Direct Numerical Simulation of Turbulence Using Divergence-Free Wavelets. Multiscale Modeling and Simulation, 7, 1101-1129. https://doi.org/10.1137/070701017</mixed-citation></ref><ref id="scirp.125127-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Deriaz, E. and Perrier, V. (2008) Orthogonal Helmholtz Decomposition in Arbitrary Dimension Using Divergence-Free and Curl-Free Wavelets. Applied and Computational Harmonic Analysis, 26, 249-269. https://doi.org/10.1016/j.acha.2008.06.001</mixed-citation></ref><ref id="scirp.125127-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Colin, F., Egli, R. and Lin, F. (2006) Computing a Null Divergence Velocity Field Using Smoothed Particle Hydrodynamics. Journal of Computational Physics, 217, 680-692. https://doi.org/10.1016/j.jcp.2006.01.021</mixed-citation></ref><ref id="scirp.125127-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Petronetto, F., Paiva, A., Lage, M., Tavares, G., Lopes, H. and Lewiner, T. (2010) Meshless Helmholtz-Hodge Decomposition. IEEE Transactions on Visualization and Computer Graphics, 16, 338-349. https://doi.org/10.1109/TVCG.2009.61</mixed-citation></ref><ref id="scirp.125127-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Stam, J. and Fiume, E. (1995) Depicting Fire and Other Gaseous Phenomena Using Diffusion Processes. Proceedings of the 22nd Annual Conference on Computer Graphics and Interactive Technique, Los Angeles, 6-11 August 1995, 129-136. https://doi.org/10.1145/218380.218430</mixed-citation></ref><ref id="scirp.125127-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Fuselier, E.J. (2006) Refined Error Estimates for Matrix-Valued Radial Basis Functions. Ph.D. Thesis, Texas A&amp;M University, College Station.</mixed-citation></ref><ref id="scirp.125127-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Macedo, I. and Castro, R. (2010) Learning Divergence-Free and Curl-Free Vector Fields with Matrix-Valued Kernels. Technical Report, Instituto de Matemática Pura e Aplicada, Rio de Janeiro, Brazil.</mixed-citation></ref><ref id="scirp.125127-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Narcowich, F.J. and Ward, J.D. (1994) Generalized Hermite Interpolation via Matrix-Valued Conditionally Positive Definite Functions. Mathematics of Computation, 63, 661-687. https://doi.org/10.1090/S0025-5718-1994-1254147-6</mixed-citation></ref><ref id="scirp.125127-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">López-López, J., Juárez, L.H. and Sandoval, M.L. (2016) Improving the Reconstruction of Vector Fields Using Mixed Finite Element Methods and Optimal Preconditioning. Numerical Methods for Partial Differential Equations, 32, 1137-1154. https://doi.org/10.1002/num.22044</mixed-citation></ref></ref-list></back></article>