38static const scalar perturbFactor = 1
e-6;
68 label facei = meshSearcher.findNearestBoundaryFace(pt);
74 const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
92 const labelList& cellAddressing = meshToMesh0Interp.cellAddressing();
102 const fvMesh& meshSource = meshToMesh0Interp.fromMesh();
103 const fvMesh& meshTarget = meshToMesh0Interp.toMesh();
114 for (
const fileName& cloudDir : cloudDirs)
120 meshSource.time().timeName(),
124 if (objects.found(
"coordinates") || objects.found(
"positions"))
127 Info<<
nl <<
" processing cloud " << cloudDir <<
endl;
137 Info<<
" read " << sourceParcels.size()
138 <<
" parcels from source mesh." <<
endl;
150 label sourceParticleI = 0;
166 bool foundCell =
false;
172 sourceToTargets[
p.cell()];
178 for (
const label targetCell : targetCells)
188 meshTarget.cells()[targetCell][0],
194 newP.track(
p.position() - newP.position(), 0);
200 addParticles.append(sourceParticleI);
201 targetParcels.addParticle(newPtr.ptr());
210 unmappedSource.insert(sourceParticleI);
216 Info<<
" after meshToMesh0 addressing found "
217 << targetParcels.size()
218 <<
" parcels in target mesh." <<
endl;
224 if (unmappedSource.size())
230 if (unmappedSource.found(sourceParticleI))
232 const label targetCell =
233 findCell(targetParcels,
p.position());
237 unmappedSource.erase(sourceParticleI);
238 addParticles.append(sourceParticleI);
239 targetParcels.addParticle
248 sourceParcels.remove(&
p);
254 addParticles.shrink();
256 Info<<
" after additional mesh searching found "
257 << targetParcels.size() <<
" parcels in target mesh." <<
endl;
259 if (addParticles.size())
270 (cloudDir, objects, meshToMesh0Interp, addParticles);
272 (cloudDir, objects, meshToMesh0Interp, addParticles);
274 (cloudDir, objects, meshToMesh0Interp, addParticles);
276 (cloudDir, objects, meshToMesh0Interp, addParticles);
278 (cloudDir, objects, meshToMesh0Interp, addParticles);
280 (cloudDir, objects, meshToMesh0Interp, addParticles);
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.
Mesh data needed to do the Finite Volume discretisation.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Serial mesh to mesh interpolation class.
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)
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.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
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).