NAG FL Interface
d06daf (dim2_​transform_​affine)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

d06daf is a utility which performs an affine transformation of a given mesh.

2 Specification

Fortran Interface
Subroutine d06daf ( nv, nedge, nelt, ntrans, itype, trans, coori, edgei, conni, cooro, edgeo, conno, itrace, rwork, lrwork, ifail)
Integer, Intent (In) :: nv, nedge, nelt, ntrans, itype(ntrans), itrace, lrwork
Integer, Intent (Inout) :: edgei(3,nedge), conni(3,nelt), ifail
Integer, Intent (Out) :: edgeo(3,nedge), conno(3,nelt)
Real (Kind=nag_wp), Intent (In) :: trans(6,ntrans)
Real (Kind=nag_wp), Intent (Inout) :: coori(2,nv)
Real (Kind=nag_wp), Intent (Out) :: cooro(2,nv), rwork(lrwork)
C Header Interface
#include <nag.h>
void  d06daf_ (const Integer *nv, const Integer *nedge, const Integer *nelt, const Integer *ntrans, const Integer itype[], const double trans[], double coori[], Integer edgei[], Integer conni[], double cooro[], Integer edgeo[], Integer conno[], const Integer *itrace, double rwork[], const Integer *lrwork, Integer *ifail)
The routine may be called by the names d06daf or nagf_mesh_dim2_transform_affine.

3 Description

d06daf generates a mesh (coordinates, triangle/vertex connectivities and edge/vertex connectivities) resulting from an affine transformation of a given mesh. This transformation is of the form Y=A×X+B, where
Such a transformation includes a translation, a rotation, a scale reduction or increase, a symmetric transformation with respect to a user-supplied line, a user-supplied analytic transformation, or a composition of several transformations.
This routine is partly derived from material in the MODULEF package from INRIA (Institut National de Recherche en Informatique et Automatique).

4 References

None.

5 Arguments

1: nv Integer Input
On entry: the total number of vertices in the input mesh.
Constraint: nv3.
2: nedge Integer Input
On entry: the number of the boundary or interface edges in the input mesh.
Constraint: nedge1.
3: nelt Integer Input
On entry: the number of triangles in the input mesh.
Constraint: nelt2×nv-1.
4: ntrans Integer Input
On entry: the number of transformations of the input mesh.
Constraint: ntrans1.
5: itype(ntrans) Integer array Input
On entry: itype(i), for i=1,2,,ntrans, indicates the type of each transformation as follows:
itype(i)=0
Identity transformation.
itype(i)=1
Translation.
itype(i)=2
Symmetric transformation with respect to a user-supplied line.
itype(i)=3
Rotation.
itype(i)=4
Scaling.
itype(i)=10
User-supplied analytic transformation.
Note that the transformations are applied in the order described in itype.
Constraint: itype(i)=0, 1, 2, 3, 4 or 10, for i=1,2,,ntrans.
6: trans(6,ntrans) Real (Kind=nag_wp) array Input
On entry: the arguments for each transformation. For i=1,2,,ntrans, trans(1,i) to trans(6,i) contain the arguments of the ith transformation.
If itype(i)=0, elements trans(1,i) to trans(6,i) are not referenced.
If itype(i)=1, the translation vector is u= ( a b ) , where a=trans(1,i) and b=trans(2,i), while elements trans(3,i) to trans(6,i) are not referenced.
If itype(i)=2, the user-supplied line is the curve {(x,y)2; such that ax+by+c=0}, where a=trans(1,i), b=trans(2,i) and c=trans(3,i), while elements trans(4,i) to trans(6,i) are not referenced.
If itype(i)=3, the centre of the rotation is (x0,y0) where x0=trans(1,i) and y0=trans(2,i), θ=trans(3,i) is its angle in degrees, while elements trans(4,i) to trans(6,i) are not referenced.
If itype(i)=4, a=trans(1,i) is the scaling coefficient in the x-direction, b=trans(2,i) is the scaling coefficient in the y-direction, and (x0,y0) are the scaling centre coordinates, with x0=trans(3,i) and y0=trans(4,i); while elements trans(5,i) to trans(6,i) are not referenced.
If itype(i)=10, the user-supplied analytic affine transformation Y=A×X+B is such that A=(akl)1k,l2 and B=(bk)1k2 whereakl=trans(2×(k-1)+l,i), and bk=trans(4+k,i) with k,l=1,2.
7: coori(2,nv) Real (Kind=nag_wp) array Input/Output
On entry: coori(1,i) contains the x coordinate of the ith vertex of the input mesh, for i=1,2,,nv; while coori(2,i) contains the corresponding y coordinate.
On exit: see Section 9.
8: edgei(3,nedge) Integer array Input/Output
On entry: the specification of the boundary or interface edges. edgei(1,j) and edgei(2,j) contain the vertex numbers of the two end points of the jth boundary edge. edgei(3,j) is a user-supplied tag for the jth boundary edge.
Constraint: 1edgei(i,j)nv and edgei(1,j)edgei(2,j), for i=1,2 and j=1,2,,nedge.
On exit: see Section 9.
9: conni(3,nelt) Integer array Input/Output
On entry: the connectivity of the input mesh between triangles and vertices. For each triangle j, conni(i,j) gives the indices of its three vertices (in anticlockwise order), for i=1,2,3 and j=1,2,,nelt.
Constraints:
  • 1conni(i,j)nv;
  • conni(1,j)conni(2,j);
  • conni(1,j)conni(3,j) and conni(2,j)conni(3,j), for i=1,2,3 and j=1,2,,nelt.
