block.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "error.H"
27 #include "block.H"
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
32 (
33  const pointField& blockPointField,
34  const curvedEdgeList& edges,
35  Istream& is
36 )
37 :
38  blockDescriptor(blockPointField, edges, is),
39  vertices_(0),
40  cells_(0),
41  boundaryPatches_(0)
42 {}
43 
44 
46 :
47  blockDescriptor(blockDesc),
48  vertices_(0),
49  cells_(0),
50  boundaryPatches_(0)
51 {}
52 
53 
54 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
55 
57 {}
58 
59 
60 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
61 
63 {
64  if (vertices_.empty())
65  {
66  createPoints();
67  }
68 
69  return vertices_;
70 }
71 
72 
74 {
75  if (cells_.empty())
76  {
77  createCells();
78  }
79 
80  return cells_;
81 }
82 
83 
85 {
86  if (boundaryPatches_.empty())
87  {
88  createBoundary();
89  }
90 
91  return boundaryPatches_;
92 }
93 
94 
95 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
96 
98 {
99  os << b.points() << nl
100  << b.cells() << nl
101  << b.boundaryPatches() << endl;
102 
103  return os;
104 }
105 
106 
107 // ************************************************************************* //
Foam::block
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
Definition: block.H:63
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::block::cells
const labelListList & cells() const
Return the cells for filling the block.
Definition: block.C:73
Foam::block::points
const pointField & points() const
Return the points for filling the block.
Definition: block.C:62
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:28
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
error.H
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::operator<<
Ostream & operator<<(Ostream &, const edgeMesh &)
Definition: edgeMeshIO.C:130
Foam::block::~block
~block()
Destructor.
Definition: block.C:56
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::block::boundaryPatches
const labelListListList & boundaryPatches() const
Return the boundary patch faces for the block.
Definition: block.C:84
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::blockDescriptor
Takes the description of the block and the list of curved edges and creates a list of points on edges...
Definition: blockDescriptor.H:61
block.H
Foam::block::block
block(const block &)
Disallow default bitwise copy construct.