NAG FL Interface
d06ccf (dim2_​renumber)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

d06ccf renumbers the vertices of a given mesh using a Gibbs method, in order the reduce the bandwidth of Finite Element matrices associated with that mesh.

2 Specification

Fortran Interface
Subroutine d06ccf ( nv, nelt, nedge, nnzmax, nnz, coor, edge, conn, irow, icol, itrace, iwork, liwork, rwork, lrwork, ifail)
Integer, Intent (In) :: nv, nelt, nedge, nnzmax, itrace, liwork, lrwork
Integer, Intent (Inout) :: edge(3,nedge), conn(3,nelt), ifail
Integer, Intent (Out) :: nnz, irow(nnzmax), icol(nnzmax), iwork(liwork)
Real (Kind=nag_wp), Intent (Inout) :: coor(2,nv)
Real (Kind=nag_wp), Intent (Out) :: rwork(lrwork)
C Header Interface
#include <nag.h>
void  d06ccf_ (const Integer *nv, const Integer *nelt, const Integer *nedge, const Integer *nnzmax, Integer *nnz, double coor[], Integer edge[], Integer conn[], Integer irow[], Integer icol[], const Integer *itrace, Integer iwork[], const Integer *liwork, double rwork[], const Integer *lrwork, Integer *ifail)
The routine may be called by the names d06ccf or nagf_mesh_dim2_renumber.

3 Description

d06ccf uses a Gibbs method to renumber the vertices of a given mesh in order to reduce the bandwidth of the associated finite element matrix A. This matrix has elements aij such that:
aij0i​ and ​j​ are vertices belonging to the same triangle.  
This routine reduces the bandwidth m, which is the smallest integer such that aij0 whenever |i-j|>m (see Gibbs et al. (1976) for details about that method). d06ccf also returns the sparsity structure of the matrix associated with the renumbered mesh.
This routine is derived from material in the MODULEF package from INRIA (Institut National de Recherche en Informatique et Automatique).

4 References

Gibbs N E, Poole W G Jr and Stockmeyer P K (1976) An algorithm for reducing the bandwidth and profile of a sparse matrix SIAM J. Numer. Anal. 13 236–250

5 Arguments

