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>
35#include <vtkInformationKey.h>
45 this->
printMsg(
"Requesting triangulation for '"
46 + std::string(dataSet->GetClassName()) +
"'",
49 if((ttk::hasInitializedMPI()) && (ttk::isRunningWithMPI())) {
51 printErr(
"MPI is not formally supported for this filter :(");
52 printErr(
"The results are likely to be incorrect.");
62 if(ttk::hasInitializedMPI()) {
63 std::vector<int> tmp{};
64 std::map<int, int> tmpId{};
73 this->
printErr(
"Unable to retrieve/initialize triangulation for '"
74 + std::string(dataSet->GetClassName()) +
"'");
80 const int &arrayIndex,
81 const std::string &arrayName,
82 vtkDataSet *
const inputData,
83 const int &inputPort) {
85 vtkDataArray *optionalArray =
nullptr;
88 optionalArray = this->GetInputArrayToProcess(arrayIndex, inputData);
91 this->SetInputArrayToProcess(arrayIndex, inputPort, 0, 0, arrayName.data());
92 optionalArray = this->GetInputArrayToProcess(arrayIndex, inputData);
98 return std::string(array->GetName()) +
"_Order";
103 vtkDataArray *scalarArray,
104 const int scalarArrayIdx,
105 const bool getGlobalOrder,
106 vtkDataArray *oldOrderArray,
110 auto nVertices = scalarArray->GetNumberOfTuples();
111 if(oldOrderArray !=
nullptr && getGlobalOrder) {
112 newOrderArray = ttkSimplexIdTypeArray::SafeDownCast(oldOrderArray);
116 newOrderArray->SetNumberOfComponents(1);
117 newOrderArray->SetNumberOfTuples(nVertices);
120 std::vector<int> neighbors;
121 std::map<int, int> neighborsToId;
123 if(ttk::hasInitializedMPI()) {
126 inputData, neighbors, neighborsToId,
nullptr);
128 if(ttk::isRunningWithMPI() && getGlobalOrder) {
135 static_cast<const T1 *
>(triangulation->
getData()),
139 switch(scalarArray->GetDataType()) {
146 if(oldOrderArray ==
nullptr || !getGlobalOrder) {
148 ->GetAttributesAsFieldData(
149 this->GetInputArrayAssociation(scalarArrayIdx, inputData))
150 ->AddArray(newOrderArray);
154 switch(scalarArray->GetDataType()) {
162 ->GetAttributesAsFieldData(
163 this->GetInputArrayAssociation(scalarArrayIdx, inputData))
164 ->AddArray(newOrderArray);
167 return newOrderArray;
171 vtkDataSet *
const inputData,
172 vtkDataArray *scalarArray,
173 const int scalarArrayIdx,
174 const bool getGlobalOrder,
175 vtkDataArray *orderArray,
177 const bool enforceOrderArrayIdx) {
179 std::string enforcedArray =
"";
180 if(enforceOrderArrayIdx) {
181 enforcedArray =
" enforced ";
185 if(triangulation->isOrderArrayGlobal(
187 this->
printMsg(
"Retrieved " + enforcedArray +
" order array `"
188 + std::string(orderArray->GetName()) +
"`.",
194 this->
printWrn(
"Order array `" + std::string(orderArray->GetName())
195 +
"` is local, but a global order array is "
196 "required. Re-computing.");
204 getGlobalOrder, orderArray, triangulation);
206 triangulation->setIsOrderArrayGlobal(
210 this->threadNumber_);
213 this->
printWrn(
"TIP: run `ttkArrayPreconditioning` first with "
214 "GlobalOrder enabled");
215 this->
printWrn(
"for improved performances :)");
227 this->
printMsg(
"Retrieved " + enforcedArray +
" order array `"
228 + std::string(orderArray->GetName()) +
"`.",
237 const int scalarArrayIdx,
239 const bool getGlobalOrder,
240 const int orderArrayIdx,
241 const bool enforceOrderArrayIdx) {
243 auto isValidOrderArray = [](vtkDataArray *
const array) {
247 if(array->GetNumberOfComponents() != 1)
251 if(array->GetDataType() != temp->GetDataType())
254 const std::string name(array->GetName());
255 if(name.size() < 6 || (name.rfind(
"_Order") != (name.size() - 6)))
260 auto scalarArray = this->GetInputArrayToProcess(scalarArrayIdx, inputData);
261 if(enforceOrderArrayIdx) {
262 auto orderArray = this->GetInputArrayToProcess(orderArrayIdx, inputData);
263 switch(isValidOrderArray(orderArray)) {
265 this->
printErr(
"Unable to retrieve enforced order array at idx "
266 + std::to_string(orderArrayIdx) +
".");
270 this->
printErr(
"Retrieved enforced order array `"
271 + std::string(orderArray->GetName())
272 +
"` has more than one component.");
276 this->
printErr(
"Enforced order array `"
277 + std::string(orderArray->GetName())
278 +
"` is of incorrect type.");
280 this->
printErr(
" -> use `ttkArrayEditor` to convert data type to `"
281 + std::string(temp->GetDataTypeAsString()) +
"`.");
286 inputData, scalarArray, scalarArrayIdx, getGlobalOrder, orderArray,
287 triangulation, enforceOrderArrayIdx);
293 this->
printErr(
"Unable to retrieve input scalar array for idx "
294 + std::to_string(scalarArrayIdx) +
".");
296 }
else if(isValidOrderArray(scalarArray) == 1) {
297 this->
printMsg(
"Retrieved scalar array `"
298 + std::string(scalarArray->GetName())
299 +
"` is already an order array.",
304 auto orderArray = inputData
305 ->GetAttributesAsFieldData(this->GetInputArrayAssociation(
306 scalarArrayIdx, inputData))
309 switch(isValidOrderArray(orderArray)) {
313 this->
printWrn(
"No pre-existing order for array:");
314 this->
printWrn(
" `" + std::string(scalarArray->GetName()) +
"`.");
322 getGlobalOrder, orderArray, triangulation);
324 std::string optionOn =
"";
327 optionOn =
"with GlobalOrder enabled ";
329 bool isGlobalOrder = getGlobalOrder || (!ttk::isRunningWithMPI());
330 triangulation->setIsOrderArrayGlobal(
334 this->threadNumber_);
337 this->
printWrn(
"TIP: run `ttkArrayPreconditioning` first");
338 this->
printWrn(optionOn +
"for improved performances :)");
346 "Retrieved order array `" + std::string(orderArray->GetName())
347 +
"` for scalar array `" + std::string(scalarArray->GetName())
348 +
"` has more than one component.");
354 "Retrieved order array `" + std::string(orderArray->GetName())
355 +
"` for scalar array `" + std::string(scalarArray->GetName())
356 +
"` is of incorrect type.");
358 this->
printErr(
" -> use `ttkArrayEditor` to convert data type to `"
359 + std::string(temp->GetDataTypeAsString()) +
"`.");
365 if(!ttk::isRunningWithMPI()) {
367 this->
printMsg(
"Retrieved order array `"
368 + std::string(orderArray->GetName())
369 +
"` for scalar array `"
370 + std::string(scalarArray->GetName()) +
"`.",
376 inputData, scalarArray, scalarArrayIdx, getGlobalOrder, orderArray,
377 triangulation, enforceOrderArrayIdx);
385 const int &arrayIndex,
386 const std::string &arrayName,
387 vtkDataSet *
const inputData,
388 std::vector<ttk::SimplexId> &spareStorage,
394 enforceArrayIndex, arrayIndex, arrayName, inputData, inputPort);
395 if(array ==
nullptr) {
397 this->
printErr(
"Could not find the requested identifiers array");
401 if(array->GetNumberOfComponents() != 1) {
403 this->
printErr(
"Identifiers field must have only one component!");
408#ifndef TTK_ENABLE_64BIT_IDS
409 if(array->GetDataType() == VTK_ID_TYPE
410 || array->GetDataType() == VTK_LONG_LONG) {
412 "Converting identifiers field from vtkIdType to SimplexId...");
413 const auto nItems = array->GetNumberOfTuples();
417 spareStorage.resize(nItems);
418 for(vtkIdType i = 0; i < nItems; ++i) {
419 spareStorage[i] =
static_cast<ttk::SimplexId>(array->GetTuple1(i));
423 return spareStorage.data();
433template <
class vtkDataType>
434int prepOutput(vtkInformation *info,
const std::string &className) {
435 auto output = vtkDataObject::GetData(info);
436 if(!output || !output->IsA(className.data())) {
438 info->Set(vtkDataObject::DATA_OBJECT(), newOutput);
448 return vtkDataSet::SafeDownCast(this->GetOutputDataObject(port));
456 this->SetInputDataInternal(index, input);
464 this->AddInputDataInternal(index, input);
468 vtkInformationVector **inputVector,
469 vtkInformationVector *outputVector) {
471 for(
int i = 0; i < this->GetNumberOfOutputPorts(); ++i) {
472 auto outInfo = outputVector->GetInformationObject(i);
474 this->
printErr(
"Unable to retrieve output vtkDataObject at port "
475 + std::to_string(i));
479 auto outputPortInfo = this->GetOutputPortInformation(i);
483 this->
printErr(
"Unable to fill output port information at port "
484 + std::to_string(i));
492 if(inPortIndex < 0 || inPortIndex >= this->GetNumberOfInputPorts()) {
493 this->
printErr(
"Input port index " + std::to_string(inPortIndex)
494 +
" specified by 'SAME_DATA_TYPE_AS_INPUT_PORT' key of "
495 "output port is out of range ("
496 + std::to_string(this->GetNumberOfInputPorts())
500 auto inInfo = inputVector[inPortIndex]->GetInformationObject(0);
503 "No information object at port " + std::to_string(inPortIndex)
504 +
" specified by 'SAME_DATA_TYPE_AS_INPUT_PORT' key of output port.");
508 auto input = vtkDataObject::GetData(inInfo);
509 auto output = vtkDataObject::GetData(outInfo);
511 if(!output || !output->IsA(input->GetClassName())) {
515 vtkDataObject::DATA_TYPE_NAME(), input->GetClassName());
516 outInfo->Set(vtkDataObject::DATA_OBJECT(), newOutput);
520 if(!outputPortInfo->Has(vtkDataObject::DATA_TYPE_NAME())) {
521 this->
printErr(
"DATA_TYPE_NAME of output port " + std::to_string(i)
525 std::string
const outputType
526 = outputPortInfo->Get(vtkDataObject::DATA_TYPE_NAME());
528 if(outputType ==
"vtkUnstructuredGrid") {
530 }
else if(outputType ==
"vtkPolyData") {
532 }
else if(outputType ==
"vtkMultiBlockDataSet") {
534 }
else if(outputType ==
"vtkTable") {
536 }
else if(outputType ==
"vtkImageData") {
539 this->
printErr(
"Unsupported data type for output[" + std::to_string(i)
540 +
"]: " + outputType);
547 + std::string(outputPortInfo->Get(vtkDataObject::DATA_TYPE_NAME()))
548 +
"' at output port " + std::to_string(i),
557int ttkAlgorithm::updateMPICommunicator(vtkDataSet *input) {
558 if(input ==
nullptr) {
562 = input->GetNumberOfCells() == 0 || input->GetNumberOfPoints() == 0;
565 MPI_Comm_split(MPI_COMM_WORLD, isEmpty, 0, &ttk::MPIcomm_);
570 MPI_Allgather(&oldRank, 1, MPI_INTEGER, newToOldRanks.data(), 1,
571 MPI_INTEGER, ttk::MPIcomm_);
572 std::map<int, int> oldToNewRanks;
574 oldToNewRanks[newToOldRanks[i]] = i;
578 if(vertexRankArray !=
nullptr) {
579 for(
int i = 0; i < input->GetNumberOfPoints(); i++) {
580 vertexRankArray[i] = oldToNewRanks[vertexRankArray[i]];
585 if(cellRankArray !=
nullptr) {
586 for(
int i = 0; i < input->GetNumberOfCells(); i++) {
587 cellRankArray[i] = oldToNewRanks[cellRankArray[i]];
597 unsigned char *ghost,
600 if(rankArray !=
nullptr) {
601#ifdef TTK_ENABLE_OPENMP
602#pragma omp parallel for reduction(+ : ghostNumber)
610 if(ghost !=
nullptr) {
611#ifdef TTK_ENABLE_OPENMP
612#pragma omp parallel for reduction(+ : ghostNumber)
623 auto minmax = std::minmax_element(globalIds, globalIds + simplexNumber);
629 MPI_Allreduce(&realSimplexNumber, &globalSimplexNumber, 1,
630 ttk::getMPIType(realSimplexNumber), MPI_SUM, ttk::MPIcomm_);
632 &min, &globalMin, 1, ttk::getMPIType(min), MPI_MIN, ttk::MPIcomm_);
634 &max, &globalMax, 1, ttk::getMPIType(max), MPI_MAX, ttk::MPIcomm_);
636 return (globalSimplexNumber == globalMax + 1 && globalMin == 0);
641 std::unordered_map<ttk::SimplexId, ttk::SimplexId> &vertGtoL,
642 std::vector<int> &neighborRanks,
643 std::map<int, int> &neighborsToId) {
645 ttk::Identifiers identifiers;
647 vtkNew<vtkIdTypeArray> vtkVertexIdentifiers{};
649 vtkNew<vtkIdTypeArray> vtkCellIdentifiers{};
650 vtkVertexIdentifiers->SetName(
"GlobalPointIds");
651 vtkVertexIdentifiers->SetNumberOfComponents(1);
652 vtkVertexIdentifiers->SetNumberOfTuples(input->GetNumberOfPoints());
653 vtkVertexIdentifiers->Fill(-1);
658 vtkCellIdentifiers->SetName(
"GlobalCellIds");
659 vtkCellIdentifiers->SetNumberOfComponents(1);
660 vtkCellIdentifiers->SetNumberOfTuples(input->GetNumberOfCells());
661 vtkCellIdentifiers->Fill(-1);
666 int vertexNumber = input->GetNumberOfPoints();
668 int cellNumber = input->GetNumberOfCells();
672 double *boundingBox = input->GetBounds();
673 identifiers.setBounds(boundingBox);
674 identifiers.initializeNeighbors(boundingBox, neighborRanks, neighborsToId);
675 if(ttk::isRunningWithMPI()) {
676 switch(input->GetDataObjectType()) {
677 case VTK_UNSTRUCTURED_GRID:
678 case VTK_POLY_DATA: {
680 identifiers.setOutdatedGlobalPointIds(
682 input->GetPointData()->GetGlobalIds()));
683 identifiers.setOutdatedGlobalCellIds(
685 input->GetCellData()->GetGlobalIds()));
687 input->GetPointData()->GetArray(
"RankArray")));
689 input->GetCellData()->GetArray(
"RankArray"));
690 identifiers.setCellRankArray(cellRankArray);
692 input->GetPointData()->GetArray(
"vtkGhostType")));
694 input->GetCellData()->GetArray(
"vtkGhostType"));
695 identifiers.setCellGhost(cellGhost);
696 vtkPointSet *pointSet = vtkPointSet::SafeDownCast(input);
697 identifiers.setPointSet(
static_cast<float *
>(
699 vtkCellArray *cells =
nullptr;
700 switch(input->GetDataObjectType()) {
701 case VTK_UNSTRUCTURED_GRID: {
702 auto dataSetAsUG = vtkUnstructuredGrid::SafeDownCast(input);
703 cells = dataSetAsUG->GetCells();
706 case VTK_POLY_DATA: {
707 auto dataSetAsPD = vtkPolyData::SafeDownCast(input);
709 = dataSetAsPD->GetNumberOfPolys() > 0 ? dataSetAsPD->GetPolys()
710 : dataSetAsPD->GetNumberOfLines() > 0 ? dataSetAsPD->GetLines()
711 : dataSetAsPD->GetVerts();
715 this->
printErr(
"Unable to get cells for `"
716 + std::string(input->GetClassName()) +
"`");
719 if(cells ==
nullptr) {
722 if(!cells->IsStorage64Bit()) {
723 if(cells->CanConvertTo64BitStorage()) {
724 this->
printWrn(
"Converting the cell array to 64-bit storage");
725 bool success = cells->ConvertTo64BitStorage();
728 "Error converting the provided cell array to 64-bit storage");
733 "Cannot convert the provided cell array to 64-bit storage");
739 cells->GetConnectivityArray()));
741 std::vector<std::vector<ttk::SimplexId>> pointsToCells(vertexNumber);
742 vtkIdList *cellList = vtkIdList::New();
743 if(cellRankArray !=
nullptr) {
745 input->GetPointCells(i, cellList);
746 for(
int j = 0; j < cellList->GetNumberOfIds(); j++) {
748 pointsToCells[i].push_back(cellList->GetId(j));
754 input->GetPointCells(i, cellList);
755 for(
int j = 0; j < cellList->GetNumberOfIds(); j++) {
756 if(cellGhost[cellList->GetId(j)] == 0) {
757 pointsToCells[i].push_back(cellList->GetId(j));
762 identifiers.setPointsToCells(pointsToCells);
764 identifiers.initializeMPITypes();
765 identifiers.setVertGtoL(&vertGtoL);
766 vtkIdList *pointCell = vtkIdList::New();
767 input->GetCellPoints(0, pointCell);
768 int nbPoints = pointCell->GetNumberOfIds();
769 identifiers.setDomainDimension(nbPoints - 1);
770 identifiers.buildKDTree();
771 status = identifiers.executePolyData();
774 case VTK_IMAGE_DATA: {
775 vtkImageData *data = vtkImageData::SafeDownCast(input);
776 identifiers.setDims(data->GetDimensions());
777 identifiers.setSpacing(data->GetSpacing());
778 status = identifiers.executeImageData();
782 this->
printErr(
"Unable to triangulate `"
783 + std::string(input->GetClassName()) +
"`");
791 printErr(
"Global identifier generation failed");
797 input->GetPointData()->SetGlobalIds(vtkVertexIdentifiers);
798 input->GetCellData()->SetGlobalIds(vtkCellIdentifiers);
804 vtkNew<vtkGhostCellsGenerator> generator;
805 if(ttk::isRunningWithMPI()
806 && (!input->HasAnyGhostCells()
807 && ((input->GetPointData()->GetArray(
"RankArray") ==
nullptr)
808 || (input->GetCellData()->GetArray(
"RankArray") ==
nullptr)))) {
809 generator->SetInputData(input);
810 generator->BuildIfRequiredOff();
811 generator->SetNumberOfGhostLayers(1);
813 input->ShallowCopy(generator->GetOutputDataObject(0));
814 input->GetPointData()->AddArray(
815 generator->GetOutputDataObject(0)->GetGhostArray(0));
816 input->GetCellData()->AddArray(
817 generator->GetOutputDataObject(0)->GetGhostArray(1));
823 std::vector<int> &neighbors,
824 std::map<int, int> &neighToId,
830 if((input->GetDataObjectType() == VTK_POLY_DATA
831 || input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID)) {
833 if((ttk::hasInitializedMPI()) && (ttk::isRunningWithMPI())) {
835 printWrn(
"The distribution by VTK of Unstructured");
836 printWrn(
"Grids and Poly Data has been reported");
837 printWrn(
"to be affected by bugs (at least up");
840 if((input->GetCellData()->GetGlobalIds() ==
nullptr)
841 || (input->GetPointData()->GetGlobalIds() ==
nullptr)) {
843 printWrn(
"=> Global identifiers may be incorrect.");
845 if((input->GetPointData()->GetArray(
"RankArray") ==
nullptr)
846 || (input->GetCellData()->GetArray(
"RankArray") ==
nullptr)) {
847 printWrn(
"=> Rank arrays may be incorrect.");
854 std::vector<int> &neighborRanks{
855 triangulation !=
nullptr ? triangulation->getNeighborRanks() : neighbors};
856 std::map<int, int> &neighborsToId{
857 triangulation !=
nullptr ? triangulation->getNeighborsToId() : neighToId};
859 double *boundingBox = input->GetBounds();
860 if(triangulation !=
nullptr) {
861 triangulation->createMetaGrid(boundingBox);
864 if(neighborRanks.empty()) {
865 ttk::preconditionNeighborsUsingBoundingBox(
866 boundingBox, neighborRanks, neighborsToId);
871 input->GetPointData()->GetGlobalIds());
873 input->GetCellData()->GetGlobalIds());
875 bool pointValidity{
false};
876 bool cellValidity{
false};
877 if((triangulation !=
nullptr
880 || triangulation ==
nullptr) {
881 if(globalPointIds !=
nullptr) {
883 input->GetPointData()->GetArray(
"vtkGhostType"));
885 input->GetPointData()->GetArray(
"RankArray"));
887 globalPointIds, vertexNumber, ghostPoints, vertexRankArray);
889 if(pointValidity && globalCellIds !=
nullptr) {
892 input->GetCellData()->GetArray(
"vtkGhostType"));
894 input->GetCellData()->GetArray(
"RankArray"));
896 globalCellIds, cellNumber, ghostCells, cellRankArray);
899 pointValidity =
true;
904 if(!pointValidity || !cellValidity) {
905 if(triangulation !=
nullptr) {
909 neighborRanks, neighborsToId);
912 std::unordered_map<ttk::SimplexId, ttk::SimplexId> vertGtoL{};
921 const auto pd{input->GetPointData()};
923 triangulation->
printWrn(
"No point data on input object");
927 triangulation->setVertsGlobalIds(
929 triangulation->setVertexGhostArray(
932 if(vertexRankArray !=
nullptr) {
933 triangulation->setVertexRankArray(vertexRankArray);
935 triangulation->preconditionDistributedVertices();
938 const auto cd{input->GetCellData()};
940 triangulation->
printWrn(
"No cell data on input object");
944 triangulation->setCellsGlobalIds(
946 triangulation->setCellGhostArray(
949 if(cellRankArray !=
nullptr) {
950 triangulation->setCellRankArray(cellRankArray);
952 triangulation->preconditionDistributedCells();
960 vtkInformationVector **inputVector,
961 vtkInformationVector *outputVector) {
963 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA_OBJECT())) {
970 if(request->Has(vtkCompositeDataPipeline::REQUEST_INFORMATION())) {
977 if(request->Has(vtkCompositeDataPipeline::REQUEST_UPDATE_TIME())) {
985 vtkCompositeDataPipeline::REQUEST_TIME_DEPENDENT_INFORMATION())) {
986 this->
printMsg(
"Processing REQUEST_TIME_DEPENDENT_INFORMATION",
989 request, inputVector, outputVector);
993 if(request->Has(vtkCompositeDataPipeline::REQUEST_UPDATE_EXTENT())) {
1000 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA_NOT_GENERATED())) {
1007 if(request->Has(vtkCompositeDataPipeline::REQUEST_DATA())) {
1010#ifdef TTK_ENABLE_MPI
1011 if(ttk::hasInitializedMPI() && inputVector !=
nullptr) {
1012 if(this->updateMPICommunicator(vtkDataSet::GetData(inputVector[0], 0))) {
1017 return this->
RequestData(request, inputVector, outputVector);
1020 this->
printErr(
"Unsupported pipeline pass:");
1021 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)