ddfem 1.0.1__py3-none-any.whl → 1.0.3__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/__init__.py +1 -0
- ddfem/boundary.py +0 -1
- ddfem/geometry/domain.py +3 -0
- ddfem/geometry/domain_dune.py +8 -5
- ddfem/model2ufl.py +1 -0
- ddfem/plot.py +13 -0
- {ddfem-1.0.1.dist-info → ddfem-1.0.3.dist-info}/METADATA +11 -4
- {ddfem-1.0.1.dist-info → ddfem-1.0.3.dist-info}/RECORD +11 -11
- ddfem/dune.py +0 -3
- {ddfem-1.0.1.dist-info → ddfem-1.0.3.dist-info}/WHEEL +0 -0
- {ddfem-1.0.1.dist-info → ddfem-1.0.3.dist-info}/licenses/LICENSE +0 -0
- {ddfem-1.0.1.dist-info → ddfem-1.0.3.dist-info}/top_level.txt +0 -0
ddfem/__init__.py
CHANGED
ddfem/boundary.py
CHANGED
ddfem/geometry/domain.py
CHANGED
ddfem/geometry/domain_dune.py
CHANGED
@@ -7,22 +7,25 @@ from .domain import Domain
|
|
7
7
|
|
8
8
|
|
9
9
|
class DomainDune(Domain):
|
10
|
-
def __init__(self, omega, x, gridView):
|
10
|
+
def __init__(self, omega, x, gridView, filterTolerance=0):
|
11
11
|
super().__init__(omega)
|
12
12
|
self.x = x
|
13
13
|
self.gridView = gridView
|
14
|
+
self.fullSDF = self.gridFunction(self.omega(self.x), name="full-sdf")
|
15
|
+
if filterTolerance>0:
|
16
|
+
self.gridView = self._filter(tolerance=filterTolerance)
|
17
|
+
self.fullSDF = self.gridFunction(self.omega(self.x), name="full-sdf")
|
14
18
|
|
15
19
|
self._phi = None
|
16
20
|
self._bndProj = None
|
17
21
|
self._extProj = None
|
18
22
|
self._bndProjSDFs = {}
|
19
23
|
|
20
|
-
self.fullSDF = self.gridFunction(self.omega(self.x), name="full-sdf")
|
21
24
|
|
22
25
|
def gridFunction(self, expr, name):
|
23
26
|
start_ = time.time()
|
24
27
|
gf = dune.fem.function.gridFunction(expr, name=name, gridView=self.gridView)
|
25
|
-
print(f"{name} setup: {time.time() - start_}")
|
28
|
+
# print(f"{name} setup: {time.time() - start_}")
|
26
29
|
return gf
|
27
30
|
|
28
31
|
def phi(self, x):
|
@@ -67,11 +70,11 @@ class DomainDune(Domain):
|
|
67
70
|
)
|
68
71
|
|
69
72
|
self.gridView.hierarchicalGrid.adapt(mark)
|
70
|
-
print(self.gridView.size(0))
|
73
|
+
# print(self.gridView.size(0))
|
71
74
|
lowerTol /= 2
|
72
75
|
upperTol /= 2
|
73
76
|
|
74
|
-
def _filter(self, tolerance
|
77
|
+
def _filter(self, tolerance):
|
75
78
|
sd = self.fullSDF
|
76
79
|
tol = tolerance # * self.epsilon.value: issue here with epsilon being a UFL expression due to CSG approach
|
77
80
|
phiFilter = (
|
ddfem/model2ufl.py
CHANGED
ddfem/plot.py
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
from matplotlib import pyplot as plt
|
2
|
+
from dune.fem.function import gridFunction
|
3
|
+
from ufl import SpatialCoordinate, triangle
|
4
|
+
|
5
|
+
def plotSolution(domain,uh,figsize, **kwargs):
|
6
|
+
x = SpatialCoordinate(triangle)
|
7
|
+
fig, axs = plt.subplots(1,2, figsize=[2*figsize[0],figsize[1]])
|
8
|
+
uh.plot(figure=(fig,axs[0]),**kwargs)
|
9
|
+
gridFunction(uh*domain.chi(x)).plot(figure=(fig,axs[1]),**kwargs)
|
10
|
+
for a in axs:
|
11
|
+
gridFunction(domain.phi(x), gridView=uh.space.gridView).plot(
|
12
|
+
onlyContours=True,contours=[0.5],gridLines=None,
|
13
|
+
contourWidth=2, contourColor="black", figure=(fig,a))
|
@@ -1,21 +1,28 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ddfem
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.3
|
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
|
7
|
-
Project-URL: Homepage, https
|
8
|
-
Project-URL: Issues, https
|
7
|
+
Project-URL: Homepage, https://gitlab.dune-project.org/dune-fem/ddfem
|
8
|
+
Project-URL: Issues, https://gitlab.dune-project.org/dune-fem/ddfem/-/issues
|
9
|
+
Project-URL: Documentation, https://ddfem.readthedocs.io/en/latest/index.html
|
10
|
+
Project-URL: Repository, https://gitlab.dune-project.org/dune-fem/ddfem.git
|
9
11
|
Classifier: Programming Language :: Python :: 3
|
10
12
|
Classifier: Operating System :: OS Independent
|
11
13
|
Requires-Python: >=3.9
|
12
14
|
Description-Content-Type: text/markdown
|
13
15
|
License-File: LICENSE
|
14
|
-
Requires-Dist: fenics-ufl
|
16
|
+
Requires-Dist: fenics-ufl==2022.2.0
|
15
17
|
Requires-Dist: numpy
|
18
|
+
Provides-Extra: dune
|
19
|
+
Requires-Dist: dune-fem; extra == "dune"
|
16
20
|
Dynamic: license-file
|
17
21
|
|
18
22
|
# Diffuse Domain Finite Element Methods
|
19
23
|
|
20
24
|
This is a package for solving complex PDEs based on the diffuse domain idea.
|
21
25
|
|
26
|
+
[Documentation][0]
|
27
|
+
|
28
|
+
[0]: https://ddfem.readthedocs.io/en/latest/index.html
|
@@ -1,7 +1,7 @@
|
|
1
|
-
ddfem/__init__.py,sha256=
|
2
|
-
ddfem/boundary.py,sha256=
|
3
|
-
ddfem/
|
4
|
-
ddfem/
|
1
|
+
ddfem/__init__.py,sha256=vQb-XOm3isbvckRLe_Zi7vcSwu1iWAZYAokP37kNk_M,137
|
2
|
+
ddfem/boundary.py,sha256=N3HGprdboCb3OIEYr_z-b7bvNnuyQjG47h-jPzU3XDg,7534
|
3
|
+
ddfem/model2ufl.py,sha256=DedK1xWQ7L8l71i259jtxgoTSkIoDKV4BV52PMasZQU,4323
|
4
|
+
ddfem/plot.py,sha256=eL9e8uhJrDHN44bJ5nzeXpKkTx-bL5MMzGU1Tm07Hoo,605
|
5
5
|
ddfem/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
ddfem/examples/advection_diffusion.py,sha256=9UPILICF3Sfh3SA7zJk6iDabXmvIa4GowJd62qaWOd8,2081
|
7
7
|
ddfem/examples/beam.py,sha256=awZvrgw92ANJgD1MGhhEVZ0eBsSNmhuwegpS8AHiiPk,4687
|
@@ -20,8 +20,8 @@ ddfem/geometry/__init__.py,sha256=ePmkipwfdhM88qrStE__n0VFKqvl8AKK4VjsAsivt4Y,29
|
|
20
20
|
ddfem/geometry/arc.py,sha256=ouK8gxkd2f8RtpAK33p6-zU5RoyMejxEge2IEcCOtR4,1381
|
21
21
|
ddfem/geometry/ball.py,sha256=Q_ped9ay3KypU8sKutAXPH9XkEFJx5hIK7qTCy1Y26E,679
|
22
22
|
ddfem/geometry/box.py,sha256=ecXUMI2a17-hZZyUXol08z7wk3IZn1yHE_CV9YIyR18,915
|
23
|
-
ddfem/geometry/domain.py,sha256=
|
24
|
-
ddfem/geometry/domain_dune.py,sha256=
|
23
|
+
ddfem/geometry/domain.py,sha256=9yZpJhWqDrQ6MuWXg6HjJRFntcNbwtgdIbKIulQD_kM,1419
|
24
|
+
ddfem/geometry/domain_dune.py,sha256=VbowbqLwUq04S27nIbz8SisHnEc15s08VCCivB27Wz8,2801
|
25
25
|
ddfem/geometry/helpers.py,sha256=kunsuciuJJwkcZgDn8A7wbKYSqIAYjdvhei_YfjvVtk,1049
|
26
26
|
ddfem/geometry/pie.py,sha256=WjgYPI6YvkcxPTQB1SjdN22dFQHV0X8kSO6QcXDLBSU,1003
|
27
27
|
ddfem/geometry/plane.py,sha256=hCRLa06yXfXzfms2JIbAusdPf5qFUy9DrjNDfZ-0TGA,500
|
@@ -34,8 +34,8 @@ ddfem/transformers/NNS.py,sha256=lGQVCd1x6KrzVyOEAIttaDXBFjP9nLBIj9wnp_fvYtg,341
|
|
34
34
|
ddfem/transformers/NS.py,sha256=fsih358oeayvmovhTAuddjbx7O0K_faF5qTAMQdHH8s,3612
|
35
35
|
ddfem/transformers/__init__.py,sha256=okno6aFZoIPaJRi_Nw7cM63jpy18rS2yHsSuG7Vb4Og,195
|
36
36
|
ddfem/transformers/transformer_base.py,sha256=Ey6iGk203lnzJOhLjMxyQNgKbclba_RIPpMW22OT7zQ,6347
|
37
|
-
ddfem-1.0.
|
38
|
-
ddfem-1.0.
|
39
|
-
ddfem-1.0.
|
40
|
-
ddfem-1.0.
|
41
|
-
ddfem-1.0.
|
37
|
+
ddfem-1.0.3.dist-info/licenses/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
38
|
+
ddfem-1.0.3.dist-info/METADATA,sha256=4eHMTzgnd6ot1UdcifO40Bs1-DLjo20WjWTUDo-uYnc,1037
|
39
|
+
ddfem-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
40
|
+
ddfem-1.0.3.dist-info/top_level.txt,sha256=LF2T9-5A2Bak81PqbCcsAex8d5Xrla2Wq8yrlQi-ZtY,6
|
41
|
+
ddfem-1.0.3.dist-info/RECORD,,
|
ddfem/dune.py
DELETED
File without changes
|
File without changes
|
File without changes
|