-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgsWriteParaviewMultiPhysics.h
73 lines (59 loc) · 2.99 KB
/
gsWriteParaviewMultiPhysics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/** @file gsWriteParaviewMultiPhysics.h
@brief Allows to write several fields defined on the same geometry
in one file, making it easier to operate with them inside Paraview.
Ideally should be a part of gismoIO module,
This file is part of the G+Smo library.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Author(s): A. Shamanskiy (TU Kaiserslautern)
Inspired by gsWriteParaview.h by A. Mantzaflaris
*/
#pragma once
#include <gsCore/gsForwardDeclarations.h>
#include <gsIO/gsParaviewCollection.h>
#define NS 1000
namespace gismo
{
/// \brief Write a file containing several fields defined on the same geometry to ONE paraview file
///
/// \param fields a map of field pointers
/// \param fn filename where paraview file is written
/// \param npts number of points used for sampling each patch
/// \param mesh if true, the parameter mesh is plotted as well
template<class T>
void gsWriteParaviewMultiPhysics(std::map<std::string, const gsField<T> *> fields, std::string const & fn,
unsigned npts=NS, bool mesh = false, bool ctrlNet = false);
/// \brief Write a file containing several fields defined on the same geometry to ONE paraview file
/// and adds it as a timestep to a Paraview collection
/// \param fields a map of field pointers
/// \param fn filename where paraview file is written
/// \param npts number of points used for sampling each patch
/// \param mesh if true, the parameter mesh is plotted as well
template<class T>
void gsWriteParaviewMultiPhysicsTimeStep(std::map<std::string, const gsField<T> *> fields, std::string const & fn,
gsParaviewCollection & collection, int time, unsigned npts=NS);
/// \brief Extract and evaluate geometry and the fields for a single patch
///
/// \param fields a map of field pointers
/// \param patchNum a number of patch
/// \param fn filename where paraview file is written
/// \param npts number of points used for sampling each patch
template<class T>
void gsWriteParaviewMultiPhysicsSinglePatch(std::map<std::string, const gsField<T> *> fields,
const unsigned patchNum,
std::string const & fn,
unsigned npts);
/// \brief Utility function to actually write prepaired matrices with data into Paraview file
///
/// \param points a matrix with space-points to plot
/// \param data a map of matrices with field evaluations to plotfilename where paraview file is written
/// \param np a vector containg the data range info
/// \param fn filename where paraview file is written
template<class T>
void gsWriteParaviewMultiTPgrid(gsMatrix<T> const& points,
std::map<std::string, gsMatrix<T> >& data,
const gsVector<index_t> & np,
std::string const & fn);
}
#undef NS