# BETIS Boundary Element Method for Laplace's Equation

BETIS is a FORTRAN77 program which applies the boundary element method to solve Laplace's equation in a 2D region, by Federico Paris and Jose Canas.

The program uses linear continuous elements and Dirichlet, Neumann as well as mixed boundary conditions can be taken into consideration.

### Input File Format:

The input to the program involves a file containing five sets of data:

1. The title line (a character string)
2. The parameter line, listing NP, NPI and NANU:
• NP is the number of elements used to discretize the boundary; This value must be positive.
• NPI is the number of internal points where the potential will be computed; NPI can be zero if no information about interior points is desired.
• NANU is the index of the point whose potential will be forced to be 0. This value is only required in the case where the boundary conditions are given entirely as Neumann conditions;
3. The coordinates of internal points; For each of the NPI internal points, there must be a record specifying XINT(I) and YINT(I):
• XINT(I) is the X coordinate of the I-th internal point;
• YINT(I) is the Y coordinate of the I-th internal point;
4. The coordinates of boundary points; The boundary points are indexed from 1 to NP+1, and are assumed to be given in counterclockwise order; Logically, the boundary point information is given consecutively; however, if one or more points are omitted, their values will be determined by linear interpolation from the preceding and succeeding values that are given. Thus, the very least input would specify points 1 and NP+1; the fullest information would specify all NP+1 points. Most input would omit points that are interior to an equally spaced line.
• I, the index of the boundary point.
• X(I) is the X coordinate of the I-th boundary point;
• Y(I) is the Y coordinate of the I-th boundary point;
5. The boundary conditions, specifying the boundary node index, the boundary code, and the values of the potential, and the "before" and "after" fluxes at the node. A typical boundary condition will only specify the potential or the flux; the values not specified can be given as 0. A boundary condition must be given for every boundary node. Logically, the boundary nodes are input in order; however boundary nodes may be omitted, in which case the data will be linearly interpolated; however, the preceding and succeeding boundary conditions must have the same value of NCOD for this to be done.
• I, the index of the boundary point.
• NCOD(I) is the boundary condition code for boundary node I; these codes are between 1 and 5.
• FI(I) is the prescribed potential at node I for codes 2, 3, 4 or 5; for code 1 it is not specified, so may be listed as 0.0;
• DFI(I,1) is the prescribed "before" flux at node I for codes 1 or 3; for codes 2, 4 and 5 it is not specified, so may be listed as 0.0;
• DFI(I,2) is the prescribed "after" flux at node I for codes 1 or 2; for codes 3, 4, and 5 it is not specified, so may be listed as 0.0;

Note that if the boundary condition code NCOD(I) is 4, then the unknown value of DFI(I,2) is assumed to be associated with a node at a corner; if the boundary condition is 5, then the value of DFI(I,2) is assumed to be associated with a node in a "continuous" boundary.

### Usage:

``` betis ```
The user will be prompted for
• namedat, the name of the input file;
• namesal, the name of the output file; (note that the program will terminate if there is already a file named namesal). The program will not overwrite an output file, so it is the user's responsibility to delete an old, unwanted file of the same name.
• igauss, the number of points to use in the Gauss quadrature rule. a value of 4 is often sufficient. This value must be between 1 and 50.

### Related Data and Programs:

FEM_50, a MATLAB program which solves Laplace's equation in an arbitrary region using the finite element method.

FEM2D_POISSON, a FORTRAN90 program which solves Poisson's equation in an arbitrary triangulated region using the finite element method.

FEM2D_POISSON_RECTANGLE, a FORTRAN77 program which solves Poisson's equation in a 2D rectangle using the finite element method.

FISHPACK, a FORTRAN77 library which solves Poisson, Laplace or Helmholtz equations in a variety of 2D and 3D geometries, using the finite difference method.

SERBA, a FORTRAN77 program which solves problems in planar elasticity using the boundary element method.

### Author:

Federico Paris and Jose Canas,
Department of Elasticity and Strength of Materials,
Industrial Engineering School,
University of Seville, Spain.

### Reference:

1. Federico Paris, Jose Canas,
Boundary Element Method: Fundamentals and Applications,
Oxford, 1997,
ISBN: 0-19-856543-7,
LC: TA347.B69.P34.

### Examples and Tests:

Example 1 is a heat conduction problem in a square with mixed boundary conditions, using 12 elements:

Example 2 is a heat conduction problem in a square with mixed boundary conditions, using 4 elements:

Example 3 is a heat conduction problem in a square with Neumann boundary conditions, using 12 elements:

Example 4 is a heat conduction problem in a square with Dirichlet boundary conditions, using 12 elements:

Example 5 is a torsion problem in a region bounded by two circular arcs, using 20 elements, and applies boundary conditions on the discretized boundary:

Example 6 is a torsion problem in a region bounded by two circular arcs, using 20 elements, and applies boundary conditions on the original boundary:

Example 7 is a torsion problem in a region bounded by two circular arcs, which takes advantage of the symmetry of the region and only treats half of it, using 10 elements, and applies boundary conditions on the discretized boundary:

### List of Routines:

• MAIN is the main program for the BETIS boundary element code.
• HGNUM calculates integrals when the point is not in the element.
• HGANA calculates integrals along elements adjacent to the node.
• PIVO applies Gauss elimination to solve the linear system.
• GAUSS_QN determines a Gauss quadrature rule.
• COEFIC sets the coefficients of a polynomial needed for the Gauss rule.
• EVALUA evaluates the polynomial defining the Gauss rule.
• ROOTS seeks roots of the polynomial defining the Gauss rule.

You can go up one level to the FORTRAN77 source codes.

Last revised on 15 December 2007.