Loading...
Searching...
No Matches
terra::io Namespace Reference

Classes

struct  CheckpointMetadata
 
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

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< CheckpointMetadataread_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
 

Enumeration Type Documentation

◆ DiagonalSplitType

enum class terra::io::DiagonalSplitType
strong
Enumerator
FORWARD_SLASH 
BACKWARD_SLASH 

◆ VtkElementType

enum class terra::io::VtkElementType
strong
Enumerator
LINEAR_QUAD 
QUADRATIC_QUAD 

Function Documentation

◆ get_vtk_type_string()

template<typename T >
std::string terra::io::get_vtk_type_string ( )

◆ read_xdmf_checkpoint_grid()

template<typename GridDataType >
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.

Parameters
checkpoint_directorypath to the directory containing the XDMF data
data_labelthe Kokkos::View label of the grid data that shall be read in
stepthe "timestep" to read
distributed_domainDistributedDomain 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

◆ read_xdmf_checkpoint_metadata()

util::Result< CheckpointMetadata > terra::io::read_xdmf_checkpoint_metadata ( const std::string &  checkpoint_directory)
inline

Reads metadata from an XDMF/checkpoint directory. See XDMFOutput for details.

Parameters
checkpoint_directorypath to the directory containing the XDMF data
Returns
Populated CheckpointMetadata struct.

◆ write_rectilinear_to_triangular_vtu()

template<typename ScalarType >
void terra::io::write_rectilinear_to_triangular_vtu ( Kokkos::View< ScalarType **[3] >  points_device_view,
const std::string &  filename,
DiagonalSplitType  split_type 
)

◆ write_surface_radial_extruded_to_wedge_vtu()

template<typename PointRealT , typename AttachedDataType >
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 
)

◆ write_vtk_xml_quad_mesh()

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).

Parameters
filenameThe path to the output VTK file (.vtu).
verticesA 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.
elementTypeSpecifies whether to write linear or quadratic elements.

Variable Documentation

◆ VTK_QUAD

constexpr int terra::io::VTK_QUAD = 9
constexpr

◆ VTK_QUADRATIC_QUAD

constexpr int terra::io::VTK_QUADRATIC_QUAD = 23
constexpr