41 const Field<Type>& field,
45 tmp<Field<Type>> tfld(
new Field<Type>(addressing.size()));
46 Field<Type>&
fld = tfld.ref();
54 ? neighbour[addressing[i] - 1]
55 : owner[- addressing[i] - 1]
66 const Field<Type>& field,
71 tmp<Field<Type>> tfld(
new Field<Type>(addressing.size()));
72 Field<Type>&
fld = tfld.ref();
77 (
isFlux && addressing[i] < 0 ? -1 : +1)
78 *field[
mag(addressing[i]) - 1];
89 const VolField<Type>& field
93 PtrList<fvPatchField<Type>> patchFields(procMesh_.boundary().size());
94 forAll(procMesh_.boundary(), procPatchi)
102 procMesh_.boundary()[procPatchi],
109 tmp<VolField<Type>> tresF
116 procMesh_.time().name(),
124 Field<Type>(field.primitiveField(), cellAddressing_),
128 VolField<Type>& resF = tresF.ref();
132 typename VolField<Type>::
133 Boundary& bf = resF.boundaryFieldRef();
136 const fvPatch& procPatch = procMesh_.boundary()[procPatchi];
138 const label completePatchi = completePatchID(procPatchi);
140 if (completePatchi == procPatchi)
147 field.boundaryField()[completePatchi],
150 patchFieldDecomposers_[procPatchi]
154 else if (isA<processorCyclicFvPatch>(procPatch))
156 if (field.boundaryField()[completePatchi].overridesConstraint())
159 str <<
"\nThe field \"" << field.name()
160 <<
"\" on cyclic patch \""
161 << field.boundaryField()[completePatchi].patch().name()
162 <<
"\" cannot be decomposed as it is not a cyclic "
163 <<
"patch field. A \"patchType cyclic;\" setting has "
164 <<
"been used to override the cyclic patch type.\n\n"
165 <<
"Cyclic patches like this with non-cyclic boundary "
166 <<
"conditions should be confined to a single "
167 <<
"processor using decomposition constraints.";
173 const label nbrCompletePatchi =
174 refCast<const processorCyclicFvPatch>(procPatch)
175 .referPatch().nbrPatchID();
180 new processorCyclicFvPatchField<Type>
187 completeMesh_.lduAddr().patchAddr(nbrCompletePatchi),
188 field.primitiveField(),
189 faceAddressingBf_[procPatchi]
194 else if (isA<processorFvPatch>(procPatch))
199 new processorFvPatchField<Type>
205 completeMesh_.owner(),
206 completeMesh_.neighbour(),
207 field.primitiveField(),
208 faceAddressingBf_[procPatchi]
228 const SurfaceField<Type>& field
231 const SubList<label> faceAddressingIf
234 procMesh_.nInternalFaces()
238 PtrList<fvsPatchField<Type>> patchFields(procMesh_.boundary().size());
239 forAll(procMesh_.boundary(), procPatchi)
247 procMesh_.boundary()[procPatchi],
254 tmp<SurfaceField<Type>> tresF
256 new SurfaceField<Type>
261 procMesh_.time().name(),
278 SurfaceField<Type>& resF = tresF.ref();
282 typename SurfaceField<Type>::
283 Boundary& bf = resF.boundaryFieldRef();
284 forAll(procMesh_.boundary(), procPatchi)
286 const fvPatch& procPatch = procMesh_.boundary()[procPatchi];
288 const label completePatchi = completePatchID(procPatchi);
290 if (completePatchi == procPatchi)
297 field.boundaryField()[procPatchi],
300 patchFieldDecomposers_[procPatchi]
304 else if (isA<processorCyclicFvPatch>(procPatch))
309 new processorCyclicFvsPatchField<Type>
315 field.boundaryField()[completePatchi],
316 faceAddressingBf_[procPatchi],
322 else if (isA<processorFvPatch>(procPatch))
327 new processorFvsPatchField<Type>
333 field.primitiveField(),
334 faceAddressingBf_[procPatchi],
351 template<
class GeoField>
354 const PtrList<GeoField>&
fields
#define forAll(list, i)
Loop across all elements in list.
static const DimensionedField< Type, GeoMesh > & null()
Return a null DimensionedField.
static const char *const typeName
void decomposeFields(const PtrList< GeoField > &fields) const
Decompose a list of fields.
tmp< VolField< Type > > decomposeField(const VolField< Type > &field) const
Decompose volume field.
static tmp< fvPatchField< Type > > New(const word &, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
static tmp< fvsPatchField< Type > > New(const word &, const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Return a pointer to a new patchField created on freestore given.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Info<< "Calculating turbulent flame speed field St\n"<< endl;volScalarField St(IOobject("St", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
string breakIntoIndentedLines(const string &str, const string::size_type nLength=80, const string::size_type nIndent=0)
Break a string up into indented lines.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
bool isFlux(const DimensionedField< Type, surfaceMesh > &df)
Check if surfaceField is a flux.
dimensioned< scalar > mag(const dimensioned< Type > &)
UList< label > labelUList