Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

GID-3108-gidpost-as-python-moduleint GiD_fWriteCoordinatesBlock( GiD_FILE fd, int num_points, GP_CONST double *xyz_array );
int GiD_fWriteCoordinatesIdBlock( GiD_FILE fd, int num_points, GP_CONST int *list_ids, GP_CONST double *xyz_array );

Description:

Write the coordinates array of the current mesh or of all meshes. These functions include GiD_fBeginCoordinates() and GiD_fEndCoordinates().

If GiD_fWriteCoordinatesBlock() is used, i.e. no list of node id’s are provided, then the node id’s are assumed to be 1..num_points .

Parameters:

list_ids is the array of node id's and expected to be num_points in size.

xyz_array is the array consecutive x, y and z coordinates of the num_points nodes, and it is expected to have num_points * 3 doubles.

Example:
C/C++ as in testpost_fd.c :

Code Block
languagecpp
    int ids[ NUM_NODES ];
    double xyz[ NUM_NODES * 3 ];
    for ( int i = 0; i < NUM_NODES; i++ ) {
      ids[ i ] = G_nodes[ i ].id;
      xyz[ i * 3 + 0 ] = G_nodes[ i ].x;
      xyz[ i * 3 + 1 ] = G_nodes[ i ].y;
      xyz[ i * 3 + 2 ] = G_nodes[ i ].z;
    }
    GiD_fWriteCoordinatesIdBlock( fdm, NUM_NODES, ids, xyz );