40 std::string m_basename;
41 std::vector<std::string> m_filenames;
61 m_options(defaultOptions()),
70 void addField(
const expr::_expr<E>& expr, std::string label) {
72 "You cannot add more fields if the gsParaviewDataSet has "
76 const unsigned nPts = m_options.
askInt(
"numPoints", 1000);
77 const unsigned precision = m_options.
askInt(
"precision", 5);
78 const bool export_base64 = m_options.
askSwitch(
"base64",
false);
83 const std::vector<std::string> tags =
84 toVTK(expr, m_evaltr, nPts, precision, label, export_base64);
85 std::vector<std::string> fnames = filenames();
91 file.open(fnames[k].c_str(), std::ios_base::app);
98 void addFields(std::vector<std::string>){ }
107 template <
class E,
typename... Rest>
108 void addFields(std::vector<std::string> labels,
const expr::_expr<E> & expr, Rest... rest) {
110 GISMO_ENSURE(
sizeof...(Rest) == labels.size() - 1,
"The length of labels must match the number of expressions provided" );
111 std::vector<std::string> newlabels(labels.cbegin()+1, labels.cend());
114 addField( expr, labels[0]);
115 addFields( newlabels, rest...);
126 "You cannot add more fields if the gsParaviewDataSet has "
133 "Provided gsField and stored geometry are not compatible!");
136 const unsigned nPts = m_options.
askInt(
"numPoints", 1000);
137 const unsigned precision = m_options.
askInt(
"precision", 5);
138 const bool export_base64 = m_options.
askSwitch(
"base64",
false);
140 const std::vector<std::string> tags =
141 toVTK(field, nPts, precision, label, export_base64);
142 const std::vector<std::string> fnames = filenames();
148 file.open(fnames[k].c_str(), std::ios_base::app);
160 template <
class T,
typename... Rest>
163 std::vector<std::string> newlabels(labels.cbegin()+1, labels.cend());
165 addField( field, labels[0]);
166 addFields( newlabels, rest...);
171 const std::vector<std::string> filenames();
183 opt.
addInt(
"numPoints",
"Number of points per-patch.", 1000);
184 opt.
addInt(
"precision",
"Number of decimal digits.", 5);
185 opt.
addInt(
"plotElements.resolution",
"Drawing resolution for element mesh.", -1);
186 opt.
addSwitch(
"makeSubfolder",
"Export vtk files to subfolder ( below the .pvd file ).",
true);
187 opt.
addSwitch(
"base64",
"Export in base64 binary format",
false);
188 opt.
addString(
"subfolder",
"Name of subfolder where the vtk files will be stored.",
"");
189 opt.
addSwitch(
"plotElements",
"Controls plotting of element mesh.",
false);
190 opt.
addSwitch(
"plotControlNet",
"Controls plotting of control point grid.",
false);
198 void initFilenames();
Generic evaluator of isogeometric expressions.
Definition gsExprEvaluator.h:39
A scalar of vector field defined on a m_parametric geometry.
Definition gsField.h:55
int nPieces() const
Returns the number of pieces.
Definition gsField.h:200
short_t geoDim() const
Returns the dimension of the physical domain (e.g., if the domain is a surface in three-dimensional s...
Definition gsField.h:190
short_t parDim() const
Returns the dimension of the parameter domain (e.g., if the domain is a surface in three-dimensional ...
Definition gsField.h:186
const gsMultiPatch< T > & patches() const
Returns gsMultiPatch containing the geometric information on the domain.
Definition gsField.h:210
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
short_t targetDim() const
Dimension of the target space.
Definition gsMultiPatch.h:258
index_t nPieces() const
Number of pieces in the domain of definition.
Definition gsMultiPatch.h:193
short_t domainDim() const
Dimension of the (source) domain.
Definition gsMultiPatch.h:254
index_t coefsSize() const
Return the number of coefficients (control points)
Definition gsMultiPatch.h:198
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
void addInt(const std::string &label, const std::string &desc, const index_t &value)
Adds a option named label, with description desc and value value.
Definition gsOptionList.cpp:201
bool askSwitch(const std::string &label, const bool &value=false) const
Reads value for option label from options.
Definition gsOptionList.cpp:128
index_t askInt(const std::string &label, const index_t &value=0) const
Reads value for option label from options.
Definition gsOptionList.cpp:117
void addSwitch(const std::string &label, const std::string &desc, const bool &value)
Adds a option named label, with description desc and value value.
Definition gsOptionList.cpp:235
void addString(const std::string &label, const std::string &desc, const std::string &value)
Adds a option named label, with description desc and value value.
Definition gsOptionList.cpp:190
This class represents a group of vtk (Paraview) files that refer to one multiPatch,...
Definition gsParaviewDataSet.h:38
void addField(const expr::_expr< E > &expr, std::string label)
Evaluates an expression, and writes that data to the vtk files.
Definition gsParaviewDataSet.h:70
void addFields(std::vector< std::string > labels, const expr::_expr< E > &expr, Rest... rest)
Recursive form of addField()
Definition gsParaviewDataSet.h:108
void addField(const gsField< T > field, std::string label)
Evaluates a gsField ( the function part ), and writes that data to the vtk files.
Definition gsParaviewDataSet.h:124
void addFields(std::vector< std::string > labels, const gsField< T > field, Rest... rest)
Recursive form of addField()
Definition gsParaviewDataSet.h:161
static gsOptionList defaultOptions()
Accessor to the current options.
Definition gsParaviewDataSet.h:180
#define index_t
Definition gsConfig.h:32
#define GISMO_ENSURE(cond, message)
Definition gsDebug.h:102
Provides the gsDofMapper class for re-indexing DoFs.
Generic expressions evaluator.
Generic expressions helper.
Provides forward declarations of types and structs.
Input and output Utilities.
Provides declaration of Basis abstract interface.
ParaView output Utilities.
The G+Smo namespace, containing all definitions for the library.
std::vector< std::string > toVTK(const gsFunctionSet< T > &funSet, unsigned nPts=1000, unsigned precision=5, std::string label="", const bool &export_base64=false)
Evaluates gsFunctionSet over all pieces( patches ) and returns all <DataArray> xml tags as a vector o...
Definition gsParaviewUtils.hpp:35