IOmapDistributePolyMesh.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) 2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
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 
27 
28 /* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
29 
30 namespace Foam
31 {
32 defineTypeNameAndDebug(IOmapDistributePolyMesh, 0);
33 }
34 
35 
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 
39 :
40  regIOobject(io)
41 {
42  // Temporary warning
44  {
46  << "Specified IOobject::MUST_READ_IF_MODIFIED but class"
47  << " does not support automatic rereading."
48  << endl;
49  }
50 
51  if
52  (
53  (
56  )
58  )
59  {
60  readStream(typeName) >> *this;
61  close();
62  }
63 }
64 
65 
67 (
68  const IOobject& io,
69  const mapDistributePolyMesh& map
70 )
71 :
72  regIOobject(io)
73 {
74  // Temporary warning
76  {
78  << "Specified IOobject::MUST_READ_IF_MODIFIED but class"
79  << " does not support automatic rereading."
80  << endl;
81  }
82 
83  if
84  (
85  (
88  )
89  || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
90  )
91  {
92  readStream(typeName) >> *this;
93  close();
94  }
95  else
96  {
98  }
99 }
100 
101 
102 // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
103 
105 {}
106 
107 
108 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
109 
111 {
112  return (is >> *this).good();
113 }
114 
115 
117 {
118  return (os << *this).good();
119 }
120 
121 
122 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
IOmapDistributePolyMesh.H
Foam::mapDistributePolyMesh::operator=
void operator=(const mapDistributePolyMesh &)
Definition: mapDistributePolyMesh.C:293
Foam::IOobject::MUST_READ
@ MUST_READ
Definition: IOobject.H:108
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::IOmapDistributePolyMesh::IOmapDistributePolyMesh
IOmapDistributePolyMesh(const IOobject &)
Construct given an IOobject.
Definition: IOmapDistributePolyMesh.C:38
Foam::IOobject::headerOk
bool headerOk()
Read and check header info.
Definition: IOobject.C:439
Foam::IOobject::MUST_READ_IF_MODIFIED
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:109
Foam::IOobject::readOpt
readOption readOpt() const
Definition: IOobject.H:317
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::IOmapDistributePolyMesh::writeData
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
Definition: IOmapDistributePolyMesh.C:116
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:60
Foam::regIOobject::readStream
Istream & readStream()
Return Istream.
Definition: regIOobjectRead.C:34
Foam::regIOobject::close
void close()
Close Istream.
Definition: regIOobjectRead.C:148
Foam::IOmapDistributePolyMesh::~IOmapDistributePolyMesh
virtual ~IOmapDistributePolyMesh()
Destructor.
Definition: IOmapDistributePolyMesh.C:104
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:57
Foam::IOobject::READ_IF_PRESENT
@ READ_IF_PRESENT
Definition: IOobject.H:110
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:259
Foam::IOmapDistributePolyMesh::readData
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
Definition: IOmapDistributePolyMesh.C:110