----------------------------------------------------------------------------
| 1413 | |
| 1414 | //---------------------------------------------------------------------------- |
| 1415 | void vtkFiniteElementFieldDistributor::vtkInternals::ExplodeCell(vtkIdType cellId, |
| 1416 | vtkPoints* oldPoints, vtkPoints* newPoints, vtkCellArray* oldCells, vtkCellArray* newCells, |
| 1417 | vtkUnsignedCharArray* newCellTypes, vtkPointData* oldPd, vtkPointData* newPd, vtkCellData* oldCd, |
| 1418 | vtkPointData* hGradFields) |
| 1419 | { |
| 1420 | // loop over cell connectivity, redo the connectivity s.t each cell is |
| 1421 | // disconnected from other cells and then copy associated points into |
| 1422 | // the point array. |
| 1423 | if (this->Order == 1) |
| 1424 | { |
| 1425 | this->ExplodeLinearCell( |
| 1426 | cellId, oldPoints, newPoints, oldCells, newCells, newCellTypes, oldPd, newPd); |
| 1427 | } |
| 1428 | else |
| 1429 | { |
| 1430 | // Determine the order from no. of components in HGrad DG field arrays. |
| 1431 | std::unordered_set<int> nCompsSet; |
| 1432 | for (const auto& field : this->hGradSpec().Fields) |
| 1433 | { |
| 1434 | const char* name = field.c_str(); |
| 1435 | vtkDataArray* arr = oldCd->GetArray(name); |
| 1436 | if (arr != nullptr) |
| 1437 | { |
| 1438 | const int nComps = arr->GetNumberOfComponents(); |
| 1439 | nCompsSet.insert(nComps); |
| 1440 | } |
| 1441 | } |
| 1442 | if (nCompsSet.size() != 1) |
| 1443 | { |
| 1444 | vtkLog(WARNING, |
| 1445 | << "Invalid number of components for HGrad DG fields. Unable to determine order of cell " |
| 1446 | << cellId); |
| 1447 | return; |
| 1448 | } |
| 1449 | |
| 1450 | int nComps = *(nCompsSet.begin()); |
| 1451 | this->ExplodeHigherOrderCell( |
| 1452 | cellId, oldPoints, newPoints, oldCells, newCells, newCellTypes, oldPd, newPd, nComps); |
| 1453 | } |
| 1454 | |
| 1455 | if (this->hGradSpec().Fields.empty()) |
| 1456 | { |
| 1457 | return; |
| 1458 | } |
| 1459 | // explode n-component cell centered HGrad DG (Discontinuous Galerkin) field from cell -> nodes. |
| 1460 | vtkIdType newNpts = 0; |
| 1461 | const vtkIdType* newPts = nullptr; |
| 1462 | newCells->GetCellAtId(cellId, newNpts, newPts); |
| 1463 | // the field components follow ioss element ordering. |
| 1464 | auto ordering = ::GetIOSSTransformation(this->RefElement, newNpts); |
| 1465 | // ioss elements are 1-indexed. transform to 0-indexed lists. |
| 1466 | std::transform( |
| 1467 | ordering.cbegin(), ordering.cend(), ordering.begin(), [](vtkIdType val) { return val - 1; }); |
| 1468 | // explode HGrad dg fields with the transformation. |
| 1469 | for (const auto& field : this->hGradSpec().Fields) |
| 1470 | { |
| 1471 | const char* name = field.c_str(); |
| 1472 | this->ExplodeDGHGradCellCenteredField( |
no test coverage detected