coneRefinement.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  coneRefinement
26 
27 Description
28  Refine boxes with centres contained inside the cone
29 
30 SourceFiles
31  coneRefinement.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef coneRefinement_H
36 #define coneRefinement_H
37 
38 #include "objectRefinement.H"
39 #include "point.H"
40 #include "typeInfo.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class coneRefinement Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class coneRefinement
52 :
53  public objectRefinement
54 {
55  // Private data
56  //- start point and the radius
58  scalar r0_;
59 
60  //- end point and the radius
62  scalar r1_;
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("cone");
68 
69 
70  // Constructors
71 
72  //- Null construct
74 
75  //- Construct from name, cell size, centre and radius
77  (
78  const word& name,
79  const scalar cellSize,
80  const direction additionalRefLevels,
81  const point& p0,
82  const scalar radius0,
83  const point& p1,
84  const scalar radius1
85  );
86 
87  //- Construct from dictionary
88  coneRefinement(const word& name, const dictionary& dict);
89 
90  //- Construct and return a clone
92  (
93  const coneRefinement& sr
94  ) const
95  {
97  (
98  new coneRefinement
99  (
100  sr.name(),
101  sr.cellSize(),
103  sr.p0_,
104  sr.r0_,
105  sr.p1_,
106  sr.r1_
107  )
108  );
109  }
110 
111  // Member Functions
112 
113  //- check if a boundBox intersects or is inside the object
114  bool intersectsObject(const boundBox&) const;
115 
116  //- Return as dictionary of entries
117  dictionary dict(bool ignoreType = false) const;
118 
119  // Write
120 
121  //- Write
122  void write(Ostream&) const;
123 
124  //- Write dictionary
125  void writeDict(Ostream&, bool subDict = true) const;
126 
127  // Member Operators
128 
129  //- assign from dictionary
130  void operator=(const dictionary&);
131 
132  // IOstream Operators
133 
134  Ostream& operator<<(Ostream&) const;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Foam::coneRefinement::write
void write(Ostream &) const
Write.
Definition: coneRefinement.C:132
Foam::coneRefinement::TypeName
TypeName("cone")
Runtime type information.
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
typeInfo.H
Foam::coneRefinement::coneRefinement
coneRefinement()
Null construct.
Definition: coneRefinement.C:40
point.H
Foam::coneRefinement::r1_
scalar r1_
Definition: coneRefinement.H:61
Foam::coneRefinement::operator=
void operator=(const dictionary &)
assign from dictionary
Definition: coneRefinement.C:176
Foam::objectRefinement::cellSize
scalar cellSize() const
return cell size
Definition: objectRefinement.H:80
Foam::coneRefinement::intersectsObject
bool intersectsObject(const boundBox &) const
check if a boundBox intersects or is inside the object
Definition: coneRefinement.C:84
Foam::objectRefinement
Definition: objectRefinement.H:54
Foam::objectRefinement::additionalRefinementLevels
direction additionalRefinementLevels() const
return the number of additional refinement levels
Definition: objectRefinement.H:157
Foam::coneRefinement::dict
dictionary dict(bool ignoreType=false) const
Return as dictionary of entries.
Definition: coneRefinement.C:109
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::coneRefinement
Definition: coneRefinement.H:50
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::coneRefinement::p1_
point p1_
end point and the radius
Definition: coneRefinement.H:60
Foam::coneRefinement::operator<<
Ostream & operator<<(Ostream &) const
Definition: coneRefinement.C:245
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::Vector< scalar >
Foam::coneRefinement::p0_
point p0_
start point and the radius
Definition: coneRefinement.H:56
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::boundBox
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:55
Foam::objectRefinement::name
const word & name() const
Return name.
Definition: objectRefinement.H:136
Foam::coneRefinement::clone
virtual autoPtr< objectRefinement > clone(const coneRefinement &sr) const
Construct and return a clone.
Definition: coneRefinement.H:91
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
objectRefinement.H
Foam::coneRefinement::writeDict
void writeDict(Ostream &, bool subDict=true) const
Write dictionary.
Definition: coneRefinement.C:141
Foam::coneRefinement::r0_
scalar r0_
Definition: coneRefinement.H:57