52 const Field<Type>&
fld,
53 const UList<Type>& defaultValues
56 autoPtr<coordSystem::cylindrical> cs;
61 if (is_vectorspace<Type>::value)
68 return interpolateUntransformed(
fld, defaultValues);
72 const cyclicAMIPolyPatch& nbrPp = this->neighbPatch();
76 Pout<<
"cyclicAMIPolyPatch::interpolate :" 77 <<
" patch:" << this->
name()
78 <<
" size:" << this->size()
79 <<
" nbrPatch:" << nbrPp.name()
80 <<
" size:" << nbrPp.size()
84 if (
fld.size() != nbrPp.size())
87 <<
"Patch:" << this->
name()
88 <<
" size:" << this->size()
89 <<
" neighbour patch:" << nbrPp.name()
90 <<
" size:" << nbrPp.size()
91 <<
" fld size:" <<
fld.size()
96 Field<Type> localFld(
fld.size());
109 <<
" size:" << this->size()
110 <<
" fc:" <<
gAverage(this->faceCentres())
111 <<
" getting remote data from:" << nbrPp.name()
112 <<
" size:" << nbrPp.size()
118 Pout<<
"At:" << nbrFc[i] <<
nl 119 <<
" cart:" <<
fld[i] <<
nl 120 <<
" cyli:" << localFld[i] <<
nl 128 Field<Type> localDeflt(defaultValues.size());
129 if (defaultValues.size() == size())
135 const SubField<Type> defaultSubFld(defaultValues);
136 const Field<Type>& defaultFld(defaultSubFld);
144 interpolateUntransformed(localFld, localDeflt)
153 const tmp<Field<Type>>& tFld,
154 const UList<Type>& defaultValues
171 const auto& AMI = (owner() ? this->AMI() : neighbPatch().AMI());
173 if (AMI.distributed())
175 const auto& map = (owner() ? AMI.tgtMap() : AMI.srcMap());
178 map.send(
fld, sendRequests, sendBuffers, recvRequests, recvBuffers);
186 const Field<Type>&
fld,
187 labelRange& sendRequests,
188 PtrList<List<Type>>& sendBuffers,
189 labelRange& recvRequests,
190 PtrList<List<Type>>& recvBuffers
193 const auto& AMI = (owner() ? this->AMI() : neighbPatch().AMI());
195 if (!AMI.distributed())
200 autoPtr<coordSystem::cylindrical> cs;
202 if (is_vectorspace<Type>::value)
209 initInterpolateUntransformed
220 const cyclicAMIPolyPatch& nbrPp = this->neighbPatch();
222 Field<Type> localFld(
fld.size());
230 initInterpolateUntransformed
245 const Field<Type>& localFld,
246 const labelRange& requests,
247 const PtrList<List<Type>>& recvBuffers,
248 const UList<Type>& defaultValues
251 const auto& AMI = (owner() ? this->AMI() : neighbPatch().AMI());
252 const auto& map = (owner() ? AMI.tgtMap() : AMI.srcMap());
255 if (AMI.distributed())
259 map.receive(requests, recvBuffers, work);
261 const Field<Type>&
fld = (AMI.distributed() ? work : localFld);
263 auto tresult = tmp<Field<Type>>
::New(this->size(),
Zero);
266 autoPtr<coordSystem::cylindrical> cs;
268 if (is_vectorspace<Type>::value)
287 Field<Type> localDeflt(defaultValues.size());
288 if (defaultValues.size() == size())
294 const SubField<Type> defaultSubFld(defaultValues);
295 const Field<Type>& defaultFld(defaultSubFld);
315 template<
class Type,
class CombineOp>
319 const CombineOp& cop,
388 AMI().interpolateToSource
398 neighbPatch().AMI().interpolateToTarget
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionSet invTransform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
A range or interval of labels defined by a start and a size.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
tmp< Field< Type > > interpolate(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >()) const
Interpolate field.
#define forAll(list, i)
Loop across all elements in list.
void initInterpolate(const Field< Type > &fld, labelRange &sendRequests, PtrList< List< Type >> &sendBuffers, labelRange &recvRequests, PtrList< List< Type >> &recvBuffers) const
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Generic templated field type.
void interpolateToTarget(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from source to target with supplied op to combine existing value with remote value and we...
void initInterpolateUntransformed(const Field< Type > &fld, labelRange &sendRequests, PtrList< List< Type >> &sendBuffers, labelRange &recvRequests, PtrList< List< Type >> &recvBuffers) const
int debug
Static debugging option.
void interpolateToSource(const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const
Interpolate from target to source with supplied op to combine existing value with remote value and we...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
tmp< Field< Type > > interpolateUntransformed(const Field< Type > &fld, const UList< Type > &defaultValues) const
Interpolate without periodic.
#define R(A, B, C, D, E, F, K, M)
Type gAverage(const FieldField< Field, Type > &f)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
virtual const cyclicAMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
virtual bool owner() const
Does this side own the patch?
SubField< vector > subField
Declare type of subField.
A class for managing temporary objects.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
coordSystem::cylindrical cylindricalCS
Compatibility typedef 1806.
static constexpr const zero Zero
Global zero (0)