Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tetrahedron_rules.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2015: G-CSC, Goethe University Frankfurt
3 * Author: Sebastian Reiter
4 *
5 * This file is part of UG4.
6 *
7 * UG4 is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License version 3 (as published by the
9 * Free Software Foundation) with the following additional attribution
10 * requirements (according to LGPL/GPL v3 §7):
11 *
12 * (1) The following notice must be displayed in the Appropriate Legal Notices
13 * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14 *
15 * (2) The following notice must be displayed at a prominent place in the
16 * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17 *
18 * (3) The following bibliography is recommended for citation and must be
19 * preserved in all covered files:
20 * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21 * parallel geometric multigrid solver on hierarchically distributed grids.
22 * Computing and visualization in science 16, 4 (2013), 151-164"
23 * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24 * flexible software system for simulating pde based models on high performance
25 * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU Lesser General Public License for more details.
31 */
32
33#ifndef __H__UG__tetrahedron_rules__
34#define __H__UG__tetrahedron_rules__
35
36#include "common/math/ugmath.h"
37
38namespace ug{
39namespace tet_rules
40{
41
43// REFINEMENT RULE
44
50
52// LOOKUP TABLES
53
54const int NUM_VERTICES = 4;
55const int NUM_EDGES = 6;
56const int NUM_FACES = 4;
57const int NUM_TRIS = 4;
58const int NUM_QUADS = 0;
59const int MAX_NUM_INDS_OUT = 64;//todo: this is just an estimate!
60
62const int EDGE_VRT_INDS[][2] = { {0, 1}, {1, 2}, {2, 0},
63 {0, 3}, {1, 3}, {2,3}};
64
66const int FACE_VRT_INDS[][4] = { {0, 1, 2, -1}, {1, 3, 2, -1},
67 {0, 2, 3, -1}, {0, 3, 1, -1}};
68
70const int OPPOSED_EDGE[] = {5, 3, 4, 1, 2, 0};
71
75const int OPPOSED_OBJECT[][NUM_VERTICES] = {{2, 1}, {2, 2}, {2, 3}, {2, 0}};
76
79// NOTE: The lists below are all generated automatically
80
82const int FACE_EDGE_INDS[4][4] = {{0, 1, 2, -1}, {4, 5, 1, -1},
83 {2, 5, 3, -1}, {3, 4, 0, -1}};
84
86const int FACE_CONTAINS_EDGE[][6] = {{1, 1, 1, 0, 0, 0}, {0, 1, 0, 0, 1, 1},
87 {0, 0, 1, 1, 0, 1}, {1, 0, 0, 1, 1, 0}};
88
90
93const int EDGE_FROM_VRTS[4][4] = {{-1, 0, 2, 3}, {0, -1, 1, 4},
94 {2, 1, -1, 5}, {3, 4, 5, -1}};
95
97
100const int FACE_FROM_VRTS[4][4][4] =
101 {{{-1, -1, -1, -1}, {-1, -1, 0, 3}, {-1, 0, -1, 2}, {-1, 3, 2, -1}},
102 {{-1, -1, 0, 3}, {-1, -1, -1, -1}, {0, -1, -1, 1}, {3, -1, 1, -1}},
103 {{-1, 0, -1, 2}, {0, -1, -1, 1}, {-1, -1, -1, -1}, {2, 1, -1, -1}},
104 {{-1, 3, 2, -1}, {3, -1, 1, -1}, {2, 1, -1, -1}, {-1, -1, -1, -1}}};
105
107const int FACE_FROM_EDGES[][6] = {{0, 0, 0, 3, 3, -1}, {0, 0, 0, -1, 1, 1},
108 {0, 0, 0, 2, -1, 2}, {3, -1, 2, 2, 3, 2},
109 {3, 1, -1, 3, 1, 1}, {-1, 1, 2, 2, 1, 1}};
110
111
112
115
158int Refine(int* newIndsOut, int* newEdgeVrts, bool& newCenterOut,
159 vector3* corners = NULL, bool* isSnapPoint = NULL);
160
161
163
175bool IsRegularRefRule(const int edgeMarks);
176
177
182
183}// end of namespace tet_rules
184}// end of namespace ug
185
186#endif
const int FACE_VRT_INDS[][4]
the local vertex indices of the given face
Definition tetrahedron_rules.h:66
const int OPPOSED_OBJECT[][NUM_VERTICES]
Definition tetrahedron_rules.h:75
void SetRefinementRule(GlobalRefinementRule refRule)
Definition tetrahedron_rules.cpp:45
int Refine(int *newIndsOut, int *newEdgeVrts, bool &newCenterOut, vector3 *corners, bool *)
Definition tetrahedron_rules.cpp:90
const int NUM_VERTICES
Definition tetrahedron_rules.h:54
const int FACE_CONTAINS_EDGE[][6]
tells whether the i-th face contains the j-th edge
Definition tetrahedron_rules.h:86
const int EDGE_FROM_VRTS[4][4]
Associates the index of the connecting edge with each tuple of vertices.
Definition tetrahedron_rules.h:93
GlobalRefinementRule
identification of refinement rule to be used
Definition tetrahedron_rules.h:46
@ STANDARD
Definition tetrahedron_rules.h:47
@ HYBRID_TET_OCT
Definition tetrahedron_rules.h:48
const int MAX_NUM_INDS_OUT
Definition tetrahedron_rules.h:59
const int NUM_EDGES
Definition tetrahedron_rules.h:55
const int FACE_EDGE_INDS[4][4]
returns the j-th edge of the i-th face
Definition tetrahedron_rules.h:82
GlobalRefinementRule GetRefinementRule()
Definition tetrahedron_rules.cpp:50
const int NUM_QUADS
Definition tetrahedron_rules.h:58
const int OPPOSED_EDGE[]
for each edge the local index of the opposed edge
Definition tetrahedron_rules.h:70
const int NUM_TRIS
Definition tetrahedron_rules.h:57
bool IsRegularRefRule(const int edgeMarks)
returns true if the specified edgeMarks would lead to a regular refinement
Definition tetrahedron_rules.cpp:716
const int NUM_FACES
Definition tetrahedron_rules.h:56
const int EDGE_VRT_INDS[][2]
the local vertex indices of the given edge
Definition tetrahedron_rules.h:62
const int FACE_FROM_EDGES[][6]
given two edges, the table returns the face, which contains both (or -1)
Definition tetrahedron_rules.h:107
const int FACE_FROM_VRTS[4][4][4]
Associates the index of the connecting face with each triple of vertices.
Definition tetrahedron_rules.h:100
the ug namespace