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)
197 if (!visitedCells.found(nbrCelli))
213 srcToTgtAddr.
setSize(src_.nCells());
214 srcToTgtWght.
setSize(src_.nCells());
215 tgtToSrcAddr.
setSize(tgt_.nCells());
216 tgtToSrcWght.
setSize(tgt_.nCells());
222 else if (!tgt_.nCells())
226 Pout<<
"mesh interpolation: have " << src_.nCells() <<
" source "
227 <<
" cells but no target cells" <<
endl;
239 Foam::meshToMeshMethod::meshToMeshMethod
249 if (!src_.nCells() || !tgt_.nCells())
253 Pout<<
"mesh interpolation: cells not on processor: Source cells = "
254 << src_.nCells() <<
", target cells = " << tgt_.nCells()
279 word fName(
"addressing_" + mesh1.
name() +
"_to_" + mesh2.
name());
286 OFstream os(src_.time().path()/fName +
".obj");
289 forAll(mesh1ToMesh2Addr, i)
291 const labelList& addr = mesh1ToMesh2Addr[i];
294 label celli = addr[j];
302 os <<
"v " <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
304 os <<
"v " << c0.
x() <<
' ' << c0.
y() <<
' ' << c0.
z()
307 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.
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.
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
OSstream wrapped stdout (std::cout) with parallel prefix.
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?
label nCells() const noexcept
Number of mesh cells.
void writeConnectivity(const polyMesh &mesh1, const polyMesh &mesh2, const labelListList &mesh1ToMesh2Addr) const
Write the connectivity (debugging)
virtual bool intersect(const label srcCelli, const label tgtCelli) const
Return the true if cells intersect.
const polyMesh & tgt_
Reference to the target mesh.
void setSize(const label n)
Alias for resize()
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.
OBJstream os(runTime.globalPath()/outputName)
labelList maskCells() const
Return src cell IDs for the overlap region.
Output to file stream, using an OSstream.
const boundBox & bounds() const
Return mesh bounding box.
const word & name() const noexcept
Return name.
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
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
static bool & parRun() noexcept
Test if this a parallel run.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void size(const label n)
Older name for setAddressableSize.
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.
defineTypeNameAndDebug(combustionModel, 0)
const T1 & first() const noexcept
Return first.
A cell is defined as a list of faces with extra functionality.
label appendUniq(const T &val)
Append an element if not already in the list.
void add(const boundBox &bb)
Extend to include the second box.