34 template<
class Type,
class CombineOp>
43 if (fld.
size() != srcAddress_.size())
46 <<
"Supplied field size is not equal to source patch size" <<
nl 47 <<
" source patch = " << srcAddress_.size() <<
nl 48 <<
" target patch = " << tgtAddress_.size() <<
nl 49 <<
" supplied field = " << fld.
size()
53 if (lowWeightCorrection_ > 0)
55 if (defaultValues.
size() != tgtAddress_.size())
58 <<
"Employing default values when sum of weights falls below " 59 << lowWeightCorrection_
60 <<
" but supplied default field size is not equal to target " 62 <<
" default values = " << defaultValues.
size() <<
nl 63 <<
" target patch = " << tgtAddress_.size() <<
nl 68 result.
setSize(tgtAddress_.size());
70 if (singlePatchProc_ == -1)
79 if (tgtWeightsSum_[facei] < lowWeightCorrection_)
81 result[facei] = defaultValues[facei];
85 const labelList& faces = tgtAddress_[facei];
86 const scalarList& weights = tgtWeights_[facei];
90 cop(result[facei], facei, work[faces[i]], weights[i]);
99 if (tgtWeightsSum_[facei] < lowWeightCorrection_)
101 result[facei] = defaultValues[facei];
105 const labelList& faces = tgtAddress_[facei];
106 const scalarList& weights = tgtWeights_[facei];
110 cop(result[facei], facei, fld[faces[i]], weights[i]);
118 template<
class Type,
class CombineOp>
122 const CombineOp& cop,
127 if (fld.
size() != tgtAddress_.size())
130 <<
"Supplied field size is not equal to target patch size" <<
nl 131 <<
" source patch = " << srcAddress_.size() <<
nl 132 <<
" target patch = " << tgtAddress_.size() <<
nl 133 <<
" supplied field = " << fld.
size()
137 if (lowWeightCorrection_ > 0)
139 if (defaultValues.
size() != srcAddress_.size())
142 <<
"Employing default values when sum of weights falls below " 143 << lowWeightCorrection_
144 <<
" but supplied default field size is not equal to target " 145 <<
"patch size" <<
nl 146 <<
" default values = " << defaultValues.
size() <<
nl 147 <<
" source patch = " << srcAddress_.size() <<
nl 152 result.
setSize(srcAddress_.size());
154 if (singlePatchProc_ == -1)
163 if (srcWeightsSum_[facei] < lowWeightCorrection_)
165 result[facei] = defaultValues[facei];
169 const labelList& faces = srcAddress_[facei];
170 const scalarList& weights = srcWeights_[facei];
174 cop(result[facei], facei, work[faces[i]], weights[i]);
183 if (srcWeightsSum_[facei] < lowWeightCorrection_)
185 result[facei] = defaultValues[facei];
189 const labelList& faces = srcAddress_[facei];
190 const scalarList& weights = srcWeights_[facei];
194 cop(result[facei], facei, fld[faces[i]], weights[i]);
202 template<
class Type,
class CombineOp>
207 const CombineOp& cop,
232 template<
class Type,
class CombineOp>
237 const CombineOp& cop,
241 return interpolateToSource(tFld(), cop, defaultValues);
245 template<
class Type,
class CombineOp>
250 const CombineOp& cop,
275 template<
class Type,
class CombineOp>
280 const CombineOp& cop,
284 return interpolateToTarget(tFld(), cop, defaultValues);
308 return interpolateToSource(tFld(),
plusEqOp<Type>(), defaultValues);
332 return interpolateToTarget(tFld(),
plusEqOp<Type>(), defaultValues);
#define forAll(list, i)
Loop across all elements in list.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
T & ref() const
Return non-const reference or generate a fatal error.
Pre-declare SubField and related 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.
errorManip< error > abort(error &err)
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.
void setSize(const label)
Reset size of List.
Class containing processor-to-processor mapping information.
A class for managing temporary objects.
label size() const
Return the number of elements in the UList.