9#include <vtkCellTypes.h>
10#include <vtkCommand.h>
11#include <vtkDataSet.h>
15#include <vtkCellData.h>
16#include <vtkGhostCellsGenerator.h>
19#include <vtkImageData.h>
20#include <vtkInformation.h>
21#include <vtkInformationIntegerKey.h>
22#include <vtkInformationVector.h>
23#include <vtkMultiBlockDataSet.h>
24#include <vtkPointData.h>
25#include <vtkPolyData.h>
27#include <vtkUnstructuredGrid.h>
29#include <vtkCompositeDataPipeline.h>
32#include <vtkInformationKey.h>
42 this->
printMsg(
"Requesting triangulation for '"
43 + std::string(dataSet->GetClassName()) +
"'",
46 if(ttk::hasInitializedMPI()) {
49 "MPI is not supported for this filter, the results will be incorrect");
59 if(ttk::hasInitializedMPI()) {
60 std::vector<int> tmp{};
69 this->
printErr(
"Unable to retrieve/initialize triangulation for '"
70 + std::string(dataSet->GetClassName()) +
"'");
76 const int &arrayIndex,
77 const std::string &arrayName,
78 vtkDataSet *
const inputData,
79 const int &inputPort) {
81 vtkDataArray *optionalArray =
nullptr;
84 optionalArray = this->GetInputArrayToProcess(arrayIndex, inputData);
87 this->SetInputArrayToProcess(arrayIndex, inputPort, 0, 0, arrayName.data());
88 optionalArray = this->GetInputArrayToProcess(arrayIndex, inputData);
94 return std::string(array->GetName()) +
"_Order";
98 const int scalarArrayIdx,
99 const int orderArrayIdx,
100 const bool enforceOrderArrayIdx) {
102 auto isValidOrderArray = [](vtkDataArray *
const array) {
106 if(array->GetNumberOfComponents() != 1)
110 if(array->GetDataType() != temp->GetDataType())
113 const std::string name(array->GetName());
114 if(name.size() < 6 || (name.rfind(
"_Order") != (name.size() - 6)))
120 if(enforceOrderArrayIdx) {
121 auto orderArray = this->GetInputArrayToProcess(orderArrayIdx, inputData);
122 switch(isValidOrderArray(orderArray)) {
124 this->
printErr(
"Unable to retrieve enforced order array at idx "
125 + std::to_string(orderArrayIdx) +
".");
129 this->
printErr(
"Retrieved enforced order array `"
130 + std::string(orderArray->GetName())
131 +
"` has more than one component.");
135 this->
printErr(
"Enforced order array `"
136 + std::string(orderArray->GetName())
137 +
"` is of incorrect type.");
139 this->
printErr(
" -> use `ttkArrayEditor` to convert data type to `"
140 + std::string(temp->GetDataTypeAsString()) +
"`.");
144 this->
printMsg(
"Retrieved enforced order array `"
145 + std::string(orderArray->GetName()) +
"`.",
152 auto scalarArray = this->GetInputArrayToProcess(scalarArrayIdx, inputData);
154 this->
printErr(
"Unable to retrieve input scalar array for idx "
155 + std::to_string(scalarArrayIdx) +
".");
157 }
else if(isValidOrderArray(scalarArray) == 1) {
158 this->
printMsg(
"Retrieved scalar array `"
159 + std::string(scalarArray->GetName())
160 +
"` is already an order array.",
165 auto orderArray = inputData
166 ->GetAttributesAsFieldData(this->GetInputArrayAssociation(
167 scalarArrayIdx, inputData))
170 switch(isValidOrderArray(orderArray)) {
173 this->
printWrn(
"No pre-existing order for array:");
174 this->
printWrn(
" `" + std::string(scalarArray->GetName()) +
"`.");
179 auto nVertices = scalarArray->GetNumberOfTuples();
182 newOrderArray->SetNumberOfComponents(1);
183 newOrderArray->SetNumberOfTuples(nVertices);
184 std::vector<int> neighbors;
186 if(ttk::hasInitializedMPI()) {
191 switch(scalarArray->GetDataType()) {
202 ->GetAttributesAsFieldData(
203 this->GetInputArrayAssociation(scalarArrayIdx, inputData))
204 ->AddArray(newOrderArray);
206 this->threadNumber_);
208 this->
printWrn(
"TIP: run `ttkArrayPreconditioning` first");
209 this->
printWrn(
"for improved performances :)");
211 return newOrderArray;
216 "Retrieved order array `" + std::string(orderArray->GetName())
217 +
"` for scalar array `" + std::string(scalarArray->GetName())
218 +
"` has more than one component.");
224 "Retrieved order array `" + std::string(orderArray->GetName())
225 +
"` for scalar array `" + std::string(scalarArray->GetName())
226 +
"` is of incorrect type.");
228 this->
printErr(
" -> use `ttkArrayEditor` to convert data type to `"
229 + std::string(temp->GetDataTypeAsString()) +
"`.");
235 "Retrieved order array `" + std::string(orderArray->GetName())
236 +
"` for scalar array `" + std::string(scalarArray->GetName()) +
"`.",
245 const int &arrayIndex,
246 const std::string &arrayName,
247 vtkDataSet *
const inputData,
248 std::vector<ttk::SimplexId> &spareStorage,
250 const bool printErr) {
254 enforceArrayIndex, arrayIndex, arrayName, inputData, inputPort);
255 if(array ==
nullptr) {
257 this->
printErr(
"Could not find the requested identifiers array");
261 if(array->GetNumberOfComponents() != 1) {
263 this->
printErr(
"Identifiers field must have only one component!");
268#ifndef TTK_ENABLE_64BIT_IDS
269 if(array->GetDataType() == VTK_ID_TYPE
270 || array->GetDataType() == VTK_LONG_LONG) {
272 "Converting identifiers field from vtkIdType to SimplexId...");
273 const auto nItems = array->GetNumberOfTuples();
277 spareStorage.resize(nItems);
278 for(vtkIdType i = 0; i < nItems; ++i) {
279 spareStorage[i] =
static_cast<ttk::SimplexId>(array->GetTuple1(i));
283 return spareStorage.data();
293template <
class vtkDataType>
294int prepOutput(vtkInformation *info,
const std::string &className) {
295 auto output = vtkDataObject::GetData(info);
296 if(!output || !output->IsA(className.data())) {
298 info->Set(vtkDataObject::DATA_OBJECT(), newOutput);
308 return vtkDataSet::SafeDownCast(this->GetOutputDataObject(port));
316 this->SetInputDataInternal(index, input);
324 this->AddInputDataInternal(index, input);
328 vtkInformationVector **inputVector,
329 vtkInformationVector *outputVector) {
331 for(
int i = 0; i < this->GetNumberOfOutputPorts(); ++i) {
332 auto outInfo = outputVector->GetInformationObject(i);
334 this->
printErr(
"Unable to retrieve output vtkDataObject at port "
335 + std::to_string(i));
339 auto outputPortInfo = this->GetOutputPortInformation(i);
343 this->
printErr(
"Unable to fill output port information at port "
344 + std::to_string(i));
352 if(inPortIndex < 0 || inPortIndex >= this->GetNumberOfInputPorts()) {
353 this->
printErr(
"Input port index " + std::to_string(inPortIndex)
354 +
" specified by 'SAME_DATA_TYPE_AS_INPUT_PORT' key of "
355 "output port is out of range ("
356 + std::to_string(this->GetNumberOfInputPorts())
360 auto inInfo = inputVector[inPortIndex]->GetInformationObject(0);
363 "No information object at port " + std::to_string(inPortIndex)
364 +
" specified by 'SAME_DATA_TYPE_AS_INPUT_PORT' key of output port.");
368 auto input = vtkDataObject::GetData(inInfo);
369 auto output = vtkDataObject::GetData(outInfo);
371 if(!output || !output->IsA(input->GetClassName())) {
375 vtkDataObject::DATA_TYPE_NAME(), input->GetClassName());
376 outInfo->Set(vtkDataObject::DATA_OBJECT(), newOutput);
380 if(!outputPortInfo->Has(vtkDataObject::DATA_TYPE_NAME())) {
381 this->
printErr(
"DATA_TYPE_NAME of output port " + std::to_string(i)
385 std::string outputType
386 = outputPortInfo->Get(vtkDataObject::DATA_TYPE_NAME());
388 if(outputType ==
"vtkUnstructuredGrid") {
389 prepOutput<vtkUnstructuredGrid>(outInfo, outputType);
390 }
else if(outputType ==
"vtkPolyData") {
391 prepOutput<vtkPolyData>(outInfo, outputType);
392 }
else if(outputType ==
"vtkMultiBlockDataSet") {
393 prepOutput<vtkMultiBlockDataSet>(outInfo, outputType);
394 }
else if(outputType ==
"vtkTable") {
395 prepOutput<vtkTable>(outInfo, outputType);
396 }
else if(outputType ==
"vtkImageData") {
397 prepOutput<vtkImageData>(outInfo, outputType);
399 this->
printErr(
"Unsupported data type for output[" + std::to_string(i)
400 +
"]: " + outputType);
407 + std::string(outputPortInfo->Get(vtkDataObject::DATA_TYPE_NAME()))
408 +
"' at output port " + std::to_string(i),
417int ttkAlgorithm::updateMPICommunicator(vtkDataSet *input) {
418 if(input ==
nullptr) {
422 = input->GetNumberOfCells() == 0 || input->GetNumberOfPoints() == 0;
425 MPI_Comm_split(MPI_COMM_WORLD, isEmpty, 0, &ttk::MPIcomm_);
430 MPI_Allgather(&oldRank, 1, MPI_INTEGER, newToOldRanks.data(), 1,
431 MPI_INTEGER, ttk::MPIcomm_);
432 std::map<int, int> oldToNewRanks;
434 oldToNewRanks[newToOldRanks[i]] = i;
437 = ttkUtils::GetPointer<int>(input->GetPointData()->GetArray(
"RankArray"));
438 if(vertexRankArray !=
nullptr) {
439 for(
int i = 0; i < input->GetNumberOfPoints(); i++) {
440 vertexRankArray[i] = oldToNewRanks[vertexRankArray[i]];
444 = ttkUtils::GetPointer<int>(input->GetCellData()->GetArray(
"RankArray"));
445 if(cellRankArray !=
nullptr) {
446 for(
int i = 0; i < input->GetNumberOfCells(); i++) {
447 cellRankArray[i] = oldToNewRanks[cellRankArray[i]];
457 unsigned char *ghost,
460 if(rankArray !=
nullptr) {
461#ifdef TTK_ENABLE_OPENMP
462#pragma omp parallel for reduction(+ : ghostNumber)
470 if(ghost !=
nullptr) {
471#ifdef TTK_ENABLE_OPENMP
472#pragma omp parallel for reduction(+ : ghostNumber)
483 auto minmax = std::minmax_element(globalIds, globalIds + simplexNumber);
489 MPI_Allreduce(&realSimplexNumber, &globalSimplexNumber, 1,
490 ttk::getMPIType(realSimplexNumber), MPI_SUM, ttk::MPIcomm_);
492 &min, &globalMin, 1, ttk::getMPIType(min), MPI_MIN, ttk::MPIcomm_);
494 &max, &globalMax, 1, ttk::getMPIType(max), MPI_MAX, ttk::MPIcomm_);
496 return (globalSimplexNumber == globalMax + 1 && globalMin == 0);
501 std::unordered_map<ttk::SimplexId, ttk::SimplexId> &vertGtoL,
502 std::vector<int> &neighborRanks) {
506 vtkNew<vtkIdTypeArray> vtkVertexIdentifiers{};
508 vtkNew<vtkIdTypeArray> vtkCellIdentifiers{};
509 vtkVertexIdentifiers->SetName(
"GlobalPointIds");
510 vtkVertexIdentifiers->SetNumberOfComponents(1);
511 vtkVertexIdentifiers->SetNumberOfTuples(input->GetNumberOfPoints());
512 vtkVertexIdentifiers->Fill(-1);
515 ttkUtils::GetPointer<ttk::LongSimplexId>(vtkVertexIdentifiers));
517 vtkCellIdentifiers->SetName(
"GlobalCellIds");
518 vtkCellIdentifiers->SetNumberOfComponents(1);
519 vtkCellIdentifiers->SetNumberOfTuples(input->GetNumberOfCells());
520 vtkCellIdentifiers->Fill(-1);
523 ttkUtils::GetPointer<ttk::LongSimplexId>(vtkCellIdentifiers));
525 int vertexNumber = input->GetNumberOfPoints();
527 int cellNumber = input->GetNumberOfCells();
531 double *boundingBox = input->GetBounds();
532 identifiers.setBounds(boundingBox);
533 identifiers.initializeNeighbors(boundingBox, neighborRanks);
534 if(ttk::isRunningWithMPI()) {
535 switch(input->GetDataObjectType()) {
536 case VTK_UNSTRUCTURED_GRID:
537 case VTK_POLY_DATA: {
539 identifiers.setOutdatedGlobalPointIds(
540 ttkUtils::GetPointer<ttk::LongSimplexId>(
541 input->GetPointData()->GetGlobalIds()));
542 identifiers.setOutdatedGlobalCellIds(
543 ttkUtils::GetPointer<ttk::LongSimplexId>(
544 input->GetCellData()->GetGlobalIds()));
545 identifiers.setVertexRankArray(ttkUtils::GetPointer<int>(
546 input->GetPointData()->GetArray(
"RankArray")));
547 int *cellRankArray = ttkUtils::GetPointer<int>(
548 input->GetCellData()->GetArray(
"RankArray"));
549 identifiers.setCellRankArray(cellRankArray);
550 identifiers.setVertGhost(ttkUtils::GetPointer<unsigned char>(
551 input->GetPointData()->GetArray(
"vtkGhostType")));
552 unsigned char *cellGhost = ttkUtils::GetPointer<unsigned char>(
553 input->GetCellData()->GetArray(
"vtkGhostType"));
554 identifiers.setCellGhost(cellGhost);
555 vtkPointSet *pointSet = vtkPointSet::SafeDownCast(input);
556 identifiers.setPointSet(
static_cast<float *
>(
558 vtkCellArray *cells =
nullptr;
559 switch(input->GetDataObjectType()) {
560 case VTK_UNSTRUCTURED_GRID: {
561 auto dataSetAsUG = vtkUnstructuredGrid::SafeDownCast(input);
562 cells = dataSetAsUG->GetCells();
565 case VTK_POLY_DATA: {
566 auto dataSetAsPD = vtkPolyData::SafeDownCast(input);
568 = dataSetAsPD->GetNumberOfPolys() > 0 ? dataSetAsPD->GetPolys()
569 : dataSetAsPD->GetNumberOfLines() > 0 ? dataSetAsPD->GetLines()
570 : dataSetAsPD->GetVerts();
574 this->
printErr(
"Unable to get cells for `"
575 + std::string(input->GetClassName()) +
"`");
578 if(cells ==
nullptr) {
581 if(!cells->IsStorage64Bit()) {
582 if(cells->CanConvertTo64BitStorage()) {
583 this->
printWrn(
"Converting the cell array to 64-bit storage");
584 bool success = cells->ConvertTo64BitStorage();
587 "Error converting the provided cell array to 64-bit storage");
592 "Cannot convert the provided cell array to 64-bit storage");
597 identifiers.setConnectivity(ttkUtils::GetPointer<ttk::LongSimplexId>(
598 cells->GetConnectivityArray()));
600 std::vector<std::vector<ttk::SimplexId>> pointsToCells(vertexNumber);
601 vtkIdList *cellList = vtkIdList::New();
602 if(cellRankArray !=
nullptr) {
604 input->GetPointCells(i, cellList);
605 for(
int j = 0; j < cellList->GetNumberOfIds(); j++) {
607 pointsToCells[i].push_back(cellList->GetId(j));
613 input->GetPointCells(i, cellList);
614 for(
int j = 0; j < cellList->GetNumberOfIds(); j++) {
615 if(cellGhost[cellList->GetId(j)] == 0) {
616 pointsToCells[i].push_back(cellList->GetId(j));
621 identifiers.setPointsToCells(pointsToCells);
623 identifiers.initializeMPITypes();
624 identifiers.setVertGtoL(&vertGtoL);
625 vtkIdList *pointCell = vtkIdList::New();
626 input->GetCellPoints(0, pointCell);
627 int nbPoints = pointCell->GetNumberOfIds();
628 identifiers.setDomainDimension(nbPoints - 1);
629 identifiers.buildKDTree();
630 status = identifiers.executePolyData();
633 case VTK_IMAGE_DATA: {
634 vtkImageData *data = vtkImageData::SafeDownCast(input);
635 identifiers.setDims(data->GetDimensions());
636 identifiers.setSpacing(data->GetSpacing());
637 status = identifiers.executeImageData();
641 this->
printErr(
"Unable to triangulate `"
642 + std::string(input->GetClassName()) +
"`");
650 printErr(
"Global identifier generation failed");
656 input->GetPointData()->SetGlobalIds(vtkVertexIdentifiers);
657 input->GetCellData()->SetGlobalIds(vtkCellIdentifiers);
663 vtkNew<vtkGhostCellsGenerator> generator;
664 if(ttk::isRunningWithMPI()
665 && (!input->HasAnyGhostCells()
666 && ((input->GetPointData()->GetArray(
"RankArray") ==
nullptr)
667 || (input->GetCellData()->GetArray(
"RankArray") ==
nullptr)))) {
668 generator->SetInputData(input);
669 generator->BuildIfRequiredOff();
670 generator->SetNumberOfGhostLayers(1);
672 input->ShallowCopy(generator->GetOutputDataObject(0));
673 input->GetPointData()->AddArray(
674 generator->GetOutputDataObject(0)->GetGhostArray(0));
675 input->GetCellData()->AddArray(
676 generator->GetOutputDataObject(0)->GetGhostArray(1));
682 std::vector<int> &neighbors,
687 if((input->GetDataObjectType() == VTK_POLY_DATA
688 || input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID)) {
689 if((input->GetCellData()->GetGlobalIds() ==
nullptr)
690 || (input->GetPointData()->GetGlobalIds() ==
nullptr)) {
691 printWrn(
"Up to Paraview 5.10.1, bugs have been found in VTK for the "
692 "distribution of Unstructured Grids and Poly Data");
693 printWrn(
"As a consequence, the generation of Global ids is "
694 "incorrect for those simplices");
696 "Beware when using TTK for such data set types, some results may "
699 if((input->GetPointData()->GetArray(
"RankArray") ==
nullptr)
700 || (input->GetCellData()->GetArray(
"RankArray") ==
nullptr)) {
701 printWrn(
"Up to Paraview 5.10.1, bugs have been found in VTK for the "
702 "distribution of Unstructured Grids and Poly Data");
703 printWrn(
"As a consequence, the generation of RankArray is "
704 "incorrect for those simplices");
706 "Beware when using TTK for such data set types, some results may "
712 std::vector<int> &neighborRanks{
713 triangulation !=
nullptr ? triangulation->getNeighborRanks() : neighbors};
715 double *boundingBox = input->GetBounds();
716 if(triangulation !=
nullptr) {
717 triangulation->createMetaGrid(boundingBox);
720 if(neighborRanks.empty()) {
721 ttk::preconditionNeighborsUsingBoundingBox(boundingBox, neighborRanks);
726 input->GetPointData()->GetGlobalIds());
728 input->GetCellData()->GetGlobalIds());
730 bool pointValidity{
false};
731 bool cellValidity{
false};
732 if((triangulation !=
nullptr
735 || triangulation ==
nullptr) {
736 if(globalPointIds !=
nullptr) {
737 unsigned char *ghostPoints = ttkUtils::GetPointer<unsigned char>(
738 input->GetPointData()->GetArray(
"vtkGhostType"));
739 int *vertexRankArray = ttkUtils::GetPointer<int>(
740 input->GetPointData()->GetArray(
"RankArray"));
742 globalPointIds, vertexNumber, ghostPoints, vertexRankArray);
744 if(pointValidity && globalCellIds !=
nullptr) {
746 unsigned char *ghostCells = ttkUtils::GetPointer<unsigned char>(
747 input->GetCellData()->GetArray(
"vtkGhostType"));
748 int *cellRankArray = ttkUtils::GetPointer<int>(
749 input->GetCellData()->GetArray(
"RankArray"));
751 globalCellIds, cellNumber, ghostCells, cellRankArray);
754 pointValidity =
true;
759 if(!pointValidity || !cellValidity) {
760 if(triangulation !=
nullptr) {
764 input, triangulation->getVertexGlobalIdMap(), neighborRanks);
767 std::unordered_map<ttk::SimplexId, ttk::SimplexId> vertGtoL{};
776 const auto pd{input->GetPointData()};
778 triangulation->
printWrn(
"No point data on input object");
782 triangulation->setVertsGlobalIds(
783 ttkUtils::GetPointer<ttk::LongSimplexId>(pd->GetGlobalIds()));
784 triangulation->setVertexGhostArray(
785 ttkUtils::GetPointer<unsigned char>(pd->GetArray(
"vtkGhostType")));
786 int *vertexRankArray = ttkUtils::GetPointer<int>(pd->GetArray(
"RankArray"));
787 if(vertexRankArray !=
nullptr) {
788 triangulation->setVertexRankArray(vertexRankArray);
790 triangulation->preconditionDistributedVertices();
793 const auto cd{input->GetCellData()};
795 triangulation->
printWrn(
"No cell data on input object");
799 triangulation->setCellsGlobalIds(
800 ttkUtils::GetPointer<ttk::LongSimplexId>(cd->GetGlobalIds()));
801 triangulation->setCellGhostArray(
802 ttkUtils::GetPointer<unsigned char>(cd->GetArray(
"vtkGhostType")));
803 int *cellRankArray = ttkUtils::GetPointer<int>(cd->GetArray(
"RankArray"));
804 if(cellRankArray !=
nullptr) {
805 triangulation->setCellRankArray(cellRankArray);
807 triangulation->preconditionDistributedCells();
815 vtkInformationVector **inputVector,
816 vtkInformationVector *outputVector) {
818 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA_OBJECT())) {
825 if(request->Has(vtkCompositeDataPipeline::REQUEST_INFORMATION())) {
832 if(request->Has(vtkCompositeDataPipeline::REQUEST_UPDATE_TIME())) {
840 vtkCompositeDataPipeline::REQUEST_TIME_DEPENDENT_INFORMATION())) {
841 this->
printMsg(
"Processing REQUEST_TIME_DEPENDENT_INFORMATION",
844 request, inputVector, outputVector);
848 if(request->Has(vtkCompositeDataPipeline::REQUEST_UPDATE_EXTENT())) {
855 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA_NOT_GENERATED())) {
862 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA())) {
866 if(ttk::hasInitializedMPI() && inputVector !=
nullptr) {
867 if(this->updateMPICommunicator(vtkDataSet::GetData(inputVector[0], 0))) {
872 return this->
RequestData(request, inputVector, outputVector);
875 this->
printErr(
"Unsupported pipeline pass:");
876 request->Print(cout);
#define TTK_FORCE_USE(x)
Force the compiler to use the function/method parameter.
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
Baseclass of all VTK filters that wrap ttk modules.
void SetInputData(vtkDataSet *)
static vtkInformationIntegerKey * SAME_DATA_TYPE_AS_INPUT_PORT()
bool checkGlobalIdValidity(ttk::LongSimplexId *globalIds, ttk::SimplexId simplexNumber, unsigned char *ghost, int *rankArray)
ttk::SimplexId * GetIdentifierArrayPtr(const bool &enforceArrayIndex, const int &arrayIndex, const std::string &arrayName, vtkDataSet *const inputData, std::vector< ttk::SimplexId > &spareStorage, const int inputPort=0, const bool printErr=true)
void AddInputData(vtkDataSet *)
virtual int RequestUpdateTime(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
virtual int RequestDataNotGenerated(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
float CompactTriangulationCacheSize
virtual int RequestData(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
void MPIGhostPipelinePreconditioning(vtkDataSet *input)
vtkDataArray * GetOrderArray(vtkDataSet *const inputData, const int scalarArrayIdx, const int orderArrayIdx=0, const bool enforceOrderArrayIdx=false)
virtual int RequestInformation(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVectors, vtkInformationVector *outputVector) override
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVectors, vtkInformationVector *outputVector)
virtual int RequestUpdateTimeDependentInformation(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
ttk::Triangulation * GetTriangulation(vtkDataSet *dataSet)
virtual int RequestUpdateExtent(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
void MPITriangulationPreconditioning(ttk::Triangulation *triangulation, vtkDataSet *input)
int GenerateGlobalIds(vtkDataSet *input, std::unordered_map< ttk::SimplexId, ttk::SimplexId > &vertGtoL, std::vector< int > &neighborRanks)
void MPIPipelinePreconditioning(vtkDataSet *input, std::vector< int > &neighbors, ttk::Triangulation *triangulation=nullptr)
int FillOutputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
vtkDataArray * GetOptionalArray(const bool &enforceArrayIndex, const int &arrayIndex, const std::string &arrayName, vtkDataSet *const inputData, const int &inputPort=0)
static std::string GetOrderArrayName(vtkDataArray *const array)
static ttk::Triangulation * GetTriangulation(int debugLevel, float cacheRatio, vtkDataSet *object)
static void * GetVoidPointer(vtkDataArray *array, vtkIdType start=0)
int printWrn(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
std::string debugMsgNamePrefix_
void setDebugMsgPrefix(const std::string &prefix)
int printMsg(const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
void setCellIdentifiers(ttk::LongSimplexId *cellIdentifiers)
void setVertexNumber(const SimplexId &vertexNumber)
void setCellNumber(const SimplexId &cellNumber)
int executeSequential()
Generates global ids for all data set type in sequential.
void setVertexIdentifiers(ttk::LongSimplexId *vertexIdentifiers)
Triangulation is a class that provides time and memory efficient traversal methods on triangulations ...
Triangulation::Type getType() const
COMMON_EXPORTS int MPIsize_
COMMON_EXPORTS int MPIrank_
void preconditionOrderArray(const size_t nVerts, const scalarType *const scalars, SimplexId *const order, const int nThreads=ttk::globalThreadNumber_)
Precondition an order array to be consumed by the base layer API.
long long int LongSimplexId
Identifier type for simplices of any dimension.
int SimplexId
Identifier type for simplices of any dimension.
vtkStandardNewMacro(ttkAlgorithm)
vtkInformationKeyMacro(ttkAlgorithm, SAME_DATA_TYPE_AS_INPUT_PORT, Integer)
int prepOutput(vtkInformation *info, const std::string &className)