\brief Prepare point data for use by linear approximating-elements. * * This copies the point data for the current cell into a new point-data * object so that the point ids and scalar ids can match. */
| 524 | * object so that the point ids and scalar ids can match. |
| 525 | */ |
| 526 | void vtkHigherOrderHexahedron::PrepareApproxData( |
| 527 | vtkPointData* pd, vtkCellData* cd, vtkIdType cellId, vtkDataArray* cellScalars) |
| 528 | { |
| 529 | this->GetApprox(); // Ensure this->Approx{PD,CD} are non-NULL. |
| 530 | // this->GetOrder(); // Ensure the order has been updated to match this element. |
| 531 | this->SetOrderFromCellData(cd, this->Points->GetNumberOfPoints(), cellId); |
| 532 | vtkIdType npts = this->Points->GetNumberOfPoints(); |
| 533 | vtkIdType nele = this->Order[0] * this->Order[1] * this->Order[2]; |
| 534 | this->ApproxPD->Initialize(); |
| 535 | this->ApproxCD->Initialize(); |
| 536 | this->ApproxPD->CopyAllOn(); |
| 537 | this->ApproxCD->CopyAllOn(); |
| 538 | this->ApproxPD->CopyAllocate(pd, npts); |
| 539 | this->ApproxCD->CopyAllocate(cd, nele); |
| 540 | this->CellScalars->SetNumberOfTuples(npts); |
| 541 | for (int pp = 0; pp < npts; ++pp) |
| 542 | { |
| 543 | this->ApproxPD->CopyData(pd, this->PointIds->GetId(pp), pp); |
| 544 | this->CellScalars->SetValue(pp, cellScalars->GetTuple1(pp)); |
| 545 | } |
| 546 | for (int ee = 0; ee < nele; ++ee) |
| 547 | { |
| 548 | this->ApproxCD->CopyData(cd, cellId, ee); |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | /// A convenience method; see the overloaded variant for more information. |
| 553 | bool vtkHigherOrderHexahedron::SubCellCoordinatesFromId(vtkVector3i& ijk, int subId) |
no test coverage detected