ddfem 1.0.4__py3-none-any.whl → 1.0.6__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 (78) hide show
  1. ddfem/__init__.py +72 -0
  2. ddfem/__main__.py +24 -0
  3. ddfem/data/adapt_010e1455a389aa01992af42c0a3f4b14.cc +27 -0
  4. ddfem/data/femscheme_f2a3cb32a864b08c0236366e732fb908.cc +43 -0
  5. ddfem/data/femspace_4ff9049b6f297245e5d33296d14cd684_d5b136dbe3c5077b69c99b8c322eb563.cc +45 -0
  6. ddfem/data/generate.py +30 -0
  7. ddfem/data/hierarchicalgrid_d827e80243feae36e8b9006bb24207e7.cc +26 -0
  8. ddfem/data/indexset_e9c0cdc96a4fc702a0969c29910954e6.cc +32 -0
  9. ddfem/data/integrands_008eefa148b772fa3192dd3c1728c140v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +587 -0
  10. ddfem/data/integrands_00ee9b3b89e4e44212e5b7ad7948a24ev1_3_a524c1196983e65de1c06d7d6afdeb44.cc +587 -0
  11. ddfem/data/integrands_1da925f6548e47811d4ee37ac8afd85ev1_3_a524c1196983e65de1c06d7d6afdeb44.cc +453 -0
  12. ddfem/data/integrands_2339be3c67df1d67b18125c34ced69c2v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +244 -0
  13. ddfem/data/integrands_3a7c822d5ac1692781ee4bcf2964fce7v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +409 -0
  14. ddfem/data/integrands_3bde0abfafcf45a3cff4d1029568ab5cv1_3_a524c1196983e65de1c06d7d6afdeb44.cc +409 -0
  15. ddfem/data/integrands_472696f050a50e3f5017ab5ecdab564bv1_3_a524c1196983e65de1c06d7d6afdeb44.cc +533 -0
  16. ddfem/data/integrands_5d65834d43b1dbae0ceafbcc9ec60542v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +453 -0
  17. ddfem/data/integrands_9fbeb56ff6a7df9b8535d767ca7725d6v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +588 -0
  18. ddfem/data/integrands_cf38a832d97016edac4179e31ea45a48v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +533 -0
  19. ddfem/data/localfunction_00f2e5593eeb23f01906255d67244f6e_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  20. ddfem/data/localfunction_0cb4ca9e24e2891510640b0737aaab21_a524c1196983e65de1c06d7d6afdeb44.cc +170 -0
  21. ddfem/data/localfunction_0f7b2106478c5d2af781b1f377a180d2_a524c1196983e65de1c06d7d6afdeb44.cc +393 -0
  22. ddfem/data/localfunction_10ad0a2d88c74db5f4bf5f81e138974f_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  23. ddfem/data/localfunction_191355e6250b2d2e260d96f519ad9976_a524c1196983e65de1c06d7d6afdeb44.cc +192 -0
  24. ddfem/data/localfunction_1d13146d4bff10e178aba773fe2a9f1d_a524c1196983e65de1c06d7d6afdeb44.cc +263 -0
  25. ddfem/data/localfunction_1d27a90a52b9053192c9cc902283f79b_a524c1196983e65de1c06d7d6afdeb44.cc +189 -0
  26. ddfem/data/localfunction_2021505441469e99dd3c9b164e083239_a524c1196983e65de1c06d7d6afdeb44.cc +620 -0
  27. ddfem/data/localfunction_228c55d163ca194a905826bcc20fcbc0_a524c1196983e65de1c06d7d6afdeb44.cc +903 -0
  28. ddfem/data/localfunction_22e797a8f3e8c322f33c41e07bd15165_a524c1196983e65de1c06d7d6afdeb44.cc +1445 -0
  29. ddfem/data/localfunction_2a97db5a6a479d02138a836cb0890cf2_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  30. ddfem/data/localfunction_32613626342183eafa360dc1f0f18924_a524c1196983e65de1c06d7d6afdeb44.cc +1425 -0
  31. ddfem/data/localfunction_33933b99fbea8227fedf6cfb180ea878_a524c1196983e65de1c06d7d6afdeb44.cc +386 -0
  32. ddfem/data/localfunction_3e323e81c52891c0ecb656eac273e52f_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  33. ddfem/data/localfunction_42ff56710f3bd510798ecabb32a6cbf0_a524c1196983e65de1c06d7d6afdeb44.cc +490 -0
  34. ddfem/data/localfunction_42ff56710f3bd510798ecabb32a6cbf0_af122c1df944c95cd395ec0f91d0f970.cc +488 -0
  35. ddfem/data/localfunction_4484607e3f9bd9999dbd7bb9d595a7b2_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  36. ddfem/data/localfunction_6363af791dde11d699a9a3d876cc5d9a_a524c1196983e65de1c06d7d6afdeb44.cc +549 -0
  37. ddfem/data/localfunction_65bda5736a84d4aa0ef2d48ebcc90ed5_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  38. ddfem/data/localfunction_762aa49bc5a47ad3d8d8bbde36b42ee5_a524c1196983e65de1c06d7d6afdeb44.cc +723 -0
  39. ddfem/data/localfunction_7d81d496538f240d504e5597484ee746_a524c1196983e65de1c06d7d6afdeb44.cc +462 -0
  40. ddfem/data/localfunction_83d9e6dd70d1c31c973224e210cc36b4_a524c1196983e65de1c06d7d6afdeb44.cc +647 -0
  41. ddfem/data/localfunction_86a0670f34bf2ac8155423a1c1bc2e75_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  42. ddfem/data/localfunction_a46a988b5d8571e80fd401a36d7341b7_a524c1196983e65de1c06d7d6afdeb44.cc +170 -0
  43. ddfem/data/localfunction_a854465b265a1a51dacb4f71f7eeb06b_a524c1196983e65de1c06d7d6afdeb44.cc +266 -0
  44. ddfem/data/localfunction_a8c726f728cd35d137188b33301aeef1_a524c1196983e65de1c06d7d6afdeb44.cc +176 -0
  45. ddfem/data/localfunction_a9bb07439605d560b583608f20441342_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  46. ddfem/data/localfunction_ae8173bdb67b8ea50ce75c3912841100_a524c1196983e65de1c06d7d6afdeb44.cc +1290 -0
  47. ddfem/data/localfunction_aeb3d963412cdc65630e0a4c3c0dde0f_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  48. ddfem/data/localfunction_b20910b6c8d57cb5e6a7ff4b89b91618_a524c1196983e65de1c06d7d6afdeb44.cc +437 -0
  49. ddfem/data/localfunction_b8239bf849ec7c1903f627833e6dac5a_a524c1196983e65de1c06d7d6afdeb44.cc +1270 -0
  50. ddfem/data/localfunction_bcafb581216501f273e23c0e26cd57af_af122c1df944c95cd395ec0f91d0f970.cc +698 -0
  51. ddfem/data/localfunction_bdfb7ddf42a423f7d0791458634d4b8f_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  52. ddfem/data/localfunction_d0f33c2dc1ae0e619d85a7621c8e83a6_a524c1196983e65de1c06d7d6afdeb44.cc +325 -0
  53. ddfem/data/localfunction_d75993d7ae5919d23117b153e900840d_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  54. ddfem/data/localfunction_dd1fb4bd60f2d8b3a062dbbdaedb9fee_a524c1196983e65de1c06d7d6afdeb44.cc +869 -0
  55. ddfem/data/localfunction_e6b6d8d3826590442cc40f3834124254_a524c1196983e65de1c06d7d6afdeb44.cc +553 -0
  56. ddfem/data/localfunction_e85b93fe9b8fcd40ee82782fc600b65b_a524c1196983e65de1c06d7d6afdeb44.cc +247 -0
  57. ddfem/data/localfunction_f4b1d42cbb447375f39ed834570cd3f0_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  58. ddfem/data/localfunction_f626cd43dc8558135fe0b32cde016644_a524c1196983e65de1c06d7d6afdeb44.cc +294 -0
  59. ddfem/data/referenceelements_0fff57b283123cc055345ec95574c857.cc +24 -0
  60. ddfem/data/referenceelements_de274310a0055100b832a0e8892b0258.cc +24 -0
  61. ddfem/data/referenceelements_f4457f35395151d83a965d4cf5fce70d.cc +24 -0
  62. ddfem/data/view_a524c1196983e65de1c06d7d6afdeb44.cc +39 -0
  63. ddfem/data/view_af122c1df944c95cd395ec0f91d0f970.cc +62 -0
  64. ddfem/examples/beam.py +2 -2
  65. ddfem/examples/five_circle_flat.py +18 -37
  66. ddfem/examples/single_circle.py +1 -1
  67. ddfem/examples/triple_circle.py +2 -2
  68. ddfem/examples/triple_circle_beam.py +2 -2
  69. ddfem/geometry/domain.py +1 -1
  70. ddfem/geometry/domain_dune.py +46 -28
  71. ddfem/geometry/primitive_base.py +11 -6
  72. ddfem/plot.py +67 -7
  73. {ddfem-1.0.4.dist-info → ddfem-1.0.6.dist-info}/METADATA +9 -2
  74. ddfem-1.0.6.dist-info/RECORD +103 -0
  75. ddfem-1.0.4.dist-info/RECORD +0 -41
  76. {ddfem-1.0.4.dist-info → ddfem-1.0.6.dist-info}/WHEEL +0 -0
  77. {ddfem-1.0.4.dist-info → ddfem-1.0.6.dist-info}/licenses/LICENSE +0 -0
  78. {ddfem-1.0.4.dist-info → ddfem-1.0.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,247 @@
1
+ #ifndef GUARD_e85b93fe9b8fcd40ee82782fc600b65b
2
+ #define GUARD_e85b93fe9b8fcd40ee82782fc600b65b
3
+
4
+ #define USING_DUNE_PYTHON 1
5
+ #include <config.h>
6
+ #include <dune/alugrid/dgf.hh>
7
+ #include <dune/alugrid/grid.hh>
8
+ #include <dune/fem/gridpart/adaptiveleafgridpart.hh>
9
+ #include <dune/fem/gridpart/filter/simple.hh>
10
+ #include <dune/fem/gridpart/filteredgridpart.hh>
11
+ #include <dune/fempy/py/gridview.hh>
12
+ #include <dune/python/grid/gridview.hh>
13
+ #include <dune/python/grid/hierarchical.hh>
14
+ #include <dune/fem/function/localfunction/bindable.hh>
15
+ #include <dune/fem/common/intersectionside.hh>
16
+ #include <dune/python/pybind11/pybind11.h>
17
+ #include <dune/python/pybind11/extensions.h>
18
+ #include <dune/fempy/py/grid/gridpart.hh>
19
+ #include <dune/common/exceptions.hh>
20
+ #include <dune/fempy/py/ufllocalfunction.hh>
21
+
22
+ namespace UFLLocalFunctions_e85b93fe9b8fcd40ee82782fc600b65b
23
+ {
24
+
25
+ // UFLLocalFunction
26
+ // ----------------
27
+
28
+ template< class GridPart >
29
+ struct UFLLocalFunction
30
+ : public Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>>
31
+ {
32
+ typedef GridPart GridPartType;
33
+ typedef typename GridPartType::GridViewType GridView;
34
+ typedef typename GridView::ctype ctype;
35
+ typedef Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>> BaseType;
36
+ typedef Dune::Fem::GridFunctionSpace<GridPartType,Dune::Dim<1>> FunctionSpaceType;
37
+ typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
38
+ typedef typename GridPartType::IntersectionType IntersectionType;
39
+ typedef typename EntityType::Geometry Geometry;
40
+ typedef typename Geometry::GlobalCoordinate GlobalCoordinateType;
41
+ typedef Dune::Fem::IntersectionSide Side;
42
+ typedef std::tuple<> ConstantTupleType;
43
+ typedef std::tuple<> CoefficientTupleType;
44
+ static constexpr bool gridPartValid = true;
45
+ template< std::size_t i >
46
+ using CoefficientType = std::tuple_element_t< i, CoefficientTupleType >;
47
+ template< std::size_t i >
48
+ using ConstantType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
49
+ using BaseType::entity;
50
+ using BaseType::geometry;
51
+
52
+ UFLLocalFunction ( const GridPartType &gridPart, const std::string &name, int order, const Dune::Fem::ParameterReader &parameter = Dune::Fem::Parameter::container() )
53
+ : BaseType(gridPart,name,order)
54
+ {}
55
+
56
+ void bind ( const IntersectionType &intersection, Side side )
57
+ {
58
+ BaseType::bind(intersection, side);
59
+ }
60
+
61
+ void bind ( const EntityType &entity )
62
+ {
63
+ BaseType::bind(entity);
64
+ }
65
+
66
+ void unbind ()
67
+ {
68
+ BaseType::unbind();
69
+ }
70
+
71
+ template< class Point >
72
+ void evaluate ( const Point &x, typename FunctionSpaceType::RangeType &result ) const
73
+ {
74
+ using std::max;
75
+ using std::sqrt;
76
+ GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
77
+ const auto tmp1 = -0.8 + tmp0[ 1 ];
78
+ const auto tmp2 = tmp1 * tmp1;
79
+ const auto tmp3 = tmp0[ 0 ] * tmp0[ 0 ];
80
+ const auto tmp4 = tmp3 + tmp2;
81
+ const auto tmp5 = 1e-10 + tmp4;
82
+ const auto tmp6 = std::sqrt( tmp5 );
83
+ const auto tmp7 = -0.5 + tmp6;
84
+ const auto tmp8 = -1 * tmp7;
85
+ const auto tmp9 = tmp0[ 1 ] * tmp0[ 1 ];
86
+ const auto tmp10 = tmp3 + tmp9;
87
+ const auto tmp11 = 1e-10 + tmp10;
88
+ const auto tmp12 = std::sqrt( tmp11 );
89
+ const auto tmp13 = -1 + tmp12;
90
+ const auto tmp14 = std::max( tmp13, tmp8 );
91
+ result[ 0 ] = tmp14;
92
+ }
93
+
94
+ template< class Point >
95
+ void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
96
+ {
97
+ using std::sqrt;
98
+ GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
99
+ const auto tmp1 = -0.8 + 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.5 + tmp6;
106
+ const auto tmp8 = -1 * tmp7;
107
+ const auto tmp9 = tmp0[ 1 ] * tmp0[ 1 ];
108
+ const auto tmp10 = tmp3 + tmp9;
109
+ const auto tmp11 = 1e-10 + tmp10;
110
+ const auto tmp12 = std::sqrt( tmp11 );
111
+ const auto tmp13 = -1 + tmp12;
112
+ const auto tmp14 = 2 * tmp12;
113
+ const auto tmp15 = tmp0[ 0 ] + tmp0[ 0 ];
114
+ const auto tmp16 = tmp15 / tmp14;
115
+ const auto tmp17 = tmp16 * (tmp13 > tmp8 ? 1 : 0.0);
116
+ const auto tmp18 = 2 * tmp6;
117
+ const auto tmp19 = tmp15 / tmp18;
118
+ const auto tmp20 = -1 * tmp19;
119
+ const auto tmp21 = -1 * (tmp13 > tmp8 ? 1 : 0.0);
120
+ const auto tmp22 = 1.0 + tmp21;
121
+ const auto tmp23 = tmp22 * tmp20;
122
+ const auto tmp24 = tmp23 + tmp17;
123
+ const auto tmp25 = tmp0[ 1 ] + tmp0[ 1 ];
124
+ const auto tmp26 = tmp25 / tmp14;
125
+ const auto tmp27 = tmp26 * (tmp13 > tmp8 ? 1 : 0.0);
126
+ const auto tmp28 = tmp1 + tmp1;
127
+ const auto tmp29 = tmp28 / tmp18;
128
+ const auto tmp30 = -1 * tmp29;
129
+ const auto tmp31 = tmp22 * tmp30;
130
+ const auto tmp32 = tmp31 + tmp27;
131
+ (result[ 0 ])[ 0 ] = tmp24;
132
+ (result[ 0 ])[ 1 ] = tmp32;
133
+ }
134
+
135
+ template< class Point >
136
+ void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
137
+ {
138
+ using std::sqrt;
139
+ GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
140
+ const auto tmp1 = -0.8 + tmp0[ 1 ];
141
+ const auto tmp2 = tmp1 * tmp1;
142
+ const auto tmp3 = tmp0[ 0 ] * tmp0[ 0 ];
143
+ const auto tmp4 = tmp3 + tmp2;
144
+ const auto tmp5 = 1e-10 + tmp4;
145
+ const auto tmp6 = std::sqrt( tmp5 );
146
+ const auto tmp7 = -0.5 + tmp6;
147
+ const auto tmp8 = -1 * tmp7;
148
+ const auto tmp9 = tmp0[ 1 ] * tmp0[ 1 ];
149
+ const auto tmp10 = tmp3 + tmp9;
150
+ const auto tmp11 = 1e-10 + tmp10;
151
+ const auto tmp12 = std::sqrt( tmp11 );
152
+ const auto tmp13 = -1 + tmp12;
153
+ const auto tmp14 = 2 * tmp12;
154
+ const auto tmp15 = tmp0[ 0 ] + tmp0[ 0 ];
155
+ const auto tmp16 = tmp15 / tmp14;
156
+ const auto tmp17 = 2 * tmp16;
157
+ const auto tmp18 = tmp17 * tmp16;
158
+ const auto tmp19 = -1 * tmp18;
159
+ const auto tmp20 = 2 + tmp19;
160
+ const auto tmp21 = tmp20 / tmp14;
161
+ const auto tmp22 = tmp21 * (tmp13 > tmp8 ? 1 : 0.0);
162
+ const auto tmp23 = 2 * tmp6;
163
+ const auto tmp24 = tmp15 / tmp23;
164
+ const auto tmp25 = 2 * tmp24;
165
+ const auto tmp26 = tmp25 * tmp24;
166
+ const auto tmp27 = -1 * tmp26;
167
+ const auto tmp28 = 2 + tmp27;
168
+ const auto tmp29 = tmp28 / tmp23;
169
+ const auto tmp30 = -1 * tmp29;
170
+ const auto tmp31 = -1 * (tmp13 > tmp8 ? 1 : 0.0);
171
+ const auto tmp32 = 1.0 + tmp31;
172
+ const auto tmp33 = tmp32 * tmp30;
173
+ const auto tmp34 = tmp33 + tmp22;
174
+ const auto tmp35 = tmp0[ 1 ] + tmp0[ 1 ];
175
+ const auto tmp36 = tmp35 / tmp14;
176
+ const auto tmp37 = 2 * tmp36;
177
+ const auto tmp38 = tmp37 * tmp16;
178
+ const auto tmp39 = -1 * tmp38;
179
+ const auto tmp40 = tmp39 / tmp14;
180
+ const auto tmp41 = tmp40 * (tmp13 > tmp8 ? 1 : 0.0);
181
+ const auto tmp42 = tmp1 + tmp1;
182
+ const auto tmp43 = tmp42 / tmp23;
183
+ const auto tmp44 = 2 * tmp43;
184
+ const auto tmp45 = tmp44 * tmp24;
185
+ const auto tmp46 = -1 * tmp45;
186
+ const auto tmp47 = tmp46 / tmp23;
187
+ const auto tmp48 = -1 * tmp47;
188
+ const auto tmp49 = tmp32 * tmp48;
189
+ const auto tmp50 = tmp49 + tmp41;
190
+ const auto tmp51 = tmp17 * tmp36;
191
+ const auto tmp52 = -1 * tmp51;
192
+ const auto tmp53 = tmp52 / tmp14;
193
+ const auto tmp54 = tmp53 * (tmp13 > tmp8 ? 1 : 0.0);
194
+ const auto tmp55 = tmp25 * tmp43;
195
+ const auto tmp56 = -1 * tmp55;
196
+ const auto tmp57 = tmp56 / tmp23;
197
+ const auto tmp58 = -1 * tmp57;
198
+ const auto tmp59 = tmp32 * tmp58;
199
+ const auto tmp60 = tmp59 + tmp54;
200
+ const auto tmp61 = tmp37 * tmp36;
201
+ const auto tmp62 = -1 * tmp61;
202
+ const auto tmp63 = 2 + tmp62;
203
+ const auto tmp64 = tmp63 / tmp14;
204
+ const auto tmp65 = tmp64 * (tmp13 > tmp8 ? 1 : 0.0);
205
+ const auto tmp66 = tmp44 * tmp43;
206
+ const auto tmp67 = -1 * tmp66;
207
+ const auto tmp68 = 2 + tmp67;
208
+ const auto tmp69 = tmp68 / tmp23;
209
+ const auto tmp70 = -1 * tmp69;
210
+ const auto tmp71 = tmp32 * tmp70;
211
+ const auto tmp72 = tmp71 + tmp65;
212
+ ((result[ 0 ])[ 0 ])[ 0 ] = tmp34;
213
+ ((result[ 0 ])[ 0 ])[ 1 ] = tmp50;
214
+ ((result[ 0 ])[ 1 ])[ 0 ] = tmp60;
215
+ ((result[ 0 ])[ 1 ])[ 1 ] = tmp72;
216
+ }
217
+
218
+ template< std::size_t i >
219
+ const ConstantType< i > &constant () const
220
+ {
221
+ return *std::get< i >( constants_ );
222
+ }
223
+
224
+ template< std::size_t i >
225
+ ConstantType< i > &constant ()
226
+ {
227
+ return *std::get< i >( constants_ );
228
+ }
229
+ ConstantTupleType constants_;
230
+ std::tuple< > coefficients_;
231
+ };
232
+
233
+ } // namespace UFLLocalFunctions_e85b93fe9b8fcd40ee82782fc600b65b
234
+
235
+ PYBIND11_MODULE( localfunction_e85b93fe9b8fcd40ee82782fc600b65b_a524c1196983e65de1c06d7d6afdeb44, module )
236
+ {
237
+ typedef UFLLocalFunctions_e85b93fe9b8fcd40ee82782fc600b65b::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > > LocalFunctionType;
238
+ if constexpr( LocalFunctionType::gridPartValid )
239
+ {
240
+ auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_e85b93fe9b8fcd40ee82782fc600b65b::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_e85b93fe9b8fcd40ee82782fc600b65b_a524c1196983e65de1c06d7d6afdeb44.cc"})).first;
241
+ Dune::FemPy::registerUFLLocalFunction( module, cls );
242
+ cls.def( pybind11::init( [] ( pybind11::object gridView, const std::string &name, int order ) {return new LocalFunctionType( Dune::FemPy::gridPart<Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true >>(gridView),name,order); } ), pybind11::keep_alive< 1, 2 >() );
243
+ cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
244
+ }
245
+ }
246
+
247
+ #endif
@@ -0,0 +1,135 @@
1
+ #ifndef GUARD_f4b1d42cbb447375f39ed834570cd3f0
2
+ #define GUARD_f4b1d42cbb447375f39ed834570cd3f0
3
+
4
+ #define USING_DUNE_PYTHON 1
5
+ #include <config.h>
6
+ #include <dune/alugrid/dgf.hh>
7
+ #include <dune/alugrid/grid.hh>
8
+ #include <dune/fem/gridpart/adaptiveleafgridpart.hh>
9
+ #include <dune/fem/gridpart/filter/simple.hh>
10
+ #include <dune/fem/gridpart/filteredgridpart.hh>
11
+ #include <dune/fempy/py/gridview.hh>
12
+ #include <dune/python/grid/gridview.hh>
13
+ #include <dune/python/grid/hierarchical.hh>
14
+ #include <dune/fem/function/localfunction/bindable.hh>
15
+ #include <dune/fem/common/intersectionside.hh>
16
+ #include <dune/python/pybind11/pybind11.h>
17
+ #include <dune/python/pybind11/extensions.h>
18
+ #include <dune/fempy/py/grid/gridpart.hh>
19
+ #include <dune/common/exceptions.hh>
20
+ #include <dune/fempy/py/ufllocalfunction.hh>
21
+
22
+ namespace UFLLocalFunctions_f4b1d42cbb447375f39ed834570cd3f0
23
+ {
24
+
25
+ // UFLLocalFunction
26
+ // ----------------
27
+
28
+ template< class GridPart >
29
+ struct UFLLocalFunction
30
+ : public Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>>
31
+ {
32
+ typedef GridPart GridPartType;
33
+ typedef typename GridPartType::GridViewType GridView;
34
+ typedef typename GridView::ctype ctype;
35
+ typedef Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>> BaseType;
36
+ typedef Dune::Fem::GridFunctionSpace<GridPartType,Dune::Dim<1>> FunctionSpaceType;
37
+ typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
38
+ typedef typename GridPartType::IntersectionType IntersectionType;
39
+ typedef typename EntityType::Geometry Geometry;
40
+ typedef typename Geometry::GlobalCoordinate GlobalCoordinateType;
41
+ typedef Dune::Fem::IntersectionSide Side;
42
+ typedef double Conc1;
43
+ typedef std::tuple< std::shared_ptr< Conc1 > > ConstantTupleType;
44
+ template< std::size_t i >
45
+ using ConstantsRangeType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
46
+ typedef std::tuple<> CoefficientTupleType;
47
+ static constexpr bool gridPartValid = true;
48
+ template< std::size_t i >
49
+ using CoefficientType = std::tuple_element_t< i, CoefficientTupleType >;
50
+ template< std::size_t i >
51
+ using ConstantType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
52
+ using BaseType::entity;
53
+ using BaseType::geometry;
54
+
55
+ UFLLocalFunction ( const GridPartType &gridPart, const std::string &name, int order, const Dune::Fem::ParameterReader &parameter = Dune::Fem::Parameter::container() )
56
+ : BaseType(gridPart,name,order)
57
+ {
58
+ std::get< 0 >( constants_ ) = std::make_shared< Conc1 >( (Conc1(0)) );
59
+ }
60
+
61
+ void bind ( const IntersectionType &intersection, Side side )
62
+ {
63
+ BaseType::bind(intersection, side);
64
+ }
65
+
66
+ void bind ( const EntityType &entity )
67
+ {
68
+ BaseType::bind(entity);
69
+ }
70
+
71
+ void unbind ()
72
+ {
73
+ BaseType::unbind();
74
+ }
75
+
76
+ template< class Point >
77
+ void evaluate ( const Point &x, typename FunctionSpaceType::RangeType &result ) const
78
+ {
79
+ double tmp0 = constant< 0 >();
80
+ result[ 0 ] = tmp0;
81
+ }
82
+
83
+ template< class Point >
84
+ void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
85
+ {
86
+ result=typename FunctionSpaceType::JacobianRangeType(0);
87
+ }
88
+
89
+ template< class Point >
90
+ void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
91
+ {
92
+ result=typename FunctionSpaceType::HessianRangeType(0);
93
+ }
94
+
95
+ template< std::size_t i >
96
+ const ConstantType< i > &constant () const
97
+ {
98
+ return *std::get< i >( constants_ );
99
+ }
100
+
101
+ template< std::size_t i >
102
+ ConstantType< i > &constant ()
103
+ {
104
+ return *std::get< i >( constants_ );
105
+ }
106
+
107
+ const Conc1 &conc1 () const
108
+ {
109
+ return *std::get< 0 >( constants_ );
110
+ }
111
+
112
+ Conc1 &conc1 ()
113
+ {
114
+ return *std::get< 0 >( constants_ );
115
+ }
116
+ ConstantTupleType constants_;
117
+ std::tuple< > coefficients_;
118
+ };
119
+
120
+ } // namespace UFLLocalFunctions_f4b1d42cbb447375f39ed834570cd3f0
121
+
122
+ PYBIND11_MODULE( localfunction_f4b1d42cbb447375f39ed834570cd3f0_a524c1196983e65de1c06d7d6afdeb44, module )
123
+ {
124
+ typedef UFLLocalFunctions_f4b1d42cbb447375f39ed834570cd3f0::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > > LocalFunctionType;
125
+ if constexpr( LocalFunctionType::gridPartValid )
126
+ {
127
+ auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_f4b1d42cbb447375f39ed834570cd3f0::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_f4b1d42cbb447375f39ed834570cd3f0_a524c1196983e65de1c06d7d6afdeb44.cc"})).first;
128
+ Dune::FemPy::registerUFLLocalFunction( module, cls );
129
+ cls.def( pybind11::init( [] ( pybind11::object gridView, const std::string &name, int order ) {return new LocalFunctionType( Dune::FemPy::gridPart<Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true >>(gridView),name,order); } ), pybind11::keep_alive< 1, 2 >() );
130
+ cls.def_property( "c1", [] ( LocalFunctionType &self ) -> UFLLocalFunctions_f4b1d42cbb447375f39ed834570cd3f0::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > >::Conc1 { return self.conc1(); }, [] ( LocalFunctionType &self, const UFLLocalFunctions_f4b1d42cbb447375f39ed834570cd3f0::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > > >::Conc1 &v ) { self.conc1() = v; } );
131
+ cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
132
+ }
133
+ }
134
+
135
+ #endif
@@ -0,0 +1,294 @@
1
+ #ifndef GUARD_f626cd43dc8558135fe0b32cde016644
2
+ #define GUARD_f626cd43dc8558135fe0b32cde016644
3
+
4
+ #define USING_DUNE_PYTHON 1
5
+ #include <config.h>
6
+ #include <dune/alugrid/dgf.hh>
7
+ #include <dune/alugrid/grid.hh>
8
+ #include <dune/fem/gridpart/adaptiveleafgridpart.hh>
9
+ #include <dune/fem/gridpart/filter/simple.hh>
10
+ #include <dune/fem/gridpart/filteredgridpart.hh>
11
+ #include <dune/fempy/py/gridview.hh>
12
+ #include <dune/python/grid/gridview.hh>
13
+ #include <dune/python/grid/hierarchical.hh>
14
+ #include <dune/fem/function/localfunction/bindable.hh>
15
+ #include <dune/fem/common/intersectionside.hh>
16
+ #include <dune/python/pybind11/pybind11.h>
17
+ #include <dune/python/pybind11/extensions.h>
18
+ #include <dune/fempy/py/grid/gridpart.hh>
19
+ #include <dune/common/exceptions.hh>
20
+ #include <dune/fempy/function/virtualizedgridfunction.hh>
21
+ #include <dune/fempy/py/ufllocalfunction.hh>
22
+
23
+ namespace UFLLocalFunctions_f626cd43dc8558135fe0b32cde016644
24
+ {
25
+
26
+ // UFLLocalFunction
27
+ // ----------------
28
+
29
+ template< class GridPart, class Coeffddm >
30
+ struct UFLLocalFunction
31
+ : public Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>>
32
+ {
33
+ typedef GridPart GridPartType;
34
+ typedef typename GridPartType::GridViewType GridView;
35
+ typedef typename GridView::ctype ctype;
36
+ typedef Dune::Fem::BindableGridFunctionWithSpace<GridPart,Dune::Dim<1>> BaseType;
37
+ typedef Dune::Fem::GridFunctionSpace<GridPartType,Dune::Dim<1>> FunctionSpaceType;
38
+ typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
39
+ typedef typename GridPartType::IntersectionType IntersectionType;
40
+ typedef typename EntityType::Geometry Geometry;
41
+ typedef typename Geometry::GlobalCoordinate GlobalCoordinateType;
42
+ typedef Dune::Fem::IntersectionSide Side;
43
+ typedef std::tuple<> ConstantTupleType;
44
+ typedef std::tuple< Dune::Fem::GridFunctionSpace< GridPartType, Dune::FieldVector< double, 1 > > > CoefficientFunctionSpaceTupleType;
45
+ typedef std::tuple< Coeffddm > CoefficientTupleType;
46
+ template< std::size_t i >
47
+ using CoefficientFunctionSpaceType = std::tuple_element_t< i, CoefficientFunctionSpaceTupleType >;
48
+ template< std::size_t i >
49
+ using CoefficientRangeType = typename CoefficientFunctionSpaceType< i >::RangeType;
50
+ template< std::size_t i >
51
+ using CoefficientJacobianRangeType = typename CoefficientFunctionSpaceType< i >::JacobianRangeType;
52
+ static constexpr bool gridPartValid = Dune::Fem::checkGridPartValid<GridPartType,Dune::Fem::ConstLocalFunction<Coeffddm>>();
53
+ template< std::size_t i >
54
+ using CoefficientType = std::tuple_element_t< i, CoefficientTupleType >;
55
+ template< std::size_t i >
56
+ using ConstantType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
57
+ using BaseType::entity;
58
+ using BaseType::geometry;
59
+
60
+ UFLLocalFunction ( const GridPartType &gridPart, const std::string &name, int order, const Coeffddm &coeffddm, const Dune::Fem::ParameterReader &parameter = Dune::Fem::Parameter::container() )
61
+ : BaseType(gridPart,name,order),
62
+ coefficients_( Dune::Fem::ConstLocalFunction< Coeffddm >( coeffddm ) )
63
+ {}
64
+
65
+ void bind ( const IntersectionType &intersection, Side side )
66
+ {
67
+ BaseType::bind(intersection, side);
68
+ std::get< 0 >( coefficients_ ).bind( this->entity() );
69
+ }
70
+
71
+ void bind ( const EntityType &entity )
72
+ {
73
+ BaseType::bind(entity);
74
+ std::get< 0 >( coefficients_ ).bind( this->entity() );
75
+ }
76
+
77
+ void unbind ()
78
+ {
79
+ BaseType::unbind();
80
+ std::get< 0 >( coefficients_ ).unbind();
81
+ }
82
+
83
+ template< class Point >
84
+ void evaluate ( const Point &x, typename FunctionSpaceType::RangeType &result ) const
85
+ {
86
+ using std::max;
87
+ using std::min;
88
+ using std::sqrt;
89
+ GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
90
+ const auto tmp1 = tmp0[ 1 ] * tmp0[ 1 ];
91
+ const auto tmp2 = tmp0[ 0 ] * tmp0[ 0 ];
92
+ const auto tmp3 = tmp2 + tmp1;
93
+ const auto tmp4 = 1e-10 + tmp3;
94
+ const auto tmp5 = std::sqrt( tmp4 );
95
+ const auto tmp6 = -1.4 + tmp5;
96
+ const auto tmp7 = 1 + tmp0[ 0 ];
97
+ const auto tmp8 = tmp7 * tmp7;
98
+ const auto tmp9 = tmp1 + tmp8;
99
+ const auto tmp10 = 1e-10 + tmp9;
100
+ const auto tmp11 = std::sqrt( tmp10 );
101
+ const auto tmp12 = -0.5 + tmp11;
102
+ const auto tmp13 = -1 + tmp0[ 0 ];
103
+ const auto tmp14 = tmp13 * tmp13;
104
+ const auto tmp15 = tmp1 + tmp14;
105
+ const auto tmp16 = 1e-10 + tmp15;
106
+ const auto tmp17 = std::sqrt( tmp16 );
107
+ const auto tmp18 = -0.5 + tmp17;
108
+ const auto tmp19 = 0.8 + tmp0[ 1 ];
109
+ const auto tmp20 = tmp19 * tmp19;
110
+ const auto tmp21 = tmp2 + tmp20;
111
+ const auto tmp22 = 1e-10 + tmp21;
112
+ const auto tmp23 = std::sqrt( tmp22 );
113
+ const auto tmp24 = -0.5 + tmp23;
114
+ const auto tmp25 = -1 * tmp24;
115
+ const auto tmp26 = -0.8 + tmp0[ 1 ];
116
+ const auto tmp27 = tmp26 * tmp26;
117
+ const auto tmp28 = tmp2 + tmp27;
118
+ const auto tmp29 = 1e-10 + tmp28;
119
+ const auto tmp30 = std::sqrt( tmp29 );
120
+ const auto tmp31 = -0.5 + tmp30;
121
+ const auto tmp32 = -1 * tmp31;
122
+ const auto tmp33 = -1 + tmp5;
123
+ const auto tmp34 = std::max( tmp33, tmp32 );
124
+ const auto tmp35 = std::max( tmp34, tmp25 );
125
+ const auto tmp36 = std::min( tmp35, tmp18 );
126
+ const auto tmp37 = std::min( tmp36, tmp12 );
127
+ const auto tmp38 = std::max( tmp37, tmp6 );
128
+ typename CoefficientFunctionSpaceType< 0 >::RangeType tmp39 = evaluateCoefficient< 0 >( x );
129
+ const auto tmp40 = tmp39[ 0 ] * (tmp38 <= 0.0 ? 1 : 0.0);
130
+ result[ 0 ] = tmp40;
131
+ }
132
+
133
+ template< class Point >
134
+ void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
135
+ {
136
+ using std::max;
137
+ using std::min;
138
+ using std::sqrt;
139
+ GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
140
+ const auto tmp1 = tmp0[ 1 ] * tmp0[ 1 ];
141
+ const auto tmp2 = tmp0[ 0 ] * tmp0[ 0 ];
142
+ const auto tmp3 = tmp2 + tmp1;
143
+ const auto tmp4 = 1e-10 + tmp3;
144
+ const auto tmp5 = std::sqrt( tmp4 );
145
+ const auto tmp6 = -1.4 + tmp5;
146
+ const auto tmp7 = 1 + tmp0[ 0 ];
147
+ const auto tmp8 = tmp7 * tmp7;
148
+ const auto tmp9 = tmp1 + tmp8;
149
+ const auto tmp10 = 1e-10 + tmp9;
150
+ const auto tmp11 = std::sqrt( tmp10 );
151
+ const auto tmp12 = -0.5 + tmp11;
152
+ const auto tmp13 = -1 + tmp0[ 0 ];
153
+ const auto tmp14 = tmp13 * tmp13;
154
+ const auto tmp15 = tmp1 + tmp14;
155
+ const auto tmp16 = 1e-10 + tmp15;
156
+ const auto tmp17 = std::sqrt( tmp16 );
157
+ const auto tmp18 = -0.5 + tmp17;
158
+ const auto tmp19 = 0.8 + tmp0[ 1 ];
159
+ const auto tmp20 = tmp19 * tmp19;
160
+ const auto tmp21 = tmp2 + tmp20;
161
+ const auto tmp22 = 1e-10 + tmp21;
162
+ const auto tmp23 = std::sqrt( tmp22 );
163
+ const auto tmp24 = -0.5 + tmp23;
164
+ const auto tmp25 = -1 * tmp24;
165
+ const auto tmp26 = -0.8 + tmp0[ 1 ];
166
+ const auto tmp27 = tmp26 * tmp26;
167
+ const auto tmp28 = tmp2 + tmp27;
168
+ const auto tmp29 = 1e-10 + tmp28;
169
+ const auto tmp30 = std::sqrt( tmp29 );
170
+ const auto tmp31 = -0.5 + tmp30;
171
+ const auto tmp32 = -1 * tmp31;
172
+ const auto tmp33 = -1 + tmp5;
173
+ const auto tmp34 = std::max( tmp33, tmp32 );
174
+ const auto tmp35 = std::max( tmp34, tmp25 );
175
+ const auto tmp36 = std::min( tmp35, tmp18 );
176
+ const auto tmp37 = std::min( tmp36, tmp12 );
177
+ const auto tmp38 = std::max( tmp37, tmp6 );
178
+ typename CoefficientFunctionSpaceType< 0 >::JacobianRangeType tmp39 = jacobianCoefficient< 0 >( x );
179
+ const auto tmp40 = (tmp39[ 0 ])[ 0 ] * (tmp38 <= 0.0 ? 1 : 0.0);
180
+ const auto tmp41 = (tmp39[ 0 ])[ 1 ] * (tmp38 <= 0.0 ? 1 : 0.0);
181
+ (result[ 0 ])[ 0 ] = tmp40;
182
+ (result[ 0 ])[ 1 ] = tmp41;
183
+ }
184
+
185
+ template< class Point >
186
+ void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
187
+ {
188
+ using std::max;
189
+ using std::min;
190
+ using std::sqrt;
191
+ GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
192
+ const auto tmp1 = tmp0[ 1 ] * tmp0[ 1 ];
193
+ const auto tmp2 = tmp0[ 0 ] * tmp0[ 0 ];
194
+ const auto tmp3 = tmp2 + tmp1;
195
+ const auto tmp4 = 1e-10 + tmp3;
196
+ const auto tmp5 = std::sqrt( tmp4 );
197
+ const auto tmp6 = -1.4 + tmp5;
198
+ const auto tmp7 = 1 + tmp0[ 0 ];
199
+ const auto tmp8 = tmp7 * tmp7;
200
+ const auto tmp9 = tmp1 + tmp8;
201
+ const auto tmp10 = 1e-10 + tmp9;
202
+ const auto tmp11 = std::sqrt( tmp10 );
203
+ const auto tmp12 = -0.5 + tmp11;
204
+ const auto tmp13 = -1 + tmp0[ 0 ];
205
+ const auto tmp14 = tmp13 * tmp13;
206
+ const auto tmp15 = tmp1 + tmp14;
207
+ const auto tmp16 = 1e-10 + tmp15;
208
+ const auto tmp17 = std::sqrt( tmp16 );
209
+ const auto tmp18 = -0.5 + tmp17;
210
+ const auto tmp19 = 0.8 + tmp0[ 1 ];
211
+ const auto tmp20 = tmp19 * tmp19;
212
+ const auto tmp21 = tmp2 + tmp20;
213
+ const auto tmp22 = 1e-10 + tmp21;
214
+ const auto tmp23 = std::sqrt( tmp22 );
215
+ const auto tmp24 = -0.5 + tmp23;
216
+ const auto tmp25 = -1 * tmp24;
217
+ const auto tmp26 = -0.8 + tmp0[ 1 ];
218
+ const auto tmp27 = tmp26 * tmp26;
219
+ const auto tmp28 = tmp2 + tmp27;
220
+ const auto tmp29 = 1e-10 + tmp28;
221
+ const auto tmp30 = std::sqrt( tmp29 );
222
+ const auto tmp31 = -0.5 + tmp30;
223
+ const auto tmp32 = -1 * tmp31;
224
+ const auto tmp33 = -1 + tmp5;
225
+ const auto tmp34 = std::max( tmp33, tmp32 );
226
+ const auto tmp35 = std::max( tmp34, tmp25 );
227
+ const auto tmp36 = std::min( tmp35, tmp18 );
228
+ const auto tmp37 = std::min( tmp36, tmp12 );
229
+ const auto tmp38 = std::max( tmp37, tmp6 );
230
+ typename CoefficientFunctionSpaceType< 0 >::HessianRangeType tmp39 = hessianCoefficient< 0 >( x );
231
+ const auto tmp40 = ((tmp39[ 0 ])[ 0 ])[ 0 ] * (tmp38 <= 0.0 ? 1 : 0.0);
232
+ const auto tmp41 = ((tmp39[ 0 ])[ 0 ])[ 1 ] * (tmp38 <= 0.0 ? 1 : 0.0);
233
+ const auto tmp42 = ((tmp39[ 0 ])[ 1 ])[ 0 ] * (tmp38 <= 0.0 ? 1 : 0.0);
234
+ const auto tmp43 = ((tmp39[ 0 ])[ 1 ])[ 1 ] * (tmp38 <= 0.0 ? 1 : 0.0);
235
+ ((result[ 0 ])[ 0 ])[ 0 ] = tmp40;
236
+ ((result[ 0 ])[ 0 ])[ 1 ] = tmp41;
237
+ ((result[ 0 ])[ 1 ])[ 0 ] = tmp42;
238
+ ((result[ 0 ])[ 1 ])[ 1 ] = tmp43;
239
+ }
240
+
241
+ template< std::size_t i >
242
+ const ConstantType< i > &constant () const
243
+ {
244
+ return *std::get< i >( constants_ );
245
+ }
246
+
247
+ template< std::size_t i >
248
+ ConstantType< i > &constant ()
249
+ {
250
+ return *std::get< i >( constants_ );
251
+ }
252
+
253
+ template< std::size_t i, class Point >
254
+ typename CoefficientFunctionSpaceType< i >::RangeType evaluateCoefficient ( const Point &x ) const
255
+ {
256
+ typename CoefficientFunctionSpaceType< i >::RangeType result;
257
+ std::get< i >( coefficients_ ).evaluate( x, result );;
258
+ return result;
259
+ }
260
+
261
+ template< std::size_t i, class Point >
262
+ typename CoefficientFunctionSpaceType< i >::JacobianRangeType jacobianCoefficient ( const Point &x ) const
263
+ {
264
+ typename CoefficientFunctionSpaceType< i >::JacobianRangeType result;
265
+ std::get< i >( coefficients_ ).jacobian( x, result );;
266
+ return result;
267
+ }
268
+
269
+ template< std::size_t i, class Point >
270
+ typename CoefficientFunctionSpaceType< i >::HessianRangeType hessianCoefficient ( const Point &x ) const
271
+ {
272
+ typename CoefficientFunctionSpaceType< i >::HessianRangeType result;
273
+ std::get< i >( coefficients_ ).hessian( x, result );;
274
+ return result;
275
+ }
276
+ ConstantTupleType constants_;
277
+ std::tuple< Dune::Fem::ConstLocalFunction< Coeffddm > > coefficients_;
278
+ };
279
+
280
+ } // namespace UFLLocalFunctions_f626cd43dc8558135fe0b32cde016644
281
+
282
+ PYBIND11_MODULE( localfunction_f626cd43dc8558135fe0b32cde016644_a524c1196983e65de1c06d7d6afdeb44, module )
283
+ {
284
+ typedef UFLLocalFunctions_f626cd43dc8558135fe0b32cde016644::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > >, Dune::FemPy::VirtualizedGridFunction< Dune::FemPy::GridPart<Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true >>, Dune::FieldVector< double, 1 > > > LocalFunctionType;
285
+ if constexpr( LocalFunctionType::gridPartValid )
286
+ {
287
+ auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_f626cd43dc8558135fe0b32cde016644::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true > >, Dune::FemPy::VirtualizedGridFunction< Dune::FemPy::GridPart<Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true >>, Dune::FieldVector< double, 1 > > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_f626cd43dc8558135fe0b32cde016644_a524c1196983e65de1c06d7d6afdeb44.cc"})).first;
288
+ Dune::FemPy::registerUFLLocalFunction( module, cls );
289
+ cls.def( pybind11::init( [] ( pybind11::object gridView, const std::string &name, int order, const Dune::FemPy::VirtualizedGridFunction< Dune::FemPy::GridPart<Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true >>, Dune::FieldVector< double, 1 > > &coeffddm ) {return new LocalFunctionType( Dune::FemPy::gridPart<Dune::Fem::FilteredGridPart< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > >, Dune::Fem::SimpleFilter< Dune::FemPy::GridPart< Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > > > >, true >>(gridView),name,order, coeffddm); } ), pybind11::keep_alive< 1, 2 >(), pybind11::keep_alive< 1, 3 >() );
290
+ cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
291
+ }
292
+ }
293
+
294
+ #endif