meshOctreeCubeBasic.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh 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 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  meshOctreeCubeBasic
26 
27 Description
28  A cube stores information needed for mesh generation
29 
30 SourceFiles
31  meshOctreeCubeBasic.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef meshOctreeCubeBasic_H
36 #define meshOctreeCubeBasic_H
37 
39 #include "contiguous.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class meshOctreeCubeBasic Declaration
48 \*---------------------------------------------------------------------------*/
49 
52 {
53  // Private data
54  //- cube type
56 
57  //- processor to which the cube belongs to
58  short procNo_;
59 
60 public:
61 
62  // Constructors
63  //- Null constructor
64  inline meshOctreeCubeBasic();
65 
66  //- Construct from coordinates
67  explicit inline meshOctreeCubeBasic
68  (
70  );
71 
72  //- Construct from coordinates and cube type
73  inline meshOctreeCubeBasic
74  (
75  const meshOctreeCubeCoordinates& cc,
76  const direction cubeType,
77  const short procNo = ALLPROCS
78  );
79 
80  // Destructor
81 
83  {}
84 
85  // Enumerators
86 
87  enum typesOfCubes
88  {
89  UNKNOWN = 1,
90  OUTSIDE = 2,
91  DATA = 4,
92  INSIDE = 8,
93  ALLPROCS = -2,
94  OTHERPROC = -3
95  };
96 
97  // Member functions
98  //- return type
99  inline direction cubeType() const;
100 
101  //- set cube type
102  inline void setCubeType(const direction);
103 
104  //- return processor number
105  inline short procNo() const;
106 
107  //- set processor number
108  inline void setProcNo(const short);
109 
110  //- return coordinates in the octree
111  inline const meshOctreeCubeCoordinates& coordinates() const;
112 
113  // Member operators
114 
115  inline void operator=(const meshOctreeCubeBasic&);
116 
117  // Friend operators
118 
119  friend inline Ostream& operator<<
120  (
121  Ostream&,
122  const meshOctreeCubeBasic&
123  );
124 
125  friend inline Istream& operator>>
126  (
127  Istream&,
129  );
130 };
131 
132 //- Specify data associated with meshOctreeCubeBasic type is contiguous
133 template<>
134 inline bool contiguous<meshOctreeCubeBasic>() {
135  return true;
136 }
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #include "meshOctreeCubeBasicI.H"
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
Foam::meshOctreeCubeBasic::OUTSIDE
@ OUTSIDE
Definition: meshOctreeCubeBasic.H:89
Foam::meshOctreeCubeBasic::meshOctreeCubeBasic
meshOctreeCubeBasic()
Null constructor.
Definition: meshOctreeCubeBasicI.H:38
Foam::meshOctreeCubeBasic::ALLPROCS
@ ALLPROCS
Definition: meshOctreeCubeBasic.H:92
Foam::meshOctreeCubeCoordinates
Definition: meshOctreeCubeCoordinates.H:55
Foam::meshOctreeCubeBasic::typesOfCubes
typesOfCubes
Definition: meshOctreeCubeBasic.H:86
Foam::meshOctreeCubeBasic::procNo_
short procNo_
processor to which the cube belongs to
Definition: meshOctreeCubeBasic.H:57
Foam::meshOctreeCubeBasic::setCubeType
void setCubeType(const direction)
set cube type
Definition: meshOctreeCubeBasicI.H:70
Foam::meshOctreeCubeBasic::cubeType
direction cubeType() const
return type
Definition: meshOctreeCubeBasicI.H:75
Foam::meshOctreeCubeBasic::UNKNOWN
@ UNKNOWN
Definition: meshOctreeCubeBasic.H:88
meshOctreeCubeBasicI.H
Foam::meshOctreeCubeBasic::coordinates
const meshOctreeCubeCoordinates & coordinates() const
return coordinates in the octree
Definition: meshOctreeCubeBasicI.H:90
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::contiguous< meshOctreeCubeBasic >
bool contiguous< meshOctreeCubeBasic >()
Specify data associated with meshOctreeCubeBasic type is contiguous.
Definition: meshOctreeCubeBasic.H:133
meshOctreeCubeCoordinates.H
Foam::meshOctreeCubeBasic::setProcNo
void setProcNo(const short)
set processor number
Definition: meshOctreeCubeBasicI.H:85
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::meshOctreeCubeBasic::operator=
void operator=(const meshOctreeCubeBasic &)
Definition: meshOctreeCubeBasicI.H:95
Foam::meshOctreeCubeBasic::INSIDE
@ INSIDE
Definition: meshOctreeCubeBasic.H:91
Foam::meshOctreeCubeBasic::OTHERPROC
@ OTHERPROC
Definition: meshOctreeCubeBasic.H:93
contiguous.H
Template function to specify if the data of a type are contiguous.
Foam::meshOctreeCubeBasic::cubeType_
direction cubeType_
cube type
Definition: meshOctreeCubeBasic.H:54
Foam::meshOctreeCubeBasic::procNo
short procNo() const
return processor number
Definition: meshOctreeCubeBasicI.H:80
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::meshOctreeCubeBasic::~meshOctreeCubeBasic
~meshOctreeCubeBasic()
Definition: meshOctreeCubeBasic.H:81
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::meshOctreeCubeBasic::DATA
@ DATA
Definition: meshOctreeCubeBasic.H:90
Foam::meshOctreeCubeBasic
Definition: meshOctreeCubeBasic.H:49