Added velocity to sws_ola
This commit is contained in:
parent
a335f2f5ce
commit
285b9476bc
2 changed files with 42 additions and 3 deletions
|
@ -25,6 +25,21 @@ class OFModel:
|
|||
)
|
||||
)
|
||||
|
||||
def write_vector_field(self, field, values):
|
||||
with open(self._root.joinpath("0", field), "r") as aw_file:
|
||||
aw_raw = aw_file.read()
|
||||
|
||||
with open(self._root.joinpath("0", field), "w") as aw_file:
|
||||
aw_file.write(
|
||||
re.sub(
|
||||
r"(?<=\(\n).*?(?=\n\))",
|
||||
"\n".join(map(lambda x: f"({' '.join(x.astype('str'))})", values)),
|
||||
aw_raw,
|
||||
count=1,
|
||||
flags=re.S,
|
||||
)
|
||||
)
|
||||
|
||||
@property
|
||||
def x(self):
|
||||
return self._x
|
||||
|
|
Reference in a new issue