PetscSolverFetiDebug.cc 18.2 KB
 Thomas Witkowski committed Sep 28, 2012 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 ``````// // Software License for AMDiS // // Copyright (c) 2010 Dresden University of Technology // All rights reserved. // Authors: Simon Vey, Thomas Witkowski et al. // // This file is part of AMDiS // // See also license.opensource.txt in the distribution. #include #include #include "parallel/ParallelDofMapping.h" #include "parallel/PetscSolverFeti.h" #include "parallel/PetscSolverFetiDebug.h" namespace AMDiS { using namespace std; void PetscSolverFetiDebug::debugNullSpace(PetscSolverFeti &feti, SystemVector &vec) { FUNCNAME("PetscSolverFetiDebug::debugNullSpace()"); TEST_EXIT(feti.stokesMode) ("This function works only for the stokes mode!\n"); // === First, get the null space basis directly from the mat object and === // === make a test whether this is a member of the null space. === { MatNullSpace nullSpace; MatGetNullSpace(feti.mat_feti, &nullSpace); PetscBool hasConst; PetscInt nBasisVec; const Vec *nullSpaceBasis; MatNullSpaceGetVecs(nullSpace, &hasConst, &nBasisVec, &nullSpaceBasis); TEST_EXIT(nBasisVec == 1)("Something is wrong!\n"); Vec vecSol; VecDuplicate(nullSpaceBasis[0], &vecSol); MatMult(feti.mat_feti, nullSpaceBasis[0], vecSol); Vec vecSol0, vecSol1; VecNestGetSubVec(vecSol, 0, &vecSol0); VecNestGetSubVec(vecSol, 1, &vecSol1); PetscReal norm, norm0, norm1; VecNorm(vecSol, NORM_2, &norm); VecNorm(vecSol0, NORM_2, &norm0); VecNorm(vecSol1, NORM_2, &norm1); MSG("Null space norm: %e (%e %e)\n", norm, norm0, norm1); VecDestroy(&vecSol); } // === Try to reproduce the null space basis on the non reduced form of === // === the FETI-DP system. === Mat fetiMat; createNestedFetiMat(feti, fetiMat); Vec vecArray[4]; Vec ktest0, ktest1, ktest2; ParallelDofMapping &localDofMap = feti.localDofMap; localDofMap.createLocalVec(ktest0); localDofMap.createLocalVec(ktest1); localDofMap.createVec(ktest2, feti.nGlobalOverallInterior); `````` Thomas Witkowski committed Oct 23, 2012 75 76 `````` const FiniteElemSpace* pressureFeSpace = `````` 77 `````` feti.componentSpaces[feti.pressureComponent]; `````` Thomas Witkowski committed Oct 23, 2012 78 `````` DofMap& m = localDofMap[feti.pressureComponent].getMap(); `````` Thomas Witkowski committed Sep 28, 2012 79 `````` for (DofMap::iterator it = m.begin(); it != m.end(); ++it) { `````` 80 `````` if (feti.dofMap[pressureFeSpace].isRankDof(it->first)) { `````` Thomas Witkowski committed Sep 28, 2012 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 `````` int index = localDofMap.getLocalMatIndex(feti.pressureComponent, it->first); VecSetValue(ktest0, index, 1.0, INSERT_VALUES); } } VecAssemblyBegin(ktest0); VecAssemblyEnd(ktest0); MatMult(feti.subdomain->getMatInterior(), ktest0, ktest1); PetscScalar *valarray; VecGetArray(ktest0, &valarray); VecCreateMPIWithArray(PETSC_COMM_WORLD, 1, localDofMap.getRankDofs(), feti.nGlobalOverallInterior, valarray, &vecArray[0]); Vec ktest3; VecGetArray(ktest1, &valarray); VecCreateMPIWithArray(PETSC_COMM_WORLD, 1, localDofMap.getRankDofs(), feti.nGlobalOverallInterior, valarray, &ktest3); feti.primalDofMap.createVec(vecArray[1]); VecSet(vecArray[1], 0.0); feti.interfaceDofMap.createVec(vecArray[2]); VecSet(vecArray[2], 1.0); feti.lagrangeMap.createVec(vecArray[3]); MatMult(feti.subdomain->getMatInteriorCoarse(1), vecArray[2], ktest2); VecAXPY(ktest2, 1.0, ktest3); MatMult(feti.mat_lagrange_scaled, ktest2, vecArray[3]); VecScale(vecArray[3], -1.0); Vec nullSpaceBasis; VecCreateNest(feti.mpiCommGlobal, 4, PETSC_NULL, vecArray, &nullSpaceBasis); Vec vecSol; VecDuplicate(nullSpaceBasis, &vecSol); MatMult(fetiMat, nullSpaceBasis, vecSol); PetscReal norm; VecNorm(vecSol, NORM_2, &norm); MSG("Null space norm: %e\n", norm); Vec vec0; Vec vec1; Vec vec2; Vec vec3; VecNestGetSubVec(vecSol, 0, &vec0); VecNestGetSubVec(vecSol, 1, &vec1); VecNestGetSubVec(vecSol, 2, &vec2); VecNestGetSubVec(vecSol, 3, &vec3); PetscReal norm0, norm1, norm2, norm3; VecNorm(vec0, NORM_2, &norm0); VecNorm(vec1, NORM_2, &norm1); VecNorm(vec2, NORM_2, &norm2); VecNorm(vec3, NORM_2, &norm3); MSG("Splitted null space norm: %e %e %e %e\n", norm0, norm1, norm2, norm3); feti.recoverSolution(vec0, vec1, vec); feti.recoverInterfaceSolution(vec2, vec); VtkWriter::writeFile(&vec, "nullspace.vtu"); MatDestroy(&fetiMat); VecDestroy(&nullSpaceBasis); VecDestroy(&vecSol); } void PetscSolverFetiDebug::createInteriorMat(PetscSolverFeti &feti, Mat &mat) { FUNCNAME("PetscSolverFetiDebug::createInteriorMat()"); Mat &localMat = feti.subdomain->getMatInterior(); int nRow, nCol; MatGetSize(localMat, &nRow, &nCol); TEST_EXIT_DBG(nRow == nCol)("Should not happen!\n"); int *dnnz = new int[nRow]; for (int i = 0; i < nRow; i++) { MatGetRow(localMat, i, &nCol, PETSC_NULL, PETSC_NULL); dnnz[i] = nCol; MatRestoreRow(localMat, i, &nCol, PETSC_NULL, PETSC_NULL); } MatCreateAIJ(PETSC_COMM_WORLD, nRow, nRow, feti.nGlobalOverallInterior, feti.nGlobalOverallInterior, 0, dnnz, 0, PETSC_NULL, &mat); PetscInt rStart, rEnd; MatGetOwnershipRange(mat, &rStart, &rEnd); for (int i = 0; i < nRow; i++) { const PetscInt *cols; const PetscScalar *vals; MatGetRow(localMat, i, &nCol, &cols, &vals); for (int j = 0; j < nCol; j++) MatSetValue(mat, i + rStart, cols[j] + rStart, vals[j], INSERT_VALUES); } MatAssemblyBegin(mat, MAT_FINAL_ASSEMBLY); MatAssemblyEnd(mat, MAT_FINAL_ASSEMBLY); delete [] dnnz; } void PetscSolverFetiDebug::createNestedFetiMat(PetscSolverFeti &feti, Mat &mat) { FUNCNAME("PetscSolverFetiDebug::createNestedFetiMat()"); PetscSolver *subdomain = feti.subdomain; if (feti.stokesMode) { vector nestMat; nestMat.resize(16); createInteriorMat(feti, nestMat[0]); nestMat[1] = subdomain->getMatInteriorCoarse(0); nestMat[2] = subdomain->getMatInteriorCoarse(1); MatTranspose(feti.mat_lagrange, MAT_INITIAL_MATRIX, &nestMat[3]); nestMat[4] = subdomain->getMatCoarseInterior(0); nestMat[5] = subdomain->getMatCoarse(0, 0); nestMat[6] = subdomain->getMatCoarse(0, 1); nestMat[7] = PETSC_NULL; nestMat[8] = subdomain->getMatCoarseInterior(1); nestMat[9] = subdomain->getMatCoarse(1, 0); nestMat[10] = PETSC_NULL; nestMat[11] = PETSC_NULL; nestMat[12] = feti.mat_lagrange; nestMat[13] = PETSC_NULL; nestMat[14] = PETSC_NULL; nestMat[15] = PETSC_NULL; Mat nestFetiMat; MatCreateNest(feti.mpiCommGlobal, 4, PETSC_NULL, 4, PETSC_NULL, &(nestMat[0]), &mat); } else { vector nestMat; nestMat.resize(9); createInteriorMat(feti, nestMat[0]); nestMat[1] = subdomain->getMatInteriorCoarse(0); MatTranspose(feti.mat_lagrange, MAT_INITIAL_MATRIX, &nestMat[2]); nestMat[3] = subdomain->getMatCoarseInterior(0); nestMat[4] = subdomain->getMatCoarse(0, 0); nestMat[5] = PETSC_NULL; nestMat[6] = feti.mat_lagrange; nestMat[7] = PETSC_NULL; nestMat[8] = PETSC_NULL; Mat nestFetiMat; MatCreateNest(feti.mpiCommGlobal, 3, PETSC_NULL, 3, PETSC_NULL, &(nestMat[0]), &mat); } } void PetscSolverFetiDebug::createExplicitFetiMat(PetscSolverFeti &feti, Mat fetiMat, Mat &explicitMat, int &nnzCounter) { FUNCNAME("PetscSolverFetiDebug::createExplicitFetiMat()"); ParallelDofMapping &lagrangeMap = feti.lagrangeMap; nnzCounter = 0; if (feti.stokesMode == false) { int nRankRows = lagrangeMap.getRankDofs(); int nOverallRows = lagrangeMap.getOverallDofs(); MatCreateAIJ(feti.mpiCommGlobal, nRankRows, nRankRows, nOverallRows, nOverallRows, nOverallRows, PETSC_NULL, nOverallRows, PETSC_NULL, &explicitMat); Vec unitVector; Vec resultVector; lagrangeMap.createVec(unitVector); lagrangeMap.createVec(resultVector); PetscInt low, high; VecGetOwnershipRange(unitVector, &low, &high); int nLocal = high - low; int nnzCounter = 0; for (int i = 0; i < lagrangeMap.getOverallDofs(); i++) { VecSet(unitVector, 0.0); if (i >= low && i < high) VecSetValue(unitVector, i, 1.0, INSERT_VALUES); VecAssemblyBegin(unitVector); VecAssemblyEnd(unitVector); MatMult(fetiMat, unitVector, resultVector); if (feti.fetiPreconditioner != FETI_NONE) { PCApply(feti.precon_feti, resultVector, unitVector); VecCopy(unitVector, resultVector); } PetscScalar *vals; VecGetArray(resultVector, &vals); for (int j = 0; j < nLocal; j++) { if (fabs(vals[j]) > 1e-30) { MatSetValue(explicitMat, low + j, i, vals[j], INSERT_VALUES); nnzCounter++; } } VecRestoreArray(resultVector, &vals); } VecDestroy(&unitVector); VecDestroy(&resultVector); } else { ParallelDofMapping &interfaceDofMap = feti.interfaceDofMap; int nRankRows = interfaceDofMap.getRankDofs() + lagrangeMap.getRankDofs(); int nOverallRows = interfaceDofMap.getOverallDofs() + lagrangeMap.getOverallDofs(); MatCreateAIJ(feti.mpiCommGlobal, nRankRows, nRankRows, nOverallRows, nOverallRows, nOverallRows, PETSC_NULL, nOverallRows, PETSC_NULL, &explicitMat); Vec unitVector[2]; Vec resultVector[2]; interfaceDofMap.createVec(unitVector[0]); interfaceDofMap.createVec(resultVector[0]); lagrangeMap.createVec(unitVector[1]); lagrangeMap.createVec(resultVector[1]); Vec unitNestVec, resultNestVec; VecCreateNest(feti.mpiCommGlobal, 2, PETSC_NULL, unitVector, &unitNestVec); VecCreateNest(feti.mpiCommGlobal, 2, PETSC_NULL, resultVector, &resultNestVec); PetscInt lowInterface, highInterface; VecGetOwnershipRange(unitVector[0], &lowInterface, &highInterface); int nLocalInterface = highInterface - lowInterface; PetscInt lowLagrange, highLagrange; VecGetOwnershipRange(unitVector[1], &lowLagrange, &highLagrange); int nLocalLagrange = highLagrange - lowLagrange; VecSet(unitVector[1], 0.0); for (int i = 0; i < interfaceDofMap.getOverallDofs(); i++) { VecSet(unitVector[0], 0.0); if (i >= lowInterface && i < highInterface) VecSetValue(unitVector[0], i, 1.0, INSERT_VALUES); VecAssemblyBegin(unitVector[0]); VecAssemblyEnd(unitVector[0]); VecAssemblyBegin(unitNestVec); VecAssemblyEnd(unitNestVec); MatMult(fetiMat, unitNestVec, resultNestVec); PetscScalar *vals; VecGetArray(resultVector[0], &vals); for (int j = 0; j < nLocalInterface; j++) { if (fabs(vals[j]) > 1e-30) { MatSetValue(explicitMat, lowInterface + j, i, vals[j], INSERT_VALUES); nnzCounter++; } } VecRestoreArray(resultVector[0], &vals); VecGetArray(resultVector[1], &vals); for (int j = 0; j < nLocalLagrange; j++) { if (fabs(vals[j]) > 1e-30) { MatSetValue(explicitMat, interfaceDofMap.getOverallDofs() + lowLagrange + j, i, vals[j], INSERT_VALUES); nnzCounter++; } } VecRestoreArray(resultVector[1], &vals); } VecSet(unitVector[0], 0.0); for (int i = 0; i < lagrangeMap.getOverallDofs(); i++) { VecSet(unitVector[1], 0.0); if (i >= lowLagrange && i < highLagrange) VecSetValue(unitVector[1], i, 1.0, INSERT_VALUES); VecAssemblyBegin(unitVector[1]); VecAssemblyEnd(unitVector[1]); VecAssemblyBegin(unitNestVec); VecAssemblyEnd(unitNestVec); MatMult(fetiMat, unitNestVec, resultNestVec); PetscScalar *vals; VecGetArray(resultVector[0], &vals); for (int j = 0; j < nLocalInterface; j++) { if (fabs(vals[j]) > 1e-30) { MatSetValue(explicitMat, lowInterface + j, interfaceDofMap.getOverallDofs() + i, vals[j], INSERT_VALUES); nnzCounter++; } } VecRestoreArray(resultVector[0], &vals); VecGetArray(resultVector[1], &vals); for (int j = 0; j < nLocalLagrange; j++) { if (fabs(vals[j]) > 1e-30) { MatSetValue(explicitMat, interfaceDofMap.getOverallDofs() + lowLagrange + j, interfaceDofMap.getOverallDofs() + i, vals[j], INSERT_VALUES); nnzCounter++; } } VecRestoreArray(resultVector[1], &vals); } VecDestroy(&unitVector[0]); VecDestroy(&unitVector[1]); VecDestroy(&resultVector[0]); VecDestroy(&resultVector[1]); VecDestroy(&unitNestVec); VecDestroy(&resultNestVec); } MatAssemblyBegin(explicitMat, MAT_FINAL_ASSEMBLY); MatAssemblyEnd(explicitMat, MAT_FINAL_ASSEMBLY); mpi::globalAdd(nnzCounter); } void PetscSolverFetiDebug::createExplicitVec(PetscSolverFeti &feti, Vec nestedVec, Vec &explicitVec) { FUNCNAME("PetscSolverFetiDebug::createExplicitVec()"); int nNested = 0; VecNestGetSize(nestedVec, &nNested); TEST_EXIT_DBG(nNested == 2) ("Only supported for 2-nest vectors, not for %d-nest vectors!\n", nNested); Vec v0, v1; VecNestGetSubVec(nestedVec, 0, &v0); VecNestGetSubVec(nestedVec, 1, &v1); int s0, s1; VecGetSize(v0, &s0); VecGetSize(v1, &s1); int l0, l1; VecGetLocalSize(v0, &l0); VecGetLocalSize(v1, &l1); int rStart0, rStart1; VecGetOwnershipRange(v0, &rStart0, PETSC_NULL); VecGetOwnershipRange(v1, &rStart1, PETSC_NULL); VecCreateMPI(feti.mpiCommGlobal, l0 + l1, s0 + s1, &explicitVec); double *val; VecGetArray(v0, &val); for (int i = 0; i < l0; i++) VecSetValue(explicitVec, rStart0 + i, val[i], INSERT_VALUES); VecRestoreArray(v0, &val); VecGetArray(v1, &val); for (int i = 0; i < l1; i++) VecSetValue(explicitVec, s0 + rStart1 + i, val[i], INSERT_VALUES); VecRestoreArray(v1, &val); VecAssemblyBegin(explicitVec); VecAssemblyEnd(explicitVec); } void PetscSolverFetiDebug::writeNullSpace(PetscSolverFeti& feti, Vec nullSpaceBasis) { FUNCNAME("PetscSolverFetiDebug::writeNullSpace()"); int writeFetiSystem = 0; Parameters::get("parallel->debug->write feti system", writeFetiSystem); if (writeFetiSystem) { Vec vecTmp; createExplicitVec(feti, nullSpaceBasis, vecTmp); PetscViewer petscView; PetscViewerBinaryOpen(PETSC_COMM_WORLD, "nullspace.vec", FILE_MODE_WRITE, &petscView); VecView(vecTmp, petscView); PetscViewerDestroy(&petscView); VecDestroy(&vecTmp); MSG("Written FETI-DP null space basis vector!\n"); } } void PetscSolverFetiDebug::debugFeti(PetscSolverFeti &feti, Vec dbgRhsVec) { FUNCNAME("PetscSolverFetiDebug:::debugFeti()"); int writeFetiSystem = 0; Parameters::get("parallel->debug->write feti system", writeFetiSystem); if (!writeFetiSystem) return; MSG("Start creating explicit FETI-DP matrix!\n"); Mat fetiMat; int nnzCounter = 0; createExplicitFetiMat(feti, feti.mat_feti, fetiMat, nnzCounter); PetscViewer petscView; PetscViewerBinaryOpen(PETSC_COMM_WORLD, "feti.mat", FILE_MODE_WRITE, &petscView); MatView(fetiMat, petscView); PetscViewerDestroy(&petscView); bool a = feti.testMatrixSymmetric(fetiMat, true); MSG("SYMMETRIC TEST: %d\n", a); int r, c; MatGetSize(fetiMat, &r, &c); MSG("FETI-DP matrix written: %d x %d mat with %d nnz\n", r, c, nnzCounter); MatDestroy(&fetiMat); Vec rhsVec; createExplicitVec(feti, dbgRhsVec, rhsVec); PetscViewerBinaryOpen(PETSC_COMM_WORLD, "feti_rhs.vec", FILE_MODE_WRITE, &petscView); VecView(rhsVec, petscView); PetscViewerDestroy(&petscView); VecDestroy(&rhsVec); } `````` 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 `````` int PetscSolverFetiDebug::testZeroRows(Mat mat) { FUNCNAME("PetscSolverFetiDebug::testZeroRows()"); int nZeroRows = 0; int firstIndex, lastIndex; MatGetOwnershipRange(mat, &firstIndex, &lastIndex); for (int i = firstIndex; i < lastIndex; i++) { PetscInt nCols; const PetscScalar *vals; MatGetRow(mat, i, &nCols, PETSC_NULL, &vals); bool nonZeroValues = false; for (int j = 0; j < nCols; j++) { if (vals[j] != 0.0) { nonZeroValues = true; break; } } if (!nonZeroValues) { MSG("Zero matrix row for global row index %d\n", i); nZeroRows++; } MatRestoreRow(mat, i, &nCols, PETSC_NULL, &vals); } return nZeroRows; } `````` Thomas Witkowski committed Nov 02, 2012 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 `````` void PetscSolverFetiDebug::writePrimalFiles(PetscSolverFeti &feti) { FUNCNAME("PetscSolverFetiDebug::writePrimalFiles()"); Mesh *mesh = feti.componentSpaces[0]->getMesh(); DOFVector > coords(feti.componentSpaces[0], "coords"); mesh->getDofIndexCoords(coords); // === Write vertex primals. === { StdMpi > stdMpi(MPI::COMM_WORLD); vector sendData; DofMap &primals = feti.primalDofMap[0].getMap(); for (DofMap::iterator it = primals.begin();it != primals.end(); ++it) { if (feti.primalDofMap[0].isRankDof(it->first)) { for (int i = 0; i < mesh->getDim(); i++) sendData.push_back(coords[it->first][i]); } } if (MPI::COMM_WORLD.Get_rank() == 0) { for (int i = 1; i < MPI::COMM_WORLD.Get_size(); i++) stdMpi.recv(i); } else { stdMpi.send(0, sendData); } stdMpi.startCommunication(); if (MPI::COMM_WORLD.Get_rank() == 0) { vector > allPrimals; for (int i = 1; i < MPI::COMM_WORLD.Get_size(); i++) { vector &recvData = stdMpi.getRecvData(i); TEST_EXIT(recvData.size() % mesh->getDim() == 0) ("Wrong number of coordinates received!\n"); int nCoords = recvData.size() / mesh->getDim(); int counter = 0; for (int j = 0; j < nCoords; j++) { WorldVector c; for (int k = 0; k < mesh->getDim(); k++) c[k] = recvData[counter++]; allPrimals.push_back(c); } } ofstream file; file.open("primals.xyz"); file << allPrimals.size() << "\n"; file << "Primals\n"; for (int i = 0; i < static_cast(allPrimals.size()); i++) { file << "P "; if (mesh->getDim() == 2) file << allPrimals[i][0] << " " << allPrimals[i][1] << " 0.0"; else file << allPrimals[i][0] << " " << allPrimals[i][1] << " " << allPrimals[i][2]; file << "\n"; } file.close(); } } // === Write face primals. === { } } `````` Thomas Witkowski committed Sep 28, 2012 646 ``}``