resample_to_regular_grid command

Purpose

Command to sample field data to cells that are arranged on a regular lattice.

Warning

GPU support for this command has not been tested and may not work as expected.

Syntax

The following keyword/value pairs must/can be provided:

input_file             (optional, either 'input_file' or 'input_files' must be defined) path of single files to be sampled
input_files            (optional, either 'input_file' or 'input_files' must be defined) path of multiple files to be sampled, using '*' as wildcard
output_directory       (mandatory) path of folder (created if non-existing) where the output files are written to
output_format          (optional, default 'vts') defines which VTK file type is used for output (valid options: 'vts', 'vtu', 'vti')
low                    (mandatory) vector of lower boundaries of the sampling region box (same as in region definition)
high                   (mandatory) vector of upper boundaries of the sampling region box (same as in region definition)
binsize                (mandatory) scalar or vector denoting the size of the cells
sequence_file_name     (mandatory) filename for a file, listing all resampled .vtu files and the corresponding time values
sample_rate            (mandatory) scalar defining the temporal sampling rate [s] of the .vtk files provided in 'input_files'
kernel_size            (optional, default 8) integer size of the interpolation kernel when sampling data to points in region
overwrite              (optional, default false) bool yes/no to control if file that was already resampled, should be resampled and written again
is_periodic_in_time    (optional, default false) bool yes/no to control if the resampled data is periodic in time, for first and last time step the same data is used
write_source_data      (optional for Telemac data, default true) bool yes/no to control if additional output is generated like walls and the source VTU data from the SLF file

Examples

resample_to_regular_grid input_files VTK/cavity-*.vtk output_directory VTU sequence_file_name sequence.file low (0, 0, 0) high (0.1, 0.1, 0.01) binsize 0.01 sample_rate 0.5 output_format vtu
resample_to_regular_grid input_files canal.vtk output_directory canal sequence_file_name sequence.file low (0, 0, 0) high (0.1, 0.1, 0.01) binsize (0.01, 0.01, 0.001)

Description

This command can be used as a pre-processing tool to re-sample field data to cell data. While the field data can be arranged in unstructured way, the cell data is arranged on a regular structured grid, defined by a bounding box (via low, high and binsize). This sampled data can then be used efficiently as input for enable_one_way_coupling when reading field data. Please note, that the definitions of low, high and binsize have to match those used for the enable_one_way_coupling command. If a file was already resampled, it will be skipped, unless overwrite yes is used.

All (vtk) files provided in input_files or via input_file are sampled and written to output_directory. Additionally a sequence_file is written, keeping track of all files and the corresponding time they represent. For that purpose a sample_rate must be provided. The format of the sequence_file corresponds to the format of defining transient field data in the enable_one_way_coupling command.

For Telemac data (Serafin SLF file format), which is a licensed feature, the input_file must be a file with the extension .slf. As the file contains the time data as well, there is no need to specify the sample_rate. By default additional output will be generated (like walls and unstructured (VTU) grids extracted from the SLF file), which can be disabled by write_source_data no.

Restrictions

None.

Default