45 void Foam::faceCoupleInfo::writeOBJ
47 const fileName& fName,
60 const edge&
e = edges[edgeI];
66 if (pointMap[pointi] == -1)
77 const edge&
e = edges[edgeI];
79 str<<
"l " << pointMap[
e[0]]+1 <<
' ' << pointMap[
e[1]]+1 <<
nl;
84 void Foam::faceCoupleInfo::writeOBJ
86 const fileName& fName,
91 Pout<<
"Writing connections as edges to " << fName <<
endl;
103 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
108 void Foam::faceCoupleInfo::writePointsFaces()
const
115 OFstream str(
"masterPatch.obj");
120 OFstream str(
"slavePatch.obj");
127 Pout<<
"Writing masterToSlavePoints to masterToSlavePoints.obj" <<
endl;
129 const labelListList coupleToMasterPoints(this->coupleToMasterPoints());
130 const labelListList coupleToSlavePoints(this->coupleToSlavePoints());
131 pointField coupleMasterPoints(coupleToMasterPoints.size());
132 pointField coupleSlavePoints(coupleToSlavePoints.size());
133 forAll(coupleToMasterPoints, couplePointi)
135 const label masterPointi = coupleToMasterPoints[couplePointi][0];
136 const label slavePointi = coupleToSlavePoints[couplePointi][0];
137 coupleMasterPoints[couplePointi] = m.localPoints()[masterPointi];
138 coupleSlavePoints[couplePointi] = m.localPoints()[slavePointi];
143 "masterToSlavePoints.obj",
151 Pout<<
"Writing masterToSlaveFaces to masterToSlaveFaces.obj" <<
endl;
155 "masterToSlaveFaces.obj",
156 calcFaceCentres<IndirectList>(m, m.points(), 0, m.size()),
157 calcFaceCentres<IndirectList>(
s,
s.points(), 0,
s.size())
192 masterToCouplePoints_(),
193 slaveToCouplePoints_()
195 if (masterAddressing.
size() != slaveAddressing.
size())
198 <<
"Number of master and slave faces differ." <<
endl
199 <<
"master:" << masterAddressing.
size()
200 <<
" slave:" << slaveAddressing.
size()
206 masterAddressing.
size()
211 <<
"Supplied internal face on master mesh to couple." <<
nl
212 <<
"Faces to be coupled have to be boundary faces."
218 slaveAddressing.
size()
223 <<
"Supplied internal face on slave mesh to couple." <<
nl
224 <<
"Faces to be coupled have to be boundary faces."
244 const label masterPointi = masterF[masterFp];
245 const label slavePointi = slaveF[slaveFp];
249 label couplePointi = -1;
250 if (masterToCouplePoints_[masterPointi] != -1)
252 couplePointi = masterToCouplePoints_[masterPointi];
254 else if (slaveToCouplePoints_[slavePointi] != -1)
256 couplePointi = slaveToCouplePoints_[slavePointi];
260 couplePointi = nCouplePoints_ ++;
263 masterToCouplePoints_[masterPointi] = couplePointi;
264 slaveToCouplePoints_[slavePointi] = couplePointi;
266 slaveFp = slaveF.
rcIndex(slaveFp);
#define forAll(list, i)
Loop across all elements in list.
A List with indirect addressing.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual const fileName & name() const
Return the name of the stream.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
Container for information needed to couple to meshes. When constructed from two meshes and a list of ...
const indirectPrimitivePatch & masterPatch() const
Addressing engine for coupled faces on mesh0.
faceCoupleInfo(const polyMesh &masterMesh, const labelList &masterAddressing, const polyMesh &slaveMesh, const labelList &slaveAddressing)
Construct from meshes and subset of mesh faces (i.e.,.
~faceCoupleInfo()
Destructor.
const indirectPrimitivePatch & slavePatch() const
Addressing engine for coupled faces on mesh1.
A face is a list of labels corresponding to mesh vertices.
Mesh consisting of general polyhedral cells.
label nInternalFaces() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Determine correspondence between points. See below.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
vectorField pointField
pointField is a vectorField.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< labelList > labelListList
A List of labelList.
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout, "Pout")
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.