1: nv Integer Input
On entry: the total number of vertices in the input mesh.
Constraint: nv3.
2: nelt Integer Input
On entry: the number of triangles in the input mesh.
Constraint: nelt2×nv-1.
3: nedge Integer Input
On entry: the number of boundary edges in the input mesh.
Constraint: nedge1.
4: nnzmax Integer Input
On entry: the maximum number of nonzero entries in the matrix based on the input mesh. It is the dimension of the arrays irow and icol as declared in the subroutine from which d06ccf is called.
Constraint: 4×nelt+nvnnzmaxnv2.
5: nnz Integer Output
On exit: the number of nonzero entries in the matrix based on the input mesh.
6: coor(2,nv) Real (Kind=nag_wp) array Input/Output
On entry: coor(1,i) contains the x coordinate of the ith input mesh vertex, for i=1,2,,nv; while coor(2,i) contains the corresponding y coordinate.
On exit: coor(1,i) will contain the x coordinate of the ith renumbered mesh vertex, for i=1,2,,nv; while coor(2,i) will contain the corresponding y coordinate.
7: edge(3,nedge) Integer array Input/Output
On entry: the specification of the boundary or interface edges. edge(1,j) and edge(2,j) contain the vertex numbers of the two end points of the jth boundary edge. edge(3,j) is a user-supplied tag for the jth boundary or interface edge: edge(3,j)=0 for an interior edge and has a nonzero tag otherwise.
Constraint: 1edge(i,j)nv and edge(1,j)edge(2,j), for i=1,2 and j=1,2,,nedge.
On exit: the renumbered specification of the boundary or interface edges.
8: conn(3,nelt) Integer array Input/Output
On entry: the connectivity of the mesh between triangles and vertices. For each triangle j, conn(i,j) gives the indices of its three vertices (in anticlockwise order), for i=1,2,3 and j=1,2,,nelt.
Constraint: 1conn(i,j)nv and conn(1,j)conn(2,j) and conn(1,j)conn(3,j) and conn(2,j)conn(3,j), for i=1,2,3 and j=1,2,,nelt.
On exit: the renumbered connectivity of the mesh between triangles and vertices.
9: irow(nnzmax) Integer array Output
10: icol(nnzmax) Integer array Output
On exit: the first nnz elements contain the row and column indices of the nonzero elements supplied in the finite element matrix A.
11: itrace Integer Input
On entry: the level of trace information required from d06ccf.
itrace0
No output is generated.
itrace=1
Information about the effect of the renumbering on the finite element matrix are output. This information includes the half bandwidth and the sparsity structure of this matrix before and after renumbering.
itrace>1
The output is similar to that produced when itrace=1 but the sparsities (for each row of the matrix, indices of nonzero entries) of the matrix before and after renumbering are also output.
12: iwork(liwork) Integer array Workspace
13: liwork Integer Input
On entry: the dimension of the array iwork as declared in the (sub)program from which d06ccf is called.
Constraint: liworkmax(nnzmax,20×nv).
14: rwork(lrwork) Real (Kind=nag_wp) array Workspace
15: lrwork Integer Input
On entry: the dimension of the array rwork as declared in the (sub)program from which d06ccf is called.
Constraint: lrworknv.
16: ifail Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or −1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, conn(I,J)=value, I=value, J=value and nv=value.
Constraint: conn(I,J)1 and conn(I,J)nv.
On entry, edge(I,J)=value, I=value, J=value and nv=value.
Constraint: edge(I,J)1 and edge(I,J)nv.
On entry, liwork=value and LIWKMN=value.
Constraint: liworkLIWKMN.
On entry, lrwork=value and LRWKMN=value.
Constraint: lrworkLRWKMN.
On entry, nedge=value.
Constraint: nedge1.
On entry, nelt=value and nv=value.
Constraint: nelt2×nv-1.
On entry, nnzmax=value, nelt=value and nv=value.
Constraint: nnzmax(4×nelt+nv) and nnzmaxnv2.
On entry, nv=value.
Constraint: nv3.
On entry, the end points of the edge J have the same index I: J=value and I=value.
On entry, vertices 1 and 2 of the triangle K have the same index I: K=value and I=value.
On entry, vertices 1 and 3 of the triangle K have the same index I: K=value and I=value.
On entry, vertices 2 and 3 of the triangle K have the same index I: K=value and I=value.
On the computation of the compact sparsity of the finite element matrix, an error has occurred. liwork has at least to be greater than value.
ifail=2
An error has occurred during the computation of the compact sparsity of the finite element matrix. Check the Triangle/Vertices connectivity.
ifail=3
A serious error has occurred in an internal call to the renumbering routine. Check the input mesh especially the connectivity. Seek expert help.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

d06ccf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

None.

10 Example

In this example, a geometry with two holes (two interior circles inside an exterior one) is considered. The geometry has been meshed using the simple incremental method (d06aaf) and it has 250 vertices and 402 triangles (see Figure 1 in Section 10.3). The routine d06baf is used to renumber the vertices, and one can see the benefit in terms of the sparsity of the finite element matrix based on the renumbered mesh (see Figure 2 and 3 in Section 10.3).

10.1 Program Text

Program Text (d06ccfe.f90)

10.2 Program Data

None.

10.3 Program Results

Program Results (d06ccfe.r)
GnuplotProduced by GNUPLOT 4.6 patchlevel 3 Example Program Figure 1: Mesh of the Geometry gnuplot_plot_1
GnuplotProduced by GNUPLOT 4.6 patchlevel 3 Figure 2: Sparsity of the FE Matrix Before Renumbering gnuplot_plot_1
GnuplotProduced by GNUPLOT 4.6 patchlevel 3 Figure 3: Sparsity of the FE Matrix After Renumbering gnuplot_plot_1