XC Open source finite element analysis program
basics.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 
28 // $Revision: 1.2 $
29 // $Date: 2004/06/01 21:19:12 $
30 // $Source: /usr/local/cvs/OpenSees/SRC/nDarray/basics.h,v $
31 
32 //#############################################################################
33 // #
34 // #
35 // /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/~~\ #
36 // | |____| #
37 // | | #
38 // | | #
39 // | | #
40 // | | #
41 // | B A S E C L A S S E S | #
42 // | | #
43 // | | #
44 // | | #
45 // | | #
46 // | C + + H E A D E R | #
47 // | | #
48 // | | #
49 // | | #
50 // | | #
51 // /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/ | #
52 // \_________________________________________\__/ #
53 // #
54 // #
55 //#############################################################################
56 //#############################################################################
57 //##
59 //################################################################################
60 //# COPY-YES (C): :-)) #
61 //# PROJECT: Object Oriented Finite Element Program #
62 //# PURPOSE: #
63 //# CLASS: #
64 //# #
65 //# VERSION: #
66 //# LANGUAGE: C++.ver >= 2.0 ( Borland C++ ver=3.10, SUN C++ ver=2.1 ) #
67 //# TARGET OS: DOS || UNIX || . . . #
68 //# DESIGNER(S): Boris Jeremic #
69 //# PROGRAMMER(S): Boris Jeremic #
70 //# #
71 //# DATE: November '92 #
72 //# UPDATE HISTORY: 05 - __ avgust '93. redefined as derived class from #
73 //# nDarray class #
74 //# january 06 '93 added matrix2BJtensor_1, matrix2BJtensor_2 #
75 //# matrix2BJtensor_3 #
76 //# August 22-29 '94 choped to separate files and worked on #
77 //# const and & issues #
78 //# August 30-31 '94 added use_def_dim to full the CC #
79 //# resolved problem with temoraries for #
80 //# operators + and - ( +=, -= ) #
81 //# #
82 //################################################################################
83 //*/
84 #ifndef BASICS_HH
85 #define BASICS_HH
86 
87 #include <cmath>
88 //#include <values.h>
89 #include <cstdio>
90 #include <cstdlib>
91 #include <cstring>
92 #include <cstdarg>
93 #include <ctime>
94 
95 
96 // Define BJmatrix as matrix type
97 #ifndef matrix
98 #define matrix BJmatrix
99 #endif
100 
101 #ifndef tensor
102 #define Tensor BJtensor
103 #endif
104 
105 // redefine Pi from math.h M_PI
106 #ifndef PI
107 #define PI 3.14159265358979323846
108 #endif
109 //##############################################################################
110 #ifndef TWOOVERTHREE
111 #define TWOOVERTHREE 0.6666666666667
112 #endif
113 //##############################################################################
114 #ifndef ONEOVERTHREE
115 #define ONEOVERTHREE 0.3333333333333
116 #endif
117 //##############################################################################
118 //##############################################################################
119 // usefull arrays for constructors . . .
120 //#ifdef SASA
121  static const int def_dim_4_2[]={2,2,2,2}; // Sasa jan - 99
122 //#endif
123 
124 #ifndef DEF_DIM
125 #define DEF_DIM
126  static const int def_dim_1[] = {3};
127  static const int def_dim_2[] = {3, 3}; // static-> see ARM pp289-290
128  static const int def_dim_3[] = {3, 3, 3}; // static-> see ARM pp289-290
129  static const int def_dim_4[] = {3, 3, 3, 3}; // static-> see ARM pp289-290
130 
131 // Cosserat
132  static const int Cosserat_def_dim_2[] = {6, 6}; // static-> see ARM pp289-290
133  static const int Cosserat_def_dim_4[] = {6, 6, 6, 6}; // static-> see ARM pp289-290
134 
135 #endif
136 
137 #ifndef TEST
138 #define TEST
139  const int tst = 3;
140 #endif
141 
142 
143 #ifndef DZERO
144 #define DZERO 0.0
145 // double ZERO = 0.0;
146 #endif
147 
148 float f_macheps();
149 double d_macheps();
150 long double ld_macheps();
151 
152 #endif
153 
154