Loading...
Searching...
No Matches
ensightVarName.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-2020 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
26Class
27 Foam::ensight::VarName
28
29Description
30 Specification of a valid Ensight variable-name.
31
32 Illegal characters
33 \code
34 space !#%()*+,-./;@[]^
35 \endcode
36 If spaces exist, they must be quoted
37
38 Variable names cannot start with a digit.
39 The maximum part name length (in GUI: 49 chars) - not addressed.
40 The maximum variable length (in GUI: 49 chars) - not addressed.
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef Foam_ensightVarName_H
45#define Foam_ensightVarName_H
46
47#include "word.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53namespace ensight
54{
55
56/*---------------------------------------------------------------------------*\
57 Class ensight::VarName Declaration
58\*---------------------------------------------------------------------------*/
59
60class VarName
61:
62 public word
63{
64public:
65
66 // Generated Methods
67
68 //- Copy construct
69 VarName(const VarName&) = default;
70
71 //- Move construct
72 VarName(VarName&&) = default;
73
74
75 // Constructors
76
77 //- Construct as copy of character array
78 inline explicit VarName(const char* s);
79
80 //- Copy construct from std::string
81 inline explicit VarName(const std::string& s);
82
83 //- Move construct from std::string
84 inline explicit VarName(std::string&& s);
85
86
87 // Member Functions
88
89 //- Is this character valid for an ensight var-name
90 inline static bool valid(char c);
91
92 //- Strip invalid characters
93 inline void stripInvalid();
94
95
96 // Member Operators
97
98 // Assignment (disabled)
99
100 void operator=(const word&) = delete;
101 void operator=(const string&) = delete;
102 void operator=(const std::string&) = delete;
103 void operator=(const char*) = delete;
104};
105
106
107// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109} // End namespace ensight
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114//- Hashing for VarName is the same as string
115template<> struct Hash<ensight::VarName> : string::hasher {};
116
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120} // End namespace Foam
121
122// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123
125
126#endif
127
128// ************************************************************************* //
void operator=(const word &)=delete
VarName(const VarName &)=default
Copy construct.
void operator=(const string &)=delete
void operator=(const char *)=delete
VarName(VarName &&)=default
Move construct.
static bool valid(char c)
Is this character valid for an ensight var-name.
void stripInvalid()
Strip invalid characters.
void operator=(const std::string &)=delete
word()=default
Default construct.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Namespace for OpenFOAM.
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
Definition Hash.H:48
Hashing functor for string and derived string classes.
Definition string.H:173