FEOutput< dim, VectorType > Class Template Reference#

DiFfRG: DiFfRG::FEOutput< dim, VectorType > Class Template Reference
DiFfRG
DiFfRG::FEOutput< dim, VectorType > Class Template Reference

A class to output finite element data to disk as .vtu files and .pvd time series. More...

#include <fe_output.hh>

Public Member Functions

 FEOutput (std::string top_folder, std::string output_name, std::string output_folder, const JSONValue &json)
 Construct a new FEOutput object.
 
 FEOutput ()
 
 ~FEOutput ()
 
void set_hdf5_output (HDF5Output *output)
 
void attach (const DoFHandler< dim > &dof_handler, const VectorType &solution, const std::string &name)
 Attach a solution to the output.
 
void attach (const DoFHandler< dim > &dof_handler, const VectorType &solution, const std::vector< std::string > &names)
 Attach a solution to the output.
 
void flush (double time)
 Flush all attached solutions to disk.
 

Private Member Functions

void update_buffers ()
 

Private Attributes

const std::string top_folder
 
const std::string output_name
 
const std::string output_folder
 
const std::string filename_pvd
 
const uint buffer_size
 
uint series_number
 
uint subdivisions
 
std::vector< std::pair< double, std::string > > time_series
 
std::vector< DataOut< safe_dim > > data_outs
 
std::list< std::thread > output_threads
 
std::list< uintoutput_thread_series
 
std::list< std::list< typename VectorMemory< VectorType >::Pointer > > attached_solutions
 
std::mutex output_mutex
 
std::mutex exception_mutex
 
std::exception_ptr stored_exception
 
GrowingVectorMemory< VectorType > mem
 
HDF5Outputhdf5_output = nullptr
 
bool save_vtk
 

Static Private Attributes

static constexpr uint safe_dim = dim == 0 ? 1 : dim
 

Detailed Description

template<uint dim, typename VectorType>
class DiFfRG::FEOutput< dim, VectorType >

A class to output finite element data to disk as .vtu files and .pvd time series.

Template Parameters
dimDimension of the problem
VectorTypeType of the vector

Constructor & Destructor Documentation

◆ FEOutput() [1/2]

template<uint dim, typename VectorType >
DiFfRG::FEOutput< dim, VectorType >::FEOutput ( std::string top_folder,
std::string output_name,
std::string output_folder,
const JSONValue & json )

Construct a new FEOutput object.

Parameters
dof_handlerDoFHandler associated with the solution
top_folderFolder where the output will be written, i.e. the folder containing the .pvd file.
output_nameName of the output, i.e. the name of the .pvd file.
output_folderFolder where the .vtu files will be saved. Should be relative to top_folder.
subdivisionsNumber of subdivisions of the cells in the .vtu files.

◆ FEOutput() [2/2]

template<uint dim, typename VectorType >
DiFfRG::FEOutput< dim, VectorType >::FEOutput ( )

◆ ~FEOutput()

template<uint dim, typename VectorType >
DiFfRG::FEOutput< dim, VectorType >::~FEOutput ( )

Member Function Documentation

◆ attach() [1/2]

template<uint dim, typename VectorType >
void DiFfRG::FEOutput< dim, VectorType >::attach ( const DoFHandler< dim > & dof_handler,
const VectorType & solution,
const std::string & name )

Attach a solution to the output.

Parameters
dof_handlerThe DoFHandler associated with the solution.
solutionThe solution to attach.
nameThe name of the solution.

◆ attach() [2/2]

template<uint dim, typename VectorType >
void DiFfRG::FEOutput< dim, VectorType >::attach ( const DoFHandler< dim > & dof_handler,
const VectorType & solution,
const std::vector< std::string > & names )

Attach a solution to the output.

Parameters
dof_handlerThe DoFHandler associated with the solution.
solutionThe solution to attach.
namesThe names of each component of the solution.

◆ flush()

template<uint dim, typename VectorType >
void DiFfRG::FEOutput< dim, VectorType >::flush ( double time)

Flush all attached solutions to disk.

Parameters
timeThe time tag to attach to the solution.

◆ set_hdf5_output()

template<uint dim, typename VectorType >
void DiFfRG::FEOutput< dim, VectorType >::set_hdf5_output ( HDF5Output * output)

◆ update_buffers()

template<uint dim, typename VectorType >
void DiFfRG::FEOutput< dim, VectorType >::update_buffers ( )
private

Member Data Documentation

◆ attached_solutions

template<uint dim, typename VectorType >
std::list<std::list<typename VectorMemory<VectorType>::Pointer> > DiFfRG::FEOutput< dim, VectorType >::attached_solutions
private

◆ buffer_size

template<uint dim, typename VectorType >
const uint DiFfRG::FEOutput< dim, VectorType >::buffer_size
private

◆ data_outs

template<uint dim, typename VectorType >
std::vector<DataOut<safe_dim> > DiFfRG::FEOutput< dim, VectorType >::data_outs
private

◆ exception_mutex

template<uint dim, typename VectorType >
std::mutex DiFfRG::FEOutput< dim, VectorType >::exception_mutex
private

◆ filename_pvd

template<uint dim, typename VectorType >
const std::string DiFfRG::FEOutput< dim, VectorType >::filename_pvd
private

◆ hdf5_output

template<uint dim, typename VectorType >
HDF5Output* DiFfRG::FEOutput< dim, VectorType >::hdf5_output = nullptr
private

◆ mem

template<uint dim, typename VectorType >
GrowingVectorMemory<VectorType> DiFfRG::FEOutput< dim, VectorType >::mem
private

◆ output_folder

template<uint dim, typename VectorType >
const std::string DiFfRG::FEOutput< dim, VectorType >::output_folder
private

◆ output_mutex

template<uint dim, typename VectorType >
std::mutex DiFfRG::FEOutput< dim, VectorType >::output_mutex
private

◆ output_name

template<uint dim, typename VectorType >
const std::string DiFfRG::FEOutput< dim, VectorType >::output_name
private

◆ output_thread_series

template<uint dim, typename VectorType >
std::list<uint> DiFfRG::FEOutput< dim, VectorType >::output_thread_series
private

◆ output_threads

template<uint dim, typename VectorType >
std::list<std::thread> DiFfRG::FEOutput< dim, VectorType >::output_threads
private

◆ safe_dim

template<uint dim, typename VectorType >
uint DiFfRG::FEOutput< dim, VectorType >::safe_dim = dim == 0 ? 1 : dim
staticconstexprprivate

◆ save_vtk

template<uint dim, typename VectorType >
bool DiFfRG::FEOutput< dim, VectorType >::save_vtk
private

◆ series_number

template<uint dim, typename VectorType >
uint DiFfRG::FEOutput< dim, VectorType >::series_number
private

◆ stored_exception

template<uint dim, typename VectorType >
std::exception_ptr DiFfRG::FEOutput< dim, VectorType >::stored_exception
private

◆ subdivisions

template<uint dim, typename VectorType >
uint DiFfRG::FEOutput< dim, VectorType >::subdivisions
private

◆ time_series

template<uint dim, typename VectorType >
std::vector<std::pair<double, std::string> > DiFfRG::FEOutput< dim, VectorType >::time_series
private

◆ top_folder

template<uint dim, typename VectorType >
const std::string DiFfRG::FEOutput< dim, VectorType >::top_folder
private

The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/data/fe_output.hh