noDecomp.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2012-2015 OpenFOAM Foundation
9 Copyright (C) 2017-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::noDecomp
29
30Description
31 A dummy decomposition method, selected as \c none.
32
33 Method coefficients: \a none
34
35SourceFiles
36 noDecomp.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef noDecomp_H
41#define noDecomp_H
42
43#include "decompositionMethod.H"
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class noDecomp Declaration
50\*---------------------------------------------------------------------------*/
52class noDecomp
53:
55{
56 // Private Member Functions
57
58 //- No copy construct
59 noDecomp(const noDecomp&) = delete;
60
61 //- No copy assignment
62 void operator=(const noDecomp&) = delete;
63
64
65public:
66
67 //- Runtime type information
68 TypeNameNoDebug("none");
69
70
71 // Constructors
72
73 //- Construct given decomposition dictionary and optional region name
74 explicit noDecomp
75 (
76 const dictionary& decompDict,
77 const word& regionName = ""
78 );
79
80
81 //- Destructor
82 virtual ~noDecomp() = default;
83
84
85 // Member Functions
86
87 //- Does not care about proc boundaries
88 virtual bool parallelAware() const
89 {
90 return true;
91 }
92
93 //- Return for every coordinate the wanted processor number.
94 // Use the mesh connectivity (if needed)
95 virtual labelList decompose
96 (
97 const polyMesh& mesh,
98 const pointField& cc,
99 const scalarField& cWeights
100 ) const
101 {
102 return labelList(cc.size(), Pstream::myProcNo());
103 }
104
105 //- Return for every coordinate the wanted processor number.
106 // Explicitly provided connectivity - does not use mesh_.
107 // The connectivity is equal to mesh.cellCells() except for
108 // - in parallel the cell numbers are global cell numbers (starting
109 // from 0 at processor0 and then incrementing all through the
110 // processors)
111 // - the connections are across coupled patches
112 virtual labelList decompose
113 (
114 const labelListList& globalCellCells,
115 const pointField& cc,
116 const scalarField& cWeights
117 ) const
118 {
119 return labelList(globalCellCells.size(), Pstream::myProcNo());
120 }
121};
122
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126} // End namespace Foam
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#endif
131
132// ************************************************************************* //
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Abstract base class for domain decomposition.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A dummy decomposition method, selected as none.
Definition: noDecomp.H:54
virtual ~noDecomp()=default
Destructor.
virtual bool parallelAware() const
Does not care about proc boundaries.
Definition: noDecomp.H:87
TypeNameNoDebug("none")
Runtime type information.
virtual labelList decompose(const polyMesh &mesh, const pointField &cc, const scalarField &cWeights) const
Return for every coordinate the wanted processor number.
Definition: noDecomp.H:95
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
int myProcNo() const noexcept
Return processor number.
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Foam::word regionName(Foam::polyMesh::defaultRegion)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:56
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition: typeInfo.H:68