ddfem 1.0.9__py3-none-any.whl → 1.0.10__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 (63) hide show
  1. ddfem/__init__.py +1 -1
  2. ddfem/__main__.py +1 -1
  3. ddfem/data/2.11.dev20250709/boundary.modules +1 -1
  4. ddfem/data/2.11.dev20250709/hierarchicalgrid_472c2c2d007bf5604887ab2f16b7eb13.cc +30 -0
  5. ddfem/data/2.11.dev20250709/integrands_00ee9b3b89e4e44212e5b7ad7948a24ev1_3_a524c1196983e65de1c06d7d6afdeb44.cc +587 -0
  6. ddfem/data/2.11.dev20250709/{integrands_5e1afa60a15644998389a84306246ea5v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_2e6d4e3b5cff269867d26022ac7cee09v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
  7. ddfem/data/2.11.dev20250709/{integrands_2e5e6f48655bd358419554a0857f697bv1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_59ef814e4fbd86ef9c0aeac61e84e9a7v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
  8. ddfem/data/2.11.dev20250709/{integrands_563572f4cb20b041e8198ba7d5f88584v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_96ea175da69be26acf1a8d94dc0b3c93v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
  9. ddfem/data/2.11.dev20250709/{integrands_2339be3c67df1d67b18125c34ced69c2v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → integrands_bf510277401791ad5e30831b49a8ed7cv1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +25 -14
  10. ddfem/data/2.11.dev20250709/intro.modules +26 -23
  11. ddfem/data/2.11.dev20250709/localfunction_0cb4ca9e24e2891510640b0737aaab21_a524c1196983e65de1c06d7d6afdeb44.cc +170 -0
  12. ddfem/data/2.11.dev20250709/localfunction_0f7b2106478c5d2af781b1f377a180d2_a524c1196983e65de1c06d7d6afdeb44.cc +393 -0
  13. ddfem/data/2.11.dev20250709/localfunction_1460b632dc5919e94a2147108f4f34f4_19659fe2f2f74bcfb5d532f1a0d38be9.cc +468 -0
  14. ddfem/data/2.11.dev20250709/localfunction_161bbe6dde741c6e3f90c2919b8d17a4_19659fe2f2f74bcfb5d532f1a0d38be9.cc +171 -0
  15. ddfem/data/2.11.dev20250709/localfunction_268716e3e3ec528038367ee04d335ea1_19659fe2f2f74bcfb5d532f1a0d38be9.cc +289 -0
  16. ddfem/data/2.11.dev20250709/localfunction_29566243d89228735978e58471af60be_19659fe2f2f74bcfb5d532f1a0d38be9.cc +246 -0
  17. ddfem/data/2.11.dev20250709/localfunction_2a890b2a64788a92607670296c0d37ac_19659fe2f2f74bcfb5d532f1a0d38be9.cc +311 -0
  18. ddfem/data/2.11.dev20250709/localfunction_2a97db5a6a479d02138a836cb0890cf2_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  19. ddfem/data/2.11.dev20250709/localfunction_2bbefabe87db948827d02bdb8d69a7d1_19659fe2f2f74bcfb5d532f1a0d38be9.cc +240 -0
  20. ddfem/data/2.11.dev20250709/localfunction_34a46b87fa5c0a5a4f0bc44949f2eda9_19659fe2f2f74bcfb5d532f1a0d38be9.cc +239 -0
  21. ddfem/data/2.11.dev20250709/localfunction_3c10414582133a0fa8e341c4544a97c7_19659fe2f2f74bcfb5d532f1a0d38be9.cc +220 -0
  22. ddfem/data/2.11.dev20250709/localfunction_3dfb73430ddb90a26b6f50f85e52e2a4_19659fe2f2f74bcfb5d532f1a0d38be9.cc +216 -0
  23. ddfem/data/2.11.dev20250709/localfunction_4484607e3f9bd9999dbd7bb9d595a7b2_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  24. ddfem/data/2.11.dev20250709/localfunction_465e17370f4344b8997151adacf7aec6_19659fe2f2f74bcfb5d532f1a0d38be9.cc +403 -0
  25. ddfem/data/2.11.dev20250709/localfunction_57e9651c5364ef528f41cf138e126115_19659fe2f2f74bcfb5d532f1a0d38be9.cc +272 -0
  26. ddfem/data/2.11.dev20250709/localfunction_5c2a00bf7ec417475a0a378ed462beeb_19659fe2f2f74bcfb5d532f1a0d38be9.cc +350 -0
  27. ddfem/data/2.11.dev20250709/localfunction_5d71e054c405bc6584738437908af804_19659fe2f2f74bcfb5d532f1a0d38be9.cc +364 -0
  28. ddfem/data/2.11.dev20250709/localfunction_6343878b30d190cc70b631d882009dec_19659fe2f2f74bcfb5d532f1a0d38be9.cc +342 -0
  29. ddfem/data/2.11.dev20250709/localfunction_639a3f3873411f43337e687cb070368f_19659fe2f2f74bcfb5d532f1a0d38be9.cc +230 -0
  30. ddfem/data/2.11.dev20250709/localfunction_65bda5736a84d4aa0ef2d48ebcc90ed5_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  31. ddfem/data/2.11.dev20250709/localfunction_6661b21a0e1340a9a9f7b32da595f130_19659fe2f2f74bcfb5d532f1a0d38be9.cc +468 -0
  32. ddfem/data/2.11.dev20250709/localfunction_75e876499fa3b7abc096aa08f88a1c2d_19659fe2f2f74bcfb5d532f1a0d38be9.cc +213 -0
  33. ddfem/data/2.11.dev20250709/localfunction_7d81d496538f240d504e5597484ee746_a524c1196983e65de1c06d7d6afdeb44.cc +462 -0
  34. ddfem/data/2.11.dev20250709/localfunction_8647b4efdf8a37595f73652bc1905df2_19659fe2f2f74bcfb5d532f1a0d38be9.cc +335 -0
  35. ddfem/data/2.11.dev20250709/localfunction_98b04b00bb93b8c6da99c91867e597ca_a524c1196983e65de1c06d7d6afdeb44.cc +639 -0
  36. ddfem/data/2.11.dev20250709/localfunction_98b32c4b5bc0d8083f3d2c394aa33429_19659fe2f2f74bcfb5d532f1a0d38be9.cc +340 -0
  37. ddfem/data/2.11.dev20250709/localfunction_9b741917efb5aa6a09e375272e4ae3aa_19659fe2f2f74bcfb5d532f1a0d38be9.cc +317 -0
  38. ddfem/data/2.11.dev20250709/localfunction_a369aff055312b472a92ee7e257534ff_19659fe2f2f74bcfb5d532f1a0d38be9.cc +392 -0
  39. ddfem/data/2.11.dev20250709/{localfunction_e4557ecff74fe5b37313674e67db2782_a524c1196983e65de1c06d7d6afdeb44.cc → localfunction_a46a988b5d8571e80fd401a36d7341b7_a524c1196983e65de1c06d7d6afdeb44.cc} +64 -29
  40. ddfem/data/2.11.dev20250709/localfunction_a6cc88a79948487ce95a6c3f22487b36_19659fe2f2f74bcfb5d532f1a0d38be9.cc +395 -0
  41. ddfem/data/2.11.dev20250709/localfunction_a9bb07439605d560b583608f20441342_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  42. ddfem/data/2.11.dev20250709/localfunction_aa506761997f291dfd2e62b678f010b2_19659fe2f2f74bcfb5d532f1a0d38be9.cc +280 -0
  43. ddfem/data/2.11.dev20250709/localfunction_b5edf0c36f0fc96cc6f5f3677c6557a1_19659fe2f2f74bcfb5d532f1a0d38be9.cc +214 -0
  44. ddfem/data/2.11.dev20250709/{localfunction_c5ebc4ae4b5d3bad6be770eb08c50d08_19659fe2f2f74bcfb5d532f1a0d38be9.cc → localfunction_c3d0902cf8bb4b86b62a2293de2b74e9_19659fe2f2f74bcfb5d532f1a0d38be9.cc} +29 -29
  45. ddfem/data/2.11.dev20250709/localfunction_cf4a29dc25e72137baf2f8fb8b8d3c50_19659fe2f2f74bcfb5d532f1a0d38be9.cc +267 -0
  46. ddfem/data/2.11.dev20250709/localfunction_d0f33c2dc1ae0e619d85a7621c8e83a6_a524c1196983e65de1c06d7d6afdeb44.cc +325 -0
  47. ddfem/data/2.11.dev20250709/localfunction_d40efa41ac661ff77278d2ae4812b06d_19659fe2f2f74bcfb5d532f1a0d38be9.cc +377 -0
  48. ddfem/data/2.11.dev20250709/localfunction_e85b93fe9b8fcd40ee82782fc600b65b_a524c1196983e65de1c06d7d6afdeb44.cc +247 -0
  49. ddfem/data/2.11.dev20250709/localfunction_e9c8d4f4cedd30cab76a588b95bbccab_19659fe2f2f74bcfb5d532f1a0d38be9.cc +325 -0
  50. ddfem/data/2.11.dev20250709/localfunction_f0d3fe89de368f7ea295a1982a807bd8_19659fe2f2f74bcfb5d532f1a0d38be9.cc +281 -0
  51. ddfem/data/2.11.dev20250709/localfunction_fb15e1ad2c62e6660c67949fcf166d81_19659fe2f2f74bcfb5d532f1a0d38be9.cc +339 -0
  52. ddfem/data/2.11.dev20250709/localfunction_fb17410b0b5d479dce9ffc6f9d61ab37_19659fe2f2f74bcfb5d532f1a0d38be9.cc +317 -0
  53. ddfem/data/2.11.dev20250709/referenceelements_fe266b8abf61f4601198949ea6b0dfd3.cc +24 -0
  54. ddfem/data/2.11.dev20250709/yaspcoordinates_dim3_ctdouble.cc +55 -0
  55. ddfem/geometry/primitive_base.py +1 -1
  56. ddfem-1.0.10.dist-info/METADATA +101 -0
  57. {ddfem-1.0.9.dist-info → ddfem-1.0.10.dist-info}/RECORD +60 -18
  58. ddfem/data/2.11.dev20250709/integrands_f3ca00a2ef95c9a48de9ec1b807b1b30v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +0 -453
  59. ddfem/data/2.11.dev20250709/localfunction_f4583c5cc10d24a8bdedf7510ce9da7b_a524c1196983e65de1c06d7d6afdeb44.cc +0 -299
  60. ddfem-1.0.9.dist-info/METADATA +0 -46
  61. {ddfem-1.0.9.dist-info → ddfem-1.0.10.dist-info}/WHEEL +0 -0
  62. {ddfem-1.0.9.dist-info → ddfem-1.0.10.dist-info}/licenses/LICENSE +0 -0
  63. {ddfem-1.0.9.dist-info → ddfem-1.0.10.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,240 @@
1
+ #ifndef GUARD_2bbefabe87db948827d02bdb8d69a7d1
2
+ #define GUARD_2bbefabe87db948827d02bdb8d69a7d1
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_2bbefabe87db948827d02bdb8d69a7d1
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[ 1 ] );
73
+ const auto tmp2 = tmp1 * tmp1;
74
+ const auto tmp3 = tmp0[ 0 ] * tmp0[ 0 ];
75
+ const auto tmp4 = tmp3 + tmp2;
76
+ const auto tmp5 = 1e-10 + tmp4;
77
+ const auto tmp6 = std::sqrt( tmp5 );
78
+ const auto tmp7 = -0.75 + tmp6;
79
+ const auto tmp8 = std::abs( tmp7 );
80
+ const auto tmp9 = -0.44083893921935485 + tmp1;
81
+ const auto tmp10 = tmp9 * tmp9;
82
+ const auto tmp11 = -0.6067627457812106 + tmp0[ 0 ];
83
+ const auto tmp12 = tmp11 * tmp11;
84
+ const auto tmp13 = tmp12 + tmp10;
85
+ const auto tmp14 = 1e-10 + tmp13;
86
+ const auto tmp15 = std::sqrt( tmp14 );
87
+ const auto tmp16 = 0.8090169943749475 * tmp1;
88
+ const auto tmp17 = 0.5877852522924731 * tmp0[ 0 ];
89
+ const auto tmp18 = -0.25 + (tmp17 > tmp16 ? tmp15 : tmp8);
90
+ result[ 0 ] = tmp18;
91
+ }
92
+
93
+ template< class Point >
94
+ void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
95
+ {
96
+ using std::abs;
97
+ using std::sqrt;
98
+ GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
99
+ const auto tmp1 = std::abs( tmp0[ 1 ] );
100
+ const auto tmp2 = tmp1 * tmp1;
101
+ const auto tmp3 = tmp0[ 0 ] * tmp0[ 0 ];
102
+ const auto tmp4 = tmp3 + tmp2;
103
+ const auto tmp5 = 1e-10 + tmp4;
104
+ const auto tmp6 = std::sqrt( tmp5 );
105
+ const auto tmp7 = -0.75 + tmp6;
106
+ const auto tmp8 = 2 * tmp6;
107
+ const auto tmp9 = tmp0[ 0 ] + tmp0[ 0 ];
108
+ const auto tmp10 = tmp9 / tmp8;
109
+ const auto tmp11 = tmp10 * (tmp7 == 0.0 ? 0.0 : (tmp7 < 0.0 ? -1 : 1));
110
+ const auto tmp12 = -0.44083893921935485 + tmp1;
111
+ const auto tmp13 = tmp12 * tmp12;
112
+ const auto tmp14 = -0.6067627457812106 + tmp0[ 0 ];
113
+ const auto tmp15 = tmp14 * tmp14;
114
+ const auto tmp16 = tmp15 + tmp13;
115
+ const auto tmp17 = 1e-10 + tmp16;
116
+ const auto tmp18 = std::sqrt( tmp17 );
117
+ const auto tmp19 = 2 * tmp18;
118
+ const auto tmp20 = tmp14 + tmp14;
119
+ const auto tmp21 = tmp20 / tmp19;
120
+ const auto tmp22 = 0.8090169943749475 * tmp1;
121
+ const auto tmp23 = 0.5877852522924731 * tmp0[ 0 ];
122
+ const auto tmp24 = tmp1 * (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1));
123
+ const auto tmp25 = tmp24 + tmp24;
124
+ const auto tmp26 = tmp25 / tmp8;
125
+ const auto tmp27 = tmp26 * (tmp7 == 0.0 ? 0.0 : (tmp7 < 0.0 ? -1 : 1));
126
+ const auto tmp28 = tmp12 * (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1));
127
+ const auto tmp29 = tmp28 + tmp28;
128
+ const auto tmp30 = tmp29 / tmp19;
129
+ (result[ 0 ])[ 0 ] = (tmp23 > tmp22 ? tmp21 : tmp11);
130
+ (result[ 0 ])[ 1 ] = (tmp23 > tmp22 ? tmp30 : tmp27);
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[ 1 ] );
140
+ const auto tmp2 = tmp1 * tmp1;
141
+ const auto tmp3 = tmp0[ 0 ] * tmp0[ 0 ];
142
+ const auto tmp4 = tmp3 + tmp2;
143
+ const auto tmp5 = 1e-10 + tmp4;
144
+ const auto tmp6 = std::sqrt( tmp5 );
145
+ const auto tmp7 = -0.75 + tmp6;
146
+ const auto tmp8 = 2 * tmp6;
147
+ const auto tmp9 = tmp0[ 0 ] + tmp0[ 0 ];
148
+ const auto tmp10 = tmp9 / tmp8;
149
+ const auto tmp11 = 2 * tmp10;
150
+ const auto tmp12 = tmp11 * tmp10;
151
+ const auto tmp13 = -1 * tmp12;
152
+ const auto tmp14 = 2 + tmp13;
153
+ const auto tmp15 = tmp14 / tmp8;
154
+ const auto tmp16 = tmp15 * (tmp7 == 0.0 ? 0.0 : (tmp7 < 0.0 ? -1 : 1));
155
+ const auto tmp17 = -0.44083893921935485 + tmp1;
156
+ const auto tmp18 = tmp17 * tmp17;
157
+ const auto tmp19 = -0.6067627457812106 + tmp0[ 0 ];
158
+ const auto tmp20 = tmp19 * tmp19;
159
+ const auto tmp21 = tmp20 + tmp18;
160
+ const auto tmp22 = 1e-10 + tmp21;
161
+ const auto tmp23 = std::sqrt( tmp22 );
162
+ const auto tmp24 = 2 * tmp23;
163
+ const auto tmp25 = tmp19 + tmp19;
164
+ const auto tmp26 = tmp25 / tmp24;
165
+ const auto tmp27 = 2 * tmp26;
166
+ const auto tmp28 = tmp27 * tmp26;
167
+ const auto tmp29 = -1 * tmp28;
168
+ const auto tmp30 = 2 + tmp29;
169
+ const auto tmp31 = tmp30 / tmp24;
170
+ const auto tmp32 = 0.8090169943749475 * tmp1;
171
+ const auto tmp33 = 0.5877852522924731 * tmp0[ 0 ];
172
+ const auto tmp34 = tmp1 * (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1));
173
+ const auto tmp35 = tmp34 + tmp34;
174
+ const auto tmp36 = tmp35 / tmp8;
175
+ const auto tmp37 = 2 * tmp36;
176
+ const auto tmp38 = tmp37 * tmp10;
177
+ const auto tmp39 = -1 * tmp38;
178
+ const auto tmp40 = tmp39 / tmp8;
179
+ const auto tmp41 = tmp40 * (tmp7 == 0.0 ? 0.0 : (tmp7 < 0.0 ? -1 : 1));
180
+ const auto tmp42 = tmp17 * (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1));
181
+ const auto tmp43 = tmp42 + tmp42;
182
+ const auto tmp44 = tmp43 / tmp24;
183
+ const auto tmp45 = 2 * tmp44;
184
+ const auto tmp46 = tmp45 * tmp26;
185
+ const auto tmp47 = -1 * tmp46;
186
+ const auto tmp48 = tmp47 / tmp24;
187
+ const auto tmp49 = tmp11 * tmp36;
188
+ const auto tmp50 = -1 * tmp49;
189
+ const auto tmp51 = tmp50 / tmp8;
190
+ const auto tmp52 = tmp51 * (tmp7 == 0.0 ? 0.0 : (tmp7 < 0.0 ? -1 : 1));
191
+ const auto tmp53 = tmp27 * tmp44;
192
+ const auto tmp54 = -1 * tmp53;
193
+ const auto tmp55 = tmp54 / tmp24;
194
+ const auto tmp56 = tmp37 * tmp36;
195
+ const auto tmp57 = -1 * tmp56;
196
+ const auto tmp58 = (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1)) * (tmp0[ 1 ] == 0.0 ? 0.0 : (tmp0[ 1 ] < 0.0 ? -1 : 1));
197
+ const auto tmp59 = tmp58 + tmp58;
198
+ const auto tmp60 = tmp59 + tmp57;
199
+ const auto tmp61 = tmp60 / tmp8;
200
+ const auto tmp62 = tmp61 * (tmp7 == 0.0 ? 0.0 : (tmp7 < 0.0 ? -1 : 1));
201
+ const auto tmp63 = tmp45 * tmp44;
202
+ const auto tmp64 = -1 * tmp63;
203
+ const auto tmp65 = tmp59 + tmp64;
204
+ const auto tmp66 = tmp65 / tmp24;
205
+ ((result[ 0 ])[ 0 ])[ 0 ] = (tmp33 > tmp32 ? tmp31 : tmp16);
206
+ ((result[ 0 ])[ 0 ])[ 1 ] = (tmp33 > tmp32 ? tmp48 : tmp41);
207
+ ((result[ 0 ])[ 1 ])[ 0 ] = (tmp33 > tmp32 ? tmp55 : tmp52);
208
+ ((result[ 0 ])[ 1 ])[ 1 ] = (tmp33 > tmp32 ? tmp66 : tmp62);
209
+ }
210
+
211
+ template< std::size_t i >
212
+ const ConstantType< i > &constant () const
213
+ {
214
+ return *std::get< i >( constants_ );
215
+ }
216
+
217
+ template< std::size_t i >
218
+ ConstantType< i > &constant ()
219
+ {
220
+ return *std::get< i >( constants_ );
221
+ }
222
+ ConstantTupleType constants_;
223
+ std::tuple< > coefficients_;
224
+ };
225
+
226
+ } // namespace UFLLocalFunctions_2bbefabe87db948827d02bdb8d69a7d1
227
+
228
+ PYBIND11_MODULE( localfunction_2bbefabe87db948827d02bdb8d69a7d1_19659fe2f2f74bcfb5d532f1a0d38be9, module )
229
+ {
230
+ typedef UFLLocalFunctions_2bbefabe87db948827d02bdb8d69a7d1::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > > LocalFunctionType;
231
+ if constexpr( LocalFunctionType::gridPartValid )
232
+ {
233
+ auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_2bbefabe87db948827d02bdb8d69a7d1::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_2bbefabe87db948827d02bdb8d69a7d1_19659fe2f2f74bcfb5d532f1a0d38be9.cc"})).first;
234
+ Dune::FemPy::registerUFLLocalFunction( module, cls );
235
+ 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 >() );
236
+ cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
237
+ }
238
+ }
239
+
240
+ #endif
@@ -0,0 +1,239 @@
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