initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / meshCut / directions / directions.H
blob11b06f1f44e92ffc0daf00c9929dad19b9165540
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::directions
28 Description
29     Set of directions for each cell in the mesh. Either uniform and size=1
30     or one set of directions per cell.
32     Used in splitting cells.
33     Either all cells have similar refinement direction ('global') or 
34     direction is dependent on local cell geometry. Controlled by dictionary.
36 SourceFiles
37     directions.C
39 \*---------------------------------------------------------------------------*/
41 #ifndef directions_H
42 #define directions_H
44 #include "List.H"
45 #include "vectorField.H"
46 #include "NamedEnum.H"
47 #include "point.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 // Forward declaration of classes
55 class polyMesh;
56 class twoDPointCorrector;
57 class primitiveMesh;
58 class polyPatch;
59 class dictionary;
61 /*---------------------------------------------------------------------------*\
62                            Class directions Declaration
63 \*---------------------------------------------------------------------------*/
65 class directions
67     public List<vectorField>
69 public:
70     // Data types
72         //- Enumeration listing the possible coordinate directions.
73         enum directionType
74         {
75             TAN1,
76             TAN2,
77             NORMAL,
78         };
80 private:
82         static const NamedEnum<directionType, 3> directionTypeNames_;
85     // Private Member Functions
88         //- For debugging. Write point coordinate.
89         static void writeOBJ(Ostream& os, const point& pt);
91         //- For debugging. Write edge between two points.
92         static void writeOBJ
93         (
94             Ostream& os,
95             const point& pt0,
96             const point& pt1,
97             label& vertI
98         );
100         //- For debugging. Write hedgehog display of vectorField as obj file.
101         static void writeOBJ
102         (
103             const fileName& fName,
104             const primitiveMesh& mesh,
105             const vectorField& dirs
106         );
108         //- Check if vec has no component in 2D normal direction. Exits if
109         //  so.
110         static void check2D
111         (
112             const twoDPointCorrector* correct2DPtr,
113             const vector& vec
114         );
116         //- Get coordinate direction for all cells in mesh by propagating from
117         //  vector on patch.
118         static vectorField propagateDirection
119         (
120             const polyMesh& mesh,
121             const bool useTopo,
122             const polyPatch& pp,
123             const vectorField& ppField,
124             const vector& defaultDir
125         );
127         //- Disallow default bitwise copy construct
128         directions(const directions&);
130         //- Disallow default bitwise assignment
131         void operator=(const directions&);
134 public:
136     // Constructors
138         //- Construct from mesh and dictionary and optional 2D corrector.
139         directions
140         (
141             const polyMesh& mesh,
142             const dictionary& dict,
143             const twoDPointCorrector* correct2DPtr = NULL
144         );
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 } // End namespace Foam
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 #endif
157 // ************************************************************************* //