MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / cut

Function cut

src/dynamicMesh/meshCut/cellLooper/hexCellLooper.C:168–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
167
168bool Foam::hexCellLooper::cut
169(
170 const vector& refDir,
171 const label celli,
172 const boolList& vertIsCut,
173 const boolList& edgeIsCut,
174 const scalarField& edgeWeight,
175
176 labelList& loop,
177 scalarField& loopWeights
178) const
179{
180 bool success = false;
181
182 if (mesh().cellShapes()[celli].model() == hex_)
183 {
184 // Get starting edge. Note: should be compatible with way refDir is
185 // determined.
186 label edgeI = meshTools::cutDirToEdge(mesh(), celli, refDir);
187
188 // Get any face using edge
189 label face0;
190 label face1;
191 meshTools::getEdgeFaces(mesh(), celli, edgeI, face0, face1);
192
193 // Walk circumference of hex, cutting edges only
194 loop.setSize(4);
195 loopWeights.setSize(4);
196
197 success = walkHex(celli, face0, edgeI, loop, loopWeights);
198 }
199 else
200 {
201 success = geomCellLooper::cut
202 (
203 refDir,
204 celli,
205 vertIsCut,
206 edgeIsCut,
207 edgeWeight,
208
209 loop,
210 loopWeights
211 );
212 }
213
214 if (debug)
215 {
216 if (loop.empty())
217 {
218 WarningInFunction
219 << "could not cut cell " << celli << endl;
220
221 fileName cutsFile("hexCellLooper_" + name(celli) + ".obj");
222
223 Pout<< "hexCellLooper : writing cell to " << cutsFile << endl;
224
225 OFstream cutsStream(cutsFile);

Callers

nothing calls this directly

Calls 15

meshFunction · 0.85
getEdgeFacesFunction · 0.85
walkHexFunction · 0.85
makeFaceFunction · 0.85
geomCellLooperClass · 0.85
nameFunction · 0.50
writeOBJFunction · 0.50
forAllFunction · 0.50
abortFunction · 0.50
setSizeMethod · 0.45
emptyMethod · 0.45
facesMethod · 0.45

Tested by

no test coverage detected