Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions src/underworld3/checkpoint/disk_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import datetime
import json
import os
import warnings
from typing import Any, Optional

import numpy as np
Expand Down Expand Up @@ -311,12 +312,20 @@ def write_snapshot(model, path: str) -> str:
# path: lazy-allocated vars with _gvec == None have no data.
mesh_vars = [v for v in mesh_vars if v._gvec is not None]

mesh.write_checkpoint(
mesh_safe,
outputPath=bulk_dir,
meshVars=mesh_vars,
index=0,
)
# write_checkpoint is user-deprecated in favour of write_timestep, but
# the snapshot backend is a legitimate internal user: it relies on the
# `{base}.mesh.00000.h5` / `{base}.{var}.00000.h5` filename convention
# (consumed by the reload path below). Suppress the FutureWarning for
# this internal call rather than spam every snapshot. (Migrating the
# snapshot to write_timestep is tracked in #252.)
with warnings.catch_warnings():
warnings.simplefilter("ignore", FutureWarning)
mesh.write_checkpoint(
Comment on lines +321 to +323
mesh_safe,
outputPath=bulk_dir,
meshVars=mesh_vars,
index=0,
)

mesh_records.append({
"name": mesh.name,
Expand Down
1 change: 0 additions & 1 deletion src/underworld3/discretisation/discretisation_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -6039,7 +6039,6 @@ def checkpoint_xdmf(
)
numCells = cells.shape[0]
numCorners = cells.shape[1]
cellDim = topo["cells"].attrs["cell_dim"]
topology_precision = cells.dtype.itemsize

if numCorners <= 1:
Expand Down
Loading