From cc025fd228db96cebbf5e3af37e41675148529c2 Mon Sep 17 00:00:00 2001 From: David Gobbi Date: Fri, 10 Mar 2023 11:45:49 -0700 Subject: [PATCH 01/18] Fix Java build error for templated parameters The Java wrappers were not blocking templated parameters, even though they are unable to wrap them. This resulted in build errors for methods like this one: void AddArray(vtkAOSDataArrayTemplate* array); The fix for these build errors is to reject all methods with parameter types that include "<" as part of their name. --- Wrapping/Tools/vtkParseJava.c | 6 ++++++ Wrapping/Tools/vtkWrapJava.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Wrapping/Tools/vtkParseJava.c b/Wrapping/Tools/vtkParseJava.c index 5a675fbbe091..ad6aab2fe640 100644 --- a/Wrapping/Tools/vtkParseJava.c +++ b/Wrapping/Tools/vtkParseJava.c @@ -475,6 +475,12 @@ static int isClassWrapped(const char* classname) return 0; } + /* Templated classes are not wrapped in Java */ + if (strchr(classname, '<')) + { + return 0; + } + /* Only the primary class in the header is wrapped in Java */ return vtkParseHierarchy_IsPrimary(entry); } diff --git a/Wrapping/Tools/vtkWrapJava.c b/Wrapping/Tools/vtkWrapJava.c index fdf3fb5dd104..09e55fd1c7e9 100644 --- a/Wrapping/Tools/vtkWrapJava.c +++ b/Wrapping/Tools/vtkWrapJava.c @@ -924,6 +924,12 @@ static int isClassWrapped(const char* classname) } } + /* Templated classes are not wrapped in Java */ + if (strchr(classname, '<')) + { + return 0; + } + return 1; } -- GitLab From 44c624698c281cb8cc6487de6f548c481ad24524 Mon Sep 17 00:00:00 2001 From: Nicolas Vuaille Date: Wed, 29 Mar 2023 10:01:54 +0200 Subject: [PATCH 02/18] Numpy append array: Document and warn Improve documentation about `dataset_adaptor.append(array, name)` method. Specially, specify two cases of `array`: * shape[0] is matching number of elements so `array` is used "as is" * otherwise `array` is **copied** at each index of a `newarray`, where `newarray.shape[0]` is the number of element In the second case, numpy may throw a `MemoryException` because of a too big memory requirement. Handle this to add explanation about the `shape` expectation. --- .../numpy_interface/dataset_adapter.py | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/Wrapping/Python/vtkmodules/numpy_interface/dataset_adapter.py b/Wrapping/Python/vtkmodules/numpy_interface/dataset_adapter.py index 98df559c67cb..db8c3b2d2555 100644 --- a/Wrapping/Python/vtkmodules/numpy_interface/dataset_adapter.py +++ b/Wrapping/Python/vtkmodules/numpy_interface/dataset_adapter.py @@ -629,7 +629,10 @@ class VTKCompositeDataArray(object): class DataSetAttributes(VTKObjectWrapper): """This is a python friendly wrapper of vtkDataSetAttributes. It - returns VTKArrays. It also provides the dictionary interface.""" + returns VTKArrays. It also provides the dictionary interface. + Note that the stored array should have a shape that matches the number + of elements. E.g. for a PointData, narray.shape[0] should be equal + to dataset.GetNumberOfPoints()""" def __init__(self, vtkobject, dataset, association): super(DataSetAttributes, self).__init__(vtkobject) @@ -684,7 +687,14 @@ class DataSetAttributes(VTKObjectWrapper): self.VTKObject.PassData(other.VTKObject) def append(self, narray, name): - """Appends a new array to the dataset attributes.""" + """Appends narray to the dataset attributes. + + If narray is a scalar, create an array with this scalar for each element. + If narray is an array with a size not matching the array association + (e.g. size should be equal to GetNumberOfPoints() for PointData), + copy the input narray for each element. This is intended to ease + initialization, typically using same 3d vector for each element. + In any case, be careful about memory explosion.""" if narray is NoneArray: # if NoneArray, nothing to do. return @@ -702,7 +712,8 @@ class DataSetAttributes(VTKObjectWrapper): else: arrLength = narray.shape[0] - # Fixup input array length: + # if input is not a valid array (i.e. unexpected shape[0]), + # create a new array and copy input for each element if not isinstance(narray, numpy.ndarray) or numpy.ndim(narray) == 0: # Scalar input dtype = narray.dtype if isinstance(narray, numpy.ndarray) else type(narray) tmparray = numpy.empty(arrLength, dtype=dtype) @@ -712,7 +723,19 @@ class DataSetAttributes(VTKObjectWrapper): components = 1 for l in narray.shape: components *= l - tmparray = numpy.empty((arrLength, components), dtype=narray.dtype) + try: + tmparray = numpy.empty((arrLength, components), dtype=narray.dtype) + except numpy.core._exceptions._ArrayMemoryError as npErr: + sys.stderr.write("Fail to copy input array for each dataset element: array is too big to be duplicated.\n" + "Input should either be small enough to be duplicated for each element, or shape[0] should " + "match number of element.\n" + "Example of correct usage: to add a point PointData array, it is common to have\n" + "array.shape[0] == 3 or array.shape[0] == dataset.GetNumberOfPoints()\n" + ) + sys.stderr.write(str(type(npErr)) + "\n") + sys.stderr.write(str(npErr)) + return + tmparray[:] = narray.flatten() narray = tmparray -- GitLab From 5c4417410788dd8fd7a50fbe6ed715c97edda1c9 Mon Sep 17 00:00:00 2001 From: Bengt Rosenberger Date: Tue, 22 Nov 2022 02:05:13 +0100 Subject: [PATCH 03/18] Fix #18722: vtkUnstructuredGrid::ShallowCopy creates connectivity if needed Made vtkUnstructuredGrid::ShallowCopy check and create internal arrays as necessary if input is a vtkUnstructuredGridBase --- Common/DataModel/vtkUnstructuredGrid.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Common/DataModel/vtkUnstructuredGrid.cxx b/Common/DataModel/vtkUnstructuredGrid.cxx index 3c3587a2fed3..13975238c2cd 100644 --- a/Common/DataModel/vtkUnstructuredGrid.cxx +++ b/Common/DataModel/vtkUnstructuredGrid.cxx @@ -1959,6 +1959,13 @@ void vtkUnstructuredGrid::ShallowCopy(vtkDataObject* dataObject) } else if (vtkUnstructuredGridBase* ugb = vtkUnstructuredGridBase::SafeDownCast(dataObject)) { + bool isNewAlloc = false; + if (!this->Connectivity || !this->Types) + { + this->AllocateEstimate(ugb->GetNumberOfCells(), ugb->GetMaxCellSize()); + isNewAlloc = true; + } + // The source object has vtkUnstructuredGrid topology, but a different // cell implementation. Deep copy the cells, and shallow copy the rest: vtkSmartPointer cellIter = @@ -1969,6 +1976,11 @@ void vtkUnstructuredGrid::ShallowCopy(vtkDataObject* dataObject) cellIter->GetPointIds()->GetPointer(0), cellIter->GetNumberOfFaces(), cellIter->GetFaces()->GetPointer(1)); } + + if (isNewAlloc) + { + this->Squeeze(); + } } this->Superclass::ShallowCopy(dataObject); -- GitLab From e7466dc374f9b059d53a1288e255ab44749dec39 Mon Sep 17 00:00:00 2001 From: Bengt Rosenberger Date: Tue, 22 Nov 2022 17:47:39 +0100 Subject: [PATCH 04/18] Add vtkMappedUnstructuredGrid to vtkUnstructuredGrid shallow copy unit test Tests vtkUnstructuredGrid::ShallowCopy with a vtkMappedUnstructuredGrid source and simulates pipeline execution where executives calls vtkUnstructuredGrid::Initialize before copy. --- CMake/VTKcppcheckSuppressions.txt | 1 + Common/DataModel/Testing/Cxx/CMakeLists.txt | 1 + .../Testing/Cxx/TestMappedGridShallowCopy.cxx | 128 ++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx diff --git a/CMake/VTKcppcheckSuppressions.txt b/CMake/VTKcppcheckSuppressions.txt index 120273a6a10d..e3dd4270b91a 100644 --- a/CMake/VTKcppcheckSuppressions.txt +++ b/CMake/VTKcppcheckSuppressions.txt @@ -89,6 +89,7 @@ uninitMemberVar:*/Charts/Core/vtkScatterPlotMatrix.cxx uninitMemberVar:*/Common/ComputationalGeometry/vtkParametricEllipsoid.cxx uninitMemberVar:*/Common/ComputationalGeometry/vtkParametricSpline.cxx uninitMemberVar:*/Common/DataModel/Testing/Cxx/TestMappedGridDeepCopy.cxx +uninitMemberVar:*/Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx uninitMemberVar:*/Common/DataModel/vtkAbstractCellLocator.cxx uninitMemberVar:*/Common/DataModel/vtkAttributesErrorMetric.cxx uninitMemberVar:*/Common/DataModel/vtkBiQuadraticQuad.cxx diff --git a/Common/DataModel/Testing/Cxx/CMakeLists.txt b/Common/DataModel/Testing/Cxx/CMakeLists.txt index fd2ed5074ce2..143e34aa044f 100644 --- a/Common/DataModel/Testing/Cxx/CMakeLists.txt +++ b/Common/DataModel/Testing/Cxx/CMakeLists.txt @@ -45,6 +45,7 @@ vtk_add_test_cxx(vtkCommonDataModelCxxTests tests TestInterpolationDerivs.cxx TestInterpolationFunctions.cxx TestMappedGridDeepCopy.cxx + TestMappedGridShallowCopy.cxx TestPath.cxx TestPentagonalPrism.cxx TestPiecewiseFunction.cxx diff --git a/Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx b/Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx new file mode 100644 index 000000000000..51f78937e137 --- /dev/null +++ b/Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx @@ -0,0 +1,128 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: TestMappedGridShallowCopy + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*---------------------------------------------------------------------------- + This test was written by Bengt Rosenberger. +----------------------------------------------------------------------------*/ + +#include "vtkCell.h" // for cell types +#include "vtkCellData.h" +#include "vtkCellIterator.h" +#include "vtkDataArray.h" +#include "vtkDebugLeaks.h" +#include "vtkDoubleArray.h" +#include "vtkIdList.h" +#include "vtkIdTypeArray.h" +#include "vtkInformation.h" +#include "vtkIntArray.h" +#include "vtkMappedUnstructuredGridGenerator.h" +#include "vtkNew.h" +#include "vtkPointData.h" +#include "vtkPoints.h" +#include "vtkTestUtilities.h" +#include "vtkUnstructuredGrid.h" +#include "vtkXMLUnstructuredGridReader.h" +#include "vtkXMLUnstructuredGridWriter.h" + +#include +#include + +int TestMappedGridShallowCopy(int vtkNotUsed(argc), char*[] vtkNotUsed(argv)) +{ + vtkUnstructuredGridBase* original; + vtkMappedUnstructuredGridGenerator::GenerateMappedUnstructuredGrid(&original); + + // This simulates the executive calling vtkUnstructuredGrid::Initialize + // when preparing an algorithm output + vtkUnstructuredGrid* copy = vtkUnstructuredGrid::New(); + copy->Initialize(); + + // Make sure shallow copy succeeds after call to Initialize + copy->ShallowCopy(original); + + // Compare number of points + if (copy->GetNumberOfPoints() != original->GetNumberOfPoints()) + { + cerr << "Number of points do not match" << endl; + return EXIT_FAILURE; + } + + // Compare number of cells + if (copy->GetNumberOfCells() != original->GetNumberOfCells()) + { + cerr << "Number of cells do not match" << endl; + return EXIT_FAILURE; + } + + // Comparison code below taken from TestMappedGridDeepCopy.cxx + vtkCellIterator* oIt = original->NewCellIterator(); + vtkCellIterator* cIt = copy->NewCellIterator(); + + vtkNew orig, copied; + for (cIt->InitTraversal(), oIt->InitTraversal(); + !cIt->IsDoneWithTraversal() && !oIt->IsDoneWithTraversal(); + cIt->GoToNextCell(), oIt->GoToNextCell()) + { + oIt->GetCell(orig.GetPointer()); + cIt->GetCell(copied.GetPointer()); + + if (cIt->GetCellType() != oIt->GetCellType()) + { + cerr << "Cell types do not match" << endl; + return EXIT_FAILURE; + } + + if (cIt->GetCellType() == VTK_POLYHEDRON) + { + vtkIdList* oFaces = oIt->GetFaces(); + vtkIdList* cFaces = cIt->GetFaces(); + + if (cFaces->GetNumberOfIds() != oFaces->GetNumberOfIds()) + { + cerr << "Face id list length does not match" << endl; + cerr << "Original: "; + for (vtkIdType i = 0; i < oFaces->GetNumberOfIds(); ++i) + { + cerr << oFaces->GetId(i) << " "; + } + cerr << endl; + + cerr << "Copied: "; + for (vtkIdType i = 0; i < cFaces->GetNumberOfIds(); ++i) + cerr << cFaces->GetId(i) << " "; + cerr << endl; + + return EXIT_FAILURE; + } + + for (vtkIdType i = 0; i < cFaces->GetNumberOfIds(); ++i) + { + vtkIdType c = cFaces->GetId(i); + vtkIdType o = oFaces->GetId(i); + + if (c != o) + { + cerr << "Face id list content does not match at" << i << endl; + return EXIT_FAILURE; + } + } + } + } + oIt->Delete(); + cIt->Delete(); + + original->Delete(); + copy->Delete(); + return EXIT_SUCCESS; +} -- GitLab From 3b4544311ce8d499f53d95e4d6ac8bda0f80614f Mon Sep 17 00:00:00 2001 From: Bengt Rosenberger Date: Tue, 22 Nov 2022 18:05:00 +0100 Subject: [PATCH 05/18] Add proper comment with test code origin Wanted to make clear I took that test from TestMappedGridDeepCopy and didn't entirely write it myself. --- Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx b/Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx index 51f78937e137..0f89f338e94c 100644 --- a/Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx +++ b/Common/DataModel/Testing/Cxx/TestMappedGridShallowCopy.cxx @@ -13,7 +13,7 @@ =========================================================================*/ /*---------------------------------------------------------------------------- - This test was written by Bengt Rosenberger. + This was taken from TestMappedGridDeepCopy and modified by Bengt Rosenberger. ----------------------------------------------------------------------------*/ #include "vtkCell.h" // for cell types -- GitLab From c86c1b17a2fedfe5079209bae8c5847be9637fa4 Mon Sep 17 00:00:00 2001 From: Lucas Givord Date: Thu, 13 Apr 2023 14:12:34 +0200 Subject: [PATCH 06/18] vtkPartitionedDataSet: add field data support for legacy reader/writer Previously, theses legacy reader/writer didn't support field data for some composite data structure like vtkPartitionedDataSet. As it is use by extractor, field data was lost during a catalyst simulation for example. --- ...stLegacyPartitionedDataSetReaderWriter.cxx | 27 +++++++++++++------ IO/Legacy/vtkCompositeDataReader.cxx | 13 ++++----- IO/Legacy/vtkCompositeDataWriter.cxx | 8 +++++- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/IO/Legacy/Testing/Cxx/TestLegacyPartitionedDataSetReaderWriter.cxx b/IO/Legacy/Testing/Cxx/TestLegacyPartitionedDataSetReaderWriter.cxx index 3876ff364ecd..89abd3268591 100644 --- a/IO/Legacy/Testing/Cxx/TestLegacyPartitionedDataSetReaderWriter.cxx +++ b/IO/Legacy/Testing/Cxx/TestLegacyPartitionedDataSetReaderWriter.cxx @@ -1,11 +1,13 @@ - -#include -#include -#include -#include -#include -#include -#include +#include "vtkFieldData.h" +#include "vtkFloatArray.h" +#include "vtkGenericDataObjectReader.h" +#include "vtkGenericDataObjectWriter.h" +#include "vtkInformation.h" +#include "vtkLogger.h" +#include "vtkMappedUnstructuredGridGenerator.h" +#include "vtkNew.h" +#include "vtkPartitionedDataSet.h" +#include "vtkUnstructuredGrid.h" int TestLegacyPartitionedDataSetReaderWriter(int, char*[]) { @@ -13,8 +15,15 @@ int TestLegacyPartitionedDataSetReaderWriter(int, char*[]) vtkMappedUnstructuredGridGenerator::GenerateUnstructuredGrid(&unstructuredGrid1); vtkMappedUnstructuredGridGenerator::GenerateUnstructuredGrid(&unstructuredGrid2); + // Add field data to check if we keep it in the output of the after writer/reader + vtkNew fieldArray; + fieldArray->SetName("fieldArray"); + fieldArray->SetNumberOfTuples(1); + fieldArray->SetTuple1(0, 3.14); + vtkNew partitionedDS; partitionedDS->SetNumberOfPartitions(4); + partitionedDS->GetFieldData()->AddArray(fieldArray); partitionedDS->SetPartition(0, unstructuredGrid1); partitionedDS->SetPartition(3, unstructuredGrid2); @@ -76,6 +85,8 @@ int TestLegacyPartitionedDataSetReaderWriter(int, char*[]) "Expected 1 metadata key n partition index 0"); vtkLogIf(ERROR, 1 != readDS->GetMetaData(0u)->GetNumberOfKeys(), "Expected 1 metadata key n partition index 3"); + vtkLogIf(ERROR, 1 != readDS->GetFieldData()->HasArray("fieldArray"), + "Expected result data to have a field data on partition-index 0"); unstructuredGrid1->Delete(); unstructuredGrid2->Delete(); diff --git a/IO/Legacy/vtkCompositeDataReader.cxx b/IO/Legacy/vtkCompositeDataReader.cxx index 9e23ba80800a..1fe0702c6d81 100644 --- a/IO/Legacy/vtkCompositeDataReader.cxx +++ b/IO/Legacy/vtkCompositeDataReader.cxx @@ -217,6 +217,13 @@ int vtkCompositeDataReader::ReadMeshSimple(const std::string& fname, vtkDataObje this->ReadCompositeData(pdc); } + // Try to read field data for each data type + if (this->ReadString(line) && strncmp(this->LowerCase(line), "field", 5) == 0) + { + vtkSmartPointer fd = vtkSmartPointer::Take(this->ReadFieldData()); + output->SetFieldData(fd); + } + return 1; } @@ -287,12 +294,6 @@ bool vtkCompositeDataReader::ReadCompositeData(vtkMultiBlockDataSet* mb) } } - if (this->ReadString(line) && strncmp(this->LowerCase(line), "field", 5) == 0) - { - vtkSmartPointer fd = vtkSmartPointer::Take(this->ReadFieldData()); - mb->SetFieldData(fd); - } - return true; } diff --git a/IO/Legacy/vtkCompositeDataWriter.cxx b/IO/Legacy/vtkCompositeDataWriter.cxx index c4ea6f5305b1..6ce580f193ce 100644 --- a/IO/Legacy/vtkCompositeDataWriter.cxx +++ b/IO/Legacy/vtkCompositeDataWriter.cxx @@ -157,6 +157,13 @@ void vtkCompositeDataWriter::WriteData() vtkErrorMacro("Unsupported input type: " << input->GetClassName()); } + // Try to write field data + vtkFieldData* fieldData = input->GetFieldData(); + if (fieldData) + { + this->WriteFieldData(fp, fieldData); + } + this->CloseVTKFile(fp); } @@ -184,7 +191,6 @@ bool vtkCompositeDataWriter::WriteCompositeData(ostream* fp, vtkMultiBlockDataSe *fp << "ENDCHILD\n"; } - this->WriteFieldData(fp, mb->GetFieldData()); return true; } -- GitLab From 815c8f9da0215b362338265e5e623a51512f039d Mon Sep 17 00:00:00 2001 From: Bernhard Froehler Date: Tue, 11 Apr 2023 12:25:18 +0200 Subject: [PATCH 07/18] OpenVR: Never ignore VREvent_Quit --- Rendering/OpenVR/vtkOpenVRRenderWindowInteractor.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Rendering/OpenVR/vtkOpenVRRenderWindowInteractor.cxx b/Rendering/OpenVR/vtkOpenVRRenderWindowInteractor.cxx index fb8c2ed73753..a668a314bfed 100644 --- a/Rendering/OpenVR/vtkOpenVRRenderWindowInteractor.cxx +++ b/Rendering/OpenVR/vtkOpenVRRenderWindowInteractor.cxx @@ -136,6 +136,11 @@ void vtkOpenVRRenderWindowInteractor::DoOneEvent(vtkVRRenderWindow* renWin, vtkR // eat up any pending events while (pHMD->PollNextEvent(&event, sizeof(vr::VREvent_t))) { + if (event.eventType == vr::VREvent_Quit) + { + this->Done = true; + return; + } } } else @@ -145,6 +150,11 @@ void vtkOpenVRRenderWindowInteractor::DoOneEvent(vtkVRRenderWindow* renWin, vtkR // process all pending events while (result) { + if (event.eventType == vr::VREvent_Quit) + { + this->Done = true; + return; + } result = pHMD->PollNextEvent(&event, sizeof(vr::VREvent_t)); } -- GitLab From 351d00d80ce8f6d6a03269ef1a373d5641783814 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 4 Apr 2022 12:40:12 +0200 Subject: [PATCH 08/18] openfoam: problem with broadcast sync (fixes #18505) - errors on the root processes would broadcast and return, except there was no corresponding broadcast on the other processes (ie, it would block). - reworked logic to simplify the handling. - misc code cleanup for broadcasts (code style only). - replace memmove with memcpy for broadcasting vtkStringArray contents (guaranteed to be non-overlapping) - remove BroadcastStatus private method (now unneeded) --- IO/Parallel/vtkPOpenFOAMReader.cxx | 420 ++++++++++++++++++----------- IO/Parallel/vtkPOpenFOAMReader.h | 1 - 2 files changed, 256 insertions(+), 165 deletions(-) diff --git a/IO/Parallel/vtkPOpenFOAMReader.cxx b/IO/Parallel/vtkPOpenFOAMReader.cxx index b60e48bd81c5..4343a9205f83 100644 --- a/IO/Parallel/vtkPOpenFOAMReader.cxx +++ b/IO/Parallel/vtkPOpenFOAMReader.cxx @@ -15,6 +15,9 @@ // This class was developed by Takuya Oshima at Niigata University, // Japan (oshima@eng.niigata-u.ac.jp). // +// Mark Olesen (OpenCFD Ltd.) www.openfoam.com +// has provided various bugfixes, improvements, cleanup +// // --------------------------------------------------------------------------- // // Bugs or support questions should be addressed to the discourse forum @@ -396,25 +399,30 @@ void vtkPOpenFOAMReader::SetCaseType(const int t) int vtkPOpenFOAMReader::RequestInformation( vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) { + const bool isRootProc = (this->ProcessId == 0); + const bool isParallel = (this->NumProcesses > 1); + int returnCode = 1; + if (this->CaseType == RECONSTRUCTED_CASE) { - int ret = 1; - if (this->ProcessId == 0) + if (isRootProc) { - ret = this->Superclass::RequestInformation(request, inputVector, outputVector); + returnCode = this->Superclass::RequestInformation(request, inputVector, outputVector); } - if (this->NumProcesses > 1) + + if (isParallel) { - // if there was an error in process 0 abort all processes - this->BroadcastStatus(ret); - if (ret == 0) + this->Controller->Broadcast(&returnCode, 1, 0); + + if (returnCode == 0) { + // Error encountered in process 0 - abort all processes vtkErrorMacro(<< "The master process returned an error."); return 0; } - vtkDoubleArray* timeValues; - if (this->ProcessId == 0) + vtkDoubleArray* timeValues = nullptr; + if (isRootProc) { timeValues = this->Superclass::GetTimeValues(); } @@ -423,16 +431,16 @@ int vtkPOpenFOAMReader::RequestInformation( timeValues = vtkDoubleArray::New(); } this->Controller->Broadcast(timeValues, 0); - if (this->ProcessId != 0) + if (!isRootProc) { this->Superclass::SetTimeInformation(outputVector, timeValues); - timeValues->Delete(); this->Superclass::Refresh = false; + timeValues->Delete(); } - this->GatherMetaData(); // pvserver deadlocks without this } - return ret; + this->GatherMetaData(); + return returnCode; } if (!this->Superclass::FileName || strlen(this->Superclass::FileName) == 0) @@ -473,75 +481,86 @@ int vtkPOpenFOAMReader::RequestInformation( int nProcessorDirs = 0; auto processorDirs = vtkSmartPointer::New(); - vtkStringArray* timeNames; - vtkDoubleArray* timeValues; + vtkStringArray* timeNames = nullptr; + vtkDoubleArray* timeValues = nullptr; - int ret = 1; - if (this->ProcessId == 0) + if (isRootProc) { - // Search and list processor subdirectories - vtkNew dir; - if (!dir->Open(masterCasePath.c_str())) - { - vtkErrorMacro(<< "Cannot open " << masterCasePath); - this->BroadcastStatus(ret = 0); - return 0; - } - - processorDirs = ::ScanForProcessorDirs(dir); - nProcessorDirs = static_cast(processorDirs->GetNumberOfTuples()); - - if (nProcessorDirs) + do { - // Get times from the first processor subdirectory - const std::string procDirName = ::ProcessorDirName(processorDirs, 0); - vtkFoamDebug(<< "First processor dir: " << procDirName << "\n"); + // Search and list processor subdirectories + vtkNew dir; + if (!dir->Open(masterCasePath.c_str())) + { + vtkErrorMacro(<< "Cannot open " << masterCasePath); + returnCode = 0; + break; // Failed + } - auto masterReader = ::NewFoamReader(this); + processorDirs = ::ScanForProcessorDirs(dir); + nProcessorDirs = static_cast(processorDirs->GetNumberOfTuples()); - if (!masterReader->MakeInformationVector(outputVector, procDirName) || - !masterReader->MakeMetaDataAtTimeStep(true)) + if (nProcessorDirs) { - this->BroadcastStatus(ret = 0); - return 0; + // Get times from the first processor subdirectory + const std::string procDirName = ::ProcessorDirName(processorDirs, 0); + vtkFoamDebug(<< "First processor dir: " << procDirName << "\n"); + + auto masterReader = ::NewFoamReader(this); + + if (!masterReader->MakeInformationVector(outputVector, procDirName) || + !masterReader->MakeMetaDataAtTimeStep(true)) + { + returnCode = 0; + break; // Failed + } + this->Superclass::Readers->AddItem(masterReader); + timeNames = masterReader->GetTimeNames(); + timeValues = masterReader->GetTimeValues(); } - this->Superclass::Readers->AddItem(masterReader); - timeNames = masterReader->GetTimeNames(); - timeValues = masterReader->GetTimeValues(); - } - else - { - timeNames = vtkStringArray::New(); - timeValues = vtkDoubleArray::New(); - this->Superclass::SetTimeInformation(outputVector, timeValues); - } - } - else - { - timeNames = vtkStringArray::New(); - timeValues = vtkDoubleArray::New(); + else + { + timeNames = vtkStringArray::New(); + timeValues = vtkDoubleArray::New(); + this->Superclass::SetTimeInformation(outputVector, timeValues); + } + } while (false); // End of process 0 only execution scope } - if (this->NumProcesses > 1) + if (isParallel) { - // if there was an error in process 0 abort all processes - this->BroadcastStatus(ret); - if (ret == 0) + this->Controller->Broadcast(&returnCode, 1, 0); + + if (returnCode == 0) { + // Error encountered in process 0 - abort all processes vtkErrorMacro(<< "The master process returned an error."); - timeValues->Delete(); // don't have to care about process 0 return 0; } + if (!isRootProc) + { + timeNames = vtkStringArray::New(); + timeValues = vtkDoubleArray::New(); + } + this->Controller->Broadcast(processorDirs, 0); this->Controller->Broadcast(timeValues, 0); this->Broadcast(timeNames); - if (this->ProcessId != 0) + if (!isRootProc) { this->Superclass::SetTimeInformation(outputVector, timeValues); } nProcessorDirs = static_cast(processorDirs->GetNumberOfTuples()); } + else + { + if (returnCode == 0) + { + // Error encountered (single process). Nothing to cleanup + return 0; + } + } // Create reader instances for processor subdirectories, // skip first one since it has already been created above @@ -567,10 +586,16 @@ int vtkPOpenFOAMReader::RequestInformation( } // Cleanup - if (this->ProcessId != 0 || (nProcessorDirs == 0)) + if (!isRootProc || (nProcessorDirs == 0)) { - timeNames->Delete(); - timeValues->Delete(); + if (timeNames) + { + timeNames->Delete(); + } + if (timeValues) + { + timeValues->Delete(); + } } this->GatherMetaData(); @@ -579,32 +604,36 @@ int vtkPOpenFOAMReader::RequestInformation( outputVector->GetInformationObject(0)->Set(CAN_HANDLE_PIECE_REQUEST(), 1); - return 1; + return returnCode; } //------------------------------------------------------------------------------ int vtkPOpenFOAMReader::RequestData( vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) { + const bool isRootProc = (this->ProcessId == 0); + const bool isParallel = (this->NumProcesses > 1); + int returnCode = 1; + vtkSmartPointer splitController; vtkInformation* outInfo = outputVector->GetInformationObject(0); auto* output = vtkMultiBlockDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); if (this->CaseType == RECONSTRUCTED_CASE) { - int ret = 1; - if (this->ProcessId == 0) + if (isRootProc) { - ret = this->Superclass::RequestData(request, inputVector, outputVector); + returnCode = this->Superclass::RequestData(request, inputVector, outputVector); } - this->BroadcastStatus(ret); this->GatherMetaData(); - if (this->NumProcesses > 1) + if (isParallel) { + this->Controller->Broadcast(&returnCode, 1, 0); + splitController.TakeReference(this->Controller->PartitionController(1, this->ProcessId)); vtkNew mb; - if (this->ProcessId == 0) + if (isRootProc) { mb->CopyStructure(output); splitController->Broadcast(mb, 0); @@ -615,14 +644,13 @@ int vtkPOpenFOAMReader::RequestData( output->CopyStructure(mb); } } - return ret; + return returnCode; } - int ret = 1; if (this->Superclass::Readers->GetNumberOfItems()) { - int nTimes(0); // Also used for logic - double requestedTimeValue(0); + int nTimes = 0; // Also used for logic + double requestedTimeValue = 0; if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP())) { nTimes = outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); @@ -668,7 +696,7 @@ int vtkPOpenFOAMReader::RequestData( if (append->GetNumberOfInputConnections(0) == 0) { output->Initialize(); - ret = 0; + returnCode = 0; } else { @@ -687,8 +715,8 @@ int vtkPOpenFOAMReader::RequestData( // To do so, we split the controller to broadcast only to the interested // processors (else case below) and avoid useless communication. splitController.TakeReference( - this->Controller->PartitionController(this->ProcessId == 0, this->ProcessId)); - if (this->ProcessId == 0) + this->Controller->PartitionController(isRootProc, this->ProcessId)); + if (isRootProc) { vtkNew mb; mb->CopyStructure(output); @@ -710,19 +738,11 @@ int vtkPOpenFOAMReader::RequestData( this->Superclass::UpdateStatus(); this->MTimeOld = this->GetMTime(); - return ret; -} - -//------------------------------------------------------------------------------ -void vtkPOpenFOAMReader::BroadcastStatus(int& status) -{ - if (this->NumProcesses > 1) - { - this->Controller->Broadcast(&status, 1, 0); - } + return returnCode; } //------------------------------------------------------------------------------ +// Note: includes guard against non-parallel calls void vtkPOpenFOAMReader::GatherMetaData() { if (this->NumProcesses > 1) @@ -740,131 +760,203 @@ void vtkPOpenFOAMReader::GatherMetaData() //------------------------------------------------------------------------------ // Broadcast a vtkStringArray in process 0 to all processes +// Low-level routine without guard against non-parallel calls +// +// Broadcasts a set of nul-char delimited strings which are re-parsed +// into individual entries. void vtkPOpenFOAMReader::Broadcast(vtkStringArray* sa) { - vtkIdType lengths[2]; - if (this->ProcessId == 0) + const bool isRootProc = (this->ProcessId == 0); + + vtkIdType lengths[2]; // A tuple of local count, send length + std::vector contents; + + if (isRootProc) { + //- Get the overall send length lengths[0] = sa->GetNumberOfTuples(); lengths[1] = 0; - for (int strI = 0; strI < sa->GetNumberOfTuples(); strI++) + for (int i = 0; i < lengths[0]; ++i) + { + const std::string& str = sa->GetValue(i); + lengths[1] += static_cast(str.length()) + 1; // Trailing nul-char + } + contents.resize(lengths[1]); // Send buffer + + //- Add content to send (nul-delimited) + char* name = contents.data(); + for (int i = 0; i < lengths[0]; ++i) { - lengths[1] += static_cast(sa->GetValue(strI).length()) + 1; + const std::string& str = sa->GetValue(i); + const int len = static_cast(str.length()) + 1; // Trailing nul-char + memcpy(name, str.c_str(), len); + name += len; } } + this->Controller->Broadcast(lengths, 2, 0); - char* contents = new char[lengths[1]]; - if (this->ProcessId == 0) + + if (!isRootProc) { - for (int strI = 0, idx = 0; strI < sa->GetNumberOfTuples(); strI++) - { - const int len = static_cast(sa->GetValue(strI).length()) + 1; - memmove(contents + idx, sa->GetValue(strI).c_str(), len); - idx += len; - } + contents.resize(lengths[1]); // Recv buffer } - this->Controller->Broadcast(contents, lengths[1], 0); - if (this->ProcessId != 0) + + this->Controller->Broadcast(contents.data(), contents.size(), 0); + + if (!isRootProc) { sa->Initialize(); sa->SetNumberOfTuples(lengths[0]); - for (int strI = 0, idx = 0; strI < lengths[0]; strI++) + + // Walk the set of nul-char delimited strings + const char* name = contents.data(); + for (int i = 0; i < lengths[0]; ++i) { - sa->SetValue(strI, contents + idx); - idx += static_cast(sa->GetValue(strI).length()) + 1; + sa->SetValue(i, name); + const int len = static_cast(sa->GetValue(i).length()) + 1; // Trailing nul-char + name += len; } } - delete[] contents; } //------------------------------------------------------------------------------ // AllGather vtkStringArray from and to all processes -void vtkPOpenFOAMReader::AllGather(vtkStringArray* s) +// Low-level routine without guard against non-parallel calls +// +// Sends/receives a set of nul-char delimited strings which can be re-parsed +// into individual entries. +void vtkPOpenFOAMReader::AllGather(vtkStringArray* sa) { + // Construct a set of nul-char delimited strings to send + + //- Get the overall send length vtkIdType length = 0; - for (int strI = 0; strI < s->GetNumberOfTuples(); strI++) + for (int i = 0; i < sa->GetNumberOfTuples(); ++i) { - length += static_cast(s->GetValue(strI).length()) + 1; + // Include trailing nul-char + length += static_cast(sa->GetValue(i).length()) + 1; } - vtkIdType* lengths = new vtkIdType[this->NumProcesses]; - this->Controller->AllGather(&length, lengths, 1); - vtkIdType totalLength = 0; - vtkIdType* offsets = new vtkIdType[this->NumProcesses]; - for (int procI = 0; procI < this->NumProcesses; procI++) + + //- Add content to send (nul-delimited) + std::vector contents(length); { - offsets[procI] = totalLength; - totalLength += lengths[procI]; + char* name = contents.data(); + for (int i = 0; i < sa->GetNumberOfTuples(); ++i) + { + const int len = static_cast(sa->GetValue(i).length()) + 1; // Trailing nul-char + memcpy(name, sa->GetValue(i).c_str(), len); + name += len; + } } - char *allContents = new char[totalLength], *contents = new char[length]; - for (int strI = 0, idx = 0; strI < s->GetNumberOfTuples(); strI++) + + std::vector lengths(this->NumProcesses); + std::vector offsets(this->NumProcesses); + + this->Controller->AllGather(&length, lengths.data(), 1); + + vtkIdType totalLength = 0; + for (int proci = 0; proci < this->NumProcesses; ++proci) { - const int len = static_cast(s->GetValue(strI).length()) + 1; - memmove(contents + idx, s->GetValue(strI).c_str(), len); - idx += len; + offsets[proci] = totalLength; + totalLength += lengths[proci]; } - this->Controller->AllGatherV(contents, allContents, length, lengths, offsets); - delete[] contents; - delete[] lengths; - delete[] offsets; - s->Initialize(); - for (int idx = 0; idx < totalLength; idx += static_cast(strlen(allContents + idx)) + 1) + + std::vector allContents(totalLength); + + this->Controller->AllGatherV( + contents.data(), allContents.data(), length, lengths.data(), offsets.data()); + + sa->Initialize(); + + // Walk the set of nul-char delimited strings { - const char* str = allContents + idx; - // insert only when the same string is not found - if (s->LookupValue(str) == -1) + const char* name = allContents.data(); + for (int off = 0; off < totalLength; /*nil*/) { - s->InsertNextValue(str); + const int len = static_cast(strlen(name)) + 1; // Trailing nul-char + if (sa->LookupValue(name) == -1) + { + // Insert only when the same string is not found + sa->InsertNextValue(name); + } + name += len; + off += len; } } - s->Squeeze(); - delete[] allContents; + sa->Squeeze(); } //------------------------------------------------------------------------------ -// AllGather vtkDataArraySelections from and to all processes -void vtkPOpenFOAMReader::AllGather(vtkDataArraySelection* s) +// AllGather vtkDataArraySelections from/to all processes +// Low-level routine without non-parallel guard +// +// Sends/receives a set of nul-char delimited strings which can be re-parsed +// into individual entries. +// Each string element is prefixed with an additional char for its enabled/disabled state. +void vtkPOpenFOAMReader::AllGather(vtkDataArraySelection* sa) { + // Construct a set of nul-char delimited strings, with bool prefix + + //- Get the overall send length vtkIdType length = 0; - for (int strI = 0; strI < s->GetNumberOfArrays(); strI++) + for (int i = 0; i < sa->GetNumberOfArrays(); ++i) { - length += static_cast(strlen(s->GetArrayName(strI))) + 2; + // Include prefix char (bool) for enabled and trailing nul-char + length += static_cast(strlen(sa->GetArrayName(i))) + 2; } - vtkIdType* lengths = new vtkIdType[this->NumProcesses]; - this->Controller->AllGather(&length, lengths, 1); - vtkIdType totalLength = 0; - vtkIdType* offsets = new vtkIdType[this->NumProcesses]; - for (int procI = 0; procI < this->NumProcesses; procI++) + + //- Add content to send (nul-delimited) + std::vector contents(length); { - offsets[procI] = totalLength; - totalLength += lengths[procI]; + char* send = contents.data(); + for (int i = 0; i < sa->GetNumberOfArrays(); ++i) + { + const char* arrayName = sa->GetArrayName(i); + const int len = static_cast(strlen(arrayName)) + 1; // With trailing nul-char + *send++ = sa->ArrayIsEnabled(arrayName); // enabled/disabled + memcpy(send, arrayName, len); + send += len; + } } - char *allContents = new char[totalLength], *contents = new char[length]; - for (int strI = 0, idx = 0; strI < s->GetNumberOfArrays(); strI++) + + std::vector lengths(this->NumProcesses); + std::vector offsets(this->NumProcesses); + + this->Controller->AllGather(&length, lengths.data(), 1); + + vtkIdType totalLength = 0; + for (int proci = 0; proci < this->NumProcesses; ++proci) { - const char* arrayName = s->GetArrayName(strI); - contents[idx] = s->ArrayIsEnabled(arrayName); - const int len = static_cast(strlen(arrayName)) + 1; - memmove(contents + idx + 1, arrayName, len); - idx += len + 1; + offsets[proci] = totalLength; + totalLength += lengths[proci]; } - this->Controller->AllGatherV(contents, allContents, length, lengths, offsets); - delete[] contents; - delete[] lengths; - delete[] offsets; + + std::vector allContents(totalLength); + + this->Controller->AllGatherV( + contents.data(), allContents.data(), length, lengths.data(), offsets.data()); + // do not RemoveAllArray so that the previous arrays are preserved - // s->RemoveAllArrays(); - for (int idx = 0; idx < totalLength; idx += static_cast(strlen(allContents + idx + 1)) + 2) + // sa->RemoveAllArrays(); + + // Walk the set of nul-char delimited strings. + // Note that each string is prefixed with a bool. { - const char* arrayName = allContents + idx + 1; - s->AddArray(arrayName); - if (allContents[idx] == 0) - { - s->DisableArray(arrayName); - } - else + const char* name = allContents.data(); + for (int off = 0; off < totalLength; /*nil*/) { - s->EnableArray(arrayName); + ++off; // leading bool + const bool isEnabled(*name++); + const int len = static_cast(strlen(name)) + 1; // With trailing nul-char + + // Add new or update current state + if (!sa->AddArray(name, isEnabled)) + { + sa->SetArraySetting(name, isEnabled); + } + + name += len; + off += len; } } - delete[] allContents; } diff --git a/IO/Parallel/vtkPOpenFOAMReader.h b/IO/Parallel/vtkPOpenFOAMReader.h index 5824bb128902..efb09d956ab3 100644 --- a/IO/Parallel/vtkPOpenFOAMReader.h +++ b/IO/Parallel/vtkPOpenFOAMReader.h @@ -83,7 +83,6 @@ private: void operator=(const vtkPOpenFOAMReader&) = delete; void GatherMetaData(); - void BroadcastStatus(int&); void Broadcast(vtkStringArray*); void AllGather(vtkStringArray*); void AllGather(vtkDataArraySelection*); -- GitLab From a24a25f062e4de3ebbd08468e24e664f6031e464 Mon Sep 17 00:00:00 2001 From: David Gobbi Date: Fri, 5 May 2023 18:14:14 -0600 Subject: [PATCH 09/18] Avoid integer overflow in vtkQuadricClustering The vtkQuadricClustering algorithm would overflow when compiled with VTK_USE_64BIT_IDS=OFF, because it would store huge integer values in a std::set. This was noted in particular with vtkQuadricLODActor. A 64-bit integer is needed in order to avoid the overflow. --- Filters/Core/vtkQuadricClustering.cxx | 9 ++++----- Rendering/LOD/vtkQuadricLODActor.cxx | 4 ---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Filters/Core/vtkQuadricClustering.cxx b/Filters/Core/vtkQuadricClustering.cxx index cac83f1d40a4..716d76f34528 100644 --- a/Filters/Core/vtkQuadricClustering.cxx +++ b/Filters/Core/vtkQuadricClustering.cxx @@ -33,12 +33,11 @@ vtkStandardNewMacro(vtkQuadricClustering); //------------------------------------------------------------------------------ // PIMPLd STL set for keeping track of inserted cells -struct vtkQuadricClusteringIdTypeHash +struct vtkQuadricClusteringIdxHash { - size_t operator()(vtkIdType val) const { return static_cast(val); } + size_t operator()(int64_t val) const { return static_cast(val); } }; -class vtkQuadricClusteringCellSet - : public std::unordered_set +class vtkQuadricClusteringCellSet : public std::unordered_set { }; typedef vtkQuadricClusteringCellSet::iterator vtkQuadricClusteringCellSetIterator; @@ -158,7 +157,7 @@ int vtkQuadricClustering::RequestData(vtkInformation* vtkNotUsed(request), // (To minimize chance of overflow, force math in vtkIdType type, // which is sometimes bigger than int, and never smaller.) vtkIdType target = input->GetNumberOfPoints(); - vtkIdType numDiv = static_cast(this->NumberOfXDivisions) * this->NumberOfYDivisions * + int64_t numDiv = static_cast(this->NumberOfXDivisions) * this->NumberOfYDivisions * this->NumberOfZDivisions / 2; if (this->AutoAdjustNumberOfDivisions && numDiv > target) { diff --git a/Rendering/LOD/vtkQuadricLODActor.cxx b/Rendering/LOD/vtkQuadricLODActor.cxx index dafc281831a0..0bcc9b34d8fb 100644 --- a/Rendering/LOD/vtkQuadricLODActor.cxx +++ b/Rendering/LOD/vtkQuadricLODActor.cxx @@ -133,10 +133,6 @@ void vtkQuadricLODActor::Render(vtkRenderer* ren, vtkMapper* vtkNotUsed(m)) } } - // TODO: When the 'TestQuadricLODActor' test gets here frameRate=15.0 - // and dim=40. This causes vtkQuadricClustering::AddTriangle()'s computations - // to overflow. If you set dim=35 there's no overflow, if you set it to 36 there is. - // Construct the LOD vtkPolyData* pd = vtkPolyData::SafeDownCast(this->Mapper->GetInput()); -- GitLab From 4876dc327a542e3f838b202cd033ecc9da5b6963 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 26 Apr 2023 21:51:43 -0400 Subject: [PATCH 10/18] Fixed signed integer overflows found by UBSan Upsized to to int64_t before multiplying. Fixes some unit test failures under UBSan. --- Common/DataModel/vtkHigherOrderTriangle.cxx | 18 ++++++++++++++---- Filters/Core/vtkQuadricClustering.cxx | 10 +++++++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Common/DataModel/vtkHigherOrderTriangle.cxx b/Common/DataModel/vtkHigherOrderTriangle.cxx index c8e75e62648a..8cd36daaabdf 100644 --- a/Common/DataModel/vtkHigherOrderTriangle.cxx +++ b/Common/DataModel/vtkHigherOrderTriangle.cxx @@ -18,6 +18,8 @@ #include "vtkHigherOrderTriangle.h" +#include + #include "vtkCellArray.h" #include "vtkCellData.h" #include "vtkDoubleArray.h" @@ -486,10 +488,18 @@ int vtkHigherOrderTriangle::IntersectWithLine( for (vtkIdType i = 0; i < 3; i++) { x[i] = xMin[i]; - pcoords[i] = (i < 2 ? (bindices[0][i] + pcoordsMin[0] * (bindices[1][i] - bindices[0][i]) + - pcoordsMin[1] * (bindices[2][i] - bindices[0][i])) / - order - : 0.); + + if (i < 2) + { + int64_t b0 = static_cast(bindices[0][i]); + int64_t b1 = static_cast(bindices[1][i]) - static_cast(bindices[0][i]); + int64_t b2 = static_cast(bindices[2][i]) - static_cast(bindices[0][i]); + pcoords[i] = (b0 + pcoordsMin[0] * b1 + pcoordsMin[1] * b2) / order; + } + else + { + pcoords[i] = 0.0; + } } t = tTmp; } diff --git a/Filters/Core/vtkQuadricClustering.cxx b/Filters/Core/vtkQuadricClustering.cxx index 716d76f34528..1cabfd89c505 100644 --- a/Filters/Core/vtkQuadricClustering.cxx +++ b/Filters/Core/vtkQuadricClustering.cxx @@ -14,6 +14,8 @@ =========================================================================*/ #include "vtkQuadricClustering.h" +#include + #include "vtkCellArray.h" #include "vtkCellData.h" #include "vtkExecutive.h" @@ -553,9 +555,11 @@ void vtkQuadricClustering::AddTriangle(vtkIdType* binIds, double* pt0, double* p } break; } - // TODO: this arithmetic overflows with the TestQuadricLODActor test. - vtkIdType idx = binIds[minIdx] + this->NumberOfBins * binIds[midIdx] + - this->NumberOfBins * this->NumberOfBins * binIds[maxIdx]; + int64_t upsizedBinMin = static_cast(binIds[minIdx]); + int64_t upsizedBinMid = static_cast(binIds[midIdx]); + int64_t upsizedBinMax = static_cast(binIds[maxIdx]); + int64_t idx = upsizedBinMin + this->NumberOfBins * upsizedBinMid + + this->NumberOfBins * this->NumberOfBins * upsizedBinMax; if (this->CellSet->find(idx) == this->CellSet->end()) { this->CellSet->insert(idx); -- GitLab From 82837c8cc734ffc9d9c107cacbb992a221918ece Mon Sep 17 00:00:00 2001 From: David Gobbi Date: Wed, 10 May 2023 14:58:38 -0600 Subject: [PATCH 11/18] Remove bad byte 0x0f from a source file The file vtkImageData.cxx had control byte 0x0f (^O) at the end of one of the comment lines. It has been removed. --- Common/DataModel/vtkImageData.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/DataModel/vtkImageData.cxx b/Common/DataModel/vtkImageData.cxx index 4a35e1cfb265..e9a849140015 100644 --- a/Common/DataModel/vtkImageData.cxx +++ b/Common/DataModel/vtkImageData.cxx @@ -511,7 +511,7 @@ void vtkImageData::AddPointsToCellTemplate(vtkCell* cell, int ijkMin[3], int ijk vtkIdType d01 = dims[0] * dims[1]; // Extract point coordinates and point ids - // Ids are relative to extent min. + // Ids are relative to extent min. npts = 0; for (loc[2] = ijkMin[2]; loc[2] <= ijkMax[2]; loc[2]++) { -- GitLab From 55558016dbb95d3904f3d5605af5b4d943c9c852 Mon Sep 17 00:00:00 2001 From: David Gobbi Date: Wed, 10 May 2023 15:17:32 -0600 Subject: [PATCH 12/18] Replace utf8 right quote with ascii quote --- Common/Core/Testing/Cxx/TestLogger.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Core/Testing/Cxx/TestLogger.cxx b/Common/Core/Testing/Cxx/TestLogger.cxx index 6bd683b186d6..490f76598776 100644 --- a/Common/Core/Testing/Cxx/TestLogger.cxx +++ b/Common/Core/Testing/Cxx/TestLogger.cxx @@ -48,7 +48,7 @@ int TestLogger(int, char*[]) auto month = "May"; vtkLogIf(2, true, << "Rough winds do shake the darling buds of " << month << ","); - vtkLogIfF(2, true, "And %s’s lease hath all too short a date;", "summers"); + vtkLogIfF(2, true, "And %s's lease hath all too short a date;", "summers"); } cerr << "--------------------------------------------" << endl -- GitLab From 2864e1028ecb5b0c8b08aa8a29f5c3378126a164 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 2 May 2023 14:29:32 +0200 Subject: [PATCH 13/18] openfoam: ignore extended number of faces (fixes paraview#14235) - occurs with foam-extend globalFaceZone, in which the faces list is longer than owner/neighbour lists (with the extra faces belonging to the globalFaceZone). Remedy by simply resetting the known NumFaces to be consistent with owner/neighbour information. The excess faces will simply be dragged along without being addressed. This is a minor memory overhead (versus truncating the face list), but only affects cases with globalFaceZone and still allows some possibility to handling in the future if desired. Adjustment consistent with CreateCellFaces() private method. --- IO/Geometry/vtkOpenFOAMReader.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/IO/Geometry/vtkOpenFOAMReader.cxx b/IO/Geometry/vtkOpenFOAMReader.cxx index 422e6325b5d2..67fb9e4ec839 100644 --- a/IO/Geometry/vtkOpenFOAMReader.cxx +++ b/IO/Geometry/vtkOpenFOAMReader.cxx @@ -6985,8 +6985,11 @@ bool vtkOpenFOAMReaderPrivate::ReadOwnerNeighbourFiles(const std::string& timeRe return false; } - // Set or check number of mesh faces - if (this->NumFaces == 0) + // Set or check number of mesh faces. + // NB: with foam-extend it is possible that "owner" is shorter than "faces" + // with additional faces being in a globalFaceZone. + // so update NumFaces to avoid inconsistencies + if ((this->NumFaces == 0) || (nFaces < this->NumFaces)) { this->NumFaces = nFaces; } -- GitLab From 269b7b039d1217aa995cdf4843f6f7ac96df8e1d Mon Sep 17 00:00:00 2001 From: Sergey Lesnik Date: Fri, 12 May 2023 13:34:58 +0200 Subject: [PATCH 14/18] openfoam: add a test for decomposed GGI / global face zone --- IO/Parallel/Testing/CMakeLists.txt | 7 + IO/Parallel/Testing/Cxx/CMakeLists.txt | 2 + .../Cxx/TestPOpenFOAMReaderGlobalFaceZone.cxx | 141 ++++++++++++++++++ .../OpenFOAM/mixerGgi/mixerGgi.foam.sha512 | 1 + .../OpenFOAM/mixerGgi/processor0/0.5/U.sha512 | 1 + .../mixerGgi/processor0/0.5/meshPhi.sha512 | 1 + .../OpenFOAM/mixerGgi/processor0/0.5/p.sha512 | 1 + .../mixerGgi/processor0/0.5/phi.sha512 | 1 + .../processor0/0.5/polyMesh/points.sha512 | 1 + .../mixerGgi/processor0/0.5/rAU.sha512 | 1 + .../OpenFOAM/mixerGgi/processor0/0/U.sha512 | 1 + .../OpenFOAM/mixerGgi/processor0/0/p.sha512 | 1 + .../constant/polyMesh/boundary.sha512 | 1 + .../constant/polyMesh/cellZones.sha512 | 1 + .../constant/polyMesh/faceZones.sha512 | 1 + .../processor0/constant/polyMesh/faces.sha512 | 1 + .../constant/polyMesh/neighbour.sha512 | 1 + .../processor0/constant/polyMesh/owner.sha512 | 1 + .../constant/polyMesh/points.sha512 | 1 + .../OpenFOAM/mixerGgi/processor1/0.5/U.sha512 | 1 + .../mixerGgi/processor1/0.5/meshPhi.sha512 | 1 + .../OpenFOAM/mixerGgi/processor1/0.5/p.sha512 | 1 + .../mixerGgi/processor1/0.5/phi.sha512 | 1 + .../processor1/0.5/polyMesh/points.sha512 | 1 + .../mixerGgi/processor1/0.5/rAU.sha512 | 1 + .../OpenFOAM/mixerGgi/processor1/0/U.sha512 | 1 + .../OpenFOAM/mixerGgi/processor1/0/p.sha512 | 1 + .../constant/polyMesh/boundary.sha512 | 1 + .../constant/polyMesh/cellZones.sha512 | 1 + .../constant/polyMesh/faceZones.sha512 | 1 + .../processor1/constant/polyMesh/faces.sha512 | 1 + .../constant/polyMesh/neighbour.sha512 | 1 + .../processor1/constant/polyMesh/owner.sha512 | 1 + .../constant/polyMesh/points.sha512 | 1 + .../OpenFOAM/mixerGgi/processor2/0.5/U.sha512 | 1 + .../mixerGgi/processor2/0.5/meshPhi.sha512 | 1 + .../OpenFOAM/mixerGgi/processor2/0.5/p.sha512 | 1 + .../mixerGgi/processor2/0.5/phi.sha512 | 1 + .../processor2/0.5/polyMesh/points.sha512 | 1 + .../mixerGgi/processor2/0.5/rAU.sha512 | 1 + .../OpenFOAM/mixerGgi/processor2/0/U.sha512 | 1 + .../OpenFOAM/mixerGgi/processor2/0/p.sha512 | 1 + .../constant/polyMesh/boundary.sha512 | 1 + .../constant/polyMesh/cellZones.sha512 | 1 + .../constant/polyMesh/faceZones.sha512 | 1 + .../processor2/constant/polyMesh/faces.sha512 | 1 + .../constant/polyMesh/neighbour.sha512 | 1 + .../processor2/constant/polyMesh/owner.sha512 | 1 + .../constant/polyMesh/points.sha512 | 1 + .../OpenFOAM/mixerGgi/processor3/0.5/U.sha512 | 1 + .../mixerGgi/processor3/0.5/meshPhi.sha512 | 1 + .../OpenFOAM/mixerGgi/processor3/0.5/p.sha512 | 1 + .../mixerGgi/processor3/0.5/phi.sha512 | 1 + .../processor3/0.5/polyMesh/points.sha512 | 1 + .../mixerGgi/processor3/0.5/rAU.sha512 | 1 + .../OpenFOAM/mixerGgi/processor3/0/U.sha512 | 1 + .../OpenFOAM/mixerGgi/processor3/0/p.sha512 | 1 + .../constant/polyMesh/boundary.sha512 | 1 + .../constant/polyMesh/cellZones.sha512 | 1 + .../constant/polyMesh/faceZones.sha512 | 1 + .../processor3/constant/polyMesh/faces.sha512 | 1 + .../constant/polyMesh/neighbour.sha512 | 1 + .../processor3/constant/polyMesh/owner.sha512 | 1 + .../constant/polyMesh/points.sha512 | 1 + 64 files changed, 211 insertions(+) create mode 100644 IO/Parallel/Testing/Cxx/TestPOpenFOAMReaderGlobalFaceZone.cxx create mode 100644 Testing/Data/OpenFOAM/mixerGgi/mixerGgi.foam.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/U.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/meshPhi.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/p.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/phi.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/polyMesh/points.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/rAU.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/0/U.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/0/p.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/boundary.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/cellZones.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/faceZones.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/faces.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/neighbour.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/owner.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/points.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/U.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/meshPhi.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/p.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/phi.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/polyMesh/points.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/rAU.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/0/U.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/0/p.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/boundary.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/cellZones.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/faceZones.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/faces.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/neighbour.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/owner.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/points.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/U.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/meshPhi.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/p.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/phi.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/polyMesh/points.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/rAU.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/0/U.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/0/p.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/boundary.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/cellZones.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/faceZones.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/faces.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/neighbour.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/owner.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/points.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/U.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/meshPhi.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/p.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/phi.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/polyMesh/points.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/rAU.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/0/U.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/0/p.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/boundary.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/cellZones.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/faceZones.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/faces.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/neighbour.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/owner.sha512 create mode 100644 Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/points.sha512 diff --git a/IO/Parallel/Testing/CMakeLists.txt b/IO/Parallel/Testing/CMakeLists.txt index c5745f3f1490..6d9dce3c3a4f 100644 --- a/IO/Parallel/Testing/CMakeLists.txt +++ b/IO/Parallel/Testing/CMakeLists.txt @@ -14,6 +14,13 @@ vtk_module_test_data( Data/OpenFOAM/cavity/constant/,REGEX:.* Data/OpenFOAM/cavity/constant/polyMesh/,REGEX:.* Data/OpenFOAM/cavity/system/,REGEX:.* + + Data/OpenFOAM/mixerGgi/,REGEX:.* + Data/OpenFOAM/mixerGgi/processor0/,RECURSE:,REGEX:.*$ + Data/OpenFOAM/mixerGgi/processor1/,RECURSE:,REGEX:.*$ + Data/OpenFOAM/mixerGgi/processor2/,RECURSE:,REGEX:.*$ + Data/OpenFOAM/mixerGgi/processor3/,RECURSE:,REGEX:.*$ + Data/bigendian.xyz) add_subdirectory(Cxx) diff --git a/IO/Parallel/Testing/Cxx/CMakeLists.txt b/IO/Parallel/Testing/Cxx/CMakeLists.txt index ee54239a1eaf..e159a1d61a91 100644 --- a/IO/Parallel/Testing/Cxx/CMakeLists.txt +++ b/IO/Parallel/Testing/Cxx/CMakeLists.txt @@ -2,6 +2,7 @@ if (TARGET VTK::ParallelMPI) vtk_add_test_mpi(vtkIOParallelCxxTests-MPI tests TESTING_DATA TestPOpenFOAMReader.cxx + TestPOpenFOAMReaderGlobalFaceZone.cxx,NO_VALID TestPOpenFOAMReaderLagrangianSerial.cxx,NO_VALID TestPOpenFOAMReaderLagrangianUncollated.cxx,NO_VALID ) @@ -10,6 +11,7 @@ endif() vtk_add_test_cxx(vtkIOParallelCxxTests tests TestPOpenFOAMReader.cxx + TestPOpenFOAMReaderGlobalFaceZone.cxx,NO_VALID TestPOpenFOAMReaderLagrangianSerial.cxx,NO_VALID TestPOpenFOAMReaderLagrangianUncollated.cxx,NO_VALID TestBigEndianPlot3D.cxx,NO_VALID diff --git a/IO/Parallel/Testing/Cxx/TestPOpenFOAMReaderGlobalFaceZone.cxx b/IO/Parallel/Testing/Cxx/TestPOpenFOAMReaderGlobalFaceZone.cxx new file mode 100644 index 000000000000..44dc7e5e8531 --- /dev/null +++ b/IO/Parallel/Testing/Cxx/TestPOpenFOAMReaderGlobalFaceZone.cxx @@ -0,0 +1,141 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: TestPOpenFOAMReaderGlobalFaceZone.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +// When a globalFaceZone is used in foam-extend in parallel (e.g. GGI), the +// owner list will be shorter than the face list. This test ensures the correct +// behavior in that case and also checks reading of the global face zone itself. + +#if VTK_MODULE_ENABLE_VTK_ParallelMPI +#include "vtkMPIController.h" +#else +#include "vtkDummyController.h" +#endif + +#include "vtkPOpenFOAMReader.h" + +#include "vtkCellData.h" +#include "vtkCompositeDataSet.h" +#include "vtkInformation.h" +#include "vtkLogger.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkNew.h" +#include "vtkPointData.h" +#include "vtkPolyData.h" +#include "vtkTestUtilities.h" +#include "vtkUnstructuredGrid.h" + +namespace +{ + +// Get any block of specified type +template +Type* findBlock(vtkMultiBlockDataSet* mb) +{ + Type* dataset = nullptr; + const unsigned int nblocks = (mb ? mb->GetNumberOfBlocks() : 0u); + for (unsigned int blocki = 0; !dataset && blocki < nblocks; ++blocki) + { + vtkDataObject* obj = mb->GetBlock(blocki); + dataset = Type::SafeDownCast(obj); + if (!dataset) + { + dataset = findBlock(vtkMultiBlockDataSet::SafeDownCast(obj)); + } + } + return dataset; +} + +// Get named block of specified type +template +Type* findBlock(vtkMultiBlockDataSet* mb, const char* blockName) +{ + Type* dataset = nullptr; + const unsigned int nblocks = (mb ? mb->GetNumberOfBlocks() : 0u); + for (unsigned int blocki = 0; !dataset && blocki < nblocks; ++blocki) + { + vtkDataObject* obj = mb->GetBlock(blocki); + if (strcmp(mb->GetMetaData(blocki)->Get(vtkCompositeDataSet::NAME()), blockName) == 0) + { + dataset = Type::SafeDownCast(obj); + } + if (!dataset) + { + dataset = findBlock(vtkMultiBlockDataSet::SafeDownCast(obj), blockName); + } + } + return dataset; +} + +} // End anonymous namespace + +int TestPOpenFOAMReaderGlobalFaceZone(int argc, char* argv[]) +{ +#if VTK_MODULE_ENABLE_VTK_ParallelMPI + vtkNew controller; +#else + vtkNew controller; +#endif + + controller->Initialize(&argc, &argv); + int rank = controller->GetLocalProcessId(); + vtkLogger::SetThreadName("rank=" + std::to_string(rank)); + vtkMultiProcessController::SetGlobalController(controller); + + // Read file name + char* filename = + vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/OpenFOAM/mixerGgi/mixerGgi.foam"); + + // Read the file + vtkNew reader; + reader->SetFileName(filename); + delete[] filename; + reader->SetCaseType(vtkPOpenFOAMReader::DECOMPOSED_CASE); + reader->ReadZonesOn(); + reader->CopyDataToCellZonesOn(); + reader->Update(); + + reader->SetTimeValue(0.5); + + // Re-read with everything selected + reader->EnableAllPatchArrays(); + reader->Update(); + reader->Print(std::cout); + reader->GetOutput()->Print(std::cout); + + auto* allBlocks = vtkMultiBlockDataSet::SafeDownCast(reader->GetOutput()); + + std::cout << "Read " << allBlocks->GetNumberOfBlocks() << " blocks" << std::endl; + + auto* zoneBlocks = findBlock(allBlocks, "zones"); + + if (!zoneBlocks) + { + std::cout << "No zone blocks!\n"; + return 1; + } + + // Get the first polyData set (faces) + auto* fZone = findBlock(zoneBlocks); + if (!fZone) + { + std::cout << "No faceZone!\n"; + return 1; + } + + fZone->GetCellData()->SetScalars(fZone->GetCellData()->GetArray("p")); + + controller->Finalize(); + + return 0; +} diff --git a/Testing/Data/OpenFOAM/mixerGgi/mixerGgi.foam.sha512 b/Testing/Data/OpenFOAM/mixerGgi/mixerGgi.foam.sha512 new file mode 100644 index 000000000000..c2f1924ca315 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/mixerGgi.foam.sha512 @@ -0,0 +1 @@ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/U.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/U.sha512 new file mode 100644 index 000000000000..98f104e11914 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/U.sha512 @@ -0,0 +1 @@ +f60345585ddc39fe0efde1960b50926fd2c03cd82b00868d1ace24b243e2dfb1651a8ead179b2d4b78c1ed2f9f0ce4e3fb418e7cd26dfa175a29a5b8ace6aa40 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/meshPhi.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/meshPhi.sha512 new file mode 100644 index 000000000000..235cae64529f --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/meshPhi.sha512 @@ -0,0 +1 @@ +bbbcb4f5d2d7ec5d2a3b1e7e6377b1998b6e92c13342d19b991ae5697ebe072ea093011eb2e4f9de6e4ce7d11de4c4dca4af42021c2dfb57f8a80f7dfb6ad8aa diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/p.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/p.sha512 new file mode 100644 index 000000000000..684f65ec5fc0 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/p.sha512 @@ -0,0 +1 @@ +3b7579e94c901a453f76066dff352125ea2788f851dd3c4b3302ffc94f67498ede7dee619f40bc35fb185a207b0ff0dd59064846a8cee9c43b0c4eaa8711790c diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/phi.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/phi.sha512 new file mode 100644 index 000000000000..f0202339a319 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/phi.sha512 @@ -0,0 +1 @@ +56fddd6007ad2518566a7348d3ac030b48f484bc57af9565545abcc5f938bddd61efaac7e0127a499f5e7b190c466376fdb8720585b68c7d635666d916ff69b0 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/polyMesh/points.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/polyMesh/points.sha512 new file mode 100644 index 000000000000..657533817a5e --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/polyMesh/points.sha512 @@ -0,0 +1 @@ +b63937f5ed715c39f0b3326242589c7b079688c359b888b469e7fe18fee2d057d88a13ff0686f7f2358527a523f27dbff4d029cdf0b0954b5aebe2921ca18a54 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/rAU.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/rAU.sha512 new file mode 100644 index 000000000000..d500df0d530f --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/0.5/rAU.sha512 @@ -0,0 +1 @@ +1678edc669b762763adcfc13787390f68373da4a0a80c2db8a42461a2bc05a63557fcad534d95487772047bfff2b4f41bb6ee10a856efea9805930adfddd3fa4 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/0/U.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/0/U.sha512 new file mode 100644 index 000000000000..91497f660283 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/0/U.sha512 @@ -0,0 +1 @@ +f2b5b83d617e294d27da8af6251fd041e8e272944287f10bba9086cd33acbea3f9c84b50e7af75c38c2e46c8d29b929d272853f05399c0c97e795c3e032b9f53 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/0/p.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/0/p.sha512 new file mode 100644 index 000000000000..65e97546b5a9 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/0/p.sha512 @@ -0,0 +1 @@ +0e26650322e8a9cbe52c9b40c76080cc51bf535aa462b87798a51c698f99354a83a5368890f5a6c79f49f1679ccca92b9e6d33c1cc97b4ae2c6b6c0f742c8a74 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/boundary.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/boundary.sha512 new file mode 100644 index 000000000000..298f69073590 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/boundary.sha512 @@ -0,0 +1 @@ +d41c1677e4cf9b87c2de75c20d22e5c8fe3bc6749bff65aba7bd77a8c1496405c91cd11f7beee0af1d7ce8e127097fdab6c27c3c6877002a027e7566bd536c2d diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/cellZones.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/cellZones.sha512 new file mode 100644 index 000000000000..16795a705d15 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/cellZones.sha512 @@ -0,0 +1 @@ +93e39270acc0fc5e600a6fb383ff2f08c10cb2c8765eeffe5523fd73f8fcc10beaea3148665374439503c57d21fe8c68aaac3d53f29cddb4a1bdc424fe5aa061 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/faceZones.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/faceZones.sha512 new file mode 100644 index 000000000000..25cb05742ace --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/faceZones.sha512 @@ -0,0 +1 @@ +b2249158b7b32ac641640ed8aa7989c07362f33faf86f4b7889c428242ae4391f450404a7eedf5f8d6b0cbe5539db09095198a288eda0dbb9ff085d08a8ed8dc diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/faces.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/faces.sha512 new file mode 100644 index 000000000000..553fed3d5c4a --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/faces.sha512 @@ -0,0 +1 @@ +398632e3c011db2955b6bbfa644e5af338431ea26b4f549e51d65d3430c876734dd3f5a1c6b1027ab1cdd79259d7101bcdd380eb33a82111f43ddd4b674bcee7 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/neighbour.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/neighbour.sha512 new file mode 100644 index 000000000000..f689ccd6d759 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/neighbour.sha512 @@ -0,0 +1 @@ +13578dc16890eb8cefcae072ff5d1db165d2d32104461dc241b4ff659ce5a8586b5aef18853a0a0fc33194ae7eb6b8400a5f68767f6b4c354dfb4027dc5de65b diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/owner.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/owner.sha512 new file mode 100644 index 000000000000..a45e66da4dbf --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/owner.sha512 @@ -0,0 +1 @@ +3e46876b306571f307d248a7a4528960757255027dcaf1e57d5d21de3cae972e27c78d44da65989cde9259855eca3768effb0003a9c510d209b708c059f1b1e3 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/points.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/points.sha512 new file mode 100644 index 000000000000..c7c2454b65c2 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor0/constant/polyMesh/points.sha512 @@ -0,0 +1 @@ +cc0a08b05ed58abef4a11de5256cd3fc5f0f6616971b7f74a56b439c0e7865580d0b0ffb6093d1ab355475bad81bddafea84f526338f9342ae57bec36f50c5a0 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/U.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/U.sha512 new file mode 100644 index 000000000000..6cde93e651c1 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/U.sha512 @@ -0,0 +1 @@ +da7fad43e265e96923437e27ec1ddb125e059c76717c983c0eaad8c29277fbba42edea16861a0603885c0f0b7cc2da9de658182238f2876de3841d5696c11966 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/meshPhi.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/meshPhi.sha512 new file mode 100644 index 000000000000..de0308f7a3f6 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/meshPhi.sha512 @@ -0,0 +1 @@ +53e525d61c377ed09dac5d94a2444e4bbea53a2c41ca83ed0750b67fe101d25fd24d99b29f89831b04e0b57a23e69f7ee9eb4f06e1176d17547756e3aeccf8c1 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/p.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/p.sha512 new file mode 100644 index 000000000000..9cfc13a20f50 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/p.sha512 @@ -0,0 +1 @@ +c3c281e3c0d99fca0395984ffc0e375563ec5565758c113d22ec1dfe30c277cebc3dfec84b37bbec57c4e6efb562ad47dd791cca2bcc8016d8a3bd8a7a1d81bd diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/phi.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/phi.sha512 new file mode 100644 index 000000000000..3ab7ace7af51 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/phi.sha512 @@ -0,0 +1 @@ +d4df034f5dc487a8e0ae67e525972d1b32e63658d702685b4899ff3036d8124c62347cef9bc3c4cdcfe14249bec3528214070bb836dcffe051dea1e089f47e42 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/polyMesh/points.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/polyMesh/points.sha512 new file mode 100644 index 000000000000..d7999703d40a --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/polyMesh/points.sha512 @@ -0,0 +1 @@ +1048e748878b1d425830ccf7d916f98a40564107db7ebdfea3b7c293317709a08b809b66c0a6b028997ac9a270551051b901f0b3b68d8d93691c0ec35bde24da diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/rAU.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/rAU.sha512 new file mode 100644 index 000000000000..f3363cce5fcc --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/0.5/rAU.sha512 @@ -0,0 +1 @@ +36f425bc75c41772aed87b91c1289f052ad1651fdea8a32b095c1612aa42090a0ef73e7a200b21009bc343413e91df7d8ad57e5911414f02036fc00573103002 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/0/U.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/0/U.sha512 new file mode 100644 index 000000000000..e1158c10be84 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/0/U.sha512 @@ -0,0 +1 @@ +1aa3a3fa28fe325598ec6f87059df46bd597808a2e4f0e7410580de9a70d09ff6312dcb1ad2372aeeefb13109b368d05a8bbce0d898151f3dd7c07f3e40297c8 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/0/p.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/0/p.sha512 new file mode 100644 index 000000000000..677705d62f50 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/0/p.sha512 @@ -0,0 +1 @@ +2d1691acdb1060e54b9dbda69b21a7ddaef170ed5ea2a2ac3e7eb3cbbf39a9356c759172efe1578470c97bac7287741d5ba9038484feb9d4483b9c8e9997d406 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/boundary.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/boundary.sha512 new file mode 100644 index 000000000000..4329eeee631c --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/boundary.sha512 @@ -0,0 +1 @@ +1aef10bc87f0c3d10eaa1c0834cb76504b2eb73e52a64a5746b8491e0f122f07f4560460702f4525a7c06105ffcca0ede3b539816768fbd30cd52d9353d78b16 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/cellZones.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/cellZones.sha512 new file mode 100644 index 000000000000..16795a705d15 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/cellZones.sha512 @@ -0,0 +1 @@ +93e39270acc0fc5e600a6fb383ff2f08c10cb2c8765eeffe5523fd73f8fcc10beaea3148665374439503c57d21fe8c68aaac3d53f29cddb4a1bdc424fe5aa061 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/faceZones.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/faceZones.sha512 new file mode 100644 index 000000000000..537929683a28 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/faceZones.sha512 @@ -0,0 +1 @@ +01db8b92573a43bd0d2f36d2d6a21adeeddcfa17ff3f2f2cc6094d379901223b84a8411906d89182f6da11a02c32226bca0e1372ceb477b88bb028eb8be9e4f5 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/faces.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/faces.sha512 new file mode 100644 index 000000000000..5528fcb00db7 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/faces.sha512 @@ -0,0 +1 @@ +aa5fdad103c683b237f021d46825a9aed888f0fe40d63fdb33a727818c37bb0b15dea1f209f0f7b19a7058a207add15adb86fc58f6dfa93b63e6ed297c5b8ca9 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/neighbour.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/neighbour.sha512 new file mode 100644 index 000000000000..d93ec9133561 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/neighbour.sha512 @@ -0,0 +1 @@ +d3b8da852235fc9458290cad08b03d42aea83674748c12d222bb8705c1e69a89ebedb94310050c9d8906f20c1b16bb267d8f28f0190f0a39aaa5a89aa9501487 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/owner.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/owner.sha512 new file mode 100644 index 000000000000..ec03ad266567 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/owner.sha512 @@ -0,0 +1 @@ +6606523e734634c5a4a44c9d2afb6acb41015775b3663e5e7e189de4e3a0fdc71820844da35fc66c9e80407a0bb361b2c49bbf80cafa945ab394366067a2441d diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/points.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/points.sha512 new file mode 100644 index 000000000000..c9d29926e21e --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor1/constant/polyMesh/points.sha512 @@ -0,0 +1 @@ +24c6a941a85534685af6b37861902d8aab8788ef3b5d894373caffc1380bf6a3d6d97b5d74e486b2e77752f17534b970053705f8a1be2c14ea5efe7528534eed diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/U.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/U.sha512 new file mode 100644 index 000000000000..d47a477f0b82 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/U.sha512 @@ -0,0 +1 @@ +e00427afc6fef15820599882cfea1a9ddd92ef7b37d4542a132591edf850588c8cdf668fc8b0d08803a3d3186f3ef195b6715ccaa8e6cd4896de942b88fd05f7 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/meshPhi.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/meshPhi.sha512 new file mode 100644 index 000000000000..e7cb64ae2dcd --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/meshPhi.sha512 @@ -0,0 +1 @@ +85324676d8672e58f31b4fe6ce8648908b49197233c9951e324e01c6c0564f87d73cd53e4c3663d1fe9302fe9c12e145de39eccd956b5171432936ed5d6624f4 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/p.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/p.sha512 new file mode 100644 index 000000000000..f8743d22505d --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/p.sha512 @@ -0,0 +1 @@ +49926d9178b378e1133e54e89266ea8d6a87ec6f8db0d5df73637d9655022e76dbb66f4e913b3475f1f6d83eca636a21af7551d35002b39b9663687cf7eefedc diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/phi.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/phi.sha512 new file mode 100644 index 000000000000..0c11a2fde171 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/phi.sha512 @@ -0,0 +1 @@ +69a7e99b4adb576c30f31458bcb2e3898233d790e6e26251fe7b9071589926d2cb3a7c2bc5ddcb1978252a7ffd8bea75763e124d7a5a8c6333cccd99ed0474ff diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/polyMesh/points.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/polyMesh/points.sha512 new file mode 100644 index 000000000000..ee34601e3708 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/polyMesh/points.sha512 @@ -0,0 +1 @@ +0cc2d36f98910943171819f7efa9f4cf5241038dcd873952e016704423deb1144ffd6febc98551dca357be092036929448dab1859064a8d616457e6142cd8a99 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/rAU.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/rAU.sha512 new file mode 100644 index 000000000000..99d00467119f --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/0.5/rAU.sha512 @@ -0,0 +1 @@ +405468ff55b5eb986bded72a08635c5b714525242f7832531a8362568026152f24d039d9285bced492732f0ef5ff8a34aa08bd86153f2dc3c9292298f8e04240 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/0/U.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/0/U.sha512 new file mode 100644 index 000000000000..2c5100a5009c --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/0/U.sha512 @@ -0,0 +1 @@ +77491ae1f6503f417d1c36a01369729b2e7314b76b74eadf69f37090cc9f8a7acba73563d812494d371cd3a446259bc96e095bf99047d6fb3c90144d0ea76ef8 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/0/p.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/0/p.sha512 new file mode 100644 index 000000000000..9decbcd69660 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/0/p.sha512 @@ -0,0 +1 @@ +907628d75461620dd89a2228aa6566263eb4f20f9e1fe8f6e620fc11be71709fef610d9113118bf5fdb4a35064fc3dddb56c09f114fdf6f7acbbb5e2582b53ec diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/boundary.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/boundary.sha512 new file mode 100644 index 000000000000..74ccb77661a9 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/boundary.sha512 @@ -0,0 +1 @@ +32f2c4efa449b419afbfddef44ca0fe643bb553ad9bd32068bd78ab35f88c7b33a3e56fbc8de7e0b889647cb74f36e6820dd52fe7aab330fa316a0c603bd74f0 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/cellZones.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/cellZones.sha512 new file mode 100644 index 000000000000..16795a705d15 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/cellZones.sha512 @@ -0,0 +1 @@ +93e39270acc0fc5e600a6fb383ff2f08c10cb2c8765eeffe5523fd73f8fcc10beaea3148665374439503c57d21fe8c68aaac3d53f29cddb4a1bdc424fe5aa061 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/faceZones.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/faceZones.sha512 new file mode 100644 index 000000000000..6552f4f64d75 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/faceZones.sha512 @@ -0,0 +1 @@ +2583061010a2bf7f3d49a1b4d23b06f914a040f10b7750fb328d32964abef1c93361af1129dcb49f8ddc54aa60712e33921a8c4405df7d2b2aa41ed8fdb66704 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/faces.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/faces.sha512 new file mode 100644 index 000000000000..7202b6317f11 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/faces.sha512 @@ -0,0 +1 @@ +80622e1ff8a3f0d53f321b166f9a45d70046ef9d654acee462e622f571c9276392840a45d23309cc6223df3672f0fd598c0733df5a43b0c377a7f718d9b10a9b diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/neighbour.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/neighbour.sha512 new file mode 100644 index 000000000000..d93ec9133561 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/neighbour.sha512 @@ -0,0 +1 @@ +d3b8da852235fc9458290cad08b03d42aea83674748c12d222bb8705c1e69a89ebedb94310050c9d8906f20c1b16bb267d8f28f0190f0a39aaa5a89aa9501487 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/owner.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/owner.sha512 new file mode 100644 index 000000000000..954e36859e6d --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/owner.sha512 @@ -0,0 +1 @@ +6f2a6a7a69ed6f07512701444230ef14dccb27f641757ffd64a4e47d9da627d5da07bf54a27aaa96bd5fe21b9e71bab1bf122070f31f5748f1705803c700be97 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/points.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/points.sha512 new file mode 100644 index 000000000000..2dee6a98604c --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor2/constant/polyMesh/points.sha512 @@ -0,0 +1 @@ +4b9315f3a267e641379a9755803db5da8a1801330f52f03ce51fdb4a5b7d144fa8667cf148284bac631e41432c004655723fe8736c750f46217d48280f5157a7 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/U.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/U.sha512 new file mode 100644 index 000000000000..7c1c36ff2a69 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/U.sha512 @@ -0,0 +1 @@ +8e92a9d48bc37c16932177c4258f63d5e24778cd6bd252d52f4374b60664a11722fecb6f8a7365443c5c80a1b320a61e90ee575443afb2125efaae3723700911 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/meshPhi.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/meshPhi.sha512 new file mode 100644 index 000000000000..3c708f0e1501 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/meshPhi.sha512 @@ -0,0 +1 @@ +afb1f0a155b60045672f89a486e91450fdaadfbd6dfb212499bf5fc2d2b7b47c46ca7de9839d474a773b20cb9505090191a6a6e71d237236f4e05247fd3e3483 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/p.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/p.sha512 new file mode 100644 index 000000000000..68cef2b4a4f1 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/p.sha512 @@ -0,0 +1 @@ +04d4849f68eeab76886dd4bbc03fcc8d47959c04a29bb552964749e31139bf6c3cc3461402e5145757402a5b7eb38fe36c661333cca68b95fbd2c359781e6327 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/phi.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/phi.sha512 new file mode 100644 index 000000000000..172d85594a27 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/phi.sha512 @@ -0,0 +1 @@ +43812fe129409aff3696131b3bbe5b60323daaec1d02e13c738075089488202003a92a10f7e9a08be76426ee0017980a6ac218e0759e73f0988e81bef0809239 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/polyMesh/points.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/polyMesh/points.sha512 new file mode 100644 index 000000000000..eed2d38be17a --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/polyMesh/points.sha512 @@ -0,0 +1 @@ +d045feac2d3e82fe58d5db9df23c5179a65f6f81c3bdfab2c601e63d68b0f31bf7313b91c20231d5ce8c56edbacec9942a49e8d2ffdf3f67ec46b13e37f03da0 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/rAU.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/rAU.sha512 new file mode 100644 index 000000000000..5fe41b07744e --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/0.5/rAU.sha512 @@ -0,0 +1 @@ +53119daa6bc20253a0a37449d8367af8842df09cc2ebd0b915badda3949f8aee106690bfa5bef68ed79a80d5294b1881b9b172c38ca67627f31b8019be809d3b diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/0/U.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/0/U.sha512 new file mode 100644 index 000000000000..22a898646ed3 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/0/U.sha512 @@ -0,0 +1 @@ +e93241550eda15abb7e71f13dfe280832121a6bf7c77b7eae190940fbcb7f893d07c1a83faf9d35dd826aa570ebcc35d79456d35e2f161578a652f2fcdbd967b diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/0/p.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/0/p.sha512 new file mode 100644 index 000000000000..2cb8ac541146 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/0/p.sha512 @@ -0,0 +1 @@ +09270be4275065f92e0f4583aaa2df6dacecf3c680d339f3f405b9582a06fe22f6cdacadf577055775085fec776a6ac5cf72f7267b2c05161d962cf19338fbb9 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/boundary.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/boundary.sha512 new file mode 100644 index 000000000000..2855799d8b73 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/boundary.sha512 @@ -0,0 +1 @@ +10c8181fe58744105bd783c3ce590aa57c0e1dc9bd14f04bdfd4bf6285b73d000f724855e28339d9d131f60c2d9494f92f12532358b70c0da1a41a8376f37b96 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/cellZones.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/cellZones.sha512 new file mode 100644 index 000000000000..16795a705d15 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/cellZones.sha512 @@ -0,0 +1 @@ +93e39270acc0fc5e600a6fb383ff2f08c10cb2c8765eeffe5523fd73f8fcc10beaea3148665374439503c57d21fe8c68aaac3d53f29cddb4a1bdc424fe5aa061 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/faceZones.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/faceZones.sha512 new file mode 100644 index 000000000000..fa124ee56e24 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/faceZones.sha512 @@ -0,0 +1 @@ +05f10d9efd21cfedd4a624e952e2296277c94cda7c2ee9a03982d6f9163dbef278839b4ffd53bbf74c133d1b45449744772d6282ff398dbbc59bd954259207b9 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/faces.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/faces.sha512 new file mode 100644 index 000000000000..026fe521c706 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/faces.sha512 @@ -0,0 +1 @@ +7fc85a34bf7a0168c7fb50484d71ad1c1dcb9d5b9896bd48533177bed7c3287380fb917913636398ac4445991a7770cec66dbc46b1aeb7f4456f22e9e35c826f diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/neighbour.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/neighbour.sha512 new file mode 100644 index 000000000000..f689ccd6d759 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/neighbour.sha512 @@ -0,0 +1 @@ +13578dc16890eb8cefcae072ff5d1db165d2d32104461dc241b4ff659ce5a8586b5aef18853a0a0fc33194ae7eb6b8400a5f68767f6b4c354dfb4027dc5de65b diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/owner.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/owner.sha512 new file mode 100644 index 000000000000..1aebc67386f7 --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/owner.sha512 @@ -0,0 +1 @@ +53dba72158ea0433376f60687be4b03bb69451aff7d8efe300bdcaf7fded53d5950a6475f715cfbb422d869e2df1371b6e849c3f25483d0340ce51e21cb166b5 diff --git a/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/points.sha512 b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/points.sha512 new file mode 100644 index 000000000000..42dd3f75d1cc --- /dev/null +++ b/Testing/Data/OpenFOAM/mixerGgi/processor3/constant/polyMesh/points.sha512 @@ -0,0 +1 @@ +ae77fc3dc824d7378a4d252d2e61ee752276a40fa7f18d2f4cc8cfa4553e2e9cfb44e8be30c912c9f0075eaa7f861711e7a5c3078714c0042ac3ad205f355030 -- GitLab From 897a852bf5853904e27be2bdfa92d48d1e74f842 Mon Sep 17 00:00:00 2001 From: Cory Quammen Date: Tue, 18 Oct 2022 13:32:17 -0400 Subject: [PATCH 15/18] vtkOpenGLProjectedTetrahedraMapper: move shader binding Move binding of the shader program needed for the projected tetrahedra rendering algorithm closer to where it is needed. This makes it less likely to interfere with other shader programs that may be used in the algorithm. --- .../vtkOpenGLProjectedTetrahedraMapper.cxx | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx index fa50151d7de9..2da083d4bd2d 100644 --- a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx +++ b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx @@ -338,32 +338,6 @@ void vtkOpenGLProjectedTetrahedraMapper::Render(vtkRenderer* renderer, vtkVolume vtkUnstructuredGridBase* input = this->GetInput(); vtkVolumeProperty* property = volume->GetProperty(); - // has something changed that would require us to recreate the shader? - if (!this->Tris.Program) - { - // build the shader source code - std::string VSSource = vtkglProjectedTetrahedraVS; - std::string FSSource = vtkglProjectedTetrahedraFS; - std::string GSSource; - - // compile and bind it if needed - vtkShaderProgram* newShader = renWin->GetShaderCache()->ReadyShaderProgram( - VSSource.c_str(), FSSource.c_str(), GSSource.c_str()); - - // if the shader changed reinitialize the VAO - if (newShader != this->Tris.Program) - { - this->Tris.Program = newShader; - this->Tris.VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed - } - - this->Tris.ShaderSourceTime.Modified(); - } - else - { - renWin->GetShaderCache()->ReadyShaderProgram(this->Tris.Program); - } - // Check to see if input changed. if ((this->InputAnalyzedTime < this->MTime) || (this->InputAnalyzedTime < input->GetMTime())) { @@ -548,6 +522,32 @@ void vtkOpenGLProjectedTetrahedraMapper::ProjectTetrahedra( vtkOpenGLCheckErrorMacro("failed at glBlitFramebuffer"); } + // has something changed that would require us to recreate the shader? + if (!this->Tris.Program) + { + // build the shader source code + std::string VSSource = vtkglProjectedTetrahedraVS; + std::string FSSource = vtkglProjectedTetrahedraFS; + std::string GSSource; + + // compile and bind it if needed + vtkShaderProgram* newShader = window->GetShaderCache()->ReadyShaderProgram( + VSSource.c_str(), FSSource.c_str(), GSSource.c_str()); + + // if the shader changed reinitialize the VAO + if (newShader != this->Tris.Program) + { + this->Tris.Program = newShader; + this->Tris.VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed + } + + this->Tris.ShaderSourceTime.Modified(); + } + else + { + window->GetShaderCache()->ReadyShaderProgram(this->Tris.Program); + } + // TODO: // There are some caching optimizations that could be used // here to skip various expensive operations (eg sorting -- GitLab From c02c0da638e315ae90eec0141ab82db477bde2a6 Mon Sep 17 00:00:00 2001 From: Cory Quammen Date: Tue, 18 Oct 2022 13:40:34 -0400 Subject: [PATCH 16/18] vtkOpenGLProjectedTetrahedraMapper: fix depth buffer blit Fix depth buffer copy when a floating point framebuffer is available. When the bit depth of VTK's render FBO and the one used by this mapper are not the same, direct blitting from one FBO to the other does not work. Fix that by separating the color buffer blit from the depth buffer blit. --- .../vtkOpenGLProjectedTetrahedraMapper.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx index 2da083d4bd2d..0ff757bd5ba3 100644 --- a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx +++ b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx @@ -495,9 +495,9 @@ void vtkOpenGLProjectedTetrahedraMapper::ProjectTetrahedra( this->AllocateFOResources(renderer); vtkOpenGLFramebufferObject* fo = nullptr; - - vtkOpenGLState* ostate = - static_cast(renderer->GetRenderWindow())->GetState(); + vtkOpenGLRenderWindow* renderWindow = + static_cast(renderer->GetRenderWindow()); + vtkOpenGLState* ostate = renderWindow->GetState(); // Copy existing Depth/Color buffers to FO if (this->UseFloatingPointFrameBuffer && this->CanDoFloatingPointFrameBuffer) @@ -516,8 +516,12 @@ void vtkOpenGLProjectedTetrahedraMapper::ProjectTetrahedra( } ostate->vtkglBlitFramebuffer(0, 0, this->CurrentFBOWidth, this->CurrentFBOHeight, 0, 0, - this->CurrentFBOWidth, this->CurrentFBOHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, - GL_NEAREST); + this->CurrentFBOWidth, this->CurrentFBOHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); + + // We need to treat depth buffer blitting specially because depth buffer formats may not + // be compatible between the FBO used in this class and the renderwindow's FBO. + renderWindow->TextureDepthBlit( + renderWindow->GetRenderFramebuffer()->GetDepthAttachmentAsTextureObject()); vtkOpenGLCheckErrorMacro("failed at glBlitFramebuffer"); } -- GitLab From d60adbd4f4b543a95f48697cef40c1d1837a3c1c Mon Sep 17 00:00:00 2001 From: Jaswant Panchumarti Date: Wed, 31 May 2023 20:16:02 -0400 Subject: [PATCH 17/18] Detect and handle incompatible depth attachment formats - When the depth formats are incompatible, sample the depth with shaders. Otherwise, blit color and depth attachments together. --- .../vtkOpenGLProjectedTetrahedraMapper.cxx | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx index 0ff757bd5ba3..3d750c736ef0 100644 --- a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx +++ b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx @@ -52,6 +52,7 @@ #include "vtkRenderer.h" #include "vtkShaderProgram.h" #include "vtkSmartPointer.h" +#include "vtkTextureObject.h" #include "vtkTimerLog.h" #include "vtkUnsignedCharArray.h" #include "vtkUnstructuredGrid.h" @@ -515,13 +516,28 @@ void vtkOpenGLProjectedTetrahedraMapper::ProjectTetrahedra( vtkErrorMacro("FO is incomplete "); } - ostate->vtkglBlitFramebuffer(0, 0, this->CurrentFBOWidth, this->CurrentFBOHeight, 0, 0, - this->CurrentFBOWidth, this->CurrentFBOHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); - + auto srcDepthTexture = + renderWindow->GetRenderFramebuffer()->GetDepthAttachmentAsTextureObject(); + auto dstDepthTexture = fo->GetDepthAttachmentAsTextureObject(); + const auto srcDepthFormat = srcDepthTexture->GetFormat(0, 0, false); + const auto dstDepthFormat = dstDepthTexture->GetFormat(0, 0, false); // We need to treat depth buffer blitting specially because depth buffer formats may not // be compatible between the FBO used in this class and the renderwindow's FBO. - renderWindow->TextureDepthBlit( - renderWindow->GetRenderFramebuffer()->GetDepthAttachmentAsTextureObject()); + if (srcDepthFormat == dstDepthFormat) + { + // compatible, blit color and depth attachments. + ostate->vtkglBlitFramebuffer(0, 0, this->CurrentFBOWidth, this->CurrentFBOHeight, 0, 0, + this->CurrentFBOWidth, this->CurrentFBOHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, + GL_NEAREST); + } + else + { + // incompatible, blit only color attachment + ostate->vtkglBlitFramebuffer(0, 0, this->CurrentFBOWidth, this->CurrentFBOHeight, 0, 0, + this->CurrentFBOWidth, this->CurrentFBOHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); + // depth values are sampled from srcDepthTexture into our framebuffer's depth attachment. + renderWindow->TextureDepthBlit(srcDepthTexture); + } vtkOpenGLCheckErrorMacro("failed at glBlitFramebuffer"); } -- GitLab From 2184a4cd9fa32c636f3622338b33bd1b1ce9ae1b Mon Sep 17 00:00:00 2001 From: Joachim Pouderoux Date: Thu, 25 May 2023 21:49:30 +0200 Subject: [PATCH 18/18] Add support for rotations in VRML Transform nodes Also fixes crash if tabs are used as values separators --- .../Data/Baseline/VRMLImporter.png.sha512 | 2 +- IO/Import/vtkVRMLImporter.cxx | 8 +++++ IO/Import/vtkVRMLImporter_Yacc.h | 36 +++++++++++-------- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/IO/Import/Testing/Data/Baseline/VRMLImporter.png.sha512 b/IO/Import/Testing/Data/Baseline/VRMLImporter.png.sha512 index 855d66989cad..28c72132ff82 100644 --- a/IO/Import/Testing/Data/Baseline/VRMLImporter.png.sha512 +++ b/IO/Import/Testing/Data/Baseline/VRMLImporter.png.sha512 @@ -1 +1 @@ -5d701e1c8c2be0de4bb93a18bdba7e189691a94f0c1aa6849af5329ad38a67e8b6a4a5d8afab41c268ee06bb2df96d642f22dac9eab2507b34591829d4d3f114 +e76248fe10bc14d59f775e28b0d39852a9718e9b0e205eeb565c0d2e51922705f4069f78ae5c66c9c2969dbed9f5350b68d97011ef6f53085475e0d0244ad792 diff --git a/IO/Import/vtkVRMLImporter.cxx b/IO/Import/vtkVRMLImporter.cxx index 6b62d567efc4..06c8e383277d 100644 --- a/IO/Import/vtkVRMLImporter.cxx +++ b/IO/Import/vtkVRMLImporter.cxx @@ -41,6 +41,7 @@ #include "vtkIdTypeArray.h" #include "vtkLight.h" #include "vtkLookupTable.h" +#include "vtkMath.h" #include "vtkNew.h" #include "vtkObjectFactory.h" #include "vtkPointData.h" @@ -928,6 +929,13 @@ void vtkVRMLImporter::exitField() this->DeleteObject(this->Parser->yylval.vec3f); this->Parser->yylval.vec3f = nullptr; } + // For the translation field of the Transform node + else if (fieldName == "rotation" && nodeTypeName == "Transform") + { + float angle = vtkMath::DegreesFromRadians(this->Parser->yylval.vec4f[3]); + this->CurrentTransform->RotateWXYZ(angle, this->Parser->yylval.vec4f[0], + this->Parser->yylval.vec4f[1], this->Parser->yylval.vec4f[2]); + } // For the scale field of the transform node else if (fieldName == "scale" && nodeTypeName == "Transform") { diff --git a/IO/Import/vtkVRMLImporter_Yacc.h b/IO/Import/vtkVRMLImporter_Yacc.h index fca0fbef4900..adc461eda96d 100644 --- a/IO/Import/vtkVRMLImporter_Yacc.h +++ b/IO/Import/vtkVRMLImporter_Yacc.h @@ -164,6 +164,7 @@ public: vtkFloatArray *vec2f; vtkIdTypeArray *mfint32; int sfint; + float vec4f[4]; } YYSTYPE; @@ -4481,8 +4482,8 @@ int vtkVRMLYaccData::yylex ( vtkVRMLImporter* self ) { // .. add to array... float num[2]; - num[0] = atof(strtok(yytext, " ")); - num[1] = atof(strtok(nullptr, " ")); + num[0] = atof(strtok(yytext, " \t")); + num[1] = atof(strtok(nullptr, " \t")); // equivalent to: sscanf(yytext, "%f %f", &num[0], &num[1]); yylval.vec2f->InsertNextTuple(num); } @@ -4498,9 +4499,9 @@ int vtkVRMLYaccData::yylex ( vtkVRMLImporter* self ) { BEGIN NODE; expectToken = 0; float num[3]; yylval.vec3f = self->PointsNew(); - num[0] = atof(strtok(yytext, " ")); - num[1] = atof(strtok(nullptr, " ")); - num[2] = atof(strtok(nullptr, " ")); + num[0] = atof(strtok(yytext, " \t")); + num[1] = atof(strtok(nullptr, " \t")); + num[2] = atof(strtok(nullptr, " \t")); //sscanf(yytext, "%f %f %f", &num[0], &num[1], &num[2]); yylval.vec3f->InsertPoint(0, num); return SFVEC3F; } @@ -4508,9 +4509,9 @@ int vtkVRMLYaccData::yylex ( vtkVRMLImporter* self ) YY_USER_ACTION { if (parsing_mf) { /* .. add to array... */ float num[3]; - num[0] = atof(strtok(yytext, " ")); - num[1] = atof(strtok(nullptr, " ")); - num[2] = atof(strtok(nullptr, " ")); + num[0] = atof(strtok(yytext, " \t")); + num[1] = atof(strtok(nullptr, " \t")); + num[2] = atof(strtok(nullptr, " \t")); //sscanf(yytext, "%f %f %f", &num[0], &num[1], &num[2]); yylval.vec3f->InsertNextPoint(num); //return MFVEC3F; @@ -4523,7 +4524,12 @@ int vtkVRMLYaccData::yylex ( vtkVRMLImporter* self ) YY_BREAK case 31: YY_USER_ACTION - { BEGIN NODE; expectToken = 0; return SFROTATION; } + { BEGIN NODE; expectToken = 0; + yylval.vec4f[0] = atof(strtok(yytext, " \t")); + yylval.vec4f[1] = atof(strtok(nullptr, " \t")); + yylval.vec4f[2] = atof(strtok(nullptr, " \t")); + yylval.vec4f[3] = atof(strtok(nullptr, " \t")); + return SFROTATION; } case 32: YY_USER_ACTION { if (parsing_mf) ; /* .. add to array... */ @@ -4537,9 +4543,9 @@ int vtkVRMLYaccData::yylex ( vtkVRMLImporter* self ) { BEGIN NODE; expectToken = 0; float num[3]; yylval.vec3f = self->PointsNew(); - num[0] = atof(strtok(yytext, " ")); - num[1] = atof(strtok(nullptr, " ")); - num[2] = atof(strtok(nullptr, " ")); + num[0] = atof(strtok(yytext, " \t")); + num[1] = atof(strtok(nullptr, " \t")); + num[2] = atof(strtok(nullptr, " \t")); //sscanf(yytext, "%f %f %f", &num[0], &num[1], &num[2]); yylval.vec3f->InsertPoint(0, num); return SFCOLOR; } @@ -4547,9 +4553,9 @@ int vtkVRMLYaccData::yylex ( vtkVRMLImporter* self ) YY_USER_ACTION { if (parsing_mf) { /* .. add to array... */ float num[3]; - num[0] = atof(strtok(yytext, " ")); - num[1] = atof(strtok(nullptr, " ")); - num[2] = atof(strtok(nullptr, " ")); + num[0] = atof(strtok(yytext, " \t")); + num[1] = atof(strtok(nullptr, " \t")); + num[2] = atof(strtok(nullptr, " \t")); yylval.vec3f->InsertNextPoint(num); } else { -- GitLab