Lines Matching refs:layout
94 …youtCreate(PetscMPIInt size, const PetscInt eextent[3], const PetscInt vextent[3], ZLayout *layout) in ZLayoutCreate() argument
97 layout->eextent.i = eextent[0]; in ZLayoutCreate()
98 layout->eextent.j = eextent[1]; in ZLayoutCreate()
99 layout->eextent.k = eextent[2]; in ZLayoutCreate()
100 layout->vextent.i = vextent[0]; in ZLayoutCreate()
101 layout->vextent.j = vextent[1]; in ZLayoutCreate()
102 layout->vextent.k = vextent[2]; in ZLayoutCreate()
103 layout->comm_size = size; in ZLayoutCreate()
104 layout->zstarts = NULL; in ZLayoutCreate()
105 PetscCall(PetscMalloc1(size + 1, &layout->zstarts)); in ZLayoutCreate()
109 layout->zstarts[0] = 0; in ZLayoutCreate()
117 if (IjkActive(layout->eextent, trial)) { in ZLayoutCreate()
170 for (; z <= ZEncode(layout->vextent); z++) { in ZLayoutCreate()
172 if (IjkActive(layout->eextent, loc)) break; in ZLayoutCreate()
175 layout->zstarts[r + 1] = z; in ZLayoutCreate()
177 layout->zstarts[size] = ZEncode(layout->vextent); in ZLayoutCreate()
181 static PetscInt ZLayoutElementsOnRank(const ZLayout *layout, PetscMPIInt rank) in ZLayoutElementsOnRank() argument
184 for (ZCode rz = layout->zstarts[rank]; rz < layout->zstarts[rank + 1]; rz++) { in ZLayoutElementsOnRank()
186 if (IjkActive(layout->eextent, loc)) remote_elem++; in ZLayoutElementsOnRank()
210 …DMPlexCreateBoxMesh_Tensor_SFC_Periodicity_Private(DM dm, const ZLayout *layout, const ZCode *vert… in DMPlexCreateBoxMesh_Tensor_SFC_Periodicity_Private() argument
257 PetscCall(PetscMPIIntCast(ZCodeFind(z, size + 1, layout->zstarts), &remote_rank)); in DMPlexCreateBoxMesh_Tensor_SFC_Periodicity_Private()
260 for (ZCode rz = layout->zstarts[remote_rank]; rz < layout->zstarts[remote_rank + 1]; rz++) { in DMPlexCreateBoxMesh_Tensor_SFC_Periodicity_Private()
270 if (IjkActive(layout->vextent, loc)) remote_count++; in DMPlexCreateBoxMesh_Tensor_SFC_Periodicity_Private()
1206 ZLayout layout; in DMPlexCreateBoxMesh_Tensor_SFC_Internal() local
1207 PetscCall(ZLayoutCreate(size, eextent, vextent, &layout)); in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1211 for (ZCode z = layout.zstarts[rank]; z < layout.zstarts[rank + 1]; z++) { in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1213 if (IjkActive(layout.vextent, loc)) PetscCall(PetscZSetAdd(vset, z)); in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1218 if (IjkActive(layout.eextent, loc)) { in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1243 for (ZCode z = layout.zstarts[rank]; z < layout.zstarts[rank + 1]; z++) { in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1245 if (!IjkActive(layout.eextent, loc)) { in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1270 PetscInt owned_verts = ZCodeFind(layout.zstarts[rank + 1], local_verts, vert_z); in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1281 PetscCall(PetscMPIIntCast(ZCodeFind(z, size + 1, layout.zstarts), &remote_rank)); in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1286 PetscInt remote_elem = ZLayoutElementsOnRank(&layout, remote_rank); in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1289 for (ZCode rz = layout.zstarts[remote_rank]; rz < layout.zstarts[remote_rank + 1]; rz++) { in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1299 if (IjkActive(layout.vextent, loc)) remote_count++; in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1332 coords[v * dim + 0] = lower[0] + loc.i * (upper[0] - lower[0]) / layout.eextent.i; in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1333 … if (dim > 1) coords[v * dim + 1] = lower[1] + loc.j * (upper[1] - lower[1]) / layout.eextent.j; in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1334 … if (dim > 2) coords[v * dim + 2] = lower[2] + loc.k * (upper[2] - lower[2]) / layout.eextent.k; in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1366 bc_count[1] += loc.i == layout.vextent.i - 1; in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1368 bc_count[3] += loc.j == layout.vextent.j - 1; in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1370 bc_count[5] += loc.k == layout.vextent.k - 1; in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1415 …PetscCall(DMPlexCreateBoxMesh_Tensor_SFC_Periodicity_Private(dm, &layout, vert_z, per_faces, lower… in DMPlexCreateBoxMesh_Tensor_SFC_Internal()
1423 PetscCall(PetscFree(layout.zstarts)); in DMPlexCreateBoxMesh_Tensor_SFC_Internal()