Exemple #1
0
static void
test_reduce (p4est_connectivity_t * conn, const char *which)
{
  SC_GLOBAL_INFOF ("Testing standard connectivity %s\n", which);
  SC_CHECK_ABORTF (p4est_connectivity_is_valid (conn),
                   "Invalid connectivity %s before reduce", which);
  p4est_connectivity_reduce (conn);
  SC_CHECK_ABORTF (p4est_connectivity_is_valid (conn),
                   "Invalid connectivity %s after reduce", which);
  SC_GLOBAL_INFOF ("Testing completion for reduced connectivity %s\n", which);
  p4est_connectivity_complete (conn);
  SC_CHECK_ABORTF (p4est_connectivity_is_valid (conn),
                   "Invalid connectivity %s after completion", which);
  p4est_connectivity_destroy (conn);
}
Exemple #2
0
int
main (int argc, char **argv)
{
  int                 i, j;
  int                 t0, t1;
  size_t              bytes;
  const char         *filename = "conndebug.p8c";
  p4est_connectivity_t *conn;

  conn = p4est_connectivity_load (filename, &bytes);
  if (conn == NULL) {
    P4EST_LERRORF ("Could not read file %s\n", filename);
    return 1;
  }
  P4EST_INFOF ("Read %d bytes\n", (int) bytes);

  p4est_connectivity_complete (conn);

  for (i = 0; i < 4; ++i) {
    t0 = i + 0;
    t1 = i + 4;
    P4EST_VERBOSEF ("X face %d: %d %d\n", i, t0, t1);
    p4est_connectivity_join_faces (conn, t0, t1, 0, 1, 0);
  }
  for (i = 0; i < 2; ++i) {
    for (j = 0; j < 2; ++j) {
      t0 = 4 * i + j + 0;
      t1 = 4 * i + j + 2;
      P4EST_VERBOSEF ("Y face %d: %d %d\n", 2 * i + j, t0, t1);
      p4est_connectivity_join_faces (conn, t0, t1, 2, 3, 0);
    }
  }
  for (i = 0; i < 4; ++i) {
    t0 = 2 * i + 0;
    t1 = 2 * i + 1;
    P4EST_VERBOSEF ("Z face %d: %d %d\n", i, t0, t1);
    p4est_connectivity_join_faces (conn, t0, t1, 4, 5, 0);
  }

  p4est_connectivity_destroy (conn);

  return 0;
}
static void
test_complete (p4est_connectivity_t * conn, const char *which, int test_p4est)
{
  SC_GLOBAL_INFOF ("Testing standard connectivity %s\n", which);
  SC_CHECK_ABORTF (p4est_connectivity_is_valid (conn),
                   "Invalid connectivity %s before completion", which);
  if (0 && test_p4est) {
    test_the_p4est (conn, 3);
  }

  SC_GLOBAL_INFOF ("Testing completion for connectivity %s\n", which);
  p4est_connectivity_complete (conn);
  SC_CHECK_ABORTF (p4est_connectivity_is_valid (conn),
                   "Invalid connectivity %s after completion", which);
  if (test_p4est) {
    test_the_p4est (conn, 3);
  }

  p4est_connectivity_destroy (conn);
}