3.22 defpol2d – Initialize polygon type¶
The defpol2d routine initializes the geometry of a polygon by selecting one of the predefined shapes shown in Fig. 3.1, based on the integer input parameter icelltype (see Table 3.3).
Fortran:
call defpol2d(icelltype,ipv,ntp,ntv,vertp)
C:
defpol2d(&icelltype,ipv,&ntp,&ntv,vertp);
Python:
(ipv,ntp,ntv,vertp)=voft.defpol2d(icelltype)
|
|
|
cell geometry index |
|
|
|
array of length |
|
|
|
maximum vertex index in the connectivity list |
|
|
|
total number of vertices |
|
|
|
array of dimensions \(({nv},2)\) storing the \(x,y\)-coordinates of each vertex |
Note: The defpol2d routine, used by the test2d program to select predefined cells, accepts icelltype values 1–6 for convex cells and 101–106 for non-convex cells. This selection does not restrict users to these geometries: user-defined polygonal cells can be supplied directly to the relevant VOFTools routines through their vertex coordinates and connectivity, subject to each routine’s requirements and the compiled array capacities. An invalid icelltype value causes defpol2d to print a diagnostic message and terminate the program through a Fortran STOP statement, including when called from C or Python.