1 /*! 2 * \file include/TFEL/System/ExternalFunctionsPrototypes.hxx 3 * \brief 4 * \author Thomas Helfer 5 * \brief 26 jan 2010 6 * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights 7 * reserved. 8 * This project is publicly released under either the GNU GPL Licence 9 * or the CECILL-A licence. A copy of thoses licences are delivered 10 * with the sources of TFEL. CEA or EDF may also distribute this 11 * project under specific licensing conditions. 12 */ 13 14 #ifndef LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX 15 #define LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX 16 17 #ifdef __cplusplus 18 #include <cstdint> 19 #include <cstddef> 20 #else 21 #include <stdint.h> 22 #include <stddef.h> 23 #endif /* __cplusplus */ 24 25 #if defined _WIN32 || defined _WIN64 || defined __CYGWIN__ 26 #define TFEL_ADDCALL_PTR __cdecl * 27 #else 28 #define TFEL_ADDCALL_PTR * 29 #endif /* LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX */ 30 31 #include "Cyrano/MaterialProperty.hxx" 32 #include "Cyrano/Behaviour.hxx" 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif /* LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX */ 37 38 #ifdef TFEL_ARCH32 39 typedef int CastemIntegerType; 40 typedef int AsterIntegerType; 41 #endif /* LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX */ 42 #ifdef TFEL_ARCH64 43 #ifdef _WIN64 44 typedef long long CastemIntegerType; 45 typedef long long AsterIntegerType; 46 #else 47 typedef long CastemIntegerType; 48 typedef long AsterIntegerType; 49 #endif /* LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX */ 50 #endif /* LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX */ 51 52 typedef int AbaqusIntegerType; 53 typedef int AnsysIntegerType; 54 typedef int EuroplexusIntegerType; 55 typedef int CalculiXIntegerType; 56 typedef int DianaFEAIntegerType; 57 58 typedef double AbaqusRealType; 59 typedef double AnsysRealType; 60 typedef double CastemRealType; 61 typedef double AsterRealType; 62 typedef double EuroplexusRealType; 63 typedef double CalculiXRealType; 64 typedef double DianaFEARealType; 65 66 #ifndef LIB_MFRONT_GENERICBEHAVIOUR_BEHAVIOURDATA_H 67 #define MFRONT_GB_BEHAVIOURDATA_FORWARD_DECLARATION 68 // forward declaration 69 typedef struct mfront_gb_BehaviourData mfront_gb_BehaviourData; 70 typedef double mfront_gb_real; 71 typedef size_t mfront_gb_size_type; 72 #endif /* LIB_MFRONT_GENERICBEHAVIOUR_BEHAVIOURDATA_H */ 73 74 #ifdef __cplusplus 75 } 76 #endif /* LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX */ 77 78 #ifdef __cplusplus 79 80 namespace tfel { 81 82 namespace system { 83 84 extern "C" { 85 86 //! a simple alias 87 typedef double(TFEL_ADDCALL_PTR CastemFunctionPtr)(const double *); 88 89 //! a simple alias 90 typedef double(TFEL_ADDCALL_PTR CFunction0Ptr)(); 91 92 //! a simple alias 93 typedef double(TFEL_ADDCALL_PTR CFunction1Ptr)(double); 94 95 //! a simple alias 96 typedef double(TFEL_ADDCALL_PTR CFunction2Ptr)(double, double); 97 98 //! a simple alias 99 typedef double(TFEL_ADDCALL_PTR CFunction3Ptr)(double, double, double); 100 101 //! a simple alias 102 typedef double(TFEL_ADDCALL_PTR CFunction4Ptr)(double, 103 double, 104 double, 105 double); 106 107 //! a simple alias 108 typedef double(TFEL_ADDCALL_PTR CFunction5Ptr)( 109 double, double, double, double, double); 110 111 //! a simple alias 112 typedef double(TFEL_ADDCALL_PTR CFunction6Ptr)( 113 double, double, double, double, double, double); 114 115 //! a simple alias 116 typedef double(TFEL_ADDCALL_PTR CFunction7Ptr)( 117 double, double, double, double, double, double, double); 118 119 //! a simple alias 120 typedef double(TFEL_ADDCALL_PTR CFunction8Ptr)( 121 double, double, double, double, double, double, double, double); 122 123 //! a simple alias 124 typedef double(TFEL_ADDCALL_PTR CFunction9Ptr)( 125 double, double, double, double, double, double, double, double, double); 126 127 //! a simple alias 128 typedef double(TFEL_ADDCALL_PTR CFunction10Ptr)(double, 129 double, 130 double, 131 double, 132 double, 133 double, 134 double, 135 double, 136 double, 137 double); 138 139 //! a simple alias 140 typedef double(TFEL_ADDCALL_PTR CFunction11Ptr)(double, 141 double, 142 double, 143 double, 144 double, 145 double, 146 double, 147 double, 148 double, 149 double, 150 double); 151 152 //! a simple alias 153 typedef double(TFEL_ADDCALL_PTR CFunction12Ptr)(double, 154 double, 155 double, 156 double, 157 double, 158 double, 159 double, 160 double, 161 double, 162 double, 163 double, 164 double); 165 166 //! a simple alias 167 typedef double(TFEL_ADDCALL_PTR CFunction13Ptr)(double, 168 double, 169 double, 170 double, 171 double, 172 double, 173 double, 174 double, 175 double, 176 double, 177 double, 178 double, 179 double); 180 181 //! a simple alias 182 typedef double(TFEL_ADDCALL_PTR CFunction14Ptr)(double, 183 double, 184 double, 185 double, 186 double, 187 double, 188 double, 189 double, 190 double, 191 double, 192 double, 193 double, 194 double, 195 double); 196 197 //! a simple alias 198 typedef double(TFEL_ADDCALL_PTR CFunction15Ptr)(double, 199 double, 200 double, 201 double, 202 double, 203 double, 204 double, 205 double, 206 double, 207 double, 208 double, 209 double, 210 double, 211 double, 212 double); 213 214 //! a simple alias 215 typedef double(TFEL_ADDCALL_PTR FortranFunction0Ptr)(); 216 217 //! a simple alias 218 typedef double(TFEL_ADDCALL_PTR FortranFunction1Ptr)(const double *); 219 220 //! a simple alias 221 typedef double(TFEL_ADDCALL_PTR FortranFunction2Ptr)(const double *, 222 const double *); 223 224 //! a simple alias 225 typedef double(TFEL_ADDCALL_PTR FortranFunction3Ptr)(const double *, 226 const double *, 227 const double *); 228 229 //! a simple alias 230 typedef double(TFEL_ADDCALL_PTR FortranFunction4Ptr)(const double *, 231 const double *, 232 const double *, 233 const double *); 234 235 //! a simple alias 236 typedef double(TFEL_ADDCALL_PTR FortranFunction5Ptr)(const double *, 237 const double *, 238 const double *, 239 const double *, 240 const double *); 241 242 //! a simple alias 243 typedef double(TFEL_ADDCALL_PTR FortranFunction6Ptr)(const double *, 244 const double *, 245 const double *, 246 const double *, 247 const double *, 248 const double *); 249 250 //! a simple alias 251 typedef double(TFEL_ADDCALL_PTR FortranFunction7Ptr)(const double *, 252 const double *, 253 const double *, 254 const double *, 255 const double *, 256 const double *, 257 const double *); 258 259 //! a simple alias 260 typedef double(TFEL_ADDCALL_PTR FortranFunction8Ptr)(const double *, 261 const double *, 262 const double *, 263 const double *, 264 const double *, 265 const double *, 266 const double *, 267 const double *); 268 269 //! a simple alias 270 typedef double(TFEL_ADDCALL_PTR FortranFunction9Ptr)(const double *, 271 const double *, 272 const double *, 273 const double *, 274 const double *, 275 const double *, 276 const double *, 277 const double *, 278 const double *); 279 280 //! a simple alias 281 typedef double(TFEL_ADDCALL_PTR FortranFunction10Ptr)(const double *, 282 const double *, 283 const double *, 284 const double *, 285 const double *, 286 const double *, 287 const double *, 288 const double *, 289 const double *, 290 const double *); 291 292 //! a simple alias 293 typedef double(TFEL_ADDCALL_PTR FortranFunction11Ptr)(const double *, 294 const double *, 295 const double *, 296 const double *, 297 const double *, 298 const double *, 299 const double *, 300 const double *, 301 const double *, 302 const double *, 303 const double *); 304 305 //! a simple alias 306 typedef double(TFEL_ADDCALL_PTR FortranFunction12Ptr)(const double *, 307 const double *, 308 const double *, 309 const double *, 310 const double *, 311 const double *, 312 const double *, 313 const double *, 314 const double *, 315 const double *, 316 const double *, 317 const double *); 318 319 //! a simple alias 320 typedef double(TFEL_ADDCALL_PTR FortranFunction13Ptr)(const double *, 321 const double *, 322 const double *, 323 const double *, 324 const double *, 325 const double *, 326 const double *, 327 const double *, 328 const double *, 329 const double *, 330 const double *, 331 const double *, 332 const double *); 333 334 //! a simple alias 335 typedef double(TFEL_ADDCALL_PTR FortranFunction14Ptr)(const double *, 336 const double *, 337 const double *, 338 const double *, 339 const double *, 340 const double *, 341 const double *, 342 const double *, 343 const double *, 344 const double *, 345 const double *, 346 const double *, 347 const double *, 348 const double *); 349 350 //! a simple alias 351 typedef double(TFEL_ADDCALL_PTR FortranFunction15Ptr)(const double *, 352 const double *, 353 const double *, 354 const double *, 355 const double *, 356 const double *, 357 const double *, 358 const double *, 359 const double *, 360 const double *, 361 const double *, 362 const double *, 363 const double *, 364 const double *, 365 const double *); 366 //! \brief a simple alias. 367 typedef int(TFEL_ADDCALL_PTR GenericBehaviourFctPtr)( 368 ::mfront_gb_BehaviourData *const); 369 //! \brief a simple alias. 370 typedef void(TFEL_ADDCALL_PTR GenericBehaviourRotateGradientsFctPtr)( 371 ::mfront_gb_real *const, 372 const ::mfront_gb_real *const, 373 const ::mfront_gb_real *const); 374 //! \brief a simple alias. 375 typedef void(TFEL_ADDCALL_PTR GenericBehaviourRotateArrayOfGradientsFctPtr)( 376 ::mfront_gb_real *const, 377 const ::mfront_gb_real *const, 378 const ::mfront_gb_real *const, 379 const mfront_gb_size_type); 380 //! \brief a simple alias. 381 typedef void( 382 TFEL_ADDCALL_PTR GenericBehaviourRotateThermodynamicForcesFctPtr)( 383 ::mfront_gb_real *const, 384 const ::mfront_gb_real *const, 385 const ::mfront_gb_real *const); 386 //! \brief a simple alias. 387 typedef void(TFEL_ADDCALL_PTR 388 GenericBehaviourRotateArrayOfThermodynamicForcesFctPtr)( 389 ::mfront_gb_real *const, 390 const ::mfront_gb_real *const, 391 const ::mfront_gb_real *const, 392 const mfront_gb_size_type); 393 //! \brief a simple alias. 394 typedef void( 395 TFEL_ADDCALL_PTR GenericBehaviourRotateTangentOperatorBlocksFctPtr)( 396 ::mfront_gb_real *const, 397 const ::mfront_gb_real *const, 398 const ::mfront_gb_real *const); 399 //! \brief a simple alias. 400 typedef void(TFEL_ADDCALL_PTR 401 GenericBehaviourRotateArrayOfTangentOperatorBlocksFctPtr)( 402 ::mfront_gb_real *const, 403 const ::mfront_gb_real *const, 404 const ::mfront_gb_real *const, 405 const mfront_gb_size_type); 406 /*! 407 * a simple alias. 408 * This is the prototype of the external functions used by the 409 * pleiades version of the castem finite element solver 410 */ 411 typedef void(TFEL_ADDCALL_PTR CastemFctPtr)( 412 CastemRealType *const, /* stress */ 413 CastemRealType *const, /* internal state variables */ 414 CastemRealType *const, /* tangent operator */ 415 CastemRealType *const, 416 CastemRealType *const, 417 CastemRealType *const, 418 CastemRealType *const, 419 CastemRealType *const, 420 CastemRealType *const, 421 CastemRealType *const, 422 const CastemRealType *const, /* strain tensor */ 423 const CastemRealType *const, /* strain increment */ 424 const CastemRealType *const, 425 const CastemRealType *const, /* time increment */ 426 const CastemRealType *const, /* temperature */ 427 const CastemRealType *const, /* temperature increment */ 428 const CastemRealType *const, /* external state variables */ 429 const CastemRealType *const, /* external state variables increments */ 430 const char *const, 431 const CastemIntegerType *const, 432 const CastemIntegerType *const, 433 const CastemIntegerType *const, /* number of components of tensors */ 434 const CastemIntegerType *const, /* number of internal state variables */ 435 const CastemRealType *const, /* material properties */ 436 const CastemIntegerType *const, /* number of material properties */ 437 const CastemRealType *const, 438 const CastemRealType *const, /* rotation matrix */ 439 CastemRealType *const, /* estimation of the next time increment */ 440 const CastemRealType *const, 441 const CastemRealType *const, 442 const CastemRealType *const, 443 const CastemIntegerType *const, 444 const CastemIntegerType *const, 445 const CastemIntegerType *const, 446 const CastemIntegerType *const, 447 const CastemIntegerType *const, 448 CastemIntegerType *const, 449 const int /* hidden fortran parameter */); 450 /*! 451 * a simple alias. 452 * This is the prototype of the external functions used by the 453 * pleiades version of the castem finite element solver 454 */ 455 typedef void(TFEL_ADDCALL_PTR AbaqusFctPtr)( 456 AbaqusRealType *const, /* stress */ 457 AbaqusRealType *const, /* internal state variables */ 458 AbaqusRealType *const, /* tangent operator */ 459 AbaqusRealType *const, 460 AbaqusRealType *const, 461 AbaqusRealType *const, 462 AbaqusRealType *const, 463 AbaqusRealType *const, 464 AbaqusRealType *const, 465 AbaqusRealType *const, 466 const AbaqusRealType *const, /* strain tensor */ 467 const AbaqusRealType *const, /* strain increment */ 468 const AbaqusRealType *const, 469 const AbaqusRealType *const, /* time increment */ 470 const AbaqusRealType *const, /* temperature */ 471 const AbaqusRealType *const, /* temperature increment */ 472 const AbaqusRealType *const, /* external state variables */ 473 const AbaqusRealType *const, /* external state variables increments */ 474 const char *const, 475 const AbaqusIntegerType *const, 476 const AbaqusIntegerType *const, 477 const AbaqusIntegerType *const, /* number of components of tensors */ 478 const AbaqusIntegerType *const, /* number of internal state variables */ 479 const AbaqusRealType *const, /* material properties */ 480 const AbaqusIntegerType *const, /* number of material properties */ 481 const AbaqusRealType *const, 482 const AbaqusRealType *const, /* rotation matrix */ 483 AbaqusRealType *const, /* estimation of the next time increment */ 484 const AbaqusRealType *const, 485 const AbaqusRealType *const, 486 const AbaqusRealType *const, 487 const AbaqusIntegerType *const, 488 const AbaqusIntegerType *const, 489 const AbaqusIntegerType *const, 490 const AbaqusIntegerType *const, 491 const AbaqusIntegerType *const, 492 AbaqusIntegerType *const, 493 const int /* hidden fortran parameter */); 494 /*! 495 * a simple alias. 496 * This is the prototype of the external functions used by the 497 * pleiades version of the castem finite element solver 498 */ 499 typedef void(TFEL_ADDCALL_PTR AnsysFctPtr)(const AnsysIntegerType *const, 500 const AnsysIntegerType *const, 501 const AnsysIntegerType *const, 502 const AnsysIntegerType *const, 503 const AnsysIntegerType *const, 504 const AnsysIntegerType *const, 505 const AnsysIntegerType *const, 506 AnsysIntegerType *const, 507 const AnsysIntegerType *const, 508 const AnsysIntegerType *const, 509 const AnsysIntegerType *const, 510 const AnsysIntegerType *const, 511 const AnsysIntegerType *const, 512 const AnsysRealType *const, 513 const AnsysRealType *const, 514 const AnsysRealType *const, 515 const AnsysRealType *const, 516 AnsysRealType *const, 517 AnsysRealType *const, 518 AnsysRealType *const, 519 AnsysRealType *const, 520 AnsysRealType *const, 521 AnsysRealType *const, 522 const AnsysRealType *const, 523 const AnsysRealType *const, 524 AnsysRealType *const, 525 const AnsysRealType *const, 526 const AnsysRealType *const, 527 const AnsysRealType *const, 528 const AnsysRealType *const, 529 const AnsysRealType *const, 530 const AnsysRealType *const, 531 AnsysRealType *const, 532 const AnsysRealType *const, 533 const AnsysRealType *const, 534 const AnsysRealType *const, 535 const AnsysRealType *const, 536 const AnsysRealType *const, 537 const AnsysRealType *const, 538 const AnsysRealType *const, 539 const AnsysRealType *const); 540 /*! 541 * a simple alias. 542 * This is the prototype of the external functions used by the 543 * abaqus explicit solver 544 */ 545 typedef void(TFEL_ADDCALL_PTR AbaqusExplicitFctPtr)( 546 const AbaqusIntegerType *const, 547 const AbaqusIntegerType *const, 548 const AbaqusIntegerType *const, 549 const AbaqusIntegerType *const, 550 const AbaqusIntegerType *const, 551 const AbaqusIntegerType *const, 552 const AbaqusIntegerType *const, 553 const AbaqusRealType *const, 554 const AbaqusRealType *const, 555 const AbaqusRealType *const, 556 const char *const, 557 const AbaqusRealType *const, 558 const AbaqusRealType *const, 559 const AbaqusRealType *const, 560 const AbaqusRealType *const, 561 const AbaqusRealType *const, 562 const AbaqusRealType *const, 563 const AbaqusRealType *const, 564 const AbaqusRealType *const, 565 const AbaqusRealType *const, 566 const AbaqusRealType *const, 567 const AbaqusRealType *const, 568 const AbaqusRealType *const, 569 const AbaqusRealType *const, 570 const AbaqusRealType *const, 571 const AbaqusRealType *const, 572 const AbaqusRealType *const, 573 const AbaqusRealType *const, 574 const AbaqusRealType *const, 575 AbaqusRealType *const, 576 AbaqusRealType *const, 577 AbaqusRealType *const, 578 AbaqusRealType *const, 579 const int /* hidden fortran parameter */); 580 /*! 581 * a simple alias. 582 * This is the prototype of the external functions used by the 583 * Code_Aster finite element solver 584 */ 585 typedef void(TFEL_ADDCALL_PTR AsterFctPtr)( 586 AsterRealType *const, /* stress */ 587 AsterRealType *const, /* internal state variables */ 588 AsterRealType *const, /* tangent operator */ 589 const AsterRealType *const, /* strain tensor */ 590 const AsterRealType *const, /* strain increment */ 591 const AsterRealType *const, /* time increment */ 592 const AsterRealType *const, /* temperature */ 593 const AsterRealType *const, /* temperature increment */ 594 const AsterRealType *const, /* external state variables */ 595 const AsterRealType *const, /* external state variables increments */ 596 const AsterIntegerType *const, /* number of components of tensors */ 597 const AsterIntegerType *const, /* number of internal state variables */ 598 const AsterRealType *const, /* material properties */ 599 const AsterIntegerType *const, /* number of material properties */ 600 const AsterRealType *const, /* rotation matrix */ 601 AsterRealType *const, /* estimation of the next time increment */ 602 const AsterIntegerType *const); 603 //! a simple alias 604 using AsterIntegrationErrorMessageFctPtr = const char *(*)(); 605 /*! 606 * a simple alias. 607 * This is the prototype of the external functions used by the 608 * pleiades version of the castem finite element solver 609 */ 610 typedef void(TFEL_ADDCALL_PTR EuroplexusFctPtr)( 611 EuroplexusIntegerType 612 *const, // status of the integration, 0 on success 613 EuroplexusRealType *const, // Cauchy stress 614 EuroplexusRealType *const, // state variables 615 EuroplexusRealType *const, // stiffness tensor 616 EuroplexusRealType *const, // time step scaling factor 617 EuroplexusIntegerType *const, // broken indicator 618 char *const, // error message 619 const EuroplexusIntegerType *const, // number of state variables 620 const EuroplexusIntegerType *const, // modelling hypothesis 621 const EuroplexusRealType *const, // time increment 622 const EuroplexusRealType 623 *const, // deformation gradient at the beginning of the time step 624 const EuroplexusRealType 625 *const, // deformation gradient at the end of the time step 626 const EuroplexusRealType *const, // rotation matrix 627 const EuroplexusRealType *const, // material properties 628 const EuroplexusIntegerType *const, // number of material properties 629 const EuroplexusRealType *const, // temperature 630 const EuroplexusRealType *const, // increment of temperature 631 const EuroplexusRealType *const, // external state variables 632 const EuroplexusRealType *const, // external state variables increments 633 const EuroplexusIntegerType 634 *const); // number of external state variables 635 /*! 636 * a simple alias. 637 * This is the prototype of the external functions used by the 638 * pleiades version of the castem finite element solver 639 */ 640 typedef void(TFEL_ADDCALL_PTR CalculiXFctPtr)( 641 const char *const, 642 const CalculiXIntegerType *const, 643 const CalculiXIntegerType *const, 644 const CalculiXIntegerType *const, 645 const CalculiXRealType *const, 646 const CalculiXRealType *const, 647 const CalculiXRealType *const, 648 const CalculiXRealType *const, 649 const CalculiXRealType *const, 650 const CalculiXRealType *const, 651 const CalculiXRealType *const, 652 const CalculiXRealType *const, 653 const CalculiXIntegerType *const, 654 const CalculiXRealType *const, 655 const CalculiXRealType *const, 656 const CalculiXRealType *const, 657 const CalculiXRealType *const, 658 const CalculiXIntegerType *const, 659 const CalculiXIntegerType *const, 660 const CalculiXIntegerType *const, 661 const CalculiXIntegerType *const, 662 const CalculiXRealType *const, 663 CalculiXRealType *const, 664 CalculiXRealType *const, 665 CalculiXRealType *const, 666 const CalculiXIntegerType *const, 667 const CalculiXRealType *const, 668 const CalculiXRealType *const, 669 CalculiXRealType *const, 670 const CalculiXIntegerType *const, 671 const int /* hidden fortran parameter */); 672 673 /*! 674 * \brief a simple alias. 675 * This is the prototype of the external functions used by the 676 * Diana FEA finite element solver 677 */ 678 typedef void(TFEL_ADDCALL_PTR DianaFEAFctPtr)( 679 DianaFEARealType *const, 680 DianaFEARealType *const, 681 DianaFEARealType *const, 682 const DianaFEAIntegerType *const, 683 const DianaFEAIntegerType *const, 684 const DianaFEAIntegerType *const, 685 const DianaFEARealType *const, 686 const DianaFEARealType *const, 687 const DianaFEARealType *const, 688 const DianaFEARealType *const, 689 const DianaFEARealType *const, 690 const DianaFEARealType *const); 691 692 } // end of extern "C" 693 694 } // end of namespace system 695 696 } // end of namespace tfel 697 698 #endif /* LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX */ 699 700 #endif /* LIB_TFEL_SYSTEM_EXTERNALFUNCTIONSPROTOTYPES_HXX */ 701