43 void Foam::meshToMesh::mapAndOpSrcToTgt
53 void Foam::meshToMesh::mapAndOpSrcToTgt
63 void Foam::meshToMesh::mapAndOpSrcToTgt
73 void Foam::meshToMesh::mapAndOpSrcToTgt
83 void Foam::meshToMesh::mapAndOpSrcToTgt
93 void Foam::meshToMesh::mapAndOpTgtToSrc
103 void Foam::meshToMesh::mapAndOpTgtToSrc
113 void Foam::meshToMesh::mapAndOpTgtToSrc
123 void Foam::meshToMesh::mapAndOpTgtToSrc
133 void Foam::meshToMesh::mapAndOpTgtToSrc
179 void Foam::meshToMesh::normaliseWeights
181 const word& descriptor,
208 const word& methodName,
244 Info<<
"Creating mesh-to-mesh addressing for " << srcRegion_.name()
245 <<
" and " << tgtRegion_.name() <<
" regions using " 246 << methodName <<
endl;
248 singleMeshProc_ = calcDistribution(srcRegion_, tgtRegion_);
252 if (singleMeshProc_ == -1)
270 distributeAndMergeCells
278 newTgtFaceNeighbours,
289 tgtRegion_.time().timeName(),
295 move(newTgtFaceOwners),
296 move(newTgtFaceNeighbours),
305 newTgt.nFaces() - newTgt.nInternalFaces(),
306 newTgt.nInternalFaces(),
308 newTgt.boundaryMesh(),
312 newTgt.addPatches(patches);
315 (void)newTgt.tetBasePtIs();
322 Pout<<
"Created newTgt mesh:" <<
nl 323 <<
" old cells = " << tgtRegion_.nCells()
324 <<
", new cells = " << newTgt.nCells() <<
nl 325 <<
" old faces = " << tgtRegion_.nFaces()
326 <<
", new faces = " << newTgt.nFaces() <<
endl;
330 Pout<<
"Writing newTgt mesh: " << newTgt.
name() <<
endl;
335 amiMethod = calcAddressing(methodName, srcRegion_, newTgt);
338 forAll(srcToTgtCellAddr_, i)
340 labelList& addressing = srcToTgtCellAddr_[i];
343 addressing[addrI] = newTgtCellIDs[addressing[addrI]];
348 forAll(tgtToSrcCellAddr_, i)
350 labelList& addressing = tgtToSrcCellAddr_[i];
353 addressing[addrI] = globalSrcCells.toGlobal(addressing[addrI]);
420 amiMethod = calcAddressing(methodName, srcRegion_, tgtRegion_);
437 Info<<
" Overlap volume: " << V_ <<
endl;
443 void Foam::meshToMesh::calculatePatchAMIs(
const word& AMIMethodName)
445 if (!patchAMIs_.empty())
448 <<
"patch AMI already calculated" 452 patchAMIs_.setSize(srcPatchID_.size());
456 label srcPatchi = srcPatchID_[i];
457 label tgtPatchi = tgtPatchID_[i];
462 Info<<
"Creating AMI between source patch " << srcPP.
name()
463 <<
" and target patch " << tgtPP.
name()
464 <<
" using " << AMIMethodName
489 void Foam::meshToMesh::constructNoCuttingPatches
491 const word& methodName,
492 const bool interpAllPatches
495 if (interpAllPatches)
509 if (!isA<processorPolyPatch>(pp))
517 tgtPatchID.append(tgtPatchi);
522 <<
"Source patch " << pp.
name()
523 <<
" not found in target mesh. " 524 <<
"Available target patches are " << tgtBM.
names()
530 srcPatchID_.transfer(srcPatchID);
531 tgtPatchID_.transfer(tgtPatchID);
538 calculatePatchAMIs(amiMethod);
542 void Foam::meshToMesh::constructFromCuttingPatches
544 const word& methodName,
549 srcPatchID_.setSize(patchMap.
size());
550 tgtPatchID_.setSize(patchMap.
size());
555 const word& tgtPatchName = iter.key();
556 const word& srcPatchName = iter();
561 srcPatchID_[i] = srcPatch.
index();
562 tgtPatchID_[i] = tgtPatch.
index();
570 calculatePatchAMIs(amiMethod);
573 cuttingPatches_.setSize(cuttingPatches.
size());
574 forAll(cuttingPatches_, i)
576 const word& patchName = cuttingPatches[i];
577 cuttingPatches_[i] = tgtRegion_.boundaryMesh().findPatchID(patchName);
588 const word& methodName,
589 bool interpAllPatches
607 constructNoCuttingPatches(methodName, interpAllPatches);
615 const word& methodName,
635 constructFromCuttingPatches
const fvPatchList & patches
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &, const negateOp &negOp, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for.
Class containing functor to negate primitives. Dummy for all other types.
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
virtual const fileName & name() const
Return the name of the stream.
void append(T *)
Append an element at the end of the list.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
virtual Ostream & write(const char)=0
Write character.
const word & name() const
Return name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Plus op for FixedList<scalar>
label findPatchID(const word &patchName) const
Find patch index given a name.
scalar V() const
Return const access to the overlap volume.
const labelListList & constructMap() const
From subsetted data to new reconstructed data.
A bounding box defined in terms of the points at its extremities.
const cellList & cells() const
const labelListList & subMap() const
From subsetted data back to original data.
label size() const
Return number of elements in table.
void writeConnectivity(const polyMesh &mesh1, const polyMesh &mesh2, const labelListList &mesh1ToMesh2Addr) const
Write the connectivity (debugging)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght)=0
Calculate addressing and weights.
virtual const pointField & points() const
Return raw points.
label calculate(const fvMesh &mesh, const labelHashSet &patchIDs, const scalar minFaceFraction, GeometricField< scalar, PatchField, GeoMesh > &distance)
Calculate distance data from patches.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
wordList names() const
Return a list of patch names.
void append(const T &)
Append an element at the end of the list.
List< scalar > scalarList
A List of scalars.
static const word null
An empty word.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< label > labelList
A List of labels.
virtual const faceList & faces() const
Return raw faces.
An STL-conforming hash table.
void inflate(const scalar s)
Inflate box by factor*mag(span) in all dimensions.
defineTypeNameAndDebug(combustionModel, 0)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
meshToMesh(const polyMesh &src, const polyMesh &tgt, const word &methodName, const bool interpAllPatches=true)
Construct from source and target meshes, generic mapping methods.
word name(const complex &)
Return a string representation of a complex.
label size() const
Return the number of elements in the UPtrList.
const point & max() const
Maximum point defining the bounding box.
const boundBox & bounds() const
Return mesh bounding box.
Class containing processor-to-processor mapping information.
virtual ~meshToMesh()
Destructor.
prefixOSstream Pout(cout, "Pout")
virtual const word & AMImethod() const =0
Return the corresponding AMI method for patch interpolation.
label index() const
Return the index of this patch in the boundaryMesh.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Mesh consisting of general polyhedral cells.
const point & min() const
Minimum point defining the bounding box.
A patch is a list of labels that address the faces in the global face list.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static autoPtr< meshToMeshMethod > New(const word &methodName, const polyMesh &src, const polyMesh &tgt)
Selector.