Debian Codegraph @

dune/uggrid/gm/GenerateRules.h

raw
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LGPL-2.1-or-later
5 /*! \file GenerateRules.h
6 * \ingroup gm
7 */
8
9 /****************************************************************************/
10 /* */
11 /* File: GenerateRules.h */
12 /* */
13 /* Purpose: header file for GenerateRules.c */
14 /* */
15 /* Author: Henrik Reichert */
16 /* Institut fuer Angewandte Mathematik */
17 /* Universitaet Heidelberg */
18 /* Im Neuenheimer Feld 294 */
19 /* 6900 Heidelberg */
20 /* */
21 /* History: 10.9.1993 begin */
22 /* */
23 /****************************************************************************/
24
25
26 /****************************************************************************/
27 /* */
28 /* auto include mechanism and other include files */
29 /* */
30 /****************************************************************************/
31
32 #ifndef __RULEGEN__
33 #define __RULEGEN__
34
35 #include <cstdio>
36
37 /****************************************************************************/
38 /* */
39 /* defines in the following order */
40 /* */
41 /* compile time constants defining static data size (i.e. arrays) */
42 /* other constants */
43 /* macros */
44 /* */
45 /****************************************************************************/
46
47 /* macros for referencing of sons */
48 /* 4 high bits for no of neighbours to be passed */
49 #define PATHDEPTHMASK 0xF0000000
50 #define PATHDEPTHSHIFT 28
51 #define PATHDEPTH(i) (((i) & PATHDEPTHMASK)>>PATHDEPTHSHIFT)
52 #define SETPATHDEPTH(i,val) (i) = ((i)&(~PATHDEPTHMASK))|(((val)<<PATHDEPTHSHIFT)&PATHDEPTHMASK)
53
54 /* 2 bits at position n for element side */
55 #define NEXTSIDEMASK 0x00000003
56 #define NEXTSIDE(i,n) (((i) & (NEXTSIDEMASK<<(2*(n))))>>(2*(n)))
57 #define SETNEXTSIDE(i,n,val) (i) = ((i)&(~(NEXTSIDEMASK<<(2*(n)))))|(((val)&NEXTSIDEMASK)<<(2*(n)))
58
59
60 /****************************************************************************/
61 /* */
62 /* data structures exported by the corresponding source file */
63 /* */
64 /****************************************************************************/
65
66 /****************************************************************************/
67 /* */
68 /* definition of exported global variables */
69 /* */
70 /****************************************************************************/
71
72 /****************************************************************************/
73 /* */
74 /* function declarations */
75 /* */
76 /****************************************************************************/
77
78
79 #endif