1 /* 2 XLiFE++ is an extended library of finite elements written in C++ 3 Copyright (C) 2014 Lunéville, Eric; Kielbasiewicz, Nicolas; Lafranche, Yvon; Nguyen, Manh-Ha; Chambeyron, Colin 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 You should have received a copy of the GNU General Public License 14 along with this program. If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17 /*! 18 \file config.hpp 19 \authors D. Martin, E. Lunéville, M.-H. Nguyen, N. Kielbasiewicz 20 \since 10 jun 2011 21 \date 17 oct 2014 22 23 \brief config "compile configuration" header file (pre-compiler macros) 24 */ 25 26 #ifndef CONFIG_HPP 27 #define CONFIG_HPP 28 29 // Include most commonly used C++ definition files 30 #include <cfloat> 31 #include <climits> 32 #include <complex> 33 #include <cstdlib> 34 #include <cmath> 35 #include <iomanip> 36 #include <iosfwd> 37 #include <string> 38 #include <set> 39 #include <vector> 40 #include <map> 41 #include <utility> 42 #include <algorithm> 43 #include <limits> 44 #include <iostream> 45 #include <list> 46 #include <iterator> 47 48 // setup : define OS, precision type, default language, debug parameter, ... 49 #include "setup.hpp" 50 51 //! main namespace of XLiFE++ library 52 namespace xlifepp 53 { 54 55 //------------------------------------------------------------------------------ 56 // Definition of scalars 57 //------------------------------------------------------------------------------ 58 #if defined(STD_TYPES) 59 //! typedef for real 60 typedef float real_t; 61 //! typedef for complex 62 typedef std::complex<float> complex_t; 63 #elif defined(LONG_TYPES) 64 //! typedef for real 65 typedef double real_t; 66 //! typedef for complex 67 typedef std::complex<double> complex_t; 68 #elif defined(LONGLONG_TYPES) 69 //! typedef for real 70 typedef long double real_t; 71 //! typedef for complex 72 typedef std::complex<long double> complex_t; 73 #endif 74 75 #if defined(COMPILER_IS_32_BITS) 76 //! typedef for integer 77 typedef long int int_t; 78 #else 79 //! typedef for integer 80 typedef long long int_t; 81 typedef unsigned long long uint_t; 82 #endif 83 //------------------------------------------------------------------------------ 84 // String choice 85 //------------------------------------------------------------------------------ 86 #if defined(STD_STRING) 87 //! typedef for string 88 typedef std::string string_t; 89 #elif defined(WIDE_STRING) 90 //! typedef for string 91 typedef std::wstring string_t; 92 #endif 93 94 //------------------------------------------------------------------------------ 95 // Shortcuts (type aliases) 96 //------------------------------------------------------------------------------ 97 //! typedef for short unsigned int 98 typedef short unsigned int dimen_t; 99 //! typedef for size_t 100 typedef size_t number_t; 101 102 typedef std::pair<dimen_t, dimen_t> dimPair; //!< useful alias 103 104 105 //------------------------------------------------------------------------------ 106 // Output format parameters and extremal values 107 //------------------------------------------------------------------------------ 108 extern const number_t entriesPerRow; 109 // unused: extern const number_t addrPerRow; 110 // unused: extern const number_t numberPerRow; 111 extern const number_t entryWidth; 112 extern const number_t entryPrec; 113 extern const number_t addrWidth; 114 extern const number_t numberWidth; 115 extern const number_t fullPrec; // for numerical data that could be reused 116 extern const number_t testPrec; // for test programs output 117 118 extern const number_t theNumberMax; 119 extern const size_t theSizeMax; 120 extern const dimen_t theDimMax; 121 extern const int_t theIntMax; 122 extern const real_t theRealMax; 123 extern const real_t theEpsilon; 124 extern const real_t theTolerance; 125 extern const real_t theZeroThreshold; 126 extern const number_t theLanguage; 127 extern number_t theGlobalVerboseLevel; 128 extern number_t theVerboseLevel; 129 extern bool trackingObjects; 130 extern real_t theDefaultCharacteristicLength; 131 132 extern number_t defaultMaxIterations; 133 extern real_t theRatioOfIterations2Rows; 134 extern real_t theBreakdownThreshold; 135 extern real_t theDefaultConvergenceThreshold; 136 extern number_t defaultKrylovDimension; 137 138 extern std::string eol; 139 140 //------------------------------------------------------------------------------ 141 // Some math constants 142 //------------------------------------------------------------------------------ 143 // 1/3, 1/6, pi, 1/pi, 1/2pi, 1/4pi, sqrt(2), sqrt(3), log(2) 144 extern const real_t over3_; 145 extern const real_t over6_; 146 extern const real_t pi_; 147 extern const complex_t i_; 148 extern const real_t overpi_; 149 extern const real_t over2pi_; 150 extern const real_t over4pi_; 151 extern const real_t sqrtOf2_; 152 extern const real_t sqrtOf3_; 153 extern const real_t logOf2_; 154 // Euler-Mascheroni gamma constant = .577215664901532860606512090082402431042...; 155 // gamma = - \Int_0^\infty exp(-x) log(x) dx 156 extern const real_t theEulerConst; 157 158 //------------------------------------------------------------------------------ 159 // Declaration of default global objects 160 //------------------------------------------------------------------------------ 161 class Parameters; 162 extern Parameters defaultParameters; 163 extern Parameters* defaultParameters_p; 164 165 class Messages; 166 extern Messages* theMessages_p; 167 168 class Trace; 169 extern Trace* trace_p; 170 171 class MsgData; 172 extern MsgData theMessageData; 173 extern std::string theWhereData; 174 175 class Environment; 176 extern Environment* theEnvironment_p; 177 178 class Parameter; 179 180 extern Parameter _lang, _verbose, _trackingMode, _isLogged; 181 extern Parameter _varnames; 182 extern Parameter _vertices, _faces; 183 extern Parameter _center, _center1, _center2, _apogee, _origin, _apex, _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8; 184 extern Parameter _xmin, _xmax, _ymin, _ymax, _zmin, _zmax; 185 extern Parameter _length, _xlength, _ylength, _zlength, _radius, _radius1, _radius2; 186 extern Parameter _basis, _scale, _direction; 187 extern Parameter _end_shape, _end1_shape, _end2_shape, _end_distance, _end1_distance, _end2_distance; 188 extern Parameter _nnodes, _hsteps; 189 extern Parameter _domain_name, _side_names, _nbsubdomains; 190 extern Parameter _nboctants, _angle1, _angle2, _type; 191 extern Parameter _maxIt, _krylovDim, _solver, _tolerance, _residue, _nbIterations; 192 extern Parameter _convToStd, _forceNonSym, _ncv, _nev, _mode, _sigma, _sort, _which; 193 extern Parameter _omega, _name; 194 195 class ArpackProb; 196 extern ArpackProb _ARprob; 197 198 class SymbolicFunction; 199 extern SymbolicFunction x_1, x_2, x_3, x_4; 200 201 class ThreadData; 202 extern ThreadData theThreadData; 203 204 //------------------------------------------------------------------------------ 205 // Unique output file stream 206 //------------------------------------------------------------------------------ 207 //extern std::ofstream thePrintStream; 208 class PrintStream; 209 class CoutStream; 210 extern PrintStream thePrintStream; 211 extern CoutStream theCout; 212 extern std::string thePrintFile; 213 214 //------------------------------------------------------------------------------ 215 // enum's used as types or as consts in user's main or functions 216 // by default items of enum begin by _ except for end user's enum 217 // enum are listed by library alphabetically 218 //------------------------------------------------------------------------------ 219 220 enum KeepStatus{_keep, _nokeep}; 221 222 // --------- arpackSupport --------- 223 224 // --------- eigenSolvers ---------- 225 226 // ----- essentialConditions ------- 227 228 //! type of essential condition 229 enum EcType { _undefEcType,_DirichletEc, _transmissionEc, _crackEc, _periodicEc, _meanEc, _lfEc }; 230 231 //! reduction method to deal with essential conditions 232 enum ReductionMethodType 233 { 234 _noReduction = 0, 235 _pseudoReduction, 236 _realReduction, 237 _penalizationReduction, 238 _dualReduction 239 }; 240 241 // ----------- finalize ------------ 242 243 // -------- finiteElements --------- 244 245 //@{ 246 /*! name nomenclature of edge/face element 247 2D (triangle) 3D (tetrahedron) 248 FE face type (Hdiv) Raviart-Thomas(RT) Nedelec Face first family (NF1) 249 Brezzi-Douglas-Marini(BDM) Nedelec Face second family(NF2) 250 FE edge type (Hrot) Nedelec first family (N1) Nedelec Edge first family (NE1) 251 Nedelec second family(N2) Nedelec Edge second family(NE2) 252 253 \note according to the previous table, there is an equivalence between 2D and 3D shortname : 254 for instance NF_1 in 2D is understood as RT_1 and RT_1 in 3D is understood as NF_1 255 */ 256 enum FeEdgeType 257 { 258 _N1_1 = 1, N1_1 = _N1_1, _NE1_1 = _N1_1, NE1_1 = _N1_1, 259 _N1_2 , N1_2 = _N1_2, _NE1_2 = _N1_2, NE1_2 = _N1_2, 260 _N1_3 , N1_3 = _N1_3, _NE1_3 = _N1_3, NE1_3 = _N1_3, 261 _N1_4 , N1_4 = _N1_4, _NE1_4 = _N1_4, NE1_4 = _N1_4, 262 _N1_5 , N1_5 = _N1_5, _NE1_5 = _N1_5, NE1_5 = _N1_5, 263 _N2_1 , N2_1 = _N2_1, _NE2_1 = _N2_1, NE2_1 = _N2_1, 264 _N2_2 , N2_2 = _N2_2, _NE2_2 = _N2_2, NE2_2 = _N2_2, 265 _N2_3 , N2_3 = _N2_3, _NE2_3 = _N2_3, NE2_3 = _N2_3, 266 _N2_4 , N2_4 = _N2_4, _NE2_4 = _N2_4, NE2_4 = _N2_4, 267 _N2_5 , N2_5 = _N2_5, _NE2_5 = _N2_5, NE2_5 = _N2_5 268 }; 269 270 enum FeFaceType 271 { 272 _RT_1 = 1, RT_1 = _RT_1, _NF1_1 = _RT_1, NF1_1 = _RT_1, 273 _RT_2 , RT_2 = _RT_2, _NF1_2 = _RT_2, NF1_2 = _RT_2, 274 _RT_3 , RT_3 = _RT_3, _NF1_3 = _RT_3, NF1_3 = _RT_3, 275 _RT_4 , RT_4 = _RT_4, _NF1_4 = _RT_4, NF1_4 = _RT_4, 276 _RT_5 , RT_5 = _RT_5, _NF1_5 = _RT_5, NF1_5 = _RT_5, 277 _BDM_1 , BDM_1 = _BDM_1, _NF2_1 = _BDM_1, NF2_1 = _BDM_1, 278 _BDM_2 , BDM_2 = _BDM_2, _NF2_2 = _BDM_2, NF2_2 = _BDM_2, 279 _BDM_3 , BDM_3 = _BDM_3, _NF2_3 = _BDM_3, NF2_3 = _BDM_3, 280 _BDM_4 , BDM_4 = _BDM_4, _NF2_4 = _BDM_4, NF2_4 = _BDM_4, 281 _BDM_5 , BDM_5 = _BDM_5, _NF2_5 = _BDM_5, NF2_5 = _BDM_5 282 }; 283 //@} 284 285 //! finite element subfamily 286 enum FESubType 287 { 288 _standard = 0, standard = _standard, 289 _GaussLobatto, GaussLobatto = _GaussLobatto, 290 _firstFamily, firstFamily = _firstFamily, 291 _secondFamily, secondFamily = _secondFamily 292 }; 293 294 //! finite element family 295 enum FEType 296 { 297 _Lagrange, Lagrange = _Lagrange, 298 _Hermite, Hermite = _Hermite, 299 _CrouzeixRaviart, CrouzeixRaviart = _CrouzeixRaviart, 300 _Nedelec, Nedelec = _Nedelec, 301 _RaviartThomas, RaviartThomas = _RaviartThomas, 302 _Nedelec_Face, NedelecFace = _Nedelec_Face, 303 _Nedelec_Edge, NedelecEdge = _Nedelec_Edge, 304 _BuffaChristiansen, BuffaChristiansen=_BuffaChristiansen 305 }; 306 307 //! integration methods 308 enum IntegrationMethodType 309 { 310 _undefIM, _quadratureIM, _polynomialIM, _productIM, 311 _LenoirSalles2dIM, Lenoir_Salles_2d =_LenoirSalles2dIM, _LenoirSalles3dIM, Lenoir_Salles_3d= _LenoirSalles3dIM, _LenoirSalles2dIR, _LenoirSalles3dIR, 312 _SauterSchwabIM, Sauter_Schwab=_SauterSchwabIM, _DuffyIM, Duffy = _DuffyIM, _HMatrixIM, H_Matrix= _HMatrixIM 313 }; 314 315 //! interpolation degree 316 enum PolynomType 317 { 318 _P0 = 0, P0 = _P0, 319 _P1, P1 = _P1, 320 _P2, P2 = _P2, 321 _P3, P3 = _P3, 322 _P4, P4 = _P4, 323 _P5, P5 = _P5, 324 _P6, P6 = _P6, 325 _P7, P7 = _P7, 326 _P8, P8 = _P8, 327 _P9, P9 = _P9, 328 _P10, P10 = _P10, 329 _P1BubbleP3 = 1001, P1BubbleP3 = _P1BubbleP3 //WARNING : do not go up to degree 1000 for PK 330 }; 331 332 //! interpolation degree 333 enum QolynomType 334 { 335 _Q0 = 0, Q0 = _Q0, 336 _Q1, Q1 = _Q1, 337 _Q2, Q2 = _Q2, 338 _Q3, Q3 = _Q3, 339 _Q4, Q4 = _Q4, 340 _Q5, Q5 = _Q5, 341 _Q6, Q6 = _Q6, 342 _Q7, Q7 = _Q7, 343 _Q8, Q8 = _Q8, 344 _Q9, Q9 = _Q9, 345 _Q10, Q10 = _Q10 346 }; 347 348 //! quadrature rules 349 enum QuadRule 350 { 351 _defaultRule = 0, defaultQuadrature = _defaultRule, 352 _GaussLegendreRule, Gauss_Legendre = _GaussLegendreRule, 353 _symmetricalGaussRule, symmetrical_Gauss = _symmetricalGaussRule, 354 _GaussLobattoRule, Gauss_Lobatto = _GaussLobattoRule, 355 _nodalRule, nodalQuadrature = _nodalRule, 356 _miscRule, miscQuadrature = _miscRule, 357 _GrundmannMollerRule, Grundmann_Moller = _GrundmannMollerRule, 358 _doubleQuadrature 359 }; 360 361 //! Sobolev space 362 enum SobolevType 363 { 364 _L2 = 0, L2 = _L2, 365 _H1, H1 = _H1, 366 _Hdiv, Hdiv = _Hdiv, 367 _Hcurl, Hcurl = _Hcurl, _Hrot = _Hcurl, Hrot = _Hrot, 368 _H2, H2 = _H2, 369 _Hinf, Hinf = _Hinf, Linf=_Hinf 370 }; 371 372 // ------------- form -------------- 373 374 //! type of linear form 375 enum LinearFormType 376 { 377 _undefLf = 0, 378 _intg, 379 _doubleIntg, 380 _bilinearAsLinear, 381 _linearCombination, 382 _composedLf, 383 _explicitLf 384 }; 385 386 //! type of computation 387 enum ComputationType 388 { 389 _undefComputation=0, 390 _FEComputation, 391 _IEComputation, 392 _SPComputation, 393 _FESPComputation, 394 _IESPComputation, 395 _FEextComputation, 396 _IEextComputation, 397 _IEHmatrixComputation 398 }; 399 400 // ----------- geometry ------------ 401 402 //! geometrical transformations 403 enum TransformType 404 { _noTransform, _translation, _rotation2d, _rotation3d, _homothety, _ptReflection, _reflection2d, _reflection3d, _composition }; 405 406 //! type of crack 407 enum CrackType 408 { 409 _noCrack, 410 _openCrack, 411 _closedCrack 412 }; 413 414 //! used for RevTrunk class in lib geometry 415 enum GeometricEndShape 416 { 417 _gesNone, gesNone=_gesNone, 418 _gesFlat, gesFlat=_gesFlat, 419 _gesCone, gesCone=_gesCone, 420 _gesEllipsoid, gesEllipsoid=_gesEllipsoid, 421 _gesSphere, gesSphere=_gesSphere 422 }; 423 424 //! enum to describe the relative position of 2 geometries 425 enum GeometryRelationType 426 { 427 _inside=0, 428 _contains, 429 _intersects, 430 _outside 431 }; 432 433 //! I/O mesh format 434 enum IOFormat 435 { 436 _undefFormat=0, 437 _vtk, vtk=_vtk, 438 _vtu, vtu=_vtu, 439 _msh, msh=_msh, 440 _geo, geo=_geo, 441 _mel, mel=_mel, 442 _ply, ply=_ply, 443 _medit, medit=_medit, 444 _matlab, matlab=_matlab, 445 _raw, raw=_raw, 446 _xyzv, xyzv=_xyzv 447 }; 448 449 //! enum to select the mesh generator/algorithm 450 enum MeshGenerator 451 { 452 _defaultGenerator=0, 453 _structured, structured=_structured, 454 _subdiv, subdiv=_subdiv, 455 _gmsh, gmsh=_gmsh 456 }; 457 458 //! enum to select the mesh generator/algorithm 459 enum MeshOption 460 { 461 _defaultMeshOption=0, 462 _unstructuredMesh, unstructuredMesh=_unstructuredMesh, 463 _structuredMesh, structuredMesh=_structuredMesh 464 }; 465 466 //! orientation type for a spacedim-1 domain 467 enum OrientationType 468 { 469 _undefOrientationType, 470 _towardsInfinite,towardsInfinite=_towardsInfinite, 471 _outwardsInfinite, outwardsInfinite=_outwardsInfinite, 472 _towardsDomain, towardsDomain=_towardsDomain, 473 _outwardsDomain, outwardsDomain=_outwardsDomain 474 }; 475 476 //! geometrical shapes 477 enum ShapeType 478 { 479 _noShape=0, 480 _fromFile, 481 _point, 482 _segment, segment=_segment, 483 _triangle, triangle=_triangle, 484 _quadrangle, quadrangle=_quadrangle, 485 _tetrahedron, tetrahedron=_tetrahedron, 486 _hexahedron, hexahedron=_hexahedron, 487 _prism, prism=_prism, 488 _pyramid, pyramid=_pyramid, 489 _ellArc, _circArc, 490 _polygon, _parallelogram, _rectangle, _square, _ellipse, _disk, _ellipsoidPart, _spherePart, 491 _setofpoints, _setofelems, _trunkPart, _cylinderPart, _conePart, 492 _polyhedron, _parallelepiped, _cuboid, _cube, _ellipsoid, _ball, _trunk, 493 _revTrunk, _cylinder, _revCylinder, _cone, _revCone, 494 _composite, _loop, _extrusion 495 }; 496 497 //! geometrical shapes 498 enum ShapesType 499 { 500 _noShapes=0, 501 _fromFiles, 502 _points, 503 _segments, segments=_segments, 504 _triangles, triangles=_triangles, 505 _quadrangles, quadrangles=_quadrangles, 506 _tetrahedra, tetrahedra=_tetrahedra, 507 _hexahedra, hexahedra, 508 _prisms, prisms=_prisms, 509 _pyramids, pyramids=_pyramids, 510 _ellArcs, _circArcs, 511 _polygons, _parallelograms, _rectangles, _squares, _ellipses, _disks, _ellipsoidParts, _sphereParts, 512 _setsofpoints, _setsofelems, _trunkParts, _cylinderParts, _coneParts, 513 _polyhedra, _parallelepipeds, _cuboids, _cubes, _ellipsoids, _balls, _trunks, 514 _revTrunks, _cylinders, _revCylinders, _cones, _revCones, 515 _composites, _loops, _extrusions 516 }; 517 518 // ------------- init -------------- 519 520 enum DataAccess { _copy = 0 , _view }; 521 522 /*! 523 Enumerated list of matrix properties regarding invertibility 524 */ 525 enum MatrixConditioning 526 { 527 _well_conditioned_matrix =0, 528 _bad_conditioned_matrix , 529 _non_invertible_matrix 530 }; 531 532 // ---------- largeMatrix ---------- 533 534 //! access type of storage 535 enum AccessType 536 { 537 _noAccess = 0, 538 _sym, 539 _row, 540 _col, 541 _dual 542 }; 543 544 //! factorization of matrices 545 enum FactorizationType {_noFactorization, _lu, _ldlt, _ldlstar, _llt, _llstar, _qr, 546 _ilu, _ildlt, _illt, _ildlstar, _illstar, _umfpack}; 547 548 //! part of matrices 549 enum MatrixPart 550 { 551 _all = 0, 552 _lower, 553 _upper 554 }; 555 556 //! storage of matrices 557 enum StorageType 558 { 559 _noStorage = 0, 560 _dense, 561 _cs, 562 _skyline, 563 _coo, 564 _hmatrix 565 }; 566 567 //! structure of matrices and vectors 568 enum StrucType {_scalar, _vector, _matrix, _vectorofvector, _vectorofmatrix, _matrixofmatrix, _undefStrucType}; 569 570 //! symmetry of matrices 571 enum SymType {_noSymmetry = 0, _symmetric, _skewSymmetric, _selfAdjoint, _skewAdjoint, _diagonal, _undefSymmetry}; 572 573 // -------- mathsResources --------- 574 575 // ----------- operator ------------ 576 577 //! type fo differential operator 578 enum DiffOpType 579 { 580 _id, _d0, _dt = _d0, _d1, _dx = _d1, _d2, _dy = _d2, _d3, _dz = _d3, 581 _grad, _nabla = _grad, _div, _curl, _rot = _curl, 582 _gradS, _nablaS = _gradS, _divS, _curlS, _rotS = _curlS, 583 _ntimes, _timesn, _ndot, _ncross, _ncrossncross, _ndotgrad, _ndiv, 584 _ncrosscurl, _ncrossgrad, _ncrossntimes, _timesncrossn, _ntimesndot, 585 _divG, _gradG, _nablaG = _gradG, _curlG, _rotG = _curlG, _epsilon, _epsilonG, _epsilonR, _voigtToM, 586 _jump, _mean, 587 _grad_x, _nabla_x = _grad_x, 588 _grad_y, _nabla_y = _grad_y, 589 _grad_xy, _nabla_xy =_grad_xy, 590 _div_x, _div_y, _div_xy, 591 _curl_x, _rot_x = _curl_x, 592 _curl_y, _rot_y = _curl_y, 593 _curl_xy, _rot_xy = _curl_xy, 594 _ntimes_x, _timesn_x, _ndot_x, _ncross_x, _ncrossncross_x, _ncrossntimes_x, _timesncrossn_x, _ndotgrad_x, _ndiv_x, _ncrosscurl_x, 595 _ntimes_y, _timesn_y, _ndot_y, _ncross_y, _ncrossncross_y, _ncrossntimes_y, _timesncrossn_y, _ndotgrad_y, _ndiv_y, _ncrosscurl_y, 596 _ndotgrad_xy, 597 _nxdotny_times, _nxcrossny_dot, _nycrossnx_dot, _nxcrossny_cross, _nycrossnx_cross, _nxcrossny_times, _nycrossnx_times 598 }; 599 600 //! type of unitary vector 601 enum UnitaryVector { _n, _nx, _ny, _nxdotny, _nxcrossny, _nycrossnx, _ncrossn }; 602 603 //! variable symbolic name 604 enum VariableName {_varUndef=0,_x,_x1=_x,_y,_x2=_y, _z, _x3=_z, _t, _x4=_t,_xy, _yx, _xx, _yy}; 605 606 //! symbolic operations 607 enum SymbolicOperation {_idop=0, _plus, _minus, _multiply, _divide, _power, //binary op 608 _equal, _different, _less, _lessequal, _greater, _greaterequal, _and, _or, //binary op 609 _abs, _realPart, _imagPart, _sqrt, _squared, _sin, _cos, _tan, _asin, _acos, _atan, //unary op 610 _sinh, _cosh, _tanh, _asinh, _acosh, _atanh, _exp, _log, _log10, _pow, _not, 611 _conj, _adj, _tran, _inv}; 612 613 // ----------- solvers ------------- 614 615 //! preconditioner 616 enum PreconditionerType {_noPrec, _luPrec, _ldltPrec, _ldlstarPrec, _ssorPrec, _diagPrec, _productPrec, _iluPrec, _illtPrec, _ildltPrec, _ildlstarPrec, _userPrec}; 617 618 // ------------ space -------------- 619 620 //! DoF type 621 enum DofType {_feDof, _spDof, _otherDof}; 622 623 //! space type 624 enum SpaceType {_feSpace, _spSpace, _subSpace, _prodSpace}; 625 626 //! DoF support type 627 enum SupportType {_undefSupport = 0, _pointSupport, _faceSupport, _edgeSupport, _elementSupport}; 628 629 //! type of unknown 630 enum UnknownType {_feUnknown, _spUnknown, _mixedUnknown}; 631 632 // ------------ term --------------- 633 634 //! Enum for reporting the status of a computation 635 enum ComputationInfo 636 { 637 //! Computation was successful. 638 _success = 0, 639 //! The provided data did not satisfy the prerequisites. 640 _numericalIssue = 1, 641 //! Iterative procedure did not converge. 642 _noConvergence = 2, 643 /*! The inputs are invalid, or the algorithm has been improperly called. 644 * When assertions are enabled, such errors trigger an assert. */ 645 _invalidInput = 3 646 }; 647 648 //! computational mode for eigen solvers 649 enum EigenComputationalMode { _davidson, _krylovSchur, // for intern solver 650 _buckling, _cayley, _cshiftRe, _cshiftIm }; // for Arpack 651 652 //! Eigen solvers 653 enum EigenSolverType { _intern, _arpack}; 654 655 //! Possible choices to sort the eigenvalues 656 enum EigenSortKind { _decr_module, _decr_realpart, _decr_imagpart, _incr_module, _incr_realpart, _incr_imagpart}; 657 658 //! Iterative solvers 659 enum IterativeSolverType {_cg, _cgs, _qmr, _bicg, _bicgstab, _gmres, _sor, _ssor}; 660 661 //! SOR solver type 662 enum SorSolverType { _diagSorS, _upperSorS, _lowerSorS, _matrixVectorSorS }; 663 664 //! main options of Term construction (TermMatrix or TermVector) 665 enum TermOption 666 { 667 //general 668 _compute, //default 669 _notCompute, 670 _assembled, //default 671 _unassembled, //not yet available 672 //only for TermMatrix 673 _nonSymmetricMatrix, //to force symmetry property (not yet managed) 674 _symmetricMatrix, 675 _selfAdjointMatrix, 676 _skewSymmetricMatrix, 677 _skewAdjointMatrix, 678 _csRowStorage, //to force storage 679 _csColStorage, 680 _csDualStorage, 681 _csSymStorage, 682 _denseRowStorage, 683 _denseColStorage, 684 _denseDualStorage, 685 _skylineSymStorage, 686 _skylineDualStorage, 687 _pseudoReductionMethod, 688 _realReductionMethod, 689 _penalizationReductionMethod 690 }; 691 692 //! Enumerated list of available HMatrix approximation method 693 enum HMApproximationMethod {_noHMApproximation, _svdCompression, _rsvdCompression, _r3svdCompression, _acaFull, _acaPartial, _acaPlus}; 694 695 // -------- umfpackSupport --------- 696 697 // ------------ utils -------------- 698 699 //! space or mesh dimension 700 enum dimensionType {_undefDim=0, _1D, _2D, _3D, _nD}; 701 702 //! type of function (C++ function or TermVector) 703 enum FuncFormType {_analytical, _interpolated}; 704 705 //! type of functions (one Point variable, or two) 706 enum FunctType {_function, _kernel}; 707 708 //! multilingual messages 709 enum Language 710 { 711 _en, en = _en, english = _en, 712 _fr, fr = _fr, francais = _fr, 713 _de, de = _de, deutsch = _de, 714 _es, es = _es, espanol = _es 715 }; 716 717 //! used for GeomParameter class in lib geometry 718 enum ParameterKey 719 { 720 _pk_none, 721 _pk_lang, _pk_verbose, _pk_trackingMode, _pk_isLogged, 722 _pk_varnames, 723 _pk_vertices, _pk_faces, 724 _pk_center, _pk_center1, _pk_center2, _pk_apogee, _pk_origin, _pk_apex, 725 _pk_v1, _pk_v2, _pk_v3, _pk_v4, _pk_v5, _pk_v6, _pk_v7, _pk_v8, 726 _pk_xmin, _pk_xmax, _pk_ymin, _pk_ymax, _pk_zmin, _pk_zmax, 727 _pk_length, _pk_xlength, _pk_ylength, _pk_zlength, _pk_radius, _pk_radius1, _pk_radius2, 728 _pk_basis, _pk_scale, _pk_dir, 729 _pk_end_shape, _pk_end1_shape, _pk_end2_shape, _pk_end_distance, _pk_end1_distance, _pk_end2_distance, 730 _pk_nnodes, _pk_hsteps, 731 _pk_domain_name, _pk_side_names, _pk_nbsubdomains, 732 _pk_nboctants, _pk_angle1, _pk_angle2, _pk_type, 733 _pk_maxIt, _pk_krylovDim, _pk_solver, _pk_tolerance, 734 _pk_convToStd, _pk_forceNonSym, _pk_ncv, _pk_nev, _pk_mode, _pk_sigma, _pk_sort, _pk_which, 735 _pk_omega, _pk_name 736 }; 737 738 //! types of values of matrices and vectors 739 enum ValueType 740 { 741 _none, _integer, _bool, _real, _complex, _string, _pt, _pointer, 742 _integerVector, _realVector, _complexVector, _stringVector, _ptVector, 743 _integerMatrix, _realMatrix, _complexMatrix, _stringMatrix, _ptMatrix 744 }; 745 746 //------------------------------------------------------------------------------ 747 // macro definition for decorated Fortran routines name called in C/C++ 748 //------------------------------------------------------------------------------ 749 #ifdef NO_TRAILING_UNDERSCORE 750 // IBM xlf compiler version under AIX / Mac OS X(Darwin) 751 #define FTNAME(x) x 752 #else 753 // Almost all other compilers append an underscore to Fortran routine name 754 #define FTNAME(x) x ## _ 755 #endif /* NO_TRAILING_UNDERSCORE */ 756 757 } //end of namespace xlifepp 758 759 #endif /* CONFIG_HPP */ 760