ddfem 1.0.4__py3-none-any.whl → 1.0.7__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 (69) hide show
  1. ddfem/__init__.py +72 -0
  2. ddfem/__main__.py +43 -0
  3. ddfem/data/2.11.dev20250326/adapt_010e1455a389aa01992af42c0a3f4b14.cc +27 -0
  4. ddfem/data/2.11.dev20250326/femscheme_f2a3cb32a864b08c0236366e732fb908.cc +43 -0
  5. ddfem/data/2.11.dev20250326/femspace_4ff9049b6f297245e5d33296d14cd684_d5b136dbe3c5077b69c99b8c322eb563.cc +45 -0
  6. ddfem/data/2.11.dev20250326/hierarchicalgrid_d827e80243feae36e8b9006bb24207e7.cc +26 -0
  7. ddfem/data/2.11.dev20250326/indexset_e9c0cdc96a4fc702a0969c29910954e6.cc +32 -0
  8. ddfem/data/2.11.dev20250326/integrands_008eefa148b772fa3192dd3c1728c140v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +587 -0
  9. ddfem/data/2.11.dev20250326/integrands_2339be3c67df1d67b18125c34ced69c2v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +244 -0
  10. ddfem/data/2.11.dev20250326/integrands_35d2bd9aedbe0c70a7d3804f461aa3a2v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +533 -0
  11. ddfem/data/2.11.dev20250326/integrands_3bde0abfafcf45a3cff4d1029568ab5cv1_3_a524c1196983e65de1c06d7d6afdeb44.cc +409 -0
  12. ddfem/data/2.11.dev20250326/integrands_6da979bc28230b7c9b9703e3f1014016v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +453 -0
  13. ddfem/data/2.11.dev20250326/integrands_8d076606b6431bd52818b74371b326fev1_3_a524c1196983e65de1c06d7d6afdeb44.cc +453 -0
  14. ddfem/data/2.11.dev20250326/integrands_c7ee79ef352597693466ebc895f89b17v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +533 -0
  15. ddfem/data/2.11.dev20250326/localfunction_00f2e5593eeb23f01906255d67244f6e_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  16. ddfem/data/2.11.dev20250326/localfunction_0cb4ca9e24e2891510640b0737aaab21_a524c1196983e65de1c06d7d6afdeb44.cc +170 -0
  17. ddfem/data/2.11.dev20250326/localfunction_0f7b2106478c5d2af781b1f377a180d2_a524c1196983e65de1c06d7d6afdeb44.cc +393 -0
  18. ddfem/data/2.11.dev20250326/localfunction_10ad0a2d88c74db5f4bf5f81e138974f_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  19. ddfem/data/2.11.dev20250326/localfunction_191355e6250b2d2e260d96f519ad9976_a524c1196983e65de1c06d7d6afdeb44.cc +192 -0
  20. ddfem/data/2.11.dev20250326/localfunction_1d13146d4bff10e178aba773fe2a9f1d_a524c1196983e65de1c06d7d6afdeb44.cc +263 -0
  21. ddfem/data/2.11.dev20250326/localfunction_1d27a90a52b9053192c9cc902283f79b_a524c1196983e65de1c06d7d6afdeb44.cc +189 -0
  22. ddfem/data/2.11.dev20250326/localfunction_2021505441469e99dd3c9b164e083239_a524c1196983e65de1c06d7d6afdeb44.cc +620 -0
  23. ddfem/data/2.11.dev20250326/localfunction_228c55d163ca194a905826bcc20fcbc0_a524c1196983e65de1c06d7d6afdeb44.cc +903 -0
  24. ddfem/data/2.11.dev20250326/localfunction_2a97db5a6a479d02138a836cb0890cf2_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  25. ddfem/data/2.11.dev20250326/localfunction_3e323e81c52891c0ecb656eac273e52f_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  26. ddfem/data/2.11.dev20250326/localfunction_42ff56710f3bd510798ecabb32a6cbf0_a524c1196983e65de1c06d7d6afdeb44.cc +490 -0
  27. ddfem/data/2.11.dev20250326/localfunction_42ff56710f3bd510798ecabb32a6cbf0_af122c1df944c95cd395ec0f91d0f970.cc +488 -0
  28. ddfem/data/2.11.dev20250326/localfunction_4484607e3f9bd9999dbd7bb9d595a7b2_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  29. ddfem/data/2.11.dev20250326/localfunction_6363af791dde11d699a9a3d876cc5d9a_a524c1196983e65de1c06d7d6afdeb44.cc +549 -0
  30. ddfem/data/2.11.dev20250326/localfunction_65bda5736a84d4aa0ef2d48ebcc90ed5_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  31. ddfem/data/2.11.dev20250326/localfunction_7d81d496538f240d504e5597484ee746_a524c1196983e65de1c06d7d6afdeb44.cc +462 -0
  32. ddfem/data/2.11.dev20250326/localfunction_82d7cb9338bf118426fac2abf41a91a4_a524c1196983e65de1c06d7d6afdeb44.cc +386 -0
  33. ddfem/data/2.11.dev20250326/localfunction_83d9e6dd70d1c31c973224e210cc36b4_a524c1196983e65de1c06d7d6afdeb44.cc +647 -0
  34. ddfem/data/2.11.dev20250326/localfunction_86a0670f34bf2ac8155423a1c1bc2e75_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  35. ddfem/data/2.11.dev20250326/localfunction_a46a988b5d8571e80fd401a36d7341b7_a524c1196983e65de1c06d7d6afdeb44.cc +170 -0
  36. ddfem/data/2.11.dev20250326/localfunction_a854465b265a1a51dacb4f71f7eeb06b_a524c1196983e65de1c06d7d6afdeb44.cc +266 -0
  37. ddfem/data/2.11.dev20250326/localfunction_a8c726f728cd35d137188b33301aeef1_a524c1196983e65de1c06d7d6afdeb44.cc +176 -0
  38. ddfem/data/2.11.dev20250326/localfunction_a9bb07439605d560b583608f20441342_a524c1196983e65de1c06d7d6afdeb44.cc +173 -0
  39. ddfem/data/2.11.dev20250326/localfunction_ae8173bdb67b8ea50ce75c3912841100_a524c1196983e65de1c06d7d6afdeb44.cc +1290 -0
  40. ddfem/data/2.11.dev20250326/localfunction_aeb3d963412cdc65630e0a4c3c0dde0f_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  41. ddfem/data/2.11.dev20250326/localfunction_b8239bf849ec7c1903f627833e6dac5a_a524c1196983e65de1c06d7d6afdeb44.cc +1270 -0
  42. ddfem/data/2.11.dev20250326/localfunction_bcafb581216501f273e23c0e26cd57af_af122c1df944c95cd395ec0f91d0f970.cc +698 -0
  43. ddfem/data/2.11.dev20250326/localfunction_bdfb7ddf42a423f7d0791458634d4b8f_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  44. ddfem/data/2.11.dev20250326/localfunction_d0f33c2dc1ae0e619d85a7621c8e83a6_a524c1196983e65de1c06d7d6afdeb44.cc +325 -0
  45. ddfem/data/2.11.dev20250326/localfunction_d75993d7ae5919d23117b153e900840d_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  46. ddfem/data/2.11.dev20250326/localfunction_e85b93fe9b8fcd40ee82782fc600b65b_a524c1196983e65de1c06d7d6afdeb44.cc +247 -0
  47. ddfem/data/2.11.dev20250326/localfunction_f4b1d42cbb447375f39ed834570cd3f0_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
  48. ddfem/data/2.11.dev20250326/localfunction_f626cd43dc8558135fe0b32cde016644_a524c1196983e65de1c06d7d6afdeb44.cc +294 -0
  49. ddfem/data/2.11.dev20250326/referenceelements_0fff57b283123cc055345ec95574c857.cc +24 -0
  50. ddfem/data/2.11.dev20250326/referenceelements_de274310a0055100b832a0e8892b0258.cc +24 -0
  51. ddfem/data/2.11.dev20250326/referenceelements_f4457f35395151d83a965d4cf5fce70d.cc +24 -0
  52. ddfem/data/2.11.dev20250326/view_a524c1196983e65de1c06d7d6afdeb44.cc +39 -0
  53. ddfem/data/2.11.dev20250326/view_af122c1df944c95cd395ec0f91d0f970.cc +62 -0
  54. ddfem/data/generate.py +44 -0
  55. ddfem/examples/beam.py +2 -2
  56. ddfem/examples/five_circle_flat.py +18 -37
  57. ddfem/examples/single_circle.py +1 -1
  58. ddfem/examples/triple_circle.py +2 -2
  59. ddfem/examples/triple_circle_beam.py +2 -2
  60. ddfem/geometry/domain.py +1 -1
  61. ddfem/geometry/domain_dune.py +46 -28
  62. ddfem/geometry/primitive_base.py +11 -6
  63. ddfem/plot.py +67 -7
  64. {ddfem-1.0.4.dist-info → ddfem-1.0.7.dist-info}/METADATA +12 -3
  65. ddfem-1.0.7.dist-info/RECORD +94 -0
  66. ddfem-1.0.4.dist-info/RECORD +0 -41
  67. {ddfem-1.0.4.dist-info → ddfem-1.0.7.dist-info}/WHEEL +0 -0
  68. {ddfem-1.0.4.dist-info → ddfem-1.0.7.dist-info}/licenses/LICENSE +0 -0
  69. {ddfem-1.0.4.dist-info → ddfem-1.0.7.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,244 @@
1
+ #ifndef GuardIntegrands_2339be3c67df1d67b18125c34ced69c2v1_3
2
+ #define GuardIntegrands_2339be3c67df1d67b18125c34ced69c2v1_3
3
+ #define USING_DUNE_PYTHON 1
4
+ #include <config.h>
5
+ #include <dune/alugrid/dgf.hh>
6
+ #include <dune/alugrid/grid.hh>
7
+ #include <dune/fem/gridpart/adaptiveleafgridpart.hh>
8
+ #include <dune/fem/gridpart/filter/simple.hh>
9
+ #include <dune/fem/gridpart/filteredgridpart.hh>
10
+ #include <dune/fempy/py/gridview.hh>
11
+ #include <dune/python/grid/gridview.hh>
12
+ #include <dune/python/grid/hierarchical.hh>
13
+ #include <tuple>
14
+ #include <dune/python/pybind11/pybind11.h>
15
+ #include <dune/python/pybind11/extensions.h>
16
+ #include <dune/fempy/py/grid/gridpart.hh>
17
+ #include <dune/fempy/geometry/edgelength.hh>
18
+ #include <dune/fempy/py/integrands.hh>
19
+
20
+ namespace Integrands_2339be3c67df1d67b18125c34ced69c2v1_3
21
+ {
22
+
23
+
24
+
25
+
26
+ // Integrands
27
+ // ----------
28
+
29
+ template< class GridPart >
30
+ struct Integrands
31
+ {
32
+ typedef GridPart GridPartType;
33
+ typedef typename GridPartType::GridViewType GridView;
34
+ typedef typename GridView::ctype ctype;
35
+ typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
36
+ typedef typename GridPartType::IntersectionType IntersectionType;
37
+ typedef typename EntityType::Geometry Geometry;
38
+ typedef typename Geometry::GlobalCoordinate GlobalCoordinateType;
39
+ typedef Dune::Fem::IntersectionSide Side;
40
+ typedef std::tuple<> ConstantTupleType;
41
+ typedef std::tuple<> CoefficientTupleType;
42
+ static constexpr bool gridPartValid = true;
43
+ template< std::size_t i >
44
+ using CoefficientType = std::tuple_element_t< i, CoefficientTupleType >;
45
+ template< std::size_t i >
46
+ using ConstantType = typename std::tuple_element_t< i, ConstantTupleType >::element_type;
47
+
48
+ Integrands ( const Dune::Fem::ParameterReader &parameter = Dune::Fem::Parameter::container() )
49
+ {}
50
+
51
+ bool init ( const EntityType &entity )
52
+ {
53
+ entity_ = entity;
54
+ geometry_.emplace( this->entity().geometry() );
55
+ return true;
56
+ }
57
+
58
+ void unbind ()
59
+ {}
60
+
61
+ bool init ( const IntersectionType &intersection )
62
+ {
63
+ intersection_ = intersection;
64
+ return (intersection.boundary() && init( intersection.inside() ));
65
+ }
66
+ typedef std::tuple< Dune::FieldVector< double, 1 >, Dune::FieldMatrix< double, 1, 2 > > DomainValueType;
67
+ typedef std::tuple< Dune::FieldVector< double, 1 >, Dune::FieldMatrix< double, 1, 2 > > RangeValueType;
68
+ static constexpr bool _nonlinear = false;
69
+
70
+ bool nonlinear () const
71
+ {
72
+ return _nonlinear;
73
+ }
74
+
75
+ template< class Point >
76
+ RangeValueType interior ( const Point &x, const DomainValueType &u ) const
77
+ {
78
+ const auto tmp0 = std::get< 0 >( u );
79
+ const auto tmp1 = 0.01 * tmp0[ 0 ];
80
+ const auto tmp2 = -1 * tmp1;
81
+ GlobalCoordinateType tmp3 = geometry().global( Dune::Fem::coordinate( x ) );
82
+ const auto tmp4 = tmp3[ 1 ] * tmp3[ 1 ];
83
+ const auto tmp5 = tmp3[ 0 ] * tmp3[ 0 ];
84
+ const auto tmp6 = tmp5 + tmp4;
85
+ const auto tmp7 = -1 * tmp6;
86
+ const auto tmp8 = 1 + tmp7;
87
+ const auto tmp9 = 0.1 * tmp8;
88
+ const auto tmp10 = tmp9 + tmp2;
89
+ const auto tmp11 = -1 * tmp10;
90
+ const auto tmp12 = 3 * tmp3[ 1 ];
91
+ const auto tmp13 = tmp0[ 0 ] * tmp12;
92
+ const auto tmp14 = -1 * tmp13;
93
+ const auto tmp15 = 0.05 * tmp6;
94
+ const auto tmp16 = -1 * tmp15;
95
+ const auto tmp17 = 0.1 + tmp16;
96
+ const auto tmp18 = std::get< 1 >( u );
97
+ const auto tmp19 = (tmp18[ 0 ])[ 0 ] * tmp17;
98
+ const auto tmp20 = tmp19 + tmp14;
99
+ const auto tmp21 = -1 * tmp3[ 0 ];
100
+ const auto tmp22 = 3 * tmp21;
101
+ const auto tmp23 = tmp0[ 0 ] * tmp22;
102
+ const auto tmp24 = -1 * tmp23;
103
+ const auto tmp25 = (tmp18[ 0 ])[ 1 ] * tmp17;
104
+ const auto tmp26 = tmp25 + tmp24;
105
+ return RangeValueType{ { tmp11 }, { { tmp20, tmp26 } } };
106
+ }
107
+
108
+ template< class Point >
109
+ auto linearizedInterior ( const Point &x, const DomainValueType &u ) const
110
+ {
111
+ GlobalCoordinateType tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
112
+ const auto tmp1 = 3 * tmp0[ 1 ];
113
+ const auto tmp2 = -1 * tmp1;
114
+ const auto tmp3 = -1 * tmp0[ 0 ];
115
+ const auto tmp4 = 3 * tmp3;
116
+ const auto tmp5 = -1 * tmp4;
117
+ const auto tmp6 = tmp0[ 1 ] * tmp0[ 1 ];
118
+ const auto tmp7 = tmp0[ 0 ] * tmp0[ 0 ];
119
+ const auto tmp8 = tmp7 + tmp6;
120
+ const auto tmp9 = 0.05 * tmp8;
121
+ const auto tmp10 = -1 * tmp9;
122
+ const auto tmp11 = 0.1 + tmp10;
123
+ return [ tmp11, tmp2, tmp5 ] ( const DomainValueType &phi ) {
124
+ return RangeValueType{ { 0.01 * (std::get< 0 >( phi ))[ 0 ] }, { { tmp2 * (std::get< 0 >( phi ))[ 0 ] + tmp11 * ((std::get< 1 >( phi ))[ 0 ])[ 0 ], tmp5 * (std::get< 0 >( phi ))[ 0 ] + tmp11 * ((std::get< 1 >( phi ))[ 0 ])[ 1 ] } } };
125
+ };
126
+ }
127
+ typedef Dune::FieldVector< double, 1 > RRangeType;
128
+ typedef Dune::FieldMatrix< double, 1, GridPartType::dimension > RJacobianRangeType;
129
+ typedef Dune::Fem::BoundaryIdProvider< typename GridPartType::GridType > BoundaryIdProviderType;
130
+ typedef std::array<int,1> DirichletComponentType;
131
+
132
+ bool hasDirichletBoundary () const
133
+ {
134
+ return true;
135
+ }
136
+
137
+ bool isDirichletIntersection ( const IntersectionType &intersection, DirichletComponentType &dirichletComponent ) const
138
+ {
139
+ const int bndId = BoundaryIdProviderType::boundaryId( intersection );
140
+ {
141
+ std::fill( dirichletComponent.begin(), dirichletComponent.end(), bndId );
142
+ }
143
+ switch( bndId )
144
+ {
145
+ default:
146
+ {
147
+ {
148
+ std::fill( dirichletComponent.begin(), dirichletComponent.end(), 1 );
149
+ return true;
150
+ }
151
+ return false;
152
+ }
153
+ }
154
+ }
155
+
156
+ template< class Point >
157
+ void dirichlet ( int bndId, const Point &x, RRangeType &result ) const
158
+ {
159
+ switch( bndId )
160
+ {
161
+ default:
162
+ {
163
+ using std::sin;
164
+ auto tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
165
+ const auto tmp1 = 3.141592653589793 * tmp0[ 1 ];
166
+ const auto tmp2 = std::sin( tmp1 );
167
+ const auto tmp3 = 3.141592653589793 * tmp0[ 0 ];
168
+ const auto tmp4 = std::sin( tmp3 );
169
+ const auto tmp5 = tmp4 * tmp2;
170
+ result[ 0 ] = tmp5;
171
+ }
172
+ }
173
+ }
174
+
175
+ template< class Point >
176
+ void dDirichlet ( int bndId, const Point &x, RJacobianRangeType &result ) const
177
+ {
178
+ switch( bndId )
179
+ {
180
+ default:
181
+ {
182
+ using std::cos;
183
+ using std::sin;
184
+ auto tmp0 = geometry().global( Dune::Fem::coordinate( x ) );
185
+ const auto tmp1 = 3.141592653589793 * tmp0[ 1 ];
186
+ const auto tmp2 = std::sin( tmp1 );
187
+ const auto tmp3 = 3.141592653589793 * tmp0[ 0 ];
188
+ const auto tmp4 = std::cos( tmp3 );
189
+ const auto tmp5 = 3.141592653589793 * tmp4;
190
+ const auto tmp6 = tmp5 * tmp2;
191
+ const auto tmp7 = std::sin( tmp3 );
192
+ const auto tmp8 = std::cos( tmp1 );
193
+ const auto tmp9 = 3.141592653589793 * tmp8;
194
+ const auto tmp10 = tmp9 * tmp7;
195
+ (result[ 0 ])[ 0 ] = tmp6;
196
+ (result[ 0 ])[ 1 ] = tmp10;
197
+ }
198
+ }
199
+ }
200
+
201
+ template< std::size_t i >
202
+ const ConstantType< i > &constant () const
203
+ {
204
+ return *std::get< i >( constants_ );
205
+ }
206
+
207
+ template< std::size_t i >
208
+ ConstantType< i > &constant ()
209
+ {
210
+ return *std::get< i >( constants_ );
211
+ }
212
+
213
+ const EntityType &entity () const
214
+ {
215
+ return entity_;
216
+ }
217
+
218
+ const Geometry &geometry () const
219
+ {
220
+ return *geometry_;
221
+ }
222
+ EntityType entity_;
223
+ IntersectionType intersection_;
224
+ std::optional< Geometry > geometry_;
225
+ ConstantTupleType constants_;
226
+ std::tuple< > coefficients_;
227
+ };
228
+
229
+ } // namespace Integrands_2339be3c67df1d67b18125c34ced69c2v1_3
230
+
231
+ PYBIND11_MODULE( integrands_2339be3c67df1d67b18125c34ced69c2v1_3_a524c1196983e65de1c06d7d6afdeb44, module )
232
+ {
233
+ typedef 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 > > GridPart;
234
+ typedef Integrands_2339be3c67df1d67b18125c34ced69c2v1_3::Integrands< GridPart > Integrands;
235
+ if constexpr( Integrands::gridPartValid )
236
+ {
237
+ auto cls = Dune::Python::insertClass<Integrands>(module,"Integrands",Dune::Python::GenerateTypeName("Integrands_2339be3c67df1d67b18125c34ced69c2v1_3::Integrands< GridPart >"), Dune::Python::IncludeFiles({"python/dune/generated/integrands_2339be3c67df1d67b18125c34ced69c2v1_3_a524c1196983e65de1c06d7d6afdeb44.cc"})).first;
238
+ Dune::FemPy::registerIntegrands< Integrands >( module, cls );
239
+ cls.def( pybind11::init( [] () { return new Integrands(); } ) );
240
+ cls.def_property_readonly( "virtualized", [] ( Integrands& ) -> bool { return true;});
241
+ cls.def_property_readonly( "hasDirichletBoundary", [] ( Integrands& ) -> bool { return true;});
242
+ }
243
+ }
244
+ #endif // GuardIntegrands_2339be3c67df1d67b18125c34ced69c2v1_3