45 void Foam::faceCoupleInfo::writeOBJ
47 const fileName& fName,
60 const edge&
e = edges[edgeI];
66 if (pointMap[pointi] == -1)
68 pointMap[pointi] = newPointi++;
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." 235 forAll(masterPatch(), coupleFacei)
237 const face& masterF = masterPatch().localFaces()[coupleFacei];
238 const face& slaveF = slavePatch().localFaces()[coupleFacei];
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);
virtual const fileName & name() const
Return the name of the stream.
List< labelList > labelListList
A List of labelList.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A face is a list of labels corresponding to mesh vertices.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
faceCoupleInfo(const polyMesh &masterMesh, const labelList &masterAddressing, const polyMesh &slaveMesh, const labelList &slaveAddressing)
Construct from meshes and subset of mesh faces (i.e.,.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
Determine correspondence between points. See below.
virtual const pointField & points() const
Return raw points.
A list of faces which address into the list of points.
vectorField pointField
pointField is a vectorField.
List< label > labelList
A List of labels.
virtual const faceList & faces() const
Return raw faces.
errorManip< error > abort(error &err)
~faceCoupleInfo()
Destructor.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
prefixOSstream Pout(cout, "Pout")
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
A List with indirect addressing.