Namespaces | |
| namespace | detail |
Classes | |
| struct | CheckpointMetadata |
| struct | GridLayout2D |
| Describes the 2D grid layout for a linearized data column. More... | |
| struct | ScalarLookupTable2D |
| Device-capable 2D scalar lookup table with bilinear interpolation. More... | |
| class | VTKOutput |
| class | XDMFOutput |
| XDMF output that simultaneously serves for visualization with software like Paraview and as a simulation checkpoint. More... | |
Enumerations | |
| enum class | VtkElementType { LINEAR_QUAD , QUADRATIC_QUAD } |
| enum class | DiagonalSplitType { FORWARD_SLASH , BACKWARD_SLASH } |
Functions | |
| template<typename ScalarType = double> | |
| std::vector< ScalarLookupTable2D< ScalarType > > | read_lookup_tables_2d (const std::string &filename, const std::vector< int > &column_indices, const GridLayout2D &layout, const std::string &label="lookup_table") |
| Read selected columns from a delimited data file into 2D lookup tables. | |
| template<typename ScalarType = double> | |
| ScalarLookupTable2D< ScalarType > | read_lookup_table_2d (const std::string &filename, int column_index, const GridLayout2D &layout, const std::string &label="lookup_table") |
| Convenience overload: read a single column from a data file. | |
| void | write_vtk_xml_quad_mesh (const std::string &filename, const Kokkos::View< double **[3] > &vertices, VtkElementType elementType=VtkElementType::LINEAR_QUAD) |
| Writes a 2D grid of vertices stored in a Kokkos View to a VTK XML Unstructured Grid file (.vtu) representing a quadrilateral mesh (linear or quadratic). | |
| template<typename T > | |
| std::string | get_vtk_type_string () |
| template<typename ScalarType > | |
| void | write_rectilinear_to_triangular_vtu (Kokkos::View< ScalarType **[3] > points_device_view, const std::string &filename, DiagonalSplitType split_type) |
| template<typename PointRealT , typename AttachedDataType > | |
| void | write_surface_radial_extruded_to_wedge_vtu (grid::Grid2DDataVec< PointRealT, 3 > surface_points_device_view, grid::Grid1DDataScalar< PointRealT > radii_device_view, std::optional< AttachedDataType > optional_attached_data_device_view, const std::string &vector_data_name, const std::string &filename, DiagonalSplitType split_type) |
| util::Result< CheckpointMetadata > | read_xdmf_checkpoint_metadata (const std::string &checkpoint_directory) |
| Reads metadata from an XDMF/checkpoint directory. See XDMFOutput for details. | |
| template<typename GridDataType > | |
| util::Result | read_xdmf_checkpoint_grid (const std::string &checkpoint_directory, const std::string &data_label, const int step, const grid::shell::DistributedDomain &distributed_domain, GridDataType &grid_data_device) |
| Reads a single grid at a single write step from an XDMF checkpoint. | |
Variables | |
| constexpr int | VTK_QUAD = 9 |
| constexpr int | VTK_QUADRATIC_QUAD = 23 |
|
strong |
|
strong |
| std::string terra::io::get_vtk_type_string | ( | ) |
| ScalarLookupTable2D< ScalarType > terra::io::read_lookup_table_2d | ( | const std::string & | filename, |
| int | column_index, | ||
| const GridLayout2D & | layout, | ||
| const std::string & | label = "lookup_table" |
||
| ) |
Convenience overload: read a single column from a data file.
Equivalent to calling read_lookup_tables_2d with a one-element column-index vector and returning the first (and only) result.
| filename | Path to the data file |
| column_index | 0-based index of the column to read |
| layout | Grid dimensions, physical coordinates, and strides |
| label | Optional label for the Kokkos view |
| std::runtime_error | (same conditions as read_lookup_tables_2d) |
| std::vector< ScalarLookupTable2D< ScalarType > > terra::io::read_lookup_tables_2d | ( | const std::string & | filename, |
| const std::vector< int > & | column_indices, | ||
| const GridLayout2D & | layout, | ||
| const std::string & | label = "lookup_table" |
||
| ) |
Read selected columns from a delimited data file into 2D lookup tables.
# (after optional leading whitespace) are treated as comments and ignored.layout.nx * layout.ny data rows; additional rows after that are silently ignored.k (0-based, among non-comment rows) maps to grid index (ix, iy) via the strides stored in layout (see GridLayout2D for details). The resulting Kokkos view is indexed as view(ix, iy).| filename | Path to the data file |
| column_indices | 0-based column indices to extract (order is preserved) |
| layout | Grid dimensions, physical coordinates, and strides |
| label | Optional label prefix for the Kokkos views |
column_indices.| std::runtime_error | if the file cannot be opened, if a data row has fewer columns than the largest requested index, or if fewer than nx * ny data rows are found. |
| util::Result terra::io::read_xdmf_checkpoint_grid | ( | const std::string & | checkpoint_directory, |
| const std::string & | data_label, | ||
| const int | step, | ||
| const grid::shell::DistributedDomain & | distributed_domain, | ||
| GridDataType & | grid_data_device | ||
| ) |
Reads a single grid at a single write step from an XDMF checkpoint.
See XDMFOutput for details.
| checkpoint_directory | path to the directory containing the XDMF data |
| data_label | the Kokkos::View label of the grid data that shall be read in |
| step | the "timestep" to read |
| distributed_domain | DistributedDomain instance that has the same topology as the one used when writing the checkpoint |
| grid_data_device | [out] properly sized Kokkos::View (can live on a device) to write the checkpoint to |
|
inline |
Reads metadata from an XDMF/checkpoint directory. See XDMFOutput for details.
| checkpoint_directory | path to the directory containing the XDMF data |
| void terra::io::write_rectilinear_to_triangular_vtu | ( | Kokkos::View< ScalarType **[3] > | points_device_view, |
| const std::string & | filename, | ||
| DiagonalSplitType | split_type | ||
| ) |
| void terra::io::write_surface_radial_extruded_to_wedge_vtu | ( | grid::Grid2DDataVec< PointRealT, 3 > | surface_points_device_view, |
| grid::Grid1DDataScalar< PointRealT > | radii_device_view, | ||
| std::optional< AttachedDataType > | optional_attached_data_device_view, | ||
| const std::string & | vector_data_name, | ||
| const std::string & | filename, | ||
| DiagonalSplitType | split_type | ||
| ) |
| void terra::io::write_vtk_xml_quad_mesh | ( | const std::string & | filename, |
| const Kokkos::View< double **[3] > & | vertices, | ||
| VtkElementType | elementType = VtkElementType::LINEAR_QUAD |
||
| ) |
Writes a 2D grid of vertices stored in a Kokkos View to a VTK XML Unstructured Grid file (.vtu) representing a quadrilateral mesh (linear or quadratic).
| filename | The path to the output VTK file (.vtu). |
| vertices | A Kokkos View containing the vertex coordinates. Assumed dimensions: (Nx, Ny, 3). vertices(i, j, 0) = X coordinate of point (i, j) vertices(i, j, 1) = Y coordinate of point (i, j) vertices(i, j, 2) = Z coordinate of point (i, j) Nx = vertices.extent(0), Ny = vertices.extent(1) For QUADRATIC_QUAD, Nx and Ny must be odd and >= 3. |
| elementType | Specifies whether to write linear or quadratic elements. |
|
constexpr |
|
constexpr |