43 const fvBoundaryMesh& fvbm
47 labelList origNcPatchCount(fvbm.size(), 0);
52 const fvPatch& fvp = fvbm[ncPatchi];
54 if (!isA<nonConformalFvPatch>(fvp))
continue;
55 if (isA<processorCyclicFvPatch>(fvp))
continue;
57 const nonConformalFvPatch& ncFvp =
58 refCast<const nonConformalFvPatch>(fvp);
60 result[ncPatchi] = origNcPatchCount[ncFvp.origPatchIndex()] ++;
66 const fvPatch& fvp = fvbm[ncPatchi];
68 if (!isA<nonConformalFvPatch>(fvp))
continue;
69 if (!isA<processorCyclicFvPatch>(fvp))
continue;
71 const nonConformalProcessorCyclicFvPatch& ncpcFvp =
72 refCast<const nonConformalProcessorCyclicFvPatch>(fvp);
74 result[ncPatchi] = result[ncpcFvp.referPatchIndex()];
87 const DimensionedField<Type, volMesh>& iF,
88 autoPtr<fvPatchField<Type>>&& origFieldPtr,
89 PtrList<fvPatchField<Type>>&& ncFieldPtrs,
90 PtrList<scalarField>&& ncCoverages
93 fvPatchField<Type>(
p, iF),
94 origFieldPtr_(origFieldPtr),
95 ncFieldPtrs_(ncFieldPtrs),
96 ncCoverages_(ncCoverages)
105 const fvPatch& origFvp = this->patch();
106 const fvBoundaryMesh& fvbm = origFvp.boundaryMesh();
111 DynamicList<label> result(ncFieldPtrs_.size());
114 const fvPatch& fvp = fvbm[ncPatchi];
116 if (!isA<nonConformalFvPatch>(fvp))
continue;
117 if (isA<processorCyclicFvPatch>(fvp))
continue;
119 const nonConformalFvPatch& ncFvp =
120 refCast<const nonConformalFvPatch>(fvp);
122 if (ncFvp.origPatchName() != origFvp.name())
continue;
124 result.append(ncPatchi);
129 if (result.size() != ncFieldPtrs_.size())
131 const DimensionedField<Type, volMesh>& iF = this->internalField();
134 <<
"Conformed field " << (
isNull(iF) ?
"" : iF.name() +
' ')
135 <<
"on patch " << origFvp.name() <<
" has " << ncFieldPtrs_.size()
136 <<
" non-conformal fields stored, but the patch has "
137 << result.size() <<
" associated non-conformal patches"
166 forAll(origPatchIndices, i)
168 const label origPatchi = origPatchIndices[i];
169 const fvPatch& origFvp = fvbm[origPatchi];
177 bF.
set(origPatchi,
nullptr),
183 pF() == pF->origFieldPtr_();
185 bF.
set(origPatchi, pF.
ptr());
192 const fvPatch& fvp = fvbm[ncPatchi];
194 if (!isA<nonConformalFvPatch>(fvp))
continue;
195 if (isA<processorCyclicFvPatch>(fvp))
continue;
198 refCast<const nonConformalFvPatch>(fvp);
201 const fvPatch& origFvp = fvbm[origPatchi];
204 refCast<conformedFvPatchField<Type>>(bF[origPatchi]);
207 max(cpF.ncFieldPtrs_.size(), ncOrigNcField[ncPatchi] + 1);
209 cpF.ncFieldPtrs_.resize(
n);
212 ncOrigNcField[ncPatchi],
222 cpF.ncCoverages_.resize(
n);
225 ncOrigNcField[ncPatchi],
233 const fvPatch& fvp = fvbm[ncPatchi];
235 if (!isA<nonConformalFvPatch>(fvp))
continue;
238 refCast<const nonConformalFvPatch>(fvp);
241 const fvPatch& origFvp = fvbm[origPatchi];
257 refCast<conformedFvPatchField<Type>>(bF[origPatchi]);
259 cpF.ncCoverages_[ncOrigNcField[ncPatchi]] +=
260 origNcMagSf/origFvp.
magSf();
267 const fvPatch& fvp = fvbm[ncPatchi];
269 if (!isA<nonConformalFvPatch>(fvp))
continue;
272 refCast<const nonConformalFvPatch>(fvp);
275 const fvPatch& origFvp = fvbm[origPatchi];
281 refCast<conformedFvPatchField<Type>>(bF[origPatchi]);
283 cpF.ncFieldPtrs_[ncOrigNcField[ncPatchi]].map
294 cpF.ncCoverages_[ncOrigNcField[ncPatchi]]
325 const fvPatch& fvp = fvbm[ncPatchi];
327 if (!isA<nonConformalFvPatch>(fvp))
continue;
330 refCast<const nonConformalFvPatch>(fvp);
333 const fvPatch& origFvp = fvbm[origPatchi];
336 refCast<conformedFvPatchField<Type>>(bF[origPatchi]);
341 forAll(ncOrigPatchFace, ncPatchFacei)
343 const label origPatchFacei = ncOrigPatchFace[ncPatchFacei];
345 if (cpF.ncCoverages_[ncOrigNcField[ncPatchi]][origPatchFacei] == 0)
347 ncOrigPatchFace[ncPatchFacei] = -1;
357 bF[ncPatchi] = bF[ncPatchi].patchInternalField();
361 cpF.ncFieldPtrs_[ncOrigNcField[ncPatchi]],
371 cpF.ncFieldPtrs_[ncOrigNcField[ncPatchi]],
378 forAll(origPatchIndices, i)
380 const label origPatchi = origPatchIndices[i];
383 refCast<conformedFvPatchField<Type>>(bF[origPatchi]);
385 bF.
set(origPatchi, cpF.origFieldPtr_.ptr());
418 ncFieldPtrs_(
dict.subDict(
"ncFields").size()),
419 ncCoverages_(
dict.subDict(
"ncFields").size())
425 const word& ncPName = iter().keyword();
426 const fvPatch& ncP =
p.boundaryMesh()[ncPName];
458 ncFieldPtrs_(ptf.ncFieldPtrs_.size()),
459 ncCoverages_(ptf.ncCoverages_.size())
461 const labelList ncPatchIndices(this->ncPatchIndices());
463 forAll(ptf.ncFieldPtrs_, i)
471 p.boundaryMesh()[ncPatchIndices[i]],
479 mapper(ptf.ncCoverages_[i]).ptr()
493 origFieldPtr_(ptf.origFieldPtr_->
clone(iF).ptr()),
494 ncFieldPtrs_(ptf.ncFieldPtrs_, iF),
495 ncCoverages_(ptf.ncCoverages_)
513 refCast<const conformedFvPatchField<Type>>(ptf);
515 origFieldPtr_->
map(cptf.origFieldPtr_(), mapper);
518 ncFieldPtrs_[i].map(cptf.ncFieldPtrs_[i], mapper);
519 mapper(ncCoverages_[i], cptf.ncCoverages_[i]);
537 refCast<const conformedFvPatchField<Type>>(ptf);
539 origFieldPtr_->
reset(cptf.origFieldPtr_());
542 ncFieldPtrs_[i].reset(cptf.ncFieldPtrs_[i]);
543 ncCoverages_[i] = cptf.ncCoverages_[i];
561 origFieldPtr_->write(os);
570 ncFieldPtrs_[i].write(os);
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static nonConformalBoundary & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const
Return mesh.
Generic GeometricBoundaryField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
T * ptr()
Return object pointer for reuse.
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base class for field mapping.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual label size() const
Return size.
virtual label start() const
Return start label of this patch in the polyMesh face list.
const scalarField & magSf() const
Return face area magnitudes.
Mapper which sets the field size and initialises all values to zero. It does not actually map values.
A class for handling words, derived from string.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
word name(const bool)
Return a word representation of a bool.
bool isType(const Type &t)
Check the typeid.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
Ostream & indent(Ostream &os)
Indent stream.