hollowConeRefinement.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  hollowConeRefinement
26 
27 Description
28  Refine boxes with centres contained inside the specified hollow cone
29 
30 SourceFiles
31  hollowConeRefinement.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef hollowConeRefinement_H
36 #define hollowConeRefinement_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 
52 :
53  public objectRefinement
54 {
55  // Private data
56  //- start point and the radii
58  scalar r0Outer_;
59  scalar r0Inner_;
60 
61  //- end point and the radii
63  scalar r1Outer_;
64  scalar r1Inner_;
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("hollowCone");
70 
71 
72  // Constructors
73 
74  //- Null construct
76 
77  //- Construct from name, cell size, centre and radii
79  (
80  const word& name,
81  const scalar cellSize,
82  const direction additionalRefLevels,
83  const point& p0,
84  const scalar radius0Outer,
85  const scalar radius0Inner,
86  const point& p1,
87  const scalar radius1Outer,
88  const scalar radius1Inner
89  );
90 
91  //- Construct from dictionary
93 
94  //- Construct and return a clone
96  (
97  const hollowConeRefinement& sr
98  ) const
99  {
101  (
103  (
104  sr.name(),
105  sr.cellSize(),
107  sr.p0_,
108  sr.r0Outer_,
109  sr.r0Inner_,
110  sr.p1_,
111  sr.r1Outer_,
112  sr.r1Inner_
113  )
114  );
115  }
116 
117  // Member Functions
118 
119  //- check if a boundBox intersects or is inside the object
120  bool intersectsObject(const boundBox&) const;
121 
122  //- Return as dictionary of entries
123  dictionary dict(bool ignoreType = false) const;
124 
125  // Write
126 
127  //- Write
128  void write(Ostream&) const;
129 
130  //- Write dictionary
131  void writeDict(Ostream&, bool subDict = true) const;
132 
133  // Member Operators
134 
135  //- assign from dictionary
136  void operator=(const dictionary&);
137 
138  // IOstream Operators
139 
140  Ostream& operator<<(Ostream&) const;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Foam::hollowConeRefinement::p0_
point p0_
start point and the radii
Definition: hollowConeRefinement.H:56
Foam::hollowConeRefinement::r0Outer_
scalar r0Outer_
Definition: hollowConeRefinement.H:57
Foam::hollowConeRefinement::writeDict
void writeDict(Ostream &, bool subDict=true) const
Write dictionary.
Definition: hollowConeRefinement.C:154
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
typeInfo.H
Foam::hollowConeRefinement::r0Inner_
scalar r0Inner_
Definition: hollowConeRefinement.H:58
point.H
Foam::hollowConeRefinement
Definition: hollowConeRefinement.H:50
Foam::hollowConeRefinement::dict
dictionary dict(bool ignoreType=false) const
Return as dictionary of entries.
Definition: hollowConeRefinement.C:118
Foam::hollowConeRefinement::write
void write(Ostream &) const
Write.
Definition: hollowConeRefinement.C:143
Foam::objectRefinement::cellSize
scalar cellSize() const
return cell size
Definition: objectRefinement.H:80
Foam::hollowConeRefinement::clone
virtual autoPtr< objectRefinement > clone(const hollowConeRefinement &sr) const
Construct and return a clone.
Definition: hollowConeRefinement.H:95
Foam::hollowConeRefinement::intersectsObject
bool intersectsObject(const boundBox &) const
check if a boundBox intersects or is inside the object
Definition: hollowConeRefinement.C:92
Foam::hollowConeRefinement::hollowConeRefinement
hollowConeRefinement()
Null construct.
Definition: hollowConeRefinement.C:40
Foam::hollowConeRefinement::p1_
point p1_
end point and the radii
Definition: hollowConeRefinement.H:61
Foam::objectRefinement
Definition: objectRefinement.H:54
Foam::objectRefinement::additionalRefinementLevels
direction additionalRefinementLevels() const
return the number of additional refinement levels
Definition: objectRefinement.H:157
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::hollowConeRefinement::TypeName
TypeName("hollowCone")
Runtime type information.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
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::hollowConeRefinement::r1Inner_
scalar r1Inner_
Definition: hollowConeRefinement.H:63
Foam::Vector< scalar >
Foam::hollowConeRefinement::r1Outer_
scalar r1Outer_
Definition: hollowConeRefinement.H:62
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::hollowConeRefinement::operator=
void operator=(const dictionary &)
assign from dictionary
Definition: hollowConeRefinement.C:191
Foam::objectRefinement::name
const word & name() const
Return name.
Definition: objectRefinement.H:136
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
objectRefinement.H
Foam::hollowConeRefinement::operator<<
Ostream & operator<<(Ostream &) const
Definition: hollowConeRefinement.C:289