DOLFINx 0.9.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
ADIOS2Writers.h File Reference

ADIOS2-based output writers. More...

Go to the source code of this file.

Classes

class  ADIOS2Writer
 Base class for ADIOS2-based writers. More...
 

Namespaces

namespace  dolfinx
 Top-level namespace.
 
namespace  dolfinx::fem
 Finite element method functionality.
 
namespace  dolfinx::io
 Support for file IO.
 

Functions

template<class T >
adios2::Attribute< T > define_attribute (adios2::IO &io, std::string name, const T &value, std::string var_name="", std::string separator="/")
 
template<class T >
adios2::Variable< T > define_variable (adios2::IO &io, std::string name, const adios2::Dims &shape=adios2::Dims(), const adios2::Dims &start=adios2::Dims(), const adios2::Dims &count=adios2::Dims())
 
template<std::floating_point T>
std::shared_ptr< const mesh::Mesh< T > > extract_common_mesh (const typename adios2_writer::U< T > &u)
 Extract common mesh from list of Functions.
 
void initialize_mesh_attributes (adios2::IO &io, mesh::CellType type)
 
template<std::floating_point T>
void initialize_function_attributes (adios2::IO &io, const typename adios2_writer::U< T > &u)
 
template<typename T , std::floating_point U>
std::vector< T > pack_function_data (const fem::Function< T, U > &u)
 
template<typename T , std::floating_point U>
void write_data (adios2::IO &io, adios2::Engine &engine, const fem::Function< T, U > &u)
 
template<std::floating_point T>
void write_mesh (adios2::IO &io, adios2::Engine &engine, const mesh::Mesh< T > &mesh)
 Write mesh geometry and connectivity (topology) for Fides.
 
std::stringstream create_vtk_schema (const std::vector< std::string > &point_data, const std::vector< std::string > &cell_data)
 
template<std::floating_point T>
std::vector< std::string > extract_function_names (const typename adios2_writer::U< T > &u)
 Extract name of functions and split into real and imaginary component.
 
template<typename T , std::floating_point X>
void vtx_write_data (adios2::IO &io, adios2::Engine &engine, const fem::Function< T, X > &u)
 
template<std::floating_point T>
void vtx_write_mesh (adios2::IO &io, adios2::Engine &engine, const mesh::Mesh< T > &mesh)
 
template<std::floating_point T>
std::pair< std::vector< std::int64_t >, std::vector< std::uint8_t > > vtx_write_mesh_from_space (adios2::IO &io, adios2::Engine &engine, const fem::FunctionSpace< T > &V)
 Given a FunctionSpace, create a topology and geometry based on the function space dof coordinates. Writes the topology and geometry using ADIOS2 in VTX format.
 

Variables

constexpr std::array field_ext = {"_real", "_imag"}
 

Detailed Description

ADIOS2-based output writers.

Function Documentation

◆ create_vtk_schema()

std::stringstream create_vtk_schema ( const std::vector< std::string > & point_data,
const std::vector< std::string > & cell_data )

◆ define_attribute()

template<class T >
adios2::Attribute< T > define_attribute ( adios2::IO & io,
std::string name,
const T & value,
std::string var_name = "",
std::string separator = "/" )

Safe definition of an attribute. First check if it has already been defined and return it. If not defined create new attribute.

◆ define_variable()

template<class T >
adios2::Variable< T > define_variable ( adios2::IO & io,
std::string name,
const adios2::Dims & shape = adios2::Dims(),
const adios2::Dims & start = adios2::Dims(),
const adios2::Dims & count = adios2::Dims() )

Safe definition of a variable. First check if it has already been defined and return it. If not defined create new variable.

◆ initialize_function_attributes()

template<std::floating_point T>
void initialize_function_attributes ( adios2::IO & io,
const typename adios2_writer::U< T > & u )

Initialize function related attributes for the ADIOS2 file used in Fides

Parameters
[in]ioThe ADIOS2 IO
[in]uList of functions

◆ initialize_mesh_attributes()

void initialize_mesh_attributes ( adios2::IO & io,
mesh::CellType type )

Initialize mesh related attributes for the ADIOS2 file used in Fides.

Parameters
[in]ioADIOS2 IO object
[in]typeCell type

◆ pack_function_data()

template<typename T , std::floating_point U>
std::vector< T > pack_function_data ( const fem::Function< T, U > & u)

Pack Function data at vertices. The mesh and the function must both be 'P1'.

◆ vtx_write_data()

template<typename T , std::floating_point X>
void vtx_write_data ( adios2::IO & io,
adios2::Engine & engine,
const fem::Function< T, X > & u )

Given a Function, write the coefficient to file using ADIOS2.

Note
Only supports (discontinuous) Lagrange functions.
For a complex function, the coefficient is split into a real and imaginary function.
Data is padded to be three dimensional if vector and 9 dimensional if tensor.
Parameters
[in]ioADIOS2 io object.
[in]engineADIOS2 engine object.
[in]uFunction to write.

◆ vtx_write_mesh()

template<std::floating_point T>
void vtx_write_mesh ( adios2::IO & io,
adios2::Engine & engine,
const mesh::Mesh< T > & mesh )

Write mesh to file using VTX format

Parameters
[in]ioThe ADIOS2 io object
[in]engineThe ADIOS2 engine object
[in]meshThe mesh

◆ vtx_write_mesh_from_space()

template<std::floating_point T>
std::pair< std::vector< std::int64_t >, std::vector< std::uint8_t > > vtx_write_mesh_from_space ( adios2::IO & io,
adios2::Engine & engine,
const fem::FunctionSpace< T > & V )

Given a FunctionSpace, create a topology and geometry based on the function space dof coordinates. Writes the topology and geometry using ADIOS2 in VTX format.

Note
Only supports (discontinuous) Lagrange functions.
Parameters
[in]ioThe ADIOS2 io object
[in]engineThe ADIOS2 engine object
[in]VThe function space

◆ write_data()

template<typename T , std::floating_point U>
void write_data ( adios2::IO & io,
adios2::Engine & engine,
const fem::Function< T, U > & u )

Write a first order Lagrange function (real or complex) using ADIOS2 in Fides format. Data is padded to be three dimensional if vector and 9 dimensional if tensor.

Parameters
[in]ioThe ADIOS2 io object
[in]engineThe ADIOS2 engine object
[in]uThe function to write

◆ write_mesh()

template<std::floating_point T>
void write_mesh ( adios2::IO & io,
adios2::Engine & engine,
const mesh::Mesh< T > & mesh )

Write mesh geometry and connectivity (topology) for Fides.

Parameters
[in]ioThe ADIOS2 IO
[in]engineThe ADIOS2 engine
[in]meshThe mesh

Variable Documentation

◆ field_ext

std::array field_ext = {"_real", "_imag"}
constexpr

String suffix for real and complex components of a vector-valued field