9#include <vtkCellTypes.h>
10#include <vtkCommand.h>
11#include <vtkDataSet.h>
16#include <vtkCellData.h>
17#include <vtkGhostCellsGenerator.h>
20#include <vtkImageData.h>
21#include <vtkInformation.h>
22#include <vtkInformationIntegerKey.h>
23#include <vtkInformationVector.h>
24#include <vtkMultiBlockDataSet.h>
25#include <vtkPointData.h>
26#include <vtkPolyData.h>
28#include <vtkUnstructuredGrid.h>
30#include <vtkCompositeDataPipeline.h>
33#include <vtkInformationKey.h>
43 this->
printMsg(
"Requesting triangulation for '"
44 + std::string(dataSet->GetClassName()) +
"'",
47 if((ttk::hasInitializedMPI()) && (ttk::isRunningWithMPI())) {
49 printErr(
"MPI is not formally supported for this filter :(");
50 printErr(
"The results are likely to be incorrect.");
60 if(ttk::hasInitializedMPI()) {
61 std::vector<int> tmp{};
62 std::map<int, int> tmpId{};
71 this->
printErr(
"Unable to retrieve/initialize triangulation for '"
72 + std::string(dataSet->GetClassName()) +
"'");
78 const int &arrayIndex,
79 const std::string &arrayName,
80 vtkDataSet *
const inputData,
81 const int &inputPort) {
83 vtkDataArray *optionalArray =
nullptr;
86 optionalArray = this->GetInputArrayToProcess(arrayIndex, inputData);
89 this->SetInputArrayToProcess(arrayIndex, inputPort, 0, 0, arrayName.data());
90 optionalArray = this->GetInputArrayToProcess(arrayIndex, inputData);
96 return std::string(array->GetName()) +
"_Order";
101 vtkDataArray *scalarArray,
102 const int scalarArrayIdx,
103 const bool getGlobalOrder,
104 vtkDataArray *oldOrderArray,
108 auto nVertices = scalarArray->GetNumberOfTuples();
109 if(oldOrderArray !=
nullptr && getGlobalOrder) {
110 newOrderArray = ttkSimplexIdTypeArray::SafeDownCast(oldOrderArray);
114 newOrderArray->SetNumberOfComponents(1);
115 newOrderArray->SetNumberOfTuples(nVertices);
118 std::vector<int> neighbors;
119 std::map<int, int> neighborsToId;
121 if(ttk::hasInitializedMPI()) {
124 inputData, neighbors, neighborsToId,
nullptr);
126 if(ttk::isRunningWithMPI() && getGlobalOrder) {
133 static_cast<const T1 *
>(triangulation->
getData()),
137 switch(scalarArray->GetDataType()) {
144 if(oldOrderArray ==
nullptr || !getGlobalOrder) {
146 ->GetAttributesAsFieldData(
147 this->GetInputArrayAssociation(scalarArrayIdx, inputData))
148 ->AddArray(newOrderArray);
152 switch(scalarArray->GetDataType()) {
160 ->GetAttributesAsFieldData(
161 this->GetInputArrayAssociation(scalarArrayIdx, inputData))
162 ->AddArray(newOrderArray);
165 return newOrderArray;
169 vtkDataSet *
const inputData,
170 vtkDataArray *scalarArray,
171 const int scalarArrayIdx,
172 const bool getGlobalOrder,
173 vtkDataArray *orderArray,
175 const bool enforceOrderArrayIdx) {
177 std::string enforcedArray =
"";
178 if(enforceOrderArrayIdx) {
179 enforcedArray =
" enforced ";
183 if(triangulation->isOrderArrayGlobal(
185 this->
printMsg(
"Retrieved " + enforcedArray +
" order array `"
186 + std::string(orderArray->GetName()) +
"`.",
192 this->
printWrn(
"Order array `" + std::string(orderArray->GetName())
193 +
"` is local, but a global order array is "
194 "required. Re-computing.");
202 getGlobalOrder, orderArray, triangulation);
204 triangulation->setIsOrderArrayGlobal(
208 this->threadNumber_);
211 this->
printWrn(
"TIP: run `ttkArrayPreconditioning` first with "
212 "GlobalOrder enabled");
213 this->
printWrn(
"for improved performances :)");
225 this->
printMsg(
"Retrieved " + enforcedArray +
" order array `"
226 + std::string(orderArray->GetName()) +
"`.",
235 const int scalarArrayIdx,
237 const bool getGlobalOrder,
238 const int orderArrayIdx,
239 const bool enforceOrderArrayIdx) {
241 auto isValidOrderArray = [](vtkDataArray *
const array) {
245 if(array->GetNumberOfComponents() != 1)
249 if(array->GetDataType() != temp->GetDataType())
252 const std::string name(array->GetName());
253 if(name.size() < 6 || (name.rfind(
"_Order") != (name.size() - 6)))
258 auto scalarArray = this->GetInputArrayToProcess(scalarArrayIdx, inputData);
259 if(enforceOrderArrayIdx) {
260 auto orderArray = this->GetInputArrayToProcess(orderArrayIdx, inputData);
261 switch(isValidOrderArray(orderArray)) {
263 this->
printErr(
"Unable to retrieve enforced order array at idx "
264 + std::to_string(orderArrayIdx) +
".");
268 this->
printErr(
"Retrieved enforced order array `"
269 + std::string(orderArray->GetName())
270 +
"` has more than one component.");
274 this->
printErr(
"Enforced order array `"
275 + std::string(orderArray->GetName())
276 +
"` is of incorrect type.");
278 this->
printErr(
" -> use `ttkArrayEditor` to convert data type to `"
279 + std::string(temp->GetDataTypeAsString()) +
"`.");
284 inputData, scalarArray, scalarArrayIdx, getGlobalOrder, orderArray,
285 triangulation, enforceOrderArrayIdx);
291 this->
printErr(
"Unable to retrieve input scalar array for idx "
292 + std::to_string(scalarArrayIdx) +
".");
294 }
else if(isValidOrderArray(scalarArray) == 1) {
295 this->
printMsg(
"Retrieved scalar array `"
296 + std::string(scalarArray->GetName())
297 +
"` is already an order array.",
302 auto orderArray = inputData
303 ->GetAttributesAsFieldData(this->GetInputArrayAssociation(
304 scalarArrayIdx, inputData))
307 switch(isValidOrderArray(orderArray)) {
311 this->
printWrn(
"No pre-existing order for array:");
312 this->
printWrn(
" `" + std::string(scalarArray->GetName()) +
"`.");
320 getGlobalOrder, orderArray, triangulation);
322 std::string optionOn =
"";
325 optionOn =
"with GlobalOrder enabled ";
327 bool isGlobalOrder = getGlobalOrder || (!ttk::isRunningWithMPI());
328 triangulation->setIsOrderArrayGlobal(
332 this->threadNumber_);
335 this->
printWrn(
"TIP: run `ttkArrayPreconditioning` first");
336 this->
printWrn(optionOn +
"for improved performances :)");
344 "Retrieved order array `" + std::string(orderArray->GetName())
345 +
"` for scalar array `" + std::string(scalarArray->GetName())
346 +
"` has more than one component.");
352 "Retrieved order array `" + std::string(orderArray->GetName())
353 +
"` for scalar array `" + std::string(scalarArray->GetName())
354 +
"` is of incorrect type.");
356 this->
printErr(
" -> use `ttkArrayEditor` to convert data type to `"
357 + std::string(temp->GetDataTypeAsString()) +
"`.");
363 if(!ttk::isRunningWithMPI()) {
365 this->
printMsg(
"Retrieved order array `"
366 + std::string(orderArray->GetName())
367 +
"` for scalar array `"
368 + std::string(scalarArray->GetName()) +
"`.",
374 inputData, scalarArray, scalarArrayIdx, getGlobalOrder, orderArray,
375 triangulation, enforceOrderArrayIdx);
383 const int &arrayIndex,
384 const std::string &arrayName,
385 vtkDataSet *
const inputData,
386 std::vector<ttk::SimplexId> &spareStorage,
392 enforceArrayIndex, arrayIndex, arrayName, inputData, inputPort);
393 if(array ==
nullptr) {
395 this->
printErr(
"Could not find the requested identifiers array");
399 if(array->GetNumberOfComponents() != 1) {
401 this->
printErr(
"Identifiers field must have only one component!");
406#ifndef TTK_ENABLE_64BIT_IDS
407 if(array->GetDataType() == VTK_ID_TYPE
408 || array->GetDataType() == VTK_LONG_LONG) {
410 "Converting identifiers field from vtkIdType to SimplexId...");
411 const auto nItems = array->GetNumberOfTuples();
415 spareStorage.resize(nItems);
416 for(vtkIdType i = 0; i < nItems; ++i) {
417 spareStorage[i] =
static_cast<ttk::SimplexId>(array->GetTuple1(i));
421 return spareStorage.data();
431template <
class vtkDataType>
432int prepOutput(vtkInformation *info,
const std::string &className) {
433 auto output = vtkDataObject::GetData(info);
434 if(!output || !output->IsA(className.data())) {
436 info->Set(vtkDataObject::DATA_OBJECT(), newOutput);
446 return vtkDataSet::SafeDownCast(this->GetOutputDataObject(port));
454 this->SetInputDataInternal(index, input);
462 this->AddInputDataInternal(index, input);
466 vtkInformationVector **inputVector,
467 vtkInformationVector *outputVector) {
469 for(
int i = 0; i < this->GetNumberOfOutputPorts(); ++i) {
470 auto outInfo = outputVector->GetInformationObject(i);
472 this->
printErr(
"Unable to retrieve output vtkDataObject at port "
473 + std::to_string(i));
477 auto outputPortInfo = this->GetOutputPortInformation(i);
481 this->
printErr(
"Unable to fill output port information at port "
482 + std::to_string(i));
490 if(inPortIndex < 0 || inPortIndex >= this->GetNumberOfInputPorts()) {
491 this->
printErr(
"Input port index " + std::to_string(inPortIndex)
492 +
" specified by 'SAME_DATA_TYPE_AS_INPUT_PORT' key of "
493 "output port is out of range ("
494 + std::to_string(this->GetNumberOfInputPorts())
498 auto inInfo = inputVector[inPortIndex]->GetInformationObject(0);
501 "No information object at port " + std::to_string(inPortIndex)
502 +
" specified by 'SAME_DATA_TYPE_AS_INPUT_PORT' key of output port.");
506 auto input = vtkDataObject::GetData(inInfo);
507 auto output = vtkDataObject::GetData(outInfo);
509 if(!output || !output->IsA(input->GetClassName())) {
513 vtkDataObject::DATA_TYPE_NAME(), input->GetClassName());
514 outInfo->Set(vtkDataObject::DATA_OBJECT(), newOutput);
518 if(!outputPortInfo->Has(vtkDataObject::DATA_TYPE_NAME())) {
519 this->
printErr(
"DATA_TYPE_NAME of output port " + std::to_string(i)
523 std::string
const outputType
524 = outputPortInfo->Get(vtkDataObject::DATA_TYPE_NAME());
526 if(outputType ==
"vtkUnstructuredGrid") {
528 }
else if(outputType ==
"vtkPolyData") {
530 }
else if(outputType ==
"vtkMultiBlockDataSet") {
532 }
else if(outputType ==
"vtkTable") {
534 }
else if(outputType ==
"vtkImageData") {
537 this->
printErr(
"Unsupported data type for output[" + std::to_string(i)
538 +
"]: " + outputType);
545 + std::string(outputPortInfo->Get(vtkDataObject::DATA_TYPE_NAME()))
546 +
"' at output port " + std::to_string(i),
555int ttkAlgorithm::updateMPICommunicator(vtkDataSet *input) {
556 if(input ==
nullptr) {
560 = input->GetNumberOfCells() == 0 || input->GetNumberOfPoints() == 0;
563 MPI_Comm_split(MPI_COMM_WORLD, isEmpty, 0, &ttk::MPIcomm_);
568 MPI_Allgather(&oldRank, 1, MPI_INTEGER, newToOldRanks.data(), 1,
569 MPI_INTEGER, ttk::MPIcomm_);
570 std::map<int, int> oldToNewRanks;
572 oldToNewRanks[newToOldRanks[i]] = i;
576 if(vertexRankArray !=
nullptr) {
577 for(
int i = 0; i < input->GetNumberOfPoints(); i++) {
578 vertexRankArray[i] = oldToNewRanks[vertexRankArray[i]];
583 if(cellRankArray !=
nullptr) {
584 for(
int i = 0; i < input->GetNumberOfCells(); i++) {
585 cellRankArray[i] = oldToNewRanks[cellRankArray[i]];
595 unsigned char *ghost,
598 if(rankArray !=
nullptr) {
599#ifdef TTK_ENABLE_OPENMP
600#pragma omp parallel for reduction(+ : ghostNumber)
608 if(ghost !=
nullptr) {
609#ifdef TTK_ENABLE_OPENMP
610#pragma omp parallel for reduction(+ : ghostNumber)
621 auto minmax = std::minmax_element(globalIds, globalIds + simplexNumber);
627 MPI_Allreduce(&realSimplexNumber, &globalSimplexNumber, 1,
628 ttk::getMPIType(realSimplexNumber), MPI_SUM, ttk::MPIcomm_);
630 &min, &globalMin, 1, ttk::getMPIType(min), MPI_MIN, ttk::MPIcomm_);
632 &max, &globalMax, 1, ttk::getMPIType(max), MPI_MAX, ttk::MPIcomm_);
634 return (globalSimplexNumber == globalMax + 1 && globalMin == 0);
639 std::unordered_map<ttk::SimplexId, ttk::SimplexId> &vertGtoL,
640 std::vector<int> &neighborRanks,
641 std::map<int, int> &neighborsToId) {
643 ttk::Identifiers identifiers;
645 vtkNew<vtkIdTypeArray> vtkVertexIdentifiers{};
647 vtkNew<vtkIdTypeArray> vtkCellIdentifiers{};
648 vtkVertexIdentifiers->SetName(
"GlobalPointIds");
649 vtkVertexIdentifiers->SetNumberOfComponents(1);
650 vtkVertexIdentifiers->SetNumberOfTuples(input->GetNumberOfPoints());
651 vtkVertexIdentifiers->Fill(-1);
656 vtkCellIdentifiers->SetName(
"GlobalCellIds");
657 vtkCellIdentifiers->SetNumberOfComponents(1);
658 vtkCellIdentifiers->SetNumberOfTuples(input->GetNumberOfCells());
659 vtkCellIdentifiers->Fill(-1);
664 int vertexNumber = input->GetNumberOfPoints();
666 int cellNumber = input->GetNumberOfCells();
670 double *boundingBox = input->GetBounds();
671 identifiers.setBounds(boundingBox);
672 identifiers.initializeNeighbors(boundingBox, neighborRanks, neighborsToId);
673 if(ttk::isRunningWithMPI()) {
674 switch(input->GetDataObjectType()) {
675 case VTK_UNSTRUCTURED_GRID:
676 case VTK_POLY_DATA: {
678 identifiers.setOutdatedGlobalPointIds(
680 input->GetPointData()->GetGlobalIds()));
681 identifiers.setOutdatedGlobalCellIds(
683 input->GetCellData()->GetGlobalIds()));
685 input->GetPointData()->GetArray(
"RankArray")));
687 input->GetCellData()->GetArray(
"RankArray"));
688 identifiers.setCellRankArray(cellRankArray);
690 input->GetPointData()->GetArray(
"vtkGhostType")));
692 input->GetCellData()->GetArray(
"vtkGhostType"));
693 identifiers.setCellGhost(cellGhost);
694 vtkPointSet *pointSet = vtkPointSet::SafeDownCast(input);
695 identifiers.setPointSet(
static_cast<float *
>(
697 vtkCellArray *cells =
nullptr;
698 switch(input->GetDataObjectType()) {
699 case VTK_UNSTRUCTURED_GRID: {
700 auto dataSetAsUG = vtkUnstructuredGrid::SafeDownCast(input);
701 cells = dataSetAsUG->GetCells();
704 case VTK_POLY_DATA: {
705 auto dataSetAsPD = vtkPolyData::SafeDownCast(input);
707 = dataSetAsPD->GetNumberOfPolys() > 0 ? dataSetAsPD->GetPolys()
708 : dataSetAsPD->GetNumberOfLines() > 0 ? dataSetAsPD->GetLines()
709 : dataSetAsPD->GetVerts();
713 this->
printErr(
"Unable to get cells for `"
714 + std::string(input->GetClassName()) +
"`");
717 if(cells ==
nullptr) {
720 if(!cells->IsStorage64Bit()) {
721 if(cells->CanConvertTo64BitStorage()) {
722 this->
printWrn(
"Converting the cell array to 64-bit storage");
723 bool success = cells->ConvertTo64BitStorage();
726 "Error converting the provided cell array to 64-bit storage");
731 "Cannot convert the provided cell array to 64-bit storage");
737 cells->GetConnectivityArray()));
739 std::vector<std::vector<ttk::SimplexId>> pointsToCells(vertexNumber);
740 vtkIdList *cellList = vtkIdList::New();
741 if(cellRankArray !=
nullptr) {
743 input->GetPointCells(i, cellList);
744 for(
int j = 0; j < cellList->GetNumberOfIds(); j++) {
746 pointsToCells[i].push_back(cellList->GetId(j));
752 input->GetPointCells(i, cellList);
753 for(
int j = 0; j < cellList->GetNumberOfIds(); j++) {
754 if(cellGhost[cellList->GetId(j)] == 0) {
755 pointsToCells[i].push_back(cellList->GetId(j));
760 identifiers.setPointsToCells(pointsToCells);
762 identifiers.initializeMPITypes();
763 identifiers.setVertGtoL(&vertGtoL);
764 vtkIdList *pointCell = vtkIdList::New();
765 input->GetCellPoints(0, pointCell);
766 int nbPoints = pointCell->GetNumberOfIds();
767 identifiers.setDomainDimension(nbPoints - 1);
768 identifiers.buildKDTree();
769 status = identifiers.executePolyData();
772 case VTK_IMAGE_DATA: {
773 vtkImageData *data = vtkImageData::SafeDownCast(input);
774 identifiers.setDims(data->GetDimensions());
775 identifiers.setSpacing(data->GetSpacing());
776 status = identifiers.executeImageData();
780 this->
printErr(
"Unable to triangulate `"
781 + std::string(input->GetClassName()) +
"`");
789 printErr(
"Global identifier generation failed");
795 input->GetPointData()->SetGlobalIds(vtkVertexIdentifiers);
796 input->GetCellData()->SetGlobalIds(vtkCellIdentifiers);
802 vtkNew<vtkGhostCellsGenerator> generator;
803 if(ttk::isRunningWithMPI()
804 && (!input->HasAnyGhostCells()
805 && ((input->GetPointData()->GetArray(
"RankArray") ==
nullptr)
806 || (input->GetCellData()->GetArray(
"RankArray") ==
nullptr)))) {
807 generator->SetInputData(input);
808 generator->BuildIfRequiredOff();
809 generator->SetNumberOfGhostLayers(1);
811 input->ShallowCopy(generator->GetOutputDataObject(0));
812 input->GetPointData()->AddArray(
813 generator->GetOutputDataObject(0)->GetGhostArray(0));
814 input->GetCellData()->AddArray(
815 generator->GetOutputDataObject(0)->GetGhostArray(1));
821 std::vector<int> &neighbors,
822 std::map<int, int> &neighToId,
828 if((input->GetDataObjectType() == VTK_POLY_DATA
829 || input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID)) {
831 if((ttk::hasInitializedMPI()) && (ttk::isRunningWithMPI())) {
833 printWrn(
"The distribution by VTK of Unstructured");
834 printWrn(
"Grids and Poly Data has been reported");
835 printWrn(
"to be affected by bugs (at least up");
838 if((input->GetCellData()->GetGlobalIds() ==
nullptr)
839 || (input->GetPointData()->GetGlobalIds() ==
nullptr)) {
841 printWrn(
"=> Global identifiers may be incorrect.");
843 if((input->GetPointData()->GetArray(
"RankArray") ==
nullptr)
844 || (input->GetCellData()->GetArray(
"RankArray") ==
nullptr)) {
845 printWrn(
"=> Rank arrays may be incorrect.");
852 std::vector<int> &neighborRanks{
853 triangulation !=
nullptr ? triangulation->getNeighborRanks() : neighbors};
854 std::map<int, int> &neighborsToId{
855 triangulation !=
nullptr ? triangulation->getNeighborsToId() : neighToId};
857 double *boundingBox = input->GetBounds();
858 if(triangulation !=
nullptr) {
859 triangulation->createMetaGrid(boundingBox);
862 if(neighborRanks.empty()) {
863 ttk::preconditionNeighborsUsingBoundingBox(
864 boundingBox, neighborRanks, neighborsToId);
869 input->GetPointData()->GetGlobalIds());
871 input->GetCellData()->GetGlobalIds());
873 bool pointValidity{
false};
874 bool cellValidity{
false};
875 if((triangulation !=
nullptr
878 || triangulation ==
nullptr) {
879 if(globalPointIds !=
nullptr) {
881 input->GetPointData()->GetArray(
"vtkGhostType"));
883 input->GetPointData()->GetArray(
"RankArray"));
885 globalPointIds, vertexNumber, ghostPoints, vertexRankArray);
887 if(pointValidity && globalCellIds !=
nullptr) {
890 input->GetCellData()->GetArray(
"vtkGhostType"));
892 input->GetCellData()->GetArray(
"RankArray"));
894 globalCellIds, cellNumber, ghostCells, cellRankArray);
897 pointValidity =
true;
902 if(!pointValidity || !cellValidity) {
903 if(triangulation !=
nullptr) {
907 neighborRanks, neighborsToId);
910 std::unordered_map<ttk::SimplexId, ttk::SimplexId> vertGtoL{};
919 const auto pd{input->GetPointData()};
921 triangulation->
printWrn(
"No point data on input object");
925 triangulation->setVertsGlobalIds(
927 triangulation->setVertexGhostArray(
930 if(vertexRankArray !=
nullptr) {
931 triangulation->setVertexRankArray(vertexRankArray);
933 triangulation->preconditionDistributedVertices();
936 const auto cd{input->GetCellData()};
938 triangulation->
printWrn(
"No cell data on input object");
942 triangulation->setCellsGlobalIds(
944 triangulation->setCellGhostArray(
947 if(cellRankArray !=
nullptr) {
948 triangulation->setCellRankArray(cellRankArray);
950 triangulation->preconditionDistributedCells();
958 vtkInformationVector **inputVector,
959 vtkInformationVector *outputVector) {
961 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA_OBJECT())) {
968 if(request->Has(vtkCompositeDataPipeline::REQUEST_INFORMATION())) {
975 if(request->Has(vtkCompositeDataPipeline::REQUEST_UPDATE_TIME())) {
983 vtkCompositeDataPipeline::REQUEST_TIME_DEPENDENT_INFORMATION())) {
984 this->
printMsg(
"Processing REQUEST_TIME_DEPENDENT_INFORMATION",
987 request, inputVector, outputVector);
991 if(request->Has(vtkCompositeDataPipeline::REQUEST_UPDATE_EXTENT())) {
998 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA_NOT_GENERATED())) {
1005 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA())) {
1008#ifdef TTK_ENABLE_MPI
1009 if(ttk::hasInitializedMPI() && inputVector !=
nullptr) {
1010 if(this->updateMPICommunicator(vtkDataSet::GetData(inputVector[0], 0))) {
1015 return this->
RequestData(request, inputVector, outputVector);
1018 this->
printErr(
"Unsupported pipeline pass:");
1019 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)
virtual int RequestInformation(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVectors, vtkInformationVector *outputVector) override
int GenerateGlobalIds(vtkDataSet *input, std::unordered_map< ttk::SimplexId, ttk::SimplexId > &vertGtoL, std::vector< int > &neighborRanks, std::map< int, int > &neighborsToId)
vtkDataArray * checkForGlobalAndComputeOrderArray(vtkDataSet *const inputData, vtkDataArray *scalarArray, const int scalarArrayIdx, const bool getGlobalOrder, vtkDataArray *orderArray, ttk::Triangulation *triangulation, const bool enforceOrderArrayIdx)
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)
vtkDataArray * GetOrderArray(vtkDataSet *const inputData, const int scalarArrayIdx, ttk::Triangulation *triangulation, const bool getGlobalOrder=false, const int orderArrayIdx=0, const bool enforceOrderArrayIdx=false)
void MPIPipelinePreconditioning(vtkDataSet *input, std::vector< int > &neighbors, std::map< int, int > &neighToId, ttk::Triangulation *triangulation=nullptr)
int FillOutputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
vtkDataArray * ComputeOrderArray(vtkDataSet *const inputData, vtkDataArray *scalarArray, const int scalarArrayIdx, const bool getGlobalOrder, vtkDataArray *oldOrderArray, ttk::Triangulation *triangulation)
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)
static DT * GetPointer(vtkDataArray *array, vtkIdType start=0)
int preconditionTriangulation(AbstractTriangulation *triangulation)
void setGlobalOrder(bool order)
int processScalarArray(const triangulationType *triangulation, ttk::SimplexId *orderArray, const DT *scalarArray, const size_t nVerts) const
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 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 ...
AbstractTriangulation * getData()
Triangulation::Type getType() const
FiltratedEdge max(const FiltratedEdge &a, const FiltratedEdge &b)
COMMON_EXPORTS int MPIsize_
int SimplexId
Identifier type for simplices of any dimension.
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.
vtkStandardNewMacro(ttkAlgorithm)
vtkInformationKeyMacro(ttkAlgorithm, SAME_DATA_TYPE_AS_INPUT_PORT, Integer)
int prepOutput(vtkInformation *info, const std::string &className)
#define ttkTypeMacroAT(group0, group1, call)
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/| (_) |"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)