cellModelIO.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 "cellModel.H"
27 #include "dictionaryEntry.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
32 {
34  name_ = entry.keyword();
35  entry.lookup("index") >> index_;
36  entry.lookup("numberOfPoints") >> nPoints_;
37  entry.lookup("faces") >> faces_;
38  entry.lookup("edges") >> edges_;
39 }
40 
41 
43 {
44  os << "name" << tab << c.name_ << tab
45  << "index" << tab << c.index_ << tab
46  << "numberOfPoints" << tab << c.nPoints_ << tab
47  << "faces" << tab << c.faces_ << tab
48  << "edges" << tab << c.edges_ << endl;
49 
50  return os;
51 }
52 
53 
54 template<>
56 {
57  const cellModel& cm = ip.t_;
58 
59  os << "name = " << cm.name() << ", "
60  << "index = " << cm.index() << ", "
61  << "number of points = " << cm.nPoints() << ", "
62  << "number of faces = " << cm.nFaces() << ", "
63  << "number of edges = " << cm.nEdges()
64  << endl;
65 
66  return os;
67 }
68 
69 
70 // ************************************************************************* //
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:65
Foam::cellModel::nPoints_
label nPoints_
Number of points in the model which determines the geometry.
Definition: cellModel.H:75
Foam::dictionaryEntry
A keyword and a list of tokens is a 'dictionaryEntry'.
Definition: dictionaryEntry.H:57
Foam::cellModel::index_
label index_
Label in the model list.
Definition: cellModel.H:72
Foam::InfoProxy
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:45
Foam::entry::keyword
const keyType & keyword() const
Return keyword.
Definition: entry.H:120
Foam::cellModel::nFaces
label nFaces() const
Return number of faces.
Definition: cellModelI.H:62
Foam::cellModel::cellModel
cellModel(Istream &)
Construct from Istream.
Definition: cellModelIO.C:31
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::cellModel::nPoints
label nPoints() const
Return number of points.
Definition: cellModelI.H:50
cellModel.H
Foam::cellModel::nEdges
label nEdges() const
Return number of edges.
Definition: cellModelI.H:56
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::InfoProxy::t_
const T & t_
Definition: InfoProxy.H:53
Foam::operator<<
Ostream & operator<<(Ostream &, const edgeMesh &)
Definition: edgeMeshIO.C:130
Foam::cellModel::name_
word name_
Name.
Definition: cellModel.H:69
Foam::cellModel::name
const word & name() const
Return model name.
Definition: cellModelI.H:38
dictionaryEntry.H
Foam::cellModel::faces_
faceList faces_
Faces of the model.
Definition: cellModel.H:78
Foam::tab
static const char tab
Definition: Ostream.H:259
Foam::cellModel::edges_
edgeList edges_
Edges of the model.
Definition: cellModel.H:81
Foam::dimensioned::name_
word name_
Variable name.
Definition: dimensionedType.H:69
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::cellModel
Maps a geometry to a set of cell primitives, which enables geometric cell data to be calculated witho...
Definition: cellModel.H:64
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::cellModel::index
label index() const
Return index of model in the model list.
Definition: cellModelI.H:44
Foam::dictionary::null
static const dictionary null
Null dictionary.
Definition: dictionary.H:193