38 const auto& interp =
AMI();
43 lst = interp.interpolateToSource(
Field<Type>(std::move(lst)));
63 (void)interp.interpolateToTarget
74 (void)interp.interpolateToSource
96 const auto& m =
map();
107template<
class Type,
class CombineOp>
114 const label myComm = getCommunicator();
118 case NEARESTPATCHFACEAMI:
120 const auto& interp = AMI();
122 label oldWarnComm(-1);
123 label oldWorldComm(-1);
130 lst = interp.interpolateToSource(
Field<Type>(std::move(lst)), cop);
139 (void)patch_.boundaryMesh().mesh().tetBasePtIs();
140 const auto& m = map();
142 label oldWarnComm(-1);
173 const label myComm = getCommunicator();
177 case NEARESTPATCHFACEAMI:
179 const auto& interp = AMI();
181 label oldWarnComm(-1);
182 label oldWorldComm(-1);
189 lst = interp.interpolateToTarget(
Field<Type>(std::move(lst)));
198 (void)patch_.boundaryMesh().mesh().tetBasePtIs();
199 const auto& m = map();
202 m.reverseDistribute(sampleSize(), lst);
210template<
class Type,
class CombineOp>
217 const label myComm = getCommunicator();
221 case NEARESTPATCHFACEAMI:
223 const auto& interp = AMI();
225 label oldWarnComm(-1);
226 label oldWorldComm(-1);
233 lst = interp.interpolateToTarget(
Field<Type>(std::move(lst)), cop);
241 (void)patch_.boundaryMesh().mesh().tetBasePtIs();
242 const auto& m = map();
243 const label cSize = sampleSize();
245 label oldWarnComm(-1);
285 const auto&
fld = *fldPtr;
312 if (tok.isCompound<List<Type>>())
314 auto* fldPtr = obr.getObjectPtr<IOField<Type>>(
name);
317 fldPtr =
new IOField<Type>
350 const word& fieldName,
351 const Field<Type>& values
354 auto* fldPtr = obr.getObjectPtr<IOField<Type>>(fieldName);
357 fldPtr =
new IOField<Type>
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A primitive field of type <T> with automated input and output.
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
static label commWorld() noexcept
Communicator for all ranks (respecting any local worlds).
static int & msgType() noexcept
Message tag of standard messages.
static label commWarn(const label communicator) noexcept
Alter communicator debugging setting. Warns for use of any communicator differing from specified....
static commsTypes defaultCommsType
Default commsType.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
static void distribute(const UPstream::commsTypes commsType, const UList< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const T &nullValue, const CombineOp &cop, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Distribute combine data with specified combine operation and negate operator (for flips).
const mapDistribute & map() const
Return reference to the parallel distribution map.
void reverseDistribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
const polyPatch & patch_
Patch to sample.
@ NEARESTPATCHFACEAMI
nearest patch face + AMI interpolation
const sampleMode mode_
What to sample.
static bool writeIOField(const regIOobject &obj, dictionary &dict)
Attempt to detect an IOField<Type> and write to dictionary.
label sampleSize() const
Return size of mapped mesh/patch/boundary.
bool masterWorld() const
Is my world ordered before the sampleWorld?
label getCommunicator() const
Get the communicator (worldComm or world-to-world).
const AMIPatchToPatchInterpolation & AMI(const bool forceUpdate=false) const
Return reference to the AMI interpolator.
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
static bool constructIOField(const word &name, token &tok, Istream &is, objectRegistry &obr)
Attempt to read an IOField<Type> and store on objectRegistry.
static void storeField(objectRegistry &obr, const word &fieldName, const Field< Type > &values)
Store an IOField on the objectRegistry relative to obr.
bool sameWorld() const
Is sample world the local world?
Registry of regIOobjects.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool store()
Register object with its registry and transfer ownership to the registry.
A class for managing temporary objects.
A templated class for holding compound tokens. The underlying container is normally a List of values,...
A token holds an item read from Istream.
compound & transferCompoundToken(const Istream *is=nullptr)
Return reference to compound and mark internally as released.
bool isCompound() const noexcept
Token is COMPOUND.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Functor to negate primitives. Dummy for most other types.