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 ensightVarName_H
45#define ensightVarName_H
46
47#include "word.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53namespace ensight
54{
55
56/*---------------------------------------------------------------------------*\
57 Class ensight::VarName Declaration
58\*---------------------------------------------------------------------------*/
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
84 // Member Functions
85
86 //- Is this character valid for an ensight var-name
87 inline static bool valid(char c);
88
89 //- Strip invalid characters
90 inline void stripInvalid();
91
92
93 // Member Operators
94
95 // Assignment (disabled)
97 void operator=(const word&) = delete;
98 void operator=(const string&) = delete;
99 void operator=(const std::string&) = delete;
100 void operator=(const char*) = delete;
101};
102
103
104// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105
106} // End namespace ensight
107
108
109// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110
111//- Hashing for VarName is the same as string
112template<> struct Hash<ensight::VarName> : string::hasher {};
113
114
115// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116
117} // End namespace Foam
118
119// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121#include "ensightVarNameI.H"
122
123#endif
124
125// ************************************************************************* //
Specification of a valid Ensight variable-name.
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
A class for handling words, derived from Foam::string.
Definition: word.H:68
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:54
Hashing functor for string and derived string classes.
Definition: string.H:148