/usr/include/ug/refine.h is in libdune-uggrid-dev 2.5.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
/*! \file refine.h
* \ingroup gm
*/
/****************************************************************************/
/* */
/* File: refine.h */
/* */
/* Purpose: definitions for two AND three dimensional refinement */
/* */
/* Author: Peter Bastian */
/* Interdisziplinaeres Zentrum fuer Wissenschaftliches Rechnen */
/* Universitaet Heidelberg */
/* Im Neuenheimer Feld 368 */
/* 6900 Heidelberg */
/* internet: bastian@iwr1.iwr.uni-heidelberg.de */
/* */
/* History: 09.03.92 begin, ug version 2.0 */
/* */
/* Remarks: */
/* */
/****************************************************************************/
/****************************************************************************/
/* */
/* auto include mechanism and other include files */
/* */
/****************************************************************************/
#ifndef __REFINE__
#define __REFINE__
#include "ugtypes.h"
#include "gm.h"
#include "algebra.h" /* just for ALGEBRA_N_CE */
#include "namespace.h"
START_UGDIM_NAMESPACE
/****************************************************************************/
/* */
/* defines in the following order */
/* */
/* compile time constants defining static data size (i.e. arrays) */
/* other constants */
/* macros */
/* */
/****************************************************************************/
#define NOTUSED -1 /* SHORT has to be signed! */
#define NO_CENTER_NODE NOTUSED
#ifdef ModelP
/* undefine if all son objects shall be identified */
#define IDENT_ONLY_NEW
#endif
/* define this if you want to apply anistropic rules */
/* #define __ANISOTROPIC__ */
/****************************************************************************/
/* */
/* control word definitions */
/* */
/****************************************************************************/
enum REFINE_CE {
PATTERN_CE = ALGEBRA_N_CE, /* continue after algebra.h entries */
ADDPATTERN_CE,
REFINE_CE,
MARK_CE,
COARSEN_CE,
DECOUPLED_CE,
REFINECLASS_CE,
UPDATE_GREEN_CE,
SIDEPATTERN_CE,
MARKCLASS_CE,
REFINE_N_CE
};
/* edges */
#define PATTERN_SHIFT 10
#define PATTERN_LEN 1
#define PATTERN(p) CW_READ(p,PATTERN_CE)
#define SETPATTERN(p,n) CW_WRITE(p,PATTERN_CE,n)
#define ADDPATTERN_SHIFT 11
#define ADDPATTERN_LEN 1
#define ADDPATTERN(p) CW_READ(p,ADDPATTERN_CE)
#define SETADDPATTERN(p,n) CW_WRITE(p,ADDPATTERN_CE,n)
/* element */
#define REFINE_SHIFT 0
#define REFINE_LEN 8
#define REFINE(p) CW_READ(p,REFINE_CE)
#define SETREFINE(p,n) CW_WRITE(p,REFINE_CE,n)
#define MARK_SHIFT 0
#define MARK_LEN 8
#define MARK(p) CW_READ(p,MARK_CE)
#define SETMARK(p,n) CW_WRITE(p,MARK_CE,n)
#define COARSEN_SHIFT 10
#define COARSEN_LEN 1
#define COARSEN(p) CW_READ(p,COARSEN_CE)
#define SETCOARSEN(p,n) CW_WRITE(p,COARSEN_CE,n)
#define DECOUPLED_SHIFT 12
#define DECOUPLED_LEN 1
#define DECOUPLED(p) CW_READ(p,DECOUPLED_CE)
#define SETDECOUPLED(p,n) CW_WRITE(p,DECOUPLED_SHIFT,n)
#define REFINECLASS_SHIFT 15
#define REFINECLASS_LEN 2
#define REFINECLASS(p) CW_READ(p,REFINECLASS_CE)
#define SETREFINECLASS(p,n) CW_WRITE(p,REFINECLASS_CE,n)
#define UPDATE_GREEN_SHIFT 8
#define UPDATE_GREEN_LEN 1
#define UPDATE_GREEN(p) CW_READ(p,UPDATE_GREEN_CE)
#define SETUPDATE_GREEN(p,n) CW_WRITE(p,UPDATE_GREEN_CE,n)
#define SIDEPATTERN_SHIFT 0
#define SIDEPATTERN_LEN 6
#define SIDEPATTERN(p) CW_READ(p,SIDEPATTERN_CE)
#define SETSIDEPATTERN(p,n) CW_WRITE(p,SIDEPATTERN_CE,n)
#define MARKCLASS_SHIFT 13
#define MARKCLASS_LEN 2
#define MARKCLASS(p) CW_READ(p,MARKCLASS_CE)
#define SETMARKCLASS(p,n) CW_WRITE(p,MARKCLASS_CE,n)
#ifdef ModelP
#define NEW_NIDENT_LEN 2
#define NEW_NIDENT(p) CW_READ(p,ce_NEW_NIDENT)
#define SETNEW_NIDENT(p,n) CW_WRITE(p,ce_NEW_NIDENT,n)
#define NEW_EDIDENT_LEN 2
#define NEW_EDIDENT(p) CW_READ(p,ce_NEW_EDIDENT)
#define SETNEW_EDIDENT(p,n) CW_WRITE(p,ce_NEW_EDIDENT,n)
#endif
/* macros for refineinfo */
#define RINFO_MAX 100
#define REFINEINFO(mg) refine_info
#define REFINESTEP(r) (r).step
#define SETREFINESTEP(r,s) (r).step = ((s)%RINFO_MAX)
#define MARKCOUNT(r) (r).markcount[(r).step]
#define SETMARKCOUNT(r,n) (r).markcount[(r).step] = (n)
#define PREDNEW0(r) (r).predicted_new[(r).step][0]
#define SETPREDNEW0(r,n) (r).predicted_new[(r).step][0] = (n)
#define PREDNEW1(r) (r).predicted_new[(r).step][1]
#define SETPREDNEW1(r,n) (r).predicted_new[(r).step][1] = (n)
#define PREDNEW2(r) (r).predicted_new[(r).step][2]
#define SETPREDNEW2(r,n) (r).predicted_new[(r).step][2] = (n)
#define REAL(r) (r).real[(r).step]
#define SETREAL(r,n) (r).real[(r).step] = (n)
#define PREDMAX(r) (r).predicted_max[(r).step]
#define SETPREDMAX(r,n) (r).predicted_max[(r).step] = (n)
/* macros for listing */
#define REFINE_ELEMENT_LIST(d,e,s) \
IFDEBUG(gm,d) \
if (e!=NULL) \
UserWriteF( s " ID=%d/%08x PRIO=%d TAG=%d BE=%d ECLASS=%d LEVEL=%d" \
" REFINECLASS=%d MARKCLASS=%d REFINE=%d MARK=%d COARSE=%d" \
" USED=%d NSONS=%d EFATHERID=%d SIDEPATTERN=%d\n", \
ID(e),EGID(e),EPRIO(e),TAG(e),(OBJT(e)==BEOBJ),ECLASS(e),LEVEL(e), \
REFINECLASS(e),MARKCLASS(e),REFINE(e),MARK(e),COARSEN(e), \
USED(e),NSONS(e),(EFATHER(e)!=NULL) ? ID(EFATHER(e)) : 0,SIDEPATTERN(e));\
ENDDEBUG
#define REFINE_GRID_LIST(d,mg,k,s1,s2) \
IFDEBUG(gm,d) \
{ \
GRID *grid = GRID_ON_LEVEL(mg,k); \
ELEMENT *theElement; \
\
UserWriteF s1 ; \
for (theElement=PFIRSTELEMENT(grid); \
theElement!=NULL; \
theElement=SUCCE(theElement)) \
{ \
REFINE_ELEMENT_LIST(d,theElement,s2) \
} \
} \
ENDDEBUG
#define REFINE_MULTIGRID_LIST(d,mg,s1,s2,s3) \
IFDEBUG(gm,d) \
{ \
INT k; \
\
UserWriteF( s1 ); \
for (k=0; k<=TOPLEVEL(mg); k++) \
{ \
GRID *grid = GRID_ON_LEVEL(mg,k); \
ELEMENT *theElement; \
\
UserWriteF( s2 ); \
for (theElement=PFIRSTELEMENT(grid); \
theElement!=NULL; \
theElement=SUCCE(theElement)) \
{ \
REFINE_ELEMENT_LIST(d,theElement,s3) \
} \
} \
} \
ENDDEBUG
/****************************************************************************/
/* */
/* typedefs */
/* */
/****************************************************************************/
typedef struct refineinfo
{
INT step; /* count of calls to AdaptMultiGrid */
float markcount[RINFO_MAX]; /* count of currently marked elements */
float predicted_new[RINFO_MAX][3];
/* count of elements, would be created */
float real[RINFO_MAX]; /* count of elements before refinement */
float predicted_max[RINFO_MAX]; /* count of elements which can be created */
} REFINEINFO;
typedef INT (*Get_Sons_of_ElementSideProcPtr)(ELEMENT *theElement, INT side, INT *Sons_of_Side,ELEMENT *SonList[MAX_SONS], INT *SonSides, INT NeedSons);
/****************************************************************************/
/* */
/* definition of exported global variables */
/* */
/****************************************************************************/
extern REFINEINFO refine_info;
#ifdef ModelP
extern INT ce_NEW_NIDENT;
extern INT ce_NEW_EDIDENT;
#endif
/****************************************************************************/
/* */
/* functions exported */
/* */
/****************************************************************************/
INT GetSonSideNodes (const ELEMENT *theElement, INT side, INT *nodes, NODE *SideNodes[MAX_SIDE_NODES], INT ioflag);
INT Get_Sons_of_ElementSide(const ELEMENT *theElement,
INT side,
INT *Sons_of_Side,
ELEMENT *SonList[MAX_SONS],
INT *SonSides,
INT NeedSons,
INT ioflag,
INT useRefineClass=0);
INT Connect_Sons_of_ElementSide (GRID *theGrid, ELEMENT *theElement, INT side, INT Sons_of_Side, ELEMENT **Sons_of_Side_List, INT *SonSides, INT ioflag);
INT Refinement_Changes (ELEMENT *theElement);
END_UGDIM_NAMESPACE
#endif
|