Skip to content

Commit 226a1f9

Browse files
committed
Update basic test, and new json interface
misc path misc
1 parent a6da4cf commit 226a1f9

7 files changed

Lines changed: 529 additions & 479 deletions

File tree

.clang-format

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
33
Language: Cpp
44
BasedOnStyle: LLVM
5-
# ColumnLimit: 80
6-
ColumnLimit: 0
7-
UseTab: ForContinuationAndIndentation
8-
IndentWidth: 4
5+
ColumnLimit: 80
6+
UseTab: Never
7+
IndentWidth: 2
98
TabWidth: 4
109
BreakBeforeBraces: Custom
1110
BraceWrapping:

cmake/recipes/polyfem.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include(FetchContent)
1111
FetchContent_Declare(
1212
polyfem
1313
GIT_REPOSITORY https://github.com/polyfem/polyfem.git
14-
GIT_TAG ea0e5cc25f2ffba64ea47225cf106460935cda5f
14+
GIT_TAG 12ac634833f91a3946cff26db01972fdb2ec3214
1515
GIT_SHALLOW FALSE
1616
)
1717
FetchContent_MakeAvailable(polyfem)

cmake/recipes/polyfem_data.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FetchContent_Declare(
99
GIT_REPOSITORY https://github.com/polyfem/polyfem-data
1010
GIT_TAG 29a46df1fd90c237a82c219f346a956e72bd17d3
1111
GIT_SHALLOW FALSE
12-
SOURCE_DIR ${POLYFEMPY_DATA_ROOT}/data
12+
SOURCE_DIR ${POLYFEMPY_DATA_ROOT}
1313
)
1414
FetchContent_GetProperties(polyfem_data)
1515
if(NOT polyfem_data_POPULATED)

polyfempy/Settings.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
2+
from logging import raiseExceptions
23
import polyfempy
3-
4+
import sys
45

56
class Settings:
67
"""Class that encodes the settings of the solver, it models the input json file"""
@@ -38,6 +39,7 @@ def __init__(self, discr_order=1, pressure_discr_order=1, pde=polyfempy.PDEs.Lap
3839
self.pde = pde
3940

4041
self.selection = None
42+
raise RuntimeError("Old Version Deprecated. Use version <0.5.2 on conda for the old interface")
4143

4244
def get_problem(self):
4345
"""Get the problem"""
@@ -141,7 +143,9 @@ def __str__(self):
141143
tmp["problem"] = self.problem
142144
tmp.update(self.advanced_options)
143145

144-
return json.dumps(tmp, sort_keys=True, indent=4)
146+
json_str = json.dumps(tmp, sort_keys=True, indent=4)
147+
148+
return json_str
145149

146150
def serialize(self):
147151
"""stringyfied json description of this class, used to run the solver"""

polyfempy/test/test_pythonic.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ def sideset(p):
3535
vertices=pts,
3636
cells=faces,
3737
sidesets_func=sideset,
38-
diriclet_bc=[{"id": 4, "value": [0, 0]}],
39-
materials=[{"id": 0, "E": 2100, "nu": 0.3}],
40-
rhs=[0, 0.1],
41-
discr_order=1
38+
boundary_conditions=dict(
39+
dirichlet_boundary=[dict(id=4, value=[0, 0])],
40+
rhs=[0, 0.1],
41+
),
42+
geometry="",
43+
materials=[dict(type="NeoHookean", id=0, E=2100, nu=0.3)],
44+
space=dict(discr_order=1),
4245
)
4346

4447
log = solver.get_log()

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def run(self):
2929
raise RuntimeError(
3030
"CMake must be installed to build the following extensions: , ".join(e.name for e in self.extensions))
3131

32-
# self.debug = True
32+
self.debug = True
3333

3434
cmake_version = LooseVersion(
3535
re.search(r'version\s*([\d.]+)', out.decode()).group(1))
@@ -78,7 +78,7 @@ def build_extension(self, ext):
7878
build_args += ['--', '-j{}'.format(n_threads)]
7979

8080
env = os.environ.copy()
81-
env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(
81+
env['CXXFLAGS'] = '{} -DVERSION_INFO=\"{}\"'.format(
8282
env.get('CXXFLAGS', ''), self.distribution.get_version())
8383

8484
if not os.path.exists(self.build_temp):
@@ -98,7 +98,7 @@ def build_extension(self, ext):
9898

9999
setup(
100100
name="polyfempy",
101-
version="0.6",
101+
version="0.7",
102102
author="Teseo Schneider",
103103
author_email="",
104104
description="Polyfem Python Bindings",

0 commit comments

Comments
 (0)