ddfem 1.0.7__py3-none-any.whl → 1.0.9__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.
- ddfem/__main__.py +43 -7
- ddfem/data/2.11.dev20250709/boundary.modules +9 -0
- ddfem/data/2.11.dev20250709/femscheme_ddd4458a70dff1f9762ec5a96ca4ba9c.cc +43 -0
- ddfem/data/2.11.dev20250709/femspace_90f0a9524a8cb701e8ee5027b7658a0e_0faf32f13b591f4f60f83c591507b9be.cc +40 -0
- ddfem/data/2.11.dev20250709/geometry.modules +84 -0
- ddfem/data/2.11.dev20250709/hierarchicalgrid_966e2a5c8356c5b278ccd3acad180f0a.cc +30 -0
- ddfem/data/{2.11.dev20250326/integrands_c7ee79ef352597693466ebc895f89b17v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → 2.11.dev20250709/integrands_2e5e6f48655bd358419554a0857f697bv1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
- ddfem/data/{2.11.dev20250326/integrands_35d2bd9aedbe0c70a7d3804f461aa3a2v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → 2.11.dev20250709/integrands_563572f4cb20b041e8198ba7d5f88584v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
- ddfem/data/{2.11.dev20250326/integrands_8d076606b6431bd52818b74371b326fev1_3_a524c1196983e65de1c06d7d6afdeb44.cc → 2.11.dev20250709/integrands_5e1afa60a15644998389a84306246ea5v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
- ddfem/data/2.11.dev20250709/integrands_ed7208bd651abb351e34c9990e0313bcv1_3_a524c1196983e65de1c06d7d6afdeb44.cc +427 -0
- ddfem/data/{2.11.dev20250326/integrands_6da979bc28230b7c9b9703e3f1014016v1_3_a524c1196983e65de1c06d7d6afdeb44.cc → 2.11.dev20250709/integrands_f3ca00a2ef95c9a48de9ec1b807b1b30v1_3_a524c1196983e65de1c06d7d6afdeb44.cc} +8 -8
- ddfem/data/2.11.dev20250709/intro.modules +109 -0
- ddfem/data/2.11.dev20250709/localfunction_c5ebc4ae4b5d3bad6be770eb08c50d08_19659fe2f2f74bcfb5d532f1a0d38be9.cc +1131 -0
- ddfem/data/2.11.dev20250709/localfunction_e4557ecff74fe5b37313674e67db2782_a524c1196983e65de1c06d7d6afdeb44.cc +135 -0
- ddfem/data/{2.11.dev20250326/localfunction_e85b93fe9b8fcd40ee82782fc600b65b_a524c1196983e65de1c06d7d6afdeb44.cc → 2.11.dev20250709/localfunction_e69118a51208cfab8a028711e966e76c_19659fe2f2f74bcfb5d532f1a0d38be9.cc} +78 -89
- ddfem/data/2.11.dev20250709/localfunction_f4583c5cc10d24a8bdedf7510ce9da7b_a524c1196983e65de1c06d7d6afdeb44.cc +299 -0
- ddfem/data/2.11.dev20250709/localfunction_fc22d5adaf3b9563160dc2aec55e8ba1_19659fe2f2f74bcfb5d532f1a0d38be9.cc +113 -0
- ddfem/data/2.11.dev20250709/transformers.modules +13 -0
- ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/view_a524c1196983e65de1c06d7d6afdeb44.cc +1 -1
- ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/view_af122c1df944c95cd395ec0f91d0f970.cc +1 -1
- ddfem/data/2.11.dev20250709/yaspcoordinates_dim2_ctdouble.cc +55 -0
- ddfem/data/generate.py +5 -4
- ddfem/geometry/__init__.py +2 -0
- ddfem/plot.py +6 -3
- {ddfem-1.0.7.dist-info → ddfem-1.0.9.dist-info}/METADATA +12 -5
- {ddfem-1.0.7.dist-info → ddfem-1.0.9.dist-info}/RECORD +62 -60
- ddfem/data/2.11.dev20250326/localfunction_0cb4ca9e24e2891510640b0737aaab21_a524c1196983e65de1c06d7d6afdeb44.cc +0 -170
- ddfem/data/2.11.dev20250326/localfunction_0f7b2106478c5d2af781b1f377a180d2_a524c1196983e65de1c06d7d6afdeb44.cc +0 -393
- ddfem/data/2.11.dev20250326/localfunction_2021505441469e99dd3c9b164e083239_a524c1196983e65de1c06d7d6afdeb44.cc +0 -620
- ddfem/data/2.11.dev20250326/localfunction_2a97db5a6a479d02138a836cb0890cf2_a524c1196983e65de1c06d7d6afdeb44.cc +0 -173
- ddfem/data/2.11.dev20250326/localfunction_4484607e3f9bd9999dbd7bb9d595a7b2_a524c1196983e65de1c06d7d6afdeb44.cc +0 -173
- ddfem/data/2.11.dev20250326/localfunction_6363af791dde11d699a9a3d876cc5d9a_a524c1196983e65de1c06d7d6afdeb44.cc +0 -549
- ddfem/data/2.11.dev20250326/localfunction_65bda5736a84d4aa0ef2d48ebcc90ed5_a524c1196983e65de1c06d7d6afdeb44.cc +0 -173
- ddfem/data/2.11.dev20250326/localfunction_7d81d496538f240d504e5597484ee746_a524c1196983e65de1c06d7d6afdeb44.cc +0 -462
- ddfem/data/2.11.dev20250326/localfunction_a46a988b5d8571e80fd401a36d7341b7_a524c1196983e65de1c06d7d6afdeb44.cc +0 -170
- ddfem/data/2.11.dev20250326/localfunction_a9bb07439605d560b583608f20441342_a524c1196983e65de1c06d7d6afdeb44.cc +0 -173
- ddfem/data/2.11.dev20250326/localfunction_d0f33c2dc1ae0e619d85a7621c8e83a6_a524c1196983e65de1c06d7d6afdeb44.cc +0 -325
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/adapt_010e1455a389aa01992af42c0a3f4b14.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/femscheme_f2a3cb32a864b08c0236366e732fb908.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/femspace_4ff9049b6f297245e5d33296d14cd684_d5b136dbe3c5077b69c99b8c322eb563.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/hierarchicalgrid_d827e80243feae36e8b9006bb24207e7.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/indexset_e9c0cdc96a4fc702a0969c29910954e6.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/integrands_008eefa148b772fa3192dd3c1728c140v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/integrands_2339be3c67df1d67b18125c34ced69c2v1_3_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/integrands_3bde0abfafcf45a3cff4d1029568ab5cv1_3_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_00f2e5593eeb23f01906255d67244f6e_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_10ad0a2d88c74db5f4bf5f81e138974f_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_191355e6250b2d2e260d96f519ad9976_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_1d13146d4bff10e178aba773fe2a9f1d_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_1d27a90a52b9053192c9cc902283f79b_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_228c55d163ca194a905826bcc20fcbc0_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_3e323e81c52891c0ecb656eac273e52f_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_42ff56710f3bd510798ecabb32a6cbf0_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_42ff56710f3bd510798ecabb32a6cbf0_af122c1df944c95cd395ec0f91d0f970.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_82d7cb9338bf118426fac2abf41a91a4_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_83d9e6dd70d1c31c973224e210cc36b4_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_86a0670f34bf2ac8155423a1c1bc2e75_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_a854465b265a1a51dacb4f71f7eeb06b_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_a8c726f728cd35d137188b33301aeef1_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_ae8173bdb67b8ea50ce75c3912841100_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_aeb3d963412cdc65630e0a4c3c0dde0f_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_b8239bf849ec7c1903f627833e6dac5a_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_bcafb581216501f273e23c0e26cd57af_af122c1df944c95cd395ec0f91d0f970.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_bdfb7ddf42a423f7d0791458634d4b8f_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_d75993d7ae5919d23117b153e900840d_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_f4b1d42cbb447375f39ed834570cd3f0_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/localfunction_f626cd43dc8558135fe0b32cde016644_a524c1196983e65de1c06d7d6afdeb44.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/referenceelements_0fff57b283123cc055345ec95574c857.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/referenceelements_de274310a0055100b832a0e8892b0258.cc +0 -0
- /ddfem/data/{2.11.dev20250326 → 2.11.dev20250709}/referenceelements_f4457f35395151d83a965d4cf5fce70d.cc +0 -0
- {ddfem-1.0.7.dist-info → ddfem-1.0.9.dist-info}/WHEEL +0 -0
- {ddfem-1.0.7.dist-info → ddfem-1.0.9.dist-info}/licenses/LICENSE +0 -0
- {ddfem-1.0.7.dist-info → ddfem-1.0.9.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,299 @@
|
|
1
|
+
#ifndef GUARD_f4583c5cc10d24a8bdedf7510ce9da7b
|
2
|
+
#define GUARD_f4583c5cc10d24a8bdedf7510ce9da7b
|
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_f4583c5cc10d24a8bdedf7510ce9da7b
|
24
|
+
{
|
25
|
+
|
26
|
+
// UFLLocalFunction
|
27
|
+
// ----------------
|
28
|
+
|
29
|
+
template< class GridPart, class Coeffbndproj, class Coeffddm, class Coeffsdfprojfull, class Coeffphidomain >
|
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, 2 > >, Dune::Fem::GridFunctionSpace< GridPartType, Dune::FieldVector< double, 1 > >, Dune::Fem::GridFunctionSpace< GridPartType, Dune::FieldVector< double, 1 > >, Dune::Fem::GridFunctionSpace< GridPartType, Dune::FieldVector< double, 1 > > > CoefficientFunctionSpaceTupleType;
|
45
|
+
typedef std::tuple< Coeffbndproj, Coeffddm, Coeffsdfprojfull, Coeffphidomain > 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<Coeffbndproj>>() && Dune::Fem::checkGridPartValid<GridPartType,Dune::Fem::ConstLocalFunction<Coeffddm>>() && Dune::Fem::checkGridPartValid<GridPartType,Dune::Fem::ConstLocalFunction<Coeffsdfprojfull>>() && Dune::Fem::checkGridPartValid<GridPartType,Dune::Fem::ConstLocalFunction<Coeffphidomain>>();
|
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 Coeffbndproj &coeffbndproj, const Coeffddm &coeffddm, const Coeffsdfprojfull &coeffsdfprojfull, const Coeffphidomain &coeffphidomain, const Dune::Fem::ParameterReader ¶meter = Dune::Fem::Parameter::container() )
|
61
|
+
: BaseType(gridPart,name,order),
|
62
|
+
coefficients_( Dune::Fem::ConstLocalFunction< Coeffbndproj >( coeffbndproj ), Dune::Fem::ConstLocalFunction< Coeffddm >( coeffddm ), Dune::Fem::ConstLocalFunction< Coeffsdfprojfull >( coeffsdfprojfull ), Dune::Fem::ConstLocalFunction< Coeffphidomain >( coeffphidomain ) )
|
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
|
+
std::get< 1 >( coefficients_ ).bind( this->entity() );
|
70
|
+
std::get< 2 >( coefficients_ ).bind( this->entity() );
|
71
|
+
std::get< 3 >( coefficients_ ).bind( this->entity() );
|
72
|
+
}
|
73
|
+
|
74
|
+
void bind ( const EntityType &entity )
|
75
|
+
{
|
76
|
+
BaseType::bind(entity);
|
77
|
+
std::get< 0 >( coefficients_ ).bind( this->entity() );
|
78
|
+
std::get< 1 >( coefficients_ ).bind( this->entity() );
|
79
|
+
std::get< 2 >( coefficients_ ).bind( this->entity() );
|
80
|
+
std::get< 3 >( coefficients_ ).bind( this->entity() );
|
81
|
+
}
|
82
|
+
|
83
|
+
void unbind ()
|
84
|
+
{
|
85
|
+
BaseType::unbind();
|
86
|
+
std::get< 0 >( coefficients_ ).unbind();
|
87
|
+
std::get< 1 >( coefficients_ ).unbind();
|
88
|
+
std::get< 2 >( coefficients_ ).unbind();
|
89
|
+
std::get< 3 >( coefficients_ ).unbind();
|
90
|
+
}
|
91
|
+
|
92
|
+
template< class Point >
|
93
|
+
void evaluate ( const Point &x, typename FunctionSpaceType::RangeType &result ) const
|
94
|
+
{
|
95
|
+
using std::sin;
|
96
|
+
typename CoefficientFunctionSpaceType< 3 >::RangeType tmp0 = evaluateCoefficient< 3 >( x );
|
97
|
+
typename CoefficientFunctionSpaceType< 2 >::RangeType tmp1 = evaluateCoefficient< 2 >( x );
|
98
|
+
const auto tmp2 = 1e-10 + tmp1[ 0 ];
|
99
|
+
typename CoefficientFunctionSpaceType< 0 >::RangeType tmp3 = evaluateCoefficient< 0 >( x );
|
100
|
+
const auto tmp4 = 3.141592653589793 * tmp3[ 1 ];
|
101
|
+
const auto tmp5 = std::sin( tmp4 );
|
102
|
+
const auto tmp6 = 3.141592653589793 * tmp3[ 0 ];
|
103
|
+
const auto tmp7 = std::sin( tmp6 );
|
104
|
+
const auto tmp8 = tmp7 * tmp5;
|
105
|
+
const auto tmp9 = -1 * tmp8;
|
106
|
+
typename CoefficientFunctionSpaceType< 1 >::RangeType tmp10 = evaluateCoefficient< 1 >( x );
|
107
|
+
const auto tmp11 = tmp10[ 0 ] + tmp9;
|
108
|
+
const auto tmp12 = tmp1[ 0 ] * tmp11;
|
109
|
+
const auto tmp13 = tmp12 / tmp2;
|
110
|
+
typename CoefficientFunctionSpaceType< 3 >::JacobianRangeType tmp14 = jacobianCoefficient< 3 >( x );
|
111
|
+
const auto tmp15 = (tmp14[ 0 ])[ 1 ] * tmp13;
|
112
|
+
const auto tmp16 = tmp15 / tmp0[ 0 ];
|
113
|
+
typename CoefficientFunctionSpaceType< 1 >::JacobianRangeType tmp17 = jacobianCoefficient< 1 >( x );
|
114
|
+
const auto tmp18 = (tmp17[ 0 ])[ 1 ] + tmp16;
|
115
|
+
const auto tmp19 = tmp18 * tmp18;
|
116
|
+
const auto tmp20 = (tmp14[ 0 ])[ 0 ] * tmp13;
|
117
|
+
const auto tmp21 = tmp20 / tmp0[ 0 ];
|
118
|
+
const auto tmp22 = (tmp17[ 0 ])[ 0 ] + tmp21;
|
119
|
+
const auto tmp23 = tmp22 * tmp22;
|
120
|
+
const auto tmp24 = tmp23 + tmp19;
|
121
|
+
result[ 0 ] = tmp24;
|
122
|
+
}
|
123
|
+
|
124
|
+
template< class Point >
|
125
|
+
void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
|
126
|
+
{
|
127
|
+
using std::cos;
|
128
|
+
using std::sin;
|
129
|
+
typename CoefficientFunctionSpaceType< 3 >::RangeType tmp0 = evaluateCoefficient< 3 >( x );
|
130
|
+
typename CoefficientFunctionSpaceType< 2 >::RangeType tmp1 = evaluateCoefficient< 2 >( x );
|
131
|
+
const auto tmp2 = 1e-10 + tmp1[ 0 ];
|
132
|
+
typename CoefficientFunctionSpaceType< 0 >::RangeType tmp3 = evaluateCoefficient< 0 >( x );
|
133
|
+
const auto tmp4 = 3.141592653589793 * tmp3[ 1 ];
|
134
|
+
const auto tmp5 = std::sin( tmp4 );
|
135
|
+
const auto tmp6 = 3.141592653589793 * tmp3[ 0 ];
|
136
|
+
const auto tmp7 = std::sin( tmp6 );
|
137
|
+
const auto tmp8 = tmp7 * tmp5;
|
138
|
+
const auto tmp9 = -1 * tmp8;
|
139
|
+
typename CoefficientFunctionSpaceType< 1 >::RangeType tmp10 = evaluateCoefficient< 1 >( x );
|
140
|
+
const auto tmp11 = tmp10[ 0 ] + tmp9;
|
141
|
+
const auto tmp12 = tmp1[ 0 ] * tmp11;
|
142
|
+
const auto tmp13 = tmp12 / tmp2;
|
143
|
+
typename CoefficientFunctionSpaceType< 3 >::JacobianRangeType tmp14 = jacobianCoefficient< 3 >( x );
|
144
|
+
const auto tmp15 = (tmp14[ 0 ])[ 1 ] * tmp13;
|
145
|
+
const auto tmp16 = tmp15 / tmp0[ 0 ];
|
146
|
+
typename CoefficientFunctionSpaceType< 1 >::JacobianRangeType tmp17 = jacobianCoefficient< 1 >( x );
|
147
|
+
const auto tmp18 = (tmp17[ 0 ])[ 1 ] + tmp16;
|
148
|
+
const auto tmp19 = (tmp14[ 0 ])[ 0 ] * tmp16;
|
149
|
+
const auto tmp20 = -1 * tmp19;
|
150
|
+
typename CoefficientFunctionSpaceType< 3 >::HessianRangeType tmp21 = hessianCoefficient< 3 >( x );
|
151
|
+
const auto tmp22 = ((tmp21[ 0 ])[ 1 ])[ 0 ] * tmp13;
|
152
|
+
typename CoefficientFunctionSpaceType< 2 >::JacobianRangeType tmp23 = jacobianCoefficient< 2 >( x );
|
153
|
+
const auto tmp24 = (tmp23[ 0 ])[ 0 ] * tmp13;
|
154
|
+
const auto tmp25 = -1 * tmp24;
|
155
|
+
const auto tmp26 = (tmp23[ 0 ])[ 0 ] * tmp11;
|
156
|
+
const auto tmp27 = std::cos( tmp6 );
|
157
|
+
typename CoefficientFunctionSpaceType< 0 >::JacobianRangeType tmp28 = jacobianCoefficient< 0 >( x );
|
158
|
+
const auto tmp29 = 3.141592653589793 * (tmp28[ 0 ])[ 0 ];
|
159
|
+
const auto tmp30 = tmp29 * tmp27;
|
160
|
+
const auto tmp31 = tmp30 * tmp5;
|
161
|
+
const auto tmp32 = std::cos( tmp4 );
|
162
|
+
const auto tmp33 = 3.141592653589793 * (tmp28[ 1 ])[ 0 ];
|
163
|
+
const auto tmp34 = tmp33 * tmp32;
|
164
|
+
const auto tmp35 = tmp34 * tmp7;
|
165
|
+
const auto tmp36 = tmp35 + tmp31;
|
166
|
+
const auto tmp37 = -1 * tmp36;
|
167
|
+
const auto tmp38 = (tmp17[ 0 ])[ 0 ] + tmp37;
|
168
|
+
const auto tmp39 = tmp1[ 0 ] * tmp38;
|
169
|
+
const auto tmp40 = tmp39 + tmp26;
|
170
|
+
const auto tmp41 = tmp40 + tmp25;
|
171
|
+
const auto tmp42 = tmp41 / tmp2;
|
172
|
+
const auto tmp43 = (tmp14[ 0 ])[ 1 ] * tmp42;
|
173
|
+
const auto tmp44 = tmp43 + tmp22;
|
174
|
+
const auto tmp45 = tmp44 + tmp20;
|
175
|
+
const auto tmp46 = tmp45 / tmp0[ 0 ];
|
176
|
+
typename CoefficientFunctionSpaceType< 1 >::HessianRangeType tmp47 = hessianCoefficient< 1 >( x );
|
177
|
+
const auto tmp48 = ((tmp47[ 0 ])[ 1 ])[ 0 ] + tmp46;
|
178
|
+
const auto tmp49 = tmp48 * tmp18;
|
179
|
+
const auto tmp50 = tmp18 * tmp48;
|
180
|
+
const auto tmp51 = tmp50 + tmp49;
|
181
|
+
const auto tmp52 = (tmp14[ 0 ])[ 0 ] * tmp13;
|
182
|
+
const auto tmp53 = tmp52 / tmp0[ 0 ];
|
183
|
+
const auto tmp54 = (tmp17[ 0 ])[ 0 ] + tmp53;
|
184
|
+
const auto tmp55 = (tmp14[ 0 ])[ 0 ] * tmp53;
|
185
|
+
const auto tmp56 = -1 * tmp55;
|
186
|
+
const auto tmp57 = ((tmp21[ 0 ])[ 0 ])[ 0 ] * tmp13;
|
187
|
+
const auto tmp58 = (tmp14[ 0 ])[ 0 ] * tmp42;
|
188
|
+
const auto tmp59 = tmp58 + tmp57;
|
189
|
+
const auto tmp60 = tmp59 + tmp56;
|
190
|
+
const auto tmp61 = tmp60 / tmp0[ 0 ];
|
191
|
+
const auto tmp62 = ((tmp47[ 0 ])[ 0 ])[ 0 ] + tmp61;
|
192
|
+
const auto tmp63 = tmp62 * tmp54;
|
193
|
+
const auto tmp64 = tmp54 * tmp62;
|
194
|
+
const auto tmp65 = tmp64 + tmp63;
|
195
|
+
const auto tmp66 = tmp65 + tmp51;
|
196
|
+
const auto tmp67 = (tmp14[ 0 ])[ 1 ] * tmp16;
|
197
|
+
const auto tmp68 = -1 * tmp67;
|
198
|
+
const auto tmp69 = ((tmp21[ 0 ])[ 1 ])[ 1 ] * tmp13;
|
199
|
+
const auto tmp70 = (tmp23[ 0 ])[ 1 ] * tmp13;
|
200
|
+
const auto tmp71 = -1 * tmp70;
|
201
|
+
const auto tmp72 = (tmp23[ 0 ])[ 1 ] * tmp11;
|
202
|
+
const auto tmp73 = 3.141592653589793 * (tmp28[ 0 ])[ 1 ];
|
203
|
+
const auto tmp74 = tmp73 * tmp27;
|
204
|
+
const auto tmp75 = tmp74 * tmp5;
|
205
|
+
const auto tmp76 = 3.141592653589793 * (tmp28[ 1 ])[ 1 ];
|
206
|
+
const auto tmp77 = tmp76 * tmp32;
|
207
|
+
const auto tmp78 = tmp77 * tmp7;
|
208
|
+
const auto tmp79 = tmp78 + tmp75;
|
209
|
+
const auto tmp80 = -1 * tmp79;
|
210
|
+
const auto tmp81 = (tmp17[ 0 ])[ 1 ] + tmp80;
|
211
|
+
const auto tmp82 = tmp1[ 0 ] * tmp81;
|
212
|
+
const auto tmp83 = tmp82 + tmp72;
|
213
|
+
const auto tmp84 = tmp83 + tmp71;
|
214
|
+
const auto tmp85 = tmp84 / tmp2;
|
215
|
+
const auto tmp86 = (tmp14[ 0 ])[ 1 ] * tmp85;
|
216
|
+
const auto tmp87 = tmp86 + tmp69;
|
217
|
+
const auto tmp88 = tmp87 + tmp68;
|
218
|
+
const auto tmp89 = tmp88 / tmp0[ 0 ];
|
219
|
+
const auto tmp90 = ((tmp47[ 0 ])[ 1 ])[ 1 ] + tmp89;
|
220
|
+
const auto tmp91 = tmp90 * tmp18;
|
221
|
+
const auto tmp92 = tmp18 * tmp90;
|
222
|
+
const auto tmp93 = tmp92 + tmp91;
|
223
|
+
const auto tmp94 = (tmp14[ 0 ])[ 1 ] * tmp53;
|
224
|
+
const auto tmp95 = -1 * tmp94;
|
225
|
+
const auto tmp96 = ((tmp21[ 0 ])[ 0 ])[ 1 ] * tmp13;
|
226
|
+
const auto tmp97 = (tmp14[ 0 ])[ 0 ] * tmp85;
|
227
|
+
const auto tmp98 = tmp97 + tmp96;
|
228
|
+
const auto tmp99 = tmp98 + tmp95;
|
229
|
+
const auto tmp100 = tmp99 / tmp0[ 0 ];
|
230
|
+
const auto tmp101 = ((tmp47[ 0 ])[ 0 ])[ 1 ] + tmp100;
|
231
|
+
const auto tmp102 = tmp101 * tmp54;
|
232
|
+
const auto tmp103 = tmp54 * tmp101;
|
233
|
+
const auto tmp104 = tmp103 + tmp102;
|
234
|
+
const auto tmp105 = tmp104 + tmp93;
|
235
|
+
(result[ 0 ])[ 0 ] = tmp66;
|
236
|
+
(result[ 0 ])[ 1 ] = tmp105;
|
237
|
+
}
|
238
|
+
|
239
|
+
template< class Point >
|
240
|
+
void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
|
241
|
+
{
|
242
|
+
DUNE_THROW(Dune::NotImplemented,"hessian method could not be generated for local function (TooHighDerivative('CodeGenerator does not allow for third order derivatives, yet.'))");
|
243
|
+
result=typename FunctionSpaceType::HessianRangeType(0);
|
244
|
+
}
|
245
|
+
|
246
|
+
template< std::size_t i >
|
247
|
+
const ConstantType< i > &constant () const
|
248
|
+
{
|
249
|
+
return *std::get< i >( constants_ );
|
250
|
+
}
|
251
|
+
|
252
|
+
template< std::size_t i >
|
253
|
+
ConstantType< i > &constant ()
|
254
|
+
{
|
255
|
+
return *std::get< i >( constants_ );
|
256
|
+
}
|
257
|
+
|
258
|
+
template< std::size_t i, class Point >
|
259
|
+
typename CoefficientFunctionSpaceType< i >::RangeType evaluateCoefficient ( const Point &x ) const
|
260
|
+
{
|
261
|
+
typename CoefficientFunctionSpaceType< i >::RangeType result;
|
262
|
+
std::get< i >( coefficients_ ).evaluate( x, result );;
|
263
|
+
return result;
|
264
|
+
}
|
265
|
+
|
266
|
+
template< std::size_t i, class Point >
|
267
|
+
typename CoefficientFunctionSpaceType< i >::JacobianRangeType jacobianCoefficient ( const Point &x ) const
|
268
|
+
{
|
269
|
+
typename CoefficientFunctionSpaceType< i >::JacobianRangeType result;
|
270
|
+
std::get< i >( coefficients_ ).jacobian( x, result );;
|
271
|
+
return result;
|
272
|
+
}
|
273
|
+
|
274
|
+
template< std::size_t i, class Point >
|
275
|
+
typename CoefficientFunctionSpaceType< i >::HessianRangeType hessianCoefficient ( const Point &x ) const
|
276
|
+
{
|
277
|
+
typename CoefficientFunctionSpaceType< i >::HessianRangeType result;
|
278
|
+
std::get< i >( coefficients_ ).hessian( x, result );;
|
279
|
+
return result;
|
280
|
+
}
|
281
|
+
ConstantTupleType constants_;
|
282
|
+
std::tuple< Dune::Fem::ConstLocalFunction< Coeffbndproj >, Dune::Fem::ConstLocalFunction< Coeffddm >, Dune::Fem::ConstLocalFunction< Coeffsdfprojfull >, Dune::Fem::ConstLocalFunction< Coeffphidomain > > coefficients_;
|
283
|
+
};
|
284
|
+
|
285
|
+
} // namespace UFLLocalFunctions_f4583c5cc10d24a8bdedf7510ce9da7b
|
286
|
+
|
287
|
+
PYBIND11_MODULE( localfunction_f4583c5cc10d24a8bdedf7510ce9da7b_a524c1196983e65de1c06d7d6afdeb44, module )
|
288
|
+
{
|
289
|
+
typedef UFLLocalFunctions_f4583c5cc10d24a8bdedf7510ce9da7b::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, 2 > >, 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::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::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;
|
290
|
+
if constexpr( LocalFunctionType::gridPartValid )
|
291
|
+
{
|
292
|
+
auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_f4583c5cc10d24a8bdedf7510ce9da7b::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, 2 > >, 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::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::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_f4583c5cc10d24a8bdedf7510ce9da7b_a524c1196983e65de1c06d7d6afdeb44.cc"})).first;
|
293
|
+
Dune::FemPy::registerUFLLocalFunction( module, cls );
|
294
|
+
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, 2 > > &coeffbndproj, 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, 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 > > &coeffsdfprojfull, 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 > > &coeffphidomain ) {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, coeffbndproj, coeffddm, coeffsdfprojfull, coeffphidomain); } ), pybind11::keep_alive< 1, 2 >(), pybind11::keep_alive< 1, 3 >(), pybind11::keep_alive< 1, 4 >(), pybind11::keep_alive< 1, 5 >(), pybind11::keep_alive< 1, 6 >() );
|
295
|
+
cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
|
296
|
+
}
|
297
|
+
}
|
298
|
+
|
299
|
+
#endif
|
@@ -0,0 +1,113 @@
|
|
1
|
+
#ifndef GUARD_fc22d5adaf3b9563160dc2aec55e8ba1
|
2
|
+
#define GUARD_fc22d5adaf3b9563160dc2aec55e8ba1
|
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_fc22d5adaf3b9563160dc2aec55e8ba1
|
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 ¶meter = 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
|
+
result[ 0 ] = 0.0;
|
70
|
+
}
|
71
|
+
|
72
|
+
template< class Point >
|
73
|
+
void jacobian ( const Point &x, typename FunctionSpaceType::JacobianRangeType &result ) const
|
74
|
+
{
|
75
|
+
result=typename FunctionSpaceType::JacobianRangeType(0);
|
76
|
+
}
|
77
|
+
|
78
|
+
template< class Point >
|
79
|
+
void hessian ( const Point &x, typename FunctionSpaceType::HessianRangeType &result ) const
|
80
|
+
{
|
81
|
+
result=typename FunctionSpaceType::HessianRangeType(0);
|
82
|
+
}
|
83
|
+
|
84
|
+
template< std::size_t i >
|
85
|
+
const ConstantType< i > &constant () const
|
86
|
+
{
|
87
|
+
return *std::get< i >( constants_ );
|
88
|
+
}
|
89
|
+
|
90
|
+
template< std::size_t i >
|
91
|
+
ConstantType< i > &constant ()
|
92
|
+
{
|
93
|
+
return *std::get< i >( constants_ );
|
94
|
+
}
|
95
|
+
ConstantTupleType constants_;
|
96
|
+
std::tuple< > coefficients_;
|
97
|
+
};
|
98
|
+
|
99
|
+
} // namespace UFLLocalFunctions_fc22d5adaf3b9563160dc2aec55e8ba1
|
100
|
+
|
101
|
+
PYBIND11_MODULE( localfunction_fc22d5adaf3b9563160dc2aec55e8ba1_19659fe2f2f74bcfb5d532f1a0d38be9, module )
|
102
|
+
{
|
103
|
+
typedef UFLLocalFunctions_fc22d5adaf3b9563160dc2aec55e8ba1::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > > LocalFunctionType;
|
104
|
+
if constexpr( LocalFunctionType::gridPartValid )
|
105
|
+
{
|
106
|
+
auto cls = Dune::Python::insertClass<LocalFunctionType>(module,"UFLLocalFunction",Dune::Python::GenerateTypeName("UFLLocalFunctions_fc22d5adaf3b9563160dc2aec55e8ba1::UFLLocalFunction< typename Dune::FemPy::GridPart< Dune::YaspGrid< 2, Dune::EquidistantOffsetCoordinates< double, 2 > >::LeafGridView > >"), Dune::Python::IncludeFiles({"python/dune/generated/localfunction_fc22d5adaf3b9563160dc2aec55e8ba1_19659fe2f2f74bcfb5d532f1a0d38be9.cc"})).first;
|
107
|
+
Dune::FemPy::registerUFLLocalFunction( module, cls );
|
108
|
+
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 >() );
|
109
|
+
cls.def_property_readonly( "virtualized", [] ( LocalFunctionType& ) -> bool { return true;});
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
#endif
|
@@ -0,0 +1,13 @@
|
|
1
|
+
hierarchicalgrid_d827e80243feae36e8b9006bb24207e7
|
2
|
+
referenceelements_de274310a0055100b832a0e8892b0258
|
3
|
+
referenceelements_0fff57b283123cc055345ec95574c857
|
4
|
+
referenceelements_f4457f35395151d83a965d4cf5fce70d
|
5
|
+
view_af122c1df944c95cd395ec0f91d0f970
|
6
|
+
view_a524c1196983e65de1c06d7d6afdeb44
|
7
|
+
femspace_4ff9049b6f297245e5d33296d14cd684_d5b136dbe3c5077b69c99b8c322eb563
|
8
|
+
integrands_00ee9b3b89e4e44212e5b7ad7948a24ev1_3_a524c1196983e65de1c06d7d6afdeb44
|
9
|
+
femscheme_f2a3cb32a864b08c0236366e732fb908
|
10
|
+
localfunction_aeb3d963412cdc65630e0a4c3c0dde0f_a524c1196983e65de1c06d7d6afdeb44
|
11
|
+
localfunction_191355e6250b2d2e260d96f519ad9976_a524c1196983e65de1c06d7d6afdeb44
|
12
|
+
localfunction_a854465b265a1a51dacb4f71f7eeb06b_a524c1196983e65de1c06d7d6afdeb44
|
13
|
+
localfunction_a854465b265a1a51dacb4f71f7eeb06b_a524c1196983e65de1c06d7d6afdeb44
|
@@ -24,7 +24,7 @@ PYBIND11_MODULE( view_a524c1196983e65de1c06d7d6afdeb44, module )
|
|
24
24
|
pybind11::module cls0 = module;
|
25
25
|
{
|
26
26
|
using DuneType = 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 >;
|
27
|
-
auto cls = Dune::Python::insertClass< DuneType >( cls0, "GridView", Dune::Python::GenerateTypeName("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{"dune/alugrid/dgf.hh","dune/alugrid/grid.hh","dune/fem/gridpart/adaptiveleafgridpart.hh","dune/fem/gridpart/filter/simple.hh","dune/fem/gridpart/filteredgridpart.hh","dune/fempy/py/gridview.hh","dune/python/grid/gridview.hh","dune/python/grid/hierarchical.hh"}).first;
|
27
|
+
auto cls = Dune::Python::insertClass< DuneType >( cls0, "GridView",pybind11::dynamic_attr(), Dune::Python::GenerateTypeName("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{"dune/alugrid/dgf.hh","dune/alugrid/grid.hh","dune/fem/gridpart/adaptiveleafgridpart.hh","dune/fem/gridpart/filter/simple.hh","dune/fem/gridpart/filteredgridpart.hh","dune/fempy/py/gridview.hh","dune/python/grid/gridview.hh","dune/python/grid/hierarchical.hh"}).first;
|
28
28
|
Dune::Python::registerGridView( cls0, cls );
|
29
29
|
|
30
30
|
Dune::FemPy::registerGridView ( cls );
|
@@ -22,7 +22,7 @@ PYBIND11_MODULE( view_af122c1df944c95cd395ec0f91d0f970, module )
|
|
22
22
|
pybind11::module cls0 = module;
|
23
23
|
{
|
24
24
|
using DuneType = Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > >;
|
25
|
-
auto cls = Dune::Python::insertClass< DuneType >( cls0, "GridView", Dune::Python::GenerateTypeName("Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > >"), Dune::Python::IncludeFiles{"dune/alugrid/dgf.hh","dune/alugrid/grid.hh","dune/fem/gridpart/adaptiveleafgridpart.hh","dune/fempy/py/gridview.hh","dune/python/grid/gridview.hh","dune/python/grid/hierarchical.hh"}).first;
|
25
|
+
auto cls = Dune::Python::insertClass< DuneType >( cls0, "GridView",pybind11::dynamic_attr(), Dune::Python::GenerateTypeName("Dune::Fem::AdaptiveLeafGridPart< Dune::ALUGrid< 2, 2, Dune::simplex > >"), Dune::Python::IncludeFiles{"dune/alugrid/dgf.hh","dune/alugrid/grid.hh","dune/fem/gridpart/adaptiveleafgridpart.hh","dune/fempy/py/gridview.hh","dune/python/grid/gridview.hh","dune/python/grid/hierarchical.hh"}).first;
|
26
26
|
Dune::Python::registerGridView( cls0, cls );
|
27
27
|
|
28
28
|
Dune::FemPy::registerGridView ( cls );
|
@@ -0,0 +1,55 @@
|
|
1
|
+
|
2
|
+
#include <dune/python/pybind11/pybind11.h>
|
3
|
+
#include <dune/python/pybind11/numpy.h>
|
4
|
+
#include <dune/python/pybind11/stl.h>
|
5
|
+
|
6
|
+
#include <dune/common/typelist.hh>
|
7
|
+
#include <dune/grid/yaspgrid/coordinates.hh>
|
8
|
+
|
9
|
+
#include <dune/python/common/typeregistry.hh>
|
10
|
+
#include <dune/python/common/fvector.hh>
|
11
|
+
|
12
|
+
using namespace Dune;
|
13
|
+
using namespace Dune::Python;
|
14
|
+
namespace py = pybind11;
|
15
|
+
|
16
|
+
template<typename T>
|
17
|
+
auto registerCoords(py::module module, std::string name)
|
18
|
+
{
|
19
|
+
auto includes = IncludeFiles{"dune/grid/yaspgrid/coordinates.hh"};
|
20
|
+
std::string nspace("Dune::");
|
21
|
+
auto typeName = GenerateTypeName(nspace+name, MetaType<double>(), "2");
|
22
|
+
auto cls = insertClass<T>(module, name, typeName, includes);
|
23
|
+
if (cls.second)
|
24
|
+
{
|
25
|
+
// cls.first.def("name", [name](const T & self)
|
26
|
+
cls.first.def_static("name", [name]() { return name; });
|
27
|
+
cls.first.def_property_readonly_static("typeName", [typeName](py::object) { return typeName.name(); });
|
28
|
+
cls.first.def_property_readonly_static("dimgrid", [](py::object) { return 2; });
|
29
|
+
cls.first.def_property_readonly_static("numpy_ctype", [](py::object) { return py::dtype::of<double>(); });
|
30
|
+
cls.first.def_property_readonly_static("ctype", [](py::object) { return "double"; });
|
31
|
+
}
|
32
|
+
return cls.first;
|
33
|
+
}
|
34
|
+
|
35
|
+
PYBIND11_MODULE(yaspcoordinates_dim2_ctdouble, module)
|
36
|
+
{
|
37
|
+
// make sure FieldVector is known to pybind11
|
38
|
+
addToTypeRegistry<double>(GenerateTypeName("double"));
|
39
|
+
registerFieldVector<double,2>(module);
|
40
|
+
|
41
|
+
// EquidistantCoordinates(const Dune::FieldVector<ct,dim>& upperRight, const std::array<int,dim>& s)
|
42
|
+
//py::class_<EquidistantCoordinates<double,2>>(module, "EquidistantCoordinates")
|
43
|
+
registerCoords<EquidistantCoordinates<double,2>>(module, "EquidistantCoordinates")
|
44
|
+
.def(py::init<Dune::FieldVector<double,2>, std::array<int,2>>());
|
45
|
+
|
46
|
+
// EquidistantOffsetCoordinates(const Dune::FieldVector<ct,dim>& lowerLeft, const Dune::FieldVector<ct,dim>& upperRight, const std::array<int,dim>& s)
|
47
|
+
registerCoords<EquidistantOffsetCoordinates<double,2>>(module, "EquidistantOffsetCoordinates")
|
48
|
+
.def(py::init<Dune::FieldVector<double,2>, Dune::FieldVector<double,2>, std::array<int,2>>());
|
49
|
+
//.def(py::init( [] (std::array<double,2>, std::array<double,2>, std::array<int,2>) { return static_cast<EquidistantOffsetCoordinates<double,2>*>(0); } ));
|
50
|
+
|
51
|
+
// TensorProductCoordinates(const std::array<std::vector<ct>,dim>& c, const std::array<int,dim>& offset)
|
52
|
+
registerCoords<TensorProductCoordinates<double,2>>(module, "TensorProductCoordinates")
|
53
|
+
.def(py::init<std::array<std::vector<double>,2>, std::array<int,2>>());
|
54
|
+
}
|
55
|
+
|
ddfem/data/generate.py
CHANGED
@@ -18,6 +18,10 @@ def main():
|
|
18
18
|
if not os.path.exists(docPath):
|
19
19
|
raise RuntimeError(f"folder {docPath} does not exist")
|
20
20
|
|
21
|
+
if os.path.exists(femVersion):
|
22
|
+
shutil.rmtree(femVersion)
|
23
|
+
os.makedirs(femVersion)
|
24
|
+
|
21
25
|
dunepy = getDunePyDir()
|
22
26
|
names = set()
|
23
27
|
for file in os.listdir(docPath):
|
@@ -25,10 +29,7 @@ def main():
|
|
25
29
|
if filename.endswith(".modules"):
|
26
30
|
with open(filename,"r") as f:
|
27
31
|
names.update(f.readlines())
|
28
|
-
|
29
|
-
if os.path.exists(femVersion):
|
30
|
-
shutil.rmtree(femVersion)
|
31
|
-
os.makedirs(femVersion)
|
32
|
+
shutil.copy(filename, femVersion)
|
32
33
|
|
33
34
|
for name in names:
|
34
35
|
name = name.strip()
|
ddfem/geometry/__init__.py
CHANGED
ddfem/plot.py
CHANGED
@@ -5,7 +5,7 @@ from ufl import SpatialCoordinate, triangle
|
|
5
5
|
|
6
6
|
def plotSolution(domain, uh, figsize, **kwargs):
|
7
7
|
x = SpatialCoordinate(triangle)
|
8
|
-
fig, axs = plt.subplots(1, 2, figsize=
|
8
|
+
fig, axs = plt.subplots(1, 2, figsize=figsize)
|
9
9
|
uh.plot(figure=(fig, axs[0]), **kwargs)
|
10
10
|
gridFunction(uh * domain.chi(x)).plot(figure=(fig, axs[1]), **kwargs)
|
11
11
|
for a in axs:
|
@@ -21,7 +21,7 @@ def plotSolution(domain, uh, figsize, **kwargs):
|
|
21
21
|
|
22
22
|
def plotSdfTree(SDF, gridView, figsize, maxDepth=None, **kwargs):
|
23
23
|
x = SpatialCoordinate(triangle)
|
24
|
-
fig, axs = plt.subplots(1, 2, figsize=
|
24
|
+
fig, axs = plt.subplots(1, 2, figsize=figsize)
|
25
25
|
|
26
26
|
gridFunction(SDF(x), gridView=gridView).plot(figure=(fig, axs[0]), **kwargs)
|
27
27
|
|
@@ -50,7 +50,10 @@ def plotSdfTree(SDF, gridView, figsize, maxDepth=None, **kwargs):
|
|
50
50
|
contourColor="white",
|
51
51
|
figure=(fig, axs[0]),
|
52
52
|
)
|
53
|
-
gridFunction(SDF.phi(x), gridView=gridView).plot(
|
53
|
+
gridFunction(SDF.phi(x), gridView=gridView).plot(
|
54
|
+
figure=(fig, axs[1]), cmap="coolwarm", **kwargs
|
55
|
+
)
|
56
|
+
|
54
57
|
|
55
58
|
def plotBndExt(domain, Model, uh, figsize, t=0, **kwargs):
|
56
59
|
from .boundary import BoundaryTerms
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ddfem
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.9
|
4
4
|
Summary: Diffuse domain finite element solver
|
5
5
|
Author-email: Luke Benfield <luke.benfield@warwick.ac.uk>, Andreas Dedner <a.s.dedner@warwick.ac.uk>
|
6
6
|
License-Expression: MIT
|
@@ -15,19 +15,26 @@ Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
16
16
|
Requires-Dist: fenics-ufl==2022.2.0
|
17
17
|
Requires-Dist: numpy
|
18
|
-
Requires-Dist: setuptools
|
18
|
+
Requires-Dist: setuptools<79.1
|
19
19
|
Provides-Extra: dune
|
20
|
-
Requires-Dist: dune-fem==2.11.
|
20
|
+
Requires-Dist: dune-fem==2.11.dev20250709; extra == "dune"
|
21
|
+
Requires-Dist: dune_alugrid==2.11.dev20250709; extra == "dune"
|
22
|
+
Requires-Dist: dune_common==2.11.dev20250709; extra == "dune"
|
23
|
+
Requires-Dist: dune_fem-dg==2.11.dev20250709; extra == "dune"
|
24
|
+
Requires-Dist: dune_geometry==2.11.dev20250709; extra == "dune"
|
25
|
+
Requires-Dist: dune_grid==2.11.dev20250709; extra == "dune"
|
26
|
+
Requires-Dist: dune_istl==2.11.dev20250709; extra == "dune"
|
27
|
+
Requires-Dist: dune_localfunctions==2.11.dev20250709; extra == "dune"
|
21
28
|
Requires-Dist: pygmsh; extra == "dune"
|
22
29
|
Provides-Extra: doc
|
23
|
-
Requires-Dist: dune-fem; extra == "doc"
|
24
|
-
Requires-Dist: pygmsh; extra == "doc"
|
25
30
|
Requires-Dist: jupyter; extra == "doc"
|
26
31
|
Requires-Dist: jupytext; extra == "doc"
|
27
32
|
Requires-Dist: nbsphinx; extra == "doc"
|
28
33
|
Requires-Dist: sphinx_rtd_theme; extra == "doc"
|
29
34
|
Requires-Dist: twine; extra == "doc"
|
30
35
|
Requires-Dist: build; extra == "doc"
|
36
|
+
Provides-Extra: dev
|
37
|
+
Requires-Dist: ddfem[doc,dune]; extra == "dev"
|
31
38
|
Dynamic: license-file
|
32
39
|
|
33
40
|
# Diffuse Domain Finite Element Methods
|