| 1 |
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root |
| 2 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 |
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 4 |
// vi: set et ts=4 sw=2 sts=2: |
| 5 |
/****************************************************************************/ |
| 6 |
/* */ |
| 7 |
/* File: rm.c */ |
| 8 |
/* */ |
| 9 |
/* Purpose: rule manager for 2D and 3D refinement rules */ |
| 10 |
/* */ |
| 11 |
/* Author: Stefan Lang */ |
| 12 |
/* Institut fuer Computeranwendungen III */ |
| 13 |
/* Universitaet Stuttgart */ |
| 14 |
/* Pfaffenwaldring 27 */ |
| 15 |
/* 70550 Stuttgart */ |
| 16 |
/* */ |
| 17 |
/* History: 21.11.95 begin, ugp version 3.0 */ |
| 18 |
/* */ |
| 19 |
/* Remarks: */ |
| 20 |
/* */ |
| 21 |
/****************************************************************************/ |
| 22 |
|
| 23 |
/****************************************************************************/ |
| 24 |
/* */ |
| 25 |
/* include files */ |
| 26 |
/* system include files */ |
| 27 |
/* application include files */ |
| 28 |
/* */ |
| 29 |
/****************************************************************************/ |
| 30 |
|
| 31 |
#include <config.h> |
| 32 |
|
| 33 |
/* standard C library */ |
| 34 |
#include <cassert> |
| 35 |
#include <cstdio> |
| 36 |
#include <cmath> |
| 37 |
#include <cstdlib> |
| 38 |
|
| 39 |
/* low module */ |
| 40 |
#include <dune/uggrid/low/architecture.h> |
| 41 |
#include <dune/uggrid/low/debug.h> |
| 42 |
#include <dune/uggrid/low/fileopen.h> |
| 43 |
#include <dune/uggrid/low/misc.h> |
| 44 |
|
| 45 |
/* dev module */ |
| 46 |
#include <dune/uggrid/ugdevices.h> |
| 47 |
|
| 48 |
/* gm module */ |
| 49 |
#include "evm.h" |
| 50 |
#include "gm.h" |
| 51 |
#include "refine.h" |
| 52 |
#include "shapes.h" |
| 53 |
#include "rm.h" |
| 54 |
#include "cw.h" |
| 55 |
#include "elements.h" |
| 56 |
|
| 57 |
#ifdef ModelP |
| 58 |
#include <dune/uggrid/parallel/dddif/parallel.h> |
| 59 |
using namespace PPIF; |
| 60 |
#endif |
| 61 |
|
| 62 |
USING_UG_NAMESPACES |
| 63 |
|
| 64 |
/****************************************************************************/ |
| 65 |
/* */ |
| 66 |
/* defines in the following order */ |
| 67 |
/* */ |
| 68 |
/* compile time constants defining static data size (i.e. arrays) */ |
| 69 |
/* other constants */ |
| 70 |
/* macros */ |
| 71 |
/* */ |
| 72 |
/****************************************************************************/ |
| 73 |
|
| 74 |
/* macros defining best refrule, specify exactly one of them !! */ |
| 75 |
/*#define __SHORTEST_INTERIOR_EDGE__*/ |
| 76 |
/*#define __MIDDLE_INTERIOR_EDGE__*/ |
| 77 |
#define __LONGEST_INTERIOR_EDGE__ |
| 78 |
|
| 79 |
#define NOINDEX -1 |
| 80 |
|
| 81 |
/* rule count for element types */ |
| 82 |
#ifdef UG_DIM_2 |
| 83 |
#define MAX_TRI_RULES 18 |
| 84 |
#define MAX_QUA_RULES 17 |
| 85 |
#else |
| 86 |
#ifndef DUNE_UGGRID_TET_RULESET |
| 87 |
#define MAX_TET_RULES 6 |
| 88 |
#endif |
| 89 |
#define MAX_PYR_RULES 5 |
| 90 |
#define MAX_PRI_RULES 15 |
| 91 |
#define MAX_HEX_RULES 13 |
| 92 |
#endif |
| 93 |
|
| 94 |
/* shorthand notation */ |
| 95 |
#define FO FATHER_SIDE_OFFSET |
| 96 |
|
| 97 |
/****************************************************************************/ |
| 98 |
/* */ |
| 99 |
/* data structures used in this source file (exported data structures are */ |
| 100 |
/* in the corresponding include file!) */ |
| 101 |
/* */ |
| 102 |
/****************************************************************************/ |
| 103 |
|
| 104 |
/****************************************************************************/ |
| 105 |
/* */ |
| 106 |
/* definition of exported global variables */ |
| 107 |
/* */ |
| 108 |
/****************************************************************************/ |
| 109 |
|
| 110 |
INT NS_DIM_PREFIX MaxRules[TAGS] = {0,0,0,0,0,0,0,0}; |
| 111 |
INT NS_DIM_PREFIX MaxNewCorners[TAGS] = {0,0,0,0,0,0,0,0}; |
| 112 |
INT NS_DIM_PREFIX MaxNewEdges[TAGS] = {0,0,0,0,0,0,0,0}; |
| 113 |
INT NS_DIM_PREFIX CenterNodeIndex[TAGS] = {0,0,0,0,0,0,0,0}; |
| 114 |
REFRULE * NS_DIM_PREFIX RefRules[TAGS] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; |
| 115 |
SHORT const* NS_DIM_PREFIX Pattern2Rule[TAGS]; |
| 116 |
|
| 117 |
#ifdef UG_DIM_3 |
| 118 |
/* define the standard regular rules for tetrahedrons */ |
| 119 |
FULLREFRULEPTR NS_DIM_PREFIX theFullRefRule; |
| 120 |
#endif |
| 121 |
|
| 122 |
|
| 123 |
/****************************************************************************/ |
| 124 |
/* */ |
| 125 |
/* definition of variables global to this source file only (static!) */ |
| 126 |
/* */ |
| 127 |
/****************************************************************************/ |
| 128 |
|
| 129 |
#ifdef UG_DIM_2 |
| 130 |
[[maybe_unused]] static REFRULE Empty_Rule = |
| 131 |
{-1,-1,NO_CLASS,-1,{-1,-1,-1,-1},-1, |
| 132 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 133 |
{{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 134 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 135 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 136 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}; |
| 137 |
|
| 138 |
/* define Rules for Triangles */ |
| 139 |
static REFRULE TriangleRules[MAX_TRI_RULES] = { |
| 140 |
/* T_NOREF */ |
| 141 |
{TRIANGLE,T_NOREF,NO_CLASS,0, |
| 142 |
{0,0,0,0},0, |
| 143 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 144 |
{{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 145 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 146 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 147 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 148 |
|
| 149 |
/* T_COPY */ |
| 150 |
{TRIANGLE,T_COPY,RED_CLASS|GREEN_CLASS,1, |
| 151 |
{0,0,0,0},0, |
| 152 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 153 |
{{TRIANGLE,{0,1,2,-1},{FO+0,FO+1,FO+2,-1},0}, |
| 154 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 155 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 156 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 157 |
|
| 158 |
/* T_RED */ |
| 159 |
{TRIANGLE,T_RED,RED_CLASS|GREEN_CLASS|SWITCH_CLASS,4, |
| 160 |
{1,1,1,0},(1<<3)-1, |
| 161 |
{{0,1},{1,2},{0,2},{-1,-1},{-1,-1}}, |
| 162 |
{{TRIANGLE,{0,3,5,-1},{FO+0, 3,FO+2,-1},0}, |
| 163 |
{TRIANGLE,{3,1,4,-1},{FO+0,FO+1, 3,-1},0}, |
| 164 |
{TRIANGLE,{4,2,5,-1},{ FO+1,FO+2,3,-1},0}, |
| 165 |
{TRIANGLE,{3,4,5,-1},{ 1, 2, 0,-1},0}}}, |
| 166 |
|
| 167 |
|
| 168 |
/* T_BISECT_1 edge 0 bisected */ |
| 169 |
{TRIANGLE,T_BISECT_1_0,RED_CLASS|GREEN_CLASS,2, |
| 170 |
{1,0,0,0},1, |
| 171 |
{{0,1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 172 |
{{TRIANGLE,{0,3,2,-1},{FO+0, 1,FO+2,-1},0}, |
| 173 |
{TRIANGLE,{3,1,2,-1},{FO+0,FO+1, 0,-1},0}, |
| 174 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 175 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 176 |
|
| 177 |
/* T_BISECT_1 edge 1 bisected */ |
| 178 |
{TRIANGLE,T_BISECT_1_1,RED_CLASS|GREEN_CLASS,2, |
| 179 |
{0,1,0,0},1<<1, |
| 180 |
{{-1,-1},{0,2},{-1,-1},{-1,-1},{-1,-1}}, |
| 181 |
{{TRIANGLE,{0,1,4,-1},{FO+0,FO+1, 1,-1},0}, |
| 182 |
{TRIANGLE,{0,4,2,-1},{ 0,FO+1,FO+2,-1},0}, |
| 183 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 184 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 185 |
|
| 186 |
/* T_BISECT_1 edge 2 bisected */ |
| 187 |
{TRIANGLE,T_BISECT_1_2,RED_CLASS|GREEN_CLASS,2, |
| 188 |
{0,0,1,0},1<<2, |
| 189 |
{{-1,-1},{-1,-1},{0,2},{-1,-1},{-1,-1}}, |
| 190 |
{{TRIANGLE,{0,1,5,-1},{FO+0, 1,FO+2,-1},0}, |
| 191 |
{TRIANGLE,{5,1,2,-1},{ 0,FO+1,FO+2,-1},0}, |
| 192 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 193 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 194 |
|
| 195 |
|
| 196 |
/* T_BISECT_2_T1 edge 2 not bisected */ |
| 197 |
{TRIANGLE,T_BISECT_2_T1_2,RED_CLASS|GREEN_CLASS,3, |
| 198 |
{1,1,0,0},(1<<2)-1, |
| 199 |
{{0,1},{1,2},{-1,-1},{-1,-1},{-1,-1}}, |
| 200 |
{{TRIANGLE,{0,3,2,-1},{FO+0, 2,FO+2,-1},0}, |
| 201 |
{TRIANGLE,{3,1,4,-1},{FO+0,FO+1, 2,-1},0}, |
| 202 |
{TRIANGLE,{3,4,2,-1},{ 1,FO+1, 0,-1},0}, |
| 203 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 204 |
|
| 205 |
/* T_BISECT_2_T1 edge 0 not bisected */ |
| 206 |
{TRIANGLE,T_BISECT_2_T1_0,RED_CLASS|GREEN_CLASS,3, |
| 207 |
{0,1,1,0},6, |
| 208 |
{{-1,-1},{0,2},{1,2},{-1,-1},{-1,-1}}, |
| 209 |
{{TRIANGLE,{0,1,4,-1},{FO+0,FO+1, 1,-1},0}, |
| 210 |
{TRIANGLE,{0,4,5,-1},{ 0, 2,FO+2,-1},0}, |
| 211 |
{TRIANGLE,{5,4,2,-1},{ 1,FO+1,FO+2,-1},0}, |
| 212 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 213 |
|
| 214 |
/* T_BISECT_2_T1 edge 1 not bisected */ |
| 215 |
{TRIANGLE,T_BISECT_2_T1_1,RED_CLASS|GREEN_CLASS,3, |
| 216 |
{1,0,1,0},5, |
| 217 |
{{0,1},{-1,-1},{1,2},{-1,-1},{-1,-1}}, |
| 218 |
{{TRIANGLE,{0,3,5,-1},{FO+0, 1,FO+2,-1},0}, |
| 219 |
{TRIANGLE,{3,1,5,-1},{FO+0, 2, 0,-1},0}, |
| 220 |
{TRIANGLE,{5,1,2,-1},{ 1,FO+1,FO+2,-1},0}, |
| 221 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 222 |
|
| 223 |
/* T_BISECT_2_T2 edge 1 not bisected */ |
| 224 |
{TRIANGLE,T_BISECT_2_T2_1,RED_CLASS|GREEN_CLASS,3, |
| 225 |
{1,0,1,0},5, |
| 226 |
{{0,1},{-1,-1},{0,2},{-1,-1},{-1,-1}}, |
| 227 |
{{TRIANGLE,{0,3,5,-1},{FO+0, 1,FO+2,-1},0}, |
| 228 |
{TRIANGLE,{5,3,2,-1},{ 0, 2,FO+2,-1},0}, |
| 229 |
{TRIANGLE,{3,1,2,-1},{FO+0,FO+1, 1,-1},0}, |
| 230 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 231 |
|
| 232 |
/* T_BISECT_2_T2 edge 2 not bisected */ |
| 233 |
{TRIANGLE,T_BISECT_2_T2_2,RED_CLASS|GREEN_CLASS,3, |
| 234 |
{1,1,0,0},3, |
| 235 |
{{0,1},{0,2},{-1,-1},{-1,-1},{-1,-1}}, |
| 236 |
{{TRIANGLE,{0,3,4,-1},{FO+0, 1, 2,-1},0}, |
| 237 |
{TRIANGLE,{3,1,4,-1},{FO+0,FO+1, 0,-1},0}, |
| 238 |
{TRIANGLE,{0,4,2,-1},{ 0,FO+1,FO+2,-1},0}, |
| 239 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 240 |
|
| 241 |
/* T_BISECT_2_T2 edge 0 not bisected */ |
| 242 |
{TRIANGLE,T_BISECT_2_T2_0,RED_CLASS|GREEN_CLASS,3, |
| 243 |
{0,1,1,0},6, |
| 244 |
{{-1,-1},{1,2},{0,2},{-1,-1},{-1,-1}}, |
| 245 |
{{TRIANGLE,{0,1,5,-1},{FO+0, 1,FO+2,-1},0}, |
| 246 |
{TRIANGLE,{5,1,4,-1},{ 0,FO+1, 2,-1},0}, |
| 247 |
{TRIANGLE,{5,4,2,-1},{ 1,FO+1,FO+2,-1},0}, |
| 248 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 249 |
|
| 250 |
/* T_BISECT_2_Q edge 0 not bisected */ |
| 251 |
{TRIANGLE,T_BISECT_2_Q_0,RED_CLASS|GREEN_CLASS,2, |
| 252 |
{0,1,1,0},6, |
| 253 |
{{-1,-1},{0,2},{0,3},{-1,-1},{-1,-1}}, |
| 254 |
{{QUADRILATERAL,{0,1,4,5},{FO+0,FO+1, 1,FO+2},0}, |
| 255 |
{TRIANGLE,{5,4,2,-1},{ 0,FO+1,FO+2,-1},0}, |
| 256 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 257 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 258 |
|
| 259 |
/* T_BISECT_2_Q edge 1 not bisected */ |
| 260 |
{TRIANGLE,T_BISECT_2_Q_1,RED_CLASS|GREEN_CLASS,2, |
| 261 |
{1,0,1,0},5, |
| 262 |
{{0,1},{-1,-1},{0,2},{-1,-1},{-1,-1}}, |
| 263 |
{{TRIANGLE,{0,3,5,-1},{FO+0, 1,FO+2,-1},0}, |
| 264 |
{QUADRILATERAL,{3,1,2,5},{FO+0,FO+1,FO+2, 0},0}, |
| 265 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 266 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 267 |
|
| 268 |
/* T_BISECT_2_Q edge 2 not bisected */ |
| 269 |
{TRIANGLE,T_BISECT_2_Q_2,RED_CLASS|GREEN_CLASS,2, |
| 270 |
{1,1,0,0},3, |
| 271 |
{{0,1},{0,2},{-1,-1},{-1,-1},{-1,-1}}, |
| 272 |
{{QUADRILATERAL,{0,3,4,2},{FO+0, 1,FO+1,FO+2},0}, |
| 273 |
{TRIANGLE,{3,1,4,-1},{FO+0,FO+1, 0,-1},0}, |
| 274 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 275 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 276 |
|
| 277 |
/* T_BISECT_3 edge 0 */ |
| 278 |
{TRIANGLE,T_BISECT_3_0,RED_CLASS|GREEN_CLASS,4, |
| 279 |
{1,1,1,0},7, |
| 280 |
{{0,1},{3,2},{0,2},{-1,-1},{-1,-1}}, |
| 281 |
{{TRIANGLE,{0,3,5,-1},{FO+0, 1,FO+2,-1},0}, |
| 282 |
{TRIANGLE,{5,3,2,-1},{ 0, 2,FO+2,-1},0}, |
| 283 |
{TRIANGLE,{3,4,2,-1},{ 3,FO+1, 1,-1},0}, |
| 284 |
{TRIANGLE,{3,1,4,-1},{FO+0,FO+1, 2,-1},0}}}, |
| 285 |
|
| 286 |
/* T_BISECT_3 edge 1 */ |
| 287 |
{TRIANGLE,T_BISECT_3_1,RED_CLASS|GREEN_CLASS,4, |
| 288 |
{1,1,1,0},7, |
| 289 |
{{0,1},{0,2},{1,2},{-1,-1},{-1,-1}}, |
| 290 |
{{TRIANGLE,{0,3,4,-1},{FO+0, 3, 1,-1},0}, |
| 291 |
{TRIANGLE,{0,4,5,-1},{ 0, 2,FO+2,-1},0}, |
| 292 |
{TRIANGLE,{5,4,2,-1},{ 1,FO+1,FO+2,-1},0}, |
| 293 |
{TRIANGLE,{3,1,4,-1},{FO+0,FO+1, 0,-1},0}}}, |
| 294 |
|
| 295 |
/* T_BISECT_3 edge 2 */ |
| 296 |
{TRIANGLE,T_BISECT_3_2,RED_CLASS|GREEN_CLASS,4, |
| 297 |
{1,1,1,0},7, |
| 298 |
{{0,1},{2,2},{1,2},{-1,-1},{-1,-1}}, |
| 299 |
{{TRIANGLE,{0,3,5,-1},{FO+0, 1,FO+2,-1},0}, |
| 300 |
{TRIANGLE,{3,1,5,-1},{FO+0, 2, 0,-1},0}, |
| 301 |
{TRIANGLE,{5,1,4,-1},{ 1,FO+1, 3,-1},0}, |
| 302 |
{TRIANGLE,{5,4,2,-1},{ 2,FO+1,FO+2,-1},0}}}, |
| 303 |
|
| 304 |
}; |
| 305 |
|
| 306 |
/* define Rules for Quadrilaterals */ |
| 307 |
static REFRULE QuadrilateralRules[MAX_QUA_RULES] = |
| 308 |
{ |
| 309 |
/* Q_NOREF */ |
| 310 |
{QUADRILATERAL,Q_NOREF,NO_CLASS,0, |
| 311 |
{0,0,0,0},0, |
| 312 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 313 |
{{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 314 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 315 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 316 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 317 |
|
| 318 |
/* Q_COPY */ |
| 319 |
{QUADRILATERAL,Q_COPY,RED_CLASS|GREEN_CLASS,1, |
| 320 |
{0,0,0,0},0, |
| 321 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 322 |
{{QUADRILATERAL,{0,1,2,3},{FO+0,FO+1,FO+2,FO+3},-1}, |
| 323 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 324 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 325 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 326 |
|
| 327 |
/* Q_RED */ |
| 328 |
{QUADRILATERAL,Q_RED,RED_CLASS|GREEN_CLASS|SWITCH_CLASS,4, |
| 329 |
{1,1,1,1,1},(1<<5)-1, |
| 330 |
{{0,1},{1,2},{2,3},{3,0},{0,2}}, |
| 331 |
{{QUADRILATERAL,{0,4,8,7},{FO+0, 1, 3,FO+3},-1}, |
| 332 |
{QUADRILATERAL,{4,1,5,8},{FO+0,FO+1, 2, 0},-1}, |
| 333 |
{QUADRILATERAL,{8,5,2,6},{ 1,FO+1,FO+2, 3},-1}, |
| 334 |
{QUADRILATERAL,{7,8,6,3},{ 0, 2,FO+2,FO+3},-1}}}, |
| 335 |
|
| 336 |
/* Q_CLOSE_1 edge 0 and 1 bisected */ |
| 337 |
{QUADRILATERAL,Q_CLOSE_1_0,RED_CLASS|GREEN_CLASS,3, |
| 338 |
{1,1,0,0,1},3+16, |
| 339 |
{{0,1},{1,2},{-1,-1},{-1,-1},{0,2}}, |
| 340 |
{{QUADRILATERAL,{0,4,8,3},{FO+0, 1, 2,FO+3},-1}, |
| 341 |
{QUADRILATERAL,{4,1,5,8},{FO+0,FO+1, 2, 0},-1}, |
| 342 |
{QUADRILATERAL,{8,5,2,3},{ 1,FO+1,FO+2, 0},-1}, |
| 343 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 344 |
|
| 345 |
/* Q_CLOSE_1 edge 1 and 2 bisected */ |
| 346 |
{QUADRILATERAL,Q_CLOSE_1_1,RED_CLASS|GREEN_CLASS,3, |
| 347 |
{0,1,1,0,1},6+16, |
| 348 |
{{-1,-1},{0,2},{1,3},{-1,-1},{0,3}}, |
| 349 |
{{QUADRILATERAL,{0,1,5,8},{FO+0,FO+1, 1, 2},-1}, |
| 350 |
{QUADRILATERAL,{8,5,2,6},{ 0,FO+1,FO+2, 2},-1}, |
| 351 |
{QUADRILATERAL,{0,8,6,3},{ 0, 1,FO+2,FO+3},-1}, |
| 352 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 353 |
|
| 354 |
/* Q_CLOSE_1 edge 2 and 3 bisected */ |
| 355 |
{QUADRILATERAL,Q_CLOSE_1_2,RED_CLASS|GREEN_CLASS,3, |
| 356 |
{0,0,1,1,1},12+16, |
| 357 |
{{-1,-1},{-1,-1},{1,3},{0,3},{0,2}}, |
| 358 |
{{QUADRILATERAL,{0,1,8,7},{FO+0, 1, 2,FO+3},-1}, |
| 359 |
{QUADRILATERAL,{8,1,2,6},{ 0,FO+1,FO+2, 2},-1}, |
| 360 |
{QUADRILATERAL,{7,8,6,3},{ 0, 1,FO+2,FO+3},-1}, |
| 361 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 362 |
|
| 363 |
/* Q_CLOSE_1 edge 0 and 3 bisected */ |
| 364 |
{QUADRILATERAL,Q_CLOSE_1_3,RED_CLASS|GREEN_CLASS,3, |
| 365 |
{1,0,0,1,1},9+16, |
| 366 |
{{0,1},{-1,-1},{-1,-1},{0,3},{0,2}}, |
| 367 |
{{QUADRILATERAL,{0,4,8,7},{FO+0, 1, 2,FO+3},-1}, |
| 368 |
{QUADRILATERAL,{4,1,2,8},{FO+0,FO+1, 2, 0},-1}, |
| 369 |
{QUADRILATERAL,{7,8,2,3},{ 0, 1,FO+2,FO+3},-1}, |
| 370 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 371 |
|
| 372 |
/* Q_BLUE edge 0 and 2 bisected */ |
| 373 |
{QUADRILATERAL,Q_BLUE_0,RED_CLASS|GREEN_CLASS,2, |
| 374 |
{1,0,1,0,0},5, |
| 375 |
{{0,1},{-1,-1},{0,2},{-1,-1},{-1,-1}}, |
| 376 |
{{QUADRILATERAL,{0,4,6,3},{FO+0, 1,FO+2,FO+3},-1}, |
| 377 |
{QUADRILATERAL,{4,1,2,6},{FO+0,FO+1,FO+2, 0},-1}, |
| 378 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 379 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 380 |
|
| 381 |
/* Q_BLUE edge 1 and 3 bisected */ |
| 382 |
{QUADRILATERAL,Q_BLUE_1,RED_CLASS|GREEN_CLASS,2, |
| 383 |
{0,1,0,1,0},10, |
| 384 |
{{-1,-1},{0,2},{-1,-1},{0,3},{-1,-1}}, |
| 385 |
{{QUADRILATERAL,{0,1,5,7},{FO+0,FO+1, 1,FO+3},-1}, |
| 386 |
{QUADRILATERAL,{7,5,2,3},{ 0,FO+1,FO+2,FO+3},-1}, |
| 387 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}, |
| 388 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 389 |
|
| 390 |
/* Q_CLOSE_2 edge 0 bisected */ |
| 391 |
{QUADRILATERAL,Q_CLOSE_2_0,RED_CLASS|GREEN_CLASS,3, |
| 392 |
{1,0,0,0,1},1+16, |
| 393 |
{{0,1},{-1,-1},{-1,-1},{-1,-1},{0,2}}, |
| 394 |
{{QUADRILATERAL,{0,4,8,3},{FO+0, 1, 2,FO+3},-1}, |
| 395 |
{QUADRILATERAL,{4,1,2,8},{FO+0,FO+1, 2, 0},-1}, |
| 396 |
{TRIANGLE,{8,2,3,-1},{ 1,FO+2, 0,-1},-1}, |
| 397 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 398 |
|
| 399 |
/* Q_CLOSE_2 edge 1 bisected */ |
| 400 |
{QUADRILATERAL,Q_CLOSE_2_1,RED_CLASS|GREEN_CLASS,3, |
| 401 |
{0,1,0,0,1},2+16, |
| 402 |
{{-1,-1},{0,2},{-1,-1},{-1,-1},{0,3}}, |
| 403 |
{{QUADRILATERAL,{0,1,5,8},{FO+0,FO+1, 1, 2},-1}, |
| 404 |
{QUADRILATERAL,{8,5,2,3},{ 0,FO+1,FO+2, 2},-1}, |
| 405 |
{TRIANGLE,{0,8,3,-1},{ 0, 1,FO+3,-1},-1}, |
| 406 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 407 |
|
| 408 |
/* Q_CLOSE_2 edge 2 bisected */ |
| 409 |
{QUADRILATERAL,Q_CLOSE_2_2,RED_CLASS|GREEN_CLASS,3, |
| 410 |
{0,0,1,0,1},4+16, |
| 411 |
{{-1,-1},{-1,-1},{1,3},{-1,-1},{0,2}}, |
| 412 |
{{TRIANGLE,{0,1,8,-1},{FO+0, 1, 2,-1},-1}, |
| 413 |
{QUADRILATERAL,{8,1,2,6},{ 0,FO+1,FO+2, 2},-1}, |
| 414 |
{QUADRILATERAL,{0,8,6,3},{ 0, 1,FO+2,FO+3},-1}, |
| 415 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 416 |
|
| 417 |
/* Q_CLOSE_2 edge 3 bisected */ |
| 418 |
{QUADRILATERAL,Q_CLOSE_2_3,RED_CLASS|GREEN_CLASS,3, |
| 419 |
{0,0,0,1,1},8+16, |
| 420 |
{{-1,-1},{-1,-1},{-1,-1},{0,3},{0,2}}, |
| 421 |
{{QUADRILATERAL,{0,1,8,7},{FO+0, 1, 2,FO+3},-1}, |
| 422 |
{TRIANGLE,{1,2,8,-1},{FO+1, 2, 0,-1},-1}, |
| 423 |
{QUADRILATERAL,{7,8,2,3},{ 0, 1,FO+2,FO+3},-1}, |
| 424 |
{-1,{-1,-1,-1,-1},{-1,-1,-1,-1},-1}}}, |
| 425 |
|
| 426 |
/* Q_CLOSE_3 edge 0 not bisected */ |
| 427 |
{QUADRILATERAL,Q_CLOSE_3_0,RED_CLASS|GREEN_CLASS,4, |
| 428 |
{0,1,1,1,0},14, |
| 429 |
{{-1,-1},{0,2},{1,2},{0,3},{-1,-1}}, |
| 430 |
{{QUADRILATERAL,{0,1,5,7},{FO+0,FO+1, 1,FO+3},-1}, |
| 431 |
{TRIANGLE,{7,5,6,-1},{ 0, 2, 3,-1},-1}, |
| 432 |
{TRIANGLE,{5,2,6,-1},{FO+1,FO+2, 1,-1},-1}, |
| 433 |
{TRIANGLE,{7,6,3,-1},{ 1,FO+2,FO+3,-1},-1}}}, |
| 434 |
|
| 435 |
/* Q_CLOSE_3 edge 1 not bisected */ |
| 436 |
{QUADRILATERAL,Q_CLOSE_3_1,RED_CLASS|GREEN_CLASS,4, |
| 437 |
{1,0,1,1,0},13, |
| 438 |
{{0,1},{-1,-1},{1,2},{0,2},{-1,-1}}, |
| 439 |
{{TRIANGLE,{0,4,7,-1},{FO+0, 1,FO+3,-1},-1}, |
| 440 |
{TRIANGLE,{7,4,6,-1},{ 0, 3, 2,-1},-1}, |
| 441 |
{TRIANGLE,{7,6,3,-1},{ 1,FO+2,FO+3,-1},-1}, |
| 442 |
{QUADRILATERAL,{4,1,2,6},{FO+0,FO+1,FO+2, 1},-1}}}, |
| 443 |
|
| 444 |
/* Q_CLOSE_3 edge 2 not bisected */ |
| 445 |
{QUADRILATERAL,Q_CLOSE_3_2,RED_CLASS|GREEN_CLASS,4, |
| 446 |
{1,1,0,1,0},11, |
| 447 |
{{0,1},{2,2},{-1,-1},{0,2},{-1,-1}}, |
| 448 |
{{TRIANGLE,{0,4,7,-1},{FO+0, 1,FO+3,-1},-1}, |
| 449 |
{TRIANGLE,{4,5,7,-1},{ 2, 3, 0,-1},-1}, |
| 450 |
{TRIANGLE,{4,1,5,-1},{FO+0,FO+1, 1,-1},-1}, |
| 451 |
{QUADRILATERAL,{7,5,2,3},{ 1,FO+1,FO+2,FO+3},-1}}}, |
| 452 |
|
| 453 |
/* Q_CLOSE_3 edge 3 not bisected */ |
| 454 |
{QUADRILATERAL,Q_CLOSE_3_3,RED_CLASS|GREEN_CLASS,4, |
| 455 |
{1,1,1,0,0},7, |
| 456 |
{{0,1},{2,2},{0,2},{-1,-1},{-1,-1}}, |
| 457 |
{{QUADRILATERAL,{0,4,6,3},{FO+0, 1,FO+2,FO+3},-1}, |
| 458 |
{TRIANGLE,{4,5,6,-1},{ 2, 3, 0,-1},-1}, |
| 459 |
{TRIANGLE,{4,1,5,-1},{FO+0,FO+1, 1,-1},-1}, |
| 460 |
{TRIANGLE,{5,2,6,-1},{FO+1,FO+2, 1,-1},-1}}} |
| 461 |
|
| 462 |
}; |
| 463 |
|
| 464 |
#endif |
| 465 |
|
| 466 |
#ifdef UG_DIM_3 |
| 467 |
|
| 468 |
static INT theBFRRDirID; /* env type for BestFullRefRule */ |
| 469 |
static INT theBFRRVarID; |
| 470 |
|
| 471 |
#ifndef DUNE_UGGRID_TET_RULESET |
| 472 |
/* define the regular rules for tetrahedron */ |
| 473 |
[[maybe_unused]] static REFRULE TetrahedronRules[MAX_TET_RULES] = |
| 474 |
{ |
| 475 |
/* TET_NO_REF */ |
| 476 |
{TETRAHEDRON,0,NO_CLASS,0, |
| 477 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 478 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 479 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 480 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 481 |
{-1,-1}}, |
| 482 |
{{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 483 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 484 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 485 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 486 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 487 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 488 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 489 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 490 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 491 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 492 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 493 |
|
| 494 |
/* TET_COPY */ |
| 495 |
{TETRAHEDRON,1,YELLOW_CLASS,1, |
| 496 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 497 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 498 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 499 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 500 |
{-1,-1}}, |
| 501 |
{{TETRAHEDRON,{ 0, 1, 2, 3,-1,-1,-1,-1},{FO+0,FO+1,FO+2,FO+3,-1,-1},-1}, |
| 502 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 503 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 504 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 505 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 506 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 507 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 508 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 509 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 510 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 511 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 512 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 513 |
|
| 514 |
/* TET_RED equals TET_RED_2_4 */ |
| 515 |
{TETRAHEDRON,2,RED_CLASS|SWITCH_CLASS,8, |
| 516 |
{1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},(1<<6)-1, |
| 517 |
|
| 518 |
/* sonandnode */ |
| 519 |
{{0,1},{1,1},{0,2},{0,3},{1,2},{2,2}, |
| 520 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 521 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 522 |
{-1,-1}}, |
| 523 |
|
| 524 |
/* sons */ |
| 525 |
{{TETRAHEDRON,{0,4,6,7,-1,-1,-1,-1},{FO+0,4,FO+2,FO+3,-1,-1},0x0}, |
| 526 |
{TETRAHEDRON,{4,5,8,1,-1,-1,-1,-1},{5,FO+1,FO+3,FO+0,-1,-1}, |
| 527 |
0x3<<PATHDEPTHSHIFT | 0x1 | (0x3<<3) | (0x3<<(2*3))}, |
| 528 |
{TETRAHEDRON,{5,6,9,2,-1,-1,-1,-1},{6,FO+2,FO+1,FO+0,-1,-1}, |
| 529 |
0x4<<PATHDEPTHSHIFT | 0x1 | (0x3<<3) | (0x1<<(2*3)) | (0x3<<(3*3))}, |
| 530 |
{TETRAHEDRON,{7,8,9,3,-1,-1,-1,-1},{7,FO+1,FO+2,FO+3,-1,-1}, |
| 531 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 532 |
{TETRAHEDRON,{4,6,7,8,-1,-1,-1,-1},{0,7,FO+3,5,-1,-1}, |
| 533 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 534 |
{TETRAHEDRON,{4,5,6,8,-1,-1,-1,-1},{FO+0,6,4,1,-1,-1}, |
| 535 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 536 |
{TETRAHEDRON,{5,6,8,9,-1,-1,-1,-1},{5,7,FO+1,2,-1,-1}, |
| 537 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 538 |
{TETRAHEDRON,{6,7,8,9,-1,-1,-1,-1},{4,3,6,FO+2,-1,-1}, |
| 539 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 540 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 541 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 542 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 543 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 544 |
|
| 545 |
/* TET_RED_0_5 */ |
| 546 |
{TETRAHEDRON,3,RED_CLASS|SWITCH_CLASS,8, |
| 547 |
{1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},(1<<6)-1, |
| 548 |
|
| 549 |
/* sonandnode */ |
| 550 |
{{1,0},{0,0},{0,1},{2,0},{1,2},{0,2}, |
| 551 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 552 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 553 |
{-1,-1}}, |
| 554 |
|
| 555 |
/* sons */ |
| 556 |
{{TETRAHEDRON,{5,6,9,2,-1,-1,-1,-1},{4,FO+2,FO+1,FO+0,-1,-1},0x0}, |
| 557 |
{TETRAHEDRON,{4,5,8,1,-1,-1,-1,-1},{5,FO+1,FO+3,FO+0,-1,-1}, |
| 558 |
0x3<<PATHDEPTHSHIFT | 0x1 | (0x3<<3) | (0x3<<(2*3))}, |
| 559 |
{TETRAHEDRON,{7,8,9,3,-1,-1,-1,-1},{6,FO+1,FO+2,FO+3,-1,-1}, |
| 560 |
0x4<<PATHDEPTHSHIFT | 0x1 | (0x3<<3) | (0x1<<(2*3)) | (0x3<<(3*3))}, |
| 561 |
{TETRAHEDRON,{0,4,6,7,-1,-1,-1,-1},{FO+0,7,FO+2,FO+3,-1,-1}, |
| 562 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 563 |
{TETRAHEDRON,{4,5,6,9,-1,-1,-1,-1},{FO+0,0,7,5,-1,-1}, |
| 564 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 565 |
{TETRAHEDRON,{5,8,9,4,-1,-1,-1,-1},{FO+1,6,4,1,-1,-1}, |
| 566 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 567 |
{TETRAHEDRON,{4,7,8,9,-1,-1,-1,-1},{FO+3,2,5,7,-1,-1}, |
| 568 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 569 |
{TETRAHEDRON,{4,6,7,9,-1,-1,-1,-1},{3,FO+2,6,4,-1,-1}, |
| 570 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 571 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 572 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 573 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 574 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 575 |
|
| 576 |
/* TET_RED_1_3 */ |
| 577 |
{TETRAHEDRON,4,RED_CLASS|SWITCH_CLASS,8, |
| 578 |
{1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},(1<<6)-1, |
| 579 |
|
| 580 |
/* sonandnode */ |
| 581 |
{{1,1},{1,1},{2,2},{0,0},{0,1},{0,2}, |
| 582 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 583 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 584 |
{-1,-1}}, |
| 585 |
|
| 586 |
/* sons */ |
| 587 |
{{TETRAHEDRON,{7,8,9,3,-1,-1,-1,-1},{4,FO+1,FO+2,FO+3,-1,-1},0x0}, |
| 588 |
{TETRAHEDRON,{4,5,8,1,-1,-1,-1,-1},{5,FO+1,FO+3,FO+0,-1,-1}, |
| 589 |
0x3<<PATHDEPTHSHIFT | 0x1 | (0x3<<3) | (0x3<<(2*3))}, |
| 590 |
{TETRAHEDRON,{0,4,6,7,-1,-1,-1,-1},{FO+0,6,FO+2,FO+3,-1,-1}, |
| 591 |
0x4<<PATHDEPTHSHIFT | 0x1 | (0x3<<3) | (0x1<<(2*3)) | (0x3<<(3*3))}, |
| 592 |
{TETRAHEDRON,{5,6,9,2,-1,-1,-1,-1},{7,FO+2,FO+1,FO+0,-1,-1}, |
| 593 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 594 |
{TETRAHEDRON,{5,7,8,9,-1,-1,-1,-1},{5,0,FO+1,7,-1,-1}, |
| 595 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 596 |
{TETRAHEDRON,{4,5,7,8,-1,-1,-1,-1},{6,4,FO+3,1,-1,-1}, |
| 597 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 598 |
{TETRAHEDRON,{4,5,6,7,-1,-1,-1,-1},{FO+0,7,2,5,-1,-1}, |
| 599 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 600 |
{TETRAHEDRON,{5,6,7,9,-1,-1,-1,-1},{6,FO+2,4,3,-1,-1}, |
| 601 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 602 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 603 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 604 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 605 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 606 |
|
| 607 |
/* TET_RED_HEX */ |
| 608 |
{TETRAHEDRON,5,RED_CLASS|SWITCH_CLASS,4, |
| 609 |
{1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},(1<<11)-1, |
| 610 |
|
| 611 |
/* sonandnode */ |
| 612 |
{{0,2},{1,3},{0,0},{0,5},{3,6},{3,4}, |
| 613 |
{0,3},{0,6},{3,7},{0,4},{0,7},{-1,-1}, |
| 614 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 615 |
{-1,-1}}, |
| 616 |
|
| 617 |
/* sons */ |
| 618 |
{{HEXAHEDRON,{4,1,5,10,13,8,11,14},{FO+0,FO+3,FO+1,1,2,3},0x0}, |
| 619 |
{HEXAHEDRON,{5,2,6,10,11,9,12,14},{FO+0,FO+1,FO+2,2,0,3},0x0}, |
| 620 |
{HEXAHEDRON,{0,4,10,6,7,13,14,12},{FO+0,FO+3,0,1,FO+2,3},0x0}, |
| 621 |
{HEXAHEDRON,{13,8,11,14,7,3,9,12},{0,FO+3,FO+1,1,2,FO+2},0x0}, |
| 622 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 623 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 624 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 625 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 626 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 627 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 628 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 629 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}} |
| 630 |
|
| 631 |
}; |
| 632 |
#endif |
| 633 |
|
| 634 |
/* define the regular rules for pyramids */ |
| 635 |
static REFRULE PyramidRules[MAX_PYR_RULES] = |
| 636 |
{ |
| 637 |
/* PYR_NO_REF */ |
| 638 |
{PYRAMID,0,NO_CLASS,0, |
| 639 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 640 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 641 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 642 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 643 |
{-1,-1}}, |
| 644 |
{{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 645 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 646 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 647 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 648 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 649 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 650 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 651 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 652 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 653 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 654 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 655 |
|
| 656 |
/* PYR_COPY */ |
| 657 |
{PYRAMID,1,YELLOW_CLASS,1, |
| 658 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 659 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 660 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 661 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 662 |
{-1,-1}}, |
| 663 |
{{PYRAMID,{ 0, 1, 2, 3, 4,-1,-1,-1},{FO+0,FO+1,FO+2,FO+3,FO+4,-1},-1}, |
| 664 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 665 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 666 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 667 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 668 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 669 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 670 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 671 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 672 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 673 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 674 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 675 |
|
| 676 |
/* PYR_RED */ |
| 677 |
{PYRAMID,2,RED_CLASS|SWITCH_CLASS,10, |
| 678 |
{1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},(1<<9)-1, |
| 679 |
|
| 680 |
/* sonandnode */ |
| 681 |
{{0,1},{1,2},{2,3},{0,3},{0,4},{1,4}, |
| 682 |
{2,4},{3,4},{0,2},{-1,-1},{-1,-1},{-1,-1}, |
| 683 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 684 |
{-1,-1}}, |
| 685 |
|
| 686 |
/* sons */ |
| 687 |
{{PYRAMID,{ 0, 5, 13, 8, 9,-1,-1,-1},{FO+0,FO+1,4,7,FO+4,-1},-1}, |
| 688 |
{PYRAMID,{5,1,6,13,10,-1,-1,-1},{FO+0,FO+1,FO+2,5,4,-1}, |
| 689 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x1<<3)}, |
| 690 |
{PYRAMID,{13,6,2,7,11,-1,-1,-1},{FO+0,5,FO+2,FO+3,6,-1}, |
| 691 |
0x4<<PATHDEPTHSHIFT | 0x2 | (0x1<<3) | (0x3<<(2*3)) | (0x1<<(3*3))}, |
| 692 |
{PYRAMID,{8,13,7,3,12,-1,-1,-1},{FO+0,7,6,FO+3,FO+4,-1}, |
| 693 |
0x2<<PATHDEPTHSHIFT | 0x3 | (0x2<<3)}, |
| 694 |
{TETRAHEDRON,{9,10,5,13,-1,-1,-1,-1},{FO+1,1,0,8,-1,-1}, |
| 695 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 696 |
{TETRAHEDRON,{10,11,6,13,-1,-1,-1,-1},{FO+2,2,1,8,-1,-1}, |
| 697 |
0x3<<PATHDEPTHSHIFT | 0x2 | (0x1<<3) | (0x3<<(2*3))}, |
| 698 |
{TETRAHEDRON,{11,12,7,13,-1,-1,-1,-1},{FO+3,3,2,8,-1,-1}, |
| 699 |
0x3<<PATHDEPTHSHIFT | 0x3 | (0x2<<3) | (0x2<<(2*3))}, |
| 700 |
{TETRAHEDRON,{12,9,8,13,-1,-1,-1,-1},{FO+4,0,3,8,-1,-1}, |
| 701 |
0x1<<PATHDEPTHSHIFT | 0x3}, |
| 702 |
{PYRAMID,{12,11,10,9,13,-1,-1,-1},{9,6,5,4,7,-1}, |
| 703 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x3<<3)}, |
| 704 |
{PYRAMID,{9,10,11,12,4,-1,-1,-1},{8,FO+1,FO+2,FO+3,FO+4,-1}, |
| 705 |
0x3<<PATHDEPTHSHIFT | 0x2 | (0x3<<3) | (0x0<<(2*3))}, |
| 706 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 707 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 708 |
|
| 709 |
/* PYR_bisect_0_1 */ |
| 710 |
{PYRAMID,3,RED_CLASS|SWITCH_CLASS,2, |
| 711 |
{1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5, |
| 712 |
|
| 713 |
/* sonandnode */ |
| 714 |
{{0,1},{1,2},{2,3},{0,3},{0,4},{1,4}, |
| 715 |
{2,4},{3,4},{0,2},{-1,-1},{-1,-1},{-1,-1}, |
| 716 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 717 |
{-1,-1}}, |
| 718 |
|
| 719 |
/* sons */ |
| 720 |
{{PYRAMID,{ 0, 5, 7, 3, 4,-1,-1,-1},{FO+0,FO+1,1,FO+3,FO+4,-1},-1}, |
| 721 |
{PYRAMID,{5,1,2,7,4,-1,-1,-1},{FO+0,FO+1,FO+2,FO+3,0,-1}, |
| 722 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x1<<3)}, |
| 723 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 724 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 725 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 726 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 727 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 728 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 729 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 730 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 731 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 732 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 733 |
|
| 734 |
/* PYR_bisect_0_2 */ |
| 735 |
{PYRAMID,4,RED_CLASS|SWITCH_CLASS,2, |
| 736 |
{0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},10, |
| 737 |
|
| 738 |
/* sonandnode */ |
| 739 |
{{0,1},{1,2},{2,3},{0,3},{0,4},{1,4}, |
| 740 |
{2,4},{3,4},{0,2},{-1,-1},{-1,-1},{-1,-1}, |
| 741 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 742 |
{-1,-1}}, |
| 743 |
|
| 744 |
/* sons */ |
| 745 |
{{PYRAMID,{ 0, 1, 6, 8, 4,-1,-1,-1},{FO+0,FO+1,FO+2,1,FO+4,-1},-1}, |
| 746 |
{PYRAMID,{8,6,2,3,4,-1,-1,-1},{FO+0,0,FO+2,FO+3,FO+4,-1}, |
| 747 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x1<<3)}, |
| 748 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 749 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 750 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 751 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 752 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 753 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 754 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 755 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 756 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 757 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}} |
| 758 |
|
| 759 |
}; |
| 760 |
|
| 761 |
/* define the regular rules for prisms */ |
| 762 |
static REFRULE PrismRules[MAX_PRI_RULES] = |
| 763 |
{ |
| 764 |
/* PRI_NO_REF */ |
| 765 |
{PRISM,0,NO_CLASS,0, |
| 766 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 767 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 768 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 769 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 770 |
{-1,-1}}, |
| 771 |
{{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 772 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 773 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 774 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 775 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 776 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 777 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 778 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 779 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 780 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 781 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 782 |
|
| 783 |
/* PRI_COPY */ |
| 784 |
{PRISM,1,YELLOW_CLASS,1, |
| 785 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 786 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 787 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 788 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 789 |
{-1,-1}}, |
| 790 |
{{PRISM,{ 0, 1, 2, 3, 4, 5,-1,-1},{FO+0,FO+1,FO+2,FO+3,FO+4,-1},-1}, |
| 791 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 792 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 793 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 794 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 795 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 796 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 797 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 798 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 799 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 800 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 801 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 802 |
|
| 803 |
/* PRI_RED */ |
| 804 |
{PRISM,2,RED_CLASS|SWITCH_CLASS,8, |
| 805 |
{1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0}, |
| 806 |
(1<<9)-1+(1<<10)+(1<<11)+(1<<12), |
| 807 |
|
| 808 |
/* sonandnode */ |
| 809 |
{{0,1},{1,1},{0,2},{0,3},{1,4},{2,5}, |
| 810 |
{4,4},{5,5},{4,5},{-1,-1},{0,4},{1,5},{0,5}, |
| 811 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 812 |
{-1,-1}}, |
| 813 |
|
| 814 |
/* sons */ |
| 815 |
{{PRISM,{0,6,8,9,16,18,-1,-1},{FO+0,FO+1,2,FO+3,4,-1},-1}, |
| 816 |
{PRISM,{6,1,7,16,10,17,-1,-1},{FO+0,FO+1,FO+2,2,5,-1}, |
| 817 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x2<<3)}, |
| 818 |
{PRISM,{8,6,7,18,16,17,-1,-1},{FO+0,0,1,3,6,-1}, |
| 819 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 820 |
{PRISM,{8,7,2,18,17,11,-1,-1},{FO+0,2,FO+2,FO+3,7,-1}, |
| 821 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x3<<3)}, |
| 822 |
{PRISM,{9,16,18,3,12,14,-1,-1},{0,FO+1,6,FO+3,FO+4,-1}, |
| 823 |
0x1<<PATHDEPTHSHIFT | 0x4}, |
| 824 |
{PRISM,{16,10,17,12,4,13,-1,-1},{1,FO+1,FO+2,6,FO+4,-1}, |
| 825 |
0x3<<PATHDEPTHSHIFT | 0x2 | (0x2<<3) | (0x4<<(2*3))}, |
| 826 |
{PRISM,{18,16,17,14,12,13,-1,-1},{2,4,5,7,FO+4,-1}, |
| 827 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x4<<3)}, |
| 828 |
{PRISM,{18,17,11,14,13,5,-1,-1},{3,6,FO+2,FO+3,FO+4,-1}, |
| 829 |
0x3<<PATHDEPTHSHIFT | 0x2 | (0x3<<3) | (0x4<<(2*3))}, |
| 830 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 831 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 832 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 833 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 834 |
|
| 835 |
/* PRI_QUADSECT */ |
| 836 |
{PRISM,3,RED_CLASS|SWITCH_CLASS,4, |
| 837 |
{1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0}, |
| 838 |
(1<<3)-1+(1<<6)+(1<<7)+(1<<8), |
| 839 |
|
| 840 |
/* sonandnode */ |
| 841 |
{{0,0},{0,0},{0,0},{-1,-1},{-1,-1},{-1,-1}, |
| 842 |
{0,0},{0,0},{0,0},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 843 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 844 |
{-1,-1}}, |
| 845 |
|
| 846 |
/* sons */ |
| 847 |
{{PRISM,{0,6,8,3,12,14,-1,-1},{FO+0,FO+1,2,FO+3,FO+4,-1},-1}, |
| 848 |
{PRISM,{6,1,7,12,4,13,-1,-1},{FO+0,FO+1,FO+2,2,FO+4,-1}, |
| 849 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x2<<3)}, |
| 850 |
{PRISM,{8,6,7,14,12,13,-1,-1},{FO+0,0,1,3,FO+4,-1}, |
| 851 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 852 |
{PRISM,{8,7,2,14,13,5,-1,-1},{FO+0,2,FO+2,FO+3,FO+4,-1}, |
| 853 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x3<<3)}, |
| 854 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 855 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 856 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 857 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 858 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 859 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 860 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 861 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 862 |
|
| 863 |
/* PRI_BISECT_0_1 */ |
| 864 |
{PRISM,4,RED_CLASS|SWITCH_CLASS,2, |
| 865 |
{1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0}, |
| 866 |
1 + (1<<6), |
| 867 |
|
| 868 |
/* sonandnode */ |
| 869 |
{{0,1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 870 |
{0,4},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 871 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 872 |
{-1,-1}}, |
| 873 |
|
| 874 |
/* sons */ |
| 875 |
{{PRISM,{0,6,2,3,12,5,-1,-1},{FO+0,FO+1,1,FO+3,FO+4,-1},-1}, |
| 876 |
{PRISM,{6,1,2,12,4,5,-1,-1},{FO+0,FO+1,FO+2,0,FO+4,-1}, |
| 877 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x2<<3)}, |
| 878 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 879 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 880 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 881 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 882 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 883 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 884 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 885 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 886 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 887 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 888 |
|
| 889 |
/* PRI_BISECT_0_2 */ |
| 890 |
{PRISM,5,RED_CLASS|SWITCH_CLASS,2, |
| 891 |
{0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0}, |
| 892 |
(1<<1) + (1<<7), |
| 893 |
|
| 894 |
/* sonandnode */ |
| 895 |
{{-1,-1},{0,1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 896 |
{-1,-1},{0,4},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 897 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 898 |
{-1,-1}}, |
| 899 |
|
| 900 |
/* sons */ |
| 901 |
{{PRISM,{0,7,2,3,13,5,-1,-1},{FO+0,1,FO+2,FO+3,FO+4,-1},-1}, |
| 902 |
{PRISM,{0,1,7,3,4,13,-1,-1},{FO+0,FO+1,FO+2,0,FO+4,-1}, |
| 903 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x2<<3)}, |
| 904 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 905 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 906 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 907 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 908 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 909 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 910 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 911 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 912 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 913 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 914 |
|
| 915 |
/* PRI_BISECT_0_3 */ |
| 916 |
{PRISM,6,RED_CLASS|SWITCH_CLASS,2, |
| 917 |
{0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, |
| 918 |
(1<<2) + (1<<8), |
| 919 |
|
| 920 |
/* sonandnode */ |
| 921 |
{{-1,-1},{-1,-1},{0,2},{-1,-1},{-1,-1},{-1,-1}, |
| 922 |
{-1,-1},{-1,-1},{0,5},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 923 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 924 |
{-1,-1}}, |
| 925 |
|
| 926 |
/* sons */ |
| 927 |
{{PRISM,{0,1,8,3,4,14,-1,-1},{FO+0,FO+1,1,FO+3,FO+4,-1},-1}, |
| 928 |
{PRISM,{8,1,2,14,4,5,-1,-1},{FO+0,0,FO+2,FO+3,FO+4,-1}, |
| 929 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x2<<3)}, |
| 930 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 931 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 932 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 933 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 934 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 935 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 936 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 937 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 938 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 939 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 940 |
|
| 941 |
/* PRI_BISECT_1_2 */ |
| 942 |
{PRISM,7,RED_CLASS|SWITCH_CLASS,2, |
| 943 |
{0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, |
| 944 |
(1<<3) + (1<<4) + (1<<5), |
| 945 |
|
| 946 |
/* sonandnode */ |
| 947 |
{{-1,-1},{-1,-1},{-1,-1},{0,0},{0,0},{0,0}, |
| 948 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 949 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 950 |
{-1,-1}}, |
| 951 |
|
| 952 |
/* sons */ |
| 953 |
{{PRISM,{0,1,2,9,10,11,-1,-1},{FO+0,FO+1,FO+2,FO+3,1,-1},-1}, |
| 954 |
{PRISM,{9,10,11,3,4,5,-1,-1},{0,FO+1,FO+2,FO+3,FO+4,-1}, |
| 955 |
0x2<<PATHDEPTHSHIFT | 0x2 | (0x2<<3)}, |
| 956 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 957 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 958 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 959 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 960 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 961 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 962 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 963 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 964 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 965 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 966 |
|
| 967 |
/* PRI_BISECT_HEX0 */ |
| 968 |
{PRISM,8,RED_CLASS|SWITCH_CLASS,2, |
| 969 |
{1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0}, |
| 970 |
1+(1<<2)+(1<<6)+(1<<8), |
| 971 |
|
| 972 |
/* sonandnode */ |
| 973 |
{{0,1},{-1,-1},{0,2},{-1,-1},{-1,-1},{-1,-1}, |
| 974 |
{0,4},{-1,-1},{0,5},{-1,-1},{-1,-1},{-1,-1}, |
| 975 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 976 |
{-1,-1}}, |
| 977 |
|
| 978 |
/* sons */ |
| 979 |
{{PRISM,{0,6,8,3,12,14,-1,-1},{FO+0,FO+1,1,FO+3,FO+4,-1},-1}, |
| 980 |
{HEXAHEDRON,{6,1,2,8,12,4,5,14},{FO+0,FO+1,FO+2,FO+3,0,FO+4}, |
| 981 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 982 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 983 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 984 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 985 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 986 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 987 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 988 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 989 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 990 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 991 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 992 |
|
| 993 |
/* PRI_BISECT_HEX1 */ |
| 994 |
{PRISM,9,RED_CLASS|SWITCH_CLASS,2, |
| 995 |
{0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0}, |
| 996 |
(1<<1)+(1<<2)+(1<<7)+(1<<8), |
| 997 |
|
| 998 |
/* sonandnode */ |
| 999 |
{{-1,-1},{0,2},{0,3},{-1,-1},{-1,-1},{-1,-1}, |
| 1000 |
{-1,-1},{0,6},{0,7},{-1,-1},{-1,-1},{-1,-1}, |
| 1001 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1002 |
{-1,-1}}, |
| 1003 |
|
| 1004 |
/* sons */ |
| 1005 |
{{HEXAHEDRON,{0,1,7,8,3,4,13,14},{FO+0,FO+1,FO+2,1,FO+3,FO+4},-1}, |
| 1006 |
{PRISM,{7,8,2,13,14,5,-1,-1},{FO+0,0,FO+2,FO+3,FO+4,-1}, |
| 1007 |
0x1<<PATHDEPTHSHIFT | 0x3}, |
| 1008 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1009 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1010 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1011 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1012 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1013 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1014 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1015 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1016 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1017 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1018 |
|
| 1019 |
/* PRI_BISECT_HEX2 */ |
| 1020 |
{PRISM,10,RED_CLASS|SWITCH_CLASS,2, |
| 1021 |
{1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0}, |
| 1022 |
1+(1<<1)+(1<<6)+(1<<7), |
| 1023 |
|
| 1024 |
/* sonandnode */ |
| 1025 |
{{0,1},{0,2},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1026 |
{0,5},{0,6},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1027 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1028 |
{-1,-1}}, |
| 1029 |
|
| 1030 |
/* sons */ |
| 1031 |
{{HEXAHEDRON,{6,7,2,0,12,13,5,3},{FO+0,1,FO+2,FO+3,FO+1,FO+4},-1}, |
| 1032 |
{PRISM,{6,1,7,12,4,13,-1,-1},{FO+0,FO+1,FO+2,0,FO+4,-1}, |
| 1033 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1034 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1035 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1036 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1037 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1038 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1039 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1040 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1041 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1042 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1043 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1044 |
|
| 1045 |
/* PRI_trisect_0_4 */ |
| 1046 |
{PRISM,11,RED_CLASS|SWITCH_CLASS,3, |
| 1047 |
{1,1,1,0,0,0,1,1,1,1,0,0,0,1,0,0,0,0,0}, |
| 1048 |
(1<<3)-1 + (1<<6) + (1<<7) + (1<<8) + (1<<9) + (1<<13), |
| 1049 |
|
| 1050 |
/* sonandnode */ |
| 1051 |
{{0,1},{1,1},{0,2},{0,3},{1,4},{2,5}, |
| 1052 |
{4,4},{5,5},{4,5},{-1,-1},{0,4},{1,5},{0,5}, |
| 1053 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1054 |
{-1,-1}}, |
| 1055 |
|
| 1056 |
/* sons */ |
| 1057 |
{{HEXAHEDRON,{ 0, 6,15,8,3,12,19,14},{FO+0,FO+1,1,2,FO+3,FO+4},-1}, |
| 1058 |
{HEXAHEDRON,{ 6, 1, 7,15,12,4,13,19},{FO+0,FO+1,FO+2,2,0,FO+4}, |
| 1059 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1060 |
{HEXAHEDRON,{ 8,15,7,2,14,19,13,5},{FO+0,0,1,FO+2,FO+3,FO+4}, |
| 1061 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1062 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1063 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1064 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1065 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1066 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1067 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1068 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1069 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1070 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1071 |
|
| 1072 |
/* PRI_rotate_l */ |
| 1073 |
{PRISM,12,RED_CLASS,1, |
| 1074 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 1075 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1076 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1077 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1078 |
{-1,-1}}, |
| 1079 |
{{PRISM,{ 1, 2, 0, 4, 5, 3,-1,-1},{FO+0,FO+2,FO+3,FO+1,FO+4,-1},-1}, |
| 1080 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1081 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1082 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1083 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1084 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1085 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1086 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1087 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1088 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1089 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1090 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1091 |
|
| 1092 |
/* PRI_rotate_r */ |
| 1093 |
{PRISM,13,RED_CLASS,1, |
| 1094 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 1095 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1096 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1097 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1098 |
{-1,-1}}, |
| 1099 |
{{PRISM,{ 2, 0, 1, 5, 3, 4,-1,-1},{FO+0,FO+3,FO+1,FO+2,FO+4,-1},-1}, |
| 1100 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1101 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1102 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1103 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1104 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1105 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1106 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1107 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1108 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1109 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1110 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1111 |
|
| 1112 |
/* PRI_QUADSECT_HEXPRI0 */ |
| 1113 |
{PRISM,14,RED_CLASS,4, |
| 1114 |
{1,1,0,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0}, |
| 1115 |
3 + (1<<3) + (1<<4) + (1<<5) + (1<<6) + (1<<7) + (1<<10) + (1<<11), |
| 1116 |
|
| 1117 |
{{0,1},{0,2},{-1,-1},{0,4},{1,5},{0,7}, |
| 1118 |
{3,5},{3,6},{-1,-1},{-1,-1},{0,5},{0,6}, |
| 1119 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1120 |
{-1,-1}}, |
| 1121 |
{{HEXAHEDRON,{11, 9, 0, 2,17,16,6, 7},{FO+3,3,FO+1,FO+0,FO+2,1},-1}, |
| 1122 |
{PRISM,{ 6, 1, 7,16,10,17,-1,-1},{FO+0,FO+1,FO+2,0,2,-1},-1}, |
| 1123 |
{PRISM,{16,10,17,12, 4,13,-1,-1},{1,FO+1,FO+2,3,FO+4,-1},-1}, |
| 1124 |
{HEXAHEDRON,{ 5, 3, 9,11,13,12,16,17},{FO+3,FO+4,FO+1,0,FO+2,2},-1}, |
| 1125 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1126 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1127 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1128 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1129 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1130 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1131 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1132 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}} |
| 1133 |
|
| 1134 |
}; |
| 1135 |
|
| 1136 |
/* define the regular rules for hexahedra */ |
| 1137 |
static REFRULE HexahedronRules[MAX_HEX_RULES] = |
| 1138 |
{ |
| 1139 |
/* HEX_NO_REF */ |
| 1140 |
{HEXAHEDRON,0,NO_CLASS,0, |
| 1141 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 1142 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1143 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1144 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1145 |
{-1,-1}}, |
| 1146 |
{{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1147 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1148 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1149 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1150 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1151 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1152 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1153 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1154 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1155 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1156 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1157 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1158 |
|
| 1159 |
/* HEX_COPY */ |
| 1160 |
{HEXAHEDRON,1,YELLOW_CLASS,1, |
| 1161 |
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0, |
| 1162 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1163 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1164 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1165 |
{-1,-1}}, |
| 1166 |
{{HEXAHEDRON,{0,1,2,3,4,5,6,7},{FO+0,FO+1,FO+2,FO+3,FO+4,FO+5},-1}, |
| 1167 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1168 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1169 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1170 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1171 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1172 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1173 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1174 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1175 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1176 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1177 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1178 |
|
| 1179 |
/* HEX_RED */ |
| 1180 |
{HEXAHEDRON,2,RED_CLASS|SWITCH_CLASS,8, |
| 1181 |
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},(1<<19)-1, |
| 1182 |
|
| 1183 |
/* sonandnode */ |
| 1184 |
{{0,1},{1,2},{2,3},{3,0}, |
| 1185 |
{0,4},{1,5},{2,6},{3,7}, |
| 1186 |
{4,5},{5,6},{6,7},{7,4}, |
| 1187 |
{0,2},{0,5},{1,6},{2,7},{0,7},{4,6},{0,6}}, |
| 1188 |
|
| 1189 |
/* sons */ |
| 1190 |
{{HEXAHEDRON,{ 0, 8,20,11,12,21,26,24},{FO+0,FO+1, 1, 3,FO+4, 4},-1}, |
| 1191 |
{HEXAHEDRON,{ 8, 1, 9,20,21,13,22,26},{FO+0,FO+1,FO+2, 2, 0, 5}, |
| 1192 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1193 |
{HEXAHEDRON,{20, 9, 2,10,26,22,14,23},{FO+0, 1,FO+2,FO+3, 3, 6}, |
| 1194 |
0x2<<PATHDEPTHSHIFT | 0x2 | 0x3<<3}, |
| 1195 |
{HEXAHEDRON,{11,20,10, 3,24,26,23,15},{FO+0, 0, 2,FO+3,FO+4, 7}, |
| 1196 |
0x1<<PATHDEPTHSHIFT | 0x3}, |
| 1197 |
|
| 1198 |
{HEXAHEDRON,{12,21,26,24, 4,16,25,19},{ 0,FO+1, 5, 7,FO+4,FO+5}, |
| 1199 |
0x1<<PATHDEPTHSHIFT | 0x5}, |
| 1200 |
{HEXAHEDRON,{21,13,22,26,16, 5,17,25},{ 1,FO+1,FO+2, 6, 4,FO+5}, |
| 1201 |
0x2<<PATHDEPTHSHIFT | 0x5 | 0x2<<3}, |
| 1202 |
{HEXAHEDRON,{26,22,14,23,25,17, 6,18},{ 2, 5,FO+2,FO+3, 7,FO+5}, |
| 1203 |
0x3<<PATHDEPTHSHIFT | 0x5 | 0x2<<3 | 0x3<<(2*3)}, |
| 1204 |
{HEXAHEDRON,{24,26,23,15,19,25,18, 7},{ 3, 4, 6,FO+3,FO+4,FO+5}, |
| 1205 |
0x2<<PATHDEPTHSHIFT | 0x5 | 0x3<<3}, |
| 1206 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1207 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1208 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1209 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1210 |
|
| 1211 |
/* HEX_bisect_0_1 */ |
| 1212 |
{HEXAHEDRON,3,RED_CLASS|SWITCH_CLASS,2, |
| 1213 |
{1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0}, |
| 1214 |
1 + (1<<2) + (1<<8) + (1<<10), |
| 1215 |
|
| 1216 |
/* sonandnode */ |
| 1217 |
{{0,0},{-1,-1},{0,0},{-1,-1},{-1,-1},{-1,-1}, |
| 1218 |
{-1,-1},{-1,-1},{0,0},{-1,-1},{0,0},{-1,-1}, |
| 1219 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1220 |
{-1,-1}}, |
| 1221 |
|
| 1222 |
/* sons */ |
| 1223 |
{{HEXAHEDRON,{ 0, 8,10,3,4,16,18,7},{FO+0,FO+1, 1,FO+3,FO+4,FO+5},-1}, |
| 1224 |
{HEXAHEDRON,{ 8, 1, 2,10,16,5,6,18},{FO+0,FO+1,FO+2,FO+3, 0,FO+5}, |
| 1225 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1226 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1227 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1228 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1229 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1230 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1231 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1232 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1233 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1234 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1235 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1236 |
|
| 1237 |
/* HEX_bisect_0_2 */ |
| 1238 |
{HEXAHEDRON,4,RED_CLASS|SWITCH_CLASS,2, |
| 1239 |
{0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, |
| 1240 |
(1<<1) + (1<<3) + (1<<9) + (1<<11), |
| 1241 |
|
| 1242 |
/* sonandnode */ |
| 1243 |
{{-1,-1},{0,0},{-1,-1},{0,0},{-1,-1},{-1,-1}, |
| 1244 |
{-1,-1},{-1,-1},{-1,-1},{0,0},{-1,-1},{0,0}, |
| 1245 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1246 |
{-1,-1}}, |
| 1247 |
|
| 1248 |
/* sons */ |
| 1249 |
{{HEXAHEDRON,{ 0, 1,9,11,4,5,17,19},{FO+0,FO+1,FO+2,1,FO+4,FO+5},-1}, |
| 1250 |
{HEXAHEDRON,{ 11, 9, 2,3,19,17,6,7},{FO+0,0,FO+2,FO+3,FO+4,FO+5}, |
| 1251 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1252 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1253 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1254 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1255 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1256 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1257 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1258 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1259 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1260 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1261 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1262 |
|
| 1263 |
/* HEX_bisect_0_3 */ |
| 1264 |
{HEXAHEDRON,5,RED_CLASS|SWITCH_CLASS,2, |
| 1265 |
{0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0}, |
| 1266 |
(1<<4) + (1<<5) + (1<<6) + (1<<7), |
| 1267 |
|
| 1268 |
/* sonandnode */ |
| 1269 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1},{0,0},{0,0}, |
| 1270 |
{0,0},{0,0},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1271 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1272 |
{-1,-1}}, |
| 1273 |
|
| 1274 |
/* sons */ |
| 1275 |
{{HEXAHEDRON,{ 0, 1,2,3,12,13,14,15},{FO+0,FO+1,FO+2,FO+3,FO+4,1},-1}, |
| 1276 |
{HEXAHEDRON,{ 12,13,14,15,4,5,6,7},{0,FO+1,FO+2,FO+3,FO+4,FO+5}, |
| 1277 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1278 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1279 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1280 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1281 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1282 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1283 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1284 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1285 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1286 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1287 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1288 |
|
| 1289 |
/* HEX_quadsect_0 */ |
| 1290 |
{HEXAHEDRON,6,RED_CLASS|SWITCH_CLASS,4, |
| 1291 |
{1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,1,0}, |
| 1292 |
(1<<4)-1 + (1<<8) + (1<<9) + (1<<10) + (1<<11) + (1<<12) + (1<<17), |
| 1293 |
|
| 1294 |
/* sonandnode */ |
| 1295 |
{{0,1},{1,2},{2,3},{0,3}, |
| 1296 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1297 |
{0,5},{1,6},{2,7},{0,7}, |
| 1298 |
{0,2},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{0,6},{-1,-1}}, |
| 1299 |
|
| 1300 |
/* sons */ |
| 1301 |
{{HEXAHEDRON,{ 0, 8,20,11,4,16,25,19},{FO+0,FO+1,1,3,FO+4,FO+5},-1}, |
| 1302 |
{HEXAHEDRON,{ 8, 1, 9,20,16,5,17,25},{FO+0,FO+1,FO+2,2,0,FO+5}, |
| 1303 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1304 |
{HEXAHEDRON,{ 20, 9, 2,10,25,17,6,18},{FO+0,1,FO+2,FO+3,3,FO+5}, |
| 1305 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1306 |
{HEXAHEDRON,{ 11, 20, 10,3,19,25,18,7},{FO+0,0,2,FO+3,FO+4,FO+5}, |
| 1307 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1308 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1309 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1310 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1311 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1312 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1313 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1314 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1315 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1316 |
|
| 1317 |
/* HEX_quadsect_1 */ |
| 1318 |
{HEXAHEDRON,7,RED_CLASS|SWITCH_CLASS,4, |
| 1319 |
{1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,0,0}, |
| 1320 |
1 + (1<<2) + (1<<4) + (1<<5) + (1<<6) + (1<<7) + (1<<8) + (1<<10) + (1<<13) + (1<<15), |
| 1321 |
|
| 1322 |
/* sonandnode */ |
| 1323 |
{{0,1},{-1,-1},{0,2},{-1,-1}, |
| 1324 |
{0,4},{1,5},{1,6},{0,7}, |
| 1325 |
{3,5},{-1,-1},{3,6},{-1,-1}, |
| 1326 |
{-1,-1},{0,5},{-1,-1},{0,6},{-1,-1},{-1,-1},{-1,-1}}, |
| 1327 |
|
| 1328 |
/* sons */ |
| 1329 |
{{HEXAHEDRON,{ 0, 8,10,3,12,21,23,15},{FO+0,FO+1,1,FO+3,FO+4,3},-1}, |
| 1330 |
{HEXAHEDRON,{ 8, 1, 2,10,21,13,14,23},{FO+0,FO+1,FO+2,FO+3,0,2}, |
| 1331 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1332 |
{HEXAHEDRON,{ 21, 13, 14,23,16,5,6,18},{1,FO+1,FO+2,FO+3,3,FO+5}, |
| 1333 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1334 |
{HEXAHEDRON,{ 12, 21, 23,15,4,16,18,7},{0,FO+1,2,FO+3,FO+4,FO+5}, |
| 1335 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1336 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1337 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1338 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1339 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1340 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1341 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1342 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1343 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1344 |
|
| 1345 |
/* HEX_quadsect_2 */ |
| 1346 |
{HEXAHEDRON,8,RED_CLASS|SWITCH_CLASS,4, |
| 1347 |
{0,1,0,1,1,1,1,1,0,1,0,1,0,0,1,0,1,0,0}, |
| 1348 |
(1<<1) + (1<<3) + (1<<4) + (1<<5) + (1<<6) + (1<<7) + (1<<9) + (1<<11) + (1<<14) + (1<<16), |
| 1349 |
|
| 1350 |
/* sonandnode */ |
| 1351 |
{{-1,-1},{0,2},{-1,-1},{0,3}, |
| 1352 |
{0,4},{0,5},{1,6},{1,7}, |
| 1353 |
{-1,-1},{3,6},{-1,-1},{3,7}, |
| 1354 |
{-1,-1},{-1,-1},{0,6},{-1,-1},{0,7},{-1,-1},{-1,-1}}, |
| 1355 |
|
| 1356 |
/* sons */ |
| 1357 |
{{HEXAHEDRON,{ 0, 1,9,11,12,13,22,24},{FO+0,FO+1,FO+2,1,FO+4,3},-1}, |
| 1358 |
{HEXAHEDRON,{ 11, 9, 2,3,24,22,14,15},{FO+0,0,FO+2,FO+3,FO+4,2}, |
| 1359 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1360 |
{HEXAHEDRON,{ 24, 22, 14,15,19,17,6,7},{1,3,FO+2,FO+3,FO+4,FO+5}, |
| 1361 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1362 |
{HEXAHEDRON,{ 12, 13, 22,24,4,5,17,19},{0,FO+1,FO+2,2,FO+4,FO+5}, |
| 1363 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1364 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1365 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1366 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1367 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1368 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1369 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1370 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1371 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1372 |
|
| 1373 |
/* HEX_trisect_0 */ |
| 1374 |
{HEXAHEDRON,9,RED_CLASS|SWITCH_CLASS,3, |
| 1375 |
{1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},(1<<2)+1, |
| 1376 |
|
| 1377 |
/* sonandnode */ |
| 1378 |
{{0,0},{-1,-1},{0,0},{-1,-1},{-1,-1},{-1,-1}, |
| 1379 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1380 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1381 |
{-1,-1}}, |
| 1382 |
|
| 1383 |
/* sons */ |
| 1384 |
{{PRISM,{0,4,8,3,7,10,-1,-1},{FO+1,FO+4,1,FO+0,FO+3,-1},-1}, |
| 1385 |
{PRISM,{ 4, 5, 8,7,6,10,-1,-1},{FO+1,FO+5,2,0,FO+3,-1}, |
| 1386 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1387 |
{PRISM,{ 5, 1, 8,6,2,10,-1,-1},{FO+1,FO+2,FO+0,1,FO+3,-1}, |
| 1388 |
0x1<<PATHDEPTHSHIFT | 0x2}, |
| 1389 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1390 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1391 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1392 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1393 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1394 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1395 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1396 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1397 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}}}, |
| 1398 |
|
| 1399 |
/* HEX_trisect_5 */ |
| 1400 |
{HEXAHEDRON,9,RED_CLASS|SWITCH_CLASS,3, |
| 1401 |
{0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0}, |
| 1402 |
(1<<8) + (1<<10), |
| 1403 |
|
| 1404 |
/* sonandnode */ |
| 1405 |
{{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1406 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1407 |
{0,0},{-1,-1},{0,0},{-1,-1}, |
| 1408 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 1409 |
|
| 1410 |
/* sons */ |
| 1411 |
{ |
| 1412 |
{PRISM,{ 4, 16,0,7,18,3,-1,-1},{FO+1,FO+5,1,FO+4,FO+3,-1},-1}, |
| 1413 |
{PRISM,{ 16, 1,0,18,2,3,-1,-1},{FO+1,2,FO+0,0,FO+3,-1},-1}, |
| 1414 |
{PRISM,{ 5, 1,16,6,2,18,-1,-1},{FO+1,FO+2,1,FO+5,FO+3,-1},-1}, |
| 1415 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1416 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1417 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1418 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1419 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1420 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1421 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1422 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1423 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1} |
| 1424 |
}}, |
| 1425 |
|
| 1426 |
/* HEX_bisect_hexpri0 */ |
| 1427 |
{HEXAHEDRON,10,RED_CLASS|SWITCH_CLASS,2, |
| 1428 |
{0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0}, |
| 1429 |
(1<<3) + (1<<11), |
| 1430 |
|
| 1431 |
/* sonandnode */ |
| 1432 |
{{-1,-1},{-1,-1},{-1,-1},{0,3}, |
| 1433 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1434 |
{-1,-1},{-1,-1},{-1,-1},{0,7}, |
| 1435 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 1436 |
|
| 1437 |
/* sons */ |
| 1438 |
{ |
| 1439 |
{HEXAHEDRON,{ 0, 1, 2,11, 4, 5, 6,19},{FO+0,FO+1,FO+2,1,FO+4,FO+5},-1}, |
| 1440 |
{PRISM,{11, 2, 3,19, 6, 7,-1,-1},{FO+0,0,FO+2,FO+3,FO+4,-1},-1}, |
| 1441 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1442 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1443 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1444 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1445 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1446 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1447 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1448 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1449 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1450 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1} |
| 1451 |
}}, |
| 1452 |
|
| 1453 |
/* HEX_bisect_hexpri1 */ |
| 1454 |
{HEXAHEDRON,11,RED_CLASS|SWITCH_CLASS,2, |
| 1455 |
{1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, |
| 1456 |
1 + (1<<8), |
| 1457 |
|
| 1458 |
/* sonandnode */ |
| 1459 |
{{0,0},{-1,-1},{-1,-1},{-1,-1}, |
| 1460 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
| 1461 |
{0,4},{-1,-1},{-1,-1},{-1,-1}, |
| 1462 |
{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}}, |
| 1463 |
|
| 1464 |
/* sons */ |
| 1465 |
{ |
| 1466 |
{HEXAHEDRON,{ 8, 1, 2, 3,16, 5, 6, 7},{FO+0,FO+1,FO+2,FO+3,1,FO+5},-1}, |
| 1467 |
{PRISM,{ 8, 3, 0,16, 7, 4,-1,-1},{FO+0,0,FO+2,FO+3,FO+4,-1},-1}, |
| 1468 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1469 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1470 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1471 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1472 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1473 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1474 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1475 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1476 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1}, |
| 1477 |
{-1,{-1,-1,-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},-1} |
| 1478 |
}} |
| 1479 |
|
| 1480 |
}; |
| 1481 |
#endif |
| 1482 |
|
| 1483 |
/****************************************************************************/ |
| 1484 |
/* */ |
| 1485 |
/* forward declarations of functions used before they are defined */ |
| 1486 |
/* */ |
| 1487 |
/****************************************************************************/ |
| 1488 |
|
| 1489 |
#ifdef UG_DIM_3 |
| 1490 |
|
| 1491 |
INT NS_DIM_PREFIX GetRule_AnisotropicRed (ELEMENT *theElement, INT *Rule) |
| 1492 |
{ |
| 1493 |
DOUBLE area,norm; |
| 1494 |
DOUBLE_VECTOR a,b,c; |
| 1495 |
|
| 1496 |
switch (TAG(theElement)) |
| 1497 |
{ |
| 1498 |
case TETRAHEDRON : |
| 1499 |
*Rule=TET_RED; |
| 1500 |
return (0); |
| 1501 |
|
| 1502 |
case PYRAMID : |
| 1503 |
*Rule=PYR_RED; |
| 1504 |
return (0); |
| 1505 |
|
| 1506 |
case PRISM : |
| 1507 |
*Rule=PRI_RED; |
| 1508 |
V3_SUBTRACT(CVECT(MYVERTEX(CORNER(theElement,1))),CVECT(MYVERTEX(CORNER(theElement,0))),a); |
| 1509 |
V3_SUBTRACT(CVECT(MYVERTEX(CORNER(theElement,2))),CVECT(MYVERTEX(CORNER(theElement,0))),b); |
| 1510 |
V3_VECTOR_PRODUCT(a,b,c); |
| 1511 |
V3_EUKLIDNORM(c,area); |
| 1512 |
area *= 0.5; |
| 1513 |
V3_SUBTRACT(CVECT(MYVERTEX(CORNER(theElement,3))),CVECT(MYVERTEX(CORNER(theElement,0))),a); |
| 1514 |
V3_EUKLIDNORM(a,norm); |
| 1515 |
if (norm < 0.25*std::sqrt(area)) |
| 1516 |
{ |
| 1517 |
*Rule=PRI_QUADSECT; |
| 1518 |
return(1); |
| 1519 |
} |
| 1520 |
break; |
| 1521 |
|
| 1522 |
case HEXAHEDRON : |
| 1523 |
*Rule=HEXA_RED; |
| 1524 |
return (0); |
| 1525 |
|
| 1526 |
default : |
| 1527 |
assert(0); |
| 1528 |
} |
| 1529 |
|
| 1530 |
return (0); |
| 1531 |
} |
| 1532 |
|
| 1533 |
|
| 1534 |
/****************************************************************************/ |
| 1535 |
/** \brief Compute best full refined refrule for the element |
| 1536 |
|
| 1537 |
\param theElement - for that element |
| 1538 |
|
| 1539 |
This function computes the best full refined refrule for the element. |
| 1540 |
|
| 1541 |
\return |
| 1542 |
Mark: number of refrule |
| 1543 |
*/ |
| 1544 |
/****************************************************************************/ |
| 1545 |
|
| 1546 |
static INT ShortestInteriorEdge (ELEMENT *theElement) |
| 1547 |
{ |
| 1548 |
DOUBLE *Corners[MAX_CORNERS_OF_ELEM]; |
| 1549 |
DOUBLE_VECTOR MidPoints[MAX_EDGES_OF_ELEM]; |
| 1550 |
INT i, flags; |
| 1551 |
DOUBLE Dist_0_5, Dist_1_3, Dist_2_4; |
| 1552 |
|
| 1553 |
/* get physical position of the corners */ |
| 1554 |
for (i=0; i<CORNERS_OF_ELEM(theElement); i++) |
| 1555 |
Corners[i] = CVECT(MYVERTEX(CORNER(theElement,i))).data(); |
| 1556 |
|
| 1557 |
/* get physical position of the midpoints of the edges */ |
| 1558 |
for (i=0; i<EDGES_OF_ELEM(theElement); i++) |
| 1559 |
V3_LINCOMB(0.5, Corners[CORNER_OF_EDGE(theElement,i,0)], 0.5, Corners[CORNER_OF_EDGE(theElement,i,1)], MidPoints[i]); |
| 1560 |
|
| 1561 |
/* compute distances */ |
| 1562 |
V3_EUKLIDNORM_OF_DIFF(MidPoints[0], MidPoints[5], Dist_0_5) |
| 1563 |
V3_EUKLIDNORM_OF_DIFF(MidPoints[1], MidPoints[3], Dist_1_3) |
| 1564 |
V3_EUKLIDNORM_OF_DIFF(MidPoints[2], MidPoints[4], Dist_2_4) |
| 1565 |
|
| 1566 |
/* return best Refrule (shortest interior edge) */ |
| 1567 |
flags = (Dist_0_5 < Dist_1_3) ; |
| 1568 |
flags |= ((Dist_1_3 < Dist_2_4) <<1) ; |
| 1569 |
flags |= ((Dist_2_4 < Dist_0_5) <<2) ; |
| 1570 |
assert(flags != 7); |
| 1571 |
|
| 1572 |
switch(flags) |
| 1573 |
{ |
| 1574 |
case 0 : /* Dist_0_5 = Dist_2_4 = Dist_1_3 */ |
| 1575 |
return (FULL_REFRULE_0_5); |
| 1576 |
case 1 : /* Dist_0_5 < Dist_2_4 < Dist_1_3 */ |
| 1577 |
return (FULL_REFRULE_0_5); |
| 1578 |
case 2 : /* Dist_1_3 < Dist_0_5 < Dist_2_4 */ |
| 1579 |
return (FULL_REFRULE_1_3); |
| 1580 |
case 3 : /* Dist_0_5 < Dist_1_3 < Dist_2_4 */ |
| 1581 |
return (FULL_REFRULE_0_5); |
| 1582 |
case 4 : /* Dist_2_4 < Dist_1_3 < Dist_0_5 */ |
| 1583 |
return (FULL_REFRULE_2_4); |
| 1584 |
case 5 : /* Dist_2_4 < Dist_0_5 < Dist_1_3 */ |
| 1585 |
return (FULL_REFRULE_2_4); |
| 1586 |
case 6 : /* Dist_1_3 < Dist_2_4 < Dist_0_5 */ |
| 1587 |
return (FULL_REFRULE_1_3); |
| 1588 |
} |
| 1589 |
return (-1); |
| 1590 |
} |
| 1591 |
|
| 1592 |
|
| 1593 |
#ifdef __ALLRULES__ |
| 1594 |
|
| 1595 |
|
| 1596 |
/****************************************************************************/ |
| 1597 |
/** \brief Compute best full refined refrule for the element |
| 1598 |
|
| 1599 |
\param theElement - for that element |
| 1600 |
|
| 1601 |
This function computes the best full refined refrule for the element |
| 1602 |
|
| 1603 |
\return |
| 1604 |
Mark: number of refrule |
| 1605 |
*/ |
| 1606 |
/****************************************************************************/ |
| 1607 |
|
| 1608 |
static INT MinimalSideAngle (ELEMENT *theElement) |
| 1609 |
{ |
| 1610 |
DOUBLE *Corners[MAX_CORNERS_OF_ELEM]; |
| 1611 |
DOUBLE_VECTOR MidPoints[MAX_EDGES_OF_ELEM]; |
| 1612 |
|
| 1613 |
/* get physical position of the corners */ |
| 1614 |
for (INT i=0; i<CORNERS_OF_ELEM(theElement); i++) |
| 1615 |
Corners[i] = CVECT(MYVERTEX(CORNER(theElement,i))); |
| 1616 |
|
| 1617 |
/* get physical position of the midpoints of the edges */ |
| 1618 |
for (INT i=0; i<EDGES_OF_ELEM(theElement); i++) |
| 1619 |
V3_LINCOMB(0.5, Corners[CORNER_OF_EDGE(theElement,i,0)], 0.5, Corners[CORNER_OF_EDGE(theElement,i,1)], MidPoints[i]); |
| 1620 |
|
| 1621 |
/* try possibilities */ |
| 1622 |
DOUBLE Min = 190.0; |
| 1623 |
INT imin = 0; |
| 1624 |
for (INT i=0; i<3; i++) |
| 1625 |
{ |
| 1626 |
INT j = OPPOSITE_EDGE(theElement,i); |
| 1627 |
Corners[2] = MidPoints[i]; |
| 1628 |
Corners[3] = MidPoints[j]; |
| 1629 |
|
| 1630 |
DOUBLE Max = 0.0; |
| 1631 |
for (INT k=0; k<2; k++) |
| 1632 |
{ |
| 1633 |
DOUBLE MaxAngle; |
| 1634 |
for (INT l=0; l<2; l++) |
| 1635 |
Corners[l] = MidPoints[SideEdgesOfEdge[i][k][l]]; |
| 1636 |
if (TetMaxSideAngle(theElement,Corners,&MaxAngle)) |
| 1637 |
return (FULL_REFRULE_0_5); |
| 1638 |
Max = MAX(Max,MaxAngle); |
| 1639 |
} |
| 1640 |
for (INT k=0; k<2; k++) |
| 1641 |
{ |
| 1642 |
DOUBLE MaxAngle; |
| 1643 |
for (INT l=0; l<2; l++) |
| 1644 |
Corners[l] = MidPoints[SideEdgesOfEdge[j][k][l]]; |
| 1645 |
if (TetMaxSideAngle(theElement,Corners,&MaxAngle)) |
| 1646 |
return (FULL_REFRULE_0_5); |
| 1647 |
Max = MAX(Max,MaxAngle); |
| 1648 |
} |
| 1649 |
if (Max<Min) |
| 1650 |
{ |
| 1651 |
Min = Max; |
| 1652 |
imin = i; |
| 1653 |
} |
| 1654 |
} |
| 1655 |
|
| 1656 |
switch (imin) |
| 1657 |
{ |
| 1658 |
case 0 : |
| 1659 |
return (FULL_REFRULE_0_5); |
| 1660 |
case 1 : |
| 1661 |
return (FULL_REFRULE_1_3); |
| 1662 |
case 2 : |
| 1663 |
return (FULL_REFRULE_2_4); |
| 1664 |
} |
| 1665 |
} |
| 1666 |
|
| 1667 |
|
| 1668 |
/****************************************************************************/ |
| 1669 |
/** \brief Compute best full refined refrule for the element |
| 1670 |
|
| 1671 |
\param theElement - for that element |
| 1672 |
|
| 1673 |
This function computes the best full refined refrule for the element |
| 1674 |
|
| 1675 |
\return |
| 1676 |
Mark: number of refrule |
| 1677 |
*/ |
| 1678 |
/****************************************************************************/ |
| 1679 |
|
| 1680 |
static INT MinimalSideEntry (ELEMENT *theElement) |
| 1681 |
{ |
| 1682 |
DOUBLE *Corners[MAX_CORNERS_OF_ELEM]; |
| 1683 |
DOUBLE_VECTOR MidPoints[MAX_EDGES_OF_ELEM]; |
| 1684 |
INT i,j,k,l,imin; |
| 1685 |
DOUBLE Angle[MAX_EDGES_OF_ELEM],Length[MAX_EDGES_OF_ELEM],Max,Min,help; |
| 1686 |
|
| 1687 |
/* get physical position of the corners */ |
| 1688 |
for (i=0; i<CORNERS_OF_ELEM(theElement); i++) |
| 1689 |
Corners[i] = CVECT(MYVERTEX(CORNER(theElement,i))); |
| 1690 |
|
| 1691 |
/* get physical position of the midpoints of the edges */ |
| 1692 |
for (i=0; i<EDGES_OF_ELEM(theElement); i++) |
| 1693 |
V3_LINCOMB(0.5, Corners[CORNER_OF_EDGE(theElement,i,0)], 0.5, Corners[CORNER_OF_EDGE(theElement,i,1)], MidPoints[i]); |
| 1694 |
|
| 1695 |
/* try possibilities */ |
| 1696 |
Min = MAX_C; |
| 1697 |
for (i=0; i<3; i++) |
| 1698 |
{ |
| 1699 |
j = OPPOSITE_EDGE(theElement,i); |
| 1700 |
Corners[2] = MidPoints[i]; |
| 1701 |
Corners[3] = MidPoints[j]; |
| 1702 |
|
| 1703 |
Max = 0.0; |
| 1704 |
for (k=0; k<2; k++) |
| 1705 |
{ |
| 1706 |
for (l=0; l<2; l++) |
| 1707 |
Corners[l] = MidPoints[SideEdgesOfEdge[i][k][l]]; |
| 1708 |
if (TetAngleAndLength(theElement,Corners,Angle,Length)) |
| 1709 |
return (FULL_REFRULE_0_5); |
| 1710 |
for (l=0; l<EDGES_OF_ELEM(theElement); l++) |
| 1711 |
if (Angle[l]>PI/2.0) |
| 1712 |
{ |
| 1713 |
help = std::abs(Length[l]*(DOUBLE)(cos((double)Angle[l])/sin((double)Angle[l]))); |
| 1714 |
Max = MAX(Max,help); |
| 1715 |
} |
| 1716 |
} |
| 1717 |
for (k=0; k<2; k++) |
| 1718 |
{ |
| 1719 |
for (l=0; l<2; l++) |
| 1720 |
Corners[l] = MidPoints[SideEdgesOfEdge[j][k][l]]; |
| 1721 |
if (TetAngleAndLength(theElement,Corners,Angle,Length)) |
| 1722 |
return (FULL_REFRULE_0_5); |
| 1723 |
for (i=0; i<EDGES_OF_ELEM(theElement); i++) |
| 1724 |
if (Angle[l]>PI/2.0) |
| 1725 |
{ |
| 1726 |
help = std::abs(Length[l]*(DOUBLE)(cos((double)Angle[l])/sin((double)Angle[l]))); |
| 1727 |
Max = MAX(Max,help); |
| 1728 |
} |
| 1729 |
} |
| 1730 |
if (Max<Min) |
| 1731 |
{ |
| 1732 |
Min = Max; |
| 1733 |
imin = i; |
| 1734 |
} |
| 1735 |
} |
| 1736 |
|
| 1737 |
switch (imin) |
| 1738 |
{ |
| 1739 |
case 0 : |
| 1740 |
return (FULL_REFRULE_0_5); |
| 1741 |
case 1 : |
| 1742 |
return (FULL_REFRULE_1_3); |
| 1743 |
case 2 : |
| 1744 |
return (FULL_REFRULE_2_4); |
| 1745 |
} |
| 1746 |
} |
| 1747 |
|
| 1748 |
|
| 1749 |
/****************************************************************************/ |
| 1750 |
/** \brief Compute best full refined refrule for the element |
| 1751 |
|
| 1752 |
\param theElement - for that element |
| 1753 |
|
| 1754 |
This function computes the best full refined refrule for the element: optimal laplace-disc w.r.t. M-Matrix eigenschaft. |
| 1755 |
|
| 1756 |
\return |
| 1757 |
Mark: number of refrule |
| 1758 |
*/ |
| 1759 |
/****************************************************************************/ |
| 1760 |
|
| 1761 |
static INT BestLaplaceMMatrix (ELEMENT *theElement) |
| 1762 |
{ |
| 1763 |
DOUBLE *Corners[MAX_CORNERS_OF_ELEM]; |
| 1764 |
DOUBLE_VECTOR MidPoints[MAX_EDGES_OF_ELEM]; |
| 1765 |
INT i,j,k,l,imin,TBFR,refrule; |
| 1766 |
DOUBLE Angle[MAX_EDGES_OF_ELEM],Length[MAX_EDGES_OF_ELEM],sum,Min; |
| 1767 |
|
| 1768 |
/* get physical position of the corners */ |
| 1769 |
for (i=0; i<CORNERS_OF_ELEM(theElement); i++) |
| 1770 |
Corners[i] = CVECT(MYVERTEX(CORNER(theElement,i))); |
| 1771 |
|
| 1772 |
/* get physical position of the midpoints of the edges */ |
| 1773 |
for (i=0; i<EDGES_OF_ELEM(theElement); i++) |
| 1774 |
V3_LINCOMB(0.5, Corners[CORNER_OF_EDGE(theElement,i,0)], 0.5, Corners[CORNER_OF_EDGE(theElement,i,1)], MidPoints[i]); |
| 1775 |
|
| 1776 |
/* try possebilities */ |
| 1777 |
Min = MAX_C; imin = -1; |
| 1778 |
for (i=0; i<3; i++) |
| 1779 |
{ |
| 1780 |
j = OPPOSITE_EDGE(theElement,i); |
| 1781 |
Corners[2] = MidPoints[i]; |
| 1782 |
Corners[3] = MidPoints[j]; |
| 1783 |
|
| 1784 |
sum = 0.0; |
| 1785 |
for (k=0; k<2; k++) |
| 1786 |
{ |
| 1787 |
for (l=0; l<2; l++) |
| 1788 |
Corners[l] = MidPoints[SideEdgesOfEdge[i][k][l]]; |
| 1789 |
if (TetAngleAndLength(theElement,Corners,Angle,Length)) |
| 1790 |
return (FULL_REFRULE_0_5); |
| 1791 |
for (l=0; l<EDGES_OF_ELEM(theElement); l++) |
| 1792 |
if (Angle[l]>PI/2.0) |
| 1793 |
sum += std::abs(Length[l]*(DOUBLE)cos((double)Angle[l])/(DOUBLE)sin((double)Angle[l])); |
| 1794 |
} |
| 1795 |
for (k=0; k<2; k++) |
| 1796 |
{ |
| 1797 |
for (l=0; l<2; l++) |
| 1798 |
Corners[l] = MidPoints[SideEdgesOfEdge[j][k][l]]; |
| 1799 |
if (TetAngleAndLength(theElement,Corners,Angle,Length)) |
| 1800 |
return (FULL_REFRULE_0_5); |
| 1801 |
for (i=0; i<EDGES_OF_ELEM(theElement); i++) |
| 1802 |
if (Angle[l]>PI/2.0) |
| 1803 |
sum += std::abs(Length[l]*(DOUBLE)cos((double)Angle[l])/(DOUBLE)sin((double)Angle[l])); |
| 1804 |
} |
| 1805 |
if (sum<Min) |
| 1806 |
{ |
| 1807 |
Min = sum; |
| 1808 |
imin = i; |
| 1809 |
} |
| 1810 |
} |
| 1811 |
|
| 1812 |
switch (imin) |
| 1813 |
{ |
| 1814 |
case 0 : |
| 1815 |
refrule = FULL_REFRULE_0_5; |
| 1816 |
break; |
| 1817 |
case 1 : |
| 1818 |
refrule = FULL_REFRULE_1_3; |
| 1819 |
break; |
| 1820 |
case 2 : |
| 1821 |
refrule = FULL_REFRULE_2_4; |
| 1822 |
break; |
| 1823 |
} |
| 1824 |
|
| 1825 |
|
| 1826 |
TBFR = ShortestInteriorEdge(theElement); |
| 1827 |
if (imin == -1) |
| 1828 |
{ |
| 1829 |
refrule = TBFR; |
| 1830 |
UserWrite ("#"); |
| 1831 |
} |
| 1832 |
|
| 1833 |
return (refrule); |
| 1834 |
} |
| 1835 |
|
| 1836 |
#endif |
| 1837 |
|
| 1838 |
|
| 1839 |
/****************************************************************************/ |
| 1840 |
/** \brief Compute best full refined refrule for the element |
| 1841 |
|
| 1842 |
\param theElement - for that element |
| 1843 |
|
| 1844 |
This function computes the best full refined refrule for the element: optimal laplace-disc w.r.t. M-Matrix eigenschaft |
| 1845 |
|
| 1846 |
\return |
| 1847 |
.n Mark: number of refrule |
| 1848 |
*/ |
| 1849 |
/****************************************************************************/ |
| 1850 |
|
| 1851 |
static INT MaxPerpendicular (ELEMENT *theElement) |
| 1852 |
{ |
| 1853 |
DOUBLE *Corners[MAX_CORNERS_OF_ELEM]; |
| 1854 |
DOUBLE_VECTOR MidPoints[MAX_EDGES_OF_ELEM]; |
| 1855 |
|
| 1856 |
/* get physical position of the corners */ |
| 1857 |
for (INT i=0; i<CORNERS_OF_ELEM(theElement); i++) |
| 1858 |
Corners[i] = CVECT(MYVERTEX(CORNER(theElement,i))).data(); |
| 1859 |
|
| 1860 |
/* get physical position of the midpoints of the edges */ |
| 1861 |
for (INT i=0; i<EDGES_OF_ELEM(theElement); i++) |
| 1862 |
V3_LINCOMB(0.5, Corners[CORNER_OF_EDGE(theElement,i,0)], 0.5, Corners[CORNER_OF_EDGE(theElement,i,1)], MidPoints[i]); |
| 1863 |
|
| 1864 |
/* try possibilities */ |
| 1865 |
DOUBLE Max = -MAX_C; |
| 1866 |
INT imin = -1; |
| 1867 |
for (INT i=0; i<3; i++) |
| 1868 |
{ |
| 1869 |
DOUBLE_VECTOR a,b,c; |
| 1870 |
DOUBLE sprd; |
| 1871 |
INT j = OPPOSITE_EDGE(theElement,i); |
| 1872 |
|
| 1873 |
V3_SUBTRACT(Corners[CORNER_OF_EDGE(theElement,i,0)],Corners[CORNER_OF_EDGE(theElement,i,1)],a) |
| 1874 |
V3_SUBTRACT(Corners[CORNER_OF_EDGE(theElement,j,0)],Corners[CORNER_OF_EDGE(theElement,j,1)],b) |
| 1875 |
V3_VECTOR_PRODUCT(a,b,c) |
| 1876 |
V3_Normalize(c); |
| 1877 |
V3_SUBTRACT(MidPoints[i],MidPoints[j],a) |
| 1878 |
V3_Normalize(a); |
| 1879 |
V3_SCALAR_PRODUCT(a,c,sprd) |
| 1880 |
sprd = std::abs(sprd); |
| 1881 |
|
| 1882 |
if (sprd>Max) |
| 1883 |
{ |
| 1884 |
Max = sprd; |
| 1885 |
imin = i; |
| 1886 |
} |
| 1887 |
} |
| 1888 |
|
| 1889 |
INT refrule; |
| 1890 |
switch (imin) |
| 1891 |
{ |
| 1892 |
case -1 : |
| 1893 |
refrule = ShortestInteriorEdge (theElement); |
| 1894 |
UserWrite ("#"); |
| 1895 |
break; |
| 1896 |
case 0 : |
| 1897 |
refrule = FULL_REFRULE_0_5; |
| 1898 |
break; |
| 1899 |
case 1 : |
| 1900 |
refrule = FULL_REFRULE_1_3; |
| 1901 |
break; |
| 1902 |
case 2 : |
| 1903 |
refrule = FULL_REFRULE_2_4; |
| 1904 |
break; |
| 1905 |
} |
| 1906 |
|
| 1907 |
return (refrule); |
| 1908 |
} |
| 1909 |
|
| 1910 |
|
| 1911 |
/****************************************************************************/ |
| 1912 |
/** \brief |
| 1913 |
MaxRightAngle - compute best full refined refrule for the element |
| 1914 |
|
| 1915 |
SYNOPSIS: |
| 1916 |
static INT MaxRightAngle (ELEMENT *theElement); |
| 1917 |
|
| 1918 |
PARAMETERS: |
| 1919 |
\param theElement - for that element |
| 1920 |
|
| 1921 |
DESCRIPTION: |
| 1922 |
This function computes the best full refined refrule for the element: optimal laplace-disc w.r.t. M-Matrix eigenschaft |
| 1923 |
|
| 1924 |
\return |
| 1925 |
INT |
| 1926 |
.n Mark: number of refrule |
| 1927 |
*/ |
| 1928 |
/****************************************************************************/ |
| 1929 |
|
| 1930 |
static INT MaxRightAngle (ELEMENT *theElement) |
| 1931 |
{ |
| 1932 |
DOUBLE *Corners[MAX_CORNERS_OF_ELEM]; |
| 1933 |
|
| 1934 |
/* get physical position of the corners */ |
| 1935 |
for (INT i=0; i<CORNERS_OF_ELEM(theElement); i++) |
| 1936 |
Corners[i] = CVECT(MYVERTEX(CORNER(theElement,i))).data(); |
| 1937 |
|
| 1938 |
/* try possibilities */ |
| 1939 |
DOUBLE Min = MAX_C; |
| 1940 |
INT imin = -1; |
| 1941 |
for (INT i=0; i<3; i++) |
| 1942 |
{ |
| 1943 |
DOUBLE_VECTOR a,b; |
| 1944 |
DOUBLE sprd; |
| 1945 |
INT j = OPPOSITE_EDGE(theElement,i); |
| 1946 |
|
| 1947 |
V3_SUBTRACT(Corners[CORNER_OF_EDGE(theElement,i,0)],Corners[CORNER_OF_EDGE(theElement,i,1)],a) |
| 1948 |
V3_Normalize(a); |
| 1949 |
V3_SUBTRACT(Corners[CORNER_OF_EDGE(theElement,j,0)],Corners[CORNER_OF_EDGE(theElement,j,1)],b) |
| 1950 |
V3_Normalize(b); |
| 1951 |
V3_SCALAR_PRODUCT(a,b,sprd) |
| 1952 |
sprd = std::abs(sprd); |
| 1953 |
|
| 1954 |
if (sprd<Min) |
| 1955 |
{ |
| 1956 |
Min = sprd; |
| 1957 |
imin = i; |
| 1958 |
} |
| 1959 |
} |
| 1960 |
|
| 1961 |
INT refrule; |
| 1962 |
switch (imin) |
| 1963 |
{ |
| 1964 |
case -1 : |
| 1965 |
refrule = ShortestInteriorEdge (theElement); |
| 1966 |
UserWrite ("#"); |
| 1967 |
break; |
| 1968 |
case 0 : |
| 1969 |
refrule = FULL_REFRULE_0_5; |
| 1970 |
break; |
| 1971 |
case 1 : |
| 1972 |
refrule = FULL_REFRULE_1_3; |
| 1973 |
break; |
| 1974 |
case 2 : |
| 1975 |
refrule = FULL_REFRULE_2_4; |
| 1976 |
break; |
| 1977 |
} |
| 1978 |
|
| 1979 |
return (refrule); |
| 1980 |
} |
| 1981 |
|
| 1982 |
|
| 1983 |
/****************************************************************************/ |
| 1984 |
/** \brief |
| 1985 |
MaxArea - compute best full refined refrule for the element |
| 1986 |
|
| 1987 |
SYNOPSIS: |
| 1988 |
static INT MaxArea (ELEMENT *theElement); |
| 1989 |
|
| 1990 |
PARAMETERS: |
| 1991 |
\param theElement - for that element |
| 1992 |
|
| 1993 |
DESCRIPTION: |
| 1994 |
This function computes the best full refined refrule for the element: optimal laplace-disc w.r.t. M-Matrix eigenschaft |
| 1995 |
|
| 1996 |
\return |
| 1997 |
INT |
| 1998 |
.n Mark: number of refrule |
| 1999 |
*/ |
| 2000 |
/****************************************************************************/ |
| 2001 |
|
| 2002 |
static INT MaxArea (ELEMENT *theElement) |
| 2003 |
{ |
| 2004 |
DOUBLE *Corners[MAX_CORNERS_OF_ELEM]; |
| 2005 |
|
| 2006 |
/* get physical position of the corners */ |
| 2007 |
for (INT i=0; i<CORNERS_OF_ELEM(theElement); i++) |
| 2008 |
Corners[i] = CVECT(MYVERTEX(CORNER(theElement,i))).data(); |
| 2009 |
|
| 2010 |
/* try possebilities */ |
| 2011 |
DOUBLE Max = -MAX_C; |
| 2012 |
INT imin = -1; |
| 2013 |
for (INT i=0; i<3; i++) |
| 2014 |
{ |
| 2015 |
DOUBLE_VECTOR a,b,c; |
| 2016 |
DOUBLE norm; |
| 2017 |
INT j = OPPOSITE_EDGE(theElement,i); |
| 2018 |
|
| 2019 |
V3_SUBTRACT(Corners[CORNER_OF_EDGE(theElement,i,0)],Corners[CORNER_OF_EDGE(theElement,i,1)],a) |
| 2020 |
V3_SUBTRACT(Corners[CORNER_OF_EDGE(theElement,j,0)],Corners[CORNER_OF_EDGE(theElement,j,1)],b) |
| 2021 |
V3_VECTOR_PRODUCT(a,b,c) |
| 2022 |
V3_EUKLIDNORM(c,norm) |
| 2023 |
|
| 2024 |
if (norm>Max) |
| 2025 |
{ |
| 2026 |
Max = norm; |
| 2027 |
imin = i; |
| 2028 |
} |
| 2029 |
} |
| 2030 |
|
| 2031 |
INT refrule; |
| 2032 |
switch (imin) |
| 2033 |
{ |
| 2034 |
case -1 : |
| 2035 |
refrule = ShortestInteriorEdge (theElement); |
| 2036 |
UserWrite ("#"); |
| 2037 |
break; |
| 2038 |
case 0 : |
| 2039 |
refrule = FULL_REFRULE_0_5; |
| 2040 |
break; |
| 2041 |
case 1 : |
| 2042 |
refrule = FULL_REFRULE_1_3; |
| 2043 |
break; |
| 2044 |
case 2 : |
| 2045 |
refrule = FULL_REFRULE_2_4; |
| 2046 |
break; |
| 2047 |
} |
| 2048 |
|
| 2049 |
return (refrule); |
| 2050 |
} |
| 2051 |
|
| 2052 |
#endif /* UG_DIM_3 */ |
| 2053 |
|
| 2054 |
|
| 2055 |
/****************************************************************************/ |
| 2056 |
/** \brief Mark an element for refinement |
| 2057 |
|
| 2058 |
\param theElement - Element to be refined |
| 2059 |
\param rule - type of refinement mark |
| 2060 |
|
| 2061 |
This function marks an element for refinement |
| 2062 |
|
| 2063 |
\return <ul> |
| 2064 |
<li> 1 if element has been marked </li> |
| 2065 |
<li> 0 if element cannot be marked </li> |
| 2066 |
</ul> |
| 2067 |
*/ |
| 2068 |
/****************************************************************************/ |
| 2069 |
|
| 2070 |
INT NS_DIM_PREFIX MarkForRefinement (ELEMENT *theElement, enum RefinementRule rule, INT side) |
| 2071 |
{ |
| 2072 |
if (theElement == NULL) return(0); |
| 2073 |
#ifdef ModelP |
| 2074 |
if (EGHOST(theElement)) return(0); |
| 2075 |
#endif |
| 2076 |
|
| 2077 |
SETCOARSEN(theElement,0); |
| 2078 |
|
| 2079 |
if (rule != COARSE) |
| 2080 |
theElement = ELEMENT_TO_MARK(theElement); |
| 2081 |
ASSERT(theElement!=NULL); |
| 2082 |
|
| 2083 |
PRINTDEBUG(gm,4,("MarkForRefinement() e=" EID_FMTX "rule=%d\n", |
| 2084 |
EID_PRTX(theElement),rule)) |
| 2085 |
|
| 2086 |
/* choose dimension */ |
| 2087 |
switch (DIM) |
| 2088 |
{ |
| 2089 |
#ifdef UG_DIM_2 |
| 2090 |
/* 2D case */ |
| 2091 |
case (2) : |
| 2092 |
|
| 2093 |
switch (TAG(theElement)) |
| 2094 |
{ |
| 2095 |
case (TRIANGLE) : |
| 2096 |
switch (rule) |
| 2097 |
{ |
| 2098 |
case COARSE : |
| 2099 |
SETCOARSEN(theElement,1); |
| 2100 |
SETMARK(theElement,NO_REFINEMENT); |
| 2101 |
SETMARKCLASS(theElement,0); |
| 2102 |
break; |
| 2103 |
|
| 2104 |
case NO_REFINEMENT : |
| 2105 |
SETMARK(theElement,NO_REFINEMENT); |
| 2106 |
SETMARKCLASS(theElement,0); |
| 2107 |
break; |
| 2108 |
|
| 2109 |
case COPY : |
| 2110 |
SETMARK(theElement,T_COPY); |
| 2111 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2112 |
break; |
| 2113 |
|
| 2114 |
case RED : |
| 2115 |
SETMARK(theElement,T_RED); |
| 2116 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2117 |
break; |
| 2118 |
|
| 2119 |
/* TODO: these marks must be introduced first |
| 2120 |
case BISECTION_3: |
| 2121 |
if (side<0) return (GM_ERROR); |
| 2122 |
SETMARK(theElement,TRI_BISECT_3+side%3); |
| 2123 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2124 |
break; |
| 2125 |
|
| 2126 |
case BISECTION_1: |
| 2127 |
if (side<0) return (GM_ERROR); |
| 2128 |
SETMARK(theElement,TRI_BISECT_1+side%3); |
| 2129 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2130 |
break; |
| 2131 |
|
| 2132 |
case BISECTION_2_Q: |
| 2133 |
if (side<0) return (GM_ERROR); |
| 2134 |
SETMARK(theElement,TRI_BISECT_2_Q+side%3); |
| 2135 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2136 |
break; |
| 2137 |
|
| 2138 |
case BISECTION_2_T1: |
| 2139 |
if (side<0) return (GM_ERROR); |
| 2140 |
SETMARK(theElement,TRI_BISECT_2_T1+side%3); |
| 2141 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2142 |
break; |
| 2143 |
|
| 2144 |
case BISECTION_2_T2: |
| 2145 |
if (side<0) return (GM_ERROR); |
| 2146 |
SETMARK(theElement,TRI_BISECT_2_T2+side%3); |
| 2147 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2148 |
break; |
| 2149 |
*/ |
| 2150 |
|
| 2151 |
default : |
| 2152 |
return(GM_ERROR); |
| 2153 |
} |
| 2154 |
break; |
| 2155 |
|
| 2156 |
case (QUADRILATERAL) : |
| 2157 |
switch (rule) |
| 2158 |
{ |
| 2159 |
case COARSE : |
| 2160 |
SETCOARSEN(theElement,1); |
| 2161 |
SETMARKCLASS(theElement,0); |
| 2162 |
SETMARK(theElement,NO_REFINEMENT); |
| 2163 |
break; |
| 2164 |
|
| 2165 |
case NO_REFINEMENT : |
| 2166 |
SETMARK(theElement,NO_REFINEMENT); |
| 2167 |
SETMARKCLASS(theElement,0); |
| 2168 |
break; |
| 2169 |
|
| 2170 |
case COPY : |
| 2171 |
SETMARK(theElement,Q_COPY); |
| 2172 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2173 |
break; |
| 2174 |
|
| 2175 |
case RED : |
| 2176 |
SETMARK(theElement,Q_RED); |
| 2177 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2178 |
break; |
| 2179 |
|
| 2180 |
/* TODO: these mark must be introduced first */ |
| 2181 |
case BLUE : |
| 2182 |
if (side<0) return (GM_ERROR); |
| 2183 |
if (side%2 == 0) |
| 2184 |
SETMARK(theElement,Q_BLUE_0); |
| 2185 |
else |
| 2186 |
SETMARK(theElement,Q_BLUE_1); |
| 2187 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2188 |
break; |
| 2189 |
|
| 2190 |
default : |
| 2191 |
return(GM_ERROR); |
| 2192 |
} |
| 2193 |
break; |
| 2194 |
|
| 2195 |
default : |
| 2196 |
return(GM_ERROR); |
| 2197 |
} |
| 2198 |
break; |
| 2199 |
#endif /* UG_DIM_2 */ |
| 2200 |
|
| 2201 |
|
| 2202 |
#ifdef UG_DIM_3 |
| 2203 |
/* 3D case */ |
| 2204 |
case (3) : |
| 2205 |
switch (TAG(theElement)) |
| 2206 |
{ |
| 2207 |
case (TETRAHEDRON) : |
| 2208 |
switch(rule) |
| 2209 |
{ |
| 2210 |
case (COARSE) : |
| 2211 |
SETMARK(theElement,NO_REFINEMENT); |
| 2212 |
SETMARKCLASS(theElement,0); |
| 2213 |
SETCOARSEN(theElement,1); |
| 2214 |
break; |
| 2215 |
case (NO_REFINEMENT) : |
| 2216 |
SETMARK(theElement,NO_REFINEMENT); |
| 2217 |
SETMARKCLASS(theElement,0); |
| 2218 |
break; |
| 2219 |
case (COPY) : |
| 2220 |
SETMARK(theElement,TET_COPY); |
| 2221 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2222 |
break; |
| 2223 |
case (RED) : |
| 2224 |
SETMARK(theElement,(*theFullRefRule)(theElement)); |
| 2225 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2226 |
break; |
| 2227 |
#ifndef DUNE_UGGRID_TET_RULESET |
| 2228 |
case (TETRA_RED_HEX) : |
| 2229 |
SETMARK(theElement,TET_RED_HEX); |
| 2230 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2231 |
break; |
| 2232 |
#endif |
| 2233 |
default : |
| 2234 |
return(GM_ERROR); |
| 2235 |
} |
| 2236 |
break; |
| 2237 |
|
| 2238 |
case (PYRAMID) : |
| 2239 |
switch(rule) |
| 2240 |
{ |
| 2241 |
case (COARSE) : |
| 2242 |
SETMARK(theElement,NO_REFINEMENT); |
| 2243 |
SETMARKCLASS(theElement,0); |
| 2244 |
SETCOARSEN(theElement,1); |
| 2245 |
break; |
| 2246 |
case (NO_REFINEMENT) : |
| 2247 |
SETMARK(theElement,NO_REFINEMENT); |
| 2248 |
SETMARKCLASS(theElement,0); |
| 2249 |
break; |
| 2250 |
case (COPY) : |
| 2251 |
SETMARK(theElement,PYR_COPY); |
| 2252 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2253 |
break; |
| 2254 |
case (RED) : |
| 2255 |
SETMARK(theElement,PYR_RED); |
| 2256 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2257 |
break; |
| 2258 |
default : |
| 2259 |
return(GM_ERROR); |
| 2260 |
} |
| 2261 |
break; |
| 2262 |
|
| 2263 |
case (PRISM) : |
| 2264 |
switch(rule) |
| 2265 |
{ |
| 2266 |
case (COARSE) : |
| 2267 |
SETMARK(theElement,NO_REFINEMENT); |
| 2268 |
SETMARKCLASS(theElement,0); |
| 2269 |
SETCOARSEN(theElement,1); |
| 2270 |
break; |
| 2271 |
case (NO_REFINEMENT) : |
| 2272 |
SETMARK(theElement,NO_REFINEMENT); |
| 2273 |
SETMARKCLASS(theElement,0); |
| 2274 |
break; |
| 2275 |
case (COPY) : |
| 2276 |
SETMARK(theElement,PRI_COPY); |
| 2277 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2278 |
break; |
| 2279 |
case (RED) : |
| 2280 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2281 |
|
| 2282 |
#ifdef __ANISOTROPIC__ |
| 2283 |
{ |
| 2284 |
INT newrule; |
| 2285 |
|
| 2286 |
if (GetRule_AnisotropicRed(theElement,&newrule)) |
| 2287 |
{ |
| 2288 |
SETMARK(theElement,newrule); |
| 2289 |
break; |
| 2290 |
} |
| 2291 |
} |
| 2292 |
#endif |
| 2293 |
|
| 2294 |
SETMARK(theElement,PRI_RED); |
| 2295 |
break; |
| 2296 |
case (PRISM_BISECT_1_2) : |
| 2297 |
SETMARK(theElement,PRI_BISECT_1_2); |
| 2298 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2299 |
break; |
| 2300 |
case (PRISM_QUADSECT) : |
| 2301 |
SETMARK(theElement,PRI_QUADSECT); |
| 2302 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2303 |
break; |
| 2304 |
case (PRISM_BISECT_HEX0) : |
| 2305 |
SETMARK(theElement,PRI_BISECT_HEX0); |
| 2306 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2307 |
break; |
| 2308 |
case (PRISM_BISECT_HEX1) : |
| 2309 |
SETMARK(theElement,PRI_BISECT_HEX1); |
| 2310 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2311 |
break; |
| 2312 |
case (PRISM_BISECT_HEX2) : |
| 2313 |
SETMARK(theElement,PRI_BISECT_HEX2); |
| 2314 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2315 |
break; |
| 2316 |
case (PRISM_ROTATE_LEFT) : |
| 2317 |
SETMARK(theElement,PRI_ROT_L); |
| 2318 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2319 |
break; |
| 2320 |
case (PRISM_ROTATE_RGHT) : |
| 2321 |
SETMARK(theElement,PRI_ROT_R); |
| 2322 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2323 |
break; |
| 2324 |
case (PRISM_QUADSECT_HEXPRI0) : |
| 2325 |
SETMARK(theElement,PRI_QUADSECT_HEXPRI0); |
| 2326 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2327 |
break; |
| 2328 |
case (PRISM_BISECT_0_1) : |
| 2329 |
SETMARK(theElement,PRI_BISECT_0_1); |
| 2330 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2331 |
break; |
| 2332 |
case (PRISM_BISECT_0_2) : |
| 2333 |
SETMARK(theElement,PRI_BISECT_0_2); |
| 2334 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2335 |
break; |
| 2336 |
case (PRISM_BISECT_0_3) : |
| 2337 |
SETMARK(theElement,PRI_BISECT_0_3); |
| 2338 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2339 |
break; |
| 2340 |
|
| 2341 |
default : |
| 2342 |
return(GM_ERROR); |
| 2343 |
} |
| 2344 |
break; |
| 2345 |
|
| 2346 |
case (HEXAHEDRON) : |
| 2347 |
switch(rule) |
| 2348 |
{ |
| 2349 |
case (COARSE) : |
| 2350 |
SETMARK(theElement,NO_REFINEMENT); |
| 2351 |
SETMARKCLASS(theElement,0); |
| 2352 |
SETCOARSEN(theElement,1); |
| 2353 |
break; |
| 2354 |
case (NO_REFINEMENT) : |
| 2355 |
SETMARK(theElement,NO_REFINEMENT); |
| 2356 |
SETMARKCLASS(theElement,0); |
| 2357 |
break; |
| 2358 |
case (COPY) : |
| 2359 |
SETMARK(theElement,HEXA_COPY); |
| 2360 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2361 |
break; |
| 2362 |
case (RED) : |
| 2363 |
SETMARK(theElement,HEXA_RED); |
| 2364 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2365 |
break; |
| 2366 |
case (HEX_BISECT_0_1) : |
| 2367 |
SETMARK(theElement,HEXA_BISECT_0_1); |
| 2368 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2369 |
break; |
| 2370 |
case (HEX_BISECT_0_2) : |
| 2371 |
SETMARK(theElement,HEXA_BISECT_0_2); |
| 2372 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2373 |
break; |
| 2374 |
case (HEX_BISECT_0_3) : |
| 2375 |
SETMARK(theElement,HEXA_BISECT_0_3); |
| 2376 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2377 |
break; |
| 2378 |
case (HEX_TRISECT_0) : |
| 2379 |
SETMARK(theElement,HEXA_TRISECT_0); |
| 2380 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2381 |
break; |
| 2382 |
case (HEX_TRISECT_5) : |
| 2383 |
SETMARK(theElement,HEXA_TRISECT_5); |
| 2384 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2385 |
break; |
| 2386 |
case (HEX_QUADSECT_0) : |
| 2387 |
SETMARK(theElement,HEXA_QUADSECT_0); |
| 2388 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2389 |
break; |
| 2390 |
case (HEX_QUADSECT_1) : |
| 2391 |
SETMARK(theElement,HEXA_QUADSECT_1); |
| 2392 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2393 |
break; |
| 2394 |
case (HEX_QUADSECT_2) : |
| 2395 |
SETMARK(theElement,HEXA_QUADSECT_2); |
| 2396 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2397 |
break; |
| 2398 |
case (HEX_BISECT_HEXPRI0) : |
| 2399 |
SETMARK(theElement,HEXA_BISECT_HEXPRI0); |
| 2400 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2401 |
break; |
| 2402 |
case (HEX_BISECT_HEXPRI1) : |
| 2403 |
SETMARK(theElement,HEXA_BISECT_HEXPRI1); |
| 2404 |
SETMARKCLASS(theElement,RED_CLASS); |
| 2405 |
break; |
| 2406 |
default : |
| 2407 |
return(GM_ERROR); |
| 2408 |
} |
| 2409 |
break; |
| 2410 |
|
| 2411 |
default : |
| 2412 |
return(GM_ERROR); |
| 2413 |
} |
| 2414 |
break; |
| 2415 |
#endif /* UG_DIM_3 */ |
| 2416 |
|
| 2417 |
default : |
| 2418 |
return(GM_ERROR); |
| 2419 |
} |
| 2420 |
|
| 2421 |
return(GM_OK); |
| 2422 |
} |
| 2423 |
|
| 2424 |
/****************************************************************************/ |
| 2425 |
/** \brief Return true when element can be tagged for refinement |
| 2426 |
|
| 2427 |
\param theElement - element to refine |
| 2428 |
|
| 2429 |
This function returns true (1) when element can be tagged for refinement |
| 2430 |
|
| 2431 |
\return <ul> |
| 2432 |
<li> false - do not tag element </li> |
| 2433 |
<li> true - element can be tagged for refinement </li> |
| 2434 |
</ul> |
| 2435 |
*/ |
| 2436 |
/****************************************************************************/ |
| 2437 |
|
| 2438 |
INT NS_DIM_PREFIX EstimateHere (const ELEMENT *theElement) |
| 2439 |
{ |
| 2440 |
#ifdef ModelP |
| 2441 |
if (EGHOST(theElement)) return(0); |
| 2442 |
#endif |
| 2443 |
return(LEAFELEM(theElement)); |
| 2444 |
} |
| 2445 |
|
| 2446 |
|
| 2447 |
/****************************************************************************/ |
| 2448 |
/** \brief Return mark of rule for a specific pattern |
| 2449 |
|
| 2450 |
\param theElement - element rule is searched for |
| 2451 |
\param pattern: pattern a rule is searched for |
| 2452 |
|
| 2453 |
This function returns mark of rule for a specific pattern |
| 2454 |
|
| 2455 |
\return Mark rule; values of the unnamed enums in the file rm.h |
| 2456 |
mark of rule |
| 2457 |
*/ |
| 2458 |
/****************************************************************************/ |
| 2459 |
|
| 2460 |
INT NS_DIM_PREFIX Patterns2Rules(ELEMENT *theElement, INT pattern) |
| 2461 |
{ |
| 2462 |
#ifdef UG_DIM_2 |
| 2463 |
switch (TAG(theElement)) { |
| 2464 |
case (TRIANGLE) : |
| 2465 |
switch (pattern) { |
| 2466 |
/** \todo 0 can mean T_COPY OR T_NOREF */ |
| 2467 |
case (0) : return(T_NOREF); |
| 2468 |
case (1) : return(T_BISECT_1_0); |
| 2469 |
case (2) : return(T_BISECT_1_1); |
| 2470 |
case (3) : return(T_BISECT_2_T1_2); |
| 2471 |
case (4) : return(T_BISECT_1_2); |
| 2472 |
case (5) : return(T_BISECT_2_T1_1); |
| 2473 |
case (6) : return(T_BISECT_2_T1_0); |
| 2474 |
case (7) : return(T_RED); |
| 2475 |
default : |
| 2476 |
assert(0); |
| 2477 |
PrintErrorMessage('E',"Patterns2Rules","no mapping for TRIANGLE and this pattern!"); |
| 2478 |
return(-1); |
| 2479 |
} |
| 2480 |
break; |
| 2481 |
case (QUADRILATERAL) : |
| 2482 |
switch (pattern) { |
| 2483 |
/** \todo 0 can mean Q_COPY OR Q_NOREF */ |
| 2484 |
case (0) : return(Q_NOREF); |
| 2485 |
case (5) : return(Q_BLUE_0); |
| 2486 |
case (7) : return(Q_CLOSE_3_3); |
| 2487 |
case (10) : return(Q_BLUE_1); |
| 2488 |
case (11) : return(Q_CLOSE_3_2); |
| 2489 |
case (13) : return(Q_CLOSE_3_1); |
| 2490 |
case (14) : return(Q_CLOSE_3_0); |
| 2491 |
|
| 2492 |
case (1) : /* mapping for green closure */ |
| 2493 |
case (17) : return(Q_CLOSE_2_0); |
| 2494 |
|
| 2495 |
case (2) : /* mapping for green closure */ |
| 2496 |
case (18) : return(Q_CLOSE_2_1); |
| 2497 |
|
| 2498 |
case (3) : /* mapping for green closure */ |
| 2499 |
case (19) : return(Q_CLOSE_1_0); |
| 2500 |
|
| 2501 |
case (4) : /* mapping for green closure */ |
| 2502 |
case (20) : return(Q_CLOSE_2_2); |
| 2503 |
|
| 2504 |
case (6) : /* mapping for green closure */ |
| 2505 |
case (22) : return(Q_CLOSE_1_1); |
| 2506 |
|
| 2507 |
case (8) : /* mapping for green closure */ |
| 2508 |
case (24) : return(Q_CLOSE_2_3); |
| 2509 |
|
| 2510 |
case (9) : /* mapping for green closure */ |
| 2511 |
case (25) : return(Q_CLOSE_1_3); |
| 2512 |
|
| 2513 |
case (12) : /* mapping for green closure */ |
| 2514 |
case (28) : return(Q_CLOSE_1_2); |
| 2515 |
|
| 2516 |
case (15) : /* mapping for green closure */ |
| 2517 |
case (31) : return(Q_RED); |
| 2518 |
default : |
| 2519 |
assert(0); |
| 2520 |
PrintErrorMessage('E',"Patterns2Rules","no mapping for QUADRILATERAL and this pattern!"); |
| 2521 |
return(-1); |
| 2522 |
} |
| 2523 |
break; |
| 2524 |
default : |
| 2525 |
PrintErrorMessage('E',"Patterns2Rules","Elementtype not found!"); |
| 2526 |
assert(0); return(-1); |
| 2527 |
} |
| 2528 |
#endif |
| 2529 |
#ifdef UG_DIM_3 |
| 2530 |
switch (TAG(theElement)) { |
| 2531 |
case (TETRAHEDRON) : |
| 2532 |
#ifdef DUNE_UGGRID_TET_RULESET |
| 2533 |
/* convert pattern to old style */ |
| 2534 |
pattern &= (~(1<<10)); |
| 2535 |
|
| 2536 |
IFDEBUG(gm,0) |
| 2537 |
int tetrarule; |
| 2538 |
if (pattern<0 || pattern>1023) |
| 2539 |
PRINTDEBUG(gm,0,("Pattern2Rule(): ERROR elem=" EID_FMTX |
| 2540 |
" pattern=%d\n",EID_PRTX(theElement),pattern)) |
| 2541 |
assert(pattern>=0 && pattern<=1023); |
| 2542 |
tetrarule = Pattern2Rule[TAG(theElement)][pattern]; |
| 2543 |
if (tetrarule<0 || tetrarule>MaxRules[TETRAHEDRON]) |
| 2544 |
PRINTDEBUG(gm,0,("Pattern2Rule(): ERROR elem=" EID_FMTX |
| 2545 |
" pattern=%d rule=%d\n",EID_PRTX(theElement),pattern,tetrarule)) |
| 2546 |
assert(tetrarule>=0 && tetrarule<=MaxRules[TETRAHEDRON]); |
| 2547 |
ENDDEBUG |
| 2548 |
|
| 2549 |
return(Pattern2Rule[TAG(theElement)][pattern]); |
| 2550 |
#else |
| 2551 |
if (MARKCLASS(theElement) != RED_CLASS) return(0); |
| 2552 |
switch (pattern) { |
| 2553 |
/* copy rule */ |
| 2554 |
case (0) : |
| 2555 |
return(0); |
| 2556 |
case (63) : |
| 2557 |
return(TET_RED); |
| 2558 |
case (1023) : |
| 2559 |
return(TET_RED_HEX); |
| 2560 |
default : |
| 2561 |
PrintErrorMessage('E',"Patterns2Rules","no mapping for TETRAHEDRON and this pattern!"); |
| 2562 |
assert(0); return(-1); |
| 2563 |
} |
| 2564 |
break; |
| 2565 |
#endif |
| 2566 |
|
| 2567 |
case (PYRAMID) : |
| 2568 |
if (MARKCLASS(theElement) != RED_CLASS) return(0); |
| 2569 |
switch (pattern) { |
| 2570 |
/* copy rule */ |
| 2571 |
case (0) : |
| 2572 |
return(0); |
| 2573 |
case (511) : |
| 2574 |
return(PYR_RED); |
| 2575 |
default : |
| 2576 |
PrintErrorMessage('E',"Patterns2Rules","no mapping for PYRAMID and this pattern!"); |
| 2577 |
assert(0); return(-1); |
| 2578 |
} |
| 2579 |
break; |
| 2580 |
|
| 2581 |
case (PRISM) : |
| 2582 |
if (MARKCLASS(theElement) != RED_CLASS) return(0); |
| 2583 |
switch (pattern) { |
| 2584 |
/* copy rule */ |
| 2585 |
case (0) : |
| 2586 |
return(0); |
| 2587 |
case (7679) : |
| 2588 |
return(PRI_RED); |
| 2589 |
case (455) : |
| 2590 |
return(PRI_QUADSECT); |
| 2591 |
case 56 : |
| 2592 |
return PRI_BISECT_1_2; |
| 2593 |
case 65 : |
| 2594 |
return PRI_BISECT_0_1; |
| 2595 |
case 130 : |
| 2596 |
return PRI_BISECT_0_2; |
| 2597 |
case 260 : |
| 2598 |
return PRI_BISECT_0_3; |
| 2599 |
case 325 : |
| 2600 |
return PRI_BISECT_HEX0; |
| 2601 |
case 195 : |
| 2602 |
return PRI_BISECT_HEX1; |
| 2603 |
case 390 : |
| 2604 |
return PRI_BISECT_HEX2; |
| 2605 |
default : |
| 2606 |
PrintErrorMessageF('E',"Patterns2Rules","no mapping for PRISM and pattern %d!", pattern); |
| 2607 |
#ifndef __ANISOTROPIC__ |
| 2608 |
assert(0); |
| 2609 |
#endif |
| 2610 |
return(-1); |
| 2611 |
} |
| 2612 |
break; |
| 2613 |
|
| 2614 |
case (HEXAHEDRON) : |
| 2615 |
if (MARKCLASS(theElement) != RED_CLASS) return(0); |
| 2616 |
switch (pattern) { |
| 2617 |
/* copy rule */ |
| 2618 |
case (0) : |
| 2619 |
return(0); |
| 2620 |
/* full red rule */ |
| 2621 |
case (262143) : |
| 2622 |
return(HEXA_RED); |
| 2623 |
case (1285) : |
| 2624 |
return HEXA_BISECT_0_1; |
| 2625 |
case (2570) : |
| 2626 |
return HEXA_BISECT_0_2; |
| 2627 |
case (240) : |
| 2628 |
return HEXA_BISECT_0_3; |
| 2629 |
case (139023) : |
| 2630 |
return HEXA_QUADSECT_0; |
| 2631 |
case (42485) : |
| 2632 |
return HEXA_QUADSECT_1; |
| 2633 |
case (84730) : |
| 2634 |
return HEXA_QUADSECT_2; |
| 2635 |
case (5) : |
| 2636 |
return HEXA_TRISECT_0; |
| 2637 |
case (1280) : |
| 2638 |
return HEXA_TRISECT_5; |
| 2639 |
case (2056) : |
| 2640 |
return HEXA_BISECT_HEXPRI0; |
| 2641 |
case (257) : |
| 2642 |
return HEXA_BISECT_HEXPRI1; |
| 2643 |
default : |
| 2644 |
PrintErrorMessage('E',"Patterns2Rules","no mapping for HEXAHEDRON and this pattern!"); |
| 2645 |
UserWriteF("pattern=%d\n",pattern); |
| 2646 |
assert(0); return(-1); |
| 2647 |
} |
| 2648 |
break; |
| 2649 |
|
| 2650 |
default : |
| 2651 |
PrintErrorMessage('E',"Patterns2Rules","Elementtype not found!"); |
| 2652 |
assert(0); return(-1); |
| 2653 |
} |
| 2654 |
#endif |
| 2655 |
PrintErrorMessage('E',"Patterns2Rules","Elementtype not found!"); |
| 2656 |
assert(0); return(-1); |
| 2657 |
} |
| 2658 |
|
| 2659 |
/****************************************************************************/ |
| 2660 |
/** \brief Gets the element which has to be marked |
| 2661 |
|
| 2662 |
\param MarkElement - element to be estimated |
| 2663 |
|
| 2664 |
This function gets the element which has to be marked |
| 2665 |
|
| 2666 |
\return <ul> |
| 2667 |
<li> first element downward with class RED_CLASS </li> |
| 2668 |
<li> NULL if MarkElement was no surface element </li> |
| 2669 |
</ul> |
| 2670 |
*/ |
| 2671 |
/****************************************************************************/ |
| 2672 |
|
| 2673 |
ELEMENT * NS_DIM_PREFIX ELEMENT_TO_MARK (ELEMENT *theElement) |
| 2674 |
{ |
| 2675 |
if (IS_REFINED(theElement)) return(NULL); |
| 2676 |
|
| 2677 |
PRINTDEBUG(gm,4,("ELEMENT_TO_MARK() called for e=" EID_FMTX "\n", |
| 2678 |
EID_PRTX(theElement))) |
| 2679 |
|
| 2680 |
while (ECLASS(theElement) != RED_CLASS) |
| 2681 |
{ |
| 2682 |
theElement = EFATHER(theElement); |
| 2683 |
ASSERT(theElement != NULL); |
| 2684 |
} |
| 2685 |
|
| 2686 |
return(theElement); |
| 2687 |
} |
| 2688 |
|
| 2689 |
|
| 2690 |
/****************************************************************************/ |
| 2691 |
/** \brief Gets rule of refinement |
| 2692 |
|
| 2693 |
\param theElement - element to refine |
| 2694 |
\param rule - filled with current refinement rule |
| 2695 |
\param data - filled with side, if rule is oriented |
| 2696 |
|
| 2697 |
This function gets rule of refinement |
| 2698 |
|
| 2699 |
\return |
| 2700 |
.n 0: side information valid |
| 2701 |
.n 1: rule without orientation |
| 2702 |
*/ |
| 2703 |
/****************************************************************************/ |
| 2704 |
|
| 2705 |
INT NS_DIM_PREFIX GetRefinementMark (ELEMENT *theElement, INT *rule, void *data) |
| 2706 |
{ |
| 2707 |
INT *side = (INT*)data; |
| 2708 |
INT mark; |
| 2709 |
|
| 2710 |
if (LEAFELEM(theElement) && |
| 2711 |
ECLASS(theElement) != RED_CLASS) |
| 2712 |
theElement = ELEMENT_TO_MARK(theElement); |
| 2713 |
|
| 2714 |
ASSERT(theElement != NULL); |
| 2715 |
if (!((ECLASS(theElement) == RED_CLASS) |
| 2716 |
&& (REFINECLASS(theElement) != RED_CLASS))) |
| 2717 |
{ |
| 2718 |
printf("GetRefinementMark: eclass=%d refineclass=%d\n", |
| 2719 |
ECLASS(theElement),REFINECLASS(theElement)); |
| 2720 |
return(-1); |
| 2721 |
} |
| 2722 |
|
| 2723 |
mark = MARK(theElement); |
| 2724 |
|
| 2725 |
#if defined(UG_DIM_3) |
| 2726 |
/* tetrahedra have three red rules */ |
| 2727 |
if (TAG(theElement)==TETRAHEDRON && |
| 2728 |
(mark==TET_RED_2_4 || mark==TET_RED_0_5 || mark==TET_RED_1_3)) |
| 2729 |
{ |
| 2730 |
*rule=RED; |
| 2731 |
return(GM_RULE_WITHOUT_ORIENTATION); |
| 2732 |
} |
| 2733 |
#endif |
| 2734 |
|
| 2735 |
switch (mark) |
| 2736 |
{ |
| 2737 |
case RED : |
| 2738 |
*rule=RED; |
| 2739 |
break; |
| 2740 |
#ifdef UG_DIM_2 |
| 2741 |
case Q_BLUE_0 : |
| 2742 |
*rule = BLUE; |
| 2743 |
break; |
| 2744 |
case Q_BLUE_1 : |
| 2745 |
*rule = BLUE; |
| 2746 |
break; |
| 2747 |
#endif |
| 2748 |
case NO_REFINEMENT : |
| 2749 |
*rule=NO_REFINEMENT; |
| 2750 |
if (COARSEN(theElement)) *rule = COARSE; |
| 2751 |
break; |
| 2752 |
case COPY : |
| 2753 |
*rule=COPY; break; |
| 2754 |
default : |
| 2755 |
*rule=NO_REFINEMENT; break; |
| 2756 |
} |
| 2757 |
*side=0; |
| 2758 |
return(GM_RULE_WITHOUT_ORIENTATION); |
| 2759 |
} |
| 2760 |
|
| 2761 |
|
| 2762 |
/****************************************************************************/ |
| 2763 |
/** \brief |
| 2764 |
GetRefinementMarkType - gets type of mark for an element |
| 2765 |
|
| 2766 |
SYNOPSIS: |
| 2767 |
INT GetRefinementMarkType (ELEMENT *theElement); |
| 2768 |
|
| 2769 |
PARAMETERS: |
| 2770 |
\param theElement - element to refine |
| 2771 |
|
| 2772 |
DESCRIPTION: |
| 2773 |
This function gets the type of mark for an element |
| 2774 |
|
| 2775 |
\return |
| 2776 |
INT |
| 2777 |
.n 0 if element is not marked |
| 2778 |
.n 1 if element is marked for refinement |
| 2779 |
.n -1 if element is marked for coarsening |
| 2780 |
*/ |
| 2781 |
/****************************************************************************/ |
| 2782 |
|
| 2783 |
INT NS_DIM_PREFIX GetRefinementMarkType (ELEMENT *theElement) |
| 2784 |
{ |
| 2785 |
INT rule; |
| 2786 |
INT side; |
| 2787 |
|
| 2788 |
if (GetRefinementMark(theElement,&rule,&side) == -1) RETURN(GM_ERROR); |
| 2789 |
|
| 2790 |
switch (rule) |
| 2791 |
{ |
| 2792 |
case RED : |
| 2793 |
#ifdef UG_DIM_2 |
| 2794 |
case BLUE : |
| 2795 |
#endif |
| 2796 |
return(1); |
| 2797 |
case COPY : |
| 2798 |
case NO_REFINEMENT : return(0); |
| 2799 |
case COARSE : return(-1); |
| 2800 |
default : assert(0); |
| 2801 |
} |
| 2802 |
|
| 2803 |
return(0); |
| 2804 |
} |
| 2805 |
|
| 2806 |
/****************************************************************************/ |
| 2807 |
/* |
| 2808 |
PrintSonData - |
| 2809 |
|
| 2810 |
SYNOPSIS: |
| 2811 |
static INT PrintSonData(struct sondata theSonData); |
| 2812 |
|
| 2813 |
PARAMETERS: |
| 2814 |
\param theSonData |
| 2815 |
|
| 2816 |
DESCRIPTION: |
| 2817 |
|
| 2818 |
\return |
| 2819 |
INT |
| 2820 |
*/ |
| 2821 |
/****************************************************************************/ |
| 2822 |
|
| 2823 |
static INT PrintSonData (struct sondata theSonData, PrintfProcPtr Printf) |
| 2824 |
{ |
| 2825 |
char buffer[128]; |
| 2826 |
int i,j; |
| 2827 |
int path = theSonData.path; |
| 2828 |
int pd = PATHDEPTH(path); |
| 2829 |
|
| 2830 |
Printf("tag=%d ",(int)theSonData.tag); |
| 2831 |
|
| 2832 |
j = 0; |
| 2833 |
j = snprintf(buffer,128," corners="); |
| 2834 |
for (i=0; i<element_descriptors[theSonData.tag]->corners_of_elem; i++) |
| 2835 |
{ |
| 2836 |
j += snprintf(buffer+j,128-j,"%2d ",(int)theSonData.corners[i]); |
| 2837 |
} |
| 2838 |
Printf(buffer); |
| 2839 |
|
| 2840 |
j = 0; |
| 2841 |
j += snprintf(buffer,128," nb="); |
| 2842 |
for (i=0; i<element_descriptors[theSonData.tag]->sides_of_elem; i++) |
| 2843 |
{ |
| 2844 |
j += snprintf(buffer+j,128-j,"%2d ",(int)theSonData.nb[i]); |
| 2845 |
} |
| 2846 |
Printf(buffer); |
| 2847 |
|
| 2848 |
Printf(" path of depth %d=",pd); |
| 2849 |
/*for (i=8*sizeof(INT)-1; i>=0; i--) |
| 2850 |
{ |
| 2851 |
snprintf(buffer,128,"%d",(int)((theSonData.path>>i) & 0x1)); |
| 2852 |
if (i%2 == 0 && theSonData.tag == TETRAHEDRON) sprintf(buffer+1," "); |
| 2853 |
if (i%3 == 0 && theSonData.tag == HEXAHEDRON) sprintf(buffer+1," "); |
| 2854 |
Printf(buffer); |
| 2855 |
}*/ |
| 2856 |
if (pd>=MAX_PATH_DEPTH) |
| 2857 |
Printf(" ERROR: path depth > MAX_PATH_DEPTH"); |
| 2858 |
else |
| 2859 |
for (j=0; j<pd; j++) |
| 2860 |
{ |
| 2861 |
int ns = NEXTSIDE(path,j); |
| 2862 |
Printf("%2d",ns); |
| 2863 |
} |
| 2864 |
|
| 2865 |
return(0); |
| 2866 |
} |
| 2867 |
|
| 2868 |
/****************************************************************************/ |
| 2869 |
/** \brief |
| 2870 |
ShowRefRule - |
| 2871 |
|
| 2872 |
SYNOPSIS: |
| 2873 |
INT ShowRefRule (INT tag, INT nb); |
| 2874 |
|
| 2875 |
PARAMETERS: |
| 2876 |
\param tag |
| 2877 |
\param nb |
| 2878 |
|
| 2879 |
DESCRIPTION: |
| 2880 |
|
| 2881 |
|
| 2882 |
\return |
| 2883 |
INT |
| 2884 |
*/ |
| 2885 |
/****************************************************************************/ |
| 2886 |
|
| 2887 |
INT NS_DIM_PREFIX ShowRefRuleX (INT tag, INT nb, PrintfProcPtr Printf) |
| 2888 |
{ |
| 2889 |
INT i; |
| 2890 |
REFRULE *theRule; |
| 2891 |
|
| 2892 |
if (MaxRules[tag]<=nb) |
| 2893 |
{ |
| 2894 |
Printf("ShowRefRule(): ERROR: nb=%d but MaxRules[%d]=%d\n",nb,tag,MaxRules[tag]); |
| 2895 |
return (1); |
| 2896 |
} |
| 2897 |
|
| 2898 |
theRule=&(RefRules[tag][nb]); |
| 2899 |
|
| 2900 |
/* header */ |
| 2901 |
Printf("\n"); |
| 2902 |
Printf("RefRule %3d:\n",nb); |
| 2903 |
|
| 2904 |
/* nsons, mark and class */ |
| 2905 |
Printf(" tag=%d mark=%3d class=%2d, nsons=%d\n",(int)theRule->tag,(int)theRule->mark,(int)theRule->rclass,(int)theRule->nsons); |
| 2906 |
|
| 2907 |
/* pattern */ |
| 2908 |
Printf(" pattern= "); |
| 2909 |
for (i=0; i<(element_descriptors[tag]->edges_of_elem+element_descriptors[tag]->sides_of_elem+1); i++) |
| 2910 |
Printf("%2d ",(int)theRule->pattern[i]); |
| 2911 |
Printf("\n"); |
| 2912 |
|
| 2913 |
/* pat */ |
| 2914 |
Printf(" pat = "); |
| 2915 |
for (i=0; i<(element_descriptors[tag]->edges_of_elem+element_descriptors[tag]->sides_of_elem+1); i++) |
| 2916 |
Printf("%2d ",(int)((theRule->pat>>i) & 0x1)); |
| 2917 |
Printf("\n"); |
| 2918 |
|
| 2919 |
/* sonandnode */ |
| 2920 |
for (i=0; i<MAX_NEW_CORNERS(tag); i++) |
| 2921 |
{ |
| 2922 |
Printf(" newnode %2d: sonandnode[%2d][0]=%2d",i,i,(int)theRule->sonandnode[i][0]); |
| 2923 |
Printf(" [%2d][1]=%2d\n",i,(int)theRule->sonandnode[i][1]); |
| 2924 |
} |
| 2925 |
Printf("\n"); |
| 2926 |
|
| 2927 |
/* print edge data |
| 2928 |
Printf(" Edge data\n"); |
| 2929 |
for (i=0; i<MAX_NEW_EDGES(tag); i++) |
| 2930 |
{ |
| 2931 |
Printf(" e %2d: ",i); |
| 2932 |
PrintEdgeData(theRule->edges[i]); |
| 2933 |
if (i%2 == 1) Printf("\n"); |
| 2934 |
} |
| 2935 |
Printf("\n");*/ |
| 2936 |
|
| 2937 |
/* print sondata data */ |
| 2938 |
Printf(" Son data\n"); |
| 2939 |
for (i=0; i<(int)theRule->nsons; i++) |
| 2940 |
{ |
| 2941 |
Printf(" son %2d: ",i); |
| 2942 |
PrintSonData(theRule->sons[i],Printf); |
| 2943 |
Printf("\n"); |
| 2944 |
} |
| 2945 |
|
| 2946 |
return (0); |
| 2947 |
} |
| 2948 |
|
| 2949 |
INT NS_DIM_PREFIX ShowRefRule (INT tag, INT nb) |
| 2950 |
{ |
| 2951 |
return (ShowRefRuleX(tag,nb,UserWriteF)); |
| 2952 |
} |
| 2953 |
|
| 2954 |
|
| 2955 |
|
| 2956 |
#ifdef UG_DIM_3 |
| 2957 |
|
| 2958 |
/****************************************************************************/ |
| 2959 |
/** \brief |
| 2960 |
InitRuleManager3D - Read the rule data set and initialize the rules |
| 2961 |
|
| 2962 |
This function reads the rule data set and initializes the rules data structure for tetrahedrons. Initializes the regular refinement rules (red rules) for hexahedrons. Irregular refinement of green closure is done algorithmically. |
| 2963 |
|
| 2964 |
\return |
| 2965 |
.n 0 if ok |
| 2966 |
.n >0 if an error occurs |
| 2967 |
*/ |
| 2968 |
/****************************************************************************/ |
| 2969 |
|
| 2970 |
#ifdef DUNE_UGGRID_TET_RULESET |
| 2971 |
# include "RefRules.cc" |
| 2972 |
#endif |
| 2973 |
|
| 2974 |
static INT InitRuleManager3D (void) |
| 2975 |
{ |
| 2976 |
FULLREFRULE *newFRR; |
| 2977 |
int nRules; |
| 2978 |
|
| 2979 |
/* now make rules for tetrahedrons globally available */ |
| 2980 |
MaxNewCorners[TETRAHEDRON] = 11; |
| 2981 |
MaxNewEdges[TETRAHEDRON] = 16; |
| 2982 |
CenterNodeIndex[TETRAHEDRON] = 10; |
| 2983 |
|
| 2984 |
#ifdef DUNE_UGGRID_TET_RULESET |
| 2985 |
RefRules[TETRAHEDRON] = tetrahedronRefinementRules; |
| 2986 |
MaxRules[TETRAHEDRON] = nTetrahedronRefinementRules; |
| 2987 |
Pattern2Rule[TETRAHEDRON] = pattern2RuleTetrahedron; |
| 2988 |
#else |
| 2989 |
RefRules[TETRAHEDRON] = TetrahedronRules; |
| 2990 |
MaxRules[TETRAHEDRON] = MAX_TET_RULES; |
| 2991 |
#endif |
| 2992 |
|
| 2993 |
|
| 2994 |
/************************************************************************/ |
| 2995 |
/* */ |
| 2996 |
/* init refinement rules from for pyramids */ |
| 2997 |
/* */ |
| 2998 |
/************************************************************************/ |
| 2999 |
|
| 3000 |
nRules = MAX_PYR_RULES; |
| 3001 |
|
| 3002 |
/* make rules for pyramids globally available */ |
| 3003 |
MaxRules[PYRAMID] = nRules; |
| 3004 |
MaxNewCorners[PYRAMID] = 19; |
| 3005 |
MaxNewEdges[PYRAMID] = 54; |
| 3006 |
CenterNodeIndex[PYRAMID] = 18; |
| 3007 |
RefRules[PYRAMID] = PyramidRules; |
| 3008 |
|
| 3009 |
/************************************************************************/ |
| 3010 |
/* */ |
| 3011 |
/* init refinement rules for prisms */ |
| 3012 |
/* */ |
| 3013 |
/************************************************************************/ |
| 3014 |
|
| 3015 |
nRules = MAX_PRI_RULES; |
| 3016 |
|
| 3017 |
/* make rules for prisms globally available */ |
| 3018 |
MaxRules[PRISM] = nRules; |
| 3019 |
MaxNewCorners[PRISM] = 19; |
| 3020 |
MaxNewEdges[PRISM] = 54; |
| 3021 |
CenterNodeIndex[PRISM] = 18; |
| 3022 |
RefRules[PRISM] = PrismRules; |
| 3023 |
|
| 3024 |
/************************************************************************/ |
| 3025 |
/* */ |
| 3026 |
/* init refinement rules from for hexahedrons */ |
| 3027 |
/* */ |
| 3028 |
/************************************************************************/ |
| 3029 |
|
| 3030 |
nRules = MAX_HEX_RULES; |
| 3031 |
|
| 3032 |
/* make rules for tetrahedrons globally available */ |
| 3033 |
MaxRules[HEXAHEDRON] = nRules; |
| 3034 |
MaxNewCorners[HEXAHEDRON] = 19; |
| 3035 |
MaxNewEdges[HEXAHEDRON] = 54; |
| 3036 |
CenterNodeIndex[HEXAHEDRON] = 18; |
| 3037 |
RefRules[HEXAHEDRON] = HexahedronRules; |
| 3038 |
|
| 3039 |
|
| 3040 |
/************************************************************************/ |
| 3041 |
/* */ |
| 3042 |
/* install best full refrules for tetrahedrons */ |
| 3043 |
/* */ |
| 3044 |
/************************************************************************/ |
| 3045 |
|
| 3046 |
/* install the /Menu directory */ |
| 3047 |
if (ChangeEnvDir("/")==NULL) |
| 3048 |
{ |
| 3049 |
PrintErrorMessage('F',"InitRuleManager3D","could not changedir to root"); |
| 3050 |
return(__LINE__); |
| 3051 |
} |
| 3052 |
theBFRRDirID = GetNewEnvDirID(); |
| 3053 |
if (MakeEnvItem("best full refrule",theBFRRDirID,sizeof(ENVDIR))==NULL) |
| 3054 |
{ |
| 3055 |
PrintErrorMessage('F',"InitRuleManager3D","could not install '/best full refrule' dir"); |
| 3056 |
return(__LINE__); |
| 3057 |
} |
| 3058 |
if (ChangeEnvDir("/best full refrule")==NULL) |
| 3059 |
return(__LINE__); |
| 3060 |
|
| 3061 |
theBFRRVarID = GetNewEnvVarID(); |
| 3062 |
|
| 3063 |
newFRR = (FULLREFRULE *) MakeEnvItem("shortestie",theBFRRVarID,sizeof(FULLREFRULE)); |
| 3064 |
if (newFRR==NULL) |
| 3065 |
return(__LINE__); |
| 3066 |
newFRR->theFullRefRule = ShortestInteriorEdge; |
| 3067 |
|
| 3068 |
newFRR = (FULLREFRULE *) MakeEnvItem("maxper",theBFRRVarID,sizeof(FULLREFRULE)); |
| 3069 |
if (newFRR==NULL) |
| 3070 |
return(__LINE__); |
| 3071 |
newFRR->theFullRefRule = MaxPerpendicular; |
| 3072 |
|
| 3073 |
newFRR = (FULLREFRULE *) MakeEnvItem("mra",theBFRRVarID,sizeof(FULLREFRULE)); |
| 3074 |
if (newFRR==NULL) |
| 3075 |
return(__LINE__); |
| 3076 |
newFRR->theFullRefRule = MaxRightAngle; |
| 3077 |
|
| 3078 |
newFRR = (FULLREFRULE *) MakeEnvItem("maxarea",theBFRRVarID,sizeof(FULLREFRULE)); |
| 3079 |
if (newFRR==NULL) |
| 3080 |
return(__LINE__); |
| 3081 |
newFRR->theFullRefRule = MaxArea; |
| 3082 |
|
| 3083 |
#ifdef __ALLRULES__ |
| 3084 |
newFRR = (FULLREFRULE *) MakeEnvItem("minangle",theBFRRVarID,sizeof(FULLREFRULE)); |
| 3085 |
if (newFRR==NULL) |
| 3086 |
return(__LINE__); |
| 3087 |
newFRR->theFullRefRule = MinimalSideAngle; |
| 3088 |
|
| 3089 |
newFRR = (FULLREFRULE *) MakeEnvItem("bestm",theBFRRVarID,sizeof(FULLREFRULE)); |
| 3090 |
if (newFRR==NULL) |
| 3091 |
return(__LINE__); |
| 3092 |
newFRR->theFullRefRule = BestLaplaceMMatrix; |
| 3093 |
|
| 3094 |
newFRR = (FULLREFRULE *) MakeEnvItem("minentry",theBFRRVarID,sizeof(FULLREFRULE)); |
| 3095 |
if (newFRR==NULL) |
| 3096 |
return(__LINE__); |
| 3097 |
newFRR->theFullRefRule = MinimalSideEntry; |
| 3098 |
#endif |
| 3099 |
|
| 3100 |
/* default full refrule */ |
| 3101 |
theFullRefRule = ShortestInteriorEdge; |
| 3102 |
|
| 3103 |
UserWrite("3D RefRules installed\n"); |
| 3104 |
|
| 3105 |
return (GM_OK); |
| 3106 |
} |
| 3107 |
|
| 3108 |
|
| 3109 |
#endif /* UG_DIM_3 */ |
| 3110 |
|
| 3111 |
#ifdef UG_DIM_2 |
| 3112 |
|
| 3113 |
|
| 3114 |
/****************************************************************************/ |
| 3115 |
/** \brief |
| 3116 |
InitRuleManager2D - Initializes rules for triangles and quadrilaterals |
| 3117 |
|
| 3118 |
SYNOPSIS: |
| 3119 |
static INT InitRuleManager2D (void); |
| 3120 |
|
| 3121 |
PARAMETERS: |
| 3122 |
. void |
| 3123 |
|
| 3124 |
DESCRIPTION: |
| 3125 |
This function initializes rules for triangles and quadrilaterals |
| 3126 |
|
| 3127 |
\return |
| 3128 |
INT |
| 3129 |
.n 0 - ok |
| 3130 |
.n >0 - error |
| 3131 |
*/ |
| 3132 |
/****************************************************************************/ |
| 3133 |
|
| 3134 |
static INT InitRuleManager2D (void) |
| 3135 |
{ |
| 3136 |
/************************************************************************/ |
| 3137 |
/* */ |
| 3138 |
/* init refinement rules for triangles */ |
| 3139 |
/* */ |
| 3140 |
/************************************************************************/ |
| 3141 |
|
| 3142 |
/* there are 8 = 2^3 different patterns */ |
| 3143 |
/* but why is there a 17 here? probably could be 8... */ |
| 3144 |
static const SHORT pattern2RuleTriangle[17] = { |
| 3145 |
/* 0: */ T_COPY, /* 0 0 0 */ |
| 3146 |
/* 1: */ T_BISECT_1_0, /* 0 0 1 */ |
| 3147 |
/* 2: */ T_BISECT_1_1, /* 0 1 0 */ |
| 3148 |
/* 3: */ T_BISECT_2_T1_0, /* 0 1 1 */ |
| 3149 |
/* 4: */ T_BISECT_1_2, /* 1 0 0 */ |
| 3150 |
/* 5: */ NOINDEX, /* 1 0 1 */ |
| 3151 |
/* 6: */ NOINDEX, /* 1 1 0 */ |
| 3152 |
/* 7: */ T_RED, /* 1 1 1 */ |
| 3153 |
}; |
| 3154 |
Pattern2Rule[TRIANGLE] = pattern2RuleTriangle; |
| 3155 |
|
| 3156 |
/* Pattern2Rule gives the starting index for rules with same pattern */ |
| 3157 |
|
| 3158 |
/* now make rules for triangles globally available */ |
| 3159 |
MaxRules[TRIANGLE] = MAX_TRI_RULES; |
| 3160 |
MaxNewCorners[TRIANGLE] = 3; |
| 3161 |
MaxNewEdges[TRIANGLE] = 9; |
| 3162 |
CenterNodeIndex[TRIANGLE] = 4; |
| 3163 |
RefRules[TRIANGLE] = TriangleRules; |
| 3164 |
|
| 3165 |
|
| 3166 |
/************************************************************************/ |
| 3167 |
/* */ |
| 3168 |
/* init refinement rules for quadrilaterals */ |
| 3169 |
/* */ |
| 3170 |
/************************************************************************/ |
| 3171 |
|
| 3172 |
/* there are 32 = 2^5 different patterns */ |
| 3173 |
static const SHORT pattern2RuleQuadrilateral[32] = { |
| 3174 |
/* Pattern2Rule gives the starting index for rules with same pattern */ |
| 3175 |
/* 0: */ NOINDEX, /* 0 0 0 0 0 */ |
| 3176 |
/* 1: */ NOINDEX, /* 0 0 0 0 1 */ |
| 3177 |
/* 2: */ NOINDEX, /* 0 0 0 1 0 */ |
| 3178 |
/* 3: */ NOINDEX, /* 0 0 0 1 1 */ |
| 3179 |
/* 4: */ NOINDEX, /* 0 0 1 0 0 */ |
| 3180 |
/* 5: */ NOINDEX, /* 0 0 1 0 1 */ |
| 3181 |
/* 6: */ NOINDEX, /* 0 0 1 1 0 */ |
| 3182 |
/* 7: */ NOINDEX, /* 0 0 1 1 1 */ |
| 3183 |
/* 8: */ NOINDEX, /* 0 1 0 0 0 */ |
| 3184 |
/* 9: */ NOINDEX, /* 0 1 0 0 1 */ |
| 3185 |
/* 10: */ NOINDEX, /* 0 1 0 1 0 */ |
| 3186 |
/* 11: */ NOINDEX, /* 0 1 0 1 1 */ |
| 3187 |
/* 12: */ NOINDEX, /* 0 1 1 0 0 */ |
| 3188 |
/* 13: */ NOINDEX, /* 0 1 1 0 1 */ |
| 3189 |
/* 14: */ NOINDEX, /* 0 1 1 1 0 */ |
| 3190 |
/* 15: */ NOINDEX, /* 0 1 1 1 1 */ |
| 3191 |
/* 16: */ NOINDEX, /* 1 0 0 0 0 */ |
| 3192 |
/* 17: */ NOINDEX, /* 1 0 0 0 1 */ |
| 3193 |
/* 18: */ NOINDEX, /* 1 0 0 1 0 */ |
| 3194 |
/* 19: */ NOINDEX, /* 1 0 0 1 1 */ |
| 3195 |
/* 20: */ NOINDEX, /* 1 0 1 0 0 */ |
| 3196 |
/* 21: */ NOINDEX, /* 1 0 1 0 1 */ |
| 3197 |
/* 22: */ NOINDEX, /* 1 0 1 1 0 */ |
| 3198 |
/* 23: */ NOINDEX, /* 1 0 1 1 1 */ |
| 3199 |
/* 24: */ NOINDEX, /* 1 1 0 0 0 */ |
| 3200 |
/* 25: */ NOINDEX, /* 1 1 0 0 1 */ |
| 3201 |
/* 26: */ NOINDEX, /* 1 1 0 1 0 */ |
| 3202 |
/* 27: */ NOINDEX, /* 1 1 0 1 1 */ |
| 3203 |
/* 28: */ NOINDEX, /* 1 1 1 0 0 */ |
| 3204 |
/* 29: */ NOINDEX, /* 1 1 1 0 1 */ |
| 3205 |
/* 30: */ NOINDEX, /* 1 1 1 1 0 */ |
| 3206 |
/* 31: */ Q_RED, /* 1 1 1 1 1 */ |
| 3207 |
}; |
| 3208 |
Pattern2Rule[QUADRILATERAL] = pattern2RuleQuadrilateral; |
| 3209 |
|
| 3210 |
|
| 3211 |
/* now make rules for quadrilaterals globally available */ |
| 3212 |
MaxRules[QUADRILATERAL] = MAX_QUA_RULES; |
| 3213 |
MaxNewCorners[QUADRILATERAL] = 4; |
| 3214 |
MaxNewEdges[QUADRILATERAL] = 12; |
| 3215 |
CenterNodeIndex[QUADRILATERAL] = 4; |
| 3216 |
RefRules[QUADRILATERAL] = QuadrilateralRules; |
| 3217 |
|
| 3218 |
return (GM_OK); |
| 3219 |
} |
| 3220 |
#endif /* UG_DIM_2 */ |
| 3221 |
|
| 3222 |
|
| 3223 |
/****************************************************************************/ |
| 3224 |
/** \brief InitRuleManager Initialize the 2- or 3D rule set |
| 3225 |
|
| 3226 |
This function initialize the 2- or 3D rule set |
| 3227 |
*/ |
| 3228 |
/****************************************************************************/ |
| 3229 |
|
| 3230 |
INT NS_DIM_PREFIX InitRuleManager (void) |
| 3231 |
{ |
| 3232 |
INT err; |
| 3233 |
|
| 3234 |
/* init 2- or 3D rulemanager */ |
| 3235 |
if ((err=CONCAT(InitRuleManager,DIM,D) ()) != GM_OK) |
| 3236 |
{ |
| 3237 |
SetHiWrd(err,__LINE__); |
| 3238 |
return(err); |
| 3239 |
} |
| 3240 |
return (0); |
| 3241 |
} |