----------------------------------------------------------------------------
| 1820 | |
| 1821 | //---------------------------------------------------------------------------- |
| 1822 | int vtkFiniteElementFieldDistributor::RequestData(vtkInformation* vtkNotUsed(request), |
| 1823 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 1824 | { |
| 1825 | this->Internals->ResetFemSpecs(); |
| 1826 | |
| 1827 | vtkPartitionedDataSetCollection* input = vtkPartitionedDataSetCollection::GetData(inputVector[0]); |
| 1828 | vtkPartitionedDataSetCollection* output = vtkPartitionedDataSetCollection::GetData(outputVector); |
| 1829 | |
| 1830 | // Look for special string array containing information records. |
| 1831 | vtkFieldData* fd = input->GetFieldData(); |
| 1832 | vtkStringArray* infoRecords = vtkStringArray::SafeDownCast(fd->GetAbstractArray(infoRecordName)); |
| 1833 | if (infoRecords == nullptr) |
| 1834 | { |
| 1835 | vtkErrorMacro(<< "Failed to find a string array - " << infoRecordName); |
| 1836 | return 0; |
| 1837 | } |
| 1838 | |
| 1839 | // Parse the information records. |
| 1840 | int refElementOrder = 0; |
| 1841 | std::unordered_set<std::string> elementBlockNames; |
| 1842 | for (vtkIdType i = 0; i < infoRecords->GetNumberOfValues(); ++i) |
| 1843 | { |
| 1844 | const auto& record = infoRecords->GetValue(i); |
| 1845 | ::vtkFiniteElementSpec* femSpec = nullptr; |
| 1846 | |
| 1847 | const std::vector<std::string> data = ::Split(record, "::"); |
| 1848 | // Examples: |
| 1849 | // "HDIV::eblock-0_0_0::CG::basis::Intrepid2_HDIV_HEX_I1_FEM" |
| 1850 | // 0 1 2 3 4 |
| 1851 | // |
| 1852 | // "HGRAD::eblock-0_0::DG::basis::Intrepid2_HGRAD_QUAD_C2_FEM" |
| 1853 | // 0 1 2 3 4 |
| 1854 | // |
| 1855 | // "HCURL::eblock-0_0_0::CG::basis::Intrepid2_HCURL_HEX_I1_FEM" |
| 1856 | // 0 1 2 3 4 |
| 1857 | // |
| 1858 | // "HCURL::eblock-0_0_0::CG::field::E_Field" |
| 1859 | // 0 1 2 3 4 |
| 1860 | if (data.size() < 5) |
| 1861 | { |
| 1862 | continue; |
| 1863 | } |
| 1864 | // within this context, an entity is either a basis or a field. |
| 1865 | const std::string& basisType = data[0]; |
| 1866 | const std::string& blockName = data[1]; |
| 1867 | const std::string& galerkinType = data[2]; |
| 1868 | const std::string& entityType = data[3]; |
| 1869 | const std::string& entityName = data[4]; |
| 1870 | // Look for valid FEM element callouts. |
| 1871 | if (!(basisType == "HCURL" || basisType == "HDIV" || basisType == "HGRAD")) |
| 1872 | { |
| 1873 | continue; |
| 1874 | } |
| 1875 | // our concern is only those element blocks which have FEM element type callouts. |
| 1876 | elementBlockNames.insert(blockName); |
| 1877 | |
| 1878 | femSpec = &(this->Internals->femSpecs[basisType]); |
| 1879 |
nothing calls this directly
no test coverage detected