On exit: see Section 9.
10: cooro(2,nv) Real (Kind=nag_wp) array Output
On exit: cooro(1,i) will contain the x coordinate of the ith vertex of the transformed mesh, for i=1,2,,nv; while cooro(2,i) will contain the corresponding y coordinate.
11: edgeo(3,nedge) Integer array Output
On exit: the specification of the boundary or interface edges of the transformed mesh. If the number of symmetric transformations is even or zero thenedgeo(i,j)=edgei(i,j), for i=1,2,3 and j=1,2,,nedge; otherwise edgeo(1,j)=edgei(2,j),edgeo(2,j)=edgei(1,j) and edgeo(3,j)=edgei(3,j), for j=1,2,,nedge.
12: conno(3,nelt) Integer array Output
On exit: the connectivity of the transformed mesh between triangles and vertices. If the number of symmetric transformations is even or zero thenconno(i,j)=conni(i,j), for i=1,2,3 and j=1,2,,nelt; otherwise conno(1,j)=conni(1,j), conno(2,j)=conni(3,j) and conno(3,j)=conni(2,j), for j=1,2,,nelt.
13: itrace Integer Input
On entry: the level of trace information required from d06daf.
itrace0
No output is generated.
itrace1
Details of each transformation, the matrix A and the vector B of the final transformation, which is the composition of all the ntrans transformations, are printed on the current advisory message unit (see x04abf).
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 d06daf is called.
Constraint: lrwork12×ntrans.
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, conni(I,J)=value, I=value, J=value and nv=value.
Constraint: conni(I,J)1 and conni(I,J)nv.
On entry, edgei(I,J)=value, I=value, J=value and nv=value.
Constraint: edgei(I,J)1 and edgei(I,J)nv.
On entry, itype(I)=value and I=value.
Constraint: itype(I)=0, 1, 2, 3, 4 or 10.
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, ntrans=value.
Constraint: ntrans>0.
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.
ifail=2
A serious error has occurred in an internal call to an auxiliary routine. Check the input mesh especially the connectivities and the details of each transformations.
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

d06daf is not threaded in any implementation.

9 Further Comments

You may not wish to save the input mesh (coori, edgei and conni) and could call d06daf using the same arguments for the input and the output (transformed) mesh.

10 Example

For an example of the use of this utility routine, see d06dbf.