你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Replace np.intc with more descriptive np.int32
这个提交包含在:
@@ -45,7 +45,7 @@ cpdef get_line_properties(
|
|||||||
material IDs for each line.
|
material IDs for each line.
|
||||||
"""
|
"""
|
||||||
cdef np.ndarray material_data = np.zeros(number_of_lines, dtype=np.uint32)
|
cdef np.ndarray material_data = np.zeros(number_of_lines, dtype=np.uint32)
|
||||||
cdef np.ndarray connectivity = np.zeros(2 * number_of_lines, dtype=np.intc)
|
cdef np.ndarray connectivity = np.zeros(2 * number_of_lines, dtype=np.int32)
|
||||||
cdef int line_index = 0
|
cdef int line_index = 0
|
||||||
cdef int connectivity_index = 0
|
cdef int connectivity_index = 0
|
||||||
cdef int point_id = 0
|
cdef int point_id = 0
|
||||||
|
@@ -101,9 +101,9 @@ class GeometryView(ABC):
|
|||||||
grid: FDTDGrid class describing a grid in a model.
|
grid: FDTDGrid class describing a grid in a model.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.start = np.array([xs, ys, zs], dtype=np.intc)
|
self.start = np.array([xs, ys, zs], dtype=np.int32)
|
||||||
self.stop = np.array([xf, yf, zf], dtype=np.intc)
|
self.stop = np.array([xf, yf, zf], dtype=np.int32)
|
||||||
self.step = np.array([dx, dy, dz], dtype=np.intc)
|
self.step = np.array([dx, dy, dz], dtype=np.int32)
|
||||||
self.size = (self.stop - self.start) // self.step
|
self.size = (self.stop - self.start) // self.step
|
||||||
|
|
||||||
self.filename = Path(filename)
|
self.filename = Path(filename)
|
||||||
@@ -224,7 +224,7 @@ class GeometryViewLines(GeometryView):
|
|||||||
n_lines = 3 * self.nx * self.ny * self.nz
|
n_lines = 3 * self.nx * self.ny * self.nz
|
||||||
|
|
||||||
self.cell_types = np.full(n_lines, VtkCellType.LINE)
|
self.cell_types = np.full(n_lines, VtkCellType.LINE)
|
||||||
self.cell_offsets = np.arange(0, 2 * n_lines + 2, 2, dtype=np.intc)
|
self.cell_offsets = np.arange(0, 2 * n_lines + 2, 2, dtype=np.int32)
|
||||||
|
|
||||||
self.connectivity, self.material_data = get_line_properties(
|
self.connectivity, self.material_data = get_line_properties(
|
||||||
n_lines, self.nx, self.ny, self.nz, ID
|
n_lines, self.nx, self.ny, self.nz, ID
|
||||||
@@ -330,7 +330,7 @@ class Metadata:
|
|||||||
|
|
||||||
self.gprmax_version = __version__
|
self.gprmax_version = __version__
|
||||||
self.dx_dy_dz = self.grid.dl
|
self.dx_dy_dz = self.grid.dl
|
||||||
self.nx_ny_nz = np.array([self.grid.nx, self.grid.ny, self.grid.nz], dtype=np.intc)
|
self.nx_ny_nz = np.array([self.grid.nx, self.grid.ny, self.grid.nz], dtype=np.int32)
|
||||||
|
|
||||||
self.materials = self.materials_comment()
|
self.materials = self.materials_comment()
|
||||||
|
|
||||||
@@ -427,8 +427,8 @@ class Metadata:
|
|||||||
def dx_dy_dz_comment(self) -> npt.NDArray[np.float64]:
|
def dx_dy_dz_comment(self) -> npt.NDArray[np.float64]:
|
||||||
return self.grid.dl
|
return self.grid.dl
|
||||||
|
|
||||||
def nx_ny_nz_comment(self) -> npt.NDArray[np.intc]:
|
def nx_ny_nz_comment(self) -> npt.NDArray[np.int32]:
|
||||||
return np.array([self.grid.nx, self.grid.ny, self.grid.nz], dtype=np.intc)
|
return np.array([self.grid.nx, self.grid.ny, self.grid.nz], dtype=np.int32)
|
||||||
|
|
||||||
def materials_comment(self) -> List[str]:
|
def materials_comment(self) -> List[str]:
|
||||||
if not self.averaged_materials:
|
if not self.averaged_materials:
|
||||||
|
@@ -57,7 +57,7 @@ class MPIGrid(FDTDGrid):
|
|||||||
COORDINATOR_RANK = 0
|
COORDINATOR_RANK = 0
|
||||||
|
|
||||||
def __init__(self, comm: MPI.Cartcomm):
|
def __init__(self, comm: MPI.Cartcomm):
|
||||||
self.size = np.zeros(3, dtype=np.intc)
|
self.size = np.zeros(3, dtype=np.int32)
|
||||||
|
|
||||||
self.comm = comm
|
self.comm = comm
|
||||||
self.x_comm = comm.Sub([False, True, True])
|
self.x_comm = comm.Sub([False, True, True])
|
||||||
@@ -65,12 +65,12 @@ class MPIGrid(FDTDGrid):
|
|||||||
self.z_comm = comm.Sub([True, True, False])
|
self.z_comm = comm.Sub([True, True, False])
|
||||||
self.pml_comm = MPI.COMM_NULL
|
self.pml_comm = MPI.COMM_NULL
|
||||||
|
|
||||||
self.mpi_tasks = np.array(self.comm.dims, dtype=np.intc)
|
self.mpi_tasks = np.array(self.comm.dims, dtype=np.int32)
|
||||||
|
|
||||||
self.lower_extent = np.zeros(3, dtype=np.intc)
|
self.lower_extent = np.zeros(3, dtype=np.int32)
|
||||||
self.upper_extent = np.zeros(3, dtype=np.intc)
|
self.upper_extent = np.zeros(3, dtype=np.int32)
|
||||||
self.negative_halo_offset = np.zeros(3, dtype=np.bool_)
|
self.negative_halo_offset = np.zeros(3, dtype=np.bool_)
|
||||||
self.global_size = np.zeros(3, dtype=np.intc)
|
self.global_size = np.zeros(3, dtype=np.int32)
|
||||||
|
|
||||||
self.neighbours = np.full((3, 2), -1, dtype=int)
|
self.neighbours = np.full((3, 2), -1, dtype=int)
|
||||||
self.neighbours[Dim.X] = self.comm.Shift(direction=Dim.X, disp=1)
|
self.neighbours[Dim.X] = self.comm.Shift(direction=Dim.X, disp=1)
|
||||||
@@ -164,7 +164,7 @@ class MPIGrid(FDTDGrid):
|
|||||||
"""
|
"""
|
||||||
return self.rank == self.COORDINATOR_RANK
|
return self.rank == self.COORDINATOR_RANK
|
||||||
|
|
||||||
def get_grid_coord_from_coordinate(self, coord: npt.NDArray[np.intc]) -> npt.NDArray[np.intc]:
|
def get_grid_coord_from_coordinate(self, coord: npt.NDArray[np.int32]) -> npt.NDArray[np.int32]:
|
||||||
"""Get the MPI grid coordinate for a global grid coordinate.
|
"""Get the MPI grid coordinate for a global grid coordinate.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -224,8 +224,8 @@ class MPIGrid(FDTDGrid):
|
|||||||
return [coord_to_rank(coord) for coord in np.ndindex(*(stop - start))]
|
return [coord_to_rank(coord) for coord in np.ndindex(*(stop - start))]
|
||||||
|
|
||||||
def global_to_local_coordinate(
|
def global_to_local_coordinate(
|
||||||
self, global_coord: npt.NDArray[np.intc]
|
self, global_coord: npt.NDArray[np.int32]
|
||||||
) -> npt.NDArray[np.intc]:
|
) -> npt.NDArray[np.int32]:
|
||||||
"""Convert a global grid coordinate to a local grid coordinate.
|
"""Convert a global grid coordinate to a local grid coordinate.
|
||||||
|
|
||||||
The returned coordinate will be relative to the current MPI
|
The returned coordinate will be relative to the current MPI
|
||||||
@@ -240,7 +240,9 @@ class MPIGrid(FDTDGrid):
|
|||||||
"""
|
"""
|
||||||
return global_coord - self.lower_extent
|
return global_coord - self.lower_extent
|
||||||
|
|
||||||
def local_to_global_coordinate(self, local_coord: npt.NDArray[np.intc]) -> npt.NDArray[np.intc]:
|
def local_to_global_coordinate(
|
||||||
|
self, local_coord: npt.NDArray[np.int32]
|
||||||
|
) -> npt.NDArray[np.int32]:
|
||||||
"""Convert a local grid coordinate to a global grid coordinate.
|
"""Convert a local grid coordinate to a global grid coordinate.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -252,7 +254,7 @@ class MPIGrid(FDTDGrid):
|
|||||||
return local_coord + self.lower_extent
|
return local_coord + self.lower_extent
|
||||||
|
|
||||||
def global_coord_inside_grid(
|
def global_coord_inside_grid(
|
||||||
self, global_coord: npt.NDArray[np.intc], allow_inside_halo: bool = False
|
self, global_coord: npt.NDArray[np.int32], allow_inside_halo: bool = False
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Check if a global coordinate falls with in the local grid.
|
"""Check if a global coordinate falls with in the local grid.
|
||||||
|
|
||||||
@@ -277,7 +279,7 @@ class MPIGrid(FDTDGrid):
|
|||||||
return all(global_coord >= lower_bound) and all(global_coord <= upper_bound)
|
return all(global_coord >= lower_bound) and all(global_coord <= upper_bound)
|
||||||
|
|
||||||
def global_bounds_overlap_local_grid(
|
def global_bounds_overlap_local_grid(
|
||||||
self, start: npt.NDArray[np.intc], stop: npt.NDArray[np.intc]
|
self, start: npt.NDArray[np.int32], stop: npt.NDArray[np.int32]
|
||||||
) -> bool:
|
) -> bool:
|
||||||
local_start = self.global_to_local_coordinate(start)
|
local_start = self.global_to_local_coordinate(start)
|
||||||
local_stop = self.global_to_local_coordinate(stop)
|
local_stop = self.global_to_local_coordinate(stop)
|
||||||
@@ -285,10 +287,10 @@ class MPIGrid(FDTDGrid):
|
|||||||
|
|
||||||
def limit_global_bounds_to_within_local_grid(
|
def limit_global_bounds_to_within_local_grid(
|
||||||
self,
|
self,
|
||||||
start: npt.NDArray[np.intc],
|
start: npt.NDArray[np.int32],
|
||||||
stop: npt.NDArray[np.intc],
|
stop: npt.NDArray[np.int32],
|
||||||
step: npt.NDArray[np.intc] = np.ones(3, dtype=np.intc),
|
step: npt.NDArray[np.int32] = np.ones(3, dtype=np.int32),
|
||||||
) -> Tuple[npt.NDArray[np.intc], npt.NDArray[np.intc], npt.NDArray[np.intc]]:
|
) -> Tuple[npt.NDArray[np.int32], npt.NDArray[np.int32], npt.NDArray[np.int32]]:
|
||||||
local_start = self.global_to_local_coordinate(start)
|
local_start = self.global_to_local_coordinate(start)
|
||||||
|
|
||||||
# Bring start into the local grid (and not in the negative halo)
|
# Bring start into the local grid (and not in the negative halo)
|
||||||
@@ -801,7 +803,7 @@ class MPIGrid(FDTDGrid):
|
|||||||
if p[2] < 0 or p[2] > self.gz:
|
if p[2] < 0 or p[2] > self.gz:
|
||||||
raise ValueError("z")
|
raise ValueError("z")
|
||||||
|
|
||||||
local_point = self.global_to_local_coordinate(np.array(p, dtype=np.intc))
|
local_point = self.global_to_local_coordinate(np.array(p, dtype=np.int32))
|
||||||
|
|
||||||
return all(local_point >= self.negative_halo_offset) and all(local_point <= self.size)
|
return all(local_point >= self.negative_halo_offset) and all(local_point <= self.size)
|
||||||
|
|
||||||
|
@@ -74,8 +74,8 @@ class MPIModel(Model):
|
|||||||
self.geometryobjects = []
|
self.geometryobjects = []
|
||||||
|
|
||||||
for go in objects:
|
for go in objects:
|
||||||
start = np.array([go.xs, go.ys, go.zs], dtype=np.intc)
|
start = np.array([go.xs, go.ys, go.zs], dtype=np.int32)
|
||||||
stop = np.array([go.xf, go.yf, go.zf], dtype=np.intc)
|
stop = np.array([go.xf, go.yf, go.zf], dtype=np.int32)
|
||||||
if self.G.global_bounds_overlap_local_grid(start, stop):
|
if self.G.global_bounds_overlap_local_grid(start, stop):
|
||||||
comm = self.comm.Split()
|
comm = self.comm.Split()
|
||||||
assert isinstance(comm, MPI.Intracomm)
|
assert isinstance(comm, MPI.Intracomm)
|
||||||
@@ -83,7 +83,7 @@ class MPIModel(Model):
|
|||||||
stop_grid_coord = self.G.get_grid_coord_from_coordinate(stop) + 1
|
stop_grid_coord = self.G.get_grid_coord_from_coordinate(stop) + 1
|
||||||
go.comm = comm.Create_cart((stop_grid_coord - start_grid_coord).tolist())
|
go.comm = comm.Create_cart((stop_grid_coord - start_grid_coord).tolist())
|
||||||
|
|
||||||
go.global_size = np.array([go.nx, go.ny, go.nz], dtype=np.intc)
|
go.global_size = np.array([go.nx, go.ny, go.nz], dtype=np.int32)
|
||||||
start, stop, offset = self.G.limit_global_bounds_to_within_local_grid(start, stop)
|
start, stop, offset = self.G.limit_global_bounds_to_within_local_grid(start, stop)
|
||||||
go.size = stop - start
|
go.size = stop - start
|
||||||
go.start = start
|
go.start = start
|
||||||
|
@@ -31,8 +31,8 @@ class Rx:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID: str
|
self.ID: str
|
||||||
self.outputs = {}
|
self.outputs = {}
|
||||||
self.coord = np.zeros(3, dtype=np.intc)
|
self.coord = np.zeros(3, dtype=np.int32)
|
||||||
self.coordorigin = np.zeros(3, dtype=np.intc)
|
self.coordorigin = np.zeros(3, dtype=np.int32)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def xcoord(self) -> int:
|
def xcoord(self) -> int:
|
||||||
|
@@ -130,10 +130,10 @@ class Snapshot:
|
|||||||
self.grid_dl = grid_dl
|
self.grid_dl = grid_dl
|
||||||
self.grid_dt = grid_dt
|
self.grid_dt = grid_dt
|
||||||
|
|
||||||
self.start = np.array([xs, ys, zs], dtype=np.intc)
|
self.start = np.array([xs, ys, zs], dtype=np.int32)
|
||||||
self.stop = np.array([xf, yf, zf], dtype=np.intc)
|
self.stop = np.array([xf, yf, zf], dtype=np.int32)
|
||||||
self.step = np.array([dx, dy, dz], dtype=np.intc)
|
self.step = np.array([dx, dy, dz], dtype=np.int32)
|
||||||
self.size = np.ceil((self.stop - self.start) / self.step).astype(np.intc)
|
self.size = np.ceil((self.stop - self.start) / self.step).astype(np.int32)
|
||||||
self.slice: list[slice] = list(map(slice, self.start, self.stop + self.step, self.step))
|
self.slice: list[slice] = list(map(slice, self.start, self.stop + self.step, self.step))
|
||||||
|
|
||||||
self.nbytes = 0
|
self.nbytes = 0
|
||||||
@@ -365,14 +365,14 @@ class MPISnapshot(Snapshot):
|
|||||||
xs, ys, zs, xf, yf, zf, dx, dy, dz, time, filename, fileext, outputs, grid_dl, grid_dt
|
xs, ys, zs, xf, yf, zf, dx, dy, dz, time, filename, fileext, outputs, grid_dl, grid_dt
|
||||||
)
|
)
|
||||||
|
|
||||||
self.offset = np.zeros(3, dtype=np.intc)
|
self.offset = np.zeros(3, dtype=np.int32)
|
||||||
self.global_size = self.size.copy()
|
self.global_size = self.size.copy()
|
||||||
|
|
||||||
self.comm: MPI.Cartcomm = None # type: ignore
|
self.comm: MPI.Cartcomm = None # type: ignore
|
||||||
|
|
||||||
def initialise_snapfields(self):
|
def initialise_snapfields(self):
|
||||||
# Start and stop may have changed since initialisation
|
# Start and stop may have changed since initialisation
|
||||||
self.size = np.ceil((self.stop - self.start) / self.step).astype(np.intc)
|
self.size = np.ceil((self.stop - self.start) / self.step).astype(np.int32)
|
||||||
return super().initialise_snapfields()
|
return super().initialise_snapfields()
|
||||||
|
|
||||||
def has_neighbour(self, dimension: Dim, direction: Dir) -> bool:
|
def has_neighbour(self, dimension: Dim, direction: Dir) -> bool:
|
||||||
|
@@ -33,8 +33,8 @@ class Source:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID: str
|
self.ID: str
|
||||||
self.polarisation = None
|
self.polarisation = None
|
||||||
self.coord = np.zeros(3, dtype=np.intc)
|
self.coord = np.zeros(3, dtype=np.int32)
|
||||||
self.coordorigin = np.zeros(3, dtype=np.intc)
|
self.coordorigin = np.zeros(3, dtype=np.int32)
|
||||||
self.start = 0.0
|
self.start = 0.0
|
||||||
self.stop = 0.0
|
self.stop = 0.0
|
||||||
self.waveform: Waveform
|
self.waveform: Waveform
|
||||||
|
@@ -29,7 +29,7 @@ class VtkImageData(VtkHdfFile):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
filename: Union[str, PathLike],
|
filename: Union[str, PathLike],
|
||||||
shape: npt.NDArray[np.intc],
|
shape: npt.NDArray[np.int32],
|
||||||
origin: Optional[npt.NDArray[np.float32]] = None,
|
origin: Optional[npt.NDArray[np.float32]] = None,
|
||||||
spacing: Optional[npt.NDArray[np.float32]] = None,
|
spacing: Optional[npt.NDArray[np.float32]] = None,
|
||||||
direction: Optional[npt.NDArray[np.float32]] = None,
|
direction: Optional[npt.NDArray[np.float32]] = None,
|
||||||
@@ -68,11 +68,11 @@ class VtkImageData(VtkHdfFile):
|
|||||||
if len(shape) > self.DIMENSIONS:
|
if len(shape) > self.DIMENSIONS:
|
||||||
raise ValueError(f"Shape must not have more than {self.DIMENSIONS} dimensions.")
|
raise ValueError(f"Shape must not have more than {self.DIMENSIONS} dimensions.")
|
||||||
elif len(shape) < self.DIMENSIONS:
|
elif len(shape) < self.DIMENSIONS:
|
||||||
shape = np.concatenate((shape, np.ones(self.DIMENSIONS - len(shape), dtype=np.intc)))
|
shape = np.concatenate((shape, np.ones(self.DIMENSIONS - len(shape), dtype=np.int32)))
|
||||||
|
|
||||||
self.shape = shape
|
self.shape = shape
|
||||||
|
|
||||||
whole_extent = np.zeros(2 * self.DIMENSIONS, dtype=np.intc)
|
whole_extent = np.zeros(2 * self.DIMENSIONS, dtype=np.int32)
|
||||||
whole_extent[1::2] = self.shape
|
whole_extent[1::2] = self.shape
|
||||||
self._set_root_attribute(self.WHOLE_EXTENT_ATTR, whole_extent)
|
self._set_root_attribute(self.WHOLE_EXTENT_ATTR, whole_extent)
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ class VtkImageData(VtkHdfFile):
|
|||||||
self.set_direction(direction)
|
self.set_direction(direction)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def whole_extent(self) -> npt.NDArray[np.intc]:
|
def whole_extent(self) -> npt.NDArray[np.int32]:
|
||||||
return self._get_root_attribute(self.WHOLE_EXTENT_ATTR)
|
return self._get_root_attribute(self.WHOLE_EXTENT_ATTR)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -141,7 +141,7 @@ class VtkImageData(VtkHdfFile):
|
|||||||
self._set_root_attribute(self.DIRECTION_ATTR, direction)
|
self._set_root_attribute(self.DIRECTION_ATTR, direction)
|
||||||
|
|
||||||
def add_point_data(
|
def add_point_data(
|
||||||
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.intc]] = None
|
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.int32]] = None
|
||||||
):
|
):
|
||||||
"""Add point data to the VTKHDF file.
|
"""Add point data to the VTKHDF file.
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ class VtkImageData(VtkHdfFile):
|
|||||||
return super().add_point_data(name, data, points_shape, offset)
|
return super().add_point_data(name, data, points_shape, offset)
|
||||||
|
|
||||||
def add_cell_data(
|
def add_cell_data(
|
||||||
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.intc]] = None
|
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.int32]] = None
|
||||||
):
|
):
|
||||||
"""Add cell data to the VTKHDF file.
|
"""Add cell data to the VTKHDF file.
|
||||||
|
|
||||||
|
@@ -101,20 +101,20 @@ class VtkUnstructuredGrid(VtkHdfFile):
|
|||||||
@property
|
@property
|
||||||
def number_of_cells(self) -> int:
|
def number_of_cells(self) -> int:
|
||||||
number_of_cells = self._get_root_dataset(self.Dataset.NUMBER_OF_CELLS)
|
number_of_cells = self._get_root_dataset(self.Dataset.NUMBER_OF_CELLS)
|
||||||
return np.sum(number_of_cells, dtype=np.intc)
|
return np.sum(number_of_cells, dtype=np.int32)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def number_of_connectivity_ids(self) -> int:
|
def number_of_connectivity_ids(self) -> int:
|
||||||
number_of_connectivity_ids = self._get_root_dataset(self.Dataset.NUMBER_OF_CONNECTIVITY_IDS)
|
number_of_connectivity_ids = self._get_root_dataset(self.Dataset.NUMBER_OF_CONNECTIVITY_IDS)
|
||||||
return np.sum(number_of_connectivity_ids, dtype=np.intc)
|
return np.sum(number_of_connectivity_ids, dtype=np.int32)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def number_of_points(self) -> int:
|
def number_of_points(self) -> int:
|
||||||
number_of_points = self._get_root_dataset(self.Dataset.NUMBER_OF_POINTS)
|
number_of_points = self._get_root_dataset(self.Dataset.NUMBER_OF_POINTS)
|
||||||
return np.sum(number_of_points, dtype=np.intc)
|
return np.sum(number_of_points, dtype=np.int32)
|
||||||
|
|
||||||
def add_point_data(
|
def add_point_data(
|
||||||
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.intc]] = None
|
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.int32]] = None
|
||||||
):
|
):
|
||||||
"""Add point data to the VTKHDF file.
|
"""Add point data to the VTKHDF file.
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ class VtkUnstructuredGrid(VtkHdfFile):
|
|||||||
return super().add_point_data(name, data, shape, offset)
|
return super().add_point_data(name, data, shape, offset)
|
||||||
|
|
||||||
def add_cell_data(
|
def add_cell_data(
|
||||||
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.intc]] = None
|
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.int32]] = None
|
||||||
):
|
):
|
||||||
"""Add cell data to the VTKHDF file.
|
"""Add cell data to the VTKHDF file.
|
||||||
|
|
||||||
|
@@ -185,8 +185,8 @@ class VtkHdfFile(AbstractContextManager):
|
|||||||
self,
|
self,
|
||||||
name: "VtkHdfFile.Dataset",
|
name: "VtkHdfFile.Dataset",
|
||||||
data: npt.ArrayLike,
|
data: npt.ArrayLike,
|
||||||
shape: Optional[npt.NDArray[np.intc]] = None,
|
shape: Optional[npt.NDArray[np.int32]] = None,
|
||||||
offset: Optional[npt.NDArray[np.intc]] = None,
|
offset: Optional[npt.NDArray[np.int32]] = None,
|
||||||
xyz_data_ordering=True,
|
xyz_data_ordering=True,
|
||||||
):
|
):
|
||||||
"""Write specified dataset to the root group of the VTKHDF file.
|
"""Write specified dataset to the root group of the VTKHDF file.
|
||||||
@@ -211,8 +211,8 @@ class VtkHdfFile(AbstractContextManager):
|
|||||||
self,
|
self,
|
||||||
path: str,
|
path: str,
|
||||||
data: npt.ArrayLike,
|
data: npt.ArrayLike,
|
||||||
shape: Optional[npt.NDArray[np.intc]] = None,
|
shape: Optional[npt.NDArray[np.int32]] = None,
|
||||||
offset: Optional[npt.NDArray[np.intc]] = None,
|
offset: Optional[npt.NDArray[np.int32]] = None,
|
||||||
dtype: Optional[npt.DTypeLike] = None,
|
dtype: Optional[npt.DTypeLike] = None,
|
||||||
xyz_data_ordering=True,
|
xyz_data_ordering=True,
|
||||||
):
|
):
|
||||||
@@ -301,8 +301,8 @@ class VtkHdfFile(AbstractContextManager):
|
|||||||
self,
|
self,
|
||||||
name: str,
|
name: str,
|
||||||
data: npt.NDArray,
|
data: npt.NDArray,
|
||||||
shape: Optional[npt.NDArray[np.intc]] = None,
|
shape: Optional[npt.NDArray[np.int32]] = None,
|
||||||
offset: Optional[npt.NDArray[np.intc]] = None,
|
offset: Optional[npt.NDArray[np.int32]] = None,
|
||||||
):
|
):
|
||||||
"""Add point data to the VTKHDF file.
|
"""Add point data to the VTKHDF file.
|
||||||
|
|
||||||
@@ -321,8 +321,8 @@ class VtkHdfFile(AbstractContextManager):
|
|||||||
self,
|
self,
|
||||||
name: str,
|
name: str,
|
||||||
data: npt.NDArray,
|
data: npt.NDArray,
|
||||||
shape: Optional[npt.NDArray[np.intc]] = None,
|
shape: Optional[npt.NDArray[np.int32]] = None,
|
||||||
offset: Optional[npt.NDArray[np.intc]] = None,
|
offset: Optional[npt.NDArray[np.int32]] = None,
|
||||||
):
|
):
|
||||||
"""Add cell data to the VTKHDF file.
|
"""Add cell data to the VTKHDF file.
|
||||||
|
|
||||||
@@ -341,8 +341,8 @@ class VtkHdfFile(AbstractContextManager):
|
|||||||
self,
|
self,
|
||||||
name: str,
|
name: str,
|
||||||
data: npt.ArrayLike,
|
data: npt.ArrayLike,
|
||||||
shape: Optional[npt.NDArray[np.intc]] = None,
|
shape: Optional[npt.NDArray[np.int32]] = None,
|
||||||
offset: Optional[npt.NDArray[np.intc]] = None,
|
offset: Optional[npt.NDArray[np.int32]] = None,
|
||||||
dtype: Optional[npt.DTypeLike] = None,
|
dtype: Optional[npt.DTypeLike] = None,
|
||||||
):
|
):
|
||||||
"""Add field data to the VTKHDF file.
|
"""Add field data to the VTKHDF file.
|
||||||
|
在新工单中引用
屏蔽一个用户