54 template <
class Function>
68 auto fs = vsDescription.variableSet();
79 template <
class Spaces,
class Variables,
class Functions>
86 return std::pair(varSetDesc,fs);
89 template <
class Spaces,
class Variables,
class Functions,
class Function,
typename... Args>
91 Function const& f, std::string name, Args
const&... args)
99 auto newFs = bf::as_vector(bf::push_back(fs,&f));
101 auto newSpaces = bf::as_vector(bf::push_back(spaces,&f.space()));
103 constexpr int index = bf::size(spaces);
105 auto newVars = bf::as_vector(bf::push_back(vars,newVar));
111 template <
class Function,
typename ...Args>
113 Function const& f, std::string name, Args
const&... args)
120 f, std::move(name), args...);
123 using VarSetDesc =
decltype(varSetDesc);
126 auto varSet = varSetDesc.variableSet();
129 bf::for_each(
typename VarSetDesc::Variables(),[&](
auto const& var)
131 component<var.id>(varSet) = *bf::at_c<var.id>(fsCopy);
152 : base(basename), pvd((basename+
".pvd").c_str()), count(0), options(options_)
154 pvd <<
"<?xml version=\"1.0\"?>\n"
155 <<
"<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"" << VTKWriterDetail::vtkEndianness() <<
"\">\n"
156 <<
" <Collection>\n";
162 template <
class VariableSet>
168 pvd <<
" <DataSet timestep=\"" << time <<
"\" file=\"" << fname <<
".vtu\" />\n";
174 pvd <<
" </Collection>\n"
Function is the interface for evaluatable functions .
void add(double time, VariableSet const &vars)
Adds frame with values given by vars at time time to the series.
TimeSeriesVTKWriter(std::string const &basename, IoOptions options_=ioOptions_default)
A class for storing a heterogeneous collection of FunctionSpaceElement s.
int count(Cell const &cell, int codim)
Computes the number of subentities of codimension c of a given entity.
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.
auto makeSpaceList(Spaces *... spaces)
Creates a list of finite element spaces in the required format. Usage example (for Stokes flow):
VariableSetDescription< SpaceList, VariableList > makeVariableSetDescription(SpaceList const &spaces, VariableList const &vars)
Creates a variable set description from given spaces and variables.
Output of mesh and solution for visualization software.
auto makeVariableSet(Spaces spaces, Variables vars, Functions fs)
IoOptions ioOptions_default
auto & component(LinearProductSpace< Scalar, Sequence > &x)
Helper class for specifying the number of components of a variable.
options for VTK/AMIRA output
Helper class for specifying the FE space index of a variable.
A class defining elementary information about a single variable.
Variables and their descriptions.