52 const Field<Type>&
fld,
53 const UList<Type>& defaultValues
57 constexpr
bool transform_supported = is_rotational_vectorspace_v<Type>;
60 autoPtr<coordSystem::cylindrical> cs;
64 if constexpr (transform_supported)
71 return interpolateUntransformed(
fld, defaultValues);
74 if constexpr (transform_supported)
76 const cyclicAMIPolyPatch& nbrPp = this->neighbPatch();
80 Pout<<
"cyclicAMIPolyPatch::interpolate :" 81 <<
" patch:" << this->
name()
82 <<
" size:" << this->size()
83 <<
" nbrPatch:" << nbrPp.name()
84 <<
" size:" << nbrPp.size()
88 if (
fld.size() != nbrPp.size())
91 <<
"Patch:" << this->
name()
92 <<
" size:" << this->size()
93 <<
" neighbour patch:" << nbrPp.name()
94 <<
" size:" << nbrPp.size()
95 <<
" fld size:" <<
fld.size()
100 Field<Type> localFld(
fld.size());
113 <<
" size:" << this->size()
114 <<
" fc:" <<
gAverage(this->faceCentres())
115 <<
" getting remote data from:" << nbrPp.name()
116 <<
" size:" << nbrPp.size()
122 Pout<<
"At:" << nbrFc[i] <<
nl 123 <<
" cart:" <<
fld[i] <<
nl 124 <<
" cyli:" << localFld[i] <<
nl 132 Field<Type> localDeflt(defaultValues.size());
133 if (defaultValues.size() == size())
139 const SubField<Type> defaultSubFld(defaultValues);
140 const Field<Type>& defaultFld(defaultSubFld);
148 interpolateUntransformed(localFld, localDeflt)
154 <<
"CODING ERROR??" <<
nl 155 <<
"calculated cylindrical coordinate system," 156 " but does not appear to be a vector-space type" <<
endl 166 const tmp<Field<Type>>& tFld,
167 const UList<Type>& defaultValues
184 const auto& AMI = (owner() ? this->AMI() : neighbPatch().AMI());
186 if (AMI.distributed() && AMI.comm() != -1)
188 const auto& map = (owner() ? AMI.tgtMap() : AMI.srcMap());
207 const Field<Type>&
fld,
208 labelRange& sendRequests,
209 PtrList<List<Type>>& sendBuffers,
210 labelRange& recvRequests,
211 PtrList<List<Type>>& recvBuffers
214 const auto& AMI = (owner() ? this->AMI() : neighbPatch().AMI());
216 if (!AMI.distributed() || AMI.comm() == -1)
222 constexpr
bool transform_supported = is_rotational_vectorspace_v<Type>;
225 autoPtr<coordSystem::cylindrical> cs;
227 if constexpr (transform_supported)
234 initInterpolateUntransformed
243 else if constexpr (transform_supported)
245 const cyclicAMIPolyPatch& nbrPp = this->neighbPatch();
247 Field<Type> localFld(
fld.size());
255 initInterpolateUntransformed
270 const Field<Type>& localFld,
271 const labelRange& requests,
272 const PtrList<List<Type>>& recvBuffers,
273 const UList<Type>& defaultValues
276 auto tresult = tmp<Field<Type>>
::New(this->size(),
Zero);
278 const auto& AMI = (owner() ? this->AMI() : neighbPatch().AMI());
281 if (AMI.distributed())
283 if (AMI.comm() == -1)
288 const auto& map = (owner() ? AMI.tgtMap() : AMI.srcMap());
300 const Field<Type>&
fld = (AMI.distributed() ? work : localFld);
303 constexpr
bool transform_supported = is_rotational_vectorspace_v<Type>;
306 autoPtr<coordSystem::cylindrical> cs;
309 if constexpr (transform_supported)
324 else if constexpr (transform_supported)
328 Field<Type> localDeflt(defaultValues.size());
329 if (defaultValues.size() == size())
335 const SubField<Type> defaultSubFld(defaultValues);
336 const Field<Type>& defaultFld(defaultSubFld);
356 template<
class Type,
class CombineOp>
360 const CombineOp& cop,
435 AMI().interpolateToSource
445 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...
errorManip< error > abort(error &err)
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.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
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)
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)