================ Why Use PyTAPS ================ Programmers already familiar with using the ITAPS interfaces in C or Fortran may be wondering why they should use PyTAPS instead. Well, for the same reason that one would want to use Python for any kind of scientific computing: it's easier! An Example ========== For a motivating example, let's consider an extremely simple program. We want to load in a VTK mesh containing several quadrilateral faces, and then print out the coordinates of each point on each quad, like so:: 0.0, 0.0, 0.0 0.0, 1.0, 0.0 1.0, 1.0, 0.0 1.0, 0.0, 0.0 0.0, 0.0, 1.0 0.0, 1.0, 1.0 1.0, 1.0, 1.0 1.0, 0.0, 1.0 0.0, 0.0, 2.0 0.0, 1.0, 2.0 1.0, 1.0, 2.0 1.0, 0.0, 2.0 C Version --------- We'll start by writing this in C, using iMesh. .. code-block:: c #include #include #include #include void handleError(iMesh_Instance mesh) { int err; char error[120]; iMesh_getDescription(mesh, error, &err, sizeof(error)); printf("Error: %s\n", error); exit(1); } int main() { iMesh_Instance mesh; int err; iMesh_newMesh("", &mesh, &err, 0); if(err != 0) handleError(mesh); iMesh_load(mesh, NULL, "mesh.vtk", "", &err, 8, 0); if(err != 0) handleError(mesh); iBase_EntityHandle *faces = NULL; int faces_allocated = 0; int faces_size; iMesh_getEntities(mesh, NULL, iBase_FACE, iMesh_ALL_TOPOLOGIES, &faces, &faces_allocated, &faces_size, &err); if(err != 0) handleError(mesh); iBase_EntityHandle *adj_ents = NULL; int adj_allocated = 0; int adj_size; int *offsets = NULL; int offsets_allocated = 0; int offsets_size; iMesh_getEntArrAdj(mesh, faces, faces_size, iBase_VERTEX, &adj_ents, &adj_allocated, &adj_size, &offsets, &offsets_allocated, &offsets_size, &err); if(err != 0) handleError(mesh); int i,j; for(i=0; i