processorBoundaryPatch.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  processorBoundaryPatch
26 
27 Description
28  Writes information for a given processor patch
29 
30 SourceFiles
31  processorBoundaryPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef processorBoundaryPatch_H
36 #define processorBoundaryPatch_H
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #include "boundaryPatchBase.H"
41 #include "typeInfo.H"
42 
43 namespace Foam
44 {
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
49 : public boundaryPatchBase
50 {
51  // private data
52 
54 
56 
57 public:
58 
59  // Runtime type information
60  TypeName("processor");
61 
62  // Construct from components
64  (
65  const word& name,
66  const word& type,
67  const label nFaces,
68  const label startFace,
69  const label myProcNo,
70  const label neighbProcNo
71  );
72 
74 
75  // Construct and return a clone
76  virtual autoPtr<boundaryPatchBase> clone() const
77  {
79  (
81  (
82  patchName(),
83  patchType(),
84  patchSize(),
85  patchStart(),
86  myProcNo_,
88  )
89  );
90  }
91 
93  (
94  const processorBoundaryPatch& pp
95  ) const
96  {
98  (
100  (
101  pp.patchName(),
102  pp.patchType(),
103  pp.patchSize(),
104  pp.patchStart(),
105  pp.myProcNo_,
106  pp.neighbProcNo_
107  )
108  );
109  }
110 
111  // Member functions
112  //- return the owner processor
113  inline label myProcNo() const
114  {
115  return myProcNo_;
116  }
117 
118  //- return the neighbour processor
119  inline label neiProcNo() const
120  {
121  return neighbProcNo_;
122  }
123 
124  //- check if the processor is the owner of the interface
125  inline bool owner() const
126  {
127  if( myProcNo_ < neighbProcNo_ )
128  return true;
129 
130  return false;
131  }
132 
133  //- Return as dictionary of entries
134  dictionary dict() const;
135 
136  // Write
137  //- write to Ostream
138  void write(Ostream&) const;
139 
140  //- Write dictionary
141  void writeDict(Ostream&) const;
142 
143  // Member operators
144  Ostream& operator<<(Ostream&) const;
145 
147 
148  void operator=(const processorBoundaryPatch&);
149 
150  bool operator!=(const processorBoundaryPatch&) const;
151 };
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::processorBoundaryPatch::TypeName
TypeName("processor")
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::boundaryPatchBase::patchSize
label patchSize() const
Definition: boundaryPatchBase.H:161
typeInfo.H
Foam::processorBoundaryPatch::processorBoundaryPatch
processorBoundaryPatch(const word &name, const word &type, const label nFaces, const label startFace, const label myProcNo, const label neighbProcNo)
Definition: processorBoundaryPatch.C:46
boundaryPatchBase.H
Foam::processorBoundaryPatch::myProcNo_
label myProcNo_
Definition: processorBoundaryPatch.H:52
Foam::boundaryPatchBase::patchName
const word & patchName() const
Definition: boundaryPatchBase.H:131
Foam::boundaryPatchBase::patchType
const word & patchType() const
Definition: boundaryPatchBase.H:141
Foam::processorBoundaryPatch::dict
dictionary dict() const
Return as dictionary of entries.
Definition: processorBoundaryPatch.C:74
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::processorBoundaryPatch::clone
virtual autoPtr< boundaryPatchBase > clone() const
Definition: processorBoundaryPatch.H:75
Foam::processorBoundaryPatch::operator=
void operator=(const processorBoundaryPatch &)
Definition: processorBoundaryPatch.C:126
Foam::processorBoundaryPatch::write
void write(Ostream &) const
write to Ostream
Definition: processorBoundaryPatch.C:88
Foam::processorBoundaryPatch::owner
bool owner() const
check if the processor is the owner of the interface
Definition: processorBoundaryPatch.H:124
Foam::processorBoundaryPatch::operator>>
Istream & operator>>(Istream &)
Definition: processorBoundaryPatch.C:112
Foam::processorBoundaryPatch::myProcNo
label myProcNo() const
return the owner processor
Definition: processorBoundaryPatch.H:112
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::processorBoundaryPatch::neighbProcNo_
label neighbProcNo_
Definition: processorBoundaryPatch.H:54
Foam::processorBoundaryPatch
Definition: processorBoundaryPatch.H:47
Foam::processorBoundaryPatch::operator!=
bool operator!=(const processorBoundaryPatch &) const
Definition: processorBoundaryPatch.C:136
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::processorBoundaryPatch::neiProcNo
label neiProcNo() const
return the neighbour processor
Definition: processorBoundaryPatch.H:118
Foam::boundaryPatchBase
Definition: boundaryPatchBase.H:50
Foam::boundaryPatchBase::patchStart
label patchStart() const
Definition: boundaryPatchBase.H:151
Foam::processorBoundaryPatch::writeDict
void writeDict(Ostream &) const
Write dictionary.
Definition: processorBoundaryPatch.C:93
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::processorBoundaryPatch::operator<<
Ostream & operator<<(Ostream &) const
Definition: processorBoundaryPatch.C:98