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());
194 const Field<Type>&
fld,
195 labelRange& sendRequests,
196 PtrList<List<Type>>& sendBuffers,
197 labelRange& recvRequests,
198 PtrList<List<Type>>& recvBuffers
201 const auto& AMI = (owner() ? this->AMI() : neighbPatch().AMI());
203 if (!AMI.distributed())
208 autoPtr<coordSystem::cylindrical> cs;
210 if (is_vectorspace<Type>::value)
217 initInterpolateUntransformed
228 const cyclicAMIPolyPatch& nbrPp = this->neighbPatch();
230 Field<Type> localFld(
fld.size());
238 initInterpolateUntransformed
253 const Field<Type>& localFld,
254 const labelRange& requests,
255 const PtrList<List<Type>>& recvBuffers,
256 const UList<Type>& defaultValues
259 const auto& AMI = (owner() ? this->AMI() : neighbPatch().AMI());
260 const auto& map = (owner() ? AMI.tgtMap() : AMI.srcMap());
263 if (AMI.distributed())
275 const Field<Type>&
fld = (AMI.distributed() ? work : localFld);
277 auto tresult = tmp<Field<Type>>
::New(this->size(),
Zero);
280 autoPtr<coordSystem::cylindrical> cs;
282 if (is_vectorspace<Type>::value)
301 Field<Type> localDeflt(defaultValues.size());
302 if (defaultValues.size() == size())
308 const SubField<Type> defaultSubFld(defaultValues);
309 const Field<Type>& defaultFld(defaultSubFld);
329 template<
class Type,
class CombineOp>
333 const CombineOp& cop,
402 AMI().interpolateToSource
412 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
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
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.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
coordSystem::cylindrical cylindricalCS
Compatibility typedef 1806.
static constexpr const zero Zero
Global zero (0)