ddfem 1.0.10__py3-none-any.whl → 1.0.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. ddfem/__init__.py +9 -5
  2. ddfem/__main__.py +12 -13
  3. ddfem/boundary.py +2 -2
  4. ddfem/data/2.11.dev20250709/extra.modules +14 -0
  5. ddfem/data/2.11.dev20250709/femscheme_0bb54cd4f1cd1df2477f5f59393c6a2e.cc +43 -0
  6. ddfem/data/2.11.dev20250709/femscheme_5c9e2700386c07226eb4db155fa5ef14.cc +43 -0
  7. ddfem/data/2.11.dev20250709/femscheme_765ef00d995a939c34bdc0d0cc4847ca.cc +43 -0
  8. ddfem/data/2.11.dev20250709/femspace_11b3436cb033df683615c50d5d4239bd_f14dd0b3b474c0cd816334330f55ad72.cc +45 -0
  9. ddfem/data/2.11.dev20250709/femspace_f4f043307753c8e74af23c94c28a3b0d_438586e783f51d84a82e82b0d8daceea.cc +45 -0
  10. ddfem/data/2.11.dev20250709/{integrands_3bde0abfafcf45a3cff4d1029568ab5cv1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_0003e4cbb961fd653fe295d2c4fa50a7v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +367 -14
  11. ddfem/data/2.11.dev20250709/{integrands_2e6d4e3b5cff269867d26022ac7cee09v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_0fa4a1c37449cf574971977e10cf682av1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
  12. ddfem/data/2.11.dev20250709/{integrands_96ea175da69be26acf1a8d94dc0b3c93v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_29b696aa653181a57d036f771efa8be9v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
  13. ddfem/data/2.11.dev20250709/integrands_536f9ba0ea4ecd1f7d4e2bc43ef29d08v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +453 -0
  14. ddfem/data/2.11.dev20250709/{integrands_008eefa148b772fa3192dd3c1728c140v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_5907ab5c70328c21dd308abf09e529aev1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
  15. ddfem/data/2.11.dev20250709/{integrands_59ef814e4fbd86ef9c0aeac61e84e9a7v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_68eba4e963a61031a52da3365f515585v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
  16. ddfem/data/2.11.dev20250709/integrands_83927be37e79b291517b827b9ddc1983v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +533 -0
  17. ddfem/data/2.11.dev20250709/integrands_8ed2f23c088e3a3d82a3259b663796c7v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +533 -0
  18. ddfem/data/2.11.dev20250709/integrands_af3bbe7d629df162ef8c570e1503bf62v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +762 -0
  19. ddfem/data/2.11.dev20250709/{integrands_00ee9b3b89e4e44212e5b7ad7948a24ev1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_d0634430f14d3432dae186e57ec5aecav1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
  20. ddfem/data/2.11.dev20250709/intro.modules +33 -102
  21. ddfem/data/2.11.dev20250709/localfunction_10f9d7a54f79c12d6ca923b9ee56b80d_a524c1196983e65de1c06d7d6afdeb44.cc +324 -0
  22. ddfem/data/2.11.dev20250709/localfunction_10f9d7a54f79c12d6ca923b9ee56b80d_af122c1df944c95cd395ec0f91d0f970.cc +322 -0
  23. ddfem/data/2.11.dev20250709/localfunction_1c20e613977d8cea4cf5227c12aa68a6_a524c1196983e65de1c06d7d6afdeb44.cc +164 -0
  24. ddfem/data/2.11.dev20250709/{localfunction_191355e6250b2d2e260d96f519ad9976_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_217e4bf8b368a7768c4897cf58f71d84_a524c1196983e65de1c06d7d6afdeb44.cc} +14 -14
  25. ddfem/data/2.11.dev20250709/localfunction_22e797a8f3e8c322f33c41e07bd15165_a524c1196983e65de1c06d7d6afdeb44.cc +1445 -0
  26. ddfem/data/2.11.dev20250709/localfunction_2e2afc8df6107683d574a8d96d5249f4_af122c1df944c95cd395ec0f91d0f970.cc +512 -0
  27. ddfem/data/2.11.dev20250709/localfunction_32613626342183eafa360dc1f0f18924_a524c1196983e65de1c06d7d6afdeb44.cc +1425 -0
  28. ddfem/data/2.11.dev20250709/localfunction_37174cfc9d6bf565336cac0d2ea785f5_a524c1196983e65de1c06d7d6afdeb44.cc +786 -0
  29. ddfem/data/2.11.dev20250709/{localfunction_d75993d7ae5919d23117b153e900840d_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_3d957c5b2628e5120636b8e3f461bc0d_a524c1196983e65de1c06d7d6afdeb44.cc} +64 -29
  30. ddfem/data/2.11.dev20250709/localfunction_3ecaa105be9e3abddf3a85d8adc5d36f_a524c1196983e65de1c06d7d6afdeb44.cc +697 -0
  31. ddfem/data/2.11.dev20250709/{localfunction_f626cd43dc8558135fe0b32cde016644_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_3ecaf7de7505b53bb0b5fb6d78549387_a524c1196983e65de1c06d7d6afdeb44.cc} +14 -14
  32. ddfem/data/2.11.dev20250709/{localfunction_1d27a90a52b9053192c9cc902283f79b_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_4192604521151252f1c8fa56a1f9f226_a524c1196983e65de1c06d7d6afdeb44.cc} +14 -14
  33. ddfem/data/2.11.dev20250709/localfunction_4976bbef3267846b59f3a26497ffe9db_a524c1196983e65de1c06d7d6afdeb44.cc +474 -0
  34. ddfem/data/2.11.dev20250709/{localfunction_a8c726f728cd35d137188b33301aeef1_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_4adfaf8a08fac23151af0b1e790db1f7_a524c1196983e65de1c06d7d6afdeb44.cc} +14 -14
  35. ddfem/data/2.11.dev20250709/{localfunction_00f2e5593eeb23f01906255d67244f6e_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_4f6a526abfe63959f81b09a5796c5eb1_a524c1196983e65de1c06d7d6afdeb44.cc} +44 -29
  36. ddfem/data/2.11.dev20250709/localfunction_5591a2c803b9658084d8f11d44bf3ae1_a524c1196983e65de1c06d7d6afdeb44.cc +485 -0
  37. ddfem/data/2.11.dev20250709/localfunction_6363af791dde11d699a9a3d876cc5d9a_a524c1196983e65de1c06d7d6afdeb44.cc +549 -0
  38. ddfem/data/2.11.dev20250709/localfunction_6363af791dde11d699a9a3d876cc5d9a_af122c1df944c95cd395ec0f91d0f970.cc +547 -0
  39. ddfem/data/2.11.dev20250709/localfunction_6eccfc8fd91ce34d81e7c3962ece5d94_a524c1196983e65de1c06d7d6afdeb44.cc +766 -0
  40. ddfem/data/2.11.dev20250709/localfunction_762aa49bc5a47ad3d8d8bbde36b42ee5_a524c1196983e65de1c06d7d6afdeb44.cc +723 -0
  41. ddfem/data/2.11.dev20250709/localfunction_76e8db0f046ac9e37a793e0bb13eea7b_a524c1196983e65de1c06d7d6afdeb44.cc +292 -0
  42. ddfem/data/2.11.dev20250709/localfunction_7792f4273b0fd848c5a0fc9d6f12683e_a524c1196983e65de1c06d7d6afdeb44.cc +280 -0
  43. ddfem/data/2.11.dev20250709/localfunction_7f7ef99c50708814ba5a82b0956b0aed_a524c1196983e65de1c06d7d6afdeb44.cc +461 -0
  44. ddfem/data/2.11.dev20250709/localfunction_898de4ae138e0ed305ef1399c66aa10a_a524c1196983e65de1c06d7d6afdeb44.cc +313 -0
  45. ddfem/data/2.11.dev20250709/{localfunction_1d13146d4bff10e178aba773fe2a9f1d_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_a99a0c7f35b06ac5a1fa7f081b5e64f9_a524c1196983e65de1c06d7d6afdeb44.cc} +14 -14
  46. ddfem/data/2.11.dev20250709/{localfunction_82d7cb9338bf118426fac2abf41a91a4_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_cda923259a47bb19861404a9fdb64303_a524c1196983e65de1c06d7d6afdeb44.cc} +14 -14
  47. ddfem/data/2.11.dev20250709/localfunction_d3d9b8a21e3075c9ff40117c5244f28e_a524c1196983e65de1c06d7d6afdeb44.cc +381 -0
  48. ddfem/data/2.11.dev20250709/localfunction_d4b9ca85d48735ee01f395a42eaa0cee_af122c1df944c95cd395ec0f91d0f970.cc +774 -0
  49. ddfem/data/2.11.dev20250709/localfunction_dd1fb4bd60f2d8b3a062dbbdaedb9fee_a524c1196983e65de1c06d7d6afdeb44.cc +869 -0
  50. ddfem/data/2.11.dev20250709/localfunction_dd5ab085a9d94f578c1f3d337ea360a3_a524c1196983e65de1c06d7d6afdeb44.cc +161 -0
  51. ddfem/data/2.11.dev20250709/{localfunction_aeb3d963412cdc65630e0a4c3c0dde0f_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_e2b19c5987f9b6fb0cd5453bfa7f4f9f_a524c1196983e65de1c06d7d6afdeb44.cc} +14 -30
  52. ddfem/examples/beam.py +43 -50
  53. ddfem/examples/chemical_reaction.py +1 -1
  54. ddfem/examples/five_circle_flat.py +42 -28
  55. ddfem/examples/linear_elasticity.py +5 -1
  56. ddfem/examples/triple_circle.py +86 -83
  57. ddfem/examples/triple_circle_beam.py +71 -61
  58. ddfem-1.0.12.dist-info/METADATA +78 -0
  59. ddfem-1.0.12.dist-info/RECORD +123 -0
  60. ddfem/data/2.11.dev20250709/boundary.modules +0 -9
  61. ddfem/data/2.11.dev20250709/femspace_90f0a9524a8cb701e8ee5027b7658a0e_0faf32f13b591f4f60f83c591507b9be.cc +0 -40
  62. ddfem/data/2.11.dev20250709/geometry.modules +0 -84
  63. ddfem/data/2.11.dev20250709/hierarchicalgrid_472c2c2d007bf5604887ab2f16b7eb13.cc +0 -30
  64. ddfem/data/2.11.dev20250709/hierarchicalgrid_966e2a5c8356c5b278ccd3acad180f0a.cc +0 -30
  65. ddfem/data/2.11.dev20250709/localfunction_10ad0a2d88c74db5f4bf5f81e138974f_a524c1196983e65de1c06d7d6afdeb44.cc +0 -135
  66. ddfem/data/2.11.dev20250709/localfunction_1460b632dc5919e94a2147108f4f34f4_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -468
  67. ddfem/data/2.11.dev20250709/localfunction_161bbe6dde741c6e3f90c2919b8d17a4_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -171
  68. ddfem/data/2.11.dev20250709/localfunction_268716e3e3ec528038367ee04d335ea1_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -289
  69. ddfem/data/2.11.dev20250709/localfunction_29566243d89228735978e58471af60be_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -246
  70. ddfem/data/2.11.dev20250709/localfunction_2a890b2a64788a92607670296c0d37ac_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -311
  71. ddfem/data/2.11.dev20250709/localfunction_2bbefabe87db948827d02bdb8d69a7d1_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -240
  72. ddfem/data/2.11.dev20250709/localfunction_34a46b87fa5c0a5a4f0bc44949f2eda9_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -239
  73. ddfem/data/2.11.dev20250709/localfunction_3c10414582133a0fa8e341c4544a97c7_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -220
  74. ddfem/data/2.11.dev20250709/localfunction_3dfb73430ddb90a26b6f50f85e52e2a4_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -216
  75. ddfem/data/2.11.dev20250709/localfunction_3e323e81c52891c0ecb656eac273e52f_a524c1196983e65de1c06d7d6afdeb44.cc +0 -135
  76. ddfem/data/2.11.dev20250709/localfunction_465e17370f4344b8997151adacf7aec6_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -403
  77. ddfem/data/2.11.dev20250709/localfunction_57e9651c5364ef528f41cf138e126115_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -272
  78. ddfem/data/2.11.dev20250709/localfunction_5c2a00bf7ec417475a0a378ed462beeb_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -350
  79. ddfem/data/2.11.dev20250709/localfunction_5d71e054c405bc6584738437908af804_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -364
  80. ddfem/data/2.11.dev20250709/localfunction_6343878b30d190cc70b631d882009dec_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -342
  81. ddfem/data/2.11.dev20250709/localfunction_639a3f3873411f43337e687cb070368f_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -230
  82. ddfem/data/2.11.dev20250709/localfunction_6661b21a0e1340a9a9f7b32da595f130_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -468
  83. ddfem/data/2.11.dev20250709/localfunction_75e876499fa3b7abc096aa08f88a1c2d_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -213
  84. ddfem/data/2.11.dev20250709/localfunction_8647b4efdf8a37595f73652bc1905df2_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -335
  85. ddfem/data/2.11.dev20250709/localfunction_86a0670f34bf2ac8155423a1c1bc2e75_a524c1196983e65de1c06d7d6afdeb44.cc +0 -135
  86. ddfem/data/2.11.dev20250709/localfunction_98b32c4b5bc0d8083f3d2c394aa33429_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -340
  87. ddfem/data/2.11.dev20250709/localfunction_9b741917efb5aa6a09e375272e4ae3aa_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -317
  88. ddfem/data/2.11.dev20250709/localfunction_a369aff055312b472a92ee7e257534ff_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -392
  89. ddfem/data/2.11.dev20250709/localfunction_a6cc88a79948487ce95a6c3f22487b36_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -395
  90. ddfem/data/2.11.dev20250709/localfunction_aa506761997f291dfd2e62b678f010b2_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -280
  91. ddfem/data/2.11.dev20250709/localfunction_b5edf0c36f0fc96cc6f5f3677c6557a1_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -214
  92. ddfem/data/2.11.dev20250709/localfunction_bdfb7ddf42a423f7d0791458634d4b8f_a524c1196983e65de1c06d7d6afdeb44.cc +0 -135
  93. ddfem/data/2.11.dev20250709/localfunction_c3d0902cf8bb4b86b62a2293de2b74e9_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -1131
  94. ddfem/data/2.11.dev20250709/localfunction_cf4a29dc25e72137baf2f8fb8b8d3c50_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -267
  95. ddfem/data/2.11.dev20250709/localfunction_d40efa41ac661ff77278d2ae4812b06d_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -377
  96. ddfem/data/2.11.dev20250709/localfunction_e69118a51208cfab8a028711e966e76c_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -236
  97. ddfem/data/2.11.dev20250709/localfunction_e9c8d4f4cedd30cab76a588b95bbccab_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -325
  98. ddfem/data/2.11.dev20250709/localfunction_f0d3fe89de368f7ea295a1982a807bd8_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -281
  99. ddfem/data/2.11.dev20250709/localfunction_f4b1d42cbb447375f39ed834570cd3f0_a524c1196983e65de1c06d7d6afdeb44.cc +0 -135
  100. ddfem/data/2.11.dev20250709/localfunction_fb15e1ad2c62e6660c67949fcf166d81_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -339
  101. ddfem/data/2.11.dev20250709/localfunction_fb17410b0b5d479dce9ffc6f9d61ab37_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -317
  102. ddfem/data/2.11.dev20250709/localfunction_fc22d5adaf3b9563160dc2aec55e8ba1_19659fe2f2f74bcfb5d532f1a0d38be9.cc +0 -113
  103. ddfem/data/2.11.dev20250709/referenceelements_fe266b8abf61f4601198949ea6b0dfd3.cc +0 -24
  104. ddfem/data/2.11.dev20250709/transformers.modules +0 -13
  105. ddfem/data/2.11.dev20250709/yaspcoordinates_dim2_ctdouble.cc +0 -55
  106. ddfem/data/2.11.dev20250709/yaspcoordinates_dim3_ctdouble.cc +0 -55
  107. ddfem-1.0.10.dist-info/METADATA +0 -101
  108. ddfem-1.0.10.dist-info/RECORD +0 -138
  109. {ddfem-1.0.10.dist-info → ddfem-1.0.12.dist-info}/WHEEL +0 -0
  110. {ddfem-1.0.10.dist-info → ddfem-1.0.12.dist-info}/licenses/LICENSE +0 -0
  111. {ddfem-1.0.10.dist-info → ddfem-1.0.12.dist-info}/top_level.txt +0 -0
@@ -1,239 +0,0 @@
1
- #ifndef GUARD_34a46b87fa5c0a5a4f0bc44949f2eda9
2
- #define GUARD_34a46b87fa5c0a5a4f0bc44949f2eda9
3
-
4
- #define USING_DUNE_PYTHON 1
5
- #include <config.h>
6
- #include <dune/grid/io/file/dgfparser/dgfyasp.hh>
7
- #include <dune/grid/yaspgrid.hh>
8
- #include <dune/python/grid/hierarchical.hh>
9
- #include <dune/fem/function/localfunction/bindable.hh>
10
- #include <dune/fem/common/intersectionside.hh>
11
- #include <dune/python/pybind11/pybind11.h>
12
- #include <dune/python/pybind11/extensions.h>
13
- #include <dune/fempy/py/grid/gridpart.hh>
14
- #include <dune/common/exceptions.hh>
15
- #include <dune/fempy/py/ufllocalfunction.hh>
16
-
17
- namespace UFLLocalFunctions_34a46b87fa5c0a5a4f0bc44949f2eda9
18
- {
19
-
20
- // UFLLocalFunction
21
- // ----------------
22
-
23
- template< class GridPart >
24
- struct UFLLocalFunction
25
- : public Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>>
26
- {
27
- typedef GridPart GridPartType;
28
- typedef typename GridPartType::GridViewType GridView;
29
- typedef typename GridView::ctype ctype;
30
- typedef Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>> BaseType;
31
- typedef Dune::Fem::GridFunctionSpace<GridPartType,Dune::Dim<1>> FunctionSpaceType;
32
- typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
33
- typedef typename GridPartType::IntersectionType IntersectionType;
34
- typedef typename EntityType::Geometry Geometry;
35
- typedef typename Geometry::GlobalCoordinate GlobalCoordinateType;
36
- typedef Dune::Fem::IntersectionSide Side;
37
- typedef std::tuple<> ConstantTupleType;
38
- typedef std::tuple<> CoefficientTupleType;
39
- static constexpr bool gridPartValid = true;
40
- template< std::size_t i >
41
- using CoefficientType = std::tuple_element_t< i, CoefficientTupleType >;
42
- template< std::size_t i >
43
- using ConstantType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
44
- using BaseType::entity;
45
- using BaseType::geometry;
46
-
47
- UFLLocalFunction ( const GridPartType &gridPart, const std::string &name, int order, const Dune::Fem::ParameterReader &parameter = Dune::Fem::Parameter::container() )
48
- : BaseType(gridPart,name,order)
49
- {}
50
-
51
- void bind ( const IntersectionType &intersection, Side side )
52
- {
53
- BaseType::bind(intersection, side);
54
- }
55
-
56
- void bind ( const EntityType &entity )
57
- {
58
- BaseType::bind(entity);
59
- }
60
-
61
- void unbind ()
62
- {
63
- BaseType::unbind();
64
- }
65
-
66
- template< class Point >
67
- void evaluate ( const Point &x, typename FunctionSpaceType::RangeType &result ) const
68
- {
69
- using std::abs;
70
- using std::sqrt;
71
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
72
- const auto tmp1 = std::abs( tmp0[ 0 ] );
73
- const auto tmp2 = 0.2 + tmp1;
74
- const auto tmp3 = tmp2 * tmp2;
75
- const auto tmp4 = tmp0[ 1 ] * tmp0[ 1 ];
76
- const auto tmp5 = tmp4 + tmp3;
77
- const auto tmp6 = 1e-10 + tmp5;
78
- const auto tmp7 = std::sqrt( tmp6 );
79
- const auto tmp8 = -0.5 + tmp7;
80
- const auto tmp9 = 0.1 + tmp8;
81
- const auto tmp10 = tmp1 * tmp1;
82
- const auto tmp11 = std::abs( tmp0[ 1 ] );
83
- const auto tmp12 = -0.3464101615137755 + tmp11;
84
- const auto tmp13 = tmp12 * tmp12;
85
- const auto tmp14 = tmp13 + tmp10;
86
- const auto tmp15 = 1e-10 + tmp14;
87
- const auto tmp16 = std::sqrt( tmp15 );
88
- const auto tmp17 = 0.3464101615137755 * tmp1;
89
- const auto tmp18 = 0.2 * tmp12;
90
- const auto tmp19 = -0.1 + (tmp18 > tmp17 ? tmp16 : tmp9);
91
- result[ 0 ] = tmp19;
92
- }
93
-
94
- template< class Point >
95
- void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
96
- {
97
- using std::abs;
98
- using std::sqrt;
99
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
100
- const auto tmp1 = std::abs( tmp0[ 0 ] );
101
- const auto tmp2 = 0.2 + tmp1;
102
- const auto tmp3 = tmp2 * tmp2;
103
- const auto tmp4 = tmp0[ 1 ] * tmp0[ 1 ];
104
- const auto tmp5 = tmp4 + tmp3;
105
- const auto tmp6 = 1e-10 + tmp5;
106
- const auto tmp7 = std::sqrt( tmp6 );
107
- const auto tmp8 = 2 * tmp7;
108
- const auto tmp9 = tmp2 * (tmp0[ 0 ] == 0.0 ? 0.0 : (tmp0[ 0 ] < 0.0 ? -1 : 1));
109
- const auto tmp10 = tmp9 + tmp9;
110
- const auto tmp11 = tmp10 / tmp8;
111
- const auto tmp12 = tmp1 * tmp1;
112
- const auto tmp13 = std::abs( tmp0[ 1 ] );
113
- const auto tmp14 = -0.3464101615137755 + tmp13;
114
- const auto tmp15 = tmp14 * tmp14;
115
- const auto tmp16 = tmp15 + tmp12;
116
- const auto tmp17 = 1e-10 + tmp16;
117
- const auto tmp18 = std::sqrt( tmp17 );
118
- const auto tmp19 = 2 * tmp18;
119
- const auto tmp20 = tmp1 * (tmp0[ 0 ] == 0.0 ? 0.0 : (tmp0[ 0 ] < 0.0 ? -1 : 1));
120
- const auto tmp21 = tmp20 + tmp20;
121
- const auto tmp22 = tmp21 / tmp19;
122
- const auto tmp23 = 0.3464101615137755 * tmp1;
123
- const auto tmp24 = 0.2 * tmp14;
124
- const auto tmp25 = tmp0[ 1 ] + tmp0[ 1 ];
125
- const auto tmp26 = tmp25 / tmp8;
126
- const auto tmp27 = tmp14 * (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1));
127
- const auto tmp28 = tmp27 + tmp27;
128
- const auto tmp29 = tmp28 / tmp19;
129
- (result[ 0 ])[ 0 ] = (tmp24 > tmp23 ? tmp22 : tmp11);
130
- (result[ 0 ])[ 1 ] = (tmp24 > tmp23 ? tmp29 : tmp26);
131
- }
132
-
133
- template< class Point >
134
- void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
135
- {
136
- using std::abs;
137
- using std::sqrt;
138
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
139
- const auto tmp1 = std::abs( tmp0[ 0 ] );
140
- const auto tmp2 = 0.2 + tmp1;
141
- const auto tmp3 = tmp2 * tmp2;
142
- const auto tmp4 = tmp0[ 1 ] * tmp0[ 1 ];
143
- const auto tmp5 = tmp4 + tmp3;
144
- const auto tmp6 = 1e-10 + tmp5;
145
- const auto tmp7 = std::sqrt( tmp6 );
146
- const auto tmp8 = 2 * tmp7;
147
- const auto tmp9 = tmp2 * (tmp0[ 0 ] == 0.0 ? 0.0 : (tmp0[ 0 ] < 0.0 ? -1 : 1));
148
- const auto tmp10 = tmp9 + tmp9;
149
- const auto tmp11 = tmp10 / tmp8;
150
- const auto tmp12 = 2 * tmp11;
151
- const auto tmp13 = tmp12 * tmp11;
152
- const auto tmp14 = -1 * tmp13;
153
- const auto tmp15 = (tmp0[ 0 ] == 0.0 ? 0.0 : (tmp0[ 0 ] < 0.0 ? -1 : 1)) * (tmp0[ 0 ] == 0.0 ? 0.0 : (tmp0[ 0 ] < 0.0 ? -1 : 1));
154
- const auto tmp16 = tmp15 + tmp15;
155
- const auto tmp17 = tmp16 + tmp14;
156
- const auto tmp18 = tmp17 / tmp8;
157
- const auto tmp19 = tmp1 * tmp1;
158
- const auto tmp20 = std::abs( tmp0[ 1 ] );
159
- const auto tmp21 = -0.3464101615137755 + tmp20;
160
- const auto tmp22 = tmp21 * tmp21;
161
- const auto tmp23 = tmp22 + tmp19;
162
- const auto tmp24 = 1e-10 + tmp23;
163
- const auto tmp25 = std::sqrt( tmp24 );
164
- const auto tmp26 = 2 * tmp25;
165
- const auto tmp27 = tmp1 * (tmp0[ 0 ] == 0.0 ? 0.0 : (tmp0[ 0 ] < 0.0 ? -1 : 1));
166
- const auto tmp28 = tmp27 + tmp27;
167
- const auto tmp29 = tmp28 / tmp26;
168
- const auto tmp30 = 2 * tmp29;
169
- const auto tmp31 = tmp30 * tmp29;
170
- const auto tmp32 = -1 * tmp31;
171
- const auto tmp33 = tmp16 + tmp32;
172
- const auto tmp34 = tmp33 / tmp26;
173
- const auto tmp35 = 0.3464101615137755 * tmp1;
174
- const auto tmp36 = 0.2 * tmp21;
175
- const auto tmp37 = tmp0[ 1 ] + tmp0[ 1 ];
176
- const auto tmp38 = tmp37 / tmp8;
177
- const auto tmp39 = 2 * tmp38;
178
- const auto tmp40 = tmp39 * tmp11;
179
- const auto tmp41 = -1 * tmp40;
180
- const auto tmp42 = tmp41 / tmp8;
181
- const auto tmp43 = tmp21 * (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1));
182
- const auto tmp44 = tmp43 + tmp43;
183
- const auto tmp45 = tmp44 / tmp26;
184
- const auto tmp46 = 2 * tmp45;
185
- const auto tmp47 = tmp46 * tmp29;
186
- const auto tmp48 = -1 * tmp47;
187
- const auto tmp49 = tmp48 / tmp26;
188
- const auto tmp50 = tmp12 * tmp38;
189
- const auto tmp51 = -1 * tmp50;
190
- const auto tmp52 = tmp51 / tmp8;
191
- const auto tmp53 = tmp30 * tmp45;
192
- const auto tmp54 = -1 * tmp53;
193
- const auto tmp55 = tmp54 / tmp26;
194
- const auto tmp56 = tmp39 * tmp38;
195
- const auto tmp57 = -1 * tmp56;
196
- const auto tmp58 = 2 + tmp57;
197
- const auto tmp59 = tmp58 / tmp8;
198
- const auto tmp60 = tmp46 * tmp45;
199
- const auto tmp61 = -1 * tmp60;
200
- const auto tmp62 = (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1)) * (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1));
201
- const auto tmp63 = tmp62 + tmp62;
202
- const auto tmp64 = tmp63 + tmp61;
203
- const auto tmp65 = tmp64 / tmp26;
204
- ((result[ 0 ])[ 0 ])[ 0 ] = (tmp36 > tmp35 ? tmp34 : tmp18);
205
- ((result[ 0 ])[ 0 ])[ 1 ] = (tmp36 > tmp35 ? tmp49 : tmp42);
206
- ((result[ 0 ])[ 1 ])[ 0 ] = (tmp36 > tmp35 ? tmp55 : tmp52);
207
- ((result[ 0 ])[ 1 ])[ 1 ] = (tmp36 > tmp35 ? tmp65 : tmp59);
208
- }
209
-
210
- template< std::size_t i >
211
- const ConstantType< i > &constant () const
212
- {
213
- return *std::get< i >( constants_ );
214
- }
215
-
216
- template< std::size_t i >
217
- ConstantType< i > &constant ()
218
- {
219
- return *std::get< i >( constants_ );
220
- }
221
- ConstantTupleType constants_;
222
- std::tuple< > coefficients_;
223
- };
224
-
225
- } // namespace UFLLocalFunctions_34a46b87fa5c0a5a4f0bc44949f2eda9
226
-
227
- PYBIND11_MODULE( localfunction_34a46b87fa5c0a5a4f0bc44949f2eda9_19659fe2f2f74bcfb5d532f1a0d38be9, module )
228
- {
229
- typedef UFLLocalFunctions_34a46b87fa5c0a5a4f0bc44949f2eda9::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > > LocalFunctionType;
230
- if constexpr( LocalFunctionType::gridPartValid )
231
- {
232
- auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_34a46b87fa5c0a5a4f0bc44949f2eda9::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_34a46b87fa5c0a5a4f0bc44949f2eda9_19659fe2f2f74bcfb5d532f1a0d38be9.cc"})).first;
233
- Dune::FemPy::registerUFLLocalFunction( module, cls );
234
- cls.def( pybind11::init( [] ( pybind11::object gridView, const std::string &name, int order ) {return new LocalFunctionType( Dune::FemPy::gridPart<Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView>(gridView),name,order); } ), pybind11::keep_alive< 1, 2 >() );
235
- cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
236
- }
237
- }
238
-
239
- #endif
@@ -1,220 +0,0 @@
1
- #ifndef GUARD_3c10414582133a0fa8e341c4544a97c7
2
- #define GUARD_3c10414582133a0fa8e341c4544a97c7
3
-
4
- #define USING_DUNE_PYTHON 1
5
- #include <config.h>
6
- #include <dune/grid/io/file/dgfparser/dgfyasp.hh>
7
- #include <dune/grid/yaspgrid.hh>
8
- #include <dune/python/grid/hierarchical.hh>
9
- #include <dune/fem/function/localfunction/bindable.hh>
10
- #include <dune/fem/common/intersectionside.hh>
11
- #include <dune/python/pybind11/pybind11.h>
12
- #include <dune/python/pybind11/extensions.h>
13
- #include <dune/fempy/py/grid/gridpart.hh>
14
- #include <dune/common/exceptions.hh>
15
- #include <dune/fempy/py/ufllocalfunction.hh>
16
-
17
- namespace UFLLocalFunctions_3c10414582133a0fa8e341c4544a97c7
18
- {
19
-
20
- // UFLLocalFunction
21
- // ----------------
22
-
23
- template< class GridPart >
24
- struct UFLLocalFunction
25
- : public Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>>
26
- {
27
- typedef GridPart GridPartType;
28
- typedef typename GridPartType::GridViewType GridView;
29
- typedef typename GridView::ctype ctype;
30
- typedef Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>> BaseType;
31
- typedef Dune::Fem::GridFunctionSpace<GridPartType,Dune::Dim<1>> FunctionSpaceType;
32
- typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
33
- typedef typename GridPartType::IntersectionType IntersectionType;
34
- typedef typename EntityType::Geometry Geometry;
35
- typedef typename Geometry::GlobalCoordinate GlobalCoordinateType;
36
- typedef Dune::Fem::IntersectionSide Side;
37
- typedef std::tuple<> ConstantTupleType;
38
- typedef std::tuple<> CoefficientTupleType;
39
- static constexpr bool gridPartValid = true;
40
- template< std::size_t i >
41
- using CoefficientType = std::tuple_element_t< i, CoefficientTupleType >;
42
- template< std::size_t i >
43
- using ConstantType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
44
- using BaseType::entity;
45
- using BaseType::geometry;
46
-
47
- UFLLocalFunction ( const GridPartType &gridPart, const std::string &name, int order, const Dune::Fem::ParameterReader &parameter = Dune::Fem::Parameter::container() )
48
- : BaseType(gridPart,name,order)
49
- {}
50
-
51
- void bind ( const IntersectionType &intersection, Side side )
52
- {
53
- BaseType::bind(intersection, side);
54
- }
55
-
56
- void bind ( const EntityType &entity )
57
- {
58
- BaseType::bind(entity);
59
- }
60
-
61
- void unbind ()
62
- {
63
- BaseType::unbind();
64
- }
65
-
66
- template< class Point >
67
- void evaluate ( const Point &x, typename FunctionSpaceType::RangeType &result ) const
68
- {
69
- using std::abs;
70
- using std::max;
71
- using std::sqrt;
72
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
73
- const auto tmp1 = -0.3 + tmp0[ 1 ];
74
- const auto tmp2 = std::abs( tmp1 );
75
- const auto tmp3 = -0.3 + tmp2;
76
- const auto tmp4 = -0.1 + tmp0[ 0 ];
77
- const auto tmp5 = std::abs( tmp4 );
78
- const auto tmp6 = -0.8 + tmp5;
79
- const auto tmp7 = std::max( tmp6, tmp3 );
80
- const auto tmp8 = std::max( tmp3, 0.0 );
81
- const auto tmp9 = tmp8 * tmp8;
82
- const auto tmp10 = std::max( tmp6, 0.0 );
83
- const auto tmp11 = tmp10 * tmp10;
84
- const auto tmp12 = tmp11 + tmp9;
85
- const auto tmp13 = 1e-10 + tmp12;
86
- const auto tmp14 = std::sqrt( tmp13 );
87
- const auto tmp15 = -1 * (tmp7 > 0.0 ? tmp14 : tmp7);
88
- result[ 0 ] = tmp15;
89
- }
90
-
91
- template< class Point >
92
- void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
93
- {
94
- using std::abs;
95
- using std::max;
96
- using std::sqrt;
97
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
98
- const auto tmp1 = -0.1 + tmp0[ 0 ];
99
- const auto tmp2 = -0.3 + tmp0[ 1 ];
100
- const auto tmp3 = std::abs( tmp2 );
101
- const auto tmp4 = -0.3 + tmp3;
102
- const auto tmp5 = std::abs( tmp1 );
103
- const auto tmp6 = -0.8 + tmp5;
104
- const auto tmp7 = (tmp6 > tmp4 ? 1 : 0.0) * (tmp1 == 0.0 ? 0.0 : (tmp1 < 0.0 ? -1 : 1));
105
- const auto tmp8 = std::max( tmp4, 0.0 );
106
- const auto tmp9 = tmp8 * tmp8;
107
- const auto tmp10 = std::max( tmp6, 0.0 );
108
- const auto tmp11 = tmp10 * tmp10;
109
- const auto tmp12 = tmp11 + tmp9;
110
- const auto tmp13 = 1e-10 + tmp12;
111
- const auto tmp14 = std::sqrt( tmp13 );
112
- const auto tmp15 = 2 * tmp14;
113
- const auto tmp16 = (tmp6 > 0.0 ? 1 : 0.0) * (tmp1 == 0.0 ? 0.0 : (tmp1 < 0.0 ? -1 : 1));
114
- const auto tmp17 = tmp16 * tmp10;
115
- const auto tmp18 = tmp17 + tmp17;
116
- const auto tmp19 = tmp18 / tmp15;
117
- const auto tmp20 = std::max( tmp6, tmp4 );
118
- const auto tmp21 = -1 * (tmp20 > 0.0 ? tmp19 : tmp7);
119
- const auto tmp22 = -1 * (tmp6 > tmp4 ? 1 : 0.0);
120
- const auto tmp23 = 1.0 + tmp22;
121
- const auto tmp24 = tmp23 * (tmp2 == 0.0 ? 0.0 : (tmp2 < 0.0 ? -1 : 1));
122
- const auto tmp25 = (tmp4 > 0.0 ? 1 : 0.0) * (tmp2 == 0.0 ? 0.0 : (tmp2 < 0.0 ? -1 : 1));
123
- const auto tmp26 = tmp25 * tmp8;
124
- const auto tmp27 = tmp26 + tmp26;
125
- const auto tmp28 = tmp27 / tmp15;
126
- const auto tmp29 = -1 * (tmp20 > 0.0 ? tmp28 : tmp24);
127
- (result[ 0 ])[ 0 ] = tmp21;
128
- (result[ 0 ])[ 1 ] = tmp29;
129
- }
130
-
131
- template< class Point >
132
- void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
133
- {
134
- using std::abs;
135
- using std::max;
136
- using std::sqrt;
137
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
138
- const auto tmp1 = -0.3 + tmp0[ 1 ];
139
- const auto tmp2 = std::abs( tmp1 );
140
- const auto tmp3 = -0.3 + tmp2;
141
- const auto tmp4 = std::max( tmp3, 0.0 );
142
- const auto tmp5 = tmp4 * tmp4;
143
- const auto tmp6 = -0.1 + tmp0[ 0 ];
144
- const auto tmp7 = std::abs( tmp6 );
145
- const auto tmp8 = -0.8 + tmp7;
146
- const auto tmp9 = std::max( tmp8, 0.0 );
147
- const auto tmp10 = tmp9 * tmp9;
148
- const auto tmp11 = tmp10 + tmp5;
149
- const auto tmp12 = 1e-10 + tmp11;
150
- const auto tmp13 = std::sqrt( tmp12 );
151
- const auto tmp14 = 2 * tmp13;
152
- const auto tmp15 = (tmp8 > 0.0 ? 1 : 0.0) * (tmp6 == 0.0 ? 0.0 : (tmp6 < 0.0 ? -1 : 1));
153
- const auto tmp16 = tmp15 * tmp9;
154
- const auto tmp17 = tmp16 + tmp16;
155
- const auto tmp18 = tmp17 / tmp14;
156
- const auto tmp19 = 2 * tmp18;
157
- const auto tmp20 = tmp19 * tmp18;
158
- const auto tmp21 = -1 * tmp20;
159
- const auto tmp22 = tmp15 * tmp15;
160
- const auto tmp23 = tmp22 + tmp22;
161
- const auto tmp24 = tmp23 + tmp21;
162
- const auto tmp25 = tmp24 / tmp14;
163
- const auto tmp26 = std::max( tmp8, tmp3 );
164
- const auto tmp27 = -1 * (tmp26 > 0.0 ? tmp25 : 0.0);
165
- const auto tmp28 = (tmp3 > 0.0 ? 1 : 0.0) * (tmp1 == 0.0 ? 0.0 : (tmp1 < 0.0 ? -1 : 1));
166
- const auto tmp29 = tmp28 * tmp4;
167
- const auto tmp30 = tmp29 + tmp29;
168
- const auto tmp31 = tmp30 / tmp14;
169
- const auto tmp32 = 2 * tmp31;
170
- const auto tmp33 = tmp32 * tmp18;
171
- const auto tmp34 = -1 * tmp33;
172
- const auto tmp35 = tmp34 / tmp14;
173
- const auto tmp36 = -1 * (tmp26 > 0.0 ? tmp35 : 0.0);
174
- const auto tmp37 = tmp19 * tmp31;
175
- const auto tmp38 = -1 * tmp37;
176
- const auto tmp39 = tmp38 / tmp14;
177
- const auto tmp40 = -1 * (tmp26 > 0.0 ? tmp39 : 0.0);
178
- const auto tmp41 = tmp32 * tmp31;
179
- const auto tmp42 = -1 * tmp41;
180
- const auto tmp43 = tmp28 * tmp28;
181
- const auto tmp44 = tmp43 + tmp43;
182
- const auto tmp45 = tmp44 + tmp42;
183
- const auto tmp46 = tmp45 / tmp14;
184
- const auto tmp47 = -1 * (tmp26 > 0.0 ? tmp46 : 0.0);
185
- ((result[ 0 ])[ 0 ])[ 0 ] = tmp27;
186
- ((result[ 0 ])[ 0 ])[ 1 ] = tmp36;
187
- ((result[ 0 ])[ 1 ])[ 0 ] = tmp40;
188
- ((result[ 0 ])[ 1 ])[ 1 ] = tmp47;
189
- }
190
-
191
- template< std::size_t i >
192
- const ConstantType< i > &constant () const
193
- {
194
- return *std::get< i >( constants_ );
195
- }
196
-
197
- template< std::size_t i >
198
- ConstantType< i > &constant ()
199
- {
200
- return *std::get< i >( constants_ );
201
- }
202
- ConstantTupleType constants_;
203
- std::tuple< > coefficients_;
204
- };
205
-
206
- } // namespace UFLLocalFunctions_3c10414582133a0fa8e341c4544a97c7
207
-
208
- PYBIND11_MODULE( localfunction_3c10414582133a0fa8e341c4544a97c7_19659fe2f2f74bcfb5d532f1a0d38be9, module )
209
- {
210
- typedef UFLLocalFunctions_3c10414582133a0fa8e341c4544a97c7::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > > LocalFunctionType;
211
- if constexpr( LocalFunctionType::gridPartValid )
212
- {
213
- auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_3c10414582133a0fa8e341c4544a97c7::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_3c10414582133a0fa8e341c4544a97c7_19659fe2f2f74bcfb5d532f1a0d38be9.cc"})).first;
214
- Dune::FemPy::registerUFLLocalFunction( module, cls );
215
- cls.def( pybind11::init( [] ( pybind11::object gridView, const std::string &name, int order ) {return new LocalFunctionType( Dune::FemPy::gridPart<Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView>(gridView),name,order); } ), pybind11::keep_alive< 1, 2 >() );
216
- cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
217
- }
218
- }
219
-
220
- #endif
@@ -1,216 +0,0 @@
1
- #ifndef GUARD_3dfb73430ddb90a26b6f50f85e52e2a4
2
- #define GUARD_3dfb73430ddb90a26b6f50f85e52e2a4
3
-
4
- #define USING_DUNE_PYTHON 1
5
- #include <config.h>
6
- #include <dune/grid/io/file/dgfparser/dgfyasp.hh>
7
- #include <dune/grid/yaspgrid.hh>
8
- #include <dune/python/grid/hierarchical.hh>
9
- #include <dune/fem/function/localfunction/bindable.hh>
10
- #include <dune/fem/common/intersectionside.hh>
11
- #include <dune/python/pybind11/pybind11.h>
12
- #include <dune/python/pybind11/extensions.h>
13
- #include <dune/fempy/py/grid/gridpart.hh>
14
- #include <dune/common/exceptions.hh>
15
- #include <dune/fempy/py/ufllocalfunction.hh>
16
-
17
- namespace UFLLocalFunctions_3dfb73430ddb90a26b6f50f85e52e2a4
18
- {
19
-
20
- // UFLLocalFunction
21
- // ----------------
22
-
23
- template< class GridPart >
24
- struct UFLLocalFunction
25
- : public Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>>
26
- {
27
- typedef GridPart GridPartType;
28
- typedef typename GridPartType::GridViewType GridView;
29
- typedef typename GridView::ctype ctype;
30
- typedef Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>> BaseType;
31
- typedef Dune::Fem::GridFunctionSpace<GridPartType,Dune::Dim<1>> FunctionSpaceType;
32
- typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
33
- typedef typename GridPartType::IntersectionType IntersectionType;
34
- typedef typename EntityType::Geometry Geometry;
35
- typedef typename Geometry::GlobalCoordinate GlobalCoordinateType;
36
- typedef Dune::Fem::IntersectionSide Side;
37
- typedef std::tuple<> ConstantTupleType;
38
- typedef std::tuple<> CoefficientTupleType;
39
- static constexpr bool gridPartValid = true;
40
- template< std::size_t i >
41
- using CoefficientType = std::tuple_element_t< i, CoefficientTupleType >;
42
- template< std::size_t i >
43
- using ConstantType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
44
- using BaseType::entity;
45
- using BaseType::geometry;
46
-
47
- UFLLocalFunction ( const GridPartType &gridPart, const std::string &name, int order, const Dune::Fem::ParameterReader &parameter = Dune::Fem::Parameter::container() )
48
- : BaseType(gridPart,name,order)
49
- {}
50
-
51
- void bind ( const IntersectionType &intersection, Side side )
52
- {
53
- BaseType::bind(intersection, side);
54
- }
55
-
56
- void bind ( const EntityType &entity )
57
- {
58
- BaseType::bind(entity);
59
- }
60
-
61
- void unbind ()
62
- {
63
- BaseType::unbind();
64
- }
65
-
66
- template< class Point >
67
- void evaluate ( const Point &x, typename FunctionSpaceType::RangeType &result ) const
68
- {
69
- using std::abs;
70
- using std::max;
71
- using std::sqrt;
72
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
73
- const auto tmp1 = 0.4 + tmp0[ 1 ];
74
- const auto tmp2 = -0.3 + tmp1;
75
- const auto tmp3 = std::abs( tmp2 );
76
- const auto tmp4 = -0.3 + tmp3;
77
- const auto tmp5 = -0.1 + tmp0[ 0 ];
78
- const auto tmp6 = std::abs( tmp5 );
79
- const auto tmp7 = -0.8 + tmp6;
80
- const auto tmp8 = std::max( tmp7, tmp4 );
81
- const auto tmp9 = std::max( tmp4, 0.0 );
82
- const auto tmp10 = tmp9 * tmp9;
83
- const auto tmp11 = std::max( tmp7, 0.0 );
84
- const auto tmp12 = tmp11 * tmp11;
85
- const auto tmp13 = tmp12 + tmp10;
86
- const auto tmp14 = 1e-10 + tmp13;
87
- const auto tmp15 = std::sqrt( tmp14 );
88
- result[ 0 ] = (tmp8 > 0.0 ? tmp15 : tmp8);
89
- }
90
-
91
- template< class Point >
92
- void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
93
- {
94
- using std::abs;
95
- using std::max;
96
- using std::sqrt;
97
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
98
- const auto tmp1 = -0.1 + tmp0[ 0 ];
99
- const auto tmp2 = 0.4 + tmp0[ 1 ];
100
- const auto tmp3 = -0.3 + tmp2;
101
- const auto tmp4 = std::abs( tmp3 );
102
- const auto tmp5 = -0.3 + tmp4;
103
- const auto tmp6 = std::abs( tmp1 );
104
- const auto tmp7 = -0.8 + tmp6;
105
- const auto tmp8 = (tmp7 > tmp5 ? 1 : 0.0) * (tmp1 == 0.0 ? 0.0 : (tmp1 < 0.0 ? -1 : 1));
106
- const auto tmp9 = std::max( tmp5, 0.0 );
107
- const auto tmp10 = tmp9 * tmp9;
108
- const auto tmp11 = std::max( tmp7, 0.0 );
109
- const auto tmp12 = tmp11 * tmp11;
110
- const auto tmp13 = tmp12 + tmp10;
111
- const auto tmp14 = 1e-10 + tmp13;
112
- const auto tmp15 = std::sqrt( tmp14 );
113
- const auto tmp16 = 2 * tmp15;
114
- const auto tmp17 = (tmp7 > 0.0 ? 1 : 0.0) * (tmp1 == 0.0 ? 0.0 : (tmp1 < 0.0 ? -1 : 1));
115
- const auto tmp18 = tmp17 * tmp11;
116
- const auto tmp19 = tmp18 + tmp18;
117
- const auto tmp20 = tmp19 / tmp16;
118
- const auto tmp21 = std::max( tmp7, tmp5 );
119
- const auto tmp22 = -1 * (tmp7 > tmp5 ? 1 : 0.0);
120
- const auto tmp23 = 1.0 + tmp22;
121
- const auto tmp24 = tmp23 * (tmp3 == 0.0 ? 0.0 : (tmp3 < 0.0 ? -1 : 1));
122
- const auto tmp25 = (tmp5 > 0.0 ? 1 : 0.0) * (tmp3 == 0.0 ? 0.0 : (tmp3 < 0.0 ? -1 : 1));
123
- const auto tmp26 = tmp25 * tmp9;
124
- const auto tmp27 = tmp26 + tmp26;
125
- const auto tmp28 = tmp27 / tmp16;
126
- (result[ 0 ])[ 0 ] = (tmp21 > 0.0 ? tmp20 : tmp8);
127
- (result[ 0 ])[ 1 ] = (tmp21 > 0.0 ? tmp28 : tmp24);
128
- }
129
-
130
- template< class Point >
131
- void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
132
- {
133
- using std::abs;
134
- using std::max;
135
- using std::sqrt;
136
- GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
137
- const auto tmp1 = 0.4 + tmp0[ 1 ];
138
- const auto tmp2 = -0.3 + tmp1;
139
- const auto tmp3 = std::abs( tmp2 );
140
- const auto tmp4 = -0.3 + tmp3;
141
- const auto tmp5 = std::max( tmp4, 0.0 );
142
- const auto tmp6 = tmp5 * tmp5;
143
- const auto tmp7 = -0.1 + tmp0[ 0 ];
144
- const auto tmp8 = std::abs( tmp7 );
145
- const auto tmp9 = -0.8 + tmp8;
146
- const auto tmp10 = std::max( tmp9, 0.0 );
147
- const auto tmp11 = tmp10 * tmp10;
148
- const auto tmp12 = tmp11 + tmp6;
149
- const auto tmp13 = 1e-10 + tmp12;
150
- const auto tmp14 = std::sqrt( tmp13 );
151
- const auto tmp15 = 2 * tmp14;
152
- const auto tmp16 = (tmp9 > 0.0 ? 1 : 0.0) * (tmp7 == 0.0 ? 0.0 : (tmp7 < 0.0 ? -1 : 1));
153
- const auto tmp17 = tmp16 * tmp10;
154
- const auto tmp18 = tmp17 + tmp17;
155
- const auto tmp19 = tmp18 / tmp15;
156
- const auto tmp20 = 2 * tmp19;
157
- const auto tmp21 = tmp20 * tmp19;
158
- const auto tmp22 = -1 * tmp21;
159
- const auto tmp23 = tmp16 * tmp16;
160
- const auto tmp24 = tmp23 + tmp23;
161
- const auto tmp25 = tmp24 + tmp22;
162
- const auto tmp26 = tmp25 / tmp15;
163
- const auto tmp27 = std::max( tmp9, tmp4 );
164
- const auto tmp28 = (tmp4 > 0.0 ? 1 : 0.0) * (tmp2 == 0.0 ? 0.0 : (tmp2 < 0.0 ? -1 : 1));
165
- const auto tmp29 = tmp28 * tmp5;
166
- const auto tmp30 = tmp29 + tmp29;
167
- const auto tmp31 = tmp30 / tmp15;
168
- const auto tmp32 = 2 * tmp31;
169
- const auto tmp33 = tmp32 * tmp19;
170
- const auto tmp34 = -1 * tmp33;
171
- const auto tmp35 = tmp34 / tmp15;
172
- const auto tmp36 = tmp20 * tmp31;
173
- const auto tmp37 = -1 * tmp36;
174
- const auto tmp38 = tmp37 / tmp15;
175
- const auto tmp39 = tmp32 * tmp31;
176
- const auto tmp40 = -1 * tmp39;
177
- const auto tmp41 = tmp28 * tmp28;
178
- const auto tmp42 = tmp41 + tmp41;
179
- const auto tmp43 = tmp42 + tmp40;
180
- const auto tmp44 = tmp43 / tmp15;
181
- ((result[ 0 ])[ 0 ])[ 0 ] = (tmp27 > 0.0 ? tmp26 : 0.0);
182
- ((result[ 0 ])[ 0 ])[ 1 ] = (tmp27 > 0.0 ? tmp35 : 0.0);
183
- ((result[ 0 ])[ 1 ])[ 0 ] = (tmp27 > 0.0 ? tmp38 : 0.0);
184
- ((result[ 0 ])[ 1 ])[ 1 ] = (tmp27 > 0.0 ? tmp44 : 0.0);
185
- }
186
-
187
- template< std::size_t i >
188
- const ConstantType< i > &constant () const
189
- {
190
- return *std::get< i >( constants_ );
191
- }
192
-
193
- template< std::size_t i >
194
- ConstantType< i > &constant ()
195
- {
196
- return *std::get< i >( constants_ );
197
- }
198
- ConstantTupleType constants_;
199
- std::tuple< > coefficients_;
200
- };
201
-
202
- } // namespace UFLLocalFunctions_3dfb73430ddb90a26b6f50f85e52e2a4
203
-
204
- PYBIND11_MODULE( localfunction_3dfb73430ddb90a26b6f50f85e52e2a4_19659fe2f2f74bcfb5d532f1a0d38be9, module )
205
- {
206
- typedef UFLLocalFunctions_3dfb73430ddb90a26b6f50f85e52e2a4::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > > LocalFunctionType;
207
- if constexpr( LocalFunctionType::gridPartValid )
208
- {
209
- auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_3dfb73430ddb90a26b6f50f85e52e2a4::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_3dfb73430ddb90a26b6f50f85e52e2a4_19659fe2f2f74bcfb5d532f1a0d38be9.cc"})).first;
210
- Dune::FemPy::registerUFLLocalFunction( module, cls );
211
- cls.def( pybind11::init( [] ( pybind11::object gridView, const std::string &name, int order ) {return new LocalFunctionType( Dune::FemPy::gridPart<Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView>(gridView),name,order); } ), pybind11::keep_alive< 1, 2 >() );
212
- cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
213
- }
214
- }
215
-
216
- #endif