foamlib 0.1.8__tar.gz → 0.1.10__tar.gz
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.
- {foamlib-0.1.8 → foamlib-0.1.10}/PKG-INFO +1 -1
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib/__init__.py +1 -1
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib/_dictionaries.py +19 -3
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib.egg-info/PKG-INFO +1 -1
- {foamlib-0.1.8 → foamlib-0.1.10}/tests/test_dictionaries.py +11 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/LICENSE.txt +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/README.md +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib/_cases.py +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib/_subprocesses.py +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib/py.typed +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib.egg-info/SOURCES.txt +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib.egg-info/dependency_links.txt +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib.egg-info/requires.txt +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/foamlib.egg-info/top_level.txt +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/pyproject.toml +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/setup.cfg +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/tests/test_basic.py +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/tests/test_flange.py +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/tests/test_flange_async.py +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/tests/test_pitz.py +0 -0
- {foamlib-0.1.8 → foamlib-0.1.10}/tests/test_pitz_async.py +0 -0
@@ -23,7 +23,18 @@ except ModuleNotFoundError:
|
|
23
23
|
else:
|
24
24
|
numpy = True
|
25
25
|
|
26
|
-
from pyparsing import
|
26
|
+
from pyparsing import (
|
27
|
+
Forward,
|
28
|
+
Group,
|
29
|
+
Keyword,
|
30
|
+
Literal,
|
31
|
+
Opt,
|
32
|
+
QuotedString,
|
33
|
+
Word,
|
34
|
+
common,
|
35
|
+
identchars,
|
36
|
+
identbodychars,
|
37
|
+
)
|
27
38
|
|
28
39
|
FoamDimensionSet = namedtuple(
|
29
40
|
"FoamDimensionSet",
|
@@ -66,6 +77,10 @@ A value that can be stored in an OpenFOAM dictionary.
|
|
66
77
|
|
67
78
|
_YES = Keyword("yes").set_parse_action(lambda s, loc, tks: True)
|
68
79
|
_NO = Keyword("no").set_parse_action(lambda s, loc, tks: False)
|
80
|
+
_WORDS = Word(identchars, identbodychars + "(),")[1, ...].set_parse_action(
|
81
|
+
lambda s, loc, tks: " ".join(tks)
|
82
|
+
)
|
83
|
+
_STRING = QuotedString('"', unquote_results=False)
|
69
84
|
_VALUE = Forward()
|
70
85
|
_LIST = Opt(
|
71
86
|
Literal("List") + Literal("<") + common.identifier + Literal(">")
|
@@ -73,7 +88,7 @@ _LIST = Opt(
|
|
73
88
|
(
|
74
89
|
Opt(common.integer).suppress()
|
75
90
|
+ Literal("(").suppress()
|
76
|
-
+ Group(
|
91
|
+
+ Group(_VALUE[...])
|
77
92
|
+ Literal(")").suppress()
|
78
93
|
)
|
79
94
|
| (
|
@@ -98,7 +113,8 @@ _VALUE << (
|
|
98
113
|
| common.number
|
99
114
|
| _YES
|
100
115
|
| _NO
|
101
|
-
|
|
116
|
+
| _WORDS
|
117
|
+
| _STRING
|
102
118
|
)
|
103
119
|
|
104
120
|
|
@@ -16,6 +16,9 @@ def test_parse() -> None:
|
|
16
16
|
assert _parse("1.0e-3") == 1.0e-3
|
17
17
|
assert _parse("yes") is True
|
18
18
|
assert _parse("no") is False
|
19
|
+
assert _parse("word") == "word"
|
20
|
+
assert _parse("word word") == "word word"
|
21
|
+
assert _parse('"a string"') == '"a string"'
|
19
22
|
assert _parse("uniform 1") == 1
|
20
23
|
assert _parse("uniform 1.0") == 1.0
|
21
24
|
assert _parse("uniform 1.0e-3") == 1.0e-3
|
@@ -162,3 +165,11 @@ def test_internal_field(pitz: FoamCase) -> None:
|
|
162
165
|
assert u == pytest.approx(u_arr)
|
163
166
|
|
164
167
|
pitz.run()
|
168
|
+
|
169
|
+
|
170
|
+
def test_fv_schemes(pitz: FoamCase) -> None:
|
171
|
+
div_schemes = pitz.fv_schemes["divSchemes"]
|
172
|
+
assert isinstance(div_schemes, FoamDictionary)
|
173
|
+
scheme = div_schemes["div(phi,U)"]
|
174
|
+
assert isinstance(scheme, str)
|
175
|
+
assert scheme == "bounded Gauss linearUpwind grad(U)"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|