cellModelIO.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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<>
55 Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy<cellModel>& ip)
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 // ************************************************************************* //
label nFaces() const
Return number of faces.
Definition: cellModelI.H:62
const keyType & keyword() const
Return keyword.
Definition: entry.H:123
static const char tab
Definition: Ostream.H:259
label nEdges() const
Return number of edges.
Definition: cellModelI.H:56
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
label nPoints() const
Return number of points.
Definition: cellModelI.H:50
static const dictionary null
Null dictionary.
Definition: dictionary.H:241
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
const dimensionedScalar & c
Speed of light in a vacuum.
A keyword and a list of tokens is a &#39;dictionaryEntry&#39;.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
label index() const
Return index of model in the model list.
Definition: cellModelI.H:44
Ostream & operator<<(Ostream &, const ensightPart &)
Maps a geometry to a set of cell primitives, which enables geometric cell data to be calculated witho...
Definition: cellModel.H:64
const word & name() const
Return model name.
Definition: cellModelI.H:38
A keyword and a list of tokens is an &#39;entry&#39;.
Definition: entry.H:65
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:812
cellModel(Istream &)
Construct from Istream.
Definition: cellModelIO.C:31