FreeFOAM The Cross-Platform CFD Toolkit
manualDecomp.H
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) 1991-2010 OpenCFD Ltd.
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 Class
25  Foam::manualDecomp
26 
27 Description
28  Decomposition given a cell-to-processor association in a file
29 
30 SourceFiles
31  manualDecomp.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef manualDecomp_H
36 #define manualDecomp_H
37 
39 
40 namespace Foam
41 {
42 
43 /*---------------------------------------------------------------------------*\
44  Class manualDecomp Declaration
45 \*---------------------------------------------------------------------------*/
46 
48 :
49  public decompositionMethod
50 {
51  // Private data
52 
53  const polyMesh* meshPtr_;
54 
55  fileName decompDataFile_;
56 
57 
58  // Private Member Functions
59 
60  //- Disallow default bitwise copy construct and assignment
61  void operator=(const manualDecomp&);
62  manualDecomp(const manualDecomp&);
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("manual");
69 
70 
71  // Constructors
72 
73  //- Construct given the decomposition dictionary
74  manualDecomp(const dictionary& decompositionDict);
75 
76  //- Construct given the decomposition dictionary and mesh
78  (
79  const dictionary& decompositionDict,
80  const polyMesh& mesh
81  );
82 
83 
84  // Destructor
85 
86  virtual ~manualDecomp()
87  {}
88 
89 
90  // Member Functions
91 
92  //- manual decompose does not care about proc boundaries - is all
93  // up to the user.
94  virtual bool parallelAware() const
95  {
96  return true;
97  }
98 
99  //- Return for every coordinate the wanted processor number. Use the
100  // mesh connectivity (if needed)
101  virtual labelList decompose
102  (
103  const pointField& points,
104  const scalarField& pointWeights
105  );
106 
107  //- Return for every coordinate the wanted processor number. Explicitly
108  // provided connectivity - does not use mesh_.
109  // The connectivity is equal to mesh.cellCells() except for
110  // - in parallel the cell numbers are global cell numbers (starting
111  // from 0 at processor0 and then incrementing all through the
112  // processors)
113  // - the connections are across coupled patches
114  virtual labelList decompose
115  (
116  const labelListList& globalCellCells,
117  const pointField& cc,
118  const scalarField& cWeights
119  )
120  {
121  return decompose(cc, cWeights);
122  }
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************ vim: set sw=4 sts=4 et: ************************ //