Hermes2D  3.0
global.h
Go to the documentation of this file.
1 // This file is part of Hermes2D
2 //
3 // Copyright (c) 2009 hp-FEM group at the University of Nevada, Reno (UNR).
4 // Email: hpfem-group@unr.edu, home page: http://www.hpfem.org/.
5 //
6 // Hermes2D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published
8 // by the Free Software Foundation; either version 2 of the License,
9 // or (at your option) any later version.
10 //
11 // Hermes2D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with Hermes2D; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef __H2D_COMMON_H_
24 #define __H2D_COMMON_H_
25 
26 #include "hermes_common.h"
27 #include "config.h"
28 
30 #define H2D_MAX_ELEMENT_SONS 4
31 #define H2D_MAX_NUMBER_EDGES 4
32 #define H2D_MAX_NUMBER_VERTICES 4
33 
34 #define H2D_NUM_MODES 2
36 #define H2D_SOLUTION_ELEMENT_CACHE_SIZE 4
37 #define H2D_MAX_NODE_ID 10000000
38 #define H2D_MAX_SOLUTION_COMPONENTS 2
39 #ifdef H2D_USE_SECOND_DERIVATIVES
40 #define H2D_NUM_FUNCTION_VALUES 6
41 #else
42 #define H2D_NUM_FUNCTION_VALUES 3
43 #endif
44 static const std::string H2D_DG_INNER_EDGE = "-1234567";
45 
47 #define CENTROID_QUAD_X 0.
48 #define CENTROID_QUAD_Y 0.
49 #define CENTROID_TRI_X -0.3333333333333333
51 #define CENTROID_TRI_Y -0.3333333333333333
52 
54 #define ELEMENT_DELTA_X 2.0
55 #define ELEMENT_DELTA_Y 2.0
56 
58 static const int H2D_TRF_TRI_NUM = 4;
60 static const int H2D_TRF_QUAD_NUM = 8;
62 static const int H2D_TRF_NUM = (H2D_TRF_QUAD_NUM + 1);
64 static const int H2D_TRF_IDENTITY = H2D_TRF_QUAD_NUM;
65 
66 #define H2DRS_ASSUMED_MAX_CANDS 512
67 
68 #define H2DRS_INTR_GIP_ORDER 20
69 #define H2DRS_MAX_ORDER_INC 1
70 
71 #define H2DRS_ORDER_ANY -1
72 
73 # define H2DRS_DEFAULT_ERR_WEIGHT_H 2.0
74 # define H2DRS_DEFAULT_ERR_WEIGHT_P 1.0
75 # define H2DRS_DEFAULT_ERR_WEIGHT_ANISO 1.414214
76 # define MAX_NUMBER_FUNCTION_VALUES_FOR_SELECTORS 3
77 namespace Hermes
78 {
80  namespace Hermes2D
81  {
82  class RefMap;
83  template<typename Scalar> class DiscreteProblem;
84  template<typename Scalar> class MeshFunctionSharedPtr;
85  template<typename Scalar> class Space;
86  template<typename Scalar> class WeakForm;
87  template<typename Scalar> class MeshFunction;
88  template<typename Scalar> class Solution;
89  class Quad2D;
90  class Quad1DStd;
91  class Quad2DStd;
92 
94  const int H2D_ORDER_BITS = 5;
95  const int H2D_ORDER_MASK = (1 << H2D_ORDER_BITS) - 1;
96 
98 #define H2D_GET_H_ORDER(encoded_order) ((encoded_order) & H2D_ORDER_MASK)
99 #define H2D_GET_V_ORDER(encoded_order) ((encoded_order) >> H2D_ORDER_BITS)
100 #define H2D_MAKE_QUAD_ORDER(h_encoded_order, v_encoded_order) (((v_encoded_order) << H2D_ORDER_BITS) + (h_encoded_order))
101 #define H2D_MAKE_EDGE_ORDER(mode, edge, order) ((mode == HERMES_MODE_TRIANGLE || edge == 0 || edge == 2) ? H2D_GET_H_ORDER(order) : H2D_GET_V_ORDER(order))
102 
103 #define H2DRS_DEFAULT_ORDER -1
104 #define H2DRS_MAX_ORDER 10
105 #define H2D_NUM_SHAPES_SIZE 12
106 
107  enum NormType
110  {
111  HERMES_L2_NORM,
112  HERMES_H1_NORM,
113  HERMES_H1_SEMINORM,
114  HERMES_HCURL_NORM,
115  HERMES_HDIV_NORM,
116  HERMES_UNSET_NORM
117  };
118 
122  HERMES_MODE_TRIANGLE = 0,
123  HERMES_MODE_QUAD = 1
124  };
125 
126  enum SpaceType {
127  HERMES_H1_SPACE = 0,
128  HERMES_HCURL_SPACE = 1,
129  HERMES_HDIV_SPACE = 2,
130  HERMES_L2_SPACE = 3,
131  HERMES_L2_MARKERWISE_CONST_SPACE = 4,
132  HERMES_INVALID_SPACE = -9999
133  };
134 
137  HERMES_H1_JACOBI = 0,
138  HERMES_L2_LEGENDRE = 1,
139  HERMES_L2_TAYLOR = 2,
140  HERMES_HDIV_LEGENDRE = 3,
141  HERMES_HCURL_GRADLEG = 4
142  };
143 
144  const char* spaceTypeToString(SpaceType spaceType);
145  SpaceType spaceTypeFromString(const char* spaceTypeString);
146 
148  enum GeomType
149  {
150  HERMES_PLANAR = 0, // Planar problem.
151  HERMES_AXISYM_X = 1, // Axisymmetric problem where x-axis is the axis of symmetry.
152  HERMES_AXISYM_Y = 2 // Axisymmetric problem where y-axis is the axis of symmetry.
153  };
154 
156  enum SymFlag
157  {
158  HERMES_ANTISYM = -1,
159  HERMES_NONSYM = 0,
160  HERMES_SYM = 1
161  };
162 
166  {
167  OpenGL,
168  // VTK, Tecplot, etc.
169  FileExport
170  };
171  }
172 }
173 #endif
Definition: adapt.h:24
ShapesetType
Important not to change the indices - used in an array enumeration.
Definition: global.h:136
Represents a function defined on a mesh.
Definition: mesh_function.h:56
2D quadrature points on the standard reference domains (-1,1)^2
Definition: quad_all.h:36
SymFlag
Bilinear form symmetry flag, see WeakForm::add_matrix_form.
Definition: global.h:156
Represents the weak formulation of a PDE problem.
Definition: global.h:86
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
GeomType
Geometrical type of weak forms.
Definition: global.h:148
Represents the solution of a PDE.
Definition: api2d.h:35
1D quadrature points on the standard reference domain (-1,1)
Definition: quad_all.h:28
const int H2D_ORDER_BITS
How many bits the encoded_order number takes.
Definition: global.h:94