Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/Application/plugins/egdef.h
3203 views
1
/* femdef.h */
2
/* General definitions for the FEM program. */
3
4
#ifndef _FEMDEF_H_
5
#define _FEMDEF_H_
6
7
#ifndef _COMMON_H_
8
typedef double Real;
9
typedef int Integer;
10
#define TRUE 1
11
#define FALSE 0
12
#endif
13
14
/* Natural constants */
15
#ifndef FM_PI
16
#define FM_PI 3.1415926
17
#endif
18
#define NEARZERO 1.0e-50
19
20
/* the number and order of the axes */
21
#define XAXIS 0
22
#define YAXIS 1
23
#define ZAXIS 2
24
#define DIM 2
25
26
/* four possible directions */
27
#define INDEFINITE -1
28
#define RIGHT 1
29
#define UP 2
30
#define LEFT 3
31
#define DOWN 0
32
33
/* bilinear 2D element sides */
34
#define BOTLEFT 0
35
#define TOPLEFT 3
36
#define BOTRIGHT 1
37
#define TOPRIGHT 2
38
39
/* linear 1D element */
40
#define FIRST 0
41
#define SECOND 1
42
43
/* coordinate systems */
44
#define COORD_CART2 0
45
#define COORD_AXIS 1
46
#define COORD_POLAR 2
47
#define COORD_CART3 3
48
#define COORD_CART1 4
49
#define COORD_CYL 5
50
51
/* Different types of boundary conditions */
52
#define BNDR_NOTHING 0
53
54
/* Type of knot */
55
#define KNOTS_ALL 1
56
#define KNOTS_DIRICHLET 2
57
#define KNOTS_FREE 3
58
59
/* Type of numbering */
60
#define NUMBER_XY 1
61
#define NUMBER_YX 2
62
#define NUMBER_1D 3
63
64
/* The values corresponding the different materials in the mesh. */
65
#define MAT_SMALLER -11
66
#define MAT_BIGGER -9
67
#define MAT_ANYTHING -10
68
#define MAT_BOT -1
69
#define MAT_RIGHT -2
70
#define MAT_TOP -3
71
#define MAT_LEFT -4
72
#define MAT_NOTHING 0
73
#define MAT_FIRSTNUMBER 2
74
#define MAT_MAXNUMBER 50
75
/* #define MAT_ORIGO 1 */
76
77
/* Elementary functions */
78
#define MIN(x, y) ( ((x) < (y)) ? (x) : (y) )
79
#define MAX(x, y) ( ((x) > (y)) ? (x) : (y) )
80
#define SGN(x) ( ((x) < 0.) ? (-1) : (((x) > 0.) ? (1) : 0) )
81
#define ABS(x) ( (x) >= 0 ? (x) : -(x))
82
#define FABS(x) ( (x) >= 0.0 ? (x) : -(x))
83
#define SQR(x) ((x) * (x))
84
#define POS(x) ((x) > 0.0 ? (x) : 0.0)
85
#define NEG(x) ((x) < 0.0 ? (x) : 0.0)
86
#define RAD_TO_DEG(x) ((x)*180.0/FM_PI)
87
#define DEG_TO_RAD(x) ((x)*FM_PI/180.0)
88
89
#endif
90
91