| 900 | } |
| 901 | |
| 902 | Ioss::Region* vtkIOSSReaderInternal::GetRegion( |
| 903 | const std::string& dbasename, int fileid, Ioss::DatabaseUsage dbUsage) |
| 904 | { |
| 905 | assert(fileid >= 0); |
| 906 | auto iter = this->DatabaseNames.find(dbasename); |
| 907 | assert(iter != this->DatabaseNames.end()); |
| 908 | |
| 909 | const bool has_multiple_files = (iter->second.ProcessCount > 0); |
| 910 | assert(has_multiple_files == false || (fileid < static_cast<int>(iter->second.Ranks.size()))); |
| 911 | |
| 912 | auto processor = has_multiple_files ? *std::next(iter->second.Ranks.begin(), fileid) : 0; |
| 913 | |
| 914 | auto riter = this->RegionMap.find(std::make_pair(dbasename, processor)); |
| 915 | if (riter == this->RegionMap.end()) |
| 916 | { |
| 917 | Ioss::PropertyManager properties; |
| 918 | if (has_multiple_files) |
| 919 | { |
| 920 | properties.add(Ioss::Property("my_processor", processor)); |
| 921 | properties.add(Ioss::Property("processor_count", iter->second.ProcessCount)); |
| 922 | } |
| 923 | #ifdef SEACAS_HAVE_MPI_WITH_ALL_BACKENDS |
| 924 | else |
| 925 | { |
| 926 | properties.add(Ioss::Property("DECOMPOSITION_METHOD", "Linear")); |
| 927 | } |
| 928 | #endif |
| 929 | |
| 930 | // tell the reader to read all blocks, even if empty. necessary to avoid |
| 931 | // having to read all files to gather metadata, if possible |
| 932 | // see paraview/paraview#20873. |
| 933 | properties.add(Ioss::Property("RETAIN_EMPTY_BLOCKS", "on")); |
| 934 | |
| 935 | // strip trailing underscores in CGNS files to turn separate fields into |
| 936 | // vectors with components. |
| 937 | // see https://github.com/sandialabs/seacas/issues/265 |
| 938 | properties.add(Ioss::Property("FIELD_STRIP_TRAILING_UNDERSCORE", "on")); |
| 939 | |
| 940 | // Do not convert variable names to lower case. The default is on. |
| 941 | // For ex: this resolves a misunderstanding b/w T (temperature) vs t (time) |
| 942 | properties.add(Ioss::Property("LOWER_CASE_VARIABLE_NAMES", "off")); |
| 943 | |
| 944 | // Only read timestep information from 0th file. |
| 945 | properties.add(Ioss::Property("EXODUS_CALL_GET_ALL_TIMES", processor == 0 ? "on" : "off")); |
| 946 | |
| 947 | // Split side sets into side-blocks by the element block of the originating side. |
| 948 | // This allows rendering sides with partial scalars inherited from the element block. |
| 949 | properties.add(Ioss::Property("SURFACE_SPLIT_TYPE", "BLOCK")); |
| 950 | |
| 951 | // Fillup with user-specified properties. |
| 952 | Ioss::NameList names; |
| 953 | this->DatabaseProperties.describe(&names); |
| 954 | |
| 955 | for (const auto& name : names) |
| 956 | { |
| 957 | properties.add(this->DatabaseProperties.get(name)); |
| 958 | } |
| 959 |
no test coverage detected