Skip to content

Commit 85d9554

Browse files
author
Teseo Schneider
committed
python module in the way
1 parent a7e3550 commit 85d9554

File tree

7 files changed

+43
-9
lines changed

7 files changed

+43
-9
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ copy_lib
77
__pycache__
88
*.obj
99
*.pyc
10-
*.vtu
10+
*.vtu
11+
*.egg-info
12+
*.so

cmake/PolyfemPythonDownloadExternal.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endfunction()
2727
function(polyfem_python_download_polyfem)
2828
polyfem_python_download_project(polyfem
2929
GIT_REPOSITORY https://github.com/polyfem/polyfem.git
30-
GIT_TAG e64626558a01ca639de5a901ff0027021ff4db70
30+
GIT_TAG e4382f43aed42f64452eba5d771c4aa33e17c9dc
3131
)
3232
endfunction()
3333

polyfempy/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from .polyfempy import Solver
2+
from .polyfempy import ScalarFormulations
3+
from .polyfempy import TensorFormulations
4+
5+
from .Settings import Settings
6+
7+
from .Problems import Franke
8+
from .Problems import GenericScalar
9+
from .Problems import Gravity
10+
from .Problems import Torsion
11+
from .Problems import GenericTensor
12+
from .Problems import Flow
13+
from .Problems import DrivenCavity

python/bending.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import polyfempy
2-
import Settings
3-
import Problems
1+
import polyfempy as pf
42

53

64

75
mesh_path = "/../3rdparty/data/square_beam.mesh"
86
tag_path = "../3rdparty/data/square_beam.txt"
97

10-
settings = Settings.Settings()
8+
settings = pf.Settings()
119
settings.discr_order = 1
1210
settings.normalize_mesh = False
1311

@@ -17,9 +15,9 @@
1715
settings.set_material_params("nu", 0.35)
1816

1917

20-
settings.tensor_formulation = polyfempy.TensorFormulations.LinearElasticity
18+
settings.tensor_formulation = pf.TensorFormulations.LinearElasticity
2119

22-
problem = Problems.GenericTensor()
20+
problem = pf.GenericTensor()
2321
problem.add_dirichlet_value(2, [0, 0, 0])
2422
problem.add_neumann_value(1,[0, -100, 0])
2523

@@ -29,7 +27,7 @@
2927
settings.set_problem(problem)
3028

3129

32-
solver = polyfempy.Solver()
30+
solver = pf.Solver()
3331

3432
solver.settings(settings.serialize())
3533
solver.load_mesh(mesh_path, tag_path)

setup.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import setuptools
2+
3+
with open("README.md", "r") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="polyfempy",
8+
version="0.0.1",
9+
author="Teseo Schneider",
10+
author_email="email@email.com",
11+
description="Polyfem Python Bindings",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://polyfem.github.io/",
15+
packages=setuptools.find_packages(),
16+
classifiers=[
17+
"Programming Language :: Python :: 3",
18+
"License :: OSI Approved :: MIT License",
19+
"Operating System :: OS Independent",
20+
],
21+
)

0 commit comments

Comments
 (0)