ensightOutputCloud.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26InNamespace
27 Foam::ensightOutput
28
29Description
30 A collection of functions for writing clouds as ensight file content.
31
32SourceFiles
33 ensightOutputCloud.C
34 ensightOutputCloudTemplates.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef ensightOutputCloud_H
39#define ensightOutputCloud_H
40
41#include "ensightFile.H"
42#include "autoPtr.H"
43#include "IOField.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
51class fvMesh;
52
53namespace ensightOutput
54{
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58
59//- Write cloud positions
61(
62 const fvMesh& mesh,
63 const word& cloudName,
64 bool exists,
65 autoPtr<ensightFile>& output
66);
67
68
69//- Write cloud field, returning true if the field is non-empty.
70template<class Type>
72(
73 const IOField<Type>& field,
74 ensightFile& os
75);
76
77
78//- Read cloud field from IOobject (if exists == true) and write,
79//- always returning true.
80template<class Type>
82(
83 const IOobject& io,
84 bool exists,
85 autoPtr<ensightFile>& output
86);
87
88
89/*---------------------------------------------------------------------------*\
90 Namespace ensightOutput::Detail
91\*---------------------------------------------------------------------------*/
92
93namespace Detail
94{
95
96//- Write cloud field data (serial) with rounding and newlines.
97// \return the current output count
98template<class Type>
100(
102 const UList<Type>& fld,
103 label count = 0
104);
105
106
107} // End namespace Detail
108
109
110// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111
112} // End namespace ensightOutput
113} // End namespace Foam
114
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118#ifdef NoRepository
120#endif
121
122// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123
124#endif
125
126// ************************************************************************* //
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Definition: ensightFile.H:55
rDeltaTY field()
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
label writeCloudFieldContent(ensightFile &os, const UList< Type > &fld, label count=0)
Write cloud field data (serial) with rounding and newlines.
bool writeCloudPositions(const fvMesh &mesh, const word &cloudName, bool exists, autoPtr< ensightFile > &output)
Write cloud positions.
bool writeCloudField(const IOField< Type > &field, ensightFile &os)
Write cloud field, returning true if the field is non-empty.
Namespace for OpenFOAM.
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
Definition: MSwindows.C:633
static Ostream & output(Ostream &os, const IntRange< T > &range)
Definition: IntRanges.C:66
const word cloudName(propsDict.get< word >("cloud"))