1#define NoConstructFromTmp
3#undef NoConstructFromTmp
13 "ITHACAparallel is already initialized, call ITHACAparallel::getInstance() to return an instance of ITHACAparallel");
22 "ITHACAparallel needs to be initialized, call ITHACAparallel::getInstance(mesh, runTime) first");
34 for (label
i = 0;
i <
mesh.boundaryMesh().size();
i++)
36 if (
mesh.boundaryMesh()[
i].type() !=
"processor")
78 Gsize_BF = autoPtr<labelList>(
new labelList (
N_BF, label(0)));
80 labelList(label(0), label(0))));
82 for (label
i = 0;
i <
N_BF;
i++)
88 for (label k = 0; k <
mesh.boundaryMesh()[
i].size(); k++)
93 Start = autoPtr<labelList> (
new labelList(
N_BF, 0));
95 for (label
i = 0;
i <
N_BF;
i++)
111 reduce(
Start()[
i], minOp<label>());
117 Pstream::parRun() =
false;
118 label comm = Pstream::worldComm;
126 label comm = Pstream::worldComm;
128 Pstream::parRun() =
true;
133 GeometricField<scalar, fvPatchField, volMesh>& field)
135 List<List< scalar >> GlobField(field.boundaryFieldRef().size() + 1);
139 for (label
i = 0;
i < field.size();
i++)
144 reduce(GlobField[0], sumOp<List<scalar >> ());
147 for (label
i = 0;
i <
N_BF;
i++)
151 GlobField[
i + 1] = zero;
153 for (label
i = 0;
i <
N_BF;
i++)
155 for (label k = 0; k < field.boundaryFieldRef()[
i].size(); k++)
158 && field.boundaryFieldRef()[
i].type() !=
"zeroGradient"
159 && field.boundaryFieldRef()[
i].type() !=
"processor" )
162 field.boundaryFieldRef()[
i][k];
166 reduce(GlobField[
i + 1], sumOp<List<scalar >> ());
173 GeometricField<vector, fvPatchField, volMesh>& field)
175 List<List< vector >> GlobField(field.boundaryFieldRef().size() + 1);
177 GlobField[0] = GlobField[0] * 0;
180 for (label
i = 0;
i < field.size();
i++)
185 reduce(GlobField[0], sumOp<List<vector >> ());
188 for (label
i = 0;
i <
N_BF;
i++)
191 List<vector> zero(
Gsize_BF()[
i], vector(0.0, 0.0, 0.0));
192 GlobField[
i + 1] = zero;
194 for (label
i = 0;
i <
N_BF;
i++)
196 for (label k = 0; k < field.boundaryFieldRef()[
i].size(); k++)
199 && field.boundaryFieldRef()[
i].type() !=
"zeroGradient"
200 && field.boundaryFieldRef()[
i].type() !=
"processor" )
203 field.boundaryFieldRef()[
i][k];
207 reduce(GlobField[
i + 1], sumOp<List<vector >> ());
#define M_Assert(Expr, Msg)
Class for parallel handling, it has several functions to deal with parallel problems,...
autoPtr< labelList > Start
StartFace on the gloabl Mesh.
autoPtr< labelIOList > indices
Cell proc addressing.
static void suspendMPI()
Function to sumpend MPI.
fvMesh & mesh
Mesh object defined locally.
ITHACAparallel()=delete
Delete empty constructor.
static ITHACAparallel * getInstance()
Gets an instance of ithacaparallel, to be used if the instance is already existing.
autoPtr< List< labelList > > IndFaceLocal
Indexing.
static void resumeMPI()
Function to resume MPI.
label N_IF_glob
Totoal number of internal field cells.
static List< int > newProcIDs_
ID of the NEW process.
autoPtr< labelIOList > indicesF
Face proc addressing.
static List< int > oldProcIDs_
ID of the OLD process.
autoPtr< labelList > Gsize_BF
Boundary Field variables representing the total number of faces for each processor.
List< List< Type > > combineFields(GeometricField< Type, fvPatchField, volMesh > &field)
Function to get a global field from a parallel one.
label N_BF
Number of Boundary Patches without considering processors.