Go to the documentation of this file.
73 Pout<<
"participating source mesh cells: " <<
cells.size() <<
endl;
86 scalar threshold = tolerance_*src_.cellVolumes()[srcCelli];
93 treeBoundBox bbTgtCell(tgt_.points(), tgt_.faces()[cellFaces[0]]);
94 for (label i = 1; i < cellFaces.
size(); ++i)
96 bbTgtCell.
add(tgt_.points(), tgt_.faces()[cellFaces[i]]);
99 return overlapEngine.cellCellOverlapMinDecomp
113 const label srcCelli,
122 treeBoundBox bbTgtCell(tgt_.points(), tgt_.faces()[cellFaces[0]]);
123 for (label i = 1; i < cellFaces.
size(); ++i)
125 bbTgtCell.
add(tgt_.points(), tgt_.faces()[cellFaces[i]]);
144 const label srcCelli,
153 treeBoundBox bbTgtCell(tgt_.points(), tgt_.faces()[cellFaces[0]]);
154 for (label i = 1; i < cellFaces.
size(); ++i)
156 bbTgtCell.
add(tgt_.points(), tgt_.faces()[cellFaces[i]]);
170 if (volAndInertia.
first() <= ROOTVSMALL)
172 volAndInertia.
first() = 0.0;
180 return volAndInertia;
195 for (
const label nbrCelli : nbrCells)
199 !visitedCells.found(nbrCelli)
200 && !nbrCellIDs.found(nbrCelli)
203 nbrCellIDs.
append(nbrCelli);
217 srcToTgtAddr.
setSize(src_.nCells());
218 srcToTgtWght.
setSize(src_.nCells());
219 tgtToSrcAddr.
setSize(tgt_.nCells());
220 tgtToSrcWght.
setSize(tgt_.nCells());
226 else if (!tgt_.nCells())
230 Pout<<
"mesh interpolation: have " << src_.nCells() <<
" source "
231 <<
" cells but no target cells" <<
endl;
243 Foam::meshToMeshMethod::meshToMeshMethod
253 if (!src_.nCells() || !tgt_.nCells())
257 Pout<<
"mesh interpolation: cells not on processor: Source cells = "
258 << src_.nCells() <<
", target cells = " << tgt_.nCells()
283 word fName(
"addressing_" + mesh1.
name() +
"_to_" + mesh2.
name());
290 OFstream os(src_.time().path()/fName +
".obj");
293 forAll(mesh1ToMesh2Addr, i)
295 const labelList& addr = mesh1ToMesh2Addr[i];
298 label celli = addr[j];
306 os <<
"v " <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
308 os <<
"v " << c0.
x() <<
' ' << c0.
y() <<
' ' << c0.
z()
311 os <<
"l " << vertI - 1 <<
' ' << vertI <<
nl;
int debug
Static debugging option.
virtual const pointField & points() const
Return raw points.
const Cmpt & x() const
Access to the vector x component.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
virtual ~meshToMeshMethod()
Destructor.
scalar cellCellOverlapVolumeMinDecomp(const primitiveMesh &meshA, const label cellAI, const primitiveMesh &meshB, const label cellBI, const treeBoundBox &cellBbB) const
Calculates the overlap volume.
virtual void appendNbrCells(const label tgtCelli, const polyMesh &mesh, const DynamicList< label > &visitedTgtCells, DynamicList< label > &nbrTgtCellIDs) const
Append target cell neighbour cells to cellIDs list.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
void inflate(const scalar s)
Inflate box by factor*mag(span) in all dimensions.
Standard boundBox with extra functionality for use in octree.
virtual Tuple2< scalar, point > interVolAndCentroid(const label srcCellI, const label tgtCellI)
Return the intersection volume and centroid between two cells.
static bool & parRun()
Is this a parallel run?
const cellList & cells() const
virtual scalar interVol(const label srcCelli, const label tgtCelli) const
Return the intersection volume between two cells.
static scalar tolerance_
Tolerance used in volume overlap calculations.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const point & max() const
Maximum describing the bounding box.
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
const Cmpt & z() const
Access to the vector z component.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Mesh consisting of general polyhedral cells.
const point & min() const
Minimum describing the bounding box.
#define forAll(list, i)
Loop across all elements in list.
bool overlaps(const boundBox &bb) const
Overlaps/touches boundingBox?
void writeConnectivity(const polyMesh &mesh1, const polyMesh &mesh2, const labelListList &mesh1ToMesh2Addr) const
Write the connectivity (debugging)
label nCells() const
Number of mesh cells.
virtual bool intersect(const label srcCelli, const label tgtCelli) const
Return the true if cells intersect.
const polyMesh & tgt_
Reference to the target mesh.
word name(const complex &c)
Return string representation of complex.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
const labelListList & cellCells() const
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const polyMesh & src_
Reference to the source mesh.
Tuple2< scalar, point > cellCellOverlapMomentMinDecomp(const primitiveMesh &meshA, const label cellAI, const primitiveMesh &meshB, const label cellBI, const treeBoundBox &cellBbB) const
Calculates the overlap volume and moment.
labelList maskCells() const
Return src cell IDs for the overlap region.
Output to file stream, using an OSstream.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
const boundBox & bounds() const
Return mesh bounding box.
const Cmpt & y() const
Access to the vector y component.
const vectorField & cellCentres() const
virtual const faceList & faces() const
Return raw faces.
virtual bool initialise(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght) const
const dimensionedScalar e
Elementary charge.
const T2 & second() const noexcept
Return second.
A bounding box defined in terms of min/max extrema points.
const dimensionedScalar c
Speed of light in a vacuum.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Calculates the overlap volume of two cells using tetrahedral decomposition.
void setSize(const label newSize)
Alias for resize(const label)
defineTypeNameAndDebug(combustionModel, 0)
const T1 & first() const noexcept
Return first.
A cell is defined as a list of faces with extra functionality.
void add(const boundBox &bb)
Extend to include the second box.