void graph<T>::deleteTop(const T& a) { // обхождане на графа с цел изтриване на всички // ребра от произволен връх до върха a g.IterStart(); elem<LList<T> >* p = g.Iter(), *r; while(p) { p->inf.IterStart(); elem<T>* q = p->inf.Iter(); if(rib(q->inf, a)) deleteRib(q->inf, a); p = p->link; } // изтриване на линейния списък, представящ // върха a и неговите наследници g.IterStart(); elem<T>* q; do { r = g.Iter(); r->inf.IterStart(); q = r->inf.Iter(); } while(q->inf != a); // a е връх на графа LList<T> x; g.deleteElem(r, x); }
int main(int argc, char *argv[]) { argList::validOptions.insert("ibCells", ""); argList::validOptions.insert("ibCellCells", ""); argList::validOptions.insert("ibCellCellFaces", ""); # include "setRootCase.H" # include "createTime.H" # include "createMesh.H" refineImmersedBoundaryMesh rib(mesh); labelList rc; if (args.optionFound("ibCells")) { rc = rib.refinementCells ( refineImmersedBoundaryMesh::IB_CELLS ); } else if (args.optionFound("ibCellCells")) { rc = rib.refinementCells ( refineImmersedBoundaryMesh::IB_CELL_CELLS ); } else if (args.optionFound("ibCellCellFaces")) { rc = rib.refinementCells ( refineImmersedBoundaryMesh::IB_CELL_CELL_FACES ); } else { FatalErrorIn(args.executable()) << "Specify one of the available options for cell selection: " << "[-ibCells] [-ibCellCells] [-ibCellCellFaces]" << nl << exit(FatalError); } Info<< "Number of refinement cells = " << rc.size() << endl; rib.refineMesh(rc); mesh.write(); Info<< "End\n" << endl; return 0; }