Hermes2D  3.0
linearizer_utils.h
Go to the documentation of this file.
1 // This file is part of Hermes2D.
2 //
3 // Hermes2D is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // Hermes2D is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with Hermes2D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __H2D_LINEARIZER_UTILS_H
19 #define __H2D_LINEARIZER_UTILS_H
20 
21 #include "hermes_common.h"
22 
23 namespace Hermes
24 {
25  namespace Hermes2D
26  {
27  namespace Views
28  {
30  const double HERMES_EPS_VERYLOW = 0.25;
32  const double HERMES_EPS_LOW = 0.05;
34  const double HERMES_EPS_NORMAL = 0.01;
36  const double HERMES_EPS_HIGH = 0.005;
38  const double HERMES_EPS_VERYHIGH = 0.001;
39 
40 #ifndef LINEARIZER_DATA_TYPE
41 #define LINEARIZER_DATA_TYPE double
42 #endif
43 
45 #ifndef LINEARIZER_DIRECTIONAL_QUAD_REFINEMENT_REQUIREMENT
46 #define LINEARIZER_DIRECTIONAL_QUAD_REFINEMENT_REQUIREMENT 5.0
47 #endif
48 
50 #define MAX_LINEARIZER_DIVISION_LEVEL 6
51 
53  template<typename Scalar>
55  {
56  };
57 
59  template<>
61  {
62  static const int dimension = 1;
63 
64  typedef float3x3 triangle_t;
65  typedef float2x3 edge_t;
66  typedef float3 vertex_t;
67  };
68 
70  template<>
72  {
73  static const int dimension = 1;
74 
75  typedef double3x3 triangle_t;
76  typedef double2x3 edge_t;
77  typedef double3 vertex_t;
78  };
79 
81  template<typename Scalar>
83  {
84  };
85 
87  template<>
89  {
90  static const int dimension = 2;
91 
92  typedef float3x4 triangle_t;
93  typedef float2x4 edge_t;
94  typedef float4 vertex_t;
95  };
96 
98  template<>
100  {
101  static const int dimension = 2;
102 
103  typedef double3x4 triangle_t;
104  typedef double2x4 edge_t;
105  typedef double4 vertex_t;
106  };
107 
111  typedef int3 triangle_indices_t;
112 
113  template<typename LinearizerDataDimensions>
114  class HERMES_API ThreadLinearizerMultidimensional;
115 
118  class HERMES_API LinearizerCriterion
119  {
120  public:
121  LinearizerCriterion(bool adaptive);
122  double error_tolerance;
123  int refinement_level;
124  bool adaptive;
125  };
126 
131  {
132  public:
133  LinearizerCriterionAdaptive(double error_tolerance);
134  };
135 
139  {
140  public:
141  LinearizerCriterionFixed(int refinement_level);
142  };
143  }
144  }
145 }
146 #endif
const double HERMES_EPS_LOW
Standard "quality" defining constants.
Definition: adapt.h:24
const double HERMES_EPS_VERYLOW
Standard "quality" defining constants.
int3 internal_vertex_info_t
Typedefs used throughout the Linearizer functionality.
const double HERMES_EPS_HIGH
Standard "quality" defining constants.
int3 triangle_indices_t
Typedefs used throughout the Linearizer functionality.
const double HERMES_EPS_VERYHIGH
Standard "quality" defining constants.
Adaptive Linearizer criterion - error tolerance (see further) where the element division stops Error ...
Typedefs used throughout the Linearizer functionality.
Typedefs used throughout the Linearizer functionality.
const double HERMES_EPS_NORMAL
Standard "quality" defining constants.
Simple Linearizer criterion - every element is refined exactly the same number of times...
Abstract class for criterion according to which the linearizer stops dividing elements at some point ...