38static const scalar perturbFactor = 1
e-6;
68 label facei = meshSearcher.findNearestBoundaryFace(pt);
74 const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
91 const polyMesh& meshSource = interp.srcRegion();
92 const polyMesh& meshTarget = interp.tgtRegion();
93 const labelListList& sourceToTarget = interp.srcToTgtCellAddr();
104 for (
const fileName& cloudDir : cloudDirs)
110 meshSource.time().timeName(),
118 objects.found(
"coordinates") || objects.found(
"positions")
123 Info<<
nl <<
" processing cloud " << cloudDir <<
endl;
133 Info<<
" read " << sourceParcels.size()
134 <<
" parcels from source mesh." <<
endl;
146 label sourceParticleI = 0;
162 bool foundCell =
false;
168 sourceToTarget[
p.cell()];
174 for (
const label targetCell : targetCells)
184 meshTarget.cells()[targetCell][0],
190 newP.track(
p.position() - newP.position(), 0);
196 addParticles.append(sourceParticleI);
197 targetParcels.addParticle(newPtr.ptr());
206 unmappedSource.insert(sourceParticleI);
212 Info<<
" after meshToMesh addressing found "
213 << targetParcels.size()
214 <<
" parcels in target mesh." <<
endl;
220 if (unmappedSource.size())
226 if (unmappedSource.found(sourceParticleI))
228 const label targetCell =
229 findCell(targetParcels,
p.position());
233 unmappedSource.erase(sourceParticleI);
234 addParticles.append(sourceParticleI);
235 targetParcels.addParticle
244 sourceParcels.remove(&
p);
250 addParticles.shrink();
252 Info<<
" after additional mesh searching found "
253 << targetParcels.size() <<
" parcels in target mesh." <<
endl;
255 if (addParticles.size())
Base cloud calls templated on particle type.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Helper IO class to read and write particle coordinates (positions).
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A cloud is a registry collection of lagrangian particles.
static const word prefix
The prefix to local: lagrangian.
A class for handling file names.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Class to calculate the cell-addressing between two overlapping meshes.
A Cloud of passive particles.
Mesh consisting of general polyhedral cells.
void findCellFacePt(const point &p, label &celli, label &tetFacei, label &tetPti) const
Find the cell, tetFacei and tetPti for point p.
virtual const labelList & faceOwner() const
Return face owner.
const vectorField & cellCentres() const
Gets the indices of (source)particles that have been appended to the target cloud and maps the lagran...
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
List< fileName > fileNameList
List of fileName.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
vector point
Point is a vector.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
void mapLagrangian(const meshToMesh0 &meshToMesh0Interp)
Maps lagrangian positions and fields.
void MapLagrangianFields(const string &cloudName, const IOobjectList &objects, const meshToMesh0 &meshToMesh0Interp, const labelList &addParticles, const char *msg)
Gets the indices of (source)particles that have been appended to the.
fileNameList readDir(const fileName &directory, const fileName::Type type=fileName::Type::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a fileName List.
constexpr char nl
The newline '\n' character (0x0a).