25#define VTK_BEZIER_QUADRILATERAL 77
38 std::vector<std::string>
toVTK(
const gsFunctionSet<T>& funSet,
40 unsigned precision = 5,
41 std::string label =
"",
42 const bool& export_base64 =
false);
46 std::vector<std::string>
toVTK(
const gsField<T>& field,
48 unsigned precision = 5,
49 std::string label =
"",
50 const bool& export_base64 =
false);
63 template <
class MatrixType>
65 std::map<std::string, std::string> attributes={{
"",
""}},
66 unsigned precision = 5,
67 const bool& export_base64=
false);
78 std::vector<std::string>
toVTK(
const expr::_expr<E>& expr,
81 unsigned precision = 5,
82 std::string label =
"SolutionField",
83 const bool& export_base64 =
false)
85 std::vector<std::string> out;
88 const index_t n = evaltr->exprData()->multiBasis().nBases();
92 for (
index_t i = 0; i != n; ++i) {
94 bounding_box_dimensions =
95 evaltr->exprData()->multiBasis().piece(i).support();
96 gsGridIterator<real_t, CUBE> grid_iterator(bounding_box_dimensions,
98 evaltr->
eval(expr, grid_iterator, i);
102 evaltr->
elementwise().size() / grid_iterator.numPoints(),
103 grid_iterator.numPoints());
106 GISMO_ASSERT(evaluated_values.rows() <= 3,
"The expression can be scalar or have at most 3 components.");
107 if (evaluated_values.rows() == 2)
109 evaluated_values.conservativeResizeLike(gsEigen::MatrixXd::Zero(3,evaluated_values.cols()));
111 out.push_back(
toDataArray(evaluated_values,{{
"Name",label}}, precision,export_base64));
134 GISMO_EXPORT std::string
toDataArray(
index_t num, std::map<std::string, std::string> attributes={{
"",
""}});
139 std::string BezierVTK(
const gsMultiPatch<T> & mPatch);
142#undef VTK_BEZIER_QUADRILATERAL
144#ifndef GISMO_BUILD_LIB
145#include GISMO_HPP_HEADER(gsParaviewUtils.hpp)
Generic evaluator of isogeometric expressions.
Definition gsExprEvaluator.h:39
gsAsConstVector< T > allValues() const
Returns a vector containing the last computed values per element.
Definition gsExprEvaluator.h:102
const std::vector< T > & elementwise() const
Returns an std::vector containing the last computed values per element.
Definition gsExprEvaluator.h:99
void eval(const expr::_expr< E > &expr, gsGridIterator< T, mode, d > &git, const index_t patchInd=0)
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
#define index_t
Definition gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides the gsDofMapper class for re-indexing DoFs.
Generic expressions evaluator.
Generic expressions helper.
Provides forward declarations of types and structs.
Provides declaration of Basis abstract interface.
The G+Smo namespace, containing all definitions for the library.
gsMatrix< real_t > vtkIDTransform(index_t nU, index_t nV)
ID transformation between G+Smo and vtk control point IDs.
Definition gsParaviewUtils.cpp:23
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
std::string toDataArray(index_t num, std::map< std::string, std::string > attributes)
Converts an integer to a 'DataArray' xml tag, which is returned as a string.
Definition gsParaviewUtils.cpp:66