------------------------------------------------------------------------------
| 824 | |
| 825 | //------------------------------------------------------------------------------ |
| 826 | int vtkSLACReader::RequestData(vtkInformation* request, |
| 827 | vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) |
| 828 | { |
| 829 | vtkInformation* outInfo[NUM_OUTPUTS]; |
| 830 | for (int i = 0; i < NUM_OUTPUTS; i++) |
| 831 | { |
| 832 | outInfo[i] = outputVector->GetInformationObject(i); |
| 833 | } |
| 834 | |
| 835 | vtkMultiBlockDataSet* surfaceOutput = vtkMultiBlockDataSet::GetData(outInfo[SURFACE_OUTPUT]); |
| 836 | vtkMultiBlockDataSet* volumeOutput = vtkMultiBlockDataSet::GetData(outInfo[VOLUME_OUTPUT]); |
| 837 | |
| 838 | if (!this->MeshFileName) |
| 839 | { |
| 840 | vtkErrorMacro("No filename specified."); |
| 841 | return 0; |
| 842 | } |
| 843 | |
| 844 | double time = 0.0; |
| 845 | bool timeValid = false; |
| 846 | int fromPort = request->Get(vtkExecutive::FROM_OUTPUT_PORT()); |
| 847 | if (outInfo[fromPort]->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP())) |
| 848 | { |
| 849 | time = outInfo[fromPort]->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()); |
| 850 | timeValid = true; |
| 851 | } |
| 852 | |
| 853 | if (this->FrequencyModes) |
| 854 | { |
| 855 | this->Internal->Phases.resize(this->Internal->Frequencies.size()); |
| 856 | for (size_t modeIndex = 0; modeIndex < this->Internal->Frequencies.size(); modeIndex++) |
| 857 | { |
| 858 | this->Internal->Phases[modeIndex] = |
| 859 | 2.0 * vtkMath::Pi() * (time * this->Internal->Frequencies[modeIndex]); |
| 860 | } |
| 861 | } |
| 862 | else |
| 863 | { |
| 864 | this->Internal->Phases.clear(); |
| 865 | } |
| 866 | |
| 867 | int readMesh = !this->MeshUpToDate(); |
| 868 | |
| 869 | // This convenience object holds the composite of the surface and volume |
| 870 | // outputs. Since each of these outputs is multiblock (and needs iterators) |
| 871 | // anyway, then subroutines can just iterate over everything once. |
| 872 | VTK_CREATE(vtkMultiBlockDataSet, compositeOutput); |
| 873 | |
| 874 | if (readMesh) |
| 875 | { |
| 876 | this->Internal->MidpointIdCache.RemoveAllMidpoints(); |
| 877 | this->Internal->MeshCache = vtkSmartPointer<vtkMultiBlockDataSet>::New(); |
| 878 | |
| 879 | vtkSLACReaderAutoCloseNetCDF meshFD(this->MeshFileName, NC_NOWRITE); |
| 880 | if (!meshFD.Valid()) |
| 881 | return 0; |
| 882 | |
| 883 | if (!this->ReadInternalVolume && !this->ReadExternalSurface) |
nothing calls this directly
no test coverage detected