File: periodicity3.c

package info (click to toggle)
p4est 2.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,536 kB
  • sloc: ansic: 87,528; makefile: 855; sh: 635; perl: 272; python: 226; awk: 40; javascript: 23
file content (73 lines) | stat: -rw-r--r-- 2,215 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
  This file is part of p4est.
  p4est is a C library to manage a collection (a forest) of multiple
  connected adaptive quadtrees or octrees in parallel.

  Copyright (C) 2010 The University of Texas System
  Additional copyright (C) 2011 individual authors
  Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac

  p4est is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  p4est is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with p4est; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#include <p4est_to_p8est.h>
#ifdef P4_TO_P8
#include <p8est_connectivity.h>

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;
}

#endif /* P4_TO_P8 */