MCPcopy Create free account
hub / github.com/Kitware/VTK / AllocPlanarGeometry

Method AllocPlanarGeometry

IO/NetCDF/vtkMPASReader.cxx:1819–1915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1817}
1818
1819int vtkMPASReader::AllocPlanarGeometry()
1820{
1821 int varid;
1822 CHECK_VAR("xCell", varid);
1823 this->PointX = new double[this->NumberOfPoints];
1824 if (!this->Internals->ValidateDimensions(varid, false, 1, "nCells"))
1825 {
1826 return 0;
1827 }
1828 size_t start_pt[] = { 0 };
1829 size_t count_pt[] = { this->NumberOfPoints };
1830 if (this->Internals->nc_err(nc_get_vara_double(
1831 this->Internals->ncFile, varid, start_pt, count_pt, this->PointX + this->PointOffset)))
1832 {
1833 return 0;
1834 }
1835 // point 0 is 0.0
1836 this->PointX[0] = 0.0;
1837
1838 CHECK_VAR("yCell", varid);
1839 this->PointY = new double[this->NumberOfPoints];
1840 if (!this->Internals->ValidateDimensions(varid, false, 1, "nCells"))
1841 {
1842 return 0;
1843 }
1844 if (this->Internals->nc_err(nc_get_vara_double(
1845 this->Internals->ncFile, varid, start_pt, count_pt, this->PointY + this->PointOffset)))
1846 {
1847 return 0;
1848 }
1849 // point 0 is 0.0
1850 this->PointY[0] = 0.0;
1851
1852 CHECK_VAR("zCell", varid);
1853 this->PointZ = new double[this->NumberOfPoints];
1854 if (!this->Internals->ValidateDimensions(varid, false, 1, "nCells"))
1855 {
1856 return 0;
1857 }
1858 if (this->Internals->nc_err(nc_get_vara_double(
1859 this->Internals->ncFile, varid, start_pt, count_pt, this->PointZ + this->PointOffset)))
1860 {
1861 return 0;
1862 }
1863 // point 0 is 0.0
1864 this->PointZ[0] = 0.0;
1865
1866 CHECK_VAR("cellsOnVertex", varid);
1867 this->OrigConnections = new int[this->NumberOfCells * this->PointsPerCell];
1868 // TODO Spec says dims should be '3', 'nVertices', but my example files
1869 // use nVertices, vertexDegree...
1870 if (!this->Internals->ValidateDimensions(varid, false, 2, "nVertices", "vertexDegree"))
1871 {
1872 return 0;
1873 }
1874 size_t start_conn[] = { 0, 0 };
1875 size_t count_conn[] = { this->NumberOfCells, this->PointsPerCell };
1876 if (this->Internals->nc_err(nc_get_vara_int(

Callers 1

ReadAndOutputGridMethod · 0.95

Calls 5

nc_get_vara_doubleFunction · 0.85
nc_get_vara_intFunction · 0.85
ValidateDimensionsMethod · 0.80
nc_var_idMethod · 0.80
nc_errMethod · 0.45

Tested by

no test coverage detected