G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsParaviewDataSet Class Reference

Detailed Description

This class represents a group of vtk (Paraview) files that refer to one multiPatch, for one timestep.

This class is used by gsParaviewCollection to manage said files, but can be used by the user explicitly as well.

+ Collaboration diagram for gsParaviewDataSet:

Public Member Functions

template<class E >
void addField (const expr::_expr< E > &expr, std::string label)
 Evaluates an expression, and writes that data to the vtk files. More...
 
template<class T >
void addField (const gsField< T > field, std::string label)
 Evaluates a gsField ( the function part ), and writes that data to the vtk files. More...
 
template<class E , typename... Rest>
void addFields (std::vector< std::string > labels, const expr::_expr< E > &expr, Rest...rest)
 Recursive form of addField() More...
 
template<class T , typename... Rest>
void addFields (std::vector< std::string > labels, const gsField< T > field, Rest...rest)
 Recursive form of addField() More...
 
const std::vector< std::string > filenames ()
 Returns the names of the files created by this gsParaviewDataSet. More...
 
 gsParaviewDataSet (std::string basename, gsMultiPatch< real_t > *const geometry, gsExprEvaluator< real_t > *eval=nullptr, gsOptionList options=defaultOptions())
 Basic constructor. More...
 

Static Public Member Functions

static gsOptionList defaultOptions ()
 Accessor to the current options.
 

Private Member Functions

template<class E >
std::vector< std::string > toVTK (const expr::_expr< E > &expr, unsigned nPts=1000, unsigned precision=5, std::string label="SolutionField")
 Evaluates one expression over all patches and returns all <DataArray> xml tags as a vector of strings. More...
 

Static Private Member Functions

template<class T >
static std::string toDataArray (const gsMatrix< T > &points, const std::string label, unsigned precision)
 Formats the coordinates of points as a <DataArray> xml tag for ParaView export. More...
 
template<class T >
static std::vector< std::string > toVTK (const gsFunctionSet< T > &funSet, unsigned nPts=1000, unsigned precision=5, std::string label="")
 Evaluates gsFunctionSet over all pieces( patches ) and returns all <DataArray> xml tags as a vector of strings. More...
 

Constructor & Destructor Documentation

gsParaviewDataSet ( std::string  basename,
gsMultiPatch< real_t > *const  geometry,
gsExprEvaluator< real_t > *  eval = nullptr,
gsOptionList  options = defaultOptions() 
)

Basic constructor.

Parameters
basenameThe basename that will be used to create all the individual filenames
geometryA gsMultiPatch of the geometry that will be exported and where the fields are defined
evalOptional. A gsExprEvaluator, necessary when working with gsExpressions for evaluation purposes
optionsA set of options, if unspecified, defaultOptions() is called.

Member Function Documentation

void addField ( const expr::_expr< E > &  expr,
std::string  label 
)
inline

Evaluates an expression, and writes that data to the vtk files.

Template Parameters
E
Parameters
exprThe gsExpression to be evaluated
labelThe name that will be displayed in Paraview for this field.
void addField ( const gsField< T >  field,
std::string  label 
)
inline

Evaluates a gsField ( the function part ), and writes that data to the vtk files.

Template Parameters
T
Parameters
fieldThe gsField to be evaluated
labelThe name that will be displayed in Paraview for this field.
void addFields ( std::vector< std::string >  labels,
const expr::_expr< E > &  expr,
Rest...  rest 
)
inline

Recursive form of addField()

Template Parameters
E
...Rest
Parameters
labelsVector of strings, containing the names of the fields as they will be shown in ParaView.
exprThe expressions to be evaluated ( arbitrary number of them )
...rest
void addFields ( std::vector< std::string >  labels,
const gsField< T >  field,
Rest...  rest 
)
inline

Recursive form of addField()

Template Parameters
T
...Rest
Parameters
labelsVector of strings, containing the names of the fields as they will be shown in ParaView.
fieldThe gsFields to be evaluated ( arbitrary number of them )
...rest
const std::vector< std::string > filenames ( )

Returns the names of the files created by this gsParaviewDataSet.

Returns
A vector of strings
static std::string toDataArray ( const gsMatrix< T > &  points,
const std::string  label,
unsigned  precision 
)
inlinestaticprivate

Formats the coordinates of points as a <DataArray> xml tag for ParaView export.

Template Parameters
TArithmetic type
Parameters
pointsA gsMatrix<T> with the coordinates of the points, stored column-wise. Its size is (numDims, numPoints)
labelA string with the label of the data
precisionNumber of decimal points in xml output
Returns
The raw xml string
static std::vector<std::string> toVTK ( const gsFunctionSet< T > &  funSet,
unsigned  nPts = 1000,
unsigned  precision = 5,
std::string  label = "" 
)
inlinestaticprivate

Evaluates gsFunctionSet over all pieces( patches ) and returns all <DataArray> xml tags as a vector of strings.

Template Parameters
T
Parameters
funSetgsFunctionSet to be evaluated
nPtsNumber of evaluation points, per patch.
precisionNumber of decimal points in xml output
Returns
Vector of strings of all <DataArrays>
std::vector<std::string> toVTK ( const expr::_expr< E > &  expr,
unsigned  nPts = 1000,
unsigned  precision = 5,
std::string  label = "SolutionField" 
)
inlineprivate

Evaluates one expression over all patches and returns all <DataArray> xml tags as a vector of strings.

Template Parameters
T
Parameters
exprExpression to be evaluated
labelThe label with which the expression will appear in Paraview
Returns
Vector of strings of all <DataArrays>