------------------------------------------------------------------------------
| 892 | |
| 893 | //------------------------------------------------------------------------------ |
| 894 | void vtkEnSightWriter::WriteCaseFile(int TotalTimeSteps) |
| 895 | { |
| 896 | |
| 897 | vtkUnstructuredGrid* input = this->GetInput(); |
| 898 | int i; |
| 899 | |
| 900 | this->ComputeNames(); |
| 901 | |
| 902 | if (!this->BaseName) |
| 903 | { |
| 904 | vtkErrorMacro("A FileName or Path/BaseName must be specified."); |
| 905 | return; |
| 906 | } |
| 907 | |
| 908 | char charBuffer[1024]; |
| 909 | auto result = vtk::format_to_n(charBuffer, sizeof(charBuffer), "{:s}/{:s}.{:d}.case", this->Path, |
| 910 | this->BaseName, this->ProcessNumber); |
| 911 | *result.out = '\0'; |
| 912 | |
| 913 | // open the geometry file |
| 914 | FILE* fd = nullptr; |
| 915 | if (!(fd = OpenFile(charBuffer))) |
| 916 | { |
| 917 | return; |
| 918 | } |
| 919 | |
| 920 | this->WriteTerminatedStringToFile("FORMAT\n", fd); |
| 921 | this->WriteTerminatedStringToFile("type: ensight gold\n\n", fd); |
| 922 | this->WriteTerminatedStringToFile("\nGEOMETRY\n", fd); |
| 923 | |
| 924 | // write the geometry file |
| 925 | if (!this->TransientGeometry) |
| 926 | { |
| 927 | result = vtk::format_to_n(charBuffer, sizeof(charBuffer), "model: {:s}.{:d}.00000.geo\n", |
| 928 | this->BaseName, this->ProcessNumber); |
| 929 | *result.out = '\0'; |
| 930 | this->WriteTerminatedStringToFile(charBuffer, fd); |
| 931 | } |
| 932 | else |
| 933 | { |
| 934 | result = vtk::format_to_n(charBuffer, sizeof(charBuffer), "model: 1 {:s}.{:d}.*****.geo\n", |
| 935 | this->BaseName, this->ProcessNumber); |
| 936 | *result.out = '\0'; |
| 937 | this->WriteTerminatedStringToFile(charBuffer, fd); |
| 938 | } |
| 939 | |
| 940 | this->WriteTerminatedStringToFile("\nVARIABLE\n", fd); |
| 941 | |
| 942 | char fileBuffer[256]; |
| 943 | |
| 944 | // write the Node variable files |
| 945 | for (i = 0; i < input->GetPointData()->GetNumberOfArrays(); i++) |
| 946 | { |
| 947 | |
| 948 | strcpy(fileBuffer, input->GetPointData()->GetArray(i)->GetName()); |
| 949 | // skip arrays that were not written |
| 950 | if (strcmp(fileBuffer, "GlobalElementId") == 0) |
| 951 | { |
no test coverage detected