MCPcopy Create free account
hub / github.com/Kitware/VTK / ExplodeHigherOrderCell

Method ExplodeHigherOrderCell

Filters/General/vtkFiniteElementFieldDistributor.cxx:1502–1693  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1500
1501//----------------------------------------------------------------------------
1502void vtkFiniteElementFieldDistributor::vtkInternals::ExplodeHigherOrderCell(vtkIdType cellId,
1503 vtkPoints* oldPoints, vtkPoints* newPoints, vtkCellArray* oldCells, vtkCellArray* newCells,
1504 vtkUnsignedCharArray* newCellTypes, vtkPointData* oldPd, vtkPointData* newPd, int nComps)
1505{
1506 vtkNonLinearCell* nonLinCell = nullptr;
1507 vtkCell* linearCell = nullptr;
1508 vtkNew<vtkIdList> oldPtIds;
1509 oldCells->GetCellAtId(cellId, oldPtIds);
1510
1511 const vtkIdType& oldNpts = oldPtIds->GetNumberOfIds();
1512 vtkIdType newNpts = 0;
1513
1514 switch (this->RefElement)
1515 {
1516 case VTK_LINE:
1517 switch (nComps)
1518 {
1519 case 3:
1520 case 4:
1521 // bump to VTK_LAGRANGE_CURVE order 2
1522 newNpts = (oldNpts != nComps) ? nComps : oldNpts;
1523 nonLinCell = this->lagrangeCurve;
1524 linearCell = this->line;
1525 break;
1526 default:
1527 vtkLog(WARNING, << "Unsupported number of components in HGRAD field for cell - VTK_LINE."
1528 << "Supported: One of 3, 4 "
1529 << "Got: " << nComps);
1530 break;
1531 }
1532 break;
1533 case VTK_TRIANGLE:
1534 switch (nComps)
1535 {
1536 case 6:
1537 case 10:
1538 // bump to VTK_LAGRANGE_TRIANGLE order 2
1539 newNpts = (oldNpts != nComps) ? nComps : oldNpts;
1540 nonLinCell = this->lagrangeTri;
1541 linearCell = this->tri;
1542 break;
1543 default:
1544 vtkLog(
1545 WARNING, << "Unsupported number of components in HGRAD field for cell - VTK_TRIANGLE."
1546 << "Supported: One of 6, 10"
1547 << "Got: " << nComps);
1548 break;
1549 }
1550 break;
1551 case VTK_QUAD:
1552 switch (nComps)
1553 {
1554 case 9:
1555 case 16:
1556 // bump to VTK_LAGRANGE_QUADRILATERAL order n
1557 newNpts = (oldNpts != nComps) ? nComps : oldNpts;
1558 this->lagrangeQuad->SetUniformOrderFromNumPoints(newNpts);
1559 nonLinCell = this->lagrangeQuad;

Callers 1

ExplodeCellMethod · 0.95

Calls 15

InsertCellPointMethod · 0.80
SetNumberOfIdsMethod · 0.80
GetCellAtIdMethod · 0.45
GetNumberOfIdsMethod · 0.45
GetPointerMethod · 0.45
GetNumberOfPointsMethod · 0.45
InsertNextCellMethod · 0.45
SetValueMethod · 0.45
GetCellTypeMethod · 0.45
GetPointMethod · 0.45
InsertPointMethod · 0.45

Tested by

no test coverage detected