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