G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsWriteParaview.h
Go to the documentation of this file.
1
15#include <gsCore/gsExport.h>
16
17#include <sstream>
18#include <fstream>
19
20#pragma once
21
22#define NS 1000
23
24
25namespace gismo {
26
27
37template<class T>
38void gsWriteParaview(const gsGeometry<T> & Geo, std::string const & fn,
39 unsigned npts=NS, bool mesh = false, bool ctrlNet = false);
40
49template<class T>
50void gsWriteParaview(gsMappedSpline<2,T> const& mspline,
51 std::string const & fn,unsigned npts = NS);
52
53
54
55
65template<class T>
66void gsWriteParaview(gsMultiPatch<T> const& mp, gsMultiBasis<T> const& mb,
67 std::string const & fn, unsigned npts = NS);
68
80template<class T>
81void gsWriteParaview(gsFunctionSet<T> const& geom,
82 gsMappedBasis<2,T> const& mbasis,
83 std::string const & fn,unsigned npts = NS,
84 const bool fullsupport = false,
85 const std::vector<index_t> indices = std::vector<index_t>());
86
92//template <class T>
93//void gsWriteParaview(gsMesh<T> const& sl, std::string const & fn, bool pvd = true);
94
96template <class T>
97void gsWriteParaview(gsMesh<T> const& sl, std::string const & fn, const gsMatrix<T>& params);
98
99GISMO_EXPORT void gsWriteParaview(const gsSurfMesh & sm,
100 std::string const & fn,
101 std::initializer_list<std::string> props = {});
102
107template <typename T>
108void gsWriteParaview(const std::vector<gsMesh<T> >& meshes, std::string const& fn);
109
110
118template<class T>
119void gsWriteParaview(const gsField<T> & field, std::string const & fn,
120 unsigned npts=NS, bool mesh = false, const std::string pDelim = "");
121
128template<class T>
129void gsWriteParaview(gsFunctionSet<T> const& geo, gsFunctionSet<T> const& func,
130 std::string const & fn, unsigned npts = NS, const std::string pDelim = "");
131
139template<class T>
140void gsWriteParaview(const gsMultiPatch<T> & Geo, std::string const & fn,
141 unsigned npts=NS, bool mesh = false, bool ctrlNet = false, const std::string pDelim = "_")
142{
143 gsWriteParaview( Geo.patches(), fn, npts, mesh, ctrlNet, pDelim);
144}
145
152template<class T>
153void gsWriteParaviewBezier(const gsMultiPatch<T> & mPatch, std::string const & filename, bool ctrlNet = false);
154
162template<class T>
163void gsWriteParaview( std::vector<gsGeometry<T> *> const & Geo,
164 std::string const & fn, unsigned npts=NS,
165 bool mesh = false, bool ctrlNet = false, const std::string pDelim = "_");
166
168template<class T>
169void gsWriteParaview(const gsMultiBasis<T> & mb, const gsMultiPatch<T> & domain,
170 std::string const & fn, unsigned npts);
171
178template<class T>
179void gsWriteParaview_basisFnct(int i, gsBasis<T> const& basis,
180 std::string const & fn, unsigned npts =NS);
181
182
188template<class T>
189void gsWriteParaview(const gsGeometrySlice<T> & Geo,
190 std::string const & fn, unsigned npts =NS);
191
197template<class T>
198void gsWriteParaview(gsFunctionSet<T> const& func,
199 std::string const & fn,
200 unsigned npts =NS);
201
210template<class T>
211void gsWriteParaview(gsFunction<T> const& func,
212 gsMatrix<T> const& supp,
213 std::string const & fn,
214 unsigned npts =NS,
215 bool graph = true);
216
223template<class T>
224void gsWriteParaview(gsBasis<T> const& basis, std::string const & fn,
225 unsigned npts =NS, bool mesh = false);
226
233template<class T>
234void gsWriteParaview(gsBasis<T> const& basis,
235 std::vector<index_t> const & indices,
236 std::string const & fn,
237 unsigned npts =NS, bool mesh = false);
238
244template<class T>
245void gsWriteParaview(const gsMatrix<T> & box, std::string const & fn, T value = 0.0);
246
251template<class T>
252void gsWriteParaview(const gsMatrix<T> & box, const gsVector<T> & values, std::string const & fn);
253
258template<class T>
259void gsWriteParaview(const gsHBox<2,T> & box, std::string const & fn);
260
267template<class T>
268void gsWriteParaview(const gsHBoxContainer<2,T> & box, std::string const & fn);
269
270
276template<class T>
277void gsWriteParaviewPoints(gsMatrix<T> const& X,
278 gsMatrix<T> const& Y,
279 std::string const & fn);
280
287template<class T>
288void gsWriteParaviewPoints(gsMatrix<T> const& X,
289 gsMatrix<T> const& Y,
290 gsMatrix<T> const& Z,
291 std::string const & fn);
292
300template<class T>
301void gsWriteParaviewPoints(gsMatrix<T> const& X,
302 gsMatrix<T> const& Y,
303 gsMatrix<T> const& Z,
304 gsMatrix<T> const& V,
305 std::string const & fn);
306
311template<class T>
312void gsWriteParaviewPoints(gsMatrix<T> const& points, std::string const & fn);
313
320//template<class T>
321//void gsWriteParaviewTPgrid(gsMatrix<T> const& points,
322// gsMatrix<T> const& data,
323// const gsVector<index_t> & np,
324// std::string const & fn);
325
339template <class T>
340void gsWriteParaview(gsSolid<T> const& sl, std::string const & fn,
341 unsigned numPoints_for_eachCurve=50, int vol_Num=0,
342 T edgeThick=0.01, gsVector3d<T> const & translate=gsVector3d<T>(0,0,0),
343 int color_convex=0, int color_nonconvex=20, int color_eloop=10,
344 std::vector<unsigned> const & eloop=std::vector<unsigned>());
345
347template <class T>
348void gsWriteParaviewSolid(gsSolid<T> const& sl,
349 std::string const & fn,
350 unsigned numSamples = NS);
351
357template<class T>
358void gsWriteParaview(gsCurveLoop<T> const & cloop, std::string const & fn, unsigned npts)
359{
360 std::vector<gsGeometry<T> *> all_curves;
361 for(index_t j =0; j< cloop.numCurves() ; j++)
362 all_curves.push_back( const_cast<gsCurve<T> *>(cloop.curve(j)) );
363
364 gsWriteParaview( all_curves, fn, npts);
365}
366
372template<class T>
373void gsWriteParaview(gsPlanarDomain<T> const & pdomain,
374 std::string const & fn, unsigned npts=NS);
375
377template<class T>
378void gsWriteParaview(const gsTrimSurface<T> & ts, std::string const & fn,
379 unsigned npts=NS, bool trimCurves = false);
380
388template<typename T>
389void gsWriteParaview(const gsVolumeBlock<T>& volBlock,
390 std::string const & fn,
391 unsigned npts = NS);
392
401template<class T>
402void gsWriteParaviewBdr(gsMultiPatch<T> const & patches,
403 std::string const & fn,
404 unsigned npts, bool ctrlNet);
405
414template<class T>
415void gsWriteParaviewIfc(gsMultiPatch<T> const & patches,
416 std::string const & fn,
417 unsigned npts, bool ctrlNet);
418
424template<class T>
425void gsWriteParaview(gsMultiPatch<T> const & patches,
426 typename gsBoundaryConditions<T>::bcContainer const & bcs,
427 std::string const & fn, unsigned npts=NS, bool ctrlNet=false);
428
436template<typename T>
437void gsWriteParaviewTrimmedCurve(const gsTrimSurface<T>& surf,
438 const unsigned idLoop,
439 const unsigned idCurve,
440 const std::string fn,
441 unsigned npts = NS);
442
443// function to plot a field on a single patch
444template<class T>
445void writeSinglePatchField(const gsFunction<T> & geometry,
446 const gsFunction<T> & parField,
447 const bool isParam,
448 std::string const & fn, unsigned npts);
449
451template<class T>
452void writeSingleCompMesh(const gsBasis<T> & basis, const gsGeometry<T> & Geo,
453 std::string const & fn, unsigned resolution = 8);
454
456template<class T>
457void writeSingleBox(const gsMatrix<T> & box, std::string const & fn, T value);
458
460template<class T>
461void writeSingleHBox(const gsHBox<2,T> & box, std::string const & fn);
462
464template<class T>
465void writeSingleControlNet(const gsGeometry<T> & Geo,
466 std::string const & fn);
467
468// Please document
469template <class T>
470void plot_errors(const gsMatrix<T> & orig,
471 const gsMatrix<T> & comp,
472 std::vector<T> const & errors,
473 std::string const & fn);
474
475
476#ifdef GISMO_WITH_PYBIND11
477
481 void pybind11_init_gsWriteParaview(pybind11::module &m);
482
483#endif // GISMO_WITH_PYBIND11
484
485
486} // namespace gismo
487
488
489
490#undef NS
491
492
493#ifndef GISMO_BUILD_LIB
494#include GISMO_HPP_HEADER(gsWriteParaview.hpp)
495#endif
A closed loop given by a collection of curves.
Definition gsCurveLoop.h:37
int numCurves() const
get Number of curves
Definition gsCurveLoop.h:172
Abstract base class representing a curve.
Definition gsCurve.h:31
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
PatchContainer const & patches() const
Returns a vector of patches // to do : replace by copies.
Definition gsMultiPatch.h:277
#define index_t
Definition gsConfig.h:32
Handles shared library creation and other class attributes.
Provides forward declarations of types and structs.
The G+Smo namespace, containing all definitions for the library.
void gsWriteParaviewSolid(gsSolid< T > const &sl, std::string const &fn, unsigned numSamples=NS)
Export a gsSolid to Paraview file.
Definition gsWriteParaview.hpp:1781
void writeSingleHBox(const gsHBox< 2, T > &box, std::string const &fn)
Export a gsHBox.
Definition gsWriteParaview.hpp:1296
void gsWriteParaview_basisFnct(int i, gsBasis< T > const &basis, std::string const &fn, unsigned npts=NS)
Export i-th Basis function to paraview file.
Definition gsWriteParaview.hpp:1011
void writeSingleCompMesh(const gsBasis< T > &basis, const gsGeometry< T > &Geo, std::string const &fn, unsigned resolution=8)
Export a computational mesh.
Definition gsWriteParaview.hpp:232
void writeSingleBox(const gsMatrix< T > &box, std::string const &fn, T value)
Export an element box.
Definition gsWriteParaview.hpp:1237
void writeSingleControlNet(const gsGeometry< T > &Geo, std::string const &fn)
Export a control net.
Definition gsWriteParaview.hpp:248
void gsWriteParaviewBdr(gsMultiPatch< T > const &patches, std::string const &fn, unsigned npts, bool ctrlNet)
Writes the boundaries of a multipatch to paraview.
Definition gsWriteParaview.hpp:2070
void gsWriteParaviewTrimmedCurve(const gsTrimSurface< T > &surf, const unsigned idLoop, const unsigned idCurve, const std::string fn, unsigned npts=NS)
Export a boundary/hole curve in trimmed surface.
Definition gsWriteParaview.hpp:2108
void gsWriteParaviewPoints(gsMatrix< T > const &X, gsMatrix< T > const &Y, std::string const &fn)
Export 2D Point set to Paraview file.
Definition gsWriteParaview.hpp:1383
void gsWriteParaviewIfc(gsMultiPatch< T > const &patches, std::string const &fn, unsigned npts, bool ctrlNet)
Writes the interfaces of a multipatch to paraview.
Definition gsWriteParaview.hpp:2083
void gsWriteParaviewBezier(const gsMultiPatch< T > &mPatch, std::string const &filename, bool ctrlNet=false)
Export a multipatch Geometry (without scalar information) to paraview file using Bezier elements.
Definition gsWriteParaview.hpp:984