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-2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::ensight::VarName
28 
29 Description
30  Specification of a valid Ensight variable-name.
31 
32  \code
33  space !#%()*+,-./;@[]^
34  \endcode
35  If spaces exist, they must be quoted
36 
37  Variable names cannot start with a digit.
38  The maximum part name length (in GUI: 49 chars) - not addresssed.
39  The maximum variable length (in GUI: 49 chars) - not addresssed.
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef ensightVarName_H
44 #define ensightVarName_H
45 
46 #include "word.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace ensight
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class ensight::VarName Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class VarName
60 :
61  public word
62 {
63 public:
64 
65  // Constructors
66 
67  //- Copy construct
68  inline VarName(const VarName& vn);
69 
70  //- Construct as copy of character array
71  inline explicit VarName(const char* s);
72 
73  //- Construct as copy of std::string
74  inline explicit VarName(const std::string& s);
75 
76 
77  // Member Functions
78 
79  //- Is this character valid for an ensight var-name
80  inline static bool valid(char c);
81 
82  //- Strip invalid characters
83  inline void stripInvalid();
84 
85 
86  // Member Operators
87 
88  // Assignment (disabled)
89 
90  void operator=(const word&) = delete;
91  void operator=(const string&) = delete;
92  void operator=(const std::string&) = delete;
93  void operator=(const char*) = delete;
94 
95 };
96 
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 } // End namespace ensight
101 } // End namespace Foam
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 #include "ensightVarNameI.H"
106 
107 #endif
108 
109 // ************************************************************************* //
Foam::ensight::VarName::valid
static bool valid(char c)
Is this character valid for an ensight var-name.
Definition: ensightVarNameI.H:58
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
s
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))
Definition: gmvOutputSpray.H:25
ensightVarNameI.H
Foam::ensight::VarName
Specification of a valid Ensight variable-name.
Definition: ensightVarName.H:58
Foam::ensight::VarName::VarName
VarName(const VarName &vn)
Copy construct.
Definition: ensightVarNameI.H:34
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::ensight::VarName::stripInvalid
void stripInvalid()
Strip invalid characters.
Definition: ensightVarNameI.H:81
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
word.H
Foam::ensight::VarName::operator=
void operator=(const word &)=delete