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

Method PrepareApproxData

Common/DataModel/vtkHigherOrderHexahedron.cxx:526–550  ·  view source on GitHub ↗

\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. */

Source from the content-addressed store, hash-verified

524 * object so that the point ids and scalar ids can match.
525 */
526void 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.
553bool vtkHigherOrderHexahedron::SubCellCoordinatesFromId(vtkVector3i& ijk, int subId)

Callers 2

ContourMethod · 0.95
ClipMethod · 0.95

Calls 11

GetApproxMethod · 0.95
SetOrderFromCellDataMethod · 0.95
GetTuple1Method · 0.80
GetNumberOfPointsMethod · 0.45
InitializeMethod · 0.45
CopyAllOnMethod · 0.45
CopyAllocateMethod · 0.45
SetNumberOfTuplesMethod · 0.45
CopyDataMethod · 0.45
GetIdMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected