-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serafin.Write creates a ghosted frame #30
Comments
Hi Nicolas, The number of frames is not a variable included in the Serafin file, but it is computed from the file size and parameters (single vs double precision). I think Fudaa-PrePro is more permissive: it can open a non-valid file and can fix it. Indeed, your initial Serafin file The file cannot be opened in BlueKenue: I added (see 64e8fc8) a method to rebuild params tuple, but it is not sufficient. The file still can not be opened in BlueKenue for example (a problem in the mesh : X/Y/IKLE ?). I ran this script: import logging
import matplotlib.pyplot as plt
import numpy as np
from pyteltools.slf import Serafin
from pyteltools.slf.util import logger
logger.setLevel(logging.DEBUG)
with Serafin.Read("input.slf", "fr") as resin:
resin.read_header()
print("Initial params", resin.header.params)
output_header = resin.header.copy()
# output_header.date = (1900, 1, 1, 0, 0, 0)
output_header.build_params()
output_header.title = bytes("MAILLAGE", Serafin.SLF_EIT).ljust(72)
output_header.empty_variables()
output_header.add_variable_from_ID("B")
output_header.add_variable_from_ID("W")
print("New params", output_header.params)
output_values = np.ones(
(output_header.nb_var, output_header.nb_nodes), dtype=output_header.np_float_type
)
with Serafin.Write("pyteltools_out_2.slf", "fr", overwrite=True) as resout:
resout.write_header(output_header)
resout.write_entire_frame(output_header, 0.0, output_values)
plt.triplot(output_header.x, output_header.y, triangles=output_header.ikle - 1)
plt.show() Its output is:
The mesh elements are not optimized for an hydraulic computation code: EDIT: I propably misused triplot (it should be Can the attached file be opened with Fudaa-PrePro ? |
It can be opened in both Fudaa and BK but partel still crashes. I open pyteltools_out_2.slf in FUDAA, export, partel is happy Thank you to look into this.
|
Reading the input file: "maillage/pyteltools_out_2.slf" of size 813812 bytes
pyteltools_out_2 params (1, 0, 0, 0, 0, 0, 0, 26907, 0, 0)
pyteltools_out_2 ipobo [0 0 0 ... 0 0 0]
Reading the input file: "maillage/FUDAA_export2.ser" of size 1031988 bytes
The 2D variable name "X" is not known (lang=fr). The complete name will be used as ID
The 2D variable name "Y" is not known (lang=fr). The complete name will be used as ID
FUDAA_export2 params (1, 0, 0, 0, 0, 0, 0, 0, 0, 1)
FUDAA_export2 ipobo [124 123 125 ... 0 0 0] Indeed IPOBO is wrong |
Adding |
Maillage.zip
Here is 3 files:
Python script
Note
np.ones
"Error" when reading pyteltools_out.slf with FUDAA
Frame 0 with 1 everywhere
Frame 1 (???) with 0
It seems harmless.
If "pyteltools_out.slf" is set as GEOMETRY FILE and computation is run in parallel, partel fails to split the file.
Partel log
With "FUDAA_export.slf", partel is OK
The text was updated successfully, but these errors were encountered: