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

Function doCommand

applications/utilities/mesh/manipulation/setSet/setSet.C:415–633  ·  view source on GitHub ↗

Read command and execute. Return true if ok, false otherwise.

Source from the content-addressed store, hash-verified

413
414// Read command and execute. Return true if ok, false otherwise.
415bool doCommand
416(
417 const polyMesh& mesh,
418 const word& setType,
419 const word& setName,
420 const word& actionName,
421 const bool writeVTKFile,
422 const bool writeCurrentTime,
423 const bool noSync,
424 Istream& is
425)
426{
427 // Get some size estimate for set.
428 const globalMeshData& parData = mesh.globalData();
429
430 label typSize =
431 max
432 (
433 parData.nTotalCells(),
434 max
435 (
436 parData.nTotalFaces(),
437 parData.nTotalPoints()
438 )
439 )
440 / (10*Pstream::nProcs());
441
442
443 bool ok = true;
444
445 // Set to work on
446 autoPtr<topoSet> currentSetPtr;
447
448 word sourceType;
449
450 try
451 {
452 topoSetSource::setAction action =
453 topoSetSource::toAction(actionName);
454
455
456 IOobject::readOption r;
457
458 if (action == topoSetSource::REMOVE)
459 {
460 removeSet(mesh, setType, setName);
461 }
462 else if
463 (
464 (action == topoSetSource::NEW)
465 || (action == topoSetSource::CLEAR)
466 )
467 {
468 r = IOobject::NO_READ;
469 currentSetPtr = topoSet::New(setType, mesh, setName, typSize);
470 }
471 else
472 {

Callers 1

mainFunction · 0.85

Calls 15

maxFunction · 0.85
returnReduceFunction · 0.85
topoSetSourceClass · 0.85
nTotalCellsMethod · 0.80
nTotalFacesMethod · 0.80
nTotalPointsMethod · 0.80
syncMethod · 0.80
timeMethod · 0.80
removeSetFunction · 0.70
writeVTKFunction · 0.70
NewFunction · 0.50
topoSetClass · 0.50

Tested by

no test coverage detected