Loading...
Searching...
No Matches
writeFluentFields.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) 2011 OpenFOAM Foundation
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
26InClass
27 Foam::writeFluentFields
28
29\*---------------------------------------------------------------------------*/
30
31#ifndef Foam_writeFluentFields_H
32#define Foam_writeFluentFields_H
33
34#include "volFields.H"
35#include "dictionary.H"
36#include "IOobjectList.H"
37#include "Ostream.H"
38
39// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40
41namespace Foam
42{
43
45(
46 const volScalarField& phi,
47 const label fluentFieldIdentifier,
48 Ostream& os
49);
50
52(
54 const label fluentFieldIdentifier,
55 Ostream& os
56);
57
58
59template<class GeoField>
61(
62 const dictionary& dict,
63 const IOobjectList& objects,
64 const fvMesh& mesh,
65 Ostream& os
66)
67{
68 for (const IOobject& io : objects.csorted<GeoField>())
69 {
70 // Lookup field from dictionary and convert field
71 const word& fieldName = io.name();
72 label unitNumber;
73 if
74 (
75 dict.readIfPresent(fieldName, unitNumber)
76 && unitNumber > 0
77 )
78 {
79 // Read field
80 GeoField field(io, mesh);
81
82 Info<< " Converting field " << fieldName << nl;
83 writeFluentField(field, unitNumber, os);
84 }
85 }
86}
87
88
89
90// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91
92} // End namespace Foam
93
94// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95
96#endif
97
98// ************************************************************************* //
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
UPtrList< const IOobject > csorted() const
The sorted list of IOobjects with headerClassName == Type::typeName.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A class for handling words, derived from Foam::string.
Definition word.H:66
rDeltaTY field()
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
const auto & io
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
void writeFluentField(const volScalarField &phi, const label fluentFieldIdentifier, Ostream &os)
void readFieldsAndWriteFluent(const dictionary &dict, const IOobjectList &objects, const fvMesh &mesh, Ostream &os)
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
dictionary dict