directions.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 | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::directions
26 
27 Description
28  Set of directions for each cell in the mesh. Either uniform and size=1
29  or one set of directions per cell.
30 
31  Used in splitting cells.
32  Either all cells have similar refinement direction ('global') or
33  direction is dependent on local cell geometry. Controlled by dictionary.
34 
35 SourceFiles
36  directions.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef directions_H
41 #define directions_H
42 
43 #include "List.H"
44 #include "vectorField.H"
45 #include "NamedEnum.H"
46 #include "point.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // Forward declaration of classes
54 class polyMesh;
55 class twoDPointCorrector;
56 class primitiveMesh;
57 class polyPatch;
58 class dictionary;
59 
60 /*---------------------------------------------------------------------------*\
61  Class directions Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class directions
65 :
66  public List<vectorField>
67 {
68 public:
69  // Data types
70 
71  //- Enumeration listing the possible coordinate directions.
72  enum directionType
73  {
76  NORMAL
77  };
78 
79 private:
80 
81  static const NamedEnum<directionType, 3> directionTypeNames_;
82 
83 
84  // Private Member Functions
85 
86 
87  //- For debugging. Write point coordinate.
88  static void writeOBJ(Ostream& os, const point& pt);
89 
90  //- For debugging. Write edge between two points.
91  static void writeOBJ
92  (
93  Ostream& os,
94  const point& pt0,
95  const point& pt1,
96  label& vertI
97  );
98 
99  //- For debugging. Write hedgehog display of vectorField as obj file.
100  static void writeOBJ
101  (
102  const fileName& fName,
103  const primitiveMesh& mesh,
104  const vectorField& dirs
105  );
106 
107  //- Check if vec has no component in 2D normal direction. Exits if
108  // so.
109  static void check2D
110  (
111  const twoDPointCorrector* correct2DPtr,
112  const vector& vec
113  );
114 
115  //- Get coordinate direction for all cells in mesh by propagating from
116  // vector on patch.
117  static vectorField propagateDirection
118  (
119  const polyMesh& mesh,
120  const bool useTopo,
121  const polyPatch& pp,
122  const vectorField& ppField,
123  const vector& defaultDir
124  );
125 
126  //- Disallow default bitwise copy construct
127  directions(const directions&);
128 
129  //- Disallow default bitwise assignment
130  void operator=(const directions&);
131 
132 
133 public:
134 
135  // Constructors
136 
137  //- Construct from mesh and dictionary and optional 2D corrector.
138  directions
139  (
140  const polyMesh& mesh,
141  const dictionary& dict,
142  const twoDPointCorrector* correct2DPtr = NULL
143  );
144 
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dynamicFvMesh & mesh
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
Definition: directions.H:63
Class applies a two-dimensional correction to mesh motion point field.
dictionary dict
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:74
directionType
Enumeration listing the possible coordinate directions.
Definition: directions.H:71
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
A class for handling file names.
Definition: fileName.H:69
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53