BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
typedefs.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_TYPEDEFS_HPP
13#define BELFEM_TYPEDEFS_HPP
14
15#include <string>
16#include <limits>
17#include <complex>
18#include <array>
19#include <cstdint>
20
21namespace belfem
22{
23//------------------------------------------------------------------------------
24
25 typedef size_t size_t;
26 typedef std::string string;
27
28 typedef int sint;
29 typedef long int lsint;
30 typedef unsigned int uint;
31 typedef unsigned char uchar;
32 typedef short unsigned int suint;
33 typedef long unsigned int luint;
34 typedef long long unsigned int lluint;
35
36 typedef double real;
37 typedef std::complex<real> cplx;
38
39//------------------------------------------------------------------------------
40
41 typedef unsigned int id_t;
42 typedef int proc_t;
43 typedef long long unsigned int key_t;
44 typedef __uint128_t key128_t;
45
46//------------------------------------------------------------------------------
47#ifdef BELFEM_INT64
48 typedef int64_t int_t ;
49 typedef uint64_t index_t;
50#else
51 typedef int32_t int_t ;
52 typedef uint32_t index_t;
53#endif
54
55//------------------------------------------------------------------------------
56
57 constexpr index_t gNoIndex = std::numeric_limits<index_t>::max();
58 constexpr id_t gNoID = std::numeric_limits<id_t>::max();
59 constexpr proc_t gNoOwner = std::numeric_limits<proc_t>::max();
60
61 // todo: probably better to move to constants
62 constexpr real gTfreeze = 273.15 ;
63 constexpr real gTref = 288.15 ;
64 constexpr real gTroom = 293.15 ;
65 constexpr real gTmin = 1.0 ;
66
67 constexpr real gFinDiffDeltaT = 0.001 ;
68 constexpr real gFinDiffDeltaB = 0.001 ;
69 constexpr real gFinDiffDeltaAngle = 1.74532925199433e-3 ;
70
71 // L, M, T, I, theta, N, J
72 typedef std::array< real, 7 > unit ;
73
74 typedef std::pair< real, unit > value ;
75
76//------------------------------------------------------------------------------
77#define BELFEM_UCHAR_MAX std::numeric_limits<uchar>::max()
78#define BELFEM_SINT_MAX std::numeric_limits<sint>::max()
79#define BELFEM_SUINT_MAX std::numeric_limits<suint>::max()
80#define BELFEM_UINT_MAX std::numeric_limits<uint>::max()
81#define BELFEM_REAL_MAX std::numeric_limits<real>::max()
82#define BELFEM_REAL_MIN std::numeric_limits<real>::min()
83#define BELFEM_INT_MAX std::numeric_limits<int>::max()
84#define BELFEM_LUINT_MAX std::numeric_limits<luint>::max()
85#define BELFEM_KEY_MAX std::numeric_limits<key_t>::max()
86#define BELFEM_SIGNALING_NAN std::numeric_limits<real>::signaling_NaN()
87#define BELFEM_QUIET_NAN std::numeric_limits<real>::quiet_NaN()
88#define BELFEM_INFINITY std::numeric_limits<real>::infinity()
89
90 constexpr real BELFEM_EPSILON = 10 * std::numeric_limits<real>::epsilon();
91 constexpr real BELFEM_EPS = std::numeric_limits<real>::epsilon();
92 constexpr real BELFEM_MESH_EPSILON = 1e-9 ;
93
94//------------------------------------------------------------------------------
95}
96#endif //BELFEM_TYPEDEFS_HPP
USER GUIDES:
Definition cl_Capacitor.cpp:16
std::complex< real > cplx
Definition typedefs.hpp:37
long int lsint
Definition typedefs.hpp:29
long long unsigned int lluint
Definition typedefs.hpp:34
std::string string
Definition typedefs.hpp:26
std::pair< real, unit > value
Definition typedefs.hpp:74
std::array< real, 7 > unit
Definition typedefs.hpp:72
constexpr real gTroom
Definition typedefs.hpp:64
long unsigned int luint
Definition typedefs.hpp:33
constexpr id_t gNoID
Definition typedefs.hpp:58
__uint128_t key128_t
Definition typedefs.hpp:44
unsigned int uint
Definition typedefs.hpp:30
constexpr real BELFEM_MESH_EPSILON
Definition typedefs.hpp:92
constexpr real gTref
Definition typedefs.hpp:63
constexpr real gFinDiffDeltaB
Definition typedefs.hpp:68
unsigned int id_t
Definition typedefs.hpp:41
constexpr real BELFEM_EPSILON
Definition typedefs.hpp:90
int proc_t
Definition commtypes.hpp:29
constexpr real BELFEM_EPS
Definition typedefs.hpp:91
constexpr real gTmin
Definition typedefs.hpp:65
unsigned char uchar
Definition typedefs.hpp:31
constexpr real gFinDiffDeltaAngle
Definition typedefs.hpp:69
long long unsigned int key_t
Definition typedefs.hpp:43
constexpr real gTfreeze
Definition typedefs.hpp:62
constexpr index_t gNoIndex
Definition typedefs.hpp:57
short unsigned int suint
Definition typedefs.hpp:32
constexpr proc_t gNoOwner
Definition typedefs.hpp:59
uint32_t index_t
Definition typedefs.hpp:52
int sint
Definition typedefs.hpp:28
constexpr real gFinDiffDeltaT
Definition typedefs.hpp:67
double real
Definition typedefs.hpp:36
size_t size_t
Definition typedefs.hpp:25
int32_t int_t
Definition typedefs.hpp:51