KASKADE 7 development version
Modules | Classes | Functions
IO

Input and Output functionality. More...

Modules

 Grid input
 Grid creation or input.
 
 Entropy coding
 Tools for entropy coding, i.e. storing sequences of symbols with different frequencies in a (small) bitstream.
 

Classes

struct  Kaskade::IoOptions
 options for VTK/AMIRA output More...
 
class  Kaskade::TimeSeriesVTKWriter
 

Functions

template<class Scalar , int n, int m, class Allocator >
void bcrsPrint (Dune::BCRSMatrix< Dune::FieldMatrix< Scalar, n, m >, Allocator > const &A, std::ostream &os=std::cout)
 Pretty prints the sparse matrix A to the given output stream. More...
 
template<class Scalar , int n, int m, class Allocator >
std::ostream & operator<< (std::ostream &os, Dune::BCRSMatrix< Dune::FieldMatrix< Scalar, n, m >, Allocator > const &A)
 Pretty prints the sparse matrix A to the given output stream. More...
 
std::string Kaskade::paddedString (int n, int places=3)
 creates a zero-padded string representation of the given number More...
 
template<class GridView , class Writer , class VariableSet , class Filter , class Options >
void Kaskade::writePartialFile (GridView const &gridView, Writer &writer, VariableSet const &vars, std::string const &filename, Filter const &filter, Options const &options)
 
template<class Entry , class Index , class VEntry >
void Kaskade::writeToMatlabBinary (NumaBCRSMatrix< Entry, Index > const &A, Dune::BlockVector< VEntry > const &b, std::string const &basename, std::string const &path, int precision=16)
 Writes the given matrix and vector to an binary file based zero. More...
 
template<class Entry , class Index >
void Kaskade::writeToMatlab (NumaBCRSMatrix< Entry, Index > const &A, std::string const &basename, std::string const &outPath, int precision=16)
 Writes the given matrix to an executable matlab file. More...
 
template<class Entry , class Index , class VEntry >
void Kaskade::writeToMatlab (NumaBCRSMatrix< Entry, Index > const &A, Dune::BlockVector< VEntry > const &b, std::string const &basename, int precision=16)
 Writes the given matrix and vector to an executable matlab file. More...
 
template<class Assembler >
void Kaskade::writeToMatlab (Assembler const &assembler, std::string const &basename, int precision=16)
 
template<class Function >
void Kaskade::writeVTK (Function const &f, std::string const &filename, IoOptions options, std::string fname)
 Writes a single finite element function to a VTK file. More...
 
template<class VariableSet >
void Kaskade::writeVTK (VariableSet const &vars, IoOptions options, std::ostream &s)
 Writes a set of finite element functions in VTK XML format to a stream. More...
 
template<class VariableSet >
void Kaskade::writeVTK (VariableSet const &vars, std::string fname, IoOptions const &options)
 Writes a set of finite element functions in VTK XML format to a file. More...
 

Detailed Description

Input and Output functionality.

Function Documentation

◆ bcrsPrint()

template<class Scalar , int n, int m, class Allocator >
void bcrsPrint ( Dune::BCRSMatrix< Dune::FieldMatrix< Scalar, n, m >, Allocator > const &  A,
std::ostream &  os = std::cout 
)

Pretty prints the sparse matrix A to the given output stream.

Definition at line 799 of file fixdune.hh.

Referenced by operator<<().

◆ operator<<()

template<class Scalar , int n, int m, class Allocator >
std::ostream & operator<< ( std::ostream &  os,
Dune::BCRSMatrix< Dune::FieldMatrix< Scalar, n, m >, Allocator > const &  A 
)

Pretty prints the sparse matrix A to the given output stream.

Definition at line 817 of file fixdune.hh.

◆ paddedString()

std::string Kaskade::paddedString ( int  n,
int  places = 3 
)

creates a zero-padded string representation of the given number

Use this to construct sequences of filenames.

Parameters
nthe number to represent as string
placesthe total number of digits

Referenced by Kaskade::TimeSeriesVTKWriter::add(), and Kaskade::VariableSetDescription< SpaceList, VariableList >::makeVariableSetDescription().

◆ writePartialFile()

template<class GridView , class Writer , class VariableSet , class Filter , class Options >
void Kaskade::writePartialFile ( GridView const &  gridView,
Writer &  writer,
VariableSet const &  vars,
std::string const &  filename,
Filter const &  filter,
Options const &  options 
)

Writes a subset of variables contained in the variable set vars with names taken from the description to an Amira or VTK XML file with the name specified by filename. The subset is specified by the STL predicate filter working on the variable names.

Parameters
gridViewGridView, i.e. LeafGridView
writerwriter for mesh data and solution data, e.g., LeafAmiraMeshWriter, VTKWriter
varsdata of variables
filenamename of output file
filterfilter for selecting variables to be written
optionsdefines the format for the output,e.g., ascii/binary

Definition at line 191 of file iobase.hh.

Referenced by Kaskade::writeAMIRAFile().

◆ writeToMatlab() [1/3]

template<class Assembler >
void Kaskade::writeToMatlab ( Assembler const &  assembler,
std::string const &  basename,
int  precision = 16 
)

Writes the assembled matrix and right hand side of a VariationalFunctionalAssembler to the given file. The contents is a Matlab function that can be executed. The file extension .m is appended automatically.

Parameters
[in]assemblera VariationalFunctionalAssembler containing the matrix and the right hand side
[in]basenamethe file name to be written to. A ".m" suffix is appended automatically.
[in]precisionthe number of valid decimal digits written for each scalar

Definition at line 214 of file matlab.hh.

◆ writeToMatlab() [2/3]

template<class Entry , class Index , class VEntry >
void Kaskade::writeToMatlab ( NumaBCRSMatrix< Entry, Index > const &  A,
Dune::BlockVector< VEntry > const &  b,
std::string const &  basename,
int  precision = 16 
)

Writes the given matrix and vector to an executable matlab file.

Definition at line 165 of file matlab.hh.

◆ writeToMatlab() [3/3]

template<class Entry , class Index >
void Kaskade::writeToMatlab ( NumaBCRSMatrix< Entry, Index > const &  A,
std::string const &  basename,
std::string const &  outPath,
int  precision = 16 
)

Writes the given matrix to an executable matlab file.

Definition at line 128 of file matlab.hh.

◆ writeToMatlabBinary()

template<class Entry , class Index , class VEntry >
void Kaskade::writeToMatlabBinary ( NumaBCRSMatrix< Entry, Index > const &  A,
Dune::BlockVector< VEntry > const &  b,
std::string const &  basename,
std::string const &  path,
int  precision = 16 
)

Writes the given matrix and vector to an binary file based zero.

Definition at line 76 of file matlab.hh.

◆ writeVTK() [1/3]

template<class Function >
void Kaskade::writeVTK ( Function const &  f,
std::string const &  filename,
IoOptions  options,
std::string  fname 
)

Writes a single finite element function to a VTK file.

Template Parameters
Functionthe finite element function type
Parameters
[in]fthe function to plot
[in]filenamethe name of the output file (.vtu is appended automatically)
[in]options
[in]fnamename of the function in the VTK output file. If empty, the filename is used.

Definition at line 56 of file vtk.hh.

Referenced by Kaskade::TimeSeriesVTKWriter::add(), and Kaskade::writeVTK().

◆ writeVTK() [2/3]

template<class VariableSet >
void Kaskade::writeVTK ( VariableSet const &  vars,
IoOptions  options,
std::ostream &  s 
)

Writes a set of finite element functions in VTK XML format to a stream.

Parameters
varsa set of finite element functions to write
optionsspecifies how the data shall be written
sthe output stream

Definition at line 530 of file vtkwriter.hh.

◆ writeVTK() [3/3]

template<class VariableSet >
void Kaskade::writeVTK ( VariableSet const &  vars,
std::string  fname,
IoOptions const &  options 
)

Writes a set of finite element functions in VTK XML format to a file.

Parameters
varsa set of finite element functions
fnamefile name (without trailing .vtu)

Note that Paraview can create a time line implicitly from numbered files. Use paddedString for easy creation of numbered file names.

writeVTK(u,"output-"+paddedString(step),IoOptions());
std::string paddedString(int n, int places=3)
creates a zero-padded string representation of the given number
void writeVTK(Function const &f, std::string const &filename, IoOptions options, std::string fname)
Writes a single finite element function to a VTK file.
Definition: vtk.hh:56
options for VTK/AMIRA output
Definition: iobase.hh:77

Definition at line 650 of file vtkwriter.hh.