Skip to content

Commit 5ccf077

Browse files
committed
Sync some fix from latest PyTelTools commits
1a32c40: Fix mesh_origin to int + build_params a719ed1: Change params(8) header nb_el to 0
1 parent 6c99f28 commit 5ccf077

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

xarray_selafin/Serafin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class SerafinHeader:
120120
- nb_nodes_per_elem <int>: number of nodes per element (= 3 in 2D and 6 in 3D)
121121
- nb_nodes_2d <int>: number of 2D nodes (equals to `nb_nodes` in 2D)
122122
123-
- mesh_origin <(float, float)>: x and y shift to apply to written coordinates (set by `set_mesh_origin`)
123+
- mesh_origin <(int, int)>: x and y shift to apply to written coordinates (set by `set_mesh_origin`)
124124
- x_stored <numpy.1D-array>: east written coordinates [shape = nb_nodes]
125125
- y_stored <numpy.1D-array>: north written coordinates [shape = nb_nodes]
126126
- x <numpy.1D-array>: east coordinates [shape = nb_nodes] (set by `_compute_mesh_coordinates`)
@@ -177,7 +177,7 @@ def __init__(self, title="", format_type="SERAFIN ", lang=LANG, endian=">"):
177177
self.nb_nodes_per_elem = -1
178178
self.nb_nodes_2d = -1
179179

180-
self.mesh_origin = (0.0, 0.0)
180+
self.mesh_origin = (0, 0)
181181
self.x_stored = None
182182
self.y_stored = None
183183
self.x = None
@@ -240,11 +240,11 @@ def build_params(self):
240240
1,
241241
0,
242242
self.mesh_origin[0],
243-
self.mesh_origin[0],
243+
self.mesh_origin[1],
244244
0,
245245
0,
246246
self.nb_planes,
247-
self.nb_elements,
247+
0,
248248
0,
249249
1,
250250
)
@@ -803,6 +803,7 @@ def from_triangulation(self, nodes, ikle, ipobo=None):
803803
self._compute_mesh_coordinates()
804804
self.ikle = ikle.flatten()
805805
self._build_ikle_2d()
806+
self.build_params()
806807
if ipobo is None:
807808
self.build_ipobo()
808809
else:

0 commit comments

Comments
 (0)