ADIOS2-based output writers.
More...
#include "vtk_utils.h"
#include <adios2.h>
#include <algorithm>
#include <basix/mdspan.hpp>
#include <cassert>
#include <complex>
#include <concepts>
#include <dolfinx/common/IndexMap.h>
#include <dolfinx/fem/DofMap.h>
#include <dolfinx/fem/FiniteElement.h>
#include <dolfinx/fem/Function.h>
#include <dolfinx/mesh/Geometry.h>
#include <dolfinx/mesh/Mesh.h>
#include <filesystem>
#include <memory>
#include <mpi.h>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <variant>
#include <vector>
Go to the source code of this file.
|
| 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.
|
| 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::tuple< std::vector< std::string >, 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.
|
|
| constexpr std::array | field_ext = {"_real", "_imag"} |
ADIOS2-based output writers.
◆ 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.
◆ 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] | io | ADIOS2 io object. |
| [in] | engine | ADIOS2 engine object. |
| [in] | u | Function 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] | io | The ADIOS2 io object |
| [in] | engine | The ADIOS2 engine object |
| [in] | mesh | The 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] | io | The ADIOS2 io object |
| [in] | engine | The ADIOS2 engine object |
| [in] | V | The function space |
◆ field_ext
| std::array field_ext = {"_real", "_imag"} |
|
constexpr |
String suffix for real and complex components of a vector-valued field