foamlib 0.1.8__tar.gz → 0.1.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foamlib
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: A Python interface for interacting with OpenFOAM
5
5
  Author-email: "Gabriel S. Gerlero" <ggerlero@cimec.unl.edu.ar>
6
6
  Project-URL: Homepage, https://github.com/gerlero/foamlib
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.8"
1
+ __version__ = "0.1.9"
2
2
 
3
3
  from ._cases import FoamCase, AsyncFoamCase, FoamTimeDirectory, FoamCaseBase
4
4
  from ._dictionaries import (
@@ -23,7 +23,19 @@ except ModuleNotFoundError:
23
23
  else:
24
24
  numpy = True
25
25
 
26
- from pyparsing import Group, Keyword, Opt, ZeroOrMore, Literal, Forward, common
26
+ from pyparsing import (
27
+ Forward,
28
+ Group,
29
+ Keyword,
30
+ Literal,
31
+ OneOrMore,
32
+ Opt,
33
+ Word,
34
+ ZeroOrMore,
35
+ common,
36
+ identchars,
37
+ identbodychars,
38
+ )
27
39
 
28
40
  FoamDimensionSet = namedtuple(
29
41
  "FoamDimensionSet",
@@ -66,6 +78,9 @@ A value that can be stored in an OpenFOAM dictionary.
66
78
 
67
79
  _YES = Keyword("yes").set_parse_action(lambda s, loc, tks: True)
68
80
  _NO = Keyword("no").set_parse_action(lambda s, loc, tks: False)
81
+ _WORDS = OneOrMore(Word(identchars, identbodychars + "(),")).set_parse_action(
82
+ lambda s, loc, tks: " ".join(tks)
83
+ )
69
84
  _VALUE = Forward()
70
85
  _LIST = Opt(
71
86
  Literal("List") + Literal("<") + common.identifier + Literal(">")
@@ -91,14 +106,7 @@ _DIMENSIONED = (common.identifier + _DIMENSIONS + _VALUE).set_parse_action(
91
106
  )
92
107
 
93
108
  _VALUE << (
94
- _FIELD
95
- | _LIST
96
- | _DIMENSIONED
97
- | _DIMENSIONS
98
- | common.number
99
- | _YES
100
- | _NO
101
- | common.identifier
109
+ _FIELD | _LIST | _DIMENSIONED | _DIMENSIONS | common.number | _YES | _NO | _WORDS
102
110
  )
103
111
 
104
112
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foamlib
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: A Python interface for interacting with OpenFOAM
5
5
  Author-email: "Gabriel S. Gerlero" <ggerlero@cimec.unl.edu.ar>
6
6
  Project-URL: Homepage, https://github.com/gerlero/foamlib
@@ -162,3 +162,11 @@ def test_internal_field(pitz: FoamCase) -> None:
162
162
  assert u == pytest.approx(u_arr)
163
163
 
164
164
  pitz.run()
165
+
166
+
167
+ def test_fv_schemes(pitz: FoamCase) -> None:
168
+ div_schemes = pitz.fv_schemes["divSchemes"]
169
+ assert isinstance(div_schemes, FoamDictionary)
170
+ scheme = div_schemes["div(phi,U)"]
171
+ assert isinstance(scheme, str)
172
+ 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