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

Method PrepareApproxData

Common/DataModel/vtkHigherOrderQuadrilateral.cxx:441–465  ·  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

439 * object so that the point ids and scalar ids can match.
440 */
441void vtkHigherOrderQuadrilateral::PrepareApproxData(
442 vtkPointData* pd, vtkCellData* cd, vtkIdType cellId, vtkDataArray* cellScalars)
443{
444 this->GetApprox(); // Ensure this->Approx{PD,CD} are non-NULL.
445 // this->GetOrder(); // Ensure the order has been updated to match this element.
446 this->SetOrderFromCellData(cd, this->Points->GetNumberOfPoints(), cellId);
447 vtkIdType npts = this->Order[2];
448 vtkIdType nele = this->Order[0] * this->Order[1];
449 this->ApproxPD->Initialize();
450 this->ApproxCD->Initialize();
451 this->ApproxPD->CopyAllOn();
452 this->ApproxCD->CopyAllOn();
453 this->ApproxPD->CopyAllocate(pd, npts);
454 this->ApproxCD->CopyAllocate(cd, nele);
455 this->CellScalars->SetNumberOfTuples(npts);
456 for (int pp = 0; pp < npts; ++pp)
457 {
458 this->ApproxPD->CopyData(pd, this->PointIds->GetId(pp), pp);
459 this->CellScalars->SetValue(pp, cellScalars->GetTuple1(pp));
460 }
461 for (int ee = 0; ee < nele; ++ee)
462 {
463 this->ApproxCD->CopyData(cd, cellId, ee);
464 }
465}
466
467/// A convenience method; see the overloaded variant for more information.
468bool vtkHigherOrderQuadrilateral::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