**3.1 LBEMA and L3ALC modules, test problems and results**

Let us start on the introduction of three-dimensional problems with the axisymmetric codes. These codes are used in a very similar manner. As with the two-dimensional problem, the component module L3ALC computes the integrals over the panels and is called as follows:

SUBROUTINE L3ALC(P,VECP,QA,QB,LPONEL,LVALID,EGEOM,LFAIL, \* NEEDL,NEEDM,NEEDMT,NEEDN,DISL,DISM,DISMT,DISN).

For axisymmetric problems, the surface is defined by conical panels, which are defined by piecewise straight lines along the generator. The parameters follow a similar pattern as L2LC, except the points and vectors are in cylindrical ð Þ *r; z* coordinates. QA and QB are the two points either side of the panel on the generator.

The LBEMA subroutine computes the solution of the Laplace equation by the direct boundary element method and has the following form:

LBEMA(MAXNODES,NNODE,NODES,MAXPANELS,NPANEL,PANELS,


In LBEMA, NODES lists the ð Þ *r; z* coordinates of the nodes on the generator of the surface, and PANELS states the two nodes that together define each panel. LINTERIOR is a logical input, which is set to TRUE if an interior problem is to be solved and FALSE for an interior problem.

The interior test problem is in file LBEMA\_IT. The test problem is the unit sphere with the exact solution:

$$
\rho = r^2 - 2x^2,\tag{25}
$$

which is easily shown to be a solution of Laplace's equation by writing *<sup>r</sup>*<sup>2</sup> <sup>¼</sup> *<sup>x</sup>*<sup>2</sup> <sup>þ</sup> *<sup>y</sup>*<sup>2</sup>*:* A Dirichlet boundary condition is applied; the solution is sought at four interior points, and the results for 18 elements are given in **Table 2**.

The exterior test problem is in file LBEMA\_ET. The test problem is the unit sphere (approximated by 18 elements) with the exact solution:

*A Pilot Fortran Software Library for the Solution of Laplace's Equation by the Boundary… DOI: http://dx.doi.org/10.5772/intechopen.86507*


**Table 2.**

*<sup>G</sup> <sup>p</sup>; <sup>q</sup>* <sup>¼</sup> <sup>1</sup>

interior problem, but for some changes of sign

*Numerical Modeling and Computer Simulation*

over the panels and is called as follows:

*<sup>M</sup>* � <sup>1</sup> 2 *I* 

surface functions approximated by a constant on each panel.

**3.1 LBEMA and L3ALC modules, test problems and results**

direct boundary element method and has the following form:

\* LINTERIOR,MAXPOINTS,NPOINT,POINTS,

\* SALPHA,SBETA,SF,SINPHI,PINPHI,

\* L\_SS,M\_SSPMHALFI,L\_PS,M\_PS, \* PERM,XORY,C,workspace)

\* LSOL,LVALID,TOLGEOM,

solved and FALSE for an interior problem.

sphere with the exact solution:

**10**

\* SPHI,SVEL,PPHI,

*φ*

*S*

Let us start on the introduction of three-dimensional problems with the axisymmetric codes. These codes are used in a very similar manner. As with the two-dimensional problem, the component module L3ALC computes the integrals

SUBROUTINE L3ALC(P,VECP,QA,QB,LPONEL,LVALID,EGEOM,LFAIL, \* NEEDL,NEEDM,NEEDMT,NEEDN,DISL,DISM,DISMT,DISN).

LBEMA(MAXNODES,NNODE,NODES,MAXPANELS,NPANEL,PANELS,

In LBEMA, NODES lists the ð Þ *r; z* coordinates of the nodes on the generator of the surface, and PANELS states the two nodes that together define each panel. LINTERIOR is a logical input, which is set to TRUE if an interior problem is to be

The interior test problem is in file LBEMA\_IT. The test problem is the unit

<sup>2</sup> � <sup>2</sup>*z*<sup>2</sup>

*<sup>r</sup>*<sup>2</sup> <sup>¼</sup> *<sup>x</sup>*<sup>2</sup> <sup>þ</sup> *<sup>y</sup>*<sup>2</sup>*:* A Dirichlet boundary condition is applied; the solution is sought at four

The exterior test problem is in file LBEMA\_ET. The test problem is the unit

*,* (25)

*φ* ¼ *r*

which is easily shown to be a solution of Laplace's equation by writing

interior points, and the results for 18 elements are given in **Table 2**.

sphere (approximated by 18 elements) with the exact solution:

For axisymmetric problems, the surface is defined by conical panels, which are defined by piecewise straight lines along the generator. The parameters follow a similar pattern as L2LC, except the points and vectors are in cylindrical ð Þ *r; z* coordinates. QA and QB are the two points either side of the panel on the generator. The LBEMA subroutine computes the solution of the Laplace equation by the

For general three-dimensional problems, the simplest elements are triangular panels, and for axisymmetric problems, they are lateral sections of a cone, with

4*πr*

where *r* is the distance between points *p* and *q* and the integrals are over surfaces rather than lines. The equations for the exterior problem are the same as for the

*,* (22)

ð Þ¼ *p* f g *Lv <sup>S</sup>*ð Þ *p* ð Þ *p*∈*S ,* (23)

*φ*ð Þ¼ *p* f g *Mφ <sup>S</sup>* � f g *Lv <sup>S</sup>*ð Þ *p*∈ *E :* (24)

*The results from the axisymmetric interior problem.*


#### **Table 3.**

*The results from the axisymmetric exterior problem.*

$$\mathbf{q} = \frac{\mathbf{1}}{\mathbf{r}},\tag{26}$$

where *r* is the distance from the origin. *φ* is a solution of Laplace's equation as it is a simple multiplication of Green's function (22). A Dirichlet boundary condition is applied to the upper hemisphere, and a Neumann boundary condition is applied on the lower hemisphere. The solution is sought at four interior points, and the results are given in **Table 3**.
