Lines Matching refs:s
117 static PetscErrorCode DMPlexCreateFluent_ReadSection(PetscViewer viewer, FluentSection *s) in DMPlexCreateFluent_ReadSection() argument
126 snum = sscanf(buffer, "%d", &s->index); in DMPlexCreateFluent_ReadSection()
129 s->index = -1; in DMPlexCreateFluent_ReadSection()
133 if (s->index == 0) { /* Comment */ in DMPlexCreateFluent_ReadSection()
136 } else if (s->index == 2) { /* Dimension */ in DMPlexCreateFluent_ReadSection()
138 snum = sscanf(buffer, "%d", &s->nd); in DMPlexCreateFluent_ReadSection()
141 } else if (s->index == 10 || s->index == 2010) { /* Vertices */ in DMPlexCreateFluent_ReadSection()
145 snum = sscanf(buffer, "(%x %x %x %d %d)", &s->zoneID, &s->first, &s->last, &s->type, &s->nd); in DMPlexCreateFluent_ReadSection()
147 if (s->zoneID > 0) { in DMPlexCreateFluent_ReadSection()
148 PetscInt numCoords = s->last - s->first + 1; in DMPlexCreateFluent_ReadSection()
150 PetscCall(PetscMalloc1(s->nd * numCoords, (PetscScalar **)&s->data)); in DMPlexCreateFluent_ReadSection()
151 …PetscCall(DMPlexCreateFluent_ReadValues(viewer, s->data, s->nd * numCoords, PETSC_SCALAR, s->index… in DMPlexCreateFluent_ReadSection()
158 } else if (s->index == 12 || s->index == 2012) { /* Cells */ in DMPlexCreateFluent_ReadSection()
162 snum = sscanf(buffer, "(%x", &s->zoneID); in DMPlexCreateFluent_ReadSection()
164 if (s->zoneID == 0) { /* Header section */ in DMPlexCreateFluent_ReadSection()
165 snum = sscanf(buffer, "(%x %x %x %d)", &s->zoneID, &s->first, &s->last, &s->nd); in DMPlexCreateFluent_ReadSection()
168 snum = sscanf(buffer, "(%x %x %x %d %d)", &s->zoneID, &s->first, &s->last, &s->type, &s->nd); in DMPlexCreateFluent_ReadSection()
170 if (s->nd == 0) { in DMPlexCreateFluent_ReadSection()
172 PetscInt numCells = s->last - s->first + 1; in DMPlexCreateFluent_ReadSection()
174 PetscCall(PetscMalloc1(numCells, (PetscInt **)&s->data)); in DMPlexCreateFluent_ReadSection()
175 …PetscCall(DMPlexCreateFluent_ReadValues(viewer, s->data, numCells, PETSC_INT, s->index == 2012 ? P… in DMPlexCreateFluent_ReadSection()
183 } else if (s->index == 13 || s->index == 2013) { /* Faces */ in DMPlexCreateFluent_ReadSection()
187 snum = sscanf(buffer, "(%x", &s->zoneID); in DMPlexCreateFluent_ReadSection()
189 if (s->zoneID == 0) { /* Header section */ in DMPlexCreateFluent_ReadSection()
190 snum = sscanf(buffer, "(%x %x %x %d)", &s->zoneID, &s->first, &s->last, &s->nd); in DMPlexCreateFluent_ReadSection()
195 snum = sscanf(buffer, "(%x %x %x %d %d)", &s->zoneID, &s->first, &s->last, &s->type, &s->nd); in DMPlexCreateFluent_ReadSection()
198 switch (s->nd) { in DMPlexCreateFluent_ReadSection()
214 numFaces = s->last - s->first + 1; in DMPlexCreateFluent_ReadSection()
217 PetscCall(PetscMalloc1(numEntries * numFaces, (PetscInt **)&s->data)); in DMPlexCreateFluent_ReadSection()
220 if (s->nd == 0) { in DMPlexCreateFluent_ReadSection()
223 …PetscCall(DMPlexCreateFluent_ReadValues(viewer, &numFaceVert, 1, PETSC_INT, s->index == 2013 ? PET… in DMPlexCreateFluent_ReadSection()
226 PetscCall(PetscMalloc1(maxsize, (PetscInt **)&s->data)); in DMPlexCreateFluent_ReadSection()
232 PetscCall(PetscArraycpy(tmp, (PetscInt *)s->data, maxsize)); in DMPlexCreateFluent_ReadSection()
233 PetscCall(PetscFree(s->data)); in DMPlexCreateFluent_ReadSection()
235 s->data = tmp; in DMPlexCreateFluent_ReadSection()
238 ((PetscInt *)s->data)[offset] = numFaceVert; in DMPlexCreateFluent_ReadSection()
242 …l(DMPlexCreateFluent_ReadValues(viewer, &(((PetscInt *)s->data)[offset]), numEntries, PETSC_INT, s… in DMPlexCreateFluent_ReadSection()
245 if (s->nd != 0) PetscCall(PetscMPIIntCast(numEntries - 2, &s->nd)); in DMPlexCreateFluent_ReadSection()
252 } else if (s->index == 39) { /* Label information */ in DMPlexCreateFluent_ReadSection()
257 snum = sscanf(buffer, "(%u %s %s %d)", &s->zoneID, caseName, labelName, &s->nd); in DMPlexCreateFluent_ReadSection()
268 PetscCall(PetscStrallocpy(labelName, (char **)&s->data)); in DMPlexCreateFluent_ReadSection()
269 … PetscCall(PetscInfo((PetscObject)viewer, "CASE: Zone ID %u is label %s\n", s->zoneID, labelName)); in DMPlexCreateFluent_ReadSection()
709 FluentSection s; in DMPlexCreateFluent() local
711 s.data = NULL; in DMPlexCreateFluent()
714 PetscCall(DMPlexCreateFluent_ReadSection(viewer, &s)); in DMPlexCreateFluent()
715 if (s.index == 2) { /* Dimension */ in DMPlexCreateFluent()
716 dim = s.nd; in DMPlexCreateFluent()
718 } else if (s.index == 10 || s.index == 2010) { /* Vertices */ in DMPlexCreateFluent()
719 if (s.zoneID == 0) { in DMPlexCreateFluent()
720 numVertices = s.last; in DMPlexCreateFluent()
725 coordsIn = (PetscScalar *)s.data; in DMPlexCreateFluent()
728 } else if (s.index == 12 || s.index == 2012) { /* Cells */ in DMPlexCreateFluent()
729 if (s.zoneID == 0) { in DMPlexCreateFluent()
730 numCells = s.last; in DMPlexCreateFluent()
734 …etscInt c = 0; c < numCells; ++c) PetscCall(GetNumCellFaces(s.nd ? s.nd : (int)((PetscInt *)s.data… in DMPlexCreateFluent()
735 PetscCall(PetscFree(s.data)); in DMPlexCreateFluent()
736 …viewer, "CASE: Found number of cell faces %" PetscInt_FMT "\n", numCells && s.nd ? cellSizes[0] : … in DMPlexCreateFluent()
738 } else if (s.index == 13 || s.index == 2013) { /* Facets */ in DMPlexCreateFluent()
739 if (s.zoneID == 0) { /* Header section */ in DMPlexCreateFluent()
740 numFaces = (PetscInt)(s.last - s.first + 1); in DMPlexCreateFluent()
741 …ject)viewer, "CASE: Found number of faces %" PetscInt_FMT " face vertices: %d\n", numFaces, s.nd)); in DMPlexCreateFluent()
749 for (unsigned int z = s.first - 1; z < s.last; z++) { in DMPlexCreateFluent()
750 faceZoneIDs[z] = s.zoneID; in DMPlexCreateFluent()
751 if (s.nd) { in DMPlexCreateFluent()
752 faceSizes[z] = s.nd; in DMPlexCreateFluent()
754 faceSizes[z] = ((PetscInt *)s.data)[offset]; in DMPlexCreateFluent()
762 doffset = s.nd ? 0 : 1; in DMPlexCreateFluent()
770 const PetscInt Nfz = s.last - s.first + 1; in DMPlexCreateFluent()
772 const PetscInt face = f + s.first - 1; in DMPlexCreateFluent()
775 … for (PetscInt v = 0; v < faceSize; ++v) faces[offset + v] = ((PetscInt *)s.data)[doffset + v]; in DMPlexCreateFluent()
776 faceAdjCell[face * 2 + 0] = ((PetscInt *)s.data)[doffset + faceSize + 0]; in DMPlexCreateFluent()
777 faceAdjCell[face * 2 + 1] = ((PetscInt *)s.data)[doffset + faceSize + 1]; in DMPlexCreateFluent()
779 doffset += faceSize + (s.nd ? 2 : 3); in DMPlexCreateFluent()
781 PetscCall(PetscFree(s.data)); in DMPlexCreateFluent()
783 } else if (s.index == 39) { /* Label information */ in DMPlexCreateFluent()
784 if (s.zoneID >= maxZoneID) { in DMPlexCreateFluent()
789 while (newmax < s.zoneID + 1) newmax *= 2; in DMPlexCreateFluent()
800 zoneNames[s.zoneID] = (const char *)s.data; in DMPlexCreateFluent()
802 } while (s.index >= 0); in DMPlexCreateFluent()
844 PetscSection s; in DMPlexCreateFluent() local
848 PetscCall(DMPlexGetConeSection(*dm, &s)); in DMPlexCreateFluent()
849 PetscCall(PetscSectionGetConstrainedStorageSize(s, &csize)); in DMPlexCreateFluent()