Bug Summary

File:dm/impls/plex/plexrefine.c
Warning:line 20, column 37
Array access (from variable 'depthSize') results in a null pointer dereference

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1#include <petsc/private/dmpleximpl.h> /*I "petscdmplex.h" I*/
2#include <petscsf.h>
3
4const char * const CellRefiners[] = {"NOOP", "SIMPLEX_1D", "SIMPLEX_2D", "HYBRID_SIMPLEX_2D", "SIMPLEX_TO_HEX_2D", "HYBRID_SIMPLEX_TO_HEX_2D", "HEX_2D", "HYBRID_HEX_2D",
5 "SIMPLEX_3D", "HYBRID_SIMPLEX_3D", "SIMPLEX_TO_HEX_3D", "HYBRID_SIMPLEX_TO_HEX_3D", "HEX_3D", "HYBRID_HEX_3D", "CellRefiners", "REFINER_", 0};
6
7PETSC_STATIC_INLINEstatic inline PetscErrorCode GetDepthStart_Private(PetscInt depth, PetscInt depthSize[], PetscInt *cStart, PetscInt *fStart, PetscInt *eStart, PetscInt *vStart)
8{
9 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 9; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10 if (cStart) *cStart = 0;
11 if (vStart) *vStart = depth < 0 ? 0 : depthSize[depth];
12 if (fStart) *fStart = depth < 0 ? 0 : depthSize[depth] + depthSize[0];
13 if (eStart) *eStart = depth < 0 ? 0 : depthSize[depth] + depthSize[0] + depthSize[depth-1];
14 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
15}
16
17PETSC_STATIC_INLINEstatic inline PetscErrorCode GetDepthEnd_Private(PetscInt depth, PetscInt depthSize[], PetscInt *cEnd, PetscInt *fEnd, PetscInt *eEnd, PetscInt *vEnd)
18{
19 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 19; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
20 if (cEnd) *cEnd = depth < 0 ? 0 : depthSize[depth];
11
Taking true branch
12
Assuming 'depth' is >= 0
13
'?' condition is false
14
Array access (from variable 'depthSize') results in a null pointer dereference
21 if (vEnd) *vEnd = depth < 0 ? 0 : depthSize[depth] + depthSize[0];
22 if (fEnd) *fEnd = depth < 0 ? 0 : depthSize[depth] + depthSize[0] + depthSize[depth-1];
23 if (eEnd) *eEnd = depth < 0 ? 0 : depthSize[depth] + depthSize[0] + depthSize[depth-1] + depthSize[1];
24 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
25}
26
27/*
28 Note that j and invj are non-square:
29 v0 + j x_face = x_cell
30 invj (x_cell - v0) = x_face
31*/
32PetscErrorCode CellRefinerGetAffineFaceTransforms_Internal(CellRefiner refiner, PetscInt *numFaces, PetscReal *v0[], PetscReal *jac[], PetscReal *invjac[], PetscReal *detj[])
33{
34 PetscReal *v = NULL((void*)0), *j = NULL((void*)0), *invj = NULL((void*)0), *dj = NULL((void*)0);
35 PetscInt cdim, fdim;
36 PetscErrorCode ierr;
37
38 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 38; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
39 switch (refiner) {
40 case REFINER_NOOP: break;
41 case REFINER_SIMPLEX_2D:
42 /*
43 2
44 |\
45 | \
46 | \
47 | \
48 | \
49 | \
50 | \
51 2 1
52 | \
53 | \
54 | \
55 0---0-------1
56 */
57 cdim = 2;
58 fdim = 1;
59 if (numFaces) *numFaces = 3;
60 if (v0) {
61 ierr = PetscMalloc1(3*cdim, &v)PetscMallocA(1,PETSC_FALSE,61,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(3*cdim)*sizeof(**(&v)),(&v))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),61,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
62 ierr = PetscMalloc1(3*cdim*fdim, &j)PetscMallocA(1,PETSC_FALSE,62,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(3*cdim*fdim)*sizeof(**(&j)),(&j))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),62,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
63 ierr = PetscMalloc1(3*cdim*fdim, &invj)PetscMallocA(1,PETSC_FALSE,63,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(3*cdim*fdim)*sizeof(**(&invj)),(&invj))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),63,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
64 ierr = PetscMalloc1(3, &dj)PetscMallocA(1,PETSC_FALSE,64,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(3)*sizeof(**(&dj)),(&dj))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),64,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
65 /* 0 */
66 v[0+0] = 0.0; v[0+1] = -1.0;
67 j[0+0] = 1.0;
68 j[0+1] = 0.0;
69 invj[0+0] = 1.0; invj[0+1] = 0.0;
70 dj[0] = 1.0;
71 /* 1 */
72 v[2+0] = 0.0; v[2+1] = 0.0;
73 j[2+0] = -1.0;
74 j[2+1] = 1.0;
75 invj[2+0] = -0.5; invj[2+1] = 0.5;
76 dj[1] = 1.414213562373095;
77 /* 2 */
78 v[4+0] = -1.0; v[4+1] = 0.0;
79 j[4+0] = 0.0;
80 j[4+1] = -1.0;
81 invj[4+0] = 0.0; invj[4+1] = -1.0;
82 dj[2] = 1.0;
83 }
84 break;
85 case REFINER_HEX_2D:
86 /*
87 3---------2---------2
88 | |
89 | |
90 | |
91 3 1
92 | |
93 | |
94 | |
95 0---------0---------1
96 */
97 cdim = 2;
98 fdim = 1;
99 if (numFaces) *numFaces = 4;
100 if (v0) {
101 ierr = PetscMalloc1(4*cdim, &v)PetscMallocA(1,PETSC_FALSE,101,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4*cdim)*sizeof(**(&v)),(&v))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),101,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
102 ierr = PetscMalloc1(4*cdim*fdim, &j)PetscMallocA(1,PETSC_FALSE,102,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4*cdim*fdim)*sizeof(**(&j)),(&j))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),102,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
103 ierr = PetscMalloc1(4*cdim*fdim, &invj)PetscMallocA(1,PETSC_FALSE,103,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4*cdim*fdim)*sizeof(**(&invj)),(&invj))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),103,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
104 ierr = PetscMalloc1(4, &dj)PetscMallocA(1,PETSC_FALSE,104,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4)*sizeof(**(&dj)),(&dj))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),104,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
105 /* 0 */
106 v[0+0] = 0.0; v[0+1] = -1.0;
107 j[0+0] = 1.0;
108 j[0+1] = 0.0;
109 invj[0+0] = 1.0; invj[0+1] = 0.0;
110 dj[0] = 1.0;
111 /* 1 */
112 v[2+0] = 1.0; v[2+1] = 0.0;
113 j[2+0] = 0.0;
114 j[2+1] = 1.0;
115 invj[2+0] = 0.0; invj[2+1] = 1.0;
116 dj[1] = 1.0;
117 /* 2 */
118 v[4+0] = 0.0; v[4+1] = 1.0;
119 j[4+0] = -1.0;
120 j[4+1] = 0.0;
121 invj[4+0] = -1.0; invj[4+1] = 0.0;
122 dj[2] = 1.0;
123 /* 3 */
124 v[6+0] = -1.0; v[6+1] = 0.0;
125 j[6+0] = 0.0;
126 j[6+1] = -1.0;
127 invj[6+0] = 0.0; invj[6+1] = -1.0;
128 dj[3] = 1.0;
129 }
130 break;
131 default:
132 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),132,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
133 }
134 if (v0) {*v0 = v;}
135 else {ierr = PetscFree(v)((*PetscTrFree)((void*)(v),135,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((v) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),135,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
136 if (jac) {*jac = j;}
137 else {ierr = PetscFree(j)((*PetscTrFree)((void*)(j),137,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((j) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),137,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
138 if (invjac) {*invjac = invj;}
139 else {ierr = PetscFree(invj)((*PetscTrFree)((void*)(invj),139,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((invj) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),139,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
140 if (invjac) {*invjac = invj;}
141 else {ierr = PetscFree(invj)((*PetscTrFree)((void*)(invj),141,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((invj) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),141,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
142 if (detj) {*detj = dj;}
143 else {ierr = PetscFree(dj)((*PetscTrFree)((void*)(dj),143,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((dj) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),143,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
144 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
145}
146
147/* Gets the affine map from the original cell to each subcell */
148PetscErrorCode CellRefinerGetAffineTransforms_Internal(CellRefiner refiner, PetscInt *numSubcells, PetscReal *v0[], PetscReal *jac[], PetscReal *invjac[])
149{
150 PetscReal *v = NULL((void*)0), *j = NULL((void*)0), *invj = NULL((void*)0), detJ;
151 PetscInt dim, s;
152 PetscErrorCode ierr;
153
154 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 154; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
155 switch (refiner) {
156 case REFINER_NOOP: break;
157 case REFINER_SIMPLEX_2D:
158 /*
159 2
160 |\
161 | \
162 | \
163 | \
164 | C \
165 | \
166 | \
167 2---1---1
168 |\ D / \
169 | 2 0 \
170 |A \ / B \
171 0---0-------1
172 */
173 dim = 2;
174 if (numSubcells) *numSubcells = 4;
175 if (v0) {
176 ierr = PetscMalloc3(4*dim,&v,4*dim*dim,&j,4*dim*dim,&invj)PetscMallocA(3,PETSC_FALSE,176,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4*dim)*sizeof(**(&v)),(&v),(size_t)(4*dim*dim
)*sizeof(**(&j)),(&j),(size_t)(4*dim*dim)*sizeof(**(&
invj)),(&invj))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),176,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
177 /* A */
178 v[0+0] = -1.0; v[0+1] = -1.0;
179 j[0+0] = 0.5; j[0+1] = 0.0;
180 j[0+2] = 0.0; j[0+3] = 0.5;
181 /* B */
182 v[2+0] = 0.0; v[2+1] = -1.0;
183 j[4+0] = 0.5; j[4+1] = 0.0;
184 j[4+2] = 0.0; j[4+3] = 0.5;
185 /* C */
186 v[4+0] = -1.0; v[4+1] = 0.0;
187 j[8+0] = 0.5; j[8+1] = 0.0;
188 j[8+2] = 0.0; j[8+3] = 0.5;
189 /* D */
190 v[6+0] = 0.0; v[6+1] = -1.0;
191 j[12+0] = 0.0; j[12+1] = -0.5;
192 j[12+2] = 0.5; j[12+3] = 0.5;
193 for (s = 0; s < 4; ++s) {
194 DMPlex_Det2D_Internal(&detJ, &j[s*dim*dim]);
195 DMPlex_Invert2D_Internal(&invj[s*dim*dim], &j[s*dim*dim], detJ);
196 }
197 }
198 break;
199 case REFINER_HEX_2D:
200 /*
201 3---------2---------2
202 | | |
203 | D 2 C |
204 | | |
205 3----3----0----1----1
206 | | |
207 | A 0 B |
208 | | |
209 0---------0---------1
210 */
211 dim = 2;
212 if (numSubcells) *numSubcells = 4;
213 if (v0) {
214 ierr = PetscMalloc3(4*dim,&v,4*dim*dim,&j,4*dim*dim,&invj)PetscMallocA(3,PETSC_FALSE,214,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4*dim)*sizeof(**(&v)),(&v),(size_t)(4*dim*dim
)*sizeof(**(&j)),(&j),(size_t)(4*dim*dim)*sizeof(**(&
invj)),(&invj))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),214,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
215 /* A */
216 v[0+0] = -1.0; v[0+1] = -1.0;
217 j[0+0] = 0.5; j[0+1] = 0.0;
218 j[0+2] = 0.0; j[0+3] = 0.5;
219 /* B */
220 v[2+0] = 0.0; v[2+1] = -1.0;
221 j[4+0] = 0.5; j[4+1] = 0.0;
222 j[4+2] = 0.0; j[4+3] = 0.5;
223 /* C */
224 v[4+0] = 0.0; v[4+1] = 0.0;
225 j[8+0] = 0.5; j[8+1] = 0.0;
226 j[8+2] = 0.0; j[8+3] = 0.5;
227 /* D */
228 v[6+0] = -1.0; v[6+1] = 0.0;
229 j[12+0] = 0.5; j[12+1] = 0.0;
230 j[12+2] = 0.0; j[12+3] = 0.5;
231 for (s = 0; s < 4; ++s) {
232 DMPlex_Det2D_Internal(&detJ, &j[s*dim*dim]);
233 DMPlex_Invert2D_Internal(&invj[s*dim*dim], &j[s*dim*dim], detJ);
234 }
235 }
236 break;
237 case REFINER_HEX_3D:
238 /*
239 Bottom (viewed from top) Top
240 1---------2---------2 7---------2---------6
241 | | | | | |
242 | B 2 C | | H 2 G |
243 | | | | | |
244 3----3----0----1----1 3----3----0----1----1
245 | | | | | |
246 | A 0 D | | E 0 F |
247 | | | | | |
248 0---------0---------3 4---------0---------5
249 */
250 break;
251 dim = 3;
252 if (numSubcells) *numSubcells = 8;
253 if (v0) {
254 ierr = PetscMalloc3(4*dim,&v,4*dim*dim,&j,4*dim*dim,&invj)PetscMallocA(3,PETSC_FALSE,254,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4*dim)*sizeof(**(&v)),(&v),(size_t)(4*dim*dim
)*sizeof(**(&j)),(&j),(size_t)(4*dim*dim)*sizeof(**(&
invj)),(&invj))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),254,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
255 /* A */
256 v[0+0] = -1.0; v[0+1] = -1.0; v[0+2] = -1.0;
257 j[0+0] = 0.5; j[0+1] = 0.0; j[0+2] = 0.0;
258 j[0+3] = 0.0; j[0+4] = 0.5; j[0+5] = 0.0;
259 j[0+6] = 0.0; j[0+7] = 0.0; j[0+8] = 0.5;
260 /* B */
261 v[3+0] = -1.0; v[3+1] = 0.0; v[3+2] = -1.0;
262 j[9+0] = 0.5; j[9+1] = 0.0; j[9+2] = 0.0;
263 j[9+3] = 0.0; j[9+4] = 0.5; j[9+5] = 0.0;
264 j[9+6] = 0.0; j[9+7] = 0.0; j[9+8] = 0.5;
265 /* C */
266 v[6+0] = 0.0; v[6+1] = 0.0; v[6+2] = -1.0;
267 j[18+0] = 0.5; j[18+1] = 0.0; j[18+2] = 0.0;
268 j[18+3] = 0.0; j[18+4] = 0.5; j[18+5] = 0.0;
269 j[18+6] = 0.0; j[18+7] = 0.0; j[18+8] = 0.5;
270 /* D */
271 v[9+0] = 0.0; v[9+1] = -1.0; v[9+2] = -1.0;
272 j[27+0] = 0.5; j[27+1] = 0.0; j[27+2] = 0.0;
273 j[27+3] = 0.0; j[27+4] = 0.5; j[27+5] = 0.0;
274 j[27+6] = 0.0; j[27+7] = 0.0; j[27+8] = 0.5;
275 /* E */
276 v[12+0] = -1.0; v[12+1] = -1.0; v[12+2] = 0.0;
277 j[36+0] = 0.5; j[36+1] = 0.0; j[36+2] = 0.0;
278 j[36+3] = 0.0; j[36+4] = 0.5; j[36+5] = 0.0;
279 j[36+6] = 0.0; j[36+7] = 0.0; j[36+8] = 0.5;
280 /* F */
281 v[15+0] = 0.0; v[15+1] = -1.0; v[15+2] = 0.0;
282 j[45+0] = 0.5; j[45+1] = 0.0; j[45+2] = 0.0;
283 j[45+3] = 0.0; j[45+4] = 0.5; j[45+5] = 0.0;
284 j[45+6] = 0.0; j[45+7] = 0.0; j[45+8] = 0.5;
285 /* G */
286 v[18+0] = 0.0; v[18+1] = 0.0; v[18+2] = 0.0;
287 j[54+0] = 0.5; j[54+1] = 0.0; j[54+2] = 0.0;
288 j[54+3] = 0.0; j[54+4] = 0.5; j[54+5] = 0.0;
289 j[54+6] = 0.0; j[54+7] = 0.0; j[54+8] = 0.5;
290 /* H */
291 v[21+0] = -1.0; v[21+1] = 0.0; v[21+2] = 0.0;
292 j[63+0] = 0.5; j[63+1] = 0.0; j[63+2] = 0.0;
293 j[63+3] = 0.0; j[63+4] = 0.5; j[63+5] = 0.0;
294 j[63+6] = 0.0; j[63+7] = 0.0; j[63+8] = 0.5;
295 for (s = 0; s < 8; ++s) {
296 DMPlex_Det3D_Internal(&detJ, &j[s*dim*dim]);
297 DMPlex_Invert3D_Internal(&invj[s*dim*dim], &j[s*dim*dim], detJ);
298 }
299 }
300 default:
301 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),301,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
302 }
303 if (v0) {*v0 = v; *jac = j; *invjac = invj;}
304 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
305}
306
307PetscErrorCode CellRefinerRestoreAffineTransforms_Internal(CellRefiner refiner, PetscInt *numSubcells, PetscReal *v0[], PetscReal *jac[], PetscReal *invjac[])
308{
309 PetscErrorCode ierr;
310
311 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 311; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
312 ierr = PetscFree3(*v0,*jac,*invjac)PetscFreeA(3,312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,&(*v0),&(*jac),&(*invjac))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
313 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
314}
315
316/* Should this be here or in the DualSpace somehow? */
317PetscErrorCode CellRefinerInCellTest_Internal(CellRefiner refiner, const PetscReal point[], PetscBool *inside)
318{
319 PetscReal sum = 0.0;
320 PetscInt d;
321
322 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 322; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
323 *inside = PETSC_TRUE;
324 switch (refiner) {
325 case REFINER_NOOP: break;
326 case REFINER_SIMPLEX_2D:
327 for (d = 0; d < 2; ++d) {
328 if (point[d] < -1.0) {*inside = PETSC_FALSE; break;}
329 sum += point[d];
330 }
331 if (sum > 1.0e-10) {*inside = PETSC_FALSE; break;}
332 break;
333 case REFINER_HEX_2D:
334 for (d = 0; d < 2; ++d) if ((point[d] < -1.00000000001) || (point[d] > 1.000000000001)) {*inside = PETSC_FALSE; break;}
335 break;
336 default:
337 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),337,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
338 }
339 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
340}
341
342static PetscErrorCode CellRefinerGetSizes(CellRefiner refiner, DM dm, PetscInt depthSize[])
343{
344 PetscInt cStart, cEnd, cMax, vStart, vEnd, vMax, fStart, fEnd, fMax, eStart, eEnd, eMax;
345 PetscErrorCode ierr;
346
347 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 347; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
348 ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),348,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
349 ierr = DMPlexGetDepthStratum(dm, 1, &eStart, &eEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),349,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
350 ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),350,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
351 ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),351,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
352 ierr = DMPlexGetHybridBounds(dm, &cMax, &fMax, &eMax, &vMax);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),352,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
353 switch (refiner) {
354 case REFINER_NOOP:
355 break;
356 case REFINER_SIMPLEX_1D:
357 depthSize[0] = vEnd - vStart + cEnd - cStart; /* Add a vertex on every cell. */
358 depthSize[1] = 2*(cEnd - cStart); /* Split every cell in 2. */
359 break;
360 case REFINER_SIMPLEX_2D:
361 depthSize[0] = vEnd - vStart + fEnd - fStart; /* Add a vertex on every face */
362 depthSize[1] = 2*(fEnd - fStart) + 3*(cEnd - cStart); /* Every face is split into 2 faces and 3 faces are added for each cell */
363 depthSize[2] = 4*(cEnd - cStart); /* Every cell split into 4 cells */
364 break;
365 case REFINER_HYBRID_SIMPLEX_2D:
366 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),366,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
367 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),367,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
368 depthSize[0] = vEnd - vStart + fMax - fStart; /* Add a vertex on every face, but not hybrid faces */
369 depthSize[1] = 2*(fMax - fStart) + 3*(cMax - cStart) + (fEnd - fMax) + (cEnd - cMax); /* Every interior face is split into 2 faces, 3 faces are added for each interior cell, and one in each hybrid cell */
370 depthSize[2] = 4*(cMax - cStart) + 2*(cEnd - cMax); /* Interior cells split into 4 cells, hybrid cells split into 2 cells */
371 break;
372 case REFINER_SIMPLEX_TO_HEX_2D:
373 depthSize[0] = vEnd - vStart + fEnd - fStart + cEnd - cStart; /* Add a vertex on every face and cell */
374 depthSize[1] = 2*(fEnd - fStart) + 3*(cEnd - cStart); /* Every face is split into 2 faces and 3 faces are added for each cell */
375 depthSize[2] = 3*(cEnd - cStart); /* Every cell split into 3 cells */
376 break;
377 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
378 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),378,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
379 depthSize[0] = vEnd - vStart + fEnd - fStart + cEnd - cStart; /* Add a vertex on every face and cell */
380 depthSize[1] = 2*(fEnd - fStart) + 3*(cMax - cStart) + 4*(cEnd - cMax); /* Every face is split into 2 faces and 3 faces are added for each cell. 4 for each hybrid cell */
381 depthSize[2] = 3*(cMax - cStart) + 4*(cEnd - cMax); /* Every cell split into 3 cells, hybrid cells split in 4 */
382 break;
383 case REFINER_HEX_2D:
384 depthSize[0] = vEnd - vStart + fEnd - fStart + cEnd - cStart; /* Add a vertex on every face and cell */
385 depthSize[1] = 2*(fEnd - fStart) + 4*(cEnd - cStart); /* Every face is split into 2 faces and 4 faces are added for each cell */
386 depthSize[2] = 4*(cEnd - cStart); /* Every cell split into 4 cells */
387 break;
388 case REFINER_HYBRID_HEX_2D:
389 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),389,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
390 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),390,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
391 /* Quadrilateral */
392 depthSize[0] = vEnd - vStart + fMax - fStart + cMax - cStart; /* Add a vertex on every face and cell */
393 depthSize[1] = 2*(fMax - fStart) + 4*(cMax - cStart); /* Every face is split into 2 faces, and 4 faces are added for each cell */
394 depthSize[2] = 4*(cMax - cStart); /* Every cell split into 4 cells */
395 /* Segment Prisms */
396 depthSize[0] += 0; /* No hybrid vertices */
397 depthSize[1] += (fEnd - fMax) + (cEnd - cMax); /* Every hybrid face remains and 1 faces is added for each hybrid cell */
398 depthSize[2] += 2*(cEnd - cMax); /* Every hybrid cell split into 2 cells */
399 break;
400 case REFINER_SIMPLEX_3D:
401 depthSize[0] = vEnd - vStart + eEnd - eStart; /* Add a vertex on every edge */
402 depthSize[1] = 2*(eEnd - eStart) + 3*(fEnd - fStart) + (cEnd - cStart); /* Every edge is split into 2 edges, 3 edges are added for each face, and 1 edge for each cell */
403 depthSize[2] = 4*(fEnd - fStart) + 8*(cEnd - cStart); /* Every face split into 4 faces and 8 faces are added for each cell */
404 depthSize[3] = 8*(cEnd - cStart); /* Every cell split into 8 cells */
405 break;
406 case REFINER_HYBRID_SIMPLEX_3D:
407 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),407,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
408 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),408,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
409 if (eMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No edge maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),409,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No edge maximum specified in hybrid mesh"
)
;
410 /* Tetrahedra */
411 depthSize[0] = vEnd - vStart + eMax - eStart; /* Add a vertex on every interior edge */
412 depthSize[1] = 2*(eMax - eStart) + 3*(fMax - fStart) + (cMax - cStart); /* Every interior edge split into 2 edges, 3 edges added for each interior face, 1 edge for each interior cell */
413 depthSize[2] = 4*(fMax - fStart) + 8*(cMax - cStart); /* Every interior face split into 4 faces, 8 faces added for each interior cell */
414 depthSize[3] = 8*(cMax - cStart); /* Every interior cell split into 8 cells */
415 /* Triangular Prisms */
416 depthSize[0] += 0; /* No hybrid vertices */
417 depthSize[1] += (eEnd - eMax) + (fEnd - fMax); /* Every hybrid edge remains, 1 edge for every hybrid face */
418 depthSize[2] += 2*(fEnd - fMax) + 3*(cEnd - cMax); /* Every hybrid face split into 2 faces and 3 faces are added for each hybrid cell */
419 depthSize[3] += 4*(cEnd - cMax); /* Every hybrid cell split into 4 cells */
420 break;
421 case REFINER_SIMPLEX_TO_HEX_3D:
422 depthSize[0] = vEnd - vStart + fEnd - fStart + eEnd - eStart + cEnd - cStart; /* Add a vertex on every face, edge and cell */
423 depthSize[1] = 2*(eEnd - eStart) + 3*(fEnd - fStart) + 4*(cEnd - cStart); /* Every edge is split into 2 edges, 3 edges are added for each face, and 4 for each cell */
424 depthSize[2] = 3*(fEnd - fStart) + 6*(cEnd - cStart); /* Every face is split into 3 faces and 6 faces are added for each cell */
425 depthSize[3] = 4*(cEnd - cStart); /* Every cell split into 4 cells */
426 break;
427 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
428 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),428,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
429 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),429,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
430 if (eMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No edge maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),430,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No edge maximum specified in hybrid mesh"
)
;
431 /* Tetrahedra */
432 depthSize[0] = vEnd - vStart + eMax - eStart + fMax - fStart + cMax - cStart; /* Add a vertex on every interior edge, face and cell */
433 depthSize[1] = 2*(eMax - eStart) + 3*(fMax - fStart) + 4*(cMax - cStart); /* Every interior edge split into 2 edges, 3 edges added for each interior face, 4 edges for each interior cell */
434 depthSize[2] = 3*(fMax - fStart) + 6*(cMax - cStart); /* Every interior face split into 3 faces, 6 faces added for each interior cell */
435 depthSize[3] = 4*(cMax - cStart); /* Every interior cell split into 8 cells */
436 /* Triangular Prisms */
437 depthSize[0] += 0; /* No hybrid vertices */
438 depthSize[1] += (eEnd - eMax) + (fEnd - fMax) + (cEnd - cMax); /* Every hybrid edge remains, 1 edge for every hybrid face and cell */
439 depthSize[2] += 2*(fEnd - fMax) + 3*(cEnd - cMax); /* Every hybrid face split into 2 faces and 3 faces are added for each hybrid cell */
440 depthSize[3] += 3*(cEnd - cMax); /* Every hybrid cell split into 3 cells */
441 break;
442 case REFINER_HEX_3D:
443 depthSize[0] = vEnd - vStart + eEnd - eStart + fEnd - fStart + cEnd - cStart; /* Add a vertex on every edge, face and cell */
444 depthSize[1] = 2*(eEnd - eStart) + 4*(fEnd - fStart) + 6*(cEnd - cStart); /* Every edge is split into 2 edge, 4 edges are added for each face, and 6 edges for each cell */
445 depthSize[2] = 4*(fEnd - fStart) + 12*(cEnd - cStart); /* Every face is split into 4 faces, and 12 faces are added for each cell */
446 depthSize[3] = 8*(cEnd - cStart); /* Every cell split into 8 cells */
447 break;
448 case REFINER_HYBRID_HEX_3D:
449 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),449,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
450 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),450,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
451 if (eMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No edge maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),451,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No edge maximum specified in hybrid mesh"
)
;
452 /* Hexahedra */
453 depthSize[0] = vEnd - vStart + eMax - eStart + fMax - fStart + cMax - cStart; /* Add a vertex on every edge, face and cell */
454 depthSize[1] = 2*(eMax - eStart) + 4*(fMax - fStart) + 6*(cMax - cStart); /* Every edge is split into 2 edge, 4 edges are added for each face, and 6 edges for each cell */
455 depthSize[2] = 4*(fMax - fStart) + 12*(cMax - cStart); /* Every face is split into 4 faces, and 12 faces are added for each cell */
456 depthSize[3] = 8*(cMax - cStart); /* Every cell split into 8 cells */
457 /* Quadrilateral Prisms */
458 depthSize[0] += 0; /* No hybrid vertices */
459 depthSize[1] += (eEnd - eMax) + (fEnd - fMax) + (cEnd - cMax); /* Every hybrid edge remains, 1 edge for every hybrid face and hybrid cell */
460 depthSize[2] += 2*(fEnd - fMax) + 4*(cEnd - cMax); /* Every hybrid face split into 2 faces and 4 faces are added for each hybrid cell */
461 depthSize[3] += 4*(cEnd - cMax); /* Every hybrid cell split into 4 cells */
462 break;
463 default:
464 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),464,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
465 }
466 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
467}
468
469/* Return triangle edge for orientation o, if it is r for o == 0 */
470PETSC_STATIC_INLINEstatic inline PetscInt GetTriEdge_Static(PetscInt o, PetscInt r) {
471 return (o < 0 ? 2-(o+r) : o+r)%3;
472}
473PETSC_STATIC_INLINEstatic inline PetscInt GetTriEdgeInverse_Static(PetscInt o, PetscInt s) {
474 return (o < 0 ? 2-(o+s) : 3+s-o)%3;
475}
476
477/* Return triangle subface for orientation o, if it is r for o == 0 */
478PETSC_STATIC_INLINEstatic inline PetscInt GetTriSubface_Static(PetscInt o, PetscInt r) {
479 return (o < 0 ? 3-(o+r) : o+r)%3;
480}
481PETSC_STATIC_INLINEstatic inline PetscInt GetTriSubfaceInverse_Static(PetscInt o, PetscInt s) {
482 return (o < 0 ? 3-(o+s) : 3+s-o)%3;
483}
484
485/* Return the interior edge number connecting the midpoints of the triangle edges r
486 and r+1 in the transitive closure for triangle orientation o */
487PETSC_STATIC_INLINEstatic inline PetscInt GetTriMidEdge_Static(PetscInt o, PetscInt r) {
488 return (o < 0 ? 1-(o+r) : o+r)%3;
489}
490PETSC_STATIC_INLINEstatic inline PetscInt GetTriMidEdgeInverse_Static(PetscInt o, PetscInt s) {
491 return (o < 0 ? 1-(o+s) : 3+s-o)%3;
492}
493
494/* Return the interior edge number connecting the midpoint of the triangle edge r
495 (in the transitive closure) and the vertex in the interior of the face for triangle orientation o */
496PETSC_STATIC_INLINEstatic inline PetscInt GetTriInteriorEdge_Static(PetscInt o, PetscInt r) {
497 return (o < 0 ? 2-(o+r) : o+r)%3;
498}
499PETSC_STATIC_INLINEstatic inline PetscInt GetTriInteriorEdgeInverse_Static(PetscInt o, PetscInt s) {
500 return (o < 0 ? 2-(o+s) : 3+s-o)%3;
501}
502
503/* Return quad edge for orientation o, if it is r for o == 0 */
504PETSC_STATIC_INLINEstatic inline PetscInt GetQuadEdge_Static(PetscInt o, PetscInt r) {
505 return (o < 0 ? 3-(o+r) : o+r)%4;
506}
507PETSC_STATIC_INLINEstatic inline PetscInt GetQuadEdgeInverse_Static(PetscInt o, PetscInt s) {
508 return (o < 0 ? 3-(o+s) : 4+s-o)%4;
509}
510
511/* Return quad subface for orientation o, if it is r for o == 0 */
512PETSC_STATIC_INLINEstatic inline PetscInt GetQuadSubface_Static(PetscInt o, PetscInt r) {
513 return (o < 0 ? 4-(o+r) : o+r)%4;
514}
515PETSC_STATIC_INLINEstatic inline PetscInt GetQuadSubfaceInverse_Static(PetscInt o, PetscInt s) {
516 return (o < 0 ? 4-(o+s) : 4+s-o)%4;
517}
518
519static PetscErrorCode DMLabelSetStratumBounds(DMLabel label, PetscInt value, PetscInt cStart, PetscInt cEnd)
520{
521 IS cIS;
522 PetscErrorCode ierr;
523
524 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 524; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
525 ierr = ISCreateStride(PETSC_COMM_SELF((MPI_Comm)0x44000001), cEnd - cStart, cStart, 1, &cIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),525,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
526 ierr = DMLabelSetStratumIS(label, value, cIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),526,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
527 ierr = ISDestroy(&cIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),527,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
528 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
529}
530
531static PetscErrorCode CellRefinerSetConeSizes(CellRefiner refiner, DM dm, PetscInt depthSize[], DM rdm)
532{
533 PetscInt depth, cStart, cStartNew, cEnd, cEndNew, cMax, c, vStart, vStartNew, vEnd, vEndNew, vMax, v, fStart, fStartNew, fEnd, fEndNew, fMax, f, eStart, eStartNew, eEnd, eEndNew, eMax, e, r;
534 DMLabel depthLabel;
535 PetscErrorCode ierr;
536
537 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 537; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
538 ierr = DMPlexGetDepth(dm, &depth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),538,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
539 ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),539,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
540 ierr = DMPlexGetDepthStratum(dm, 1, &eStart, &eEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),540,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
541 ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),541,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
542 ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),542,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
543 ierr = DMPlexGetHybridBounds(dm, &cMax, &fMax, &eMax, &vMax);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),543,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
544 ierr = GetDepthStart_Private(depth, depthSize, &cStartNew, &fStartNew, &eStartNew, &vStartNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),544,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
545 ierr = GetDepthEnd_Private(depth, depthSize, &cEndNew, &fEndNew, &eEndNew, &vEndNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),545,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
546 ierr = DMCreateLabel(rdm,"depth");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),546,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
547 ierr = DMPlexGetDepthLabel(rdm,&depthLabel);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),547,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
548 ierr = DMLabelSetStratumBounds(depthLabel, 0, vStartNew, vEndNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),548,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
549 if (depth > 2) ierr = DMLabelSetStratumBounds(depthLabel, 1, eStartNew, eEndNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),549,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
550 if (depth > 1) ierr = DMLabelSetStratumBounds(depthLabel, depth - 1, fStartNew, fEndNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),550,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
551 if (depth > 0) ierr = DMLabelSetStratumBounds(depthLabel, depth, cStartNew, cEndNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),551,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
552 {
553 DM_Plex *plex = (DM_Plex *) rdm->data;
554 ierr = PetscObjectStateGet((PetscObject) depthLabel, &plex->depthState);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),554,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
555 }
556 if (!refiner) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
557 switch (refiner) {
558 case REFINER_SIMPLEX_1D:
559 /* All cells have 2 vertices */
560 for (c = cStart; c < cEnd; ++c) {
561 for (r = 0; r < 2; ++r) {
562 const PetscInt newp = cStartNew + (c - cStart)*2 + r;
563
564 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),564,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
565 }
566 }
567 /* Old vertices have identical supports */
568 for (v = vStart; v < vEnd; ++v) {
569 const PetscInt newp = vStartNew + (v - vStart);
570 PetscInt size;
571
572 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),572,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
573 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),573,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
574 }
575 /* Cell vertices have support 2 */
576 for (c = cStart; c < cEnd; ++c) {
577 const PetscInt newp = vStartNew + (vEnd - vStart) + (c - cStart);
578
579 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),579,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
580 }
581 break;
582 case REFINER_SIMPLEX_2D:
583 /* All cells have 3 faces */
584 for (c = cStart; c < cEnd; ++c) {
585 for (r = 0; r < 4; ++r) {
586 const PetscInt newp = (c - cStart)*4 + r;
587
588 ierr = DMPlexSetConeSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),588,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
589 }
590 }
591 /* Split faces have 2 vertices and the same cells as the parent */
592 for (f = fStart; f < fEnd; ++f) {
593 for (r = 0; r < 2; ++r) {
594 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
595 PetscInt size;
596
597 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),597,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
598 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),598,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
599 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),599,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
600 }
601 }
602 /* Interior faces have 2 vertices and 2 cells */
603 for (c = cStart; c < cEnd; ++c) {
604 for (r = 0; r < 3; ++r) {
605 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + r;
606
607 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),607,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
608 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),608,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
609 }
610 }
611 /* Old vertices have identical supports */
612 for (v = vStart; v < vEnd; ++v) {
613 const PetscInt newp = vStartNew + (v - vStart);
614 PetscInt size;
615
616 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),616,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
617 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),617,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
618 }
619 /* Face vertices have 2 + cells*2 supports */
620 for (f = fStart; f < fEnd; ++f) {
621 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
622 PetscInt size;
623
624 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),624,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
625 ierr = DMPlexSetSupportSize(rdm, newp, 2 + size*2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),625,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
626 }
627 break;
628 case REFINER_SIMPLEX_TO_HEX_2D:
629 /* All cells have 4 faces */
630 for (c = cStart; c < cEnd; ++c) {
631 for (r = 0; r < 3; ++r) {
632 const PetscInt newp = (c - cStart)*3 + r;
633
634 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),634,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
635 }
636 }
637 /* Split faces have 2 vertices and the same cells as the parent */
638 for (f = fStart; f < fEnd; ++f) {
639 for (r = 0; r < 2; ++r) {
640 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
641 PetscInt size;
642
643 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),643,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
644 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),644,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
645 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),645,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
646 }
647 }
648 /* Interior faces have 2 vertices and 2 cells */
649 for (c = cStart; c < cEnd; ++c) {
650 for (r = 0; r < 3; ++r) {
651 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + r;
652
653 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),653,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
654 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),654,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
655 }
656 }
657 /* Old vertices have identical supports */
658 for (v = vStart; v < vEnd; ++v) {
659 const PetscInt newp = vStartNew + (v - vStart);
660 PetscInt size;
661
662 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),662,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
663 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),663,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
664 }
665 /* Split-face vertices have cells + 2 supports */
666 for (f = fStart; f < fEnd; ++f) {
667 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
668 PetscInt size;
669
670 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),670,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
671 ierr = DMPlexSetSupportSize(rdm, newp, size + 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),671,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
672 }
673 /* Interior vertices have 3 supports */
674 for (c = cStart; c < cEnd; ++c) {
675 const PetscInt newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + c - cStart;
676
677 ierr = DMPlexSetSupportSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),677,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
678 }
679 break;
680 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
681 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),681,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
682 /* the mesh is no longer hybrid */
683 cMax = PetscMin(cEnd, cMax)(((cEnd)<(cMax)) ? (cEnd) : (cMax));
684 /* All cells have 4 faces */
685 for (c = cStart; c < cMax; ++c) {
686 for (r = 0; r < 3; ++r) {
687 const PetscInt newp = (c - cStart)*3 + r;
688
689 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),689,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
690 }
691 }
692 for (c = cMax; c < cEnd; ++c) {
693 for (r = 0; r < 4; ++r) {
694 const PetscInt newp = (cMax - cStart)*3 + (c - cMax)*4 + r;
695
696 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),696,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
697 }
698 }
699 /* Split faces have 2 vertices and the same cells as the parent */
700 for (f = fStart; f < fEnd; ++f) {
701 for (r = 0; r < 2; ++r) {
702 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
703 PetscInt size;
704
705 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),705,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
706 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),706,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
707 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),707,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
708 }
709 }
710 /* Interior faces have 2 vertices and 2 cells */
711 for (c = cStart; c < cMax; ++c) {
712 for (r = 0; r < 3; ++r) {
713 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + r;
714
715 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),715,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
716 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),716,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
717 }
718 }
719 /* Hybrid interior faces have 2 vertices and 2 cells */
720 for (c = cMax; c < cEnd; ++c) {
721 for (r = 0; r < 4; ++r) {
722 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (c - cMax)*4 + r;
723
724 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),724,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
725 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),725,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
726 }
727 }
728 /* Old vertices have identical supports */
729 for (v = vStart; v < vEnd; ++v) {
730 const PetscInt newp = vStartNew + (v - vStart);
731 PetscInt size;
732
733 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),733,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
734 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),734,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
735 }
736 /* Split-face vertices have cells + 2 supports */
737 for (f = fStart; f < fEnd; ++f) {
738 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
739 PetscInt size;
740
741 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),741,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
742 ierr = DMPlexSetSupportSize(rdm, newp, size + 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),742,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
743 }
744 /* Interior vertices have 3 supports */
745 for (c = cStart; c < cMax; ++c) {
746 const PetscInt newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + c - cStart;
747
748 ierr = DMPlexSetSupportSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),748,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
749 }
750 /* Hybrid interior vertices have 4 supports */
751 for (c = cMax; c < cEnd; ++c) {
752 const PetscInt newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + c - cStart;
753
754 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),754,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
755 }
756 break;
757 case REFINER_HEX_2D:
758 /* All cells have 4 faces */
759 for (c = cStart; c < cEnd; ++c) {
760 for (r = 0; r < 4; ++r) {
761 const PetscInt newp = cStartNew + (c - cStart)*4 + r;
762
763 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),763,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
764 }
765 }
766 /* Split faces have 2 vertices and the same cells as the parent */
767 for (f = fStart; f < fEnd; ++f) {
768 for (r = 0; r < 2; ++r) {
769 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
770 PetscInt size;
771
772 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),772,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
773 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),773,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
774 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),774,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
775 }
776 }
777 /* Interior faces have 2 vertices and 2 cells */
778 for (c = cStart; c < cEnd; ++c) {
779 for (r = 0; r < 4; ++r) {
780 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + r;
781
782 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),782,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
783 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),783,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
784 }
785 }
786 /* Old vertices have identical supports */
787 for (v = vStart; v < vEnd; ++v) {
788 const PetscInt newp = vStartNew + (v - vStart);
789 PetscInt size;
790
791 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
792 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),792,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
793 }
794 /* Face vertices have 2 + cells supports */
795 for (f = fStart; f < fEnd; ++f) {
796 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
797 PetscInt size;
798
799 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),799,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
800 ierr = DMPlexSetSupportSize(rdm, newp, 2 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),800,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
801 }
802 /* Cell vertices have 4 supports */
803 for (c = cStart; c < cEnd; ++c) {
804 const PetscInt newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (c - cStart);
805
806 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),806,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
807 }
808 break;
809 case REFINER_HYBRID_SIMPLEX_2D:
810 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),810,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
811 cMax = PetscMin(cEnd, cMax)(((cEnd)<(cMax)) ? (cEnd) : (cMax));
812 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),812,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
813 fMax = PetscMin(fEnd, fMax)(((fEnd)<(fMax)) ? (fEnd) : (fMax));
814 ierr = DMPlexSetHybridBounds(rdm, cStartNew + (cMax - cStart)*4, fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3, PETSC_DETERMINE-1, PETSC_DETERMINE-1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),814,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
815 /* Interior cells have 3 faces */
816 for (c = cStart; c < cMax; ++c) {
817 for (r = 0; r < 4; ++r) {
818 const PetscInt newp = cStartNew + (c - cStart)*4 + r;
819
820 ierr = DMPlexSetConeSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),820,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
821 }
822 }
823 /* Hybrid cells have 4 faces */
824 for (c = cMax; c < cEnd; ++c) {
825 for (r = 0; r < 2; ++r) {
826 const PetscInt newp = cStartNew + (cMax - cStart)*4 + (c - cMax)*2 + r;
827
828 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),828,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
829 }
830 }
831 /* Interior split faces have 2 vertices and the same cells as the parent */
832 for (f = fStart; f < fMax; ++f) {
833 for (r = 0; r < 2; ++r) {
834 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
835 PetscInt size;
836
837 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),837,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
838 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),838,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
839 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),839,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
840 }
841 }
842 /* Interior cell faces have 2 vertices and 2 cells */
843 for (c = cStart; c < cMax; ++c) {
844 for (r = 0; r < 3; ++r) {
845 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (c - cStart)*3 + r;
846
847 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),847,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
848 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),848,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
849 }
850 }
851 /* Hybrid faces have 2 vertices and the same cells */
852 for (f = fMax; f < fEnd; ++f) {
853 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (f - fMax);
854 PetscInt size;
855
856 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),856,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
857 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),857,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
858 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),858,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
859 }
860 /* Hybrid cell faces have 2 vertices and 2 cells */
861 for (c = cMax; c < cEnd; ++c) {
862 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (fEnd - fMax) + (c - cMax);
863
864 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),864,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
865 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),865,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
866 }
867 /* Old vertices have identical supports */
868 for (v = vStart; v < vEnd; ++v) {
869 const PetscInt newp = vStartNew + (v - vStart);
870 PetscInt size;
871
872 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),872,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
873 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),873,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
874 }
875 /* Face vertices have 2 + (2 interior, 1 hybrid) supports */
876 for (f = fStart; f < fMax; ++f) {
877 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
878 const PetscInt *support;
879 PetscInt size, newSize = 2, s;
880
881 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),881,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
882 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),882,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
883 for (s = 0; s < size; ++s) {
884 if (support[s] >= cMax) newSize += 1;
885 else newSize += 2;
886 }
887 ierr = DMPlexSetSupportSize(rdm, newp, newSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),887,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
888 }
889 break;
890 case REFINER_HYBRID_HEX_2D:
891 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),891,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
892 cMax = PetscMin(cEnd, cMax)(((cEnd)<(cMax)) ? (cEnd) : (cMax));
893 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),893,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
894 fMax = PetscMin(fEnd, fMax)(((fEnd)<(fMax)) ? (fEnd) : (fMax));
895 ierr = DMPlexSetHybridBounds(rdm, cStartNew + (cMax - cStart)*4, fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4, PETSC_DETERMINE-1, PETSC_DETERMINE-1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),895,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
896 /* Interior cells have 4 faces */
897 for (c = cStart; c < cMax; ++c) {
898 for (r = 0; r < 4; ++r) {
899 const PetscInt newp = cStartNew + (c - cStart)*4 + r;
900
901 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),901,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
902 }
903 }
904 /* Hybrid cells have 4 faces */
905 for (c = cMax; c < cEnd; ++c) {
906 for (r = 0; r < 2; ++r) {
907 const PetscInt newp = cStartNew + (cMax - cStart)*4 + (c - cMax)*2 + r;
908
909 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),909,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
910 }
911 }
912 /* Interior split faces have 2 vertices and the same cells as the parent */
913 for (f = fStart; f < fMax; ++f) {
914 for (r = 0; r < 2; ++r) {
915 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
916 PetscInt size;
917
918 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),918,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
919 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
920 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),920,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
921 }
922 }
923 /* Interior cell faces have 2 vertices and 2 cells */
924 for (c = cStart; c < cMax; ++c) {
925 for (r = 0; r < 4; ++r) {
926 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + r;
927
928 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),928,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
929 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),929,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
930 }
931 }
932 /* Hybrid faces have 2 vertices and the same cells */
933 for (f = fMax; f < fEnd; ++f) {
934 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (f - fMax);
935 PetscInt size;
936
937 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),937,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
938 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),938,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
939 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),939,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
940 }
941 /* Hybrid cell faces have 2 vertices and 2 cells */
942 for (c = cMax; c < cEnd; ++c) {
943 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (fEnd - fMax) + (c - cMax);
944
945 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),945,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
946 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),946,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
947 }
948 /* Old vertices have identical supports */
949 for (v = vStart; v < vEnd; ++v) {
950 const PetscInt newp = vStartNew + (v - vStart);
951 PetscInt size;
952
953 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),953,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
954 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),954,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
955 }
956 /* Face vertices have 2 + cells supports */
957 for (f = fStart; f < fMax; ++f) {
958 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
959 PetscInt size;
960
961 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),961,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
962 ierr = DMPlexSetSupportSize(rdm, newp, 2 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),962,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
963 }
964 /* Cell vertices have 4 supports */
965 for (c = cStart; c < cMax; ++c) {
966 const PetscInt newp = vStartNew + (vEnd - vStart) + (fMax - fStart) + (c - cStart);
967
968 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),968,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
969 }
970 break;
971 case REFINER_SIMPLEX_3D:
972 /* All cells have 4 faces */
973 for (c = cStart; c < cEnd; ++c) {
974 for (r = 0; r < 8; ++r) {
975 const PetscInt newp = cStartNew + (c - cStart)*8 + r;
976
977 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),977,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
978 }
979 }
980 /* Split faces have 3 edges and the same cells as the parent */
981 for (f = fStart; f < fEnd; ++f) {
982 for (r = 0; r < 4; ++r) {
983 const PetscInt newp = fStartNew + (f - fStart)*4 + r;
984 PetscInt size;
985
986 ierr = DMPlexSetConeSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),986,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
987 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),987,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
988 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),988,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
989 }
990 }
991 /* Interior cell faces have 3 edges and 2 cells */
992 for (c = cStart; c < cEnd; ++c) {
993 for (r = 0; r < 8; ++r) {
994 const PetscInt newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + r;
995
996 ierr = DMPlexSetConeSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),996,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
997 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),997,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
998 }
999 }
1000 /* Split edges have 2 vertices and the same faces */
1001 for (e = eStart; e < eEnd; ++e) {
1002 for (r = 0; r < 2; ++r) {
1003 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
1004 PetscInt size;
1005
1006 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1006,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1007 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1007,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1008 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1008,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1009 }
1010 }
1011 /* Face edges have 2 vertices and 2+cells*(1/2) faces */
1012 for (f = fStart; f < fEnd; ++f) {
1013 for (r = 0; r < 3; ++r) {
1014 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + r;
1015 const PetscInt *cone, *ornt, *support, eint[4] = {1, 0, 2, 0};
1016 PetscInt coneSize, c, supportSize, s, er, intFaces = 0;
1017
1018 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1018,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1019 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1019,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1020 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1020,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1021 for (s = 0; s < supportSize; ++s) {
1022 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1022,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1023 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1023,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1024 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1024,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1025 for (c = 0; c < coneSize; ++c) {if (cone[c] == f) break;}
1026 /* Here we want to determine whether edge newp contains a vertex which is part of the cross-tet edge */
1027 er = GetTriMidEdgeInverse_Static(ornt[c], r);
1028 if (er == eint[c]) {
1029 intFaces += 1;
1030 } else {
1031 intFaces += 2;
1032 }
1033 }
1034 ierr = DMPlexSetSupportSize(rdm, newp, 2+intFaces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1034,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1035 }
1036 }
1037 /* Interior cell edges have 2 vertices and 4 faces */
1038 for (c = cStart; c < cEnd; ++c) {
1039 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart);
1040
1041 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1041,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1042 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1042,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1043 }
1044 /* Old vertices have identical supports */
1045 for (v = vStart; v < vEnd; ++v) {
1046 const PetscInt newp = vStartNew + (v - vStart);
1047 PetscInt size;
1048
1049 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1049,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1050 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1050,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1051 }
1052 /* Edge vertices have 2 + faces*2 + cells*0/1 supports */
1053 for (e = eStart; e < eEnd; ++e) {
1054 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
1055 PetscInt size, *star = NULL((void*)0), starSize, s, cellSize = 0;
1056
1057 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1057,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1058 ierr = DMPlexGetTransitiveClosure(dm, e, PETSC_FALSE, &starSize, &star);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1058,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1059 for (s = 0; s < starSize*2; s += 2) {
1060 const PetscInt *cone, *ornt;
1061 PetscInt e01, e23;
1062
1063 if ((star[s] >= cStart) && (star[s] < cEnd)) {
1064 /* Check edge 0-1 */
1065 ierr = DMPlexGetCone(dm, star[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1065,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1066 ierr = DMPlexGetConeOrientation(dm, star[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1066,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1067 ierr = DMPlexGetCone(dm, cone[0], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1067,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1068 e01 = cone[GetTriEdge_Static(ornt[0], 0)];
1069 /* Check edge 2-3 */
1070 ierr = DMPlexGetCone(dm, star[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1070,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1071 ierr = DMPlexGetConeOrientation(dm, star[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1071,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1072 ierr = DMPlexGetCone(dm, cone[2], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1072,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1073 e23 = cone[GetTriEdge_Static(ornt[2], 1)];
1074 if ((e01 == e) || (e23 == e)) ++cellSize;
1075 }
1076 }
1077 ierr = DMPlexRestoreTransitiveClosure(dm, e, PETSC_FALSE, &starSize, &star);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1077,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1078 ierr = DMPlexSetSupportSize(rdm, newp, 2 + size*2 + cellSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1078,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1079 }
1080 break;
1081 case REFINER_HYBRID_SIMPLEX_3D:
1082 ierr = DMPlexSetHybridBounds(rdm, cStartNew + 8*(cMax-cStart), fStartNew + 4*(fMax - fStart) + 8*(cMax - cStart),
1083 eStartNew + 2*(eMax - eStart) + 3*(fMax - fStart) + (cMax - cStart), PETSC_DETERMINE-1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1083,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1084 /* Interior cells have 4 faces */
1085 for (c = cStart; c < cMax; ++c) {
1086 for (r = 0; r < 8; ++r) {
1087 const PetscInt newp = cStartNew + (c - cStart)*8 + r;
1088
1089 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1089,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1090 }
1091 }
1092 /* Hybrid cells have 5 faces */
1093 for (c = cMax; c < cEnd; ++c) {
1094 for (r = 0; r < 4; ++r) {
1095 const PetscInt newp = cStartNew + (cMax - cStart)*8 + (c - cMax)*4 + r;
1096
1097 ierr = DMPlexSetConeSize(rdm, newp, 5);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1097,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1098 }
1099 }
1100 /* Interior split faces have 3 edges and the same cells as the parent */
1101 for (f = fStart; f < fMax; ++f) {
1102 for (r = 0; r < 4; ++r) {
1103 const PetscInt newp = fStartNew + (f - fStart)*4 + r;
1104 PetscInt size;
1105
1106 ierr = DMPlexSetConeSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1106,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1107 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1107,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1108 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1108,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1109 }
1110 }
1111 /* Interior cell faces have 3 edges and 2 cells */
1112 for (c = cStart; c < cMax; ++c) {
1113 for (r = 0; r < 8; ++r) {
1114 const PetscInt newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + r;
1115
1116 ierr = DMPlexSetConeSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1116,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1117 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1117,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1118 }
1119 }
1120 /* Hybrid split faces have 4 edges and the same cells as the parent */
1121 for (f = fMax; f < fEnd; ++f) {
1122 for (r = 0; r < 2; ++r) {
1123 const PetscInt newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (f - fMax)*2 + r;
1124 PetscInt size;
1125
1126 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1126,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1127 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1127,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1128 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1128,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1129 }
1130 }
1131 /* Hybrid cells faces have 4 edges and 2 cells */
1132 for (c = cMax; c < cEnd; ++c) {
1133 for (r = 0; r < 3; ++r) {
1134 const PetscInt newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + r;
1135
1136 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1136,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1137 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1137,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1138 }
1139 }
1140 /* Interior split edges have 2 vertices and the same faces */
1141 for (e = eStart; e < eMax; ++e) {
1142 for (r = 0; r < 2; ++r) {
1143 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
1144 PetscInt size;
1145
1146 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1146,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1147 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1147,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1148 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1148,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1149 }
1150 }
1151 /* Interior face edges have 2 vertices and 2+cells*(1/2) faces */
1152 for (f = fStart; f < fMax; ++f) {
1153 for (r = 0; r < 3; ++r) {
1154 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + r;
1155 const PetscInt *cone, *ornt, *support, eint[4] = {1, 0, 2, 0};
1156 PetscInt coneSize, c, supportSize, s, er, intFaces = 0;
1157
1158 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1158,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1159 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1159,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1160 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1160,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1161 for (s = 0; s < supportSize; ++s) {
1162 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1162,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1163 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1163,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1164 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1164,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1165 for (c = 0; c < coneSize; ++c) {if (cone[c] == f) break;}
1166 if (support[s] < cMax) {
1167 /* Here we want to determine whether edge newp contains a vertex which is part of the cross-tet edge */
1168 er = GetTriMidEdgeInverse_Static(ornt[c], r);
1169 if (er == eint[c]) {
1170 intFaces += 1;
1171 } else {
1172 intFaces += 2;
1173 }
1174 } else {
1175 intFaces += 1;
1176 }
1177 }
1178 ierr = DMPlexSetSupportSize(rdm, newp, 2+intFaces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1178,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1179 }
1180 }
1181 /* Interior cell edges have 2 vertices and 4 faces */
1182 for (c = cStart; c < cMax; ++c) {
1183 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart);
1184
1185 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1185,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1186 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1186,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1187 }
1188 /* Hybrid edges have 2 vertices and the same faces */
1189 for (e = eMax; e < eEnd; ++e) {
1190 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (e - eMax);
1191 PetscInt size;
1192
1193 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1193,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1194 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1194,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1195 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1195,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1196 }
1197 /* Hybrid face edges have 2 vertices and 2+2*cells faces */
1198 for (f = fMax; f < fEnd; ++f) {
1199 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (eEnd - eMax) + (f - fMax);
1200 PetscInt size;
1201
1202 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1202,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1203 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1203,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1204 ierr = DMPlexSetSupportSize(rdm, newp, 2+2*size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1204,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1205 }
1206 /* Interior vertices have identical supports */
1207 for (v = vStart; v < vEnd; ++v) {
1208 const PetscInt newp = vStartNew + (v - vStart);
1209 PetscInt size;
1210
1211 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1211,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1212 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1212,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1213 }
1214 /* Interior edge vertices have 2 + interior face*2 + hybrid face + cells*0/1 supports */
1215 for (e = eStart; e < eMax; ++e) {
1216 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
1217 const PetscInt *support;
1218 PetscInt size, *star = NULL((void*)0), starSize, s, faceSize = 0, cellSize = 0;
1219
1220 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1220,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1221 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1221,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1222 for (s = 0; s < size; ++s) {
1223 if (support[s] < fMax) faceSize += 2;
1224 else faceSize += 1;
1225 }
1226 ierr = DMPlexGetTransitiveClosure(dm, e, PETSC_FALSE, &starSize, &star);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1226,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1227 for (s = 0; s < starSize*2; s += 2) {
1228 const PetscInt *cone, *ornt;
1229 PetscInt e01, e23;
1230
1231 if ((star[s] >= cStart) && (star[s] < cMax)) {
1232 /* Check edge 0-1 */
1233 ierr = DMPlexGetCone(dm, star[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1233,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1234 ierr = DMPlexGetConeOrientation(dm, star[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1234,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1235 ierr = DMPlexGetCone(dm, cone[0], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1235,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1236 e01 = cone[GetTriEdge_Static(ornt[0], 0)];
1237 /* Check edge 2-3 */
1238 ierr = DMPlexGetCone(dm, star[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1238,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1239 ierr = DMPlexGetConeOrientation(dm, star[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1239,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1240 ierr = DMPlexGetCone(dm, cone[2], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1240,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1241 e23 = cone[GetTriEdge_Static(ornt[2], 1)];
1242 if ((e01 == e) || (e23 == e)) ++cellSize;
1243 }
1244 }
1245 ierr = DMPlexRestoreTransitiveClosure(dm, e, PETSC_FALSE, &starSize, &star);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1245,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1246 ierr = DMPlexSetSupportSize(rdm, newp, 2 + faceSize + cellSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1246,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1247 }
1248 break;
1249 case REFINER_SIMPLEX_TO_HEX_3D:
1250 /* All cells have 6 faces */
1251 for (c = cStart; c < cEnd; ++c) {
1252 for (r = 0; r < 4; ++r) {
1253 const PetscInt newp = cStartNew + (c - cStart)*4 + r;
1254
1255 ierr = DMPlexSetConeSize(rdm, newp, 6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1255,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1256 }
1257 }
1258 /* Split faces have 4 edges and the same cells as the parent */
1259 for (f = fStart; f < fEnd; ++f) {
1260 for (r = 0; r < 3; ++r) {
1261 const PetscInt newp = fStartNew + (f - fStart)*3 + r;
1262 PetscInt size;
1263
1264 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1264,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1265 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1265,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1266 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1266,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1267 }
1268 }
1269 /* Interior cell faces have 4 edges and 2 cells */
1270 for (c = cStart; c < cEnd; ++c) {
1271 for (r = 0; r < 6; ++r) {
1272 const PetscInt newp = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + r;
1273
1274 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1274,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1275 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1276 }
1277 }
1278 /* Split edges have 2 vertices and the same faces */
1279 for (e = eStart; e < eEnd; ++e) {
1280 for (r = 0; r < 2; ++r) {
1281 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
1282 PetscInt size;
1283
1284 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1284,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1285 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1285,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1286 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1286,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1287 }
1288 }
1289 /* Face edges have 2 vertices and 2 + cell faces supports */
1290 for (f = fStart; f < fEnd; ++f) {
1291 for (r = 0; r < 3; ++r) {
1292 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + r;
1293 PetscInt size;
1294
1295 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1295,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1296 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1296,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1297 ierr = DMPlexSetSupportSize(rdm, newp, 2+size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1297,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1298 }
1299 }
1300 /* Interior cell edges have 2 vertices and 3 faces */
1301 for (c = cStart; c < cEnd; ++c) {
1302 for (r = 0; r < 4; ++r) {
1303 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + r;
1304
1305 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1305,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1306 ierr = DMPlexSetSupportSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1306,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1307 }
1308 }
1309 /* Old vertices have identical supports */
1310 for (v = vStart; v < vEnd; ++v) {
1311 const PetscInt newp = vStartNew + (v - vStart);
1312 PetscInt size;
1313
1314 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1314,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1315 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1315,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1316 }
1317 /* Edge vertices have 2 + faces supports */
1318 for (e = eStart; e < eEnd; ++e) {
1319 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
1320 PetscInt size;
1321
1322 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1322,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1323 ierr = DMPlexSetSupportSize(rdm, newp, 2 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1323,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1324 }
1325 /* Face vertices have 3 + cells supports */
1326 for (f = fStart; f < fEnd; ++f) {
1327 const PetscInt newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + f - fStart;
1328 PetscInt size;
1329
1330 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1330,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1331 ierr = DMPlexSetSupportSize(rdm, newp, 3 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1331,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1332 }
1333 /* Interior cell vertices have 4 supports */
1334 for (c = cStart; c < cEnd; ++c) {
1335 const PetscInt newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + fEnd - fStart + c - cStart;
1336
1337 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1337,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1338 }
1339 break;
1340 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
1341 /* the mesh is no longer hybrid */
1342 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),1342,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
1343 cMax = PetscMin(cEnd, cMax)(((cEnd)<(cMax)) ? (cEnd) : (cMax));
1344 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),1344,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
1345 fMax = PetscMin(fEnd, fMax)(((fEnd)<(fMax)) ? (fEnd) : (fMax));
1346 if (eMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No edge maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),1346,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No edge maximum specified in hybrid mesh"
)
;
1347 eMax = PetscMin(eEnd, eMax)(((eEnd)<(eMax)) ? (eEnd) : (eMax));
1348 /* All cells have 6 faces */
1349 for (c = cStart; c < cMax; ++c) {
1350 for (r = 0; r < 4; ++r) {
1351 const PetscInt newp = cStartNew + (c - cStart)*4 + r;
1352
1353 ierr = DMPlexSetConeSize(rdm, newp, 6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1353,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1354 }
1355 }
1356 for (c = cMax; c < cEnd; ++c) {
1357 for (r = 0; r < 3; ++r) {
1358 const PetscInt newp = cStartNew + (cMax - cStart)*4 + (c - cMax)*3 + r;
1359
1360 ierr = DMPlexSetConeSize(rdm, newp, 6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1360,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1361 }
1362 }
1363 /* Interior split faces have 4 edges and the same cells as the parent */
1364 for (f = fStart; f < fMax; ++f) {
1365 for (r = 0; r < 3; ++r) {
1366 const PetscInt newp = fStartNew + (f - fStart)*3 + r;
1367 PetscInt size;
1368
1369 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1369,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1370 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1370,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1371 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1371,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1372 }
1373 }
1374 /* Interior cell faces have 4 edges and 2 cells */
1375 for (c = cStart; c < cMax; ++c) {
1376 for (r = 0; r < 6; ++r) {
1377 const PetscInt newp = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + r;
1378
1379 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1379,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1380 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1380,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1381 }
1382 }
1383 /* Hybrid split faces have 4 edges and the same cells as the parent */
1384 for (f = fMax; f < fEnd; ++f) {
1385 for (r = 0; r < 2; ++r) {
1386 const PetscInt newp = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (f - fMax)*2 + r;
1387 PetscInt size;
1388
1389 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1389,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1390 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1390,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1391 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1391,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1392 }
1393 }
1394 /* Hybrid cell faces have 4 edges and 2 cells */
1395 for (c = cMax; c < cEnd; ++c) {
1396 for (r = 0; r < 3; ++r) {
1397 const PetscInt newp = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + r;
1398
1399 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1399,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1400 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1400,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1401 }
1402 }
1403 /* Interior split edges have 2 vertices and the same faces */
1404 for (e = eStart; e < eMax; ++e) {
1405 for (r = 0; r < 2; ++r) {
1406 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
1407 PetscInt size;
1408
1409 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1409,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1410 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1410,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1411 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1411,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1412 }
1413 }
1414 /* Interior face edges have 2 vertices and 2 + cell faces supports */
1415 for (f = fStart; f < fMax; ++f) {
1416 for (r = 0; r < 3; ++r) {
1417 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + r;
1418 PetscInt size;
1419
1420 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1420,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1421 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1421,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1422 ierr = DMPlexSetSupportSize(rdm, newp, 2+size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1422,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1423 }
1424 }
1425 /* Interior cell edges have 2 vertices and 3 faces */
1426 for (c = cStart; c < cMax; ++c) {
1427 for (r = 0; r < 4; ++r) {
1428 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + r;
1429
1430 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1430,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1431 ierr = DMPlexSetSupportSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1431,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1432 }
1433 }
1434 /* Hybrid edges have 2 vertices and the same faces */
1435 for (e = eMax; e < eEnd; ++e) {
1436 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (e - eMax);
1437 PetscInt size;
1438
1439 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1439,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1440 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1440,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1441 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1441,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1442 }
1443 /* Hybrid face edges have 2 vertices and 2+cells faces */
1444 for (f = fMax; f < fEnd; ++f) {
1445 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (f - fMax);
1446 PetscInt size;
1447
1448 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1448,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1449 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1449,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1450 ierr = DMPlexSetSupportSize(rdm, newp, 2+size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1450,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1451 }
1452 /* Hybrid cell edges have 2 vertices and 3 faces */
1453 for (c = cMax; c < cEnd; ++c) {
1454 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (fEnd - fMax) + (c - cMax);
1455
1456 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1456,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1457 ierr = DMPlexSetSupportSize(rdm, newp, 3);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1457,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1458 }
1459 /* Old vertices have identical supports */
1460 for (v = vStart; v < vEnd; ++v) {
1461 const PetscInt newp = vStartNew + (v - vStart);
1462 PetscInt size;
1463
1464 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1464,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1465 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1465,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1466 }
1467 /* Interior edge vertices have 2 + faces supports */
1468 for (e = eStart; e < eMax; ++e) {
1469 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
1470 PetscInt size;
1471
1472 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1472,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1473 ierr = DMPlexSetSupportSize(rdm, newp, 2 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1473,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1474 }
1475 /* Interior face vertices have 3 + cells supports */
1476 for (f = fStart; f < fMax; ++f) {
1477 const PetscInt newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + f - fStart;
1478 PetscInt size;
1479
1480 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1480,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1481 ierr = DMPlexSetSupportSize(rdm, newp, 3 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1481,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1482 }
1483 /* Interior cell vertices have 4 supports */
1484 for (c = cStart; c < cMax; ++c) {
1485 const PetscInt newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax - fStart) + c - cStart;
1486
1487 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1487,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1488 }
1489 break;
1490 case REFINER_HEX_3D:
1491 /* All cells have 6 faces */
1492 for (c = cStart; c < cEnd; ++c) {
1493 for (r = 0; r < 8; ++r) {
1494 const PetscInt newp = (c - cStart)*8 + r;
1495
1496 ierr = DMPlexSetConeSize(rdm, newp, 6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1496,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1497 }
1498 }
1499 /* Split faces have 4 edges and the same cells as the parent */
1500 for (f = fStart; f < fEnd; ++f) {
1501 for (r = 0; r < 4; ++r) {
1502 const PetscInt newp = fStartNew + (f - fStart)*4 + r;
1503 PetscInt size;
1504
1505 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1505,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1506 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1506,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1507 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1507,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1508 }
1509 }
1510 /* Interior faces have 4 edges and 2 cells */
1511 for (c = cStart; c < cEnd; ++c) {
1512 for (r = 0; r < 12; ++r) {
1513 const PetscInt newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + r;
1514
1515 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1515,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1516 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1516,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1517 }
1518 }
1519 /* Split edges have 2 vertices and the same faces as the parent */
1520 for (e = eStart; e < eEnd; ++e) {
1521 for (r = 0; r < 2; ++r) {
1522 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
1523 PetscInt size;
1524
1525 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1525,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1526 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1526,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1527 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1527,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1528 }
1529 }
1530 /* Face edges have 2 vertices and 2+cells faces */
1531 for (f = fStart; f < fEnd; ++f) {
1532 for (r = 0; r < 4; ++r) {
1533 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (f - fStart)*4 + r;
1534 PetscInt size;
1535
1536 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1536,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1537 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1537,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1538 ierr = DMPlexSetSupportSize(rdm, newp, 2+size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1538,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1539 }
1540 }
1541 /* Cell edges have 2 vertices and 4 faces */
1542 for (c = cStart; c < cEnd; ++c) {
1543 for (r = 0; r < 6; ++r) {
1544 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + r;
1545
1546 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1546,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1547 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1547,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1548 }
1549 }
1550 /* Old vertices have identical supports */
1551 for (v = vStart; v < vEnd; ++v) {
1552 const PetscInt newp = vStartNew + (v - vStart);
1553 PetscInt size;
1554
1555 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1555,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1556 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1556,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1557 }
1558 /* Edge vertices have 2 + faces supports */
1559 for (e = eStart; e < eEnd; ++e) {
1560 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
1561 PetscInt size;
1562
1563 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1563,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1564 ierr = DMPlexSetSupportSize(rdm, newp, 2 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1564,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1565 }
1566 /* Face vertices have 4 + cells supports */
1567 for (f = fStart; f < fEnd; ++f) {
1568 const PetscInt newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (f - fStart);
1569 PetscInt size;
1570
1571 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1571,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1572 ierr = DMPlexSetSupportSize(rdm, newp, 4 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1572,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1573 }
1574 /* Cell vertices have 6 supports */
1575 for (c = cStart; c < cEnd; ++c) {
1576 const PetscInt newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (fEnd - fStart) + (c - cStart);
1577
1578 ierr = DMPlexSetSupportSize(rdm, newp, 6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1578,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1579 }
1580 break;
1581 case REFINER_HYBRID_HEX_3D:
1582 ierr = DMPlexSetHybridBounds(rdm, cStartNew + 8*(cMax-cStart), fStartNew + 4*(fMax - fStart) + 12*(cMax - cStart),
1583 eStartNew + 2*(eMax - eStart) + 4*(fMax - fStart) + 6*(cMax - cStart), PETSC_DETERMINE-1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1583,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1584 /* Interior cells have 6 faces */
1585 for (c = cStart; c < cMax; ++c) {
1586 for (r = 0; r < 8; ++r) {
1587 const PetscInt newp = cStartNew + (c - cStart)*8 + r;
1588
1589 ierr = DMPlexSetConeSize(rdm, newp, 6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1589,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1590 }
1591 }
1592 /* Hybrid cells have 6 faces */
1593 for (c = cMax; c < cEnd; ++c) {
1594 for (r = 0; r < 4; ++r) {
1595 const PetscInt newp = cStartNew + (cMax - cStart)*8 + (c - cMax)*4 + r;
1596
1597 ierr = DMPlexSetConeSize(rdm, newp, 6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1597,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1598 }
1599 }
1600 /* Interior split faces have 4 edges and the same cells as the parent */
1601 for (f = fStart; f < fMax; ++f) {
1602 for (r = 0; r < 4; ++r) {
1603 const PetscInt newp = fStartNew + (f - fStart)*4 + r;
1604 PetscInt size;
1605
1606 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1606,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1607 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1607,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1608 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1608,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1609 }
1610 }
1611 /* Interior cell faces have 4 edges and 2 cells */
1612 for (c = cStart; c < cMax; ++c) {
1613 for (r = 0; r < 12; ++r) {
1614 const PetscInt newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + r;
1615
1616 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1616,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1617 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1617,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1618 }
1619 }
1620 /* Hybrid split faces have 4 edges and the same cells as the parent */
1621 for (f = fMax; f < fEnd; ++f) {
1622 for (r = 0; r < 2; ++r) {
1623 const PetscInt newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (f - fMax)*2 + r;
1624 PetscInt size;
1625
1626 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1626,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1627 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1627,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1628 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1628,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1629 }
1630 }
1631 /* Hybrid cells faces have 4 edges and 2 cells */
1632 for (c = cMax; c < cEnd; ++c) {
1633 for (r = 0; r < 4; ++r) {
1634 const PetscInt newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (c - cMax)*4 + r;
1635
1636 ierr = DMPlexSetConeSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1636,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1637 ierr = DMPlexSetSupportSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1637,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1638 }
1639 }
1640 /* Interior split edges have 2 vertices and the same faces as the parent */
1641 for (e = eStart; e < eMax; ++e) {
1642 for (r = 0; r < 2; ++r) {
1643 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
1644 PetscInt size;
1645
1646 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1646,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1647 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1647,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1648 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1648,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1649 }
1650 }
1651 /* Interior face edges have 2 vertices and 2+cells faces */
1652 for (f = fStart; f < fMax; ++f) {
1653 for (r = 0; r < 4; ++r) {
1654 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (f - fStart)*4 + r;
1655 PetscInt size;
1656
1657 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1657,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1658 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1658,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1659 ierr = DMPlexSetSupportSize(rdm, newp, 2+size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1659,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1660 }
1661 }
1662 /* Interior cell edges have 2 vertices and 4 faces */
1663 for (c = cStart; c < cMax; ++c) {
1664 for (r = 0; r < 6; ++r) {
1665 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + r;
1666
1667 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1667,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1668 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1668,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1669 }
1670 }
1671 /* Hybrid edges have 2 vertices and the same faces */
1672 for (e = eMax; e < eEnd; ++e) {
1673 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (e - eMax);
1674 PetscInt size;
1675
1676 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1676,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1677 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1677,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1678 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1678,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1679 }
1680 /* Hybrid face edges have 2 vertices and 2+cells faces */
1681 for (f = fMax; f < fEnd; ++f) {
1682 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (f - fMax);
1683 PetscInt size;
1684
1685 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1685,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1686 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1686,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1687 ierr = DMPlexSetSupportSize(rdm, newp, 2+size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1687,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1688 }
1689 /* Hybrid cell edges have 2 vertices and 4 faces */
1690 for (c = cMax; c < cEnd; ++c) {
1691 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (fEnd - fMax) + (c - cMax);
1692
1693 ierr = DMPlexSetConeSize(rdm, newp, 2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1693,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1694 ierr = DMPlexSetSupportSize(rdm, newp, 4);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1694,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1695 }
1696 /* Interior vertices have identical supports */
1697 for (v = vStart; v < vEnd; ++v) {
1698 const PetscInt newp = vStartNew + (v - vStart);
1699 PetscInt size;
1700
1701 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1701,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1702 ierr = DMPlexSetSupportSize(rdm, newp, size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1702,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1703 }
1704 /* Interior edge vertices have 2 + faces supports */
1705 for (e = eStart; e < eMax; ++e) {
1706 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
1707 PetscInt size;
1708
1709 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1709,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1710 ierr = DMPlexSetSupportSize(rdm, newp, 2 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1710,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1711 }
1712 /* Interior face vertices have 4 + cells supports */
1713 for (f = fStart; f < fMax; ++f) {
1714 const PetscInt newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (f - fStart);
1715 PetscInt size;
1716
1717 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1717,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1718 ierr = DMPlexSetSupportSize(rdm, newp, 4 + size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1718,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1719 }
1720 /* Interior cell vertices have 6 supports */
1721 for (c = cStart; c < cMax; ++c) {
1722 const PetscInt newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax - fStart) + (c - cStart);
1723
1724 ierr = DMPlexSetSupportSize(rdm, newp, 6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1724,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1725 }
1726 break;
1727 default:
1728 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),1728,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
1729 }
1730 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1731}
1732
1733static PetscErrorCode CellRefinerSetCones(CellRefiner refiner, DM dm, PetscInt depthSize[], DM rdm)
1734{
1735 const PetscInt *faces, cellInd[4] = {0, 1, 2, 3};
1736 PetscInt cStart, cEnd, cMax, vStart, vEnd, vMax, fStart, fEnd, fMax, eStart, eEnd, eMax;
1737 PetscInt cStartNew, cEndNew, cMaxNew, vStartNew, vEndNew, fStartNew, fEndNew, fMaxNew, eStartNew, eEndNew, eMaxNew;
1738 PetscInt depth, maxSupportSize, *supportRef, c, f, e, v, r;
1739#if defined(PETSC_USE_DEBUG1)
1740 PetscInt p;
1741#endif
1742 PetscErrorCode ierr;
1743
1744 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 1744; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1745 if (!refiner) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1746 ierr = DMPlexGetDepth(dm, &depth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1746,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1747 ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1747,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1748 ierr = DMPlexGetDepthStratum(dm, 1, &eStart, &eEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1748,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1749 ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1749,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1750 ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1750,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1751 ierr = DMPlexGetHybridBounds(dm, &cMax, &fMax, &eMax, &vMax);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1751,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1752 ierr = GetDepthStart_Private(depth, depthSize, &cStartNew, &fStartNew, &eStartNew, &vStartNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1752,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1753 ierr = GetDepthEnd_Private(depth, depthSize, &cEndNew, &fEndNew, &eEndNew, &vEndNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1753,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1754 switch (refiner) {
1755 case REFINER_SIMPLEX_1D:
1756 /* Max support size of refined mesh is 2 */
1757 ierr = PetscMalloc1(2, &supportRef)PetscMallocA(1,PETSC_FALSE,1757,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2)*sizeof(**(&supportRef)),(&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1757,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1758 /* All cells have 2 vertices */
1759 for (c = cStart; c < cEnd; ++c) {
1760 const PetscInt newv = vStartNew + (vEnd - vStart) + (c - cStart);
1761
1762 for (r = 0; r < 2; ++r) {
1763 const PetscInt newp = cStartNew + (c - cStart)*2 + r;
1764 const PetscInt *cone;
1765 PetscInt coneNew[2];
1766
1767 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1767,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1768 coneNew[0] = vStartNew + (cone[0] - vStart);
1769 coneNew[1] = vStartNew + (cone[1] - vStart);
1770 coneNew[(r+1)%2] = newv;
1771 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1771,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1772#if defined(PETSC_USE_DEBUG1)
1773 if ((newp < cStartNew) || (newp >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1773,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
,cStartNew,cEndNew)
;
1774 for (p = 0; p < 2; ++p) {
1775 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),1775,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
1776 }
1777#endif
1778 }
1779 }
1780 /* Old vertices have identical supports */
1781 for (v = vStart; v < vEnd; ++v) {
1782 const PetscInt newp = vStartNew + (v - vStart);
1783 const PetscInt *support, *cone;
1784 PetscInt size, s;
1785
1786 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1786,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1787 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1787,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1788 for (s = 0; s < size; ++s) {
1789 PetscInt r = 0;
1790
1791 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1792 if (cone[1] == v) r = 1;
1793 supportRef[s] = cStartNew + (support[s] - cStart)*2 + r;
1794 }
1795 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1795,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1796#if defined(PETSC_USE_DEBUG1)
1797 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),1797,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
1798 for (p = 0; p < size; ++p) {
1799 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1799,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
1800 }
1801#endif
1802 }
1803 /* Cell vertices have support of 2 cells */
1804 for (c = cStart; c < cEnd; ++c) {
1805 const PetscInt newp = vStartNew + (vEnd - vStart) + (c - cStart);
1806
1807 supportRef[0] = cStartNew + (c - cStart)*2 + 0;
1808 supportRef[1] = cStartNew + (c - cStart)*2 + 1;
1809 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1809,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1810#if defined(PETSC_USE_DEBUG1)
1811 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),1811,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
1812 for (p = 0; p < 2; ++p) {
1813 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1813,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
1814 }
1815#endif
1816 }
1817 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),1817,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1817,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1818 break;
1819 case REFINER_SIMPLEX_2D:
1820 /*
1821 2
1822 |\
1823 | \
1824 | \
1825 | \
1826 | C \
1827 | \
1828 | \
1829 2---1---1
1830 |\ D / \
1831 | 2 0 \
1832 |A \ / B \
1833 0---0-------1
1834 */
1835 /* All cells have 3 faces */
1836 for (c = cStart; c < cEnd; ++c) {
1837 const PetscInt newp = cStartNew + (c - cStart)*4;
1838 const PetscInt *cone, *ornt;
1839 PetscInt coneNew[3], orntNew[3];
1840
1841 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1841,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1842 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1842,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1843 /* A triangle */
1844 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 1 : 0);
1845 orntNew[0] = ornt[0];
1846 coneNew[1] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 2;
1847 orntNew[1] = -2;
1848 coneNew[2] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 0 : 1);
1849 orntNew[2] = ornt[2];
1850 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1850,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1851 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1851,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1852#if defined(PETSC_USE_DEBUG1)
1853 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1853,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
1854 for (p = 0; p < 3; ++p) {
1855 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1855,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
1856 }
1857#endif
1858 /* B triangle */
1859 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 0 : 1);
1860 orntNew[0] = ornt[0];
1861 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 1 : 0);
1862 orntNew[1] = ornt[1];
1863 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 0;
1864 orntNew[2] = -2;
1865 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1865,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1866 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1866,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1867#if defined(PETSC_USE_DEBUG1)
1868 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1868,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
1869 for (p = 0; p < 3; ++p) {
1870 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1870,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
1871 }
1872#endif
1873 /* C triangle */
1874 coneNew[0] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 1;
1875 orntNew[0] = -2;
1876 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 0 : 1);
1877 orntNew[1] = ornt[1];
1878 coneNew[2] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 1 : 0);
1879 orntNew[2] = ornt[2];
1880 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1880,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1881 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1881,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1882#if defined(PETSC_USE_DEBUG1)
1883 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1883,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
1884 for (p = 0; p < 3; ++p) {
1885 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1885,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
1886 }
1887#endif
1888 /* D triangle */
1889 coneNew[0] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 0;
1890 orntNew[0] = 0;
1891 coneNew[1] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 1;
1892 orntNew[1] = 0;
1893 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 2;
1894 orntNew[2] = 0;
1895 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1895,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1896 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1896,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1897#if defined(PETSC_USE_DEBUG1)
1898 if ((newp+3 < cStartNew) || (newp+3 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1898,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cEndNew)
;
1899 for (p = 0; p < 3; ++p) {
1900 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1900,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
1901 }
1902#endif
1903 }
1904 /* Split faces have 2 vertices and the same cells as the parent */
1905 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1905,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1906 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,1906,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1906,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1907 for (f = fStart; f < fEnd; ++f) {
1908 const PetscInt newv = vStartNew + (vEnd - vStart) + (f - fStart);
1909
1910 for (r = 0; r < 2; ++r) {
1911 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
1912 const PetscInt *cone, *ornt, *support;
1913 PetscInt coneNew[2], coneSize, c, supportSize, s;
1914
1915 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1915,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1916 coneNew[0] = vStartNew + (cone[0] - vStart);
1917 coneNew[1] = vStartNew + (cone[1] - vStart);
1918 coneNew[(r+1)%2] = newv;
1919 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1920#if defined(PETSC_USE_DEBUG1)
1921 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1921,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
1922 for (p = 0; p < 2; ++p) {
1923 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),1923,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
1924 }
1925#endif
1926 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1926,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1927 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1927,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1928 for (s = 0; s < supportSize; ++s) {
1929 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1929,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1930 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1930,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1931 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1931,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1932 for (c = 0; c < coneSize; ++c) {
1933 if (cone[c] == f) break;
1934 }
1935 supportRef[s] = cStartNew + (support[s] - cStart)*4 + (ornt[c] < 0 ? (c+1-r)%3 : (c+r)%3);
1936 }
1937 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1937,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1938#if defined(PETSC_USE_DEBUG1)
1939 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1939,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
1940 for (p = 0; p < supportSize; ++p) {
1941 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1941,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
1942 }
1943#endif
1944 }
1945 }
1946 /* Interior faces have 2 vertices and 2 cells */
1947 for (c = cStart; c < cEnd; ++c) {
1948 const PetscInt *cone;
1949
1950 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1950,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1951 for (r = 0; r < 3; ++r) {
1952 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + r;
1953 PetscInt coneNew[2];
1954 PetscInt supportNew[2];
1955
1956 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - fStart);
1957 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[(r+1)%3] - fStart);
1958 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1958,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1959#if defined(PETSC_USE_DEBUG1)
1960 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1960,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
1961 for (p = 0; p < 2; ++p) {
1962 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),1962,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
1963 }
1964#endif
1965 supportNew[0] = (c - cStart)*4 + (r+1)%3;
1966 supportNew[1] = (c - cStart)*4 + 3;
1967 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1967,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1968#if defined(PETSC_USE_DEBUG1)
1969 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1969,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
1970 for (p = 0; p < 2; ++p) {
1971 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),1971,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
1972 }
1973#endif
1974 }
1975 }
1976 /* Old vertices have identical supports */
1977 for (v = vStart; v < vEnd; ++v) {
1978 const PetscInt newp = vStartNew + (v - vStart);
1979 const PetscInt *support, *cone;
1980 PetscInt size, s;
1981
1982 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1982,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1983 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1983,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1984 for (s = 0; s < size; ++s) {
1985 PetscInt r = 0;
1986
1987 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1987,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1988 if (cone[1] == v) r = 1;
1989 supportRef[s] = fStartNew + (support[s] - fStart)*2 + r;
1990 }
1991 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1991,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1992#if defined(PETSC_USE_DEBUG1)
1993 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),1993,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
1994 for (p = 0; p < size; ++p) {
1995 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),1995,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
1996 }
1997#endif
1998 }
1999 /* Face vertices have 2 + cells*2 supports */
2000 for (f = fStart; f < fEnd; ++f) {
2001 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
2002 const PetscInt *cone, *support;
2003 PetscInt size, s;
2004
2005 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2005,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2006 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2006,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2007 supportRef[0] = fStartNew + (f - fStart)*2 + 0;
2008 supportRef[1] = fStartNew + (f - fStart)*2 + 1;
2009 for (s = 0; s < size; ++s) {
2010 PetscInt r = 0;
2011
2012 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2012,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2013 if (cone[1] == f) r = 1;
2014 else if (cone[2] == f) r = 2;
2015 supportRef[2+s*2+0] = fStartNew + (fEnd - fStart)*2 + (support[s] - cStart)*3 + (r+2)%3;
2016 supportRef[2+s*2+1] = fStartNew + (fEnd - fStart)*2 + (support[s] - cStart)*3 + r;
2017 }
2018 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2018,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2019#if defined(PETSC_USE_DEBUG1)
2020 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2020,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
2021 for (p = 0; p < 2+size*2; ++p) {
2022 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2022,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
2023 }
2024#endif
2025 }
2026 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),2026,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2026,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2027 break;
2028 case REFINER_SIMPLEX_TO_HEX_2D:
2029 /*
2030 2
2031 |\
2032 | \
2033 | \
2034 | \
2035 | C \
2036 | \
2037 2 1
2038 |\ / \
2039 | 2 1 \
2040 | \/ \
2041 | | \
2042 |A | B \
2043 | 0 \
2044 | | \
2045 0---0----------1
2046 */
2047 /* All cells have 4 faces */
2048 for (c = cStart; c < cEnd; ++c) {
2049 const PetscInt newp = cStartNew + (c - cStart)*3;
2050 const PetscInt *cone, *ornt;
2051 PetscInt coneNew[4], orntNew[4];
2052
2053 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2053,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2054 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2054,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2055 /* A quad */
2056 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 1 : 0);
2057 orntNew[0] = ornt[0];
2058 coneNew[1] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 0;
2059 orntNew[1] = 0;
2060 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 2;
2061 orntNew[2] = -2;
2062 coneNew[3] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 0 : 1);
2063 orntNew[3] = ornt[2];
2064 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2064,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2065 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2065,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2066#if defined(PETSC_USE_DEBUG1)
2067 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2067,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
2068 for (p = 0; p < 4; ++p) {
2069 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2069,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2070 }
2071#endif
2072 /* B quad */
2073 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 0 : 1);
2074 orntNew[0] = ornt[0];
2075 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 1 : 0);
2076 orntNew[1] = ornt[1];
2077 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 1;
2078 orntNew[2] = 0;
2079 coneNew[3] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 0;
2080 orntNew[3] = -2;
2081 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2081,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2082 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2082,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2083#if defined(PETSC_USE_DEBUG1)
2084 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2084,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
2085 for (p = 0; p < 4; ++p) {
2086 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2086,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2087 }
2088#endif
2089 /* C quad */
2090 coneNew[0] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 0 : 1);
2091 orntNew[0] = ornt[1];
2092 coneNew[1] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 1 : 0);
2093 orntNew[1] = ornt[2];
2094 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 2;
2095 orntNew[2] = 0;
2096 coneNew[3] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 1;
2097 orntNew[3] = -2;
2098 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2098,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2099 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2099,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2100#if defined(PETSC_USE_DEBUG1)
2101 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2101,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
2102 for (p = 0; p < 4; ++p) {
2103 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2103,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2104 }
2105#endif
2106 }
2107 /* Split faces have 2 vertices and the same cells as the parent */
2108 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2108,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2109 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,2109,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2109,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2110 for (f = fStart; f < fEnd; ++f) {
2111 const PetscInt newv = vStartNew + (vEnd - vStart) + (f - fStart);
2112
2113 for (r = 0; r < 2; ++r) {
2114 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
2115 const PetscInt *cone, *ornt, *support;
2116 PetscInt coneNew[2], coneSize, c, supportSize, s;
2117
2118 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2118,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2119 coneNew[0] = vStartNew + (cone[0] - vStart);
2120 coneNew[1] = vStartNew + (cone[1] - vStart);
2121 coneNew[(r+1)%2] = newv;
2122 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2122,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2123#if defined(PETSC_USE_DEBUG1)
2124 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2124,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2125 for (p = 0; p < 2; ++p) {
2126 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2126,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
2127 }
2128#endif
2129 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2129,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2130 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2130,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2131 for (s = 0; s < supportSize; ++s) {
2132 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2132,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2133 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2133,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2134 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2134,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2135 for (c = 0; c < coneSize; ++c) {
2136 if (cone[c] == f) break;
2137 }
2138 supportRef[s] = cStartNew + (support[s] - cStart)*3 + (ornt[c] < 0 ? (c+1-r)%3 : (c+r)%3);
2139 }
2140 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2140,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2141#if defined(PETSC_USE_DEBUG1)
2142 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2142,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2143 for (p = 0; p < supportSize; ++p) {
2144 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2144,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
2145 }
2146#endif
2147 }
2148 }
2149 /* Interior faces have 2 vertices and 2 cells */
2150 for (c = cStart; c < cEnd; ++c) {
2151 const PetscInt *cone;
2152
2153 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2153,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2154 for (r = 0; r < 3; ++r) {
2155 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + r;
2156 PetscInt coneNew[2];
2157 PetscInt supportNew[2];
2158
2159 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - fStart);
2160 coneNew[1] = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (c - cStart);
2161 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2161,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2162#if defined(PETSC_USE_DEBUG1)
2163 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2163,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2164 for (p = 0; p < 2; ++p) {
2165 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2165,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
2166 }
2167#endif
2168 supportNew[0] = (c - cStart)*3 + r%3;
2169 supportNew[1] = (c - cStart)*3 + (r+1)%3;
2170 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2170,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2171#if defined(PETSC_USE_DEBUG1)
2172 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2172,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2173 for (p = 0; p < 2; ++p) {
2174 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2174,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
2175 }
2176#endif
2177 }
2178 }
2179 /* Old vertices have identical supports */
2180 for (v = vStart; v < vEnd; ++v) {
2181 const PetscInt newp = vStartNew + (v - vStart);
2182 const PetscInt *support, *cone;
2183 PetscInt size, s;
2184
2185 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2185,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2186 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2186,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2187 for (s = 0; s < size; ++s) {
2188 PetscInt r = 0;
2189
2190 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2190,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2191 if (cone[1] == v) r = 1;
2192 supportRef[s] = fStartNew + (support[s] - fStart)*2 + r;
2193 }
2194 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2194,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2195#if defined(PETSC_USE_DEBUG1)
2196 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2196,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
2197 for (p = 0; p < size; ++p) {
2198 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2198,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
2199 }
2200#endif
2201 }
2202 /* Split-face vertices have cells + 2 supports */
2203 for (f = fStart; f < fEnd; ++f) {
2204 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
2205 const PetscInt *cone, *support;
2206 PetscInt size, s;
2207
2208 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2208,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2209 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2209,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2210 supportRef[0] = fStartNew + (f - fStart)*2 + 0;
2211 supportRef[1] = fStartNew + (f - fStart)*2 + 1;
2212 for (s = 0; s < size; ++s) {
2213 PetscInt r = 0;
2214
2215 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2215,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2216 if (cone[1] == f) r = 1;
2217 else if (cone[2] == f) r = 2;
2218 supportRef[2+s+0] = fStartNew + (fEnd - fStart)*2 + (support[s] - cStart)*3 + r;
2219 }
2220 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2220,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2221#if defined(PETSC_USE_DEBUG1)
2222 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2222,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
2223 for (p = 0; p < 2+size; ++p) {
2224 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2224,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
2225 }
2226#endif
2227 }
2228 /* Interior vertices have 3 supports */
2229 for (c = cStart; c < cEnd; ++c) {
2230 const PetscInt newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + c - cStart;
2231
2232 supportRef[0] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 0;
2233 supportRef[1] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 1;
2234 supportRef[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 2;
2235 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2235,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2236 }
2237 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),2237,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2237,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2238 break;
2239 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
2240 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),2240,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
2241 cMax = PetscMin(cEnd, cMax)(((cEnd)<(cMax)) ? (cEnd) : (cMax));
2242 for (c = cStart; c < cMax; ++c) {
2243 const PetscInt newp = cStartNew + (c - cStart)*3;
2244 const PetscInt *cone, *ornt;
2245 PetscInt coneNew[4], orntNew[4];
2246
2247 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2247,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2248 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2248,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2249 /* A quad */
2250 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 1 : 0);
2251 orntNew[0] = ornt[0];
2252 coneNew[1] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 0;
2253 orntNew[1] = 0;
2254 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 2;
2255 orntNew[2] = -2;
2256 coneNew[3] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 0 : 1);
2257 orntNew[3] = ornt[2];
2258 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2258,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2259 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2259,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2260#if defined(PETSC_USE_DEBUG1)
2261 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2261,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
2262 for (p = 0; p < 4; ++p) {
2263 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2263,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2264 }
2265#endif
2266 /* B quad */
2267 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 0 : 1);
2268 orntNew[0] = ornt[0];
2269 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 1 : 0);
2270 orntNew[1] = ornt[1];
2271 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 1;
2272 orntNew[2] = 0;
2273 coneNew[3] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 0;
2274 orntNew[3] = -2;
2275 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2276 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2276,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2277#if defined(PETSC_USE_DEBUG1)
2278 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2278,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
2279 for (p = 0; p < 4; ++p) {
2280 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2280,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2281 }
2282#endif
2283 /* C quad */
2284 coneNew[0] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 0 : 1);
2285 orntNew[0] = ornt[1];
2286 coneNew[1] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 1 : 0);
2287 orntNew[1] = ornt[2];
2288 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 2;
2289 orntNew[2] = 0;
2290 coneNew[3] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 1;
2291 orntNew[3] = -2;
2292 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2292,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2293 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2293,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2294#if defined(PETSC_USE_DEBUG1)
2295 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2295,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
2296 for (p = 0; p < 4; ++p) {
2297 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2297,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2298 }
2299#endif
2300 }
2301 /*
2302 2---------1---------3
2303 | | |
2304 | D 1 C |
2305 | | |
2306 2----2----0----3----3
2307 | | |
2308 | A 0 B |
2309 | | |
2310 0---------0---------1
2311 */
2312 /* Parent cells are input as prisms but children are quads, since the mesh is no longer hybrid */
2313 for (c = cMax; c < cEnd; ++c) {
2314 const PetscInt newp = cStartNew + (cMax - cStart)*3 + (c - cMax)*4;
2315 const PetscInt newpt = (cMax - cStart)*3 + (c - cMax)*4;
2316 const PetscInt *cone, *ornt;
2317 PetscInt coneNew[4], orntNew[4];
2318
2319 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2319,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2320 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2320,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2321 /* A quad */
2322 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 1 : 0);
2323 orntNew[0] = ornt[0];
2324 coneNew[1] = fStartNew + (fEnd - fStart)*2 + newpt + 0;
2325 orntNew[1] = 0;
2326 coneNew[2] = fStartNew + (fEnd - fStart)*2 + newpt + 2;
2327 orntNew[2] = -2;
2328 coneNew[3] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 1 : 0);
2329 orntNew[3] = ornt[2] < 0 ? 0 : -2;
2330 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2330,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2331 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2331,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2332#if defined(PETSC_USE_DEBUG1)
2333 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2333,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
2334 for (p = 0; p < 4; ++p) {
2335 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2335,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2336 }
2337#endif
2338 /* B quad */
2339 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 0 : 1);
2340 orntNew[0] = ornt[0];
2341 coneNew[1] = fStartNew + (cone[3] - fStart)*2 + (ornt[3] < 0 ? 1 : 0);
2342 orntNew[1] = ornt[3];
2343 coneNew[2] = fStartNew + (fEnd - fStart)*2 + newpt + 3;
2344 orntNew[2] = 0;
2345 coneNew[3] = fStartNew + (fEnd - fStart)*2 + newpt + 0;
2346 orntNew[3] = -2;
2347 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2347,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2348 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2348,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2349#if defined(PETSC_USE_DEBUG1)
2350 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2350,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
2351 for (p = 0; p < 4; ++p) {
2352 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2352,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2353 }
2354#endif
2355 /* C quad */
2356 coneNew[0] = fStartNew + (fEnd - fStart)*2 + newpt + 3;
2357 orntNew[0] = -2;
2358 coneNew[1] = fStartNew + (cone[3] - fStart)*2 + (ornt[3] < 0 ? 0 : 1);
2359 orntNew[1] = ornt[3];
2360 coneNew[2] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 0 : 1);
2361 orntNew[2] = ornt[1] < 0 ? 0 : -2;
2362 coneNew[3] = fStartNew + (fEnd - fStart)*2 + newpt + 1;
2363 orntNew[3] = 0;
2364 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2364,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2365 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2365,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2366#if defined(PETSC_USE_DEBUG1)
2367 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2367,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
2368 for (p = 0; p < 4; ++p) {
2369 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2369,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2370 }
2371#endif
2372 /* D quad */
2373 coneNew[0] = fStartNew + (fEnd - fStart)*2 + newpt + 2;
2374 orntNew[0] = 0;
2375 coneNew[1] = fStartNew + (fEnd - fStart)*2 + newpt + 1;
2376 orntNew[1] = -2;
2377 coneNew[2] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 1 : 0);
2378 orntNew[2] = ornt[1] < 0 ? 0 : -2;
2379 coneNew[3] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 0 : 1);
2380 orntNew[3] = ornt[2] < 0 ? 0 : -2;
2381 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2381,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2382 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2382,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2383#if defined(PETSC_USE_DEBUG1)
2384 if ((newp+3 < cStartNew) || (newp+3 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2384,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cEndNew)
;
2385 for (p = 0; p < 4; ++p) {
2386 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2386,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2387 }
2388#endif
2389 }
2390 /* Split faces have 2 vertices and the same cells as the parent */
2391 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2391,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2392 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,2392,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2392,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2393 for (f = fStart; f < fEnd; ++f) {
2394 const PetscInt newv = vStartNew + (vEnd - vStart) + (f - fStart);
2395
2396 for (r = 0; r < 2; ++r) {
2397 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
2398 const PetscInt *cone, *ornt, *support;
2399 PetscInt coneNew[2], coneSize, c, supportSize, s;
2400
2401 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2401,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2402 coneNew[0] = vStartNew + (cone[0] - vStart);
2403 coneNew[1] = vStartNew + (cone[1] - vStart);
2404 coneNew[(r+1)%2] = newv;
2405 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2405,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2406#if defined(PETSC_USE_DEBUG1)
2407 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2407,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2408 for (p = 0; p < 2; ++p) {
2409 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2409,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
2410 }
2411#endif
2412 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2412,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2413 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2413,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2414 for (s = 0; s < supportSize; ++s) {
2415 const PetscInt p2q[4][2] = { {0, 1},
2416 {3, 2},
2417 {0, 3},
2418 {1, 2} };
2419
2420 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2420,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2421 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2421,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2422 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2422,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2423 for (c = 0; c < coneSize; ++c) {
2424 if (cone[c] == f) break;
2425 }
2426 if (coneSize == 3) supportRef[s] = cStartNew + (support[s] - cStart)*3 + (ornt[c] < 0 ? (c+1-r)%3 : (c+r)%3);
2427 else if (coneSize == 4) supportRef[s] = cStartNew + (cMax - cStart)*3 + (support[s] - cMax)*4 + (ornt[c] < 0 ? p2q[c][(r+1)%2] : p2q[c][r]);
2428 else SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected cone size %D", coneSize)return PetscError(((MPI_Comm)0x44000001),2428,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected cone size %D",coneSize)
;
2429 }
2430 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2430,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2431#if defined(PETSC_USE_DEBUG1)
2432 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2432,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2433 for (p = 0; p < supportSize; ++p) {
2434 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2434,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
2435 }
2436#endif
2437 }
2438 }
2439 /* Interior faces have 2 vertices and 2 cells */
2440 for (c = cStart; c < cMax; ++c) {
2441 const PetscInt *cone;
2442
2443 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2443,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2444 for (r = 0; r < 3; ++r) {
2445 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + r;
2446 PetscInt coneNew[2];
2447 PetscInt supportNew[2];
2448
2449 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - fStart);
2450 coneNew[1] = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (c - cStart);
2451 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2451,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2452#if defined(PETSC_USE_DEBUG1)
2453 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2453,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2454 for (p = 0; p < 2; ++p) {
2455 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2455,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
2456 }
2457#endif
2458 supportNew[0] = (c - cStart)*3 + r%3;
2459 supportNew[1] = (c - cStart)*3 + (r+1)%3;
2460 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2460,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2461#if defined(PETSC_USE_DEBUG1)
2462 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2462,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2463 for (p = 0; p < 2; ++p) {
2464 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2464,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
2465 }
2466#endif
2467 }
2468 }
2469 /* Hybrid interior faces have 2 vertices and 2 cells */
2470 for (c = cMax; c < cEnd; ++c) {
2471 const PetscInt *cone;
2472 PetscInt coneNew[2], supportNew[2];
2473
2474 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2474,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2475 for (r = 0; r < 4; ++r) {
2476 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (c - cMax)*4 + r;
2477
2478 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - fStart);
2479 coneNew[1] = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (cMax - cStart) + (c - cMax);
2480 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2480,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2481#if defined(PETSC_USE_DEBUG1)
2482 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2482,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2483 for (p = 0; p < 2; ++p) {
2484 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2484,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
2485 }
2486#endif
2487 if (r==0) {
2488 supportNew[0] = (cMax - cStart)*3 + (c - cMax)*4 + 0;
2489 supportNew[1] = (cMax - cStart)*3 + (c - cMax)*4 + 1;
2490 } else if (r==1) {
2491 supportNew[0] = (cMax - cStart)*3 + (c - cMax)*4 + 2;
2492 supportNew[1] = (cMax - cStart)*3 + (c - cMax)*4 + 3;
2493 } else if (r==2) {
2494 supportNew[0] = (cMax - cStart)*3 + (c - cMax)*4 + 0;
2495 supportNew[1] = (cMax - cStart)*3 + (c - cMax)*4 + 3;
2496 } else {
2497 supportNew[0] = (cMax - cStart)*3 + (c - cMax)*4 + 1;
2498 supportNew[1] = (cMax - cStart)*3 + (c - cMax)*4 + 2;
2499 }
2500 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2500,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2501#if defined(PETSC_USE_DEBUG1)
2502 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2502,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2503 for (p = 0; p < 2; ++p) {
2504 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2504,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
2505 }
2506#endif
2507 }
2508 }
2509 /* Old vertices have identical supports */
2510 for (v = vStart; v < vEnd; ++v) {
2511 const PetscInt newp = vStartNew + (v - vStart);
2512 const PetscInt *support, *cone;
2513 PetscInt size, s;
2514
2515 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2515,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2516 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2516,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2517 for (s = 0; s < size; ++s) {
2518 PetscInt r = 0;
2519
2520 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2520,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2521 if (cone[1] == v) r = 1;
2522 supportRef[s] = fStartNew + (support[s] - fStart)*2 + r;
2523 }
2524 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2524,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2525#if defined(PETSC_USE_DEBUG1)
2526 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2526,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
2527 for (p = 0; p < size; ++p) {
2528 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2528,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
2529 }
2530#endif
2531 }
2532 /* Split-face vertices have cells + 2 supports */
2533 for (f = fStart; f < fEnd; ++f) {
2534 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
2535 const PetscInt *cone, *support;
2536 PetscInt size, s;
2537
2538 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2538,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2539 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2539,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2540 supportRef[0] = fStartNew + (f - fStart)*2 + 0;
2541 supportRef[1] = fStartNew + (f - fStart)*2 + 1;
2542 for (s = 0; s < size; ++s) {
2543 PetscInt r = 0, coneSize;
2544
2545 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2545,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2546 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2546,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2547 if (coneSize == 3) {
2548 if (cone[1] == f) r = 1;
2549 else if (cone[2] == f) r = 2;
2550 supportRef[2+s] = fStartNew + (fEnd - fStart)*2 + (support[s] - cStart)*3 + r;
2551 } else if (coneSize == 4) {
2552 if (cone[1] == f) r = 1;
2553 else if (cone[2] == f) r = 2;
2554 else if (cone[3] == f) r = 3;
2555 supportRef[2+s] = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (support[s] - cMax)*4 + r;
2556 } else SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected cone size %D", coneSize)return PetscError(((MPI_Comm)0x44000001),2556,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected cone size %D",coneSize)
;
2557 }
2558 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2558,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2559#if defined(PETSC_USE_DEBUG1)
2560 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2560,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
2561 for (p = 0; p < 2+size; ++p) {
2562 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2562,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
2563 }
2564#endif
2565 }
2566 /* Interior vertices have 3 supports */
2567 for (c = cStart; c < cMax; ++c) {
2568 const PetscInt newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + c - cStart;
2569
2570 supportRef[0] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 0;
2571 supportRef[1] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 1;
2572 supportRef[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*3 + 2;
2573 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2573,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2574 }
2575 /* Hybrid interior vertices have 4 supports */
2576 for (c = cMax; c < cEnd; ++c) {
2577 const PetscInt newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + c - cStart;
2578
2579 supportRef[0] = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (c - cMax)*4 + 0;
2580 supportRef[1] = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (c - cMax)*4 + 1;
2581 supportRef[2] = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (c - cMax)*4 + 2;
2582 supportRef[3] = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (c - cMax)*4 + 3;
2583 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2583,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2584 }
2585 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),2585,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2585,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2586 break;
2587 case REFINER_HEX_2D:
2588 /*
2589 3---------2---------2
2590 | | |
2591 | D 2 C |
2592 | | |
2593 3----3----0----1----1
2594 | | |
2595 | A 0 B |
2596 | | |
2597 0---------0---------1
2598 */
2599 /* All cells have 4 faces */
2600 for (c = cStart; c < cEnd; ++c) {
2601 const PetscInt newp = (c - cStart)*4;
2602 const PetscInt *cone, *ornt;
2603 PetscInt coneNew[4], orntNew[4];
2604
2605 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2605,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2606 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2606,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2607 /* A quad */
2608 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 1 : 0);
2609 orntNew[0] = ornt[0];
2610 coneNew[1] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + 0;
2611 orntNew[1] = 0;
2612 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + 3;
2613 orntNew[2] = -2;
2614 coneNew[3] = fStartNew + (cone[3] - fStart)*2 + (ornt[3] < 0 ? 0 : 1);
2615 orntNew[3] = ornt[3];
2616 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2616,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2617 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2617,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2618#if defined(PETSC_USE_DEBUG1)
2619 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2619,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
2620 for (p = 0; p < 4; ++p) {
2621 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2621,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2622 }
2623#endif
2624 /* B quad */
2625 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 0 : 1);
2626 orntNew[0] = ornt[0];
2627 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 1 : 0);
2628 orntNew[1] = ornt[1];
2629 coneNew[2] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + 1;
2630 orntNew[2] = -2;
2631 coneNew[3] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + 0;
2632 orntNew[3] = -2;
2633 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2633,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2634 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2634,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2635#if defined(PETSC_USE_DEBUG1)
2636 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2636,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
2637 for (p = 0; p < 4; ++p) {
2638 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2638,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2639 }
2640#endif
2641 /* C quad */
2642 coneNew[0] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + 1;
2643 orntNew[0] = 0;
2644 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 0 : 1);
2645 orntNew[1] = ornt[1];
2646 coneNew[2] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 1 : 0);
2647 orntNew[2] = ornt[2];
2648 coneNew[3] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + 2;
2649 orntNew[3] = -2;
2650 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2650,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2651 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2651,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2652#if defined(PETSC_USE_DEBUG1)
2653 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2653,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
2654 for (p = 0; p < 4; ++p) {
2655 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2655,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2656 }
2657#endif
2658 /* D quad */
2659 coneNew[0] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + 3;
2660 orntNew[0] = 0;
2661 coneNew[1] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + 2;
2662 orntNew[1] = 0;
2663 coneNew[2] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 0 : 1);
2664 orntNew[2] = ornt[2];
2665 coneNew[3] = fStartNew + (cone[3] - fStart)*2 + (ornt[3] < 0 ? 1 : 0);
2666 orntNew[3] = ornt[3];
2667 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2667,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2668 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2668,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2669#if defined(PETSC_USE_DEBUG1)
2670 if ((newp+3 < cStartNew) || (newp+3 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2670,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cEndNew)
;
2671 for (p = 0; p < 4; ++p) {
2672 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2672,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2673 }
2674#endif
2675 }
2676 /* Split faces have 2 vertices and the same cells as the parent */
2677 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2677,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2678 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,2678,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2678,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2679 for (f = fStart; f < fEnd; ++f) {
2680 const PetscInt newv = vStartNew + (vEnd - vStart) + (f - fStart);
2681
2682 for (r = 0; r < 2; ++r) {
2683 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
2684 const PetscInt *cone, *ornt, *support;
2685 PetscInt coneNew[2], coneSize, c, supportSize, s;
2686
2687 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2687,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2688 coneNew[0] = vStartNew + (cone[0] - vStart);
2689 coneNew[1] = vStartNew + (cone[1] - vStart);
2690 coneNew[(r+1)%2] = newv;
2691 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2691,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2692#if defined(PETSC_USE_DEBUG1)
2693 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2693,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2694 for (p = 0; p < 2; ++p) {
2695 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2695,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
2696 }
2697#endif
2698 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2698,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2699 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2699,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2700 for (s = 0; s < supportSize; ++s) {
2701 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2701,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2702 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2702,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2703 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2703,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2704 for (c = 0; c < coneSize; ++c) {
2705 if (cone[c] == f) break;
2706 }
2707 supportRef[s] = cStartNew + (support[s] - cStart)*4 + (ornt[c] < 0 ? (c+1-r)%4 : (c+r)%4);
2708 }
2709 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2709,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2710#if defined(PETSC_USE_DEBUG1)
2711 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2711,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2712 for (p = 0; p < supportSize; ++p) {
2713 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2713,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
2714 }
2715#endif
2716 }
2717 }
2718 /* Interior faces have 2 vertices and 2 cells */
2719 for (c = cStart; c < cEnd; ++c) {
2720 const PetscInt *cone;
2721 PetscInt coneNew[2], supportNew[2];
2722
2723 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2723,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2724 for (r = 0; r < 4; ++r) {
2725 const PetscInt newp = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + r;
2726
2727 if (r==1 || r==2) {
2728 coneNew[0] = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (c - cStart);
2729 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[r] - fStart);
2730 } else {
2731 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - fStart);
2732 coneNew[1] = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (c - cStart);
2733 }
2734 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2734,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2735#if defined(PETSC_USE_DEBUG1)
2736 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2736,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2737 for (p = 0; p < 2; ++p) {
2738 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2738,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
2739 }
2740#endif
2741 supportNew[0] = (c - cStart)*4 + r;
2742 supportNew[1] = (c - cStart)*4 + (r+1)%4;
2743 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2743,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2744#if defined(PETSC_USE_DEBUG1)
2745 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2745,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2746 for (p = 0; p < 2; ++p) {
2747 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2747,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
2748 }
2749#endif
2750 }
2751 }
2752 /* Old vertices have identical supports */
2753 for (v = vStart; v < vEnd; ++v) {
2754 const PetscInt newp = vStartNew + (v - vStart);
2755 const PetscInt *support, *cone;
2756 PetscInt size, s;
2757
2758 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2758,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2759 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2759,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2760 for (s = 0; s < size; ++s) {
2761 PetscInt r = 0;
2762
2763 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2763,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2764 if (cone[1] == v) r = 1;
2765 supportRef[s] = fStartNew + (support[s] - fStart)*2 + r;
2766 }
2767 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2767,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2768#if defined(PETSC_USE_DEBUG1)
2769 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2769,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
2770 for (p = 0; p < size; ++p) {
2771 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2771,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
2772 }
2773#endif
2774 }
2775 /* Face vertices have 2 + cells supports */
2776 for (f = fStart; f < fEnd; ++f) {
2777 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
2778 const PetscInt *cone, *support;
2779 PetscInt size, s;
2780
2781 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2781,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2782 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2782,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2783 supportRef[0] = fStartNew + (f - fStart)*2 + 0;
2784 supportRef[1] = fStartNew + (f - fStart)*2 + 1;
2785 for (s = 0; s < size; ++s) {
2786 PetscInt r = 0;
2787
2788 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2788,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2789 if (cone[1] == f) r = 1;
2790 else if (cone[2] == f) r = 2;
2791 else if (cone[3] == f) r = 3;
2792 supportRef[2+s] = fStartNew + (fEnd - fStart)*2 + (support[s] - cStart)*4 + r;
2793 }
2794 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2794,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2795#if defined(PETSC_USE_DEBUG1)
2796 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2796,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
2797 for (p = 0; p < 2+size; ++p) {
2798 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2798,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
2799 }
2800#endif
2801 }
2802 /* Cell vertices have 4 supports */
2803 for (c = cStart; c < cEnd; ++c) {
2804 const PetscInt newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (c - cStart);
2805 PetscInt supportNew[4];
2806
2807 for (r = 0; r < 4; ++r) {
2808 supportNew[r] = fStartNew + (fEnd - fStart)*2 + (c - cStart)*4 + r;
2809 }
2810 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2810,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2811 }
2812 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),2812,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2812,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2813 break;
2814 case REFINER_HYBRID_SIMPLEX_2D:
2815 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),2815,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
2816 cMax = PetscMin(cEnd, cMax)(((cEnd)<(cMax)) ? (cEnd) : (cMax));
2817 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),2817,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
2818 fMax = PetscMin(fEnd, fMax)(((fEnd)<(fMax)) ? (fEnd) : (fMax));
2819 ierr = DMPlexGetHybridBounds(rdm, &cMaxNew, &fMaxNew, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2819,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2820 /* Interior cells have 3 faces */
2821 for (c = cStart; c < cMax; ++c) {
2822 const PetscInt newp = cStartNew + (c - cStart)*4;
2823 const PetscInt *cone, *ornt;
2824 PetscInt coneNew[3], orntNew[3];
2825
2826 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2826,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2827 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2827,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2828 /* A triangle */
2829 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 1 : 0);
2830 orntNew[0] = ornt[0];
2831 coneNew[1] = fStartNew + (fMax - fStart)*2 + (c - cStart)*3 + 2;
2832 orntNew[1] = -2;
2833 coneNew[2] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 0 : 1);
2834 orntNew[2] = ornt[2];
2835 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2835,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2836 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2836,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2837#if defined(PETSC_USE_DEBUG1)
2838 if ((newp+0 < cStartNew) || (newp+0 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior cell [%D, %D)", newp+0, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),2838,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior cell [%D, %D)"
,newp+0,cStartNew,cMaxNew)
;
2839 for (p = 0; p < 3; ++p) {
2840 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),2840,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior face [%D, %D)"
,coneNew[p],fStartNew,fMaxNew)
;
2841 }
2842#endif
2843 /* B triangle */
2844 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 0 : 1);
2845 orntNew[0] = ornt[0];
2846 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 1 : 0);
2847 orntNew[1] = ornt[1];
2848 coneNew[2] = fStartNew + (fMax - fStart)*2 + (c - cStart)*3 + 0;
2849 orntNew[2] = -2;
2850 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2850,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2851 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2851,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2852#if defined(PETSC_USE_DEBUG1)
2853 if ((newp+1 < cStartNew) || (newp+1 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior cell [%D, %D)", newp+1, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),2853,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior cell [%D, %D)"
,newp+1,cStartNew,cMaxNew)
;
2854 for (p = 0; p < 3; ++p) {
2855 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),2855,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior face [%D, %D)"
,coneNew[p],fStartNew,fMaxNew)
;
2856 }
2857#endif
2858 /* C triangle */
2859 coneNew[0] = fStartNew + (fMax - fStart)*2 + (c - cStart)*3 + 1;
2860 orntNew[0] = -2;
2861 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 0 : 1);
2862 orntNew[1] = ornt[1];
2863 coneNew[2] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 1 : 0);
2864 orntNew[2] = ornt[2];
2865 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2865,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2866 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2866,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2867#if defined(PETSC_USE_DEBUG1)
2868 if ((newp+2 < cStartNew) || (newp+2 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior cell [%D, %D)", newp+2, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),2868,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior cell [%D, %D)"
,newp+2,cStartNew,cMaxNew)
;
2869 for (p = 0; p < 3; ++p) {
2870 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),2870,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior face [%D, %D)"
,coneNew[p],fStartNew,fMaxNew)
;
2871 }
2872#endif
2873 /* D triangle */
2874 coneNew[0] = fStartNew + (fMax - fStart)*2 + (c - cStart)*3 + 0;
2875 orntNew[0] = 0;
2876 coneNew[1] = fStartNew + (fMax - fStart)*2 + (c - cStart)*3 + 1;
2877 orntNew[1] = 0;
2878 coneNew[2] = fStartNew + (fMax - fStart)*2 + (c - cStart)*3 + 2;
2879 orntNew[2] = 0;
2880 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2880,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2881 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2881,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2882#if defined(PETSC_USE_DEBUG1)
2883 if ((newp+3 < cStartNew) || (newp+3 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior cell [%D, %D)", newp+3, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),2883,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior cell [%D, %D)"
,newp+3,cStartNew,cMaxNew)
;
2884 for (p = 0; p < 3; ++p) {
2885 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),2885,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior face [%D, %D)"
,coneNew[p],fStartNew,fMaxNew)
;
2886 }
2887#endif
2888 }
2889 /*
2890 2----3----3
2891 | |
2892 | B |
2893 | |
2894 0----4--- 1
2895 | |
2896 | A |
2897 | |
2898 0----2----1
2899 */
2900 /* Hybrid cells have 4 faces */
2901 for (c = cMax; c < cEnd; ++c) {
2902 const PetscInt newp = cStartNew + (cMax - cStart)*4 + (c - cMax)*2;
2903 const PetscInt *cone, *ornt;
2904 PetscInt coneNew[4], orntNew[4], r;
2905
2906 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2906,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2907 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2907,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2908 r = (ornt[0] < 0 ? 1 : 0);
2909 /* A quad */
2910 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + r;
2911 orntNew[0] = ornt[0];
2912 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + r;
2913 orntNew[1] = ornt[1];
2914 coneNew[2+r] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (cone[2+r] - fMax);
2915 orntNew[2+r] = 0;
2916 coneNew[3-r] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (fEnd - fMax) + (c - cMax);
2917 orntNew[3-r] = 0;
2918 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2918,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2919 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2920#if defined(PETSC_USE_DEBUG1)
2921 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2921,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
2922 for (p = 0; p < 4; ++p) {
2923 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2923,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2924 }
2925#endif
2926 /* B quad */
2927 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + 1-r;
2928 orntNew[0] = ornt[0];
2929 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + 1-r;
2930 orntNew[1] = ornt[1];
2931 coneNew[2+r] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (fEnd - fMax) + (c - cMax);
2932 orntNew[2+r] = 0;
2933 coneNew[3-r] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (cone[3-r] - fMax);
2934 orntNew[3-r] = 0;
2935 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2935,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2936 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2936,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2937#if defined(PETSC_USE_DEBUG1)
2938 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2938,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
2939 for (p = 0; p < 4; ++p) {
2940 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2940,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
2941 }
2942#endif
2943 }
2944 /* Interior split faces have 2 vertices and the same cells as the parent */
2945 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2945,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2946 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,2946,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2946,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2947 for (f = fStart; f < fMax; ++f) {
2948 const PetscInt newv = vStartNew + (vEnd - vStart) + (f - fStart);
2949
2950 for (r = 0; r < 2; ++r) {
2951 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
2952 const PetscInt *cone, *ornt, *support;
2953 PetscInt coneNew[2], coneSize, c, supportSize, s;
2954
2955 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2955,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2956 coneNew[0] = vStartNew + (cone[0] - vStart);
2957 coneNew[1] = vStartNew + (cone[1] - vStart);
2958 coneNew[(r+1)%2] = newv;
2959 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2959,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2960#if defined(PETSC_USE_DEBUG1)
2961 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2961,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2962 for (p = 0; p < 2; ++p) {
2963 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),2963,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
2964 }
2965#endif
2966 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2966,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2967 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2967,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2968 for (s = 0; s < supportSize; ++s) {
2969 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2969,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2970 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2970,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2971 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2971,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2972 for (c = 0; c < coneSize; ++c) if (cone[c] == f) break;
2973 if (support[s] >= cMax) {
2974 supportRef[s] = cStartNew + (cMax - cStart)*4 + (support[s] - cMax)*2 + (ornt[c] < 0 ? 1-r : r);
2975 } else {
2976 supportRef[s] = cStartNew + (support[s] - cStart)*4 + (ornt[c] < 0 ? (c+1-r)%3 : (c+r)%3);
2977 }
2978 }
2979 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2979,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2980#if defined(PETSC_USE_DEBUG1)
2981 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),2981,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
2982 for (p = 0; p < supportSize; ++p) {
2983 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),2983,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
2984 }
2985#endif
2986 }
2987 }
2988 /* Interior cell faces have 2 vertices and 2 cells */
2989 for (c = cStart; c < cMax; ++c) {
2990 const PetscInt *cone;
2991
2992 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2992,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2993 for (r = 0; r < 3; ++r) {
2994 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (c - cStart)*3 + r;
2995 PetscInt coneNew[2];
2996 PetscInt supportNew[2];
2997
2998 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - fStart);
2999 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[(r+1)%3] - fStart);
3000 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3000,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3001#if defined(PETSC_USE_DEBUG1)
3002 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3002,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3003 for (p = 0; p < 2; ++p) {
3004 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3004,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
3005 }
3006#endif
3007 supportNew[0] = (c - cStart)*4 + (r+1)%3;
3008 supportNew[1] = (c - cStart)*4 + 3;
3009 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3009,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3010#if defined(PETSC_USE_DEBUG1)
3011 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3011,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3012 for (p = 0; p < 2; ++p) {
3013 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3013,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3014 }
3015#endif
3016 }
3017 }
3018 /* Interior hybrid faces have 2 vertices and the same cells */
3019 for (f = fMax; f < fEnd; ++f) {
3020 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (f - fMax);
3021 const PetscInt *cone, *ornt;
3022 const PetscInt *support;
3023 PetscInt coneNew[2];
3024 PetscInt supportNew[2];
3025 PetscInt size, s, r;
3026
3027 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3027,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3028 coneNew[0] = vStartNew + (cone[0] - vStart);
3029 coneNew[1] = vStartNew + (cone[1] - vStart);
3030 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3030,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3031#if defined(PETSC_USE_DEBUG1)
3032 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3032,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3033 for (p = 0; p < 2; ++p) {
3034 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3034,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
3035 }
3036#endif
3037 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3037,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3038 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3038,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3039 for (s = 0; s < size; ++s) {
3040 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3040,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3041 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3041,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3042 for (r = 0; r < 2; ++r) {
3043 if (cone[r+2] == f) break;
3044 }
3045 supportNew[s] = (cMax - cStart)*4 + (support[s] - cMax)*2 + (ornt[0] < 0 ? 1-r : r);
3046 }
3047 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3047,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3048#if defined(PETSC_USE_DEBUG1)
3049 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3049,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3050 for (p = 0; p < size; ++p) {
3051 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3051,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3052 }
3053#endif
3054 }
3055 /* Cell hybrid faces have 2 vertices and 2 cells */
3056 for (c = cMax; c < cEnd; ++c) {
3057 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (fEnd - fMax) + (c - cMax);
3058 const PetscInt *cone;
3059 PetscInt coneNew[2];
3060 PetscInt supportNew[2];
3061
3062 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3062,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3063 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[0] - fStart);
3064 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[1] - fStart);
3065 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3065,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3066#if defined(PETSC_USE_DEBUG1)
3067 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3067,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3068 for (p = 0; p < 2; ++p) {
3069 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3069,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
3070 }
3071#endif
3072 supportNew[0] = (cMax - cStart)*4 + (c - cMax)*2 + 0;
3073 supportNew[1] = (cMax - cStart)*4 + (c - cMax)*2 + 1;
3074 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3074,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3075#if defined(PETSC_USE_DEBUG1)
3076 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3076,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3077 for (p = 0; p < 2; ++p) {
3078 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3078,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3079 }
3080#endif
3081 }
3082 /* Old vertices have identical supports */
3083 for (v = vStart; v < vEnd; ++v) {
3084 const PetscInt newp = vStartNew + (v - vStart);
3085 const PetscInt *support, *cone;
3086 PetscInt size, s;
3087
3088 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3088,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3089 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3089,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3090 for (s = 0; s < size; ++s) {
3091 if (support[s] >= fMax) {
3092 supportRef[s] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (support[s] - fMax);
3093 } else {
3094 PetscInt r = 0;
3095
3096 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3096,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3097 if (cone[1] == v) r = 1;
3098 supportRef[s] = fStartNew + (support[s] - fStart)*2 + r;
3099 }
3100 }
3101 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3101,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3102#if defined(PETSC_USE_DEBUG1)
3103 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3103,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
3104 for (p = 0; p < size; ++p) {
3105 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3105,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
3106 }
3107#endif
3108 }
3109 /* Face vertices have 2 + (2 interior, 1 hybrid) supports */
3110 for (f = fStart; f < fMax; ++f) {
3111 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
3112 const PetscInt *cone, *support;
3113 PetscInt size, newSize = 2, s;
3114
3115 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3115,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3116 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3116,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3117 supportRef[0] = fStartNew + (f - fStart)*2 + 0;
3118 supportRef[1] = fStartNew + (f - fStart)*2 + 1;
3119 for (s = 0; s < size; ++s) {
3120 PetscInt r = 0;
3121
3122 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3122,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3123 if (support[s] >= cMax) {
3124 supportRef[newSize+0] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (fEnd - fMax) + (support[s] - cMax);
3125
3126 newSize += 1;
3127 } else {
3128 if (cone[1] == f) r = 1;
3129 else if (cone[2] == f) r = 2;
3130 supportRef[newSize+0] = fStartNew + (fMax - fStart)*2 + (support[s] - cStart)*3 + (r+2)%3;
3131 supportRef[newSize+1] = fStartNew + (fMax - fStart)*2 + (support[s] - cStart)*3 + r;
3132
3133 newSize += 2;
3134 }
3135 }
3136 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3136,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3137#if defined(PETSC_USE_DEBUG1)
3138 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3138,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
3139 for (p = 0; p < newSize; ++p) {
3140 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3140,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
3141 }
3142#endif
3143 }
3144 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),3144,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3144,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3145 break;
3146 case REFINER_HYBRID_HEX_2D:
3147 /* Hybrid Hex 2D */
3148 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),3148,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
3149 cMax = PetscMin(cEnd, cMax)(((cEnd)<(cMax)) ? (cEnd) : (cMax));
3150 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),3150,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
3151 fMax = PetscMin(fEnd, fMax)(((fEnd)<(fMax)) ? (fEnd) : (fMax));
3152 ierr = DMPlexGetHybridBounds(rdm, &cMaxNew, &fMaxNew, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3152,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3153 /* Interior cells have 4 faces */
3154 for (c = cStart; c < cMax; ++c) {
3155 const PetscInt newp = cStartNew + (c - cStart)*4;
3156 const PetscInt *cone, *ornt;
3157 PetscInt coneNew[4], orntNew[4];
3158
3159 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3159,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3160 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3160,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3161 /* A quad */
3162 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 1 : 0);
3163 orntNew[0] = ornt[0];
3164 coneNew[1] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + 0;
3165 orntNew[1] = 0;
3166 coneNew[2] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + 3;
3167 orntNew[2] = -2;
3168 coneNew[3] = fStartNew + (cone[3] - fStart)*2 + (ornt[3] < 0 ? 0 : 1);
3169 orntNew[3] = ornt[3];
3170 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3170,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3171 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3171,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3172#if defined(PETSC_USE_DEBUG1)
3173 if ((newp+0 < cStartNew) || (newp+0 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior cell [%D, %D)", newp+0, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),3173,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior cell [%D, %D)"
,newp+0,cStartNew,cMaxNew)
;
3174 for (p = 0; p < 4; ++p) {
3175 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),3175,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior face [%D, %D)"
,coneNew[p],fStartNew,fMaxNew)
;
3176 }
3177#endif
3178 /* B quad */
3179 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 0 : 1);
3180 orntNew[0] = ornt[0];
3181 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 1 : 0);
3182 orntNew[1] = ornt[1];
3183 coneNew[2] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + 1;
3184 orntNew[2] = 0;
3185 coneNew[3] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + 0;
3186 orntNew[3] = -2;
3187 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3187,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3188 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3188,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3189#if defined(PETSC_USE_DEBUG1)
3190 if ((newp+1 < cStartNew) || (newp+1 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior cell [%D, %D)", newp+1, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),3190,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior cell [%D, %D)"
,newp+1,cStartNew,cMaxNew)
;
3191 for (p = 0; p < 4; ++p) {
3192 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),3192,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior face [%D, %D)"
,coneNew[p],fStartNew,fMaxNew)
;
3193 }
3194#endif
3195 /* C quad */
3196 coneNew[0] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + 1;
3197 orntNew[0] = -2;
3198 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 0 : 1);
3199 orntNew[1] = ornt[1];
3200 coneNew[2] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 1 : 0);
3201 orntNew[2] = ornt[2];
3202 coneNew[3] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + 2;
3203 orntNew[3] = 0;
3204 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3204,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3205 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3205,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3206#if defined(PETSC_USE_DEBUG1)
3207 if ((newp+2 < cStartNew) || (newp+2 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior cell [%D, %D)", newp+2, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),3207,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior cell [%D, %D)"
,newp+2,cStartNew,cMaxNew)
;
3208 for (p = 0; p < 4; ++p) {
3209 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),3209,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior face [%D, %D)"
,coneNew[p],fStartNew,fMaxNew)
;
3210 }
3211#endif
3212 /* D quad */
3213 coneNew[0] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + 3;
3214 orntNew[0] = 0;
3215 coneNew[1] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + 2;
3216 orntNew[1] = -2;
3217 coneNew[2] = fStartNew + (cone[2] - fStart)*2 + (ornt[2] < 0 ? 0 : 1);
3218 orntNew[2] = ornt[2];
3219 coneNew[3] = fStartNew + (cone[3] - fStart)*2 + (ornt[3] < 0 ? 1 : 0);
3220 orntNew[3] = ornt[3];
3221 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3221,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3222 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3222,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3223#if defined(PETSC_USE_DEBUG1)
3224 if ((newp+3 < cStartNew) || (newp+3 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior cell [%D, %D)", newp+3, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),3224,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior cell [%D, %D)"
,newp+3,cStartNew,cMaxNew)
;
3225 for (p = 0; p < 4; ++p) {
3226 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),3226,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior face [%D, %D)"
,coneNew[p],fStartNew,fMaxNew)
;
3227 }
3228#endif
3229 }
3230 /*
3231 2----3----3
3232 | |
3233 | B |
3234 | |
3235 0----4--- 1
3236 | |
3237 | A |
3238 | |
3239 0----2----1
3240 */
3241 /* Hybrid cells have 4 faces */
3242 for (c = cMax; c < cEnd; ++c) {
3243 const PetscInt newp = cStartNew + (cMax - cStart)*4 + (c - cMax)*2;
3244 const PetscInt *cone, *ornt;
3245 PetscInt coneNew[4], orntNew[4];
3246
3247 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3247,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3248 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3248,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3249 /* A quad */
3250 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 1 : 0);
3251 orntNew[0] = ornt[0];
3252 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 1 : 0);
3253 orntNew[1] = ornt[1];
3254 coneNew[2] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (cone[2] - fMax);
3255 orntNew[2] = 0;
3256 coneNew[3] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (fEnd - fMax) + (c - cMax);
3257 orntNew[3] = 0;
3258 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3258,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3259 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3259,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3260#if defined(PETSC_USE_DEBUG1)
3261 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3261,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
3262 for (p = 0; p < 4; ++p) {
3263 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3263,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3264 }
3265#endif
3266 /* B quad */
3267 coneNew[0] = fStartNew + (cone[0] - fStart)*2 + (ornt[0] < 0 ? 0 : 1);
3268 orntNew[0] = ornt[0];
3269 coneNew[1] = fStartNew + (cone[1] - fStart)*2 + (ornt[1] < 0 ? 0 : 1);
3270 orntNew[1] = ornt[1];
3271 coneNew[2] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (fEnd - fMax) + (c - cMax);
3272 orntNew[2] = 0;
3273 coneNew[3] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (cone[3] - fMax);
3274 orntNew[3] = 0;
3275 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3276 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3276,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3277#if defined(PETSC_USE_DEBUG1)
3278 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3278,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
3279 for (p = 0; p < 4; ++p) {
3280 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3280,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3281 }
3282#endif
3283 }
3284 /* Interior split faces have 2 vertices and the same cells as the parent */
3285 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3285,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3286 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,3286,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3286,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3287 for (f = fStart; f < fMax; ++f) {
3288 const PetscInt newv = vStartNew + (vEnd - vStart) + (f - fStart);
3289
3290 for (r = 0; r < 2; ++r) {
3291 const PetscInt newp = fStartNew + (f - fStart)*2 + r;
3292 const PetscInt *cone, *ornt, *support;
3293 PetscInt coneNew[2], coneSize, c, supportSize, s;
3294
3295 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3295,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3296 coneNew[0] = vStartNew + (cone[0] - vStart);
3297 coneNew[1] = vStartNew + (cone[1] - vStart);
3298 coneNew[(r+1)%2] = newv;
3299 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3299,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3300#if defined(PETSC_USE_DEBUG1)
3301 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3301,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3302 for (p = 0; p < 2; ++p) {
3303 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3303,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
3304 }
3305#endif
3306 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3306,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3307 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3307,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3308 for (s = 0; s < supportSize; ++s) {
3309 if (support[s] >= cMax) {
3310 supportRef[s] = cStartNew + (cMax - cStart)*4 + (support[s] - cMax)*2 + r;
3311 } else {
3312 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3313 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3313,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3314 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3314,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3315 for (c = 0; c < coneSize; ++c) {
3316 if (cone[c] == f) break;
3317 }
3318 supportRef[s] = cStartNew + (support[s] - cStart)*4 + (ornt[c] < 0 ? (c+1-r)%4 : (c+r)%4);
3319 }
3320 }
3321 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3321,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3322#if defined(PETSC_USE_DEBUG1)
3323 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3323,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3324 for (p = 0; p < supportSize; ++p) {
3325 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3325,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
3326 }
3327#endif
3328 }
3329 }
3330 /* Interior cell faces have 2 vertices and 2 cells */
3331 for (c = cStart; c < cMax; ++c) {
3332 const PetscInt *cone;
3333
3334 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3334,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3335 for (r = 0; r < 4; ++r) {
3336 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + r;
3337 PetscInt coneNew[2], supportNew[2];
3338
3339 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - fStart);
3340 coneNew[1] = vStartNew + (vEnd - vStart) + (fMax - fStart) + (c - cStart);
3341 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3341,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3342#if defined(PETSC_USE_DEBUG1)
3343 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3343,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3344 for (p = 0; p < 2; ++p) {
3345 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3345,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
3346 }
3347#endif
3348 supportNew[0] = (c - cStart)*4 + r;
3349 supportNew[1] = (c - cStart)*4 + (r+1)%4;
3350 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3350,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3351#if defined(PETSC_USE_DEBUG1)
3352 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3352,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3353 for (p = 0; p < 2; ++p) {
3354 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3354,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3355 }
3356#endif
3357 }
3358 }
3359 /* Hybrid faces have 2 vertices and the same cells */
3360 for (f = fMax; f < fEnd; ++f) {
3361 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (f - fMax);
3362 const PetscInt *cone, *support;
3363 PetscInt coneNew[2], supportNew[2];
3364 PetscInt size, s, r;
3365
3366 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3366,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3367 coneNew[0] = vStartNew + (cone[0] - vStart);
3368 coneNew[1] = vStartNew + (cone[1] - vStart);
3369 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3369,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3370#if defined(PETSC_USE_DEBUG1)
3371 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3371,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3372 for (p = 0; p < 2; ++p) {
3373 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3373,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
3374 }
3375#endif
3376 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3376,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3377 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3377,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3378 for (s = 0; s < size; ++s) {
3379 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3379,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3380 for (r = 0; r < 2; ++r) {
3381 if (cone[r+2] == f) break;
3382 }
3383 supportNew[s] = (cMax - cStart)*4 + (support[s] - cMax)*2 + r;
3384 }
3385 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3385,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3386#if defined(PETSC_USE_DEBUG1)
3387 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3387,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3388 for (p = 0; p < size; ++p) {
3389 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3389,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3390 }
3391#endif
3392 }
3393 /* Cell hybrid faces have 2 vertices and 2 cells */
3394 for (c = cMax; c < cEnd; ++c) {
3395 const PetscInt newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (fEnd - fMax) + (c - cMax);
3396 const PetscInt *cone;
3397 PetscInt coneNew[2], supportNew[2];
3398
3399 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3399,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3400 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[0] - fStart);
3401 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[1] - fStart);
3402 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3402,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3403#if defined(PETSC_USE_DEBUG1)
3404 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3404,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3405 for (p = 0; p < 2; ++p) {
3406 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3406,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
3407 }
3408#endif
3409 supportNew[0] = (cMax - cStart)*4 + (c - cMax)*2 + 0;
3410 supportNew[1] = (cMax - cStart)*4 + (c - cMax)*2 + 1;
3411 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3411,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3412#if defined(PETSC_USE_DEBUG1)
3413 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3413,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3414 for (p = 0; p < 2; ++p) {
3415 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3415,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3416 }
3417#endif
3418 }
3419 /* Old vertices have identical supports */
3420 for (v = vStart; v < vEnd; ++v) {
3421 const PetscInt newp = vStartNew + (v - vStart);
3422 const PetscInt *support, *cone;
3423 PetscInt size, s;
3424
3425 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3425,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3426 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3426,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3427 for (s = 0; s < size; ++s) {
3428 if (support[s] >= fMax) {
3429 supportRef[s] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (support[s] - fMax);
3430 } else {
3431 PetscInt r = 0;
3432
3433 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3433,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3434 if (cone[1] == v) r = 1;
3435 supportRef[s] = fStartNew + (support[s] - fStart)*2 + r;
3436 }
3437 }
3438 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3438,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3439#if defined(PETSC_USE_DEBUG1)
3440 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3440,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
3441 for (p = 0; p < size; ++p) {
3442 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3442,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
3443 }
3444#endif
3445 }
3446 /* Face vertices have 2 + cells supports */
3447 for (f = fStart; f < fMax; ++f) {
3448 const PetscInt newp = vStartNew + (vEnd - vStart) + (f - fStart);
3449 const PetscInt *cone, *support;
3450 PetscInt size, s;
3451
3452 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3452,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3453 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3453,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3454 supportRef[0] = fStartNew + (f - fStart)*2 + 0;
3455 supportRef[1] = fStartNew + (f - fStart)*2 + 1;
3456 for (s = 0; s < size; ++s) {
3457 PetscInt r = 0;
3458
3459 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3459,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3460 if (support[s] >= cMax) {
3461 supportRef[2+s] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (fEnd - fMax) + (support[s] - cMax);
3462 } else {
3463 if (cone[1] == f) r = 1;
3464 else if (cone[2] == f) r = 2;
3465 else if (cone[3] == f) r = 3;
3466 supportRef[2+s] = fStartNew + (fMax - fStart)*2 + (support[s] - cStart)*4 + r;
3467 }
3468 }
3469 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3469,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3470#if defined(PETSC_USE_DEBUG1)
3471 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3471,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
3472 for (p = 0; p < 2+size; ++p) {
3473 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3473,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
3474 }
3475#endif
3476 }
3477 /* Cell vertices have 4 supports */
3478 for (c = cStart; c < cMax; ++c) {
3479 const PetscInt newp = vStartNew + (vEnd - vStart) + (fMax - fStart) + (c - cStart);
3480 PetscInt supportNew[4];
3481
3482 for (r = 0; r < 4; ++r) {
3483 supportNew[r] = fStartNew + (fMax - fStart)*2 + (c - cStart)*4 + r;
3484 }
3485 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3485,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3486 }
3487 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),3487,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3487,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3488 break;
3489 case REFINER_SIMPLEX_3D:
3490 /* All cells have 4 faces: Tet face order is prescribed in DMPlexGetFaces_Internal() */
3491 ierr = DMPlexGetRawFaces_Internal(dm, 3, 4, cellInd, NULL((void*)0), NULL((void*)0), &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3491,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3492 for (c = cStart; c < cEnd; ++c) {
3493 const PetscInt newp = cStartNew + (c - cStart)*8;
3494 const PetscInt *cone, *ornt;
3495 PetscInt coneNew[4], orntNew[4];
3496
3497 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3497,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3498 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3498,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3499 /* A tetrahedron: {0, a, c, d} */
3500 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetTriSubface_Static(ornt[0], 0); /* A */
3501 orntNew[0] = ornt[0];
3502 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetTriSubface_Static(ornt[1], 0); /* A */
3503 orntNew[1] = ornt[1];
3504 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetTriSubface_Static(ornt[2], 0); /* A */
3505 orntNew[2] = ornt[2];
3506 coneNew[3] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 0;
3507 orntNew[3] = 0;
3508 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3508,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3509 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3509,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3510#if defined(PETSC_USE_DEBUG1)
3511 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3511,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
3512 for (p = 0; p < 4; ++p) {
3513 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3513,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3514 }
3515#endif
3516 /* B tetrahedron: {a, 1, b, e} */
3517 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetTriSubface_Static(ornt[0], 1); /* B */
3518 orntNew[0] = ornt[0];
3519 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetTriSubface_Static(ornt[1], 2); /* C */
3520 orntNew[1] = ornt[1];
3521 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 1;
3522 orntNew[2] = 0;
3523 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetTriSubface_Static(ornt[3], 1); /* B */
3524 orntNew[3] = ornt[3];
3525 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3525,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3526 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3526,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3527#if defined(PETSC_USE_DEBUG1)
3528 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3528,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
3529 for (p = 0; p < 4; ++p) {
3530 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3530,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3531 }
3532#endif
3533 /* C tetrahedron: {c, b, 2, f} */
3534 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetTriSubface_Static(ornt[0], 2); /* C */
3535 orntNew[0] = ornt[0];
3536 coneNew[1] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 2;
3537 orntNew[1] = 0;
3538 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetTriSubface_Static(ornt[2], 1); /* B */
3539 orntNew[2] = ornt[2];
3540 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetTriSubface_Static(ornt[3], 0); /* A */
3541 orntNew[3] = ornt[3];
3542 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3542,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3543 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3543,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3544#if defined(PETSC_USE_DEBUG1)
3545 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3545,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
3546 for (p = 0; p < 4; ++p) {
3547 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3547,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3548 }
3549#endif
3550 /* D tetrahedron: {d, e, f, 3} */
3551 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 3;
3552 orntNew[0] = 0;
3553 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetTriSubface_Static(ornt[1], 1); /* B */
3554 orntNew[1] = ornt[1];
3555 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetTriSubface_Static(ornt[2], 2); /* C */
3556 orntNew[2] = ornt[2];
3557 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetTriSubface_Static(ornt[3], 2); /* C */
3558 orntNew[3] = ornt[3];
3559 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3559,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3560 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3560,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3561#if defined(PETSC_USE_DEBUG1)
3562 if ((newp+3 < cStartNew) || (newp+3 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3562,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cEndNew)
;
3563 for (p = 0; p < 4; ++p) {
3564 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3564,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3565 }
3566#endif
3567 /* A' tetrahedron: {c, d, a, f} */
3568 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 0;
3569 orntNew[0] = -3;
3570 coneNew[1] = fStartNew + (cone[2] - fStart)*4 + 3;
3571 orntNew[1] = ornt[2] < 0 ? -(GetTriMidEdge_Static(ornt[2], 0)+1) : GetTriMidEdge_Static(ornt[2], 0);
3572 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 5;
3573 orntNew[2] = 0;
3574 coneNew[3] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 4;
3575 orntNew[3] = 2;
3576 ierr = DMPlexSetCone(rdm, newp+4, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3576,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3577 ierr = DMPlexSetConeOrientation(rdm, newp+4, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3577,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3578#if defined(PETSC_USE_DEBUG1)
3579 if ((newp+4 < cStartNew) || (newp+4 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+4, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3579,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+4,cStartNew,cEndNew)
;
3580 for (p = 0; p < 4; ++p) {
3581 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3581,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3582 }
3583#endif
3584 /* B' tetrahedron: {e, b, a, f} */
3585 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 1;
3586 orntNew[0] = -2;
3587 coneNew[1] = fStartNew + (cone[3] - fStart)*4 + 3;
3588 orntNew[1] = ornt[3] < 0 ? -(GetTriMidEdge_Static(ornt[3], 1)+1) : GetTriMidEdge_Static(ornt[3], 1);
3589 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 6;
3590 orntNew[2] = 0;
3591 coneNew[3] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 7;
3592 orntNew[3] = 0;
3593 ierr = DMPlexSetCone(rdm, newp+5, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3593,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3594 ierr = DMPlexSetConeOrientation(rdm, newp+5, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3594,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3595#if defined(PETSC_USE_DEBUG1)
3596 if ((newp+5 < cStartNew) || (newp+5 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+5, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3596,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+5,cStartNew,cEndNew)
;
3597 for (p = 0; p < 4; ++p) {
3598 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3598,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3599 }
3600#endif
3601 /* C' tetrahedron: {f, a, c, b} */
3602 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 5;
3603 orntNew[0] = -2;
3604 coneNew[1] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 7;
3605 orntNew[1] = -2;
3606 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 2;
3607 orntNew[2] = -1;
3608 coneNew[3] = fStartNew + (cone[0] - fStart)*4 + 3;
3609 orntNew[3] = ornt[0] < 0 ? -(GetTriMidEdge_Static(ornt[0], 2)+1) : GetTriMidEdge_Static(ornt[0], 2);
3610 ierr = DMPlexSetCone(rdm, newp+6, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3610,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3611 ierr = DMPlexSetConeOrientation(rdm, newp+6, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3611,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3612#if defined(PETSC_USE_DEBUG1)
3613 if ((newp+6 < cStartNew) || (newp+6 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+6, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3613,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+6,cStartNew,cEndNew)
;
3614 for (p = 0; p < 4; ++p) {
3615 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3615,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3616 }
3617#endif
3618 /* D' tetrahedron: {f, a, e, d} */
3619 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 6;
3620 orntNew[0] = -2;
3621 coneNew[1] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 4;
3622 orntNew[1] = -1;
3623 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 3;
3624 orntNew[2] = -2;
3625 coneNew[3] = fStartNew + (cone[1] - fStart)*4 + 3;
3626 orntNew[3] = ornt[1] < 0 ? -(GetTriMidEdge_Static(ornt[1], 1)+1) : GetTriMidEdge_Static(ornt[1], 1);
3627 ierr = DMPlexSetCone(rdm, newp+7, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3627,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3628 ierr = DMPlexSetConeOrientation(rdm, newp+7, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3628,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3629#if defined(PETSC_USE_DEBUG1)
3630 if ((newp+7 < cStartNew) || (newp+7 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+7, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3630,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+7,cStartNew,cEndNew)
;
3631 for (p = 0; p < 4; ++p) {
3632 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3632,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
3633 }
3634#endif
3635 }
3636 /* Split faces have 3 edges and the same cells as the parent */
3637 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3637,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3638 ierr = PetscMalloc1(2 + maxSupportSize*3, &supportRef)PetscMallocA(1,PETSC_FALSE,3638,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*3)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3638,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3639 for (f = fStart; f < fEnd; ++f) {
3640 const PetscInt newp = fStartNew + (f - fStart)*4;
3641 const PetscInt *cone, *ornt, *support;
3642 PetscInt coneNew[3], orntNew[3], coneSize, supportSize, s;
3643
3644 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3644,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3645 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3645,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3646 /* A triangle */
3647 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 1 : 0);
3648 orntNew[0] = ornt[0];
3649 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 2;
3650 orntNew[1] = -2;
3651 coneNew[2] = eStartNew + (cone[2] - eStart)*2 + (ornt[2] < 0 ? 0 : 1);
3652 orntNew[2] = ornt[2];
3653 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3653,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3654 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3654,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3655#if defined(PETSC_USE_DEBUG1)
3656 if ((newp+0 < fStartNew) || (newp+0 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+0, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3656,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+0,fStartNew,fEndNew)
;
3657 for (p = 0; p < 3; ++p) {
3658 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3658,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3659 }
3660#endif
3661 /* B triangle */
3662 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 0 : 1);
3663 orntNew[0] = ornt[0];
3664 coneNew[1] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 1 : 0);
3665 orntNew[1] = ornt[1];
3666 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 0;
3667 orntNew[2] = -2;
3668 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3668,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3669 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3669,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3670#if defined(PETSC_USE_DEBUG1)
3671 if ((newp+1 < fStartNew) || (newp+1 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+1, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3671,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+1,fStartNew,fEndNew)
;
3672 for (p = 0; p < 3; ++p) {
3673 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3673,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3674 }
3675#endif
3676 /* C triangle */
3677 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 1;
3678 orntNew[0] = -2;
3679 coneNew[1] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 0 : 1);
3680 orntNew[1] = ornt[1];
3681 coneNew[2] = eStartNew + (cone[2] - eStart)*2 + (ornt[2] < 0 ? 1 : 0);
3682 orntNew[2] = ornt[2];
3683 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3683,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3684 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3684,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3685#if defined(PETSC_USE_DEBUG1)
3686 if ((newp+2 < fStartNew) || (newp+2 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+2, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3686,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+2,fStartNew,fEndNew)
;
3687 for (p = 0; p < 3; ++p) {
3688 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3688,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3689 }
3690#endif
3691 /* D triangle */
3692 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 0;
3693 orntNew[0] = 0;
3694 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 1;
3695 orntNew[1] = 0;
3696 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 2;
3697 orntNew[2] = 0;
3698 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3698,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3699 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3699,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3700#if defined(PETSC_USE_DEBUG1)
3701 if ((newp+3 < fStartNew) || (newp+3 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+3, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3701,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+3,fStartNew,fEndNew)
;
3702 for (p = 0; p < 3; ++p) {
3703 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3703,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3704 }
3705#endif
3706 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3706,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3707 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3707,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3708 for (r = 0; r < 4; ++r) {
3709 for (s = 0; s < supportSize; ++s) {
3710 PetscInt subf;
3711 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3711,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3712 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3712,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3713 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3713,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3714 for (c = 0; c < coneSize; ++c) {
3715 if (cone[c] == f) break;
3716 }
3717 subf = GetTriSubfaceInverse_Static(ornt[c], r);
3718 supportRef[s] = cStartNew + (support[s] - cStart)*8 + (r==3 ? (c+2)%4 + 4 : faces[c*3+subf]);
3719 }
3720 ierr = DMPlexSetSupport(rdm, newp+r, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3720,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3721#if defined(PETSC_USE_DEBUG1)
3722 if ((newp+r < fStartNew) || (newp+r >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+r, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3722,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+r,fStartNew,fEndNew)
;
3723 for (p = 0; p < supportSize; ++p) {
3724 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3724,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
3725 }
3726#endif
3727 }
3728 }
3729 /* Interior faces have 3 edges and 2 cells */
3730 for (c = cStart; c < cEnd; ++c) {
3731 PetscInt newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8;
3732 const PetscInt *cone, *ornt;
3733 PetscInt coneNew[3], orntNew[3];
3734 PetscInt supportNew[2];
3735
3736 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3736,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3737 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3737,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3738 /* Face A: {c, a, d} */
3739 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 2);
3740 orntNew[0] = ornt[0] < 0 ? -2 : 0;
3741 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 2);
3742 orntNew[1] = ornt[1] < 0 ? -2 : 0;
3743 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 2);
3744 orntNew[2] = ornt[2] < 0 ? -2 : 0;
3745 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3745,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3746 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3746,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3747#if defined(PETSC_USE_DEBUG1)
3748 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3748,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3749 for (p = 0; p < 3; ++p) {
3750 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3750,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3751 }
3752#endif
3753 supportNew[0] = (c - cStart)*8 + 0;
3754 supportNew[1] = (c - cStart)*8 + 0+4;
3755 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3755,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3756#if defined(PETSC_USE_DEBUG1)
3757 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3757,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3758 for (p = 0; p < 2; ++p) {
3759 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3759,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3760 }
3761#endif
3762 ++newp;
3763 /* Face B: {a, b, e} */
3764 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 0);
3765 orntNew[0] = ornt[0] < 0 ? -2 : 0;
3766 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 0);
3767 orntNew[1] = ornt[3] < 0 ? -2 : 0;
3768 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 1);
3769 orntNew[2] = ornt[1] < 0 ? -2 : 0;
3770 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3770,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3771 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3771,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3772#if defined(PETSC_USE_DEBUG1)
3773 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3773,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3774 for (p = 0; p < 3; ++p) {
3775 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3775,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3776 }
3777#endif
3778 supportNew[0] = (c - cStart)*8 + 1;
3779 supportNew[1] = (c - cStart)*8 + 1+4;
3780 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3780,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3781#if defined(PETSC_USE_DEBUG1)
3782 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3782,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3783 for (p = 0; p < 2; ++p) {
3784 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3784,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3785 }
3786#endif
3787 ++newp;
3788 /* Face C: {c, f, b} */
3789 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 0);
3790 orntNew[0] = ornt[2] < 0 ? -2 : 0;
3791 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 2);
3792 orntNew[1] = ornt[3] < 0 ? -2 : 0;
3793 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 1);
3794 orntNew[2] = ornt[0] < 0 ? -2 : 0;
3795 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3795,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3796 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3796,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3797#if defined(PETSC_USE_DEBUG1)
3798 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3798,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3799 for (p = 0; p < 3; ++p) {
3800 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3800,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3801 }
3802#endif
3803 supportNew[0] = (c - cStart)*8 + 2;
3804 supportNew[1] = (c - cStart)*8 + 2+4;
3805 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3805,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3806#if defined(PETSC_USE_DEBUG1)
3807 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3807,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3808 for (p = 0; p < 2; ++p) {
3809 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3809,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3810 }
3811#endif
3812 ++newp;
3813 /* Face D: {d, e, f} */
3814 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 0);
3815 orntNew[0] = ornt[1] < 0 ? -2 : 0;
3816 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 1);
3817 orntNew[1] = ornt[3] < 0 ? -2 : 0;
3818 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 1);
3819 orntNew[2] = ornt[2] < 0 ? -2 : 0;
3820 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3820,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3821 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3821,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3822#if defined(PETSC_USE_DEBUG1)
3823 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3823,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3824 for (p = 0; p < 3; ++p) {
3825 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3825,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3826 }
3827#endif
3828 supportNew[0] = (c - cStart)*8 + 3;
3829 supportNew[1] = (c - cStart)*8 + 3+4;
3830 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3830,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3831#if defined(PETSC_USE_DEBUG1)
3832 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3832,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3833 for (p = 0; p < 2; ++p) {
3834 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3834,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3835 }
3836#endif
3837 ++newp;
3838 /* Face E: {d, f, a} */
3839 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 1);
3840 orntNew[0] = ornt[2] < 0 ? 0 : -2;
3841 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart);
3842 orntNew[1] = -2;
3843 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 2);
3844 orntNew[2] = ornt[1] < 0 ? -2 : 0;
3845 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3845,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3846 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3846,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3847#if defined(PETSC_USE_DEBUG1)
3848 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3848,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3849 for (p = 0; p < 3; ++p) {
3850 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3850,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3851 }
3852#endif
3853 supportNew[0] = (c - cStart)*8 + 0+4;
3854 supportNew[1] = (c - cStart)*8 + 3+4;
3855 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3855,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3856#if defined(PETSC_USE_DEBUG1)
3857 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3857,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3858 for (p = 0; p < 2; ++p) {
3859 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3859,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3860 }
3861#endif
3862 ++newp;
3863 /* Face F: {c, a, f} */
3864 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 2);
3865 orntNew[0] = ornt[0] < 0 ? -2 : 0;
3866 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart);
3867 orntNew[1] = 0;
3868 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 0);
3869 orntNew[2] = ornt[2] < 0 ? 0 : -2;
3870 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3870,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3871 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3871,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3872#if defined(PETSC_USE_DEBUG1)
3873 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3873,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3874 for (p = 0; p < 3; ++p) {
3875 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3875,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3876 }
3877#endif
3878 supportNew[0] = (c - cStart)*8 + 0+4;
3879 supportNew[1] = (c - cStart)*8 + 2+4;
3880 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3880,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3881#if defined(PETSC_USE_DEBUG1)
3882 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3882,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3883 for (p = 0; p < 2; ++p) {
3884 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3884,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3885 }
3886#endif
3887 ++newp;
3888 /* Face G: {e, a, f} */
3889 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 1);
3890 orntNew[0] = ornt[1] < 0 ? -2 : 0;
3891 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart);
3892 orntNew[1] = 0;
3893 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 1);
3894 orntNew[2] = ornt[3] < 0 ? 0 : -2;
3895 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3895,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3896 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3896,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3897#if defined(PETSC_USE_DEBUG1)
3898 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3898,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3899 for (p = 0; p < 3; ++p) {
3900 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3900,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3901 }
3902#endif
3903 supportNew[0] = (c - cStart)*8 + 1+4;
3904 supportNew[1] = (c - cStart)*8 + 3+4;
3905 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3905,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3906#if defined(PETSC_USE_DEBUG1)
3907 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3907,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3908 for (p = 0; p < 2; ++p) {
3909 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3909,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3910 }
3911#endif
3912 ++newp;
3913 /* Face H: {a, b, f} */
3914 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 0);
3915 orntNew[0] = ornt[0] < 0 ? -2 : 0;
3916 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 2);
3917 orntNew[1] = ornt[3] < 0 ? 0 : -2;
3918 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart);
3919 orntNew[2] = -2;
3920 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3920,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3921 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3921,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3922#if defined(PETSC_USE_DEBUG1)
3923 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3923,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3924 for (p = 0; p < 3; ++p) {
3925 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3925,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
3926 }
3927#endif
3928 supportNew[0] = (c - cStart)*8 + 1+4;
3929 supportNew[1] = (c - cStart)*8 + 2+4;
3930 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3930,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3931#if defined(PETSC_USE_DEBUG1)
3932 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3932,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
3933 for (p = 0; p < 2; ++p) {
3934 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),3934,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
3935 }
3936#endif
3937 ++newp;
3938 }
3939 /* Split Edges have 2 vertices and the same faces as the parent */
3940 for (e = eStart; e < eEnd; ++e) {
3941 const PetscInt newv = vStartNew + (vEnd - vStart) + (e - eStart);
3942
3943 for (r = 0; r < 2; ++r) {
3944 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
3945 const PetscInt *cone, *ornt, *support;
3946 PetscInt coneNew[2], coneSize, c, supportSize, s;
3947
3948 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3948,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3949 coneNew[0] = vStartNew + (cone[0] - vStart);
3950 coneNew[1] = vStartNew + (cone[1] - vStart);
3951 coneNew[(r+1)%2] = newv;
3952 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3952,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3953#if defined(PETSC_USE_DEBUG1)
3954 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3954,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
3955 for (p = 0; p < 2; ++p) {
3956 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),3956,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
3957 }
3958#endif
3959 ierr = DMPlexGetSupportSize(dm, e, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3959,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3960 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3960,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3961 for (s = 0; s < supportSize; ++s) {
3962 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3962,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3963 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3963,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3964 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3964,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3965 for (c = 0; c < coneSize; ++c) {
3966 if (cone[c] == e) break;
3967 }
3968 supportRef[s] = fStartNew + (support[s] - fStart)*4 + (c + (ornt[c] < 0 ? 1-r : r))%3;
3969 }
3970 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3970,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3971#if defined(PETSC_USE_DEBUG1)
3972 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3972,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
3973 for (p = 0; p < supportSize; ++p) {
3974 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),3974,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
3975 }
3976#endif
3977 }
3978 }
3979 /* Face edges have 2 vertices and 2+cells*(1/2) faces */
3980 for (f = fStart; f < fEnd; ++f) {
3981 const PetscInt *cone, *ornt, *support;
3982 PetscInt coneSize, supportSize, s;
3983
3984 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3984,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3985 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3985,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3986 for (r = 0; r < 3; ++r) {
3987 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + r;
3988 PetscInt coneNew[2], intFaces = 0, er, eint[4] = {1, 0, 2, 0};
3989 PetscInt fint[24] = { 1, 7, -1, -1, 0, 5,
3990 -1, -1, 1, 6, 0, 4,
3991 2, 5, 3, 4, -1, -1,
3992 -1, -1, 3, 6, 2, 7};
3993
3994 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3994,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3995 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[(r+0)%3] - eStart);
3996 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[(r+1)%3] - eStart);
3997 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3997,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3998#if defined(PETSC_USE_DEBUG1)
3999 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),3999,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
4000 for (p = 0; p < 2; ++p) {
4001 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4001,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
4002 }
4003#endif
4004 supportRef[0] = fStartNew + (f - fStart)*4 + (r+1)%3;
4005 supportRef[1] = fStartNew + (f - fStart)*4 + 3;
4006 for (s = 0; s < supportSize; ++s) {
4007 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4007,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4008 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4008,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4009 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4009,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4010 for (c = 0; c < coneSize; ++c) {if (cone[c] == f) break;}
4011 /* Here we want to determine whether edge newp contains a vertex which is part of the cross-tet edge */
4012 er = GetTriMidEdgeInverse_Static(ornt[c], r);
4013 if (er == eint[c]) {
4014 supportRef[2+intFaces++] = fStartNew + (fEnd - fStart)*4 + (support[s] - cStart)*8 + (c + 2)%4;
4015 } else {
4016 supportRef[2+intFaces++] = fStartNew + (fEnd - fStart)*4 + (support[s] - cStart)*8 + fint[(c*3 + er)*2 + 0];
4017 supportRef[2+intFaces++] = fStartNew + (fEnd - fStart)*4 + (support[s] - cStart)*8 + fint[(c*3 + er)*2 + 1];
4018 }
4019 }
4020 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4020,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4021#if defined(PETSC_USE_DEBUG1)
4022 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4022,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
4023 for (p = 0; p < intFaces; ++p) {
4024 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4024,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
4025 }
4026#endif
4027 }
4028 }
4029 /* Interior edges have 2 vertices and 4 faces */
4030 for (c = cStart; c < cEnd; ++c) {
4031 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart);
4032 const PetscInt *cone, *ornt, *fcone;
4033 PetscInt coneNew[2], supportNew[4], find;
4034
4035 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4035,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4036 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4036,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4037 ierr = DMPlexGetCone(dm, cone[0], &fcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4037,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4038 find = GetTriEdge_Static(ornt[0], 0);
4039 coneNew[0] = vStartNew + (vEnd - vStart) + (fcone[find] - eStart);
4040 ierr = DMPlexGetCone(dm, cone[2], &fcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4040,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4041 find = GetTriEdge_Static(ornt[2], 1);
4042 coneNew[1] = vStartNew + (vEnd - vStart) + (fcone[find] - eStart);
4043 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4043,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4044#if defined(PETSC_USE_DEBUG1)
4045 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4045,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
4046 for (p = 0; p < 2; ++p) {
4047 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4047,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
4048 }
4049#endif
4050 supportNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 4;
4051 supportNew[1] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 5;
4052 supportNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 6;
4053 supportNew[3] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*8 + 7;
4054 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4054,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4055#if defined(PETSC_USE_DEBUG1)
4056 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4056,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
4057 for (p = 0; p < 4; ++p) {
4058 if ((supportNew[p] < fStartNew) || (supportNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4058,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportNew
[p],fStartNew,fEndNew)
;
4059 }
4060#endif
4061 }
4062 /* Old vertices have identical supports */
4063 for (v = vStart; v < vEnd; ++v) {
4064 const PetscInt newp = vStartNew + (v - vStart);
4065 const PetscInt *support, *cone;
4066 PetscInt size, s;
4067
4068 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4068,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4069 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4069,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4070 for (s = 0; s < size; ++s) {
4071 PetscInt r = 0;
4072
4073 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4073,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4074 if (cone[1] == v) r = 1;
4075 supportRef[s] = eStartNew + (support[s] - eStart)*2 + r;
4076 }
4077 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4077,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4078#if defined(PETSC_USE_DEBUG1)
4079 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4079,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
4080 for (p = 0; p < size; ++p) {
4081 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4081,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
4082 }
4083#endif
4084 }
4085 /* Edge vertices have 2 + face*2 + 0/1 supports */
4086 for (e = eStart; e < eEnd; ++e) {
4087 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
4088 const PetscInt *cone, *support;
4089 PetscInt *star = NULL((void*)0), starSize, cellSize = 0, coneSize, size, s;
4090
4091 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4091,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4092 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4092,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4093 supportRef[0] = eStartNew + (e - eStart)*2 + 0;
4094 supportRef[1] = eStartNew + (e - eStart)*2 + 1;
4095 for (s = 0; s < size; ++s) {
4096 PetscInt r = 0;
4097
4098 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4098,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4099 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4099,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4100 for (r = 0; r < coneSize; ++r) {if (cone[r] == e) break;}
4101 supportRef[2+s*2+0] = eStartNew + (eEnd - eStart)*2 + (support[s] - fStart)*3 + (r+0)%3;
4102 supportRef[2+s*2+1] = eStartNew + (eEnd - eStart)*2 + (support[s] - fStart)*3 + (r+2)%3;
4103 }
4104 ierr = DMPlexGetTransitiveClosure(dm, e, PETSC_FALSE, &starSize, &star);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4104,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4105 for (s = 0; s < starSize*2; s += 2) {
4106 const PetscInt *cone, *ornt;
4107 PetscInt e01, e23;
4108
4109 if ((star[s] >= cStart) && (star[s] < cEnd)) {
4110 /* Check edge 0-1 */
4111 ierr = DMPlexGetCone(dm, star[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4111,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4112 ierr = DMPlexGetConeOrientation(dm, star[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4112,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4113 ierr = DMPlexGetCone(dm, cone[0], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4113,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4114 e01 = cone[GetTriEdge_Static(ornt[0], 0)];
4115 /* Check edge 2-3 */
4116 ierr = DMPlexGetCone(dm, star[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4116,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4117 ierr = DMPlexGetConeOrientation(dm, star[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4117,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4118 ierr = DMPlexGetCone(dm, cone[2], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4118,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4119 e23 = cone[GetTriEdge_Static(ornt[2], 1)];
4120 if ((e01 == e) || (e23 == e)) {supportRef[2+size*2+cellSize++] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (star[s] - cStart);}
4121 }
4122 }
4123 ierr = DMPlexRestoreTransitiveClosure(dm, e, PETSC_FALSE, &starSize, &star);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4123,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4124 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4124,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4125#if defined(PETSC_USE_DEBUG1)
4126 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4126,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
4127 for (p = 0; p < 2+size*2+cellSize; ++p) {
4128 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4128,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
4129 }
4130#endif
4131 }
4132 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),4132,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4132,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4133 ierr = DMPlexRestoreFaces_Internal(dm, 3, cStart, NULL((void*)0), NULL((void*)0), &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4133,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4134 break;
4135 case REFINER_HYBRID_SIMPLEX_3D:
4136 ierr = DMPlexGetHybridBounds(rdm, &cMaxNew, &fMaxNew, &eMaxNew, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4136,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4137 /* Interior cells have 4 faces: Tet face order is prescribed in DMPlexGetFaces_Internal() */
4138 ierr = DMPlexGetRawFaces_Internal(dm, 3, 4, cellInd, NULL((void*)0), NULL((void*)0), &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4138,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4139 for (c = cStart; c < cMax; ++c) {
4140 const PetscInt newp = cStartNew + (c - cStart)*8;
4141 const PetscInt *cone, *ornt;
4142 PetscInt coneNew[4], orntNew[4];
4143
4144 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4144,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4145 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4145,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4146 /* A tetrahedron: {0, a, c, d} */
4147 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetTriSubface_Static(ornt[0], 0); /* A */
4148 orntNew[0] = ornt[0];
4149 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetTriSubface_Static(ornt[1], 0); /* A */
4150 orntNew[1] = ornt[1];
4151 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetTriSubface_Static(ornt[2], 0); /* A */
4152 orntNew[2] = ornt[2];
4153 coneNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 0;
4154 orntNew[3] = 0;
4155 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4155,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4156 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4156,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4157#if defined(PETSC_USE_DEBUG1)
4158 if ((newp+0 < cStartNew) || (newp+0 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4158,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cMaxNew)
;
4159 for (p = 0; p < 4; ++p) {
4160 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4160,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4161 }
4162#endif
4163 /* B tetrahedron: {a, 1, b, e} */
4164 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetTriSubface_Static(ornt[0], 1); /* B */
4165 orntNew[0] = ornt[0];
4166 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetTriSubface_Static(ornt[1], 2); /* C */
4167 orntNew[1] = ornt[1];
4168 coneNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 1;
4169 orntNew[2] = 0;
4170 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetTriSubface_Static(ornt[3], 1); /* B */
4171 orntNew[3] = ornt[3];
4172 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4172,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4173 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4173,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4174#if defined(PETSC_USE_DEBUG1)
4175 if ((newp+1 < cStartNew) || (newp+1 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4175,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cMaxNew)
;
4176 for (p = 0; p < 4; ++p) {
4177 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4177,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4178 }
4179#endif
4180 /* C tetrahedron: {c, b, 2, f} */
4181 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetTriSubface_Static(ornt[0], 2); /* C */
4182 orntNew[0] = ornt[0];
4183 coneNew[1] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 2;
4184 orntNew[1] = 0;
4185 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetTriSubface_Static(ornt[2], 1); /* B */
4186 orntNew[2] = ornt[2];
4187 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetTriSubface_Static(ornt[3], 0); /* A */
4188 orntNew[3] = ornt[3];
4189 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4189,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4190 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4190,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4191#if defined(PETSC_USE_DEBUG1)
4192 if ((newp+2 < cStartNew) || (newp+2 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4192,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cMaxNew)
;
4193 for (p = 0; p < 4; ++p) {
4194 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4194,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4195 }
4196#endif
4197 /* D tetrahedron: {d, e, f, 3} */
4198 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 3;
4199 orntNew[0] = 0;
4200 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetTriSubface_Static(ornt[1], 1); /* B */
4201 orntNew[1] = ornt[1];
4202 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetTriSubface_Static(ornt[2], 2); /* C */
4203 orntNew[2] = ornt[2];
4204 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetTriSubface_Static(ornt[3], 2); /* C */
4205 orntNew[3] = ornt[3];
4206 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4206,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4207 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4207,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4208#if defined(PETSC_USE_DEBUG1)
4209 if ((newp+3 < cStartNew) || (newp+3 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4209,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cMaxNew)
;
4210 for (p = 0; p < 4; ++p) {
4211 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4211,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4212 }
4213#endif
4214 /* A' tetrahedron: {d, a, c, f} */
4215 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 0;
4216 orntNew[0] = -3;
4217 coneNew[1] = fStartNew + (cone[2] - fStart)*4 + 3;
4218 orntNew[1] = ornt[2] < 0 ? -(GetTriMidEdge_Static(ornt[2], 0)+1) : GetTriMidEdge_Static(ornt[2], 0);
4219 coneNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 5;
4220 orntNew[2] = 0;
4221 coneNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 4;
4222 orntNew[3] = 2;
4223 ierr = DMPlexSetCone(rdm, newp+4, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4223,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4224 ierr = DMPlexSetConeOrientation(rdm, newp+4, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4224,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4225#if defined(PETSC_USE_DEBUG1)
4226 if ((newp+4 < cStartNew) || (newp+4 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+4, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4226,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+4,cStartNew,cMaxNew)
;
4227 for (p = 0; p < 4; ++p) {
4228 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4228,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4229 }
4230#endif
4231 /* B' tetrahedron: {e, b, a, f} */
4232 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 1;
4233 orntNew[0] = -3;
4234 coneNew[1] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 6;
4235 orntNew[1] = 1;
4236 coneNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 7;
4237 orntNew[2] = 0;
4238 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + 3;
4239 orntNew[3] = ornt[3] < 0 ? -(GetTriMidEdge_Static(ornt[3], 0)+1) : GetTriMidEdge_Static(ornt[3], 0);
4240 ierr = DMPlexSetCone(rdm, newp+5, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4240,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4241 ierr = DMPlexSetConeOrientation(rdm, newp+5, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4241,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4242#if defined(PETSC_USE_DEBUG1)
4243 if ((newp+5 < cStartNew) || (newp+5 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+5, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4243,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+5,cStartNew,cMaxNew)
;
4244 for (p = 0; p < 4; ++p) {
4245 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4245,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4246 }
4247#endif
4248 /* C' tetrahedron: {b, f, c, a} */
4249 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 2;
4250 orntNew[0] = -3;
4251 coneNew[1] = fStartNew + (cone[0] - fStart)*4 + 3;
4252 orntNew[1] = ornt[0] < 0 ? -(GetTriMidEdge_Static(ornt[0], 2)+1) : GetTriMidEdge_Static(ornt[0], 2);
4253 coneNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 5;
4254 orntNew[2] = -3;
4255 coneNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 7;
4256 orntNew[3] = -2;
4257 ierr = DMPlexSetCone(rdm, newp+6, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4257,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4258 ierr = DMPlexSetConeOrientation(rdm, newp+6, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4258,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4259#if defined(PETSC_USE_DEBUG1)
4260 if ((newp+6 < cStartNew) || (newp+6 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+6, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4260,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+6,cStartNew,cMaxNew)
;
4261 for (p = 0; p < 4; ++p) {
4262 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4262,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4263 }
4264#endif
4265 /* D' tetrahedron: {f, e, d, a} */
4266 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 3;
4267 orntNew[0] = -3;
4268 coneNew[1] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 4;
4269 orntNew[1] = -3;
4270 coneNew[2] = fStartNew + (cone[1] - fStart)*4 + 3;
4271 orntNew[2] = ornt[1] < 0 ? -(GetTriMidEdge_Static(ornt[1], 0)+1) : GetTriMidEdge_Static(ornt[1], 0);
4272 coneNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 6;
4273 orntNew[3] = -3;
4274 ierr = DMPlexSetCone(rdm, newp+7, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4274,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4275 ierr = DMPlexSetConeOrientation(rdm, newp+7, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4276#if defined(PETSC_USE_DEBUG1)
4277 if ((newp+7 < cStartNew) || (newp+7 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+7, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4277,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+7,cStartNew,cMaxNew)
;
4278 for (p = 0; p < 4; ++p) {
4279 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4279,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4280 }
4281#endif
4282 }
4283 /* Hybrid cells have 5 faces */
4284 for (c = cMax; c < cEnd; ++c) {
4285 const PetscInt newp = cStartNew + (cMax - cStart)*8 + (c - cMax)*4;
4286 const PetscInt *cone, *ornt, *fornt;
4287 PetscInt coneNew[5], orntNew[5], o, of, i;
4288
4289 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4289,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4290 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4290,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4291 ierr = DMPlexGetConeOrientation(dm, cone[0], &fornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4291,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4292 o = ornt[0] < 0 ? -1 : 1;
4293 for (r = 0; r < 3; ++r) {
4294 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetTriSubface_Static(ornt[0], r);
4295 orntNew[0] = ornt[0];
4296 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetTriSubface_Static(ornt[1], r);
4297 orntNew[1] = ornt[1];
4298 of = fornt[GetTriEdge_Static(ornt[0], r)] < 0 ? -1 : 1;
4299 i = GetTriEdgeInverse_Static(ornt[0], r) + 2;
4300 coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (cone[2+GetTriEdge_Static(ornt[0], r)] - fMax)*2 + (o*of < 0 ? 1 : 0);
4301 orntNew[i] = 0;
4302 i = GetTriEdgeInverse_Static(ornt[0], (r+1)%3) + 2;
4303 coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + GetTriSubface_Static(ornt[0], r);
4304 orntNew[i] = 0;
4305 of = fornt[GetTriEdge_Static(ornt[0], (r+2)%3)] < 0 ? -1 : 1;
4306 i = GetTriEdgeInverse_Static(ornt[0], (r+2)%3) + 2;
4307 coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (cone[2+GetTriEdge_Static(ornt[0], (r+2)%3)] - fMax)*2 + (o*of < 0 ? 0 : 1);
4308 orntNew[i] = 0;
4309 ierr = DMPlexSetCone(rdm, newp+r, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4309,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4310 ierr = DMPlexSetConeOrientation(rdm, newp+r, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4310,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4311#if defined(PETSC_USE_DEBUG1)
4312 if ((newp+r < cMaxNew) || (newp+r >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid cell [%D, %D)", newp+r, cMaxNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),4312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid cell [%D, %D)"
,newp+r,cMaxNew,cEndNew)
;
4313 for (p = 0; p < 2; ++p) {
4314 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4314,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4315 }
4316 for (p = 2; p < 5; ++p) {
4317 if ((coneNew[p] < fMaxNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", coneNew[p], fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4317,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,coneNew[p],fMaxNew,fEndNew)
;
4318 }
4319#endif
4320 }
4321 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + 3;
4322 orntNew[0] = 0;
4323 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + 3;
4324 orntNew[1] = 0;
4325 coneNew[2] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 1;
4326 orntNew[2] = 0;
4327 coneNew[3] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 2;
4328 orntNew[3] = 0;
4329 coneNew[4] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 0;
4330 orntNew[4] = 0;
4331 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4331,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4332 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4332,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4333#if defined(PETSC_USE_DEBUG1)
4334 if ((newp+3 < cMaxNew) || (newp+3 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid cell [%D, %D)", newp+3, cMaxNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),4334,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid cell [%D, %D)"
,newp+3,cMaxNew,cEndNew)
;
4335 for (p = 0; p < 2; ++p) {
4336 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4336,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
4337 }
4338 for (p = 2; p < 5; ++p) {
4339 if ((coneNew[p] < fMaxNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", coneNew[p], fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4339,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,coneNew[p],fMaxNew,fEndNew)
;
4340 }
4341#endif
4342 }
4343 /* Split faces have 3 edges and the same cells as the parent */
4344 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4344,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4345 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,4345,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4345,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4346 for (f = fStart; f < fMax; ++f) {
4347 const PetscInt newp = fStartNew + (f - fStart)*4;
4348 const PetscInt *cone, *ornt, *support;
4349 PetscInt coneNew[3], orntNew[3], coneSize, supportSize, s;
4350
4351 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4351,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4352 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4352,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4353 /* A triangle */
4354 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 1 : 0);
4355 orntNew[0] = ornt[0];
4356 coneNew[1] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 2;
4357 orntNew[1] = -2;
4358 coneNew[2] = eStartNew + (cone[2] - eStart)*2 + (ornt[2] < 0 ? 0 : 1);
4359 orntNew[2] = ornt[2];
4360 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4360,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4361 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4361,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4362#if defined(PETSC_USE_DEBUG1)
4363 if ((newp+0 < fStartNew) || (newp+0 >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+0, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4363,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+0,fStartNew,fMaxNew)
;
4364 for (p = 0; p < 3; ++p) {
4365 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4365,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4366 }
4367#endif
4368 /* B triangle */
4369 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 0 : 1);
4370 orntNew[0] = ornt[0];
4371 coneNew[1] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 1 : 0);
4372 orntNew[1] = ornt[1];
4373 coneNew[2] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 0;
4374 orntNew[2] = -2;
4375 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4375,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4376 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4376,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4377#if defined(PETSC_USE_DEBUG1)
4378 if ((newp+1 < fStartNew) || (newp+1 >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+1, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4378,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+1,fStartNew,fMaxNew)
;
4379 for (p = 0; p < 3; ++p) {
4380 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4380,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4381 }
4382#endif
4383 /* C triangle */
4384 coneNew[0] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 1;
4385 orntNew[0] = -2;
4386 coneNew[1] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 0 : 1);
4387 orntNew[1] = ornt[1];
4388 coneNew[2] = eStartNew + (cone[2] - eStart)*2 + (ornt[2] < 0 ? 1 : 0);
4389 orntNew[2] = ornt[2];
4390 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4390,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4391 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4391,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4392#if defined(PETSC_USE_DEBUG1)
4393 if ((newp+2 < fStartNew) || (newp+2 >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+2, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4393,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+2,fStartNew,fMaxNew)
;
4394 for (p = 0; p < 3; ++p) {
4395 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4395,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4396 }
4397#endif
4398 /* D triangle */
4399 coneNew[0] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 0;
4400 orntNew[0] = 0;
4401 coneNew[1] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 1;
4402 orntNew[1] = 0;
4403 coneNew[2] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 2;
4404 orntNew[2] = 0;
4405 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4405,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4406 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4406,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4407#if defined(PETSC_USE_DEBUG1)
4408 if ((newp+3 < fStartNew) || (newp+3 >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+3, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4408,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+3,fStartNew,fMaxNew)
;
4409 for (p = 0; p < 3; ++p) {
4410 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4410,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4411 }
4412#endif
4413 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4413,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4414 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4414,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4415 for (r = 0; r < 4; ++r) {
4416 for (s = 0; s < supportSize; ++s) {
4417 PetscInt subf;
4418 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4418,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4419 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4419,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4420 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4420,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4421 for (c = 0; c < coneSize; ++c) {
4422 if (cone[c] == f) break;
4423 }
4424 subf = GetTriSubfaceInverse_Static(ornt[c], r);
4425 if (support[s] < cMax) {
4426 supportRef[s] = cStartNew + (support[s] - cStart)*8 + (r==3 ? (c+2)%4 + 4 : faces[c*3+subf]);
4427 } else {
4428 supportRef[s] = cStartNew + (cMax - cStart)*8 + (support[s] - cMax)*4 + (r==3 ? r : subf);
4429 }
4430 }
4431 ierr = DMPlexSetSupport(rdm, newp+r, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4431,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4432#if defined(PETSC_USE_DEBUG1)
4433 if ((newp+r < fStartNew) || (newp+r >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+r, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4433,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+r,fStartNew,fMaxNew)
;
4434 for (p = 0; p < supportSize; ++p) {
4435 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior or hybrid cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),4435,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior or hybrid cell [%D, %D)"
,supportRef[p],cStartNew,cEndNew)
;
4436 }
4437#endif
4438 }
4439 }
4440 /* Interior cell faces have 3 edges and 2 cells */
4441 for (c = cStart; c < cMax; ++c) {
4442 PetscInt newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*8;
4443 const PetscInt *cone, *ornt;
4444 PetscInt coneNew[3], orntNew[3];
4445 PetscInt supportNew[2];
4446
4447 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4447,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4448 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4448,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4449 /* Face A: {c, a, d} */
4450 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 2);
4451 orntNew[0] = ornt[0] < 0 ? -2 : 0;
4452 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 2);
4453 orntNew[1] = ornt[1] < 0 ? -2 : 0;
4454 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 2);
4455 orntNew[2] = ornt[2] < 0 ? -2 : 0;
4456 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4456,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4457 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4457,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4458#if defined(PETSC_USE_DEBUG1)
4459 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4459,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4460 for (p = 0; p < 3; ++p) {
4461 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4461,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4462 }
4463#endif
4464 supportNew[0] = (c - cStart)*8 + 0;
4465 supportNew[1] = (c - cStart)*8 + 0+4;
4466 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4466,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4467#if defined(PETSC_USE_DEBUG1)
4468 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4468,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4469 for (p = 0; p < 2; ++p) {
4470 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4470,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
4471 }
4472#endif
4473 ++newp;
4474 /* Face B: {a, b, e} */
4475 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 0);
4476 orntNew[0] = ornt[0] < 0 ? -2 : 0;
4477 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 0);
4478 orntNew[1] = ornt[3] < 0 ? -2 : 0;
4479 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 1);
4480 orntNew[2] = ornt[1] < 0 ? -2 : 0;
4481 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4481,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4482 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4482,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4483#if defined(PETSC_USE_DEBUG1)
4484 if ((newp+1 < fStartNew) || (newp+1 >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+1, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4484,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+1,fStartNew,fMaxNew)
;
4485 for (p = 0; p < 3; ++p) {
4486 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4486,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4487 }
4488#endif
4489 supportNew[0] = (c - cStart)*8 + 1;
4490 supportNew[1] = (c - cStart)*8 + 1+4;
4491 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4491,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4492#if defined(PETSC_USE_DEBUG1)
4493 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4493,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4494 for (p = 0; p < 2; ++p) {
4495 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4495,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
4496 }
4497#endif
4498 ++newp;
4499 /* Face C: {c, f, b} */
4500 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 0);
4501 orntNew[0] = ornt[2] < 0 ? -2 : 0;
4502 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 2);
4503 orntNew[1] = ornt[3] < 0 ? -2 : 0;
4504 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 1);
4505 orntNew[2] = ornt[0] < 0 ? -2 : 0;
4506 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4506,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4507 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4507,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4508#if defined(PETSC_USE_DEBUG1)
4509 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4509,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4510 for (p = 0; p < 3; ++p) {
4511 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4511,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4512 }
4513#endif
4514 supportNew[0] = (c - cStart)*8 + 2;
4515 supportNew[1] = (c - cStart)*8 + 2+4;
4516 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4516,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4517#if defined(PETSC_USE_DEBUG1)
4518 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4518,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4519 for (p = 0; p < 2; ++p) {
4520 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4520,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
4521 }
4522#endif
4523 ++newp;
4524 /* Face D: {d, e, f} */
4525 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 0);
4526 orntNew[0] = ornt[1] < 0 ? -2 : 0;
4527 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 1);
4528 orntNew[1] = ornt[3] < 0 ? -2 : 0;
4529 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 1);
4530 orntNew[2] = ornt[2] < 0 ? -2 : 0;
4531 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4531,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4532 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4532,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4533#if defined(PETSC_USE_DEBUG1)
4534 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4534,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4535 for (p = 0; p < 3; ++p) {
4536 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4536,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4537 }
4538#endif
4539 supportNew[0] = (c - cStart)*8 + 3;
4540 supportNew[1] = (c - cStart)*8 + 3+4;
4541 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4541,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4542#if defined(PETSC_USE_DEBUG1)
4543 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4543,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4544 for (p = 0; p < 2; ++p) {
4545 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4545,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
4546 }
4547#endif
4548 ++newp;
4549 /* Face E: {d, f, a} */
4550 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 1);
4551 orntNew[0] = ornt[2] < 0 ? 0 : -2;
4552 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart);
4553 orntNew[1] = -2;
4554 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 2);
4555 orntNew[2] = ornt[1] < 0 ? -2 : 0;
4556 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4556,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4557 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4557,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4558#if defined(PETSC_USE_DEBUG1)
4559 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4559,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4560 for (p = 0; p < 3; ++p) {
4561 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4561,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4562 }
4563#endif
4564 supportNew[0] = (c - cStart)*8 + 0+4;
4565 supportNew[1] = (c - cStart)*8 + 3+4;
4566 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4566,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4567#if defined(PETSC_USE_DEBUG1)
4568 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4568,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4569 for (p = 0; p < 2; ++p) {
4570 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4570,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
4571 }
4572#endif
4573 ++newp;
4574 /* Face F: {c, a, f} */
4575 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 2);
4576 orntNew[0] = ornt[0] < 0 ? -2 : 0;
4577 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart);
4578 orntNew[1] = 0;
4579 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*3 + GetTriMidEdge_Static(ornt[2], 0);
4580 orntNew[2] = ornt[2] < 0 ? 0 : -2;
4581 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4581,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4582 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4582,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4583#if defined(PETSC_USE_DEBUG1)
4584 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4584,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4585 for (p = 0; p < 3; ++p) {
4586 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4586,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4587 }
4588#endif
4589 supportNew[0] = (c - cStart)*8 + 0+4;
4590 supportNew[1] = (c - cStart)*8 + 2+4;
4591 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4591,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4592#if defined(PETSC_USE_DEBUG1)
4593 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4593,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4594 for (p = 0; p < 2; ++p) {
4595 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4595,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
4596 }
4597#endif
4598 ++newp;
4599 /* Face G: {e, a, f} */
4600 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriMidEdge_Static(ornt[1], 1);
4601 orntNew[0] = ornt[1] < 0 ? -2 : 0;
4602 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart);
4603 orntNew[1] = 0;
4604 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 1);
4605 orntNew[2] = ornt[3] < 0 ? 0 : -2;
4606 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4606,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4607 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4607,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4608#if defined(PETSC_USE_DEBUG1)
4609 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4609,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4610 for (p = 0; p < 3; ++p) {
4611 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4611,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4612 }
4613#endif
4614 supportNew[0] = (c - cStart)*8 + 1+4;
4615 supportNew[1] = (c - cStart)*8 + 3+4;
4616 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4616,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4617#if defined(PETSC_USE_DEBUG1)
4618 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4618,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4619 for (p = 0; p < 2; ++p) {
4620 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4620,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
4621 }
4622#endif
4623 ++newp;
4624 /* Face H: {a, b, f} */
4625 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriMidEdge_Static(ornt[0], 0);
4626 orntNew[0] = ornt[0] < 0 ? -2 : 0;
4627 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*3 + GetTriMidEdge_Static(ornt[3], 2);
4628 orntNew[1] = ornt[3] < 0 ? 0 : -2;
4629 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart);
4630 orntNew[2] = -2;
4631 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4631,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4632 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4632,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4633#if defined(PETSC_USE_DEBUG1)
4634 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4634,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4635 for (p = 0; p < 3; ++p) {
4636 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4636,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4637 }
4638#endif
4639 supportNew[0] = (c - cStart)*8 + 1+4;
4640 supportNew[1] = (c - cStart)*8 + 2+4;
4641 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4641,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4642#if defined(PETSC_USE_DEBUG1)
4643 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4643,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
4644 for (p = 0; p < 2; ++p) {
4645 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),4645,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
4646 }
4647#endif
4648 ++newp;
4649 }
4650 /* Hybrid split faces have 4 edges and same cells */
4651 for (f = fMax; f < fEnd; ++f) {
4652 const PetscInt *cone, *ornt, *support;
4653 PetscInt coneNew[4], orntNew[4];
4654 PetscInt supportNew[2], size, s, c;
4655
4656 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4656,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4657 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4657,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4658 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4658,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4659 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4659,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4660 for (r = 0; r < 2; ++r) {
4661 const PetscInt newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (f - fMax)*2 + r;
4662
4663 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 1-r : r);
4664 orntNew[0] = ornt[0];
4665 coneNew[1] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 1-r : r);
4666 orntNew[1] = ornt[1];
4667 coneNew[2+r] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (cone[2+r] - eMax);
4668 orntNew[2+r] = 0;
4669 coneNew[3-r] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (eEnd - eMax) + (f - fMax);
4670 orntNew[3-r] = 0;
4671 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4671,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4672 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4672,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4673#if defined(PETSC_USE_DEBUG1)
4674 if ((newp < fMaxNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", newp, fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4674,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,newp,fMaxNew,fEndNew)
;
4675 for (p = 0; p < 2; ++p) {
4676 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4676,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4677 }
4678 for (p = 2; p < 4; ++p) {
4679 if ((coneNew[p] < eMaxNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", coneNew[p], eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4679,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,coneNew[p],eMaxNew,eEndNew)
;
4680 }
4681#endif
4682 for (s = 0; s < size; ++s) {
4683 const PetscInt *coneCell, *orntCell, *fornt;
4684 PetscInt o, of;
4685
4686 ierr = DMPlexGetCone(dm, support[s], &coneCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4686,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4687 ierr = DMPlexGetConeOrientation(dm, support[s], &orntCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4687,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4688 o = orntCell[0] < 0 ? -1 : 1;
4689 for (c = 2; c < 5; ++c) if (coneCell[c] == f) break;
4690 if (c >= 5) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Could not find face %D in cone of cell %D", f, support[s])return PetscError(((MPI_Comm)0x44000001),4690,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Could not find face %D in cone of cell %D"
,f,support[s])
;
4691 ierr = DMPlexGetConeOrientation(dm, coneCell[0], &fornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4691,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4692 of = fornt[c-2] < 0 ? -1 : 1;
4693 supportNew[s] = cStartNew + (cMax - cStart)*8 + (support[s] - cMax)*4 + (GetTriEdgeInverse_Static(orntCell[0], c-2) + (o*of < 0 ? 1-r : r))%3;
4694 }
4695 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4695,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4696#if defined(PETSC_USE_DEBUG1)
4697 if ((newp < fMaxNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", newp, fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4697,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,newp,fMaxNew,fEndNew)
;
4698 for (p = 0; p < size; ++p) {
4699 if ((supportNew[p] < cMaxNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid cell [%D, %D)", supportNew[p], cMaxNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),4699,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid cell [%D, %D)"
,supportNew[p],cMaxNew,cEndNew)
;
4700 }
4701#endif
4702 }
4703 }
4704 /* Hybrid cell faces have 4 edges and 2 cells */
4705 for (c = cMax; c < cEnd; ++c) {
4706 PetscInt newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3;
4707 const PetscInt *cone, *ornt;
4708 PetscInt coneNew[4], orntNew[4];
4709 PetscInt supportNew[2];
4710
4711 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4711,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4712 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4712,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4713 for (r = 0; r < 3; ++r) {
4714 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + (r+2)%3;
4715 orntNew[0] = 0;
4716 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + (r+2)%3;
4717 orntNew[1] = 0;
4718 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (eEnd - eMax) + (cone[2+(r+2)%3] - fMax);
4719 orntNew[2] = 0;
4720 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (eEnd - eMax) + (cone[2+r] - fMax);
4721 orntNew[3] = 0;
4722 ierr = DMPlexSetCone(rdm, newp+r, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4722,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4723 ierr = DMPlexSetConeOrientation(rdm, newp+r, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4723,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4724#if defined(PETSC_USE_DEBUG1)
4725 if ((newp+r < fMaxNew) || (newp+r >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", newp+r, fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4725,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,newp+r,fMaxNew,fEndNew)
;
4726 for (p = 0; p < 2; ++p) {
4727 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4727,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
4728 }
4729 for (p = 2; p < 4; ++p) {
4730 if ((coneNew[p] < eMaxNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", coneNew[p], eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4730,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,coneNew[p],eMaxNew,eEndNew)
;
4731 }
4732#endif
4733 supportNew[0] = cStartNew + (cMax - cStart)*8 + (c - cMax)*4 + GetTriSubface_Static(ornt[0], r);
4734 supportNew[1] = cStartNew + (cMax - cStart)*8 + (c - cMax)*4 + 3;
4735 ierr = DMPlexSetSupport(rdm, newp+r, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4735,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4736#if defined(PETSC_USE_DEBUG1)
4737 if ((newp+r < fMaxNew) || (newp+r >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", newp+r, fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4737,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,newp+r,fMaxNew,fEndNew)
;
4738 for (p = 0; p < 2; ++p) {
4739 if ((supportNew[p] < cMaxNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid cell [%D, %D)", supportNew[p], cMaxNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),4739,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid cell [%D, %D)"
,supportNew[p],cMaxNew,cEndNew)
;
4740 }
4741#endif
4742 }
4743 }
4744 /* Interior split edges have 2 vertices and the same faces as the parent */
4745 for (e = eStart; e < eMax; ++e) {
4746 const PetscInt newv = vStartNew + (vEnd - vStart) + (e - eStart);
4747
4748 for (r = 0; r < 2; ++r) {
4749 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
4750 const PetscInt *cone, *ornt, *support;
4751 PetscInt coneNew[2], coneSize, c, supportSize, s;
4752
4753 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4753,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4754 coneNew[0] = vStartNew + (cone[0] - vStart);
4755 coneNew[1] = vStartNew + (cone[1] - vStart);
4756 coneNew[(r+1)%2] = newv;
4757 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4757,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4758#if defined(PETSC_USE_DEBUG1)
4759 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4759,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
4760 for (p = 0; p < 2; ++p) {
4761 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4761,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
4762 }
4763#endif
4764 ierr = DMPlexGetSupportSize(dm, e, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4764,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4765 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4765,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4766 for (s = 0; s < supportSize; ++s) {
4767 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4767,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4768 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4768,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4769 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4769,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4770 for (c = 0; c < coneSize; ++c) if (cone[c] == e) break;
4771 if (support[s] < fMax) {
4772 supportRef[s] = fStartNew + (support[s] - fStart)*4 + (c + (ornt[c] < 0 ? 1-r : r))%3;
4773 } else {
4774 supportRef[s] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (support[s] - fMax)*2 + (ornt[c] < 0 ? 1-r : r);
4775 }
4776 }
4777 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4777,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4778#if defined(PETSC_USE_DEBUG1)
4779 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4779,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
4780 for (p = 0; p < supportSize; ++p) {
4781 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior or hybrid face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4781,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior or hybrid face [%D, %D)"
,supportRef[p],fStartNew,fEndNew)
;
4782 }
4783#endif
4784 }
4785 }
4786 /* Interior face edges have 2 vertices and 2+cells*(1/2) faces */
4787 for (f = fStart; f < fMax; ++f) {
4788 const PetscInt *cone, *ornt, *support;
4789 PetscInt coneSize, supportSize, s;
4790
4791 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4792 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4792,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4793 for (r = 0; r < 3; ++r) {
4794 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + r;
4795 PetscInt coneNew[2], intFaces = 0, er, eint[4] = {1, 0, 2, 0};
4796 PetscInt fint[24] = { 1, 7, -1, -1, 0, 5,
4797 -1, -1, 1, 6, 0, 4,
4798 2, 5, 3, 4, -1, -1,
4799 -1, -1, 3, 6, 2, 7};
4800
4801 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4801,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4802 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[(r+0)%3] - eStart);
4803 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[(r+1)%3] - eStart);
4804 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4804,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4805#if defined(PETSC_USE_DEBUG1)
4806 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4806,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
4807 for (p = 0; p < 2; ++p) {
4808 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4808,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
4809 }
4810#endif
4811 supportRef[0] = fStartNew + (f - fStart)*4 + (r+1)%3;
4812 supportRef[1] = fStartNew + (f - fStart)*4 + 3;
4813 for (s = 0; s < supportSize; ++s) {
4814 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4814,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4815 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4815,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4816 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4816,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4817 for (c = 0; c < coneSize; ++c) {if (cone[c] == f) break;}
4818 if (support[s] < cMax) {
4819 /* Here we want to determine whether edge newp contains a vertex which is part of the cross-tet edge */
4820 er = GetTriMidEdgeInverse_Static(ornt[c], r);
4821 if (er == eint[c]) {
4822 supportRef[2+intFaces++] = fStartNew + (fMax - fStart)*4 + (support[s] - cStart)*8 + (c + 2)%4;
4823 } else {
4824 supportRef[2+intFaces++] = fStartNew + (fMax - fStart)*4 + (support[s] - cStart)*8 + fint[(c*3 + er)*2 + 0];
4825 supportRef[2+intFaces++] = fStartNew + (fMax - fStart)*4 + (support[s] - cStart)*8 + fint[(c*3 + er)*2 + 1];
4826 }
4827 } else {
4828 supportRef[2+intFaces++] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (support[s] - cMax)*3 + (r + 1)%3;
4829 }
4830 }
4831 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4831,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4832#if defined(PETSC_USE_DEBUG1)
4833 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4833,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
4834 for (p = 0; p < intFaces; ++p) {
4835 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior or hybrid face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4835,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior or hybrid face [%D, %D)"
,supportRef[p],fStartNew,fEndNew)
;
4836 }
4837#endif
4838 }
4839 }
4840 /* Interior cell edges have 2 vertices and 4 faces */
4841 for (c = cStart; c < cMax; ++c) {
4842 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart);
4843 const PetscInt *cone, *ornt, *fcone;
4844 PetscInt coneNew[2], supportNew[4], find;
4845
4846 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4846,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4847 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4847,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4848 ierr = DMPlexGetCone(dm, cone[0], &fcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4848,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4849 find = GetTriEdge_Static(ornt[0], 0);
4850 coneNew[0] = vStartNew + (vEnd - vStart) + (fcone[find] - eStart);
4851 ierr = DMPlexGetCone(dm, cone[2], &fcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4851,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4852 find = GetTriEdge_Static(ornt[2], 1);
4853 coneNew[1] = vStartNew + (vEnd - vStart) + (fcone[find] - eStart);
4854 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4854,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4855#if defined(PETSC_USE_DEBUG1)
4856 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4856,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
4857 for (p = 0; p < 2; ++p) {
4858 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4858,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
4859 }
4860#endif
4861 supportNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 4;
4862 supportNew[1] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 5;
4863 supportNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 6;
4864 supportNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*8 + 7;
4865 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4865,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4866#if defined(PETSC_USE_DEBUG1)
4867 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),4867,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
4868 for (p = 0; p < 4; ++p) {
4869 if ((supportNew[p] < fStartNew) || (supportNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),4869,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportNew
[p],fStartNew,fMaxNew)
;
4870 }
4871#endif
4872 }
4873 /* Hybrid edges have two vertices and the same faces */
4874 for (e = eMax; e < eEnd; ++e) {
4875 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (e - eMax);
4876 const PetscInt *cone, *support, *fcone;
4877 PetscInt coneNew[2], size, fsize, s;
4878
4879 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4879,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4880 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4880,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4881 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4881,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4882 coneNew[0] = vStartNew + (cone[0] - vStart);
4883 coneNew[1] = vStartNew + (cone[1] - vStart);
4884 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4884,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4885#if defined(PETSC_USE_DEBUG1)
4886 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4886,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
4887 for (p = 0; p < 2; ++p) {
4888 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4888,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
4889 }
4890#endif
4891 for (s = 0; s < size; ++s) {
4892 ierr = DMPlexGetConeSize(dm, support[s], &fsize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4892,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4893 ierr = DMPlexGetCone(dm, support[s], &fcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4893,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4894 for (c = 0; c < fsize; ++c) if (fcone[c] == e) break;
4895 if ((c < 2) || (c > 3)) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Edge %D not found in cone of face %D", e, support[s])return PetscError(((MPI_Comm)0x44000001),4895,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Edge %D not found in cone of face %D"
,e,support[s])
;
4896 supportRef[s] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (support[s] - fMax)*2 + c-2;
4897 }
4898 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4898,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4899#if defined(PETSC_USE_DEBUG1)
4900 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4900,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
4901 for (p = 0; p < size; ++p) {
4902 if ((supportRef[p] < fMaxNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", supportRef[p], fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4902,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,supportRef[p],fMaxNew,fEndNew)
;
4903 }
4904#endif
4905 }
4906 /* Hybrid face edges have 2 vertices and 2+2*cells faces */
4907 for (f = fMax; f < fEnd; ++f) {
4908 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (eEnd - eMax) + (f - fMax);
4909 const PetscInt *cone, *support, *ccone, *cornt;
4910 PetscInt coneNew[2], size, csize, s;
4911
4912 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4912,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4913 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4913,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4914 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4914,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4915 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[0] - eStart);
4916 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[1] - eStart);
4917 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4917,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4918#if defined(PETSC_USE_DEBUG1)
4919 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
4920 for (p = 0; p < 2; ++p) {
4921 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4921,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
4922 }
4923#endif
4924 supportRef[0] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (f - fMax)*2 + 0;
4925 supportRef[1] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (f - fMax)*2 + 1;
4926 for (s = 0; s < size; ++s) {
4927 ierr = DMPlexGetConeSize(dm, support[s], &csize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4927,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4928 ierr = DMPlexGetCone(dm, support[s], &ccone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4928,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4929 ierr = DMPlexGetConeOrientation(dm, support[s], &cornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4929,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4930 for (c = 0; c < csize; ++c) if (ccone[c] == f) break;
4931 if ((c < 2) || (c >= csize)) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Hybrid face %D is not in cone of hybrid cell %D", f, support[s])return PetscError(((MPI_Comm)0x44000001),4931,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Hybrid face %D is not in cone of hybrid cell %D"
,f,support[s])
;
4932 supportRef[2+s*2+0] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (support[s] - cMax)*3 + c-2;
4933 supportRef[2+s*2+1] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (support[s] - cMax)*3 + (c-1)%3;
4934 }
4935 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4935,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4936#if defined(PETSC_USE_DEBUG1)
4937 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4937,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
4938 for (p = 0; p < 2+size*2; ++p) {
4939 if ((supportRef[p] < fMaxNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", supportRef[p], fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),4939,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,supportRef[p],fMaxNew,fEndNew)
;
4940 }
4941#endif
4942 }
4943 /* Interior vertices have identical supports */
4944 for (v = vStart; v < vEnd; ++v) {
4945 const PetscInt newp = vStartNew + (v - vStart);
4946 const PetscInt *support, *cone;
4947 PetscInt size, s;
4948
4949 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4949,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4950 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4950,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4951 for (s = 0; s < size; ++s) {
4952 PetscInt r = 0;
4953
4954 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4954,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4955 if (cone[1] == v) r = 1;
4956 if (support[s] < eMax) supportRef[s] = eStartNew + (support[s] - eStart)*2 + r;
4957 else supportRef[s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (support[s] - eMax);
4958 }
4959 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4959,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4960#if defined(PETSC_USE_DEBUG1)
4961 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),4961,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
4962 for (p = 0; p < size; ++p) {
4963 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior or hybrid edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),4963,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior or hybrid edge [%D, %D)"
,supportRef[p],eStartNew,eEndNew)
;
4964 }
4965#endif
4966 }
4967 /* Interior edge vertices have 2 + interior face*2 + hybrid face + cells*0/1 supports */
4968 for (e = eStart; e < eMax; ++e) {
4969 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
4970 const PetscInt *cone, *support;
4971 PetscInt *star = NULL((void*)0), starSize, faceSize = 0, cellSize = 0, coneSize, size, s;
4972
4973 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4973,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4974 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4974,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4975 supportRef[0] = eStartNew + (e - eStart)*2 + 0;
4976 supportRef[1] = eStartNew + (e - eStart)*2 + 1;
4977 for (s = 0; s < size; ++s) {
4978 PetscInt r = 0;
4979
4980 if (support[s] < fMax) {
4981 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4981,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4982 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4982,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4983 for (r = 0; r < coneSize; ++r) {if (cone[r] == e) break;}
4984 supportRef[2+faceSize+0] = eStartNew + (eMax - eStart)*2 + (support[s] - fStart)*3 + (r+0)%3;
4985 supportRef[2+faceSize+1] = eStartNew + (eMax - eStart)*2 + (support[s] - fStart)*3 + (r+2)%3;
4986 faceSize += 2;
4987 } else {
4988 supportRef[2+faceSize+0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (eEnd - eMax) + (support[s] - fMax);
4989 ++faceSize;
4990 }
4991 }
4992 ierr = DMPlexGetTransitiveClosure(dm, e, PETSC_FALSE, &starSize, &star);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4992,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
4993 for (s = 0; s < starSize*2; s += 2) {
4994 const PetscInt *cone, *ornt;
4995 PetscInt e01, e23;
4996
4997 if ((star[s] >= cStart) && (star[s] < cMax)) {
4998 /* Check edge 0-1 */
4999 ierr = DMPlexGetCone(dm, star[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),4999,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5000 ierr = DMPlexGetConeOrientation(dm, star[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5000,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5001 ierr = DMPlexGetCone(dm, cone[0], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5001,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5002 e01 = cone[GetTriEdge_Static(ornt[0], 0)];
5003 /* Check edge 2-3 */
5004 ierr = DMPlexGetCone(dm, star[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5004,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5005 ierr = DMPlexGetConeOrientation(dm, star[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5005,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5006 ierr = DMPlexGetCone(dm, cone[2], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5006,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5007 e23 = cone[GetTriEdge_Static(ornt[2], 1)];
5008 if ((e01 == e) || (e23 == e)) {supportRef[2+faceSize+cellSize++] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (star[s] - cStart);}
5009 }
5010 }
5011 ierr = DMPlexRestoreTransitiveClosure(dm, e, PETSC_FALSE, &starSize, &star);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5011,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5012 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5012,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5013#if defined(PETSC_USE_DEBUG1)
5014 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),5014,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
5015 for (p = 0; p < 2+faceSize+cellSize; ++p) {
5016 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an interior or hybrid edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5016,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an interior or hybrid edge [%D, %D)"
,supportRef[p],eStartNew,eEndNew)
;
5017 }
5018#endif
5019 }
5020 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),5020,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5020,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5021 ierr = DMPlexRestoreFaces_Internal(dm, 3, cStart, NULL((void*)0), NULL((void*)0), &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5021,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5022 break;
5023 case REFINER_SIMPLEX_TO_HEX_3D:
5024 ierr = DMPlexGetRawFaces_Internal(dm, 3, 4, cellInd, NULL((void*)0), NULL((void*)0), &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5024,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5025 /* All cells have 6 faces */
5026 for (c = cStart; c < cEnd; ++c) {
5027 const PetscInt newp = cStartNew + (c - cStart)*4;
5028 const PetscInt *cone, *ornt;
5029 PetscInt coneNew[6];
5030 PetscInt orntNew[6];
5031
5032 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5032,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5033 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5033,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5034 /* A hex */
5035 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 0); /* B */
5036 orntNew[0] = ornt[0] < 0 ? -1 : 1;
5037 coneNew[1] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 3; /* T */
5038 orntNew[1] = -4;
5039 coneNew[2] = fStartNew + (cone[2] - fStart)*3 + GetTriSubface_Static(ornt[2], 0); /* F */
5040 orntNew[2] = ornt[2] < 0 ? -1 : 1;
5041 coneNew[3] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 0; /* K */
5042 orntNew[3] = -1;
5043 coneNew[4] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 2; /* R */
5044 orntNew[4] = 0;
5045 coneNew[5] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 0); /* L */
5046 orntNew[5] = ornt[1] < 0 ? -1 : 1;
5047 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5047,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5048 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5048,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5049#if defined(PETSC_USE_DEBUG1)
5050 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5050,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
5051 for (p = 0; p < 6; ++p) {
5052 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5052,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5053 }
5054#endif
5055 /* B hex */
5056 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 1); /* B */
5057 orntNew[0] = ornt[0] < 0 ? -2 : 0;
5058 coneNew[1] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 4; /* T */
5059 orntNew[1] = 0;
5060 coneNew[2] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 0; /* F */
5061 orntNew[2] = 0;
5062 coneNew[3] = fStartNew + (cone[3] - fStart)*3 + GetTriSubface_Static(ornt[3], 1); /* K */
5063 orntNew[3] = ornt[3] < 0 ? -2 : 0;
5064 coneNew[4] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 1; /* R */
5065 orntNew[4] = 0;
5066 coneNew[5] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 2); /* L */
5067 orntNew[5] = ornt[1] < 0 ? -4 : 2;
5068 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5068,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5069 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5069,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5070#if defined(PETSC_USE_DEBUG1)
5071 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5071,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
5072 for (p = 0; p < 6; ++p) {
5073 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5073,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5074 }
5075#endif
5076 /* C hex */
5077 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 2); /* B */
5078 orntNew[0] = ornt[0] < 0 ? -4 : 2;
5079 coneNew[1] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 5; /* T */
5080 orntNew[1] = -4;
5081 coneNew[2] = fStartNew + (cone[2] - fStart)*3 + GetTriSubface_Static(ornt[2], 1); /* F */
5082 orntNew[2] = ornt[2] < 0 ? -2 : 0;
5083 coneNew[3] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 1; /* K */
5084 orntNew[3] = -1;
5085 coneNew[4] = fStartNew + (cone[3] - fStart)*3 + GetTriSubface_Static(ornt[3], 0); /* R */
5086 orntNew[4] = ornt[3] < 0 ? -1 : 1;
5087 coneNew[5] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 2; /* L */
5088 orntNew[5] = -4;
5089 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5089,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5090 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5090,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5091#if defined(PETSC_USE_DEBUG1)
5092 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5092,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
5093 for (p = 0; p < 6; ++p) {
5094 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5094,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5095 }
5096#endif
5097 /* D hex */
5098 coneNew[0] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 3; /* B */
5099 orntNew[0] = 0;
5100 coneNew[1] = fStartNew + (cone[3] - fStart)*3 + GetTriSubface_Static(ornt[3], 2); /* T */
5101 orntNew[1] = ornt[3] < 0 ? -1 : 1;
5102 coneNew[2] = fStartNew + (cone[2] - fStart)*3 + GetTriSubface_Static(ornt[2], 2); /* F */
5103 orntNew[2] = ornt[2] < 0 ? -4 : 2;
5104 coneNew[3] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 4; /* K */
5105 orntNew[3] = -1;
5106 coneNew[4] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + 5; /* R */
5107 orntNew[4] = 0;
5108 coneNew[5] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 1); /* L */
5109 orntNew[5] = ornt[1] < 0 ? -2 : 0;
5110 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5110,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5111 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5111,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5112#if defined(PETSC_USE_DEBUG1)
5113 if ((newp+3 < cStartNew) || (newp+3 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5113,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cEndNew)
;
5114 for (p = 0; p < 6; ++p) {
5115 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5115,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5116 }
5117#endif
5118 }
5119 /* Split faces have 4 edges and the same cells as the parent */
5120 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5120,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5121 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,5121,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5121,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5122 for (f = fStart; f < fEnd; ++f) {
5123 const PetscInt newp = fStartNew + (f - fStart)*3;
5124 const PetscInt *cone, *ornt, *support;
5125 PetscInt coneNew[4], orntNew[4], coneSize, supportSize, s;
5126
5127 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5127,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5128 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5128,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5129 /* A quad */
5130 coneNew[0] = eStartNew + (cone[2] - eStart)*2 + (ornt[2] < 0 ? 0 : 1);
5131 orntNew[0] = ornt[2];
5132 coneNew[1] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 1 : 0);
5133 orntNew[1] = ornt[0];
5134 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 0;
5135 orntNew[2] = 0;
5136 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 2;
5137 orntNew[3] = -2;
5138 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5138,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5139 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5139,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5140#if defined(PETSC_USE_DEBUG1)
5141 if ((newp+0 < fStartNew) || (newp+0 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+0, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5141,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+0,fStartNew,fEndNew)
;
5142 for (p = 0; p < 4; ++p) {
5143 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5143,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5144 }
5145#endif
5146 /* B quad */
5147 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 0 : 1);
5148 orntNew[0] = ornt[0];
5149 coneNew[1] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 1 : 0);
5150 orntNew[1] = ornt[1];
5151 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 1;
5152 orntNew[2] = 0;
5153 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 0;
5154 orntNew[3] = -2;
5155 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5155,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5156 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5156,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5157#if defined(PETSC_USE_DEBUG1)
5158 if ((newp+1 < fStartNew) || (newp+1 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+1, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5158,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+1,fStartNew,fEndNew)
;
5159 for (p = 0; p < 4; ++p) {
5160 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5160,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5161 }
5162#endif
5163 /* C quad */
5164 coneNew[0] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 0 : 1);
5165 orntNew[0] = ornt[1];
5166 coneNew[1] = eStartNew + (cone[2] - eStart)*2 + (ornt[2] < 0 ? 1 : 0);
5167 orntNew[1] = ornt[2];
5168 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 2;
5169 orntNew[2] = 0;
5170 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 1;
5171 orntNew[3] = -2;
5172 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5172,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5173 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5173,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5174#if defined(PETSC_USE_DEBUG1)
5175 if ((newp+2 < fStartNew) || (newp+2 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+2, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5175,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+2,fStartNew,fEndNew)
;
5176 for (p = 0; p < 4; ++p) {
5177 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5177,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5178 }
5179#endif
5180 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5180,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5181 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5181,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5182 for (r = 0; r < 3; ++r) {
5183 for (s = 0; s < supportSize; ++s) {
5184 PetscInt subf;
5185 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5185,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5186 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5186,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5187 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5187,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5188 for (c = 0; c < coneSize; ++c) {
5189 if (cone[c] == f) break;
5190 }
5191 subf = GetTriSubfaceInverse_Static(ornt[c], r);
5192 supportRef[s] = cStartNew + (support[s] - cStart)*4 + faces[c*3+subf];
5193 }
5194 ierr = DMPlexSetSupport(rdm, newp+r, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5194,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5195#if defined(PETSC_USE_DEBUG1)
5196 if ((newp+r < fStartNew) || (newp+r >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+r, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5196,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+r,fStartNew,fEndNew)
;
5197 for (p = 0; p < supportSize; ++p) {
5198 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5198,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
5199 }
5200#endif
5201 }
5202 }
5203 /* Interior faces have 4 edges and 2 cells */
5204 for (c = cStart; c < cEnd; ++c) {
5205 PetscInt newp = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6;
5206 const PetscInt *cone, *ornt;
5207 PetscInt coneNew[4], orntNew[4];
5208 PetscInt supportNew[2];
5209
5210 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5210,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5211 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5211,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5212 /* Face {a, g, m, h} */
5213 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],0);
5214 orntNew[0] = 0;
5215 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 0;
5216 orntNew[1] = 0;
5217 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 1;
5218 orntNew[2] = -2;
5219 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],2);
5220 orntNew[3] = -2;
5221 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5221,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5222 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5222,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5223#if defined(PETSC_USE_DEBUG1)
5224 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5224,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5225 for (p = 0; p < 4; ++p) {
5226 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5226,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5227 }
5228#endif
5229 supportNew[0] = (c - cStart)*4 + 0;
5230 supportNew[1] = (c - cStart)*4 + 1;
5231 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5231,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5232#if defined(PETSC_USE_DEBUG1)
5233 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5233,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5234 for (p = 0; p < 2; ++p) {
5235 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5235,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5236 }
5237#endif
5238 ++newp;
5239 /* Face {g, b, l , m} */
5240 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],1);
5241 orntNew[0] = -2;
5242 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*3 + GetTriInteriorEdge_Static(ornt[3],0);
5243 orntNew[1] = 0;
5244 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 3;
5245 orntNew[2] = 0;
5246 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 0;
5247 orntNew[3] = -2;
5248 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5248,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5249 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5249,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5250#if defined(PETSC_USE_DEBUG1)
5251 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5251,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5252 for (p = 0; p < 4; ++p) {
5253 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5253,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5254 }
5255#endif
5256 supportNew[0] = (c - cStart)*4 + 1;
5257 supportNew[1] = (c - cStart)*4 + 2;
5258 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5258,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5259#if defined(PETSC_USE_DEBUG1)
5260 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5260,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5261 for (p = 0; p < 2; ++p) {
5262 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5262,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5263 }
5264#endif
5265 ++newp;
5266 /* Face {c, g, m, i} */
5267 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],2);
5268 orntNew[0] = 0;
5269 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 0;
5270 orntNew[1] = 0;
5271 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 2;
5272 orntNew[2] = -2;
5273 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*3 + GetTriInteriorEdge_Static(ornt[2],0);
5274 orntNew[3] = -2;
5275 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5276 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5276,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5277#if defined(PETSC_USE_DEBUG1)
5278 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5278,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5279 for (p = 0; p < 4; ++p) {
5280 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5280,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5281 }
5282#endif
5283 supportNew[0] = (c - cStart)*4 + 0;
5284 supportNew[1] = (c - cStart)*4 + 2;
5285 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5285,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5286#if defined(PETSC_USE_DEBUG1)
5287 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5287,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5288 for (p = 0; p < 2; ++p) {
5289 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5289,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5290 }
5291#endif
5292 ++newp;
5293 /* Face {d, h, m, i} */
5294 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],0);
5295 orntNew[0] = 0;
5296 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 1;
5297 orntNew[1] = 0;
5298 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 2;
5299 orntNew[2] = -2;
5300 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*3 + GetTriInteriorEdge_Static(ornt[2],2);
5301 orntNew[3] = -2;
5302 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5302,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5303 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5303,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5304#if defined(PETSC_USE_DEBUG1)
5305 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5305,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5306 for (p = 0; p < 4; ++p) {
5307 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5307,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5308 }
5309#endif
5310 supportNew[0] = (c - cStart)*4 + 0;
5311 supportNew[1] = (c - cStart)*4 + 3;
5312 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5313#if defined(PETSC_USE_DEBUG1)
5314 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5314,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5315 for (p = 0; p < 2; ++p) {
5316 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5316,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5317 }
5318#endif
5319 ++newp;
5320 /* Face {h, m, l, e} */
5321 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 1;
5322 orntNew[0] = 0;
5323 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 3;
5324 orntNew[1] = -2;
5325 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*3 + GetTriInteriorEdge_Static(ornt[3],1);
5326 orntNew[2] = -2;
5327 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],1);
5328 orntNew[3] = 0;
5329 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5329,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5330 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5330,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5331#if defined(PETSC_USE_DEBUG1)
5332 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5332,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5333 for (p = 0; p < 4; ++p) {
5334 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5334,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5335 }
5336#endif
5337 supportNew[0] = (c - cStart)*4 + 1;
5338 supportNew[1] = (c - cStart)*4 + 3;
5339 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5339,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5340#if defined(PETSC_USE_DEBUG1)
5341 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5341,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5342 for (p = 0; p < 2; ++p) {
5343 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5343,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5344 }
5345#endif
5346 ++newp;
5347 /* Face {i, m, l, f} */
5348 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 2;
5349 orntNew[0] = 0;
5350 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 3;
5351 orntNew[1] = -2;
5352 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*3 + GetTriInteriorEdge_Static(ornt[3],2);
5353 orntNew[2] = -2;
5354 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*3 + GetTriInteriorEdge_Static(ornt[2],1);
5355 orntNew[3] = 0;
5356 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5356,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5357 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5357,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5358#if defined(PETSC_USE_DEBUG1)
5359 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5359,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5360 for (p = 0; p < 4; ++p) {
5361 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5361,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5362 }
5363#endif
5364 supportNew[0] = (c - cStart)*4 + 2;
5365 supportNew[1] = (c - cStart)*4 + 3;
5366 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5366,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5367#if defined(PETSC_USE_DEBUG1)
5368 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5368,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5369 for (p = 0; p < 2; ++p) {
5370 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5370,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5371 }
5372#endif
5373 ++newp;
5374 }
5375 /* Split Edges have 2 vertices and the same faces as the parent */
5376 for (e = eStart; e < eEnd; ++e) {
5377 const PetscInt newv = vStartNew + (vEnd - vStart) + (e - eStart);
5378
5379 for (r = 0; r < 2; ++r) {
5380 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
5381 const PetscInt *cone, *ornt, *support;
5382 PetscInt coneNew[2], coneSize, c, supportSize, s;
5383
5384 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5384,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5385 coneNew[0] = vStartNew + (cone[0] - vStart);
5386 coneNew[1] = vStartNew + (cone[1] - vStart);
5387 coneNew[(r+1)%2] = newv;
5388 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5388,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5389#if defined(PETSC_USE_DEBUG1)
5390 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5390,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
5391 for (p = 0; p < 2; ++p) {
5392 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),5392,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
5393 }
5394#endif
5395 ierr = DMPlexGetSupportSize(dm, e, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5395,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5396 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5396,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5397 for (s = 0; s < supportSize; ++s) {
5398 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5398,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5399 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5399,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5400 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5400,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5401 for (c = 0; c < coneSize; ++c) {
5402 if (cone[c] == e) break;
5403 }
5404 supportRef[s] = fStartNew + (support[s] - fStart)*3 + (c + (ornt[c] < 0 ? 1-r : r))%3;
5405 }
5406 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5406,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5407#if defined(PETSC_USE_DEBUG1)
5408 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5408,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
5409 for (p = 0; p < supportSize; ++p) {
5410 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5410,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
5411 }
5412#endif
5413 }
5414 }
5415 /* Face edges have 2 vertices and 2 + cell faces supports */
5416 for (f = fStart; f < fEnd; ++f) {
5417 const PetscInt *cone, *ornt, *support;
5418 PetscInt coneSize, supportSize, s;
5419
5420 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5420,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5421 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5421,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5422 for (r = 0; r < 3; ++r) {
5423 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + r;
5424 PetscInt coneNew[2];
5425 PetscInt fint[4][3] = { {0, 1, 2},
5426 {3, 4, 0},
5427 {2, 5, 3},
5428 {1, 4, 5} };
5429
5430 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5430,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5431 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - eStart);
5432 coneNew[1] = vStartNew + (vEnd - vStart) + (eEnd - eStart) + f - fStart;
5433 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5433,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5434#if defined(PETSC_USE_DEBUG1)
5435 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5435,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
5436 for (p = 0; p < 2; ++p) {
5437 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),5437,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
5438 }
5439#endif
5440 supportRef[0] = fStartNew + (f - fStart)*3 + (r+0)%3;
5441 supportRef[1] = fStartNew + (f - fStart)*3 + (r+1)%3;
5442 for (s = 0; s < supportSize; ++s) {
5443 PetscInt er;
5444 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5444,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5445 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5445,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5446 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5446,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5447 for (c = 0; c < coneSize; ++c) {if (cone[c] == f) break;}
5448 er = GetTriInteriorEdgeInverse_Static(ornt[c], r);
5449 supportRef[2+s] = fStartNew + (fEnd - fStart)*3 + (support[s] - cStart)*6 + fint[c][er];
5450 }
5451 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5451,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5452#if defined(PETSC_USE_DEBUG1)
5453 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5453,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
5454 for (p = 0; p < supportSize + 2; ++p) {
5455 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5455,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
5456 }
5457#endif
5458 }
5459 }
5460 /* Interior cell edges have 2 vertices and 3 faces */
5461 for (c = cStart; c < cEnd; ++c) {
5462 const PetscInt *cone;
5463 PetscInt fint[4][3] = { {0,1,2},
5464 {0,3,4},
5465 {2,3,5},
5466 {1,4,5} } ;
5467
5468 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5468,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5469 for (r = 0; r < 4; r++) {
5470 PetscInt coneNew[2], supportNew[3];
5471 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + r;
5472
5473 coneNew[0] = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (cone[r] - fStart);
5474 coneNew[1] = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (fEnd -fStart) + c - cStart;
5475 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5475,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5476#if defined(PETSC_USE_DEBUG1)
5477 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5477,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
5478 for (p = 0; p < 2; ++p) {
5479 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),5479,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
5480 }
5481#endif
5482 supportNew[0] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + fint[r][0];
5483 supportNew[1] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + fint[r][1];
5484 supportNew[2] = fStartNew + (fEnd - fStart)*3 + (c - cStart)*6 + fint[r][2];
5485 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5485,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5486#if defined(PETSC_USE_DEBUG1)
5487 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5487,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
5488 for (p = 0; p < 3; ++p) {
5489 if ((supportNew[p] < fStartNew) || (supportNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5489,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportNew
[p],fStartNew,fEndNew)
;
5490 }
5491#endif
5492 }
5493 }
5494 /* Old vertices have identical supports */
5495 for (v = vStart; v < vEnd; ++v) {
5496 const PetscInt newp = vStartNew + (v - vStart);
5497 const PetscInt *support, *cone;
5498 PetscInt size, s;
5499
5500 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5500,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5501 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5501,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5502 for (s = 0; s < size; ++s) {
5503 PetscInt r = 0;
5504
5505 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5505,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5506 if (cone[1] == v) r = 1;
5507 supportRef[s] = eStartNew + (support[s] - eStart)*2 + r;
5508 }
5509 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5509,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5510#if defined(PETSC_USE_DEBUG1)
5511 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),5511,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
5512 for (p = 0; p < size; ++p) {
5513 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5513,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
5514 }
5515#endif
5516 }
5517 /* Edge vertices have 2 + faces supports */
5518 for (e = eStart; e < eEnd; ++e) {
5519 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
5520 const PetscInt *cone, *support;
5521 PetscInt size, s;
5522
5523 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5523,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5524 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5524,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5525 supportRef[0] = eStartNew + (e - eStart)*2 + 0;
5526 supportRef[1] = eStartNew + (e - eStart)*2 + 1;
5527 for (s = 0; s < size; ++s) {
5528 PetscInt r = 0, coneSize;
5529
5530 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5530,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5531 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5531,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5532 for (r = 0; r < coneSize; ++r) {if (cone[r] == e) break;}
5533 supportRef[2+s] = eStartNew + (eEnd - eStart)*2 + (support[s] - fStart)*3 + r;
5534 }
5535 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5535,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5536#if defined(PETSC_USE_DEBUG1)
5537 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),5537,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
5538 for (p = 0; p < 2+size; ++p) {
5539 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5539,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
5540 }
5541#endif
5542 }
5543 /* Face vertices have 3 + cells supports */
5544 for (f = fStart; f < fEnd; ++f) {
5545 const PetscInt newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (f - fStart);
5546 const PetscInt *cone, *support;
5547 PetscInt size, s;
5548
5549 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5549,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5550 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5550,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5551 supportRef[0] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 0;
5552 supportRef[1] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 1;
5553 supportRef[2] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*3 + 2;
5554 for (s = 0; s < size; ++s) {
5555 PetscInt r = 0, coneSize;
5556
5557 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5557,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5558 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5558,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5559 for (r = 0; r < coneSize; ++r) {if (cone[r] == f) break;}
5560 supportRef[3+s] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (support[s] - cStart)*4 + r;
5561 }
5562 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5562,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5563#if defined(PETSC_USE_DEBUG1)
5564 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),5564,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
5565 for (p = 0; p < 3+size; ++p) {
5566 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5566,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
5567 }
5568#endif
5569 }
5570 /* Interior cell vertices have 4 supports */
5571 for (c = cStart; c < cEnd; ++c) {
5572 const PetscInt newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (fEnd - fStart) + c - cStart;
5573 supportRef[0] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 0;
5574 supportRef[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 1;
5575 supportRef[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 2;
5576 supportRef[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (c - cStart)*4 + 3;
5577 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5577,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5578#if defined(PETSC_USE_DEBUG1)
5579 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),5579,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
5580 for (p = 0; p < 4; ++p) {
5581 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5581,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
5582 }
5583#endif
5584 }
5585 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),5585,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5585,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5586 ierr = DMPlexRestoreFaces_Internal(dm, 3, cStart, NULL((void*)0), NULL((void*)0), &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5586,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5587 break;
5588 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
5589 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),5589,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
5590 cMax = PetscMin(cEnd, cMax)(((cEnd)<(cMax)) ? (cEnd) : (cMax));
5591 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),5591,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
5592 fMax = PetscMin(fEnd, fMax)(((fEnd)<(fMax)) ? (fEnd) : (fMax));
5593 if (eMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),5593,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
5594 eMax = PetscMin(eEnd, eMax)(((eEnd)<(eMax)) ? (eEnd) : (eMax));
5595 ierr = DMPlexGetRawFaces_Internal(dm, 3, 4, cellInd, NULL((void*)0), NULL((void*)0), &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5595,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5596 /* All cells have 6 faces */
5597 for (c = cStart; c < cMax; ++c) {
5598 const PetscInt newp = cStartNew + (c - cStart)*4;
5599 const PetscInt *cone, *ornt;
5600 PetscInt coneNew[6];
5601 PetscInt orntNew[6];
5602
5603 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5603,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5604#if defined(PETSC_USE_DEBUG1)
5605 for (p = 0; p < 4; ++p) {
5606 if (cone[p] >= fMax) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position %D for cell %D", cone[p], p, fMax, c)return PetscError(((MPI_Comm)0x44000001),5606,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position %D for cell %D"
,cone[p],p,fMax,c)
;
5607 }
5608#endif
5609 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5609,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5610 /* A hex */
5611 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 0); /* B */
5612 orntNew[0] = ornt[0] < 0 ? -1 : 1;
5613 coneNew[1] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 3; /* T */
5614 orntNew[1] = -4;
5615 coneNew[2] = fStartNew + (cone[2] - fStart)*3 + GetTriSubface_Static(ornt[2], 0); /* F */
5616 orntNew[2] = ornt[2] < 0 ? -1 : 1;
5617 coneNew[3] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 0; /* K */
5618 orntNew[3] = -1;
5619 coneNew[4] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 2; /* R */
5620 orntNew[4] = 0;
5621 coneNew[5] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 0); /* L */
5622 orntNew[5] = ornt[1] < 0 ? -1 : 1;
5623 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5623,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5624 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5624,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5625#if defined(PETSC_USE_DEBUG1)
5626 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5626,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
5627 for (p = 0; p < 6; ++p) {
5628 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5628,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5629 }
5630#endif
5631 /* B hex */
5632 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 1); /* B */
5633 orntNew[0] = ornt[0] < 0 ? -2 : 0;
5634 coneNew[1] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 4; /* T */
5635 orntNew[1] = 0;
5636 coneNew[2] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 0; /* F */
5637 orntNew[2] = 0;
5638 coneNew[3] = fStartNew + (cone[3] - fStart)*3 + GetTriSubface_Static(ornt[3], 1); /* K */
5639 orntNew[3] = ornt[3] < 0 ? -2 : 0;
5640 coneNew[4] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 1; /* R */
5641 orntNew[4] = 0;
5642 coneNew[5] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 2); /* L */
5643 orntNew[5] = ornt[1] < 0 ? -4 : 2;
5644 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5644,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5645 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5645,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5646#if defined(PETSC_USE_DEBUG1)
5647 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5647,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
5648 for (p = 0; p < 6; ++p) {
5649 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5649,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5650 }
5651#endif
5652 /* C hex */
5653 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 2); /* B */
5654 orntNew[0] = ornt[0] < 0 ? -4 : 2;
5655 coneNew[1] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 5; /* T */
5656 orntNew[1] = -4;
5657 coneNew[2] = fStartNew + (cone[2] - fStart)*3 + GetTriSubface_Static(ornt[2], 1); /* F */
5658 orntNew[2] = ornt[2] < 0 ? -2 : 0;
5659 coneNew[3] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 1; /* K */
5660 orntNew[3] = -1;
5661 coneNew[4] = fStartNew + (cone[3] - fStart)*3 + GetTriSubface_Static(ornt[3], 0); /* R */
5662 orntNew[4] = ornt[3] < 0 ? -1 : 1;
5663 coneNew[5] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 2; /* L */
5664 orntNew[5] = -4;
5665 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5665,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5666 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5666,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5667#if defined(PETSC_USE_DEBUG1)
5668 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5668,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
5669 for (p = 0; p < 6; ++p) {
5670 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5670,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5671 }
5672#endif
5673 /* D hex */
5674 coneNew[0] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 3; /* B */
5675 orntNew[0] = 0;
5676 coneNew[1] = fStartNew + (cone[3] - fStart)*3 + GetTriSubface_Static(ornt[3], 2); /* T */
5677 orntNew[1] = ornt[3] < 0 ? -1 : 1;
5678 coneNew[2] = fStartNew + (cone[2] - fStart)*3 + GetTriSubface_Static(ornt[2], 2); /* F */
5679 orntNew[2] = ornt[2] < 0 ? -4 : 2;
5680 coneNew[3] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 4; /* K */
5681 orntNew[3] = -1;
5682 coneNew[4] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + 5; /* R */
5683 orntNew[4] = 0;
5684 coneNew[5] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 1); /* L */
5685 orntNew[5] = ornt[1] < 0 ? -2 : 0;
5686 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5686,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5687 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5687,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5688#if defined(PETSC_USE_DEBUG1)
5689 if ((newp+3 < cStartNew) || (newp+3 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5689,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cEndNew)
;
5690 for (p = 0; p < 6; ++p) {
5691 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5691,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5692 }
5693#endif
5694 }
5695 for (c = cMax; c < cEnd; ++c) {
5696 const PetscInt newp = cStartNew + (cMax - cStart)*4 + (c - cMax)*3;
5697 const PetscInt *cone, *ornt;
5698 PetscInt coneNew[6], orntNew[6];
5699 PetscInt o, of, cf;
5700
5701 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5701,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5702#if defined(PETSC_USE_DEBUG1)
5703 if (cone[0] >= fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position 0 for cell %D", cone[0], fMax, c)return PetscError(((MPI_Comm)0x44000001),5703,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position 0 for cell %D"
,cone[0],fMax,c)
;
5704 if (cone[1] >= fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position 1 for cell %D", cone[1], fMax, c)return PetscError(((MPI_Comm)0x44000001),5704,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position 1 for cell %D"
,cone[1],fMax,c)
;
5705 if (cone[2] < fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected face %D (fMax %D) in cone position 2 for cell %D", cone[2], fMax, c)return PetscError(((MPI_Comm)0x44000001),5705,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected face %D (fMax %D) in cone position 2 for cell %D"
,cone[2],fMax,c)
;
5706 if (cone[3] < fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected face %D (fMax %D) in cone position 3 for cell %D", cone[3], fMax, c)return PetscError(((MPI_Comm)0x44000001),5706,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected face %D (fMax %D) in cone position 3 for cell %D"
,cone[3],fMax,c)
;
5707 if (cone[4] < fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected face %D (fMax %D) in cone position 4 for cell %D", cone[4], fMax, c)return PetscError(((MPI_Comm)0x44000001),5707,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected face %D (fMax %D) in cone position 4 for cell %D"
,cone[4],fMax,c)
;
5708#endif
5709 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5709,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5710 o = ornt[0] < 0 ? -1 : 1;
5711 o = 1;
5712 /* A hex */
5713 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 0); /* B */
5714 orntNew[0] = ornt[0] < 0 ? -1 : 1;
5715 coneNew[1] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 0); /* T */
5716 orntNew[1] = ornt[1] < 0 ? 1 : -1;
5717 cf = 2;
5718 of = ornt[2+cf] < 0 ? -1 : 1;
5719 coneNew[2] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (cone[2+cf] - fMax)*2 + (o*of < 0 ? 0 : 1); /* F */
5720 orntNew[2] = o*of < 0 ? 0 : -1;
5721 coneNew[3] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 0; /* K */
5722 orntNew[3] = -1;
5723 coneNew[4] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 2; /* R */
5724 orntNew[4] = 0;
5725 cf = 0;
5726 of = ornt[2+cf] < 0 ? -1 : 1;
5727 coneNew[5] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (cone[2+cf] - fMax)*2 + (o*of < 0 ? 1 : 0); /* L */
5728 orntNew[5] = o*of < 0 ? 1 : -4;
5729 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5729,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5730 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5730,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5731#if defined(PETSC_USE_DEBUG1)
5732 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5732,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
5733 for (p = 0; p < 6; ++p) {
5734 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5734,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5735 }
5736#endif
5737 /* B hex */
5738 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 1); /* B */
5739 orntNew[0] = ornt[0] < 0 ? -2 : 0;
5740 coneNew[1] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 1); /* T */
5741 orntNew[1] = ornt[1] < 0 ? 2 : -4;
5742 coneNew[2] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 0; /* F */
5743 orntNew[2] = 0;
5744 cf = 1;
5745 of = ornt[2+cf] < 0 ? -1 : 1;
5746 coneNew[3] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (cone[2+cf] - fMax)*2 + (o*of < 0 ? 1 : 0); /* K */
5747 orntNew[3] = o*of < 0 ? 0 : -1;
5748 coneNew[4] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 1; /* R */
5749 orntNew[4] = -1;
5750 cf = 0;
5751 of = ornt[2+cf] < 0 ? -1 : 1;
5752 coneNew[5] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (cone[2+cf] - fMax)*2 + (o*of < 0 ? 0 : 1); /* L */
5753 orntNew[5] = o*of < 0 ? 1 : -4;
5754 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5754,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5755 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5755,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5756#if defined(PETSC_USE_DEBUG1)
5757 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5757,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
5758 for (p = 0; p < 6; ++p) {
5759 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5759,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5760 }
5761#endif
5762 /* C hex */
5763 coneNew[0] = fStartNew + (cone[0] - fStart)*3 + GetTriSubface_Static(ornt[0], 2); /* B */
5764 orntNew[0] = ornt[0] < 0 ? -4 : 2;
5765 coneNew[1] = fStartNew + (cone[1] - fStart)*3 + GetTriSubface_Static(ornt[1], 2); /* T */
5766 orntNew[1] = ornt[1] < 0 ? 0 : -2;
5767 cf = 2;
5768 of = ornt[2+cf] < 0 ? -1 : 1;
5769 coneNew[2] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (cone[2+cf] - fMax)*2 + (o*of < 0 ? 1 : 0); /* F */
5770 orntNew[2] = o*of < 0 ? 0 : -1;
5771 coneNew[3] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 1; /* K */
5772 orntNew[3] = 0;
5773 cf = 1;
5774 of = ornt[2+cf] < 0 ? -1 : 1;
5775 coneNew[4] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (cone[2+cf] - fMax)*2 + (o*of < 0 ? 0 : 1); /* R */
5776 orntNew[4] = o*of < 0 ? 0 : -1;
5777 coneNew[5] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 2; /* L */
5778 orntNew[5] = -4;
5779 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5779,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5780 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5780,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5781#if defined(PETSC_USE_DEBUG1)
5782 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5782,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
5783 for (p = 0; p < 6; ++p) {
5784 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5784,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
5785 }
5786#endif
5787 }
5788
5789 /* Split faces have 4 edges and the same cells as the parent */
5790 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5790,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5791 ierr = PetscMalloc1(2 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,5791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(2 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5792 for (f = fStart; f < fMax; ++f) {
5793 const PetscInt newp = fStartNew + (f - fStart)*3;
5794 const PetscInt *cone, *ornt, *support;
5795 PetscInt coneNew[4], orntNew[4], coneSize, supportSize, s;
5796
5797 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5797,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5798#if defined(PETSC_USE_DEBUG1)
5799 for (p = 0; p < 3; ++p) {
5800 if (cone[p] >= eMax) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid edge %D (eMax %D) in cone position %D for face %D", cone[p], p, eMax, f)return PetscError(((MPI_Comm)0x44000001),5800,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid edge %D (eMax %D) in cone position %D for face %D"
,cone[p],p,eMax,f)
;
5801 }
5802#endif
5803 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5803,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5804 /* A quad */
5805 coneNew[0] = eStartNew + (cone[2] - eStart)*2 + (ornt[2] < 0 ? 0 : 1);
5806 orntNew[0] = ornt[2];
5807 coneNew[1] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 1 : 0);
5808 orntNew[1] = ornt[0];
5809 coneNew[2] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 0;
5810 orntNew[2] = 0;
5811 coneNew[3] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 2;
5812 orntNew[3] = -2;
5813 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5813,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5814 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5814,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5815#if defined(PETSC_USE_DEBUG1)
5816 if ((newp+0 < fStartNew) || (newp+0 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+0, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5816,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+0,fStartNew,fEndNew)
;
5817 for (p = 0; p < 4; ++p) {
5818 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5818,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5819 }
5820#endif
5821 /* B quad */
5822 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 0 : 1);
5823 orntNew[0] = ornt[0];
5824 coneNew[1] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 1 : 0);
5825 orntNew[1] = ornt[1];
5826 coneNew[2] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 1;
5827 orntNew[2] = 0;
5828 coneNew[3] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 0;
5829 orntNew[3] = -2;
5830 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5830,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5831 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5831,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5832#if defined(PETSC_USE_DEBUG1)
5833 if ((newp+1 < fStartNew) || (newp+1 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+1, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5833,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+1,fStartNew,fEndNew)
;
5834 for (p = 0; p < 4; ++p) {
5835 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5835,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5836 }
5837#endif
5838 /* C quad */
5839 coneNew[0] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 0 : 1);
5840 orntNew[0] = ornt[1];
5841 coneNew[1] = eStartNew + (cone[2] - eStart)*2 + (ornt[2] < 0 ? 1 : 0);
5842 orntNew[1] = ornt[2];
5843 coneNew[2] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 2;
5844 orntNew[2] = 0;
5845 coneNew[3] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 1;
5846 orntNew[3] = -2;
5847 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5847,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5848 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5848,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5849#if defined(PETSC_USE_DEBUG1)
5850 if ((newp+2 < fStartNew) || (newp+2 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+2, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5850,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+2,fStartNew,fEndNew)
;
5851 for (p = 0; p < 4; ++p) {
5852 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5852,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5853 }
5854#endif
5855 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5855,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5856 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5856,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5857 for (r = 0; r < 3; ++r) {
5858 for (s = 0; s < supportSize; ++s) {
5859 PetscInt subf;
5860
5861 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5861,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5862 if (coneSize != 5 && support[s] >= cMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),5862,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
5863 if (coneSize != 4 && support[s] < cMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),5863,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
5864 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5864,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5865 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5865,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5866 for (c = 0; c < coneSize; ++c) {
5867 if (cone[c] == f) break;
5868 }
5869 subf = GetTriSubfaceInverse_Static(ornt[c], r);
5870 if (coneSize == 4) {
5871 supportRef[s] = cStartNew + (support[s] - cStart)*4 + faces[c*3+subf];
5872 } else if (coneSize == 5) {
5873 if (c != 0 && c != 1) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected position %D in cone %D of cell %D (cMax %D) for face %D", c, support[s], cMax, f)return PetscError(((MPI_Comm)0x44000001),5873,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected position %D in cone %D of cell %D (cMax %D) for face %D"
,c,support[s],cMax,f)
;
5874 supportRef[s] = cStartNew + (cMax - cStart)*4 + (support[s] - cMax)*3 + subf;
5875 } else SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),5875,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
5876 }
5877 ierr = DMPlexSetSupport(rdm, newp+r, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5877,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5878#if defined(PETSC_USE_DEBUG1)
5879 if ((newp+r < fStartNew) || (newp+r >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+r, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5879,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+r,fStartNew,fEndNew)
;
5880 for (p = 0; p < supportSize; ++p) {
5881 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5881,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
5882 }
5883#endif
5884 }
5885 }
5886 /* Interior faces have 4 edges and 2 cells */
5887 for (c = cStart; c < cMax; ++c) {
5888 PetscInt newp = fStartNew + (fMax - fStart)*3 + (c - cStart)*6;
5889 const PetscInt *cone, *ornt;
5890 PetscInt coneNew[4], orntNew[4];
5891 PetscInt supportNew[2];
5892
5893 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5893,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5894#if defined(PETSC_USE_DEBUG1)
5895 for (p = 0; p < 4; ++p) {
5896 if (cone[p] >= fMax) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position %D for face %D", cone[p], p, fMax, f)return PetscError(((MPI_Comm)0x44000001),5896,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position %D for face %D"
,cone[p],p,fMax,f)
;
5897 }
5898#endif
5899 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5899,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5900 /* Face {a, g, m, h} */
5901 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],0);
5902 orntNew[0] = 0;
5903 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 0;
5904 orntNew[1] = 0;
5905 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 1;
5906 orntNew[2] = -2;
5907 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],2);
5908 orntNew[3] = -2;
5909 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5909,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5910 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5910,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5911#if defined(PETSC_USE_DEBUG1)
5912 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5912,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5913 for (p = 0; p < 4; ++p) {
5914 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5914,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5915 }
5916#endif
5917 supportNew[0] = cStartNew + (c - cStart)*4 + 0;
5918 supportNew[1] = cStartNew + (c - cStart)*4 + 1;
5919 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5920#if defined(PETSC_USE_DEBUG1)
5921 for (p = 0; p < 2; ++p) {
5922 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5922,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5923 }
5924#endif
5925 ++newp;
5926 /* Face {g, b, l , m} */
5927 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],1);
5928 orntNew[0] = -2;
5929 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*3 + GetTriInteriorEdge_Static(ornt[3],0);
5930 orntNew[1] = 0;
5931 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 3;
5932 orntNew[2] = 0;
5933 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 0;
5934 orntNew[3] = -2;
5935 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5935,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5936 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5936,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5937#if defined(PETSC_USE_DEBUG1)
5938 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5938,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5939 for (p = 0; p < 4; ++p) {
5940 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5940,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5941 }
5942#endif
5943 supportNew[0] = cStartNew + (c - cStart)*4 + 1;
5944 supportNew[1] = cStartNew + (c - cStart)*4 + 2;
5945 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5945,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5946#if defined(PETSC_USE_DEBUG1)
5947 for (p = 0; p < 2; ++p) {
5948 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5948,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5949 }
5950#endif
5951 ++newp;
5952 /* Face {c, g, m, i} */
5953 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],2);
5954 orntNew[0] = 0;
5955 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 0;
5956 orntNew[1] = 0;
5957 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 2;
5958 orntNew[2] = -2;
5959 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*3 + GetTriInteriorEdge_Static(ornt[2],0);
5960 orntNew[3] = -2;
5961 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5961,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5962 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5962,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5963#if defined(PETSC_USE_DEBUG1)
5964 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5964,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5965 for (p = 0; p < 4; ++p) {
5966 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5966,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5967 }
5968#endif
5969 supportNew[0] = cStartNew + (c - cStart)*4 + 0;
5970 supportNew[1] = cStartNew + (c - cStart)*4 + 2;
5971 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5971,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5972#if defined(PETSC_USE_DEBUG1)
5973 for (p = 0; p < 2; ++p) {
5974 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),5974,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
5975 }
5976#endif
5977 ++newp;
5978 /* Face {d, h, m, i} */
5979 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],0);
5980 orntNew[0] = 0;
5981 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 1;
5982 orntNew[1] = 0;
5983 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 2;
5984 orntNew[2] = -2;
5985 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*3 + GetTriInteriorEdge_Static(ornt[2],2);
5986 orntNew[3] = -2;
5987 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5987,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5988 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5988,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5989#if defined(PETSC_USE_DEBUG1)
5990 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),5990,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
5991 for (p = 0; p < 4; ++p) {
5992 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),5992,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
5993 }
5994#endif
5995 supportNew[0] = cStartNew + (c - cStart)*4 + 0;
5996 supportNew[1] = cStartNew + (c - cStart)*4 + 3;
5997 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),5997,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
5998#if defined(PETSC_USE_DEBUG1)
5999 for (p = 0; p < 2; ++p) {
6000 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6000,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
6001 }
6002#endif
6003 ++newp;
6004 /* Face {h, m, l, e} */
6005 coneNew[0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 1;
6006 orntNew[0] = 0;
6007 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 3;
6008 orntNew[1] = -2;
6009 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*3 + GetTriInteriorEdge_Static(ornt[3],1);
6010 orntNew[2] = -2;
6011 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],1);
6012 orntNew[3] = 0;
6013 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6013,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6014 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6014,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6015#if defined(PETSC_USE_DEBUG1)
6016 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6016,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6017 for (p = 0; p < 4; ++p) {
6018 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6018,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6019 }
6020#endif
6021 supportNew[0] = cStartNew + (c - cStart)*4 + 1;
6022 supportNew[1] = cStartNew + (c - cStart)*4 + 3;
6023 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6023,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6024#if defined(PETSC_USE_DEBUG1)
6025 for (p = 0; p < 2; ++p) {
6026 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6026,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
6027 }
6028#endif
6029 ++newp;
6030 /* Face {i, m, l, f} */
6031 coneNew[0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 2;
6032 orntNew[0] = 0;
6033 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 3;
6034 orntNew[1] = -2;
6035 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*3 + GetTriInteriorEdge_Static(ornt[3],2);
6036 orntNew[2] = -2;
6037 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*3 + GetTriInteriorEdge_Static(ornt[2],1);
6038 orntNew[3] = 0;
6039 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6039,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6040 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6040,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6041#if defined(PETSC_USE_DEBUG1)
6042 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6042,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6043 for (p = 0; p < 4; ++p) {
6044 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6044,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6045 }
6046#endif
6047 supportNew[0] = cStartNew + (c - cStart)*4 + 2;
6048 supportNew[1] = cStartNew + (c - cStart)*4 + 3;
6049 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6049,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6050#if defined(PETSC_USE_DEBUG1)
6051 for (p = 0; p < 2; ++p) {
6052 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6052,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
6053 }
6054#endif
6055 ++newp;
6056 }
6057 /* Hybrid split faces have 4 edges and same cells */
6058 for (f = fMax; f < fEnd; ++f) {
6059 const PetscInt *cone, *ornt, *support;
6060 PetscInt coneNew[4], orntNew[4];
6061 PetscInt size, s;
6062 const PetscInt newp = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (f - fMax)*2;
6063
6064 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6064,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6065#if defined(PETSC_USE_DEBUG1)
6066 if (cone[0] >= eMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid edge %D (eMax %D) in cone position 0 for face %D", cone[0], eMax, f)return PetscError(((MPI_Comm)0x44000001),6066,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid edge %D (eMax %D) in cone position 0 for face %D"
,cone[0],eMax,f)
;
6067 if (cone[1] >= eMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid edge %D (eMax %D) in cone position 1 for face %D", cone[1], eMax, f)return PetscError(((MPI_Comm)0x44000001),6067,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid edge %D (eMax %D) in cone position 1 for face %D"
,cone[1],eMax,f)
;
6068 if (cone[2] < eMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected edge %D (eMax %D) in cone position 2 for face %D", cone[2], eMax, f)return PetscError(((MPI_Comm)0x44000001),6068,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected edge %D (eMax %D) in cone position 2 for face %D"
,cone[2],eMax,f)
;
6069 if (cone[3] < eMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected edge %D (eMax %D) in cone position 3 for face %D", cone[3], eMax, f)return PetscError(((MPI_Comm)0x44000001),6069,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected edge %D (eMax %D) in cone position 3 for face %D"
,cone[3],eMax,f)
;
6070#endif
6071 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6071,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6072 /* A face */
6073 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 1 : 0);
6074 orntNew[0] = ornt[0];
6075 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (f - fMax);
6076 orntNew[1] = 0;
6077 coneNew[2] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 1 : 0);
6078 orntNew[2] = ornt[1] < 0 ? 0 : -2;
6079 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (cone[2] - eMax);
6080 orntNew[3] = ornt[2] < 0 ? 0 : -2;
6081 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6081,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6082 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6082,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6083#if defined(PETSC_USE_DEBUG1)
6084 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6084,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6085 for (p = 0; p < 4; ++p) {
6086 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6086,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6087 }
6088#endif
6089
6090 /* B face */
6091 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 0 : 1);
6092 orntNew[0] = ornt[0];
6093 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (cone[3] - eMax);
6094 orntNew[1] = ornt[3];
6095 coneNew[2] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 0 : 1);
6096 orntNew[2] = ornt[1] < 0 ? 0 : -2;
6097 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (f - fMax);
6098 orntNew[3] = -2;
6099 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6099,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6100 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6100,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6101#if defined(PETSC_USE_DEBUG1)
6102 if ((newp+1 < fStartNew) || (newp+1 >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp+1, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6102,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
+1,fStartNew,fEndNew)
;
6103 for (p = 0; p < 4; ++p) {
6104 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6104,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6105 }
6106#endif
6107
6108 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6108,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6109 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6109,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6110 for (r = 0; r < 2; ++r) {
6111 for (s = 0; s < size; ++s) {
6112 const PetscInt *coneCell, *orntCell;
6113 PetscInt coneSize, o, of, c;
6114
6115 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6115,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6116 if (coneSize != 5 || support[s] < cMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),6116,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
6117 ierr = DMPlexGetCone(dm, support[s], &coneCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6117,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6118 ierr = DMPlexGetConeOrientation(dm, support[s], &orntCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6118,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6119 o = orntCell[0] < 0 ? -1 : 1;
6120 o = 1;
6121 for (c = 0; c < coneSize; ++c) if (coneCell[c] == f) break;
6122 if (c == 0 || c == 1) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected position in cone %D of cell %D (cMax %D) for face %D", c, support[s], cMax, f)return PetscError(((MPI_Comm)0x44000001),6122,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected position in cone %D of cell %D (cMax %D) for face %D"
,c,support[s],cMax,f)
;
6123 if (c == coneSize) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Could not find face %D in cone of cell %D", f, support[s])return PetscError(((MPI_Comm)0x44000001),6123,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Could not find face %D in cone of cell %D"
,f,support[s])
;
6124 of = orntCell[c] < 0 ? -1 : 1;
6125 supportRef[s] = cStartNew + (cMax - cStart)*4 + (support[s] - cMax)*3 + (c-2 + (o*of < 0 ? 1-r : r))%3;
6126 }
6127 ierr = DMPlexSetSupport(rdm, newp + r, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6127,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6128#if defined(PETSC_USE_DEBUG1)
6129 for (p = 0; p < size; ++p) {
6130 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6130,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
6131 }
6132#endif
6133 }
6134 }
6135 /* Interior hybrid faces have 4 edges and 2 cells */
6136 for (c = cMax; c < cEnd; ++c) {
6137 PetscInt newp = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3;
6138 const PetscInt *cone, *ornt;
6139 PetscInt coneNew[4], orntNew[4];
6140 PetscInt supportNew[2];
6141
6142 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6142,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6143#if defined(PETSC_USE_DEBUG1)
6144 if (cone[0] >= fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position 0 for cell %D", cone[0], fMax, c)return PetscError(((MPI_Comm)0x44000001),6144,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position 0 for cell %D"
,cone[0],fMax,c)
;
6145 if (cone[1] >= fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position 1 for cell %D", cone[1], fMax, c)return PetscError(((MPI_Comm)0x44000001),6145,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position 1 for cell %D"
,cone[1],fMax,c)
;
6146 if (cone[2] < fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected face %D (fMax %D) in cone position 2 for cell %D", cone[2], fMax, c)return PetscError(((MPI_Comm)0x44000001),6146,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected face %D (fMax %D) in cone position 2 for cell %D"
,cone[2],fMax,c)
;
6147 if (cone[3] < fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected face %D (fMax %D) in cone position 3 for cell %D", cone[3], fMax, c)return PetscError(((MPI_Comm)0x44000001),6147,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected face %D (fMax %D) in cone position 3 for cell %D"
,cone[3],fMax,c)
;
6148 if (cone[4] < fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected face %D (fMax %D) in cone position 3 for cell %D", cone[3], fMax, c)return PetscError(((MPI_Comm)0x44000001),6148,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected face %D (fMax %D) in cone position 3 for cell %D"
,cone[3],fMax,c)
;
6149#endif
6150 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6150,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6151 /* Face {a, g, h, d} */
6152 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],0);
6153 orntNew[0] = 0;
6154 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (fEnd - fMax) + c - cMax;
6155 orntNew[1] = 0;
6156 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],0);
6157 orntNew[2] = -2;
6158 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (cone[2] - fMax);
6159 orntNew[3] = -2;
6160 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6160,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6161 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6161,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6162#if defined(PETSC_USE_DEBUG1)
6163 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6163,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6164 for (p = 0; p < 4; ++p) {
6165 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6165,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6166 }
6167#endif
6168 supportNew[0] = cStartNew + (cMax - cStart)*4 + (c - cMax)*3 + 0;
6169 supportNew[1] = cStartNew + (cMax - cStart)*4 + (c - cMax)*3 + 1;
6170 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6170,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6171#if defined(PETSC_USE_DEBUG1)
6172 for (p = 0; p < 2; ++p) {
6173 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6173,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
6174 }
6175#endif
6176 ++newp;
6177 /* Face {b, g, h, l} */
6178 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],1);
6179 orntNew[0] = 0;
6180 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (fEnd - fMax) + c - cMax;
6181 orntNew[1] = 0;
6182 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],1);
6183 orntNew[2] = -2;
6184 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (cone[3] - fMax);
6185 orntNew[3] = -2;
6186 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6186,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6187 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6187,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6188#if defined(PETSC_USE_DEBUG1)
6189 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6189,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6190 for (p = 0; p < 4; ++p) {
6191 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6191,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6192 }
6193#endif
6194 supportNew[0] = cStartNew + (cMax - cStart)*4 + (c - cMax)*3 + 1;
6195 supportNew[1] = cStartNew + (cMax - cStart)*4 + (c - cMax)*3 + 2;
6196 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6196,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6197#if defined(PETSC_USE_DEBUG1)
6198 for (p = 0; p < 2; ++p) {
6199 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6199,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
6200 }
6201#endif
6202 ++newp;
6203 /* Face {c, g, h, f} */
6204 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*3 + GetTriInteriorEdge_Static(ornt[0],2);
6205 orntNew[0] = 0;
6206 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (fEnd - fMax) + c - cMax;
6207 orntNew[1] = 0;
6208 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*3 + GetTriInteriorEdge_Static(ornt[1],2);
6209 orntNew[2] = -2;
6210 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (cone[4] - fMax);
6211 orntNew[3] = -2;
6212 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6212,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6213 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6213,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6214#if defined(PETSC_USE_DEBUG1)
6215 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6215,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6216 for (p = 0; p < 4; ++p) {
6217 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6217,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6218 }
6219#endif
6220 supportNew[0] = cStartNew + (cMax - cStart)*4 + (c - cMax)*3 + 2;
6221 supportNew[1] = cStartNew + (cMax - cStart)*4 + (c - cMax)*3 + 0;
6222 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6222,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6223#if defined(PETSC_USE_DEBUG1)
6224 for (p = 0; p < 2; ++p) {
6225 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6225,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
6226 }
6227#endif
6228 }
6229 /* Face edges have 2 vertices and 2 + cell faces supports */
6230 for (f = fStart; f < fMax; ++f) {
6231 const PetscInt *cone, *ornt, *support;
6232 PetscInt coneSize, supportSize, s;
6233
6234 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6234,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6235 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6235,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6236 for (r = 0; r < 3; ++r) {
6237 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + r;
6238 PetscInt coneNew[2];
6239 PetscInt fint[4][3] = { {0, 1, 2},
6240 {3, 4, 0},
6241 {2, 5, 3},
6242 {1, 4, 5} };
6243
6244 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6244,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6245 if (cone[r] >= eMax) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected cone point %D in position %D for face %D (eMax %D)", cone[r], r, f, eMax)return PetscError(((MPI_Comm)0x44000001),6245,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected cone point %D in position %D for face %D (eMax %D)"
,cone[r],r,f,eMax)
;
6246 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - eStart);
6247 coneNew[1] = vStartNew + (vEnd - vStart) + (eMax - eStart) + f - fStart;
6248 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6248,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6249#if defined(PETSC_USE_DEBUG1)
6250 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6250,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6251 for (p = 0; p < 2; ++p) {
6252 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6252,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
6253 }
6254#endif
6255 supportRef[0] = fStartNew + (f - fStart)*3 + (r+0)%3;
6256 supportRef[1] = fStartNew + (f - fStart)*3 + (r+1)%3;
6257 for (s = 0; s < supportSize; ++s) {
6258 PetscInt er;
6259
6260 supportRef[2+s] = -1;
6261 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6261,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6262 if (coneSize != 5 && support[s] >= cMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),6262,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
6263 if (coneSize != 4 && support[s] < cMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),6263,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
6264 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6264,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6265 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6265,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6266 for (c = 0; c < coneSize; ++c) {if (cone[c] == f) break;}
6267 er = GetTriInteriorEdgeInverse_Static(ornt[c], r);
6268 if (coneSize == 4) {
6269 supportRef[2+s] = fStartNew + (fMax - fStart)*3 + (support[s] - cStart)*6 + fint[c][er];
6270 } else if (coneSize == 5) {
6271 if (c != 0 && c != 1) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected position %D in cone %D of cell %D (cMax %D) for face %D", c, support[s], cMax, f)return PetscError(((MPI_Comm)0x44000001),6271,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected position %D in cone %D of cell %D (cMax %D) for face %D"
,c,support[s],cMax,f)
;
6272 supportRef[2+s] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (support[s] - cMax)*3 + er;
6273 }
6274 }
6275 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6276#if defined(PETSC_USE_DEBUG1)
6277 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6277,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6278 for (p = 0; p < supportSize + 2; ++p) {
6279 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6279,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
6280 }
6281#endif
6282 }
6283 }
6284 /* Interior cell edges have 2 vertices and 3 faces */
6285 for (c = cStart; c < cMax; ++c) {
6286 const PetscInt *cone;
6287 PetscInt fint[4][3] = { {0,1,2},
6288 {0,3,4},
6289 {2,3,5},
6290 {1,4,5} } ;
6291
6292 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6292,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6293 for (r = 0; r < 4; r++) {
6294 PetscInt coneNew[2], supportNew[3];
6295 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + r;
6296
6297 if (cone[r] >= fMax) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position %D for cell %D", cone[r], r, fMax, c)return PetscError(((MPI_Comm)0x44000001),6297,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position %D for cell %D"
,cone[r],r,fMax,c)
;
6298 coneNew[0] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (cone[r] - fStart);
6299 coneNew[1] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax -fStart) + c - cStart;
6300 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6300,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6301#if defined(PETSC_USE_DEBUG1)
6302 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6302,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6303 for (p = 0; p < 2; ++p) {
6304 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6304,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
6305 }
6306#endif
6307 supportNew[0] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + fint[r][0];
6308 supportNew[1] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + fint[r][1];
6309 supportNew[2] = fStartNew + (fMax - fStart)*3 + (c - cStart)*6 + fint[r][2];
6310 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6310,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6311#if defined(PETSC_USE_DEBUG1)
6312 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6313 for (p = 0; p < 3; ++p) {
6314 if ((supportNew[p] < fStartNew) || (supportNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6314,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportNew
[p],fStartNew,fEndNew)
;
6315 }
6316#endif
6317 }
6318 }
6319 /* Hybrid edges have two vertices and the same faces */
6320 for (e = eMax; e < eEnd; ++e) {
6321 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (e - eMax);
6322 const PetscInt *cone, *support, *fcone;
6323 PetscInt coneNew[2], size, fsize, s;
6324
6325 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6325,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6326 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6326,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6327 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6327,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6328 coneNew[0] = vStartNew + (cone[0] - vStart);
6329 coneNew[1] = vStartNew + (cone[1] - vStart);
6330 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6330,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6331#if defined(PETSC_USE_DEBUG1)
6332 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is a edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6332,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is a edge [%D, %D)",newp,eStartNew
,eEndNew)
;
6333 for (p = 0; p < 2; ++p) {
6334 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6334,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
6335 }
6336#endif
6337 for (s = 0; s < size; ++s) {
6338 ierr = DMPlexGetConeSize(dm, support[s], &fsize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6338,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6339 ierr = DMPlexGetCone(dm, support[s], &fcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6339,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6340 for (c = 0; c < fsize; ++c) if (fcone[c] == e) break;
6341 if ((c < 2) || (c > 3)) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Edge %D not found in cone of face %D", e, support[s])return PetscError(((MPI_Comm)0x44000001),6341,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Edge %D not found in cone of face %D"
,e,support[s])
;
6342 supportRef[s] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (support[s] - fMax)*2 + c-2;
6343 }
6344 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6344,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6345#if defined(PETSC_USE_DEBUG1)
6346 for (p = 0; p < size; ++p) {
6347 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6347,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
6348 }
6349#endif
6350 }
6351 /* Hybrid face edges have 2 vertices and 2 + cell faces supports */
6352 for (f = fMax; f < fEnd; ++f) {
6353 const PetscInt *cone, *ornt, *support;
6354 PetscInt coneSize, supportSize;
6355 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + f - fMax;
6356 PetscInt coneNew[2], s;
6357
6358 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6358,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6359#if defined(PETSC_USE_DEBUG1)
6360 if (cone[0] >= eMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected cone point %D in position 0 for face %D (eMax %D)", cone[0], f, eMax)return PetscError(((MPI_Comm)0x44000001),6360,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected cone point %D in position 0 for face %D (eMax %D)"
,cone[0],f,eMax)
;
6361 if (cone[1] >= eMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected cone point %D in position 1 for face %D (eMax %D)", cone[1], f, eMax)return PetscError(((MPI_Comm)0x44000001),6361,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected cone point %D in position 1 for face %D (eMax %D)"
,cone[1],f,eMax)
;
6362#endif
6363 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[0] - eStart);
6364 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[1] - eStart);
6365 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6365,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6366#if defined(PETSC_USE_DEBUG1)
6367 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6367,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6368 for (p = 0; p < 2; ++p) {
6369 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6369,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
6370 }
6371#endif
6372 supportRef[0] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (f- fMax)*2 + 0;
6373 supportRef[1] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (f- fMax)*2 + 1;
6374 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6374,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6375 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6375,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6376 for (s = 0; s < supportSize; ++s) {
6377 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6377,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6378 if (coneSize != 5 || support[s] < cMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),6378,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
6379 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6379,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6380 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6380,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6381 for (c = 0; c < coneSize; ++c) {if (cone[c] == f) break;}
6382 if (c == 0 || c == 1) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected position in cone %D of cell %D (cMax %D) for face %D", c, support[s], cMax, f)return PetscError(((MPI_Comm)0x44000001),6382,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected position in cone %D of cell %D (cMax %D) for face %D"
,c,support[s],cMax,f)
;
6383 supportRef[2+s] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (support[s] - cMax)*3 + c - 2;
6384 }
6385 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6385,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6386#if defined(PETSC_USE_DEBUG1)
6387 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6387,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6388 for (p = 0; p < supportSize + 2; ++p) {
6389 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6389,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
6390 }
6391#endif
6392 }
6393 /* Hybrid cell edges have 2 vertices and 3 faces */
6394 for (c = cMax; c < cEnd; ++c) {
6395 PetscInt coneNew[2], supportNew[3];
6396 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (fEnd - fMax) + c - cMax;
6397 const PetscInt *cone;
6398
6399 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6399,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6400#if defined(PETSC_USE_DEBUG1)
6401 if (cone[0] >= fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position 0 for cell %D", cone[0], fMax, c)return PetscError(((MPI_Comm)0x44000001),6401,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position 0 for cell %D"
,cone[0],fMax,c)
;
6402 if (cone[1] >= fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected hybrid face %D (fMax %D) in cone position 1 for cell %D", cone[1], fMax, c)return PetscError(((MPI_Comm)0x44000001),6402,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected hybrid face %D (fMax %D) in cone position 1 for cell %D"
,cone[1],fMax,c)
;
6403#endif
6404 coneNew[0] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (cone[0] - fStart);
6405 coneNew[1] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (cone[1] - fStart);
6406 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6406,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6407#if defined(PETSC_USE_DEBUG1)
6408 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6408,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6409 for (p = 0; p < 2; ++p) {
6410 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6410,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
6411 }
6412#endif
6413 supportNew[0] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 0;
6414 supportNew[1] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 1;
6415 supportNew[2] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (c - cMax)*3 + 2;
6416 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6416,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6417#if defined(PETSC_USE_DEBUG1)
6418 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6418,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6419 for (p = 0; p < 3; ++p) {
6420 if ((supportNew[p] < fStartNew) || (supportNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6420,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportNew
[p],fStartNew,fEndNew)
;
6421 }
6422#endif
6423 }
6424 /* Old vertices have identical supports */
6425 for (v = vStart; v < vEnd; ++v) {
6426 const PetscInt newp = vStartNew + (v - vStart);
6427 const PetscInt *support, *cone;
6428 PetscInt size, s;
6429
6430 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6430,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6431 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6431,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6432 for (s = 0; s < size; ++s) {
6433 const PetscInt e = support[s];
6434
6435 supportRef[s] = -1;
6436 if (eStart <= e) {
6437 if (e < eMax) {
6438 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6438,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6439 supportRef[s] = eStartNew + (e - eStart)*2 + (cone[1] == v ? 1 : 0);
6440 } else if (e < eEnd) {
6441 supportRef[s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + e - eMax;
6442 } else SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", e, eStart, eEnd)return PetscError(((MPI_Comm)0x44000001),6442,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",e,
eStart,eEnd)
;
6443 } else SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", e, eStart, eEnd)return PetscError(((MPI_Comm)0x44000001),6443,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",e,
eStart,eEnd)
;
6444 }
6445 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6445,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6446#if defined(PETSC_USE_DEBUG1)
6447 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6447,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
6448 for (p = 0; p < size; ++p) {
6449 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6449,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
6450 }
6451#endif
6452 }
6453 /* Interior edge vertices have 2 + faces supports */
6454 for (e = eStart; e < eMax; ++e) {
6455 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
6456 const PetscInt *cone, *support;
6457 PetscInt size, s;
6458
6459 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6459,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6460 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6460,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6461 supportRef[0] = eStartNew + (e - eStart)*2 + 0;
6462 supportRef[1] = eStartNew + (e - eStart)*2 + 1;
6463 for (s = 0; s < size; ++s) {
6464 PetscInt r, coneSize;
6465
6466 supportRef[2+s] = -1;
6467 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6467,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6468 if (coneSize != 4 && support[s] >= fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for face %D (fMax %D)", coneSize, support[s], fMax)return PetscError(((MPI_Comm)0x44000001),6468,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for face %D (fMax %D)"
,coneSize,support[s],fMax)
;
6469 if (coneSize != 3 && support[s] < fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for face %D (fMax %D)", coneSize, support[s], fMax)return PetscError(((MPI_Comm)0x44000001),6469,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for face %D (fMax %D)"
,coneSize,support[s],fMax)
;
6470 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6470,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6471 for (r = 0; r < coneSize; ++r) {if (cone[r] == e) break;}
6472 if (coneSize == 3) supportRef[2+s] = eStartNew + (eMax - eStart)*2 + (support[s] - fStart)*3 + r;
6473 else if (coneSize == 4) {
6474 if (r != 0 && r != 1) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected position in cone %D of face %D (fMax %D) for edge %D", r, support[s], fMax, e)return PetscError(((MPI_Comm)0x44000001),6474,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected position in cone %D of face %D (fMax %D) for edge %D"
,r,support[s],fMax,e)
;
6475 supportRef[2+s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + support[s] - fMax;
6476 } else SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for face %D (fMax %D)", coneSize, support[s], fMax)return PetscError(((MPI_Comm)0x44000001),6476,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for face %D (fMax %D)"
,coneSize,support[s],fMax)
;
6477 }
6478 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6478,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6479#if defined(PETSC_USE_DEBUG1)
6480 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6480,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
6481 for (p = 0; p < 2+size; ++p) {
6482 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6482,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
6483 }
6484#endif
6485 }
6486 /* Split Edges have 2 vertices and the same faces as the parent */
6487 for (e = eStart; e < eMax; ++e) {
6488 const PetscInt newv = vStartNew + (vEnd - vStart) + (e - eStart);
6489
6490 for (r = 0; r < 2; ++r) {
6491 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
6492 const PetscInt *cone, *ornt, *support;
6493 PetscInt coneNew[2], coneSize, c, supportSize, s;
6494
6495 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6495,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6496 coneNew[0] = vStartNew + (cone[0] - vStart);
6497 coneNew[1] = vStartNew + (cone[1] - vStart);
6498 coneNew[(r+1)%2] = newv;
6499 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6499,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6500#if defined(PETSC_USE_DEBUG1)
6501 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6501,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6502 for (p = 0; p < 2; ++p) {
6503 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6503,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
6504 }
6505#endif
6506 ierr = DMPlexGetSupportSize(dm, e, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6506,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6507 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6507,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6508 for (s = 0; s < supportSize; ++s) {
6509 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6509,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6510 if (coneSize != 4 && support[s] >= fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for face %D (fMax %D)", coneSize, support[s], fMax)return PetscError(((MPI_Comm)0x44000001),6510,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for face %D (fMax %D)"
,coneSize,support[s],fMax)
;
6511 if (coneSize != 3 && support[s] < fMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for face %D (fMax %D)", coneSize, support[s], fMax)return PetscError(((MPI_Comm)0x44000001),6511,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for face %D (fMax %D)"
,coneSize,support[s],fMax)
;
6512 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6512,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6513 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6513,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6514 for (c = 0; c < coneSize; ++c) {
6515 if (cone[c] == e) break;
6516 }
6517 if (coneSize == 3) supportRef[s] = fStartNew + (support[s] - fStart)*3 + (c + (ornt[c] < 0 ? 1-r : r))%3;
6518 else if (coneSize == 4) {
6519 if (c != 0 && c != 1) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected position in cone %D of face %D (fMax %D) for edge %D", c, support[s], fMax, e)return PetscError(((MPI_Comm)0x44000001),6519,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected position in cone %D of face %D (fMax %D) for edge %D"
,c,support[s],fMax,e)
;
6520 supportRef[s] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (support[s] - fMax)*2 + (ornt[c] < 0 ? 1-r : r);
6521 } else SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for face %D (fMax %D)", coneSize, support[s], fMax)return PetscError(((MPI_Comm)0x44000001),6521,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for face %D (fMax %D)"
,coneSize,support[s],fMax)
;
6522 }
6523 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6523,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6524#if defined(PETSC_USE_DEBUG1)
6525 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6525,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
6526 for (p = 0; p < supportSize; ++p) {
6527 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6527,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
6528 }
6529#endif
6530 }
6531 }
6532 /* Face vertices have 3 + cells supports */
6533 for (f = fStart; f < fMax; ++f) {
6534 const PetscInt newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (f - fStart);
6535 const PetscInt *cone, *support;
6536 PetscInt size, s;
6537
6538 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6538,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6539 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6539,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6540 supportRef[0] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 0;
6541 supportRef[1] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 1;
6542 supportRef[2] = eStartNew + (eMax - eStart)*2 + (f - fStart)*3 + 2;
6543 for (s = 0; s < size; ++s) {
6544 PetscInt r, coneSize;
6545
6546 supportRef[3+s] = -1;
6547 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6547,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6548 if (coneSize != 5 && support[s] >= cMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),6548,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
6549 if (coneSize != 4 && support[s] < cMax) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected conesize %D for cell %D (cMax %D)", coneSize, support[s], cMax)return PetscError(((MPI_Comm)0x44000001),6549,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected conesize %D for cell %D (cMax %D)"
,coneSize,support[s],cMax)
;
6550 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6550,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6551 for (r = 0; r < coneSize; ++r) {if (cone[r] == f) break;}
6552 if (coneSize == 4) supportRef[3+s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (support[s] - cStart)*4 + r;
6553 else if (coneSize == 5) {
6554 if (r != 0 && r != 1) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Unexpected position in cone %D of cell %D (cMax %D) for face %D", r, support[s], cMax, f)return PetscError(((MPI_Comm)0x44000001),6554,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unexpected position in cone %D of cell %D (cMax %D) for face %D"
,r,support[s],cMax,f)
;
6555 supportRef[3+s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (fEnd - fMax) + support[s] - cMax;
6556 }
6557 }
6558 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6558,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6559#if defined(PETSC_USE_DEBUG1)
6560 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6560,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
6561 for (p = 0; p < 3+size; ++p) {
6562 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6562,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
6563 }
6564#endif
6565 }
6566 /* Interior cell vertices have 4 supports */
6567 for (c = cStart; c < cMax; ++c) {
6568 const PetscInt newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax - fStart) + c - cStart;
6569
6570 supportRef[0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 0;
6571 supportRef[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 1;
6572 supportRef[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 2;
6573 supportRef[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (c - cStart)*4 + 3;
6574 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6574,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6575#if defined(PETSC_USE_DEBUG1)
6576 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),6576,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
6577 for (p = 0; p < 4; ++p) {
6578 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6578,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
6579 }
6580#endif
6581 }
6582 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),6582,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6582,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6583 ierr = DMPlexRestoreFaces_Internal(dm, 3, cStart, NULL((void*)0), NULL((void*)0), &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6583,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6584 break;
6585 case REFINER_HEX_3D:
6586 /*
6587 Bottom (viewed from top) Top
6588 1---------2---------2 7---------2---------6
6589 | | | | | |
6590 | B 2 C | | H 2 G |
6591 | | | | | |
6592 3----3----0----1----1 3----3----0----1----1
6593 | | | | | |
6594 | A 0 D | | E 0 F |
6595 | | | | | |
6596 0---------0---------3 4---------0---------5
6597 */
6598 /* All cells have 6 faces: Bottom, Top, Front, Back, Right, Left */
6599 for (c = cStart; c < cEnd; ++c) {
6600 const PetscInt newp = (c - cStart)*8;
6601 const PetscInt *cone, *ornt;
6602 PetscInt coneNew[6], orntNew[6];
6603
6604 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6604,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6605 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6605,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6606 /* A hex */
6607 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], 0);
6608 orntNew[0] = ornt[0];
6609 coneNew[1] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 8; /* AE */
6610 orntNew[1] = 0;
6611 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetQuadSubface_Static(ornt[2], 0);
6612 orntNew[2] = ornt[2];
6613 coneNew[3] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 3; /* AB */
6614 orntNew[3] = 0;
6615 coneNew[4] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 0; /* AD */
6616 orntNew[4] = 0;
6617 coneNew[5] = fStartNew + (cone[5] - fStart)*4 + GetQuadSubface_Static(ornt[5], 0);
6618 orntNew[5] = ornt[5];
6619 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6619,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6620 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6620,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6621#if defined(PETSC_USE_DEBUG1)
6622 if ((newp+0 < cStartNew) || (newp+0 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6622,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cEndNew)
;
6623 for (p = 0; p < 6; ++p) {
6624 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6624,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
6625 }
6626#endif
6627 /* B hex */
6628 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], 1);
6629 orntNew[0] = ornt[0];
6630 coneNew[1] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 11; /* BH */
6631 orntNew[1] = 0;
6632 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 3; /* AB */
6633 orntNew[2] = -1;
6634 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetQuadSubface_Static(ornt[3], 1);
6635 orntNew[3] = ornt[3];
6636 coneNew[4] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 2; /* BC */
6637 orntNew[4] = 0;
6638 coneNew[5] = fStartNew + (cone[5] - fStart)*4 + GetQuadSubface_Static(ornt[5], 3);
6639 orntNew[5] = ornt[5];
6640 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6640,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6641 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6641,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6642#if defined(PETSC_USE_DEBUG1)
6643 if ((newp+1 < cStartNew) || (newp+1 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6643,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cEndNew)
;
6644 for (p = 0; p < 6; ++p) {
6645 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6645,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
6646 }
6647#endif
6648 /* C hex */
6649 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], 2);
6650 orntNew[0] = ornt[0];
6651 coneNew[1] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 10; /* CG */
6652 orntNew[1] = 0;
6653 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 1; /* CD */
6654 orntNew[2] = -1;
6655 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetQuadSubface_Static(ornt[3], 0);
6656 orntNew[3] = ornt[3];
6657 coneNew[4] = fStartNew + (cone[4] - fStart)*4 + GetQuadSubface_Static(ornt[4], 1);
6658 orntNew[4] = ornt[4];
6659 coneNew[5] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 2; /* BC */
6660 orntNew[5] = -4;
6661 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6661,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6662 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6662,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6663#if defined(PETSC_USE_DEBUG1)
6664 if ((newp+2 < cStartNew) || (newp+2 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6664,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cEndNew)
;
6665 for (p = 0; p < 6; ++p) {
6666 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6666,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
6667 }
6668#endif
6669 /* D hex */
6670 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], 3);
6671 orntNew[0] = ornt[0];
6672 coneNew[1] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 9; /* DF */
6673 orntNew[1] = 0;
6674 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetQuadSubface_Static(ornt[2], 1);
6675 orntNew[2] = ornt[2];
6676 coneNew[3] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 1; /* CD */
6677 orntNew[3] = 0;
6678 coneNew[4] = fStartNew + (cone[4] - fStart)*4 + GetQuadSubface_Static(ornt[4], 0);
6679 orntNew[4] = ornt[4];
6680 coneNew[5] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 0; /* AD */
6681 orntNew[5] = -4;
6682 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6682,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6683 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6683,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6684#if defined(PETSC_USE_DEBUG1)
6685 if ((newp+3 < cStartNew) || (newp+3 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6685,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cEndNew)
;
6686 for (p = 0; p < 6; ++p) {
6687 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6687,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
6688 }
6689#endif
6690 /* E hex */
6691 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 8; /* AE */
6692 orntNew[0] = -4;
6693 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], 0);
6694 orntNew[1] = ornt[1];
6695 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetQuadSubface_Static(ornt[2], 3);
6696 orntNew[2] = ornt[2];
6697 coneNew[3] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 7; /* EH */
6698 orntNew[3] = 0;
6699 coneNew[4] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 4; /* EF */
6700 orntNew[4] = -1;
6701 coneNew[5] = fStartNew + (cone[5] - fStart)*4 + GetQuadSubface_Static(ornt[5], 1);
6702 orntNew[5] = ornt[5];
6703 ierr = DMPlexSetCone(rdm, newp+4, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6703,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6704 ierr = DMPlexSetConeOrientation(rdm, newp+4, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6704,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6705#if defined(PETSC_USE_DEBUG1)
6706 if ((newp+4 < cStartNew) || (newp+4 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+4, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6706,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+4,cStartNew,cEndNew)
;
6707 for (p = 0; p < 6; ++p) {
6708 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6708,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
6709 }
6710#endif
6711 /* F hex */
6712 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 9; /* DF */
6713 orntNew[0] = -4;
6714 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], 1);
6715 orntNew[1] = ornt[1];
6716 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetQuadSubface_Static(ornt[2], 2);
6717 orntNew[2] = ornt[2];
6718 coneNew[3] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 5; /* FG */
6719 orntNew[3] = -1;
6720 coneNew[4] = fStartNew + (cone[4] - fStart)*4 + GetQuadSubface_Static(ornt[4], 3);
6721 orntNew[4] = ornt[4];
6722 coneNew[5] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 4; /* EF */
6723 orntNew[5] = 1;
6724 ierr = DMPlexSetCone(rdm, newp+5, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6724,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6725 ierr = DMPlexSetConeOrientation(rdm, newp+5, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6725,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6726#if defined(PETSC_USE_DEBUG1)
6727 if ((newp+5 < cStartNew) || (newp+5 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+5, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6727,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+5,cStartNew,cEndNew)
;
6728 for (p = 0; p < 6; ++p) {
6729 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6729,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
6730 }
6731#endif
6732 /* G hex */
6733 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 10; /* CG */
6734 orntNew[0] = -4;
6735 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], 2);
6736 orntNew[1] = ornt[1];
6737 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 5; /* FG */
6738 orntNew[2] = 0;
6739 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetQuadSubface_Static(ornt[3], 3);
6740 orntNew[3] = ornt[3];
6741 coneNew[4] = fStartNew + (cone[4] - fStart)*4 + GetQuadSubface_Static(ornt[4], 2);
6742 orntNew[4] = ornt[4];
6743 coneNew[5] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 6; /* GH */
6744 orntNew[5] = -3;
6745 ierr = DMPlexSetCone(rdm, newp+6, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6745,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6746 ierr = DMPlexSetConeOrientation(rdm, newp+6, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6746,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6747#if defined(PETSC_USE_DEBUG1)
6748 if ((newp+6 < cStartNew) || (newp+6 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+6, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6748,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+6,cStartNew,cEndNew)
;
6749 for (p = 0; p < 6; ++p) {
6750 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6750,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
6751 }
6752#endif
6753 /* H hex */
6754 coneNew[0] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 11; /* BH */
6755 orntNew[0] = -4;
6756 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], 3);
6757 orntNew[1] = ornt[1];
6758 coneNew[2] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 7; /* EH */
6759 orntNew[2] = -1;
6760 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetQuadSubface_Static(ornt[3], 2);
6761 orntNew[3] = ornt[3];
6762 coneNew[4] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 6; /* GH */
6763 orntNew[4] = 3;
6764 coneNew[5] = fStartNew + (cone[5] - fStart)*4 + GetQuadSubface_Static(ornt[5], 2);
6765 orntNew[5] = ornt[5];
6766 ierr = DMPlexSetCone(rdm, newp+7, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6766,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6767 ierr = DMPlexSetConeOrientation(rdm, newp+7, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6767,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6768#if defined(PETSC_USE_DEBUG1)
6769 if ((newp+7 < cStartNew) || (newp+7 >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+7, cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6769,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+7,cStartNew,cEndNew)
;
6770 for (p = 0; p < 6; ++p) {
6771 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6771,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fEndNew)
;
6772 }
6773#endif
6774 }
6775 /* Split faces have 4 edges and the same cells as the parent */
6776 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6776,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6777 ierr = PetscMalloc1(4 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,6777,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6777,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6778 for (f = fStart; f < fEnd; ++f) {
6779 for (r = 0; r < 4; ++r) {
6780 /* TODO: This can come from GetFaces_Internal() */
6781 const PetscInt newCells[24] = {0, 1, 2, 3, 4, 5, 6, 7, 0, 3, 5, 4, 2, 1, 7, 6, 3, 2, 6, 5, 0, 4, 7, 1};
6782 const PetscInt newp = fStartNew + (f - fStart)*4 + r;
6783 const PetscInt *cone, *ornt, *support;
6784 PetscInt coneNew[4], orntNew[4], coneSize, c, supportSize, s;
6785
6786 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6786,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6787 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6787,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6788 coneNew[(r+3)%4] = eStartNew + (cone[(r+3)%4] - eStart)*2 + (ornt[(r+3)%4] < 0 ? 0 : 1);
6789 orntNew[(r+3)%4] = ornt[(r+3)%4];
6790 coneNew[(r+0)%4] = eStartNew + (cone[r] - eStart)*2 + (ornt[r] < 0 ? 1 : 0);
6791 orntNew[(r+0)%4] = ornt[r];
6792 coneNew[(r+1)%4] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*4 + r;
6793 orntNew[(r+1)%4] = 0;
6794 coneNew[(r+2)%4] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*4 + (r+3)%4;
6795 orntNew[(r+2)%4] = -2;
6796 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6796,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6797 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6797,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6798#if defined(PETSC_USE_DEBUG1)
6799 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6799,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6800 for (p = 0; p < 4; ++p) {
6801 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6801,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6802 }
6803#endif
6804 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6804,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6805 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6805,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6806 for (s = 0; s < supportSize; ++s) {
6807 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6807,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6808 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6808,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6809 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6809,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6810 for (c = 0; c < coneSize; ++c) {
6811 if (cone[c] == f) break;
6812 }
6813 supportRef[s] = cStartNew + (support[s] - cStart)*8 + newCells[c*4+GetQuadSubfaceInverse_Static(ornt[c], r)];
6814 }
6815 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6815,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6816#if defined(PETSC_USE_DEBUG1)
6817 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6817,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6818 for (p = 0; p < supportSize; ++p) {
6819 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),6819,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
6820 }
6821#endif
6822 }
6823 }
6824 /* Interior faces have 4 edges and 2 cells */
6825 for (c = cStart; c < cEnd; ++c) {
6826 const PetscInt newCells[24] = {0, 3, 2, 3, 1, 2, 0, 1, 4, 5, 5, 6, 6, 7, 4, 7, 0, 4, 3, 5, 2, 6, 1, 7};
6827 const PetscInt *cone, *ornt;
6828 PetscInt newp, coneNew[4], orntNew[4], supportNew[2];
6829
6830 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6830,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6831 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6831,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6832 /* A-D face */
6833 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 0;
6834 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*4 + GetQuadEdge_Static(ornt[0], 3);
6835 orntNew[0] = 0;
6836 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 0;
6837 orntNew[1] = 0;
6838 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 2;
6839 orntNew[2] = -2;
6840 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*4 + GetQuadEdge_Static(ornt[2], 0);
6841 orntNew[3] = -2;
6842 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6842,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6843 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6843,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6844#if defined(PETSC_USE_DEBUG1)
6845 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6845,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6846 for (p = 0; p < 4; ++p) {
6847 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6847,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6848 }
6849#endif
6850 /* C-D face */
6851 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 1;
6852 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*4 + GetQuadEdge_Static(ornt[0], 2);
6853 orntNew[0] = 0;
6854 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 0;
6855 orntNew[1] = 0;
6856 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 4;
6857 orntNew[2] = -2;
6858 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[4] - fStart)*4 + GetQuadEdge_Static(ornt[4], 0);
6859 orntNew[3] = -2;
6860 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6860,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6861 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6861,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6862#if defined(PETSC_USE_DEBUG1)
6863 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6863,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6864 for (p = 0; p < 4; ++p) {
6865 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6865,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6866 }
6867#endif
6868 /* B-C face */
6869 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 2;
6870 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*4 + GetQuadEdge_Static(ornt[0], 1);
6871 orntNew[0] = -2;
6872 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*4 + GetQuadEdge_Static(ornt[3], 0);
6873 orntNew[1] = 0;
6874 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 3;
6875 orntNew[2] = 0;
6876 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 0;
6877 orntNew[3] = -2;
6878 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6878,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6879 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6879,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6880#if defined(PETSC_USE_DEBUG1)
6881 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6881,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6882 for (p = 0; p < 4; ++p) {
6883 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6883,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6884 }
6885#endif
6886 /* A-B face */
6887 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 3;
6888 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[0] - fStart)*4 + GetQuadEdge_Static(ornt[0], 0);
6889 orntNew[0] = -2;
6890 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[5] - fStart)*4 + GetQuadEdge_Static(ornt[5], 3);
6891 orntNew[1] = 0;
6892 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 5;
6893 orntNew[2] = 0;
6894 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 0;
6895 orntNew[3] = -2;
6896 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6896,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6897 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6897,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6898#if defined(PETSC_USE_DEBUG1)
6899 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6899,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6900 for (p = 0; p < 4; ++p) {
6901 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6901,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6902 }
6903#endif
6904 /* E-F face */
6905 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 4;
6906 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 2;
6907 orntNew[0] = -2;
6908 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*4 + GetQuadEdge_Static(ornt[2], 2);
6909 orntNew[1] = -2;
6910 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*4 + GetQuadEdge_Static(ornt[1], 0);
6911 orntNew[2] = 0;
6912 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 1;
6913 orntNew[3] = 0;
6914 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6914,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6915 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6915,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6916#if defined(PETSC_USE_DEBUG1)
6917 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6917,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6918 for (p = 0; p < 4; ++p) {
6919 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6920 }
6921#endif
6922 /* F-G face */
6923 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 5;
6924 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 4;
6925 orntNew[0] = -2;
6926 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[4] - fStart)*4 + GetQuadEdge_Static(ornt[4], 2);
6927 orntNew[1] = -2;
6928 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*4 + GetQuadEdge_Static(ornt[1], 1);
6929 orntNew[2] = 0;
6930 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 1;
6931 orntNew[3] = 0;
6932 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6932,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6933 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6933,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6934#if defined(PETSC_USE_DEBUG1)
6935 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6935,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6936 for (p = 0; p < 4; ++p) {
6937 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6937,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6938 }
6939#endif
6940 /* G-H face */
6941 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 6;
6942 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*4 + GetQuadEdge_Static(ornt[3], 2);
6943 orntNew[0] = -2;
6944 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*4 + GetQuadEdge_Static(ornt[1], 2);
6945 orntNew[1] = 0;
6946 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 1;
6947 orntNew[2] = 0;
6948 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 3;
6949 orntNew[3] = -2;
6950 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6950,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6951 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6951,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6952#if defined(PETSC_USE_DEBUG1)
6953 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6953,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6954 for (p = 0; p < 4; ++p) {
6955 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6955,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6956 }
6957#endif
6958 /* E-H face */
6959 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 7;
6960 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 5;
6961 orntNew[0] = -2;
6962 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[5] - fStart)*4 + GetQuadEdge_Static(ornt[5], 1);
6963 orntNew[1] = -2;
6964 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[1] - fStart)*4 + GetQuadEdge_Static(ornt[1], 3);
6965 orntNew[2] = 0;
6966 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 1;
6967 orntNew[3] = 0;
6968 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6968,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6969 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6969,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6970#if defined(PETSC_USE_DEBUG1)
6971 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6971,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6972 for (p = 0; p < 4; ++p) {
6973 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6973,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6974 }
6975#endif
6976 /* A-E face */
6977 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 8;
6978 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*4 + GetQuadEdge_Static(ornt[2], 3);
6979 orntNew[0] = 0;
6980 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 2;
6981 orntNew[1] = 0;
6982 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 5;
6983 orntNew[2] = -2;
6984 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[5] - fStart)*4 + GetQuadEdge_Static(ornt[5], 0);
6985 orntNew[3] = -2;
6986 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6986,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6987 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),6987,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
6988#if defined(PETSC_USE_DEBUG1)
6989 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),6989,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
6990 for (p = 0; p < 4; ++p) {
6991 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),6991,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
6992 }
6993#endif
6994 /* D-F face */
6995 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 9;
6996 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (cone[2] - fStart)*4 + GetQuadEdge_Static(ornt[2], 1);
6997 orntNew[0] = -2;
6998 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[4] - fStart)*4 + GetQuadEdge_Static(ornt[4], 3);
6999 orntNew[1] = 0;
7000 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 4;
7001 orntNew[2] = 0;
7002 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 2;
7003 orntNew[3] = -2;
7004 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7004,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7005 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7005,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7006#if defined(PETSC_USE_DEBUG1)
7007 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7007,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
7008 for (p = 0; p < 4; ++p) {
7009 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7009,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
7010 }
7011#endif
7012 /* C-G face */
7013 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 10;
7014 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 4;
7015 orntNew[0] = -2;
7016 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (cone[4] - fStart)*4 + GetQuadEdge_Static(ornt[4], 1);
7017 orntNew[1] = -2;
7018 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*4 + GetQuadEdge_Static(ornt[3], 3);
7019 orntNew[2] = 0;
7020 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 3;
7021 orntNew[3] = 0;
7022 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7022,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7023 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7023,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7024#if defined(PETSC_USE_DEBUG1)
7025 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7025,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
7026 for (p = 0; p < 4; ++p) {
7027 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7027,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
7028 }
7029#endif
7030 /* B-H face */
7031 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + 11;
7032 coneNew[0] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 5;
7033 orntNew[0] = 0;
7034 coneNew[1] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + 3;
7035 orntNew[1] = -2;
7036 coneNew[2] = eStartNew + (eEnd - eStart)*2 + (cone[3] - fStart)*4 + GetQuadEdge_Static(ornt[3], 1);
7037 orntNew[2] = -2;
7038 coneNew[3] = eStartNew + (eEnd - eStart)*2 + (cone[5] - fStart)*4 + GetQuadEdge_Static(ornt[5], 2);
7039 orntNew[3] = 0;
7040 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7040,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7041 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7041,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7042#if defined(PETSC_USE_DEBUG1)
7043 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7043,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
7044 for (p = 0; p < 4; ++p) {
7045 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7045,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eEndNew)
;
7046 }
7047#endif
7048 for (r = 0; r < 12; ++r) {
7049 newp = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + r;
7050 supportNew[0] = cStartNew + (c - cStart)*8 + newCells[r*2+0];
7051 supportNew[1] = cStartNew + (c - cStart)*8 + newCells[r*2+1];
7052 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7052,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7053#if defined(PETSC_USE_DEBUG1)
7054 if ((newp < fStartNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7054,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fEndNew)
;
7055 for (p = 0; p < 2; ++p) {
7056 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),7056,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cEndNew)
;
7057 }
7058#endif
7059 }
7060 }
7061 /* Split edges have 2 vertices and the same faces as the parent */
7062 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7062,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7063 for (e = eStart; e < eEnd; ++e) {
7064 const PetscInt newv = vStartNew + (vEnd - vStart) + (e - eStart);
7065
7066 for (r = 0; r < 2; ++r) {
7067 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
7068 const PetscInt *cone, *ornt, *support;
7069 PetscInt coneNew[2], coneSize, c, supportSize, s;
7070
7071 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7071,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7072 coneNew[0] = vStartNew + (cone[0] - vStart);
7073 coneNew[1] = vStartNew + (cone[1] - vStart);
7074 coneNew[(r+1)%2] = newv;
7075 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7075,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7076#if defined(PETSC_USE_DEBUG1)
7077 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7077,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
7078 for (p = 0; p < 2; ++p) {
7079 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),7079,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
7080 }
7081#endif
7082 ierr = DMPlexGetSupportSize(dm, e, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7082,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7083 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7083,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7084 for (s = 0; s < supportSize; ++s) {
7085 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7085,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7086 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7086,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7087 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7087,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7088 for (c = 0; c < coneSize; ++c) {
7089 if (cone[c] == e) break;
7090 }
7091 supportRef[s] = fStartNew + (support[s] - fStart)*4 + (ornt[c] < 0 ? (c+1-r)%4 : (c+r)%4);
7092 }
7093 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7093,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7094#if defined(PETSC_USE_DEBUG1)
7095 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7095,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
7096 for (p = 0; p < supportSize; ++p) {
7097 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7097,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
7098 }
7099#endif
7100 }
7101 }
7102 /* Face edges have 2 vertices and 2+cells faces */
7103 for (f = fStart; f < fEnd; ++f) {
7104 const PetscInt newFaces[24] = {3, 2, 1, 0, 4, 5, 6, 7, 0, 9, 4, 8, 2, 11, 6, 10, 1, 10, 5, 9, 8, 7, 11, 3};
7105 const PetscInt newv = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (f - fStart);
7106 const PetscInt *cone, *coneCell, *orntCell, *support;
7107 PetscInt coneNew[2], coneSize, c, supportSize, s;
7108
7109 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7109,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7110 for (r = 0; r < 4; ++r) {
7111 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (f - fStart)*4 + r;
7112
7113 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - eStart);
7114 coneNew[1] = newv;
7115 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7115,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7116#if defined(PETSC_USE_DEBUG1)
7117 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7117,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
7118 for (p = 0; p < 2; ++p) {
7119 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),7119,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
7120 }
7121#endif
7122 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7122,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7123 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7123,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7124 supportRef[0] = fStartNew + (f - fStart)*4 + r;
7125 supportRef[1] = fStartNew + (f - fStart)*4 + (r+1)%4;
7126 for (s = 0; s < supportSize; ++s) {
7127 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7127,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7128 ierr = DMPlexGetCone(dm, support[s], &coneCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7128,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7129 ierr = DMPlexGetConeOrientation(dm, support[s], &orntCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7129,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7130 for (c = 0; c < coneSize; ++c) if (coneCell[c] == f) break;
7131 supportRef[2+s] = fStartNew + (fEnd - fStart)*4 + (support[s] - cStart)*12 + newFaces[c*4 + GetQuadEdgeInverse_Static(orntCell[c], r)];
7132 }
7133 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7133,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7134#if defined(PETSC_USE_DEBUG1)
7135 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7135,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
7136 for (p = 0; p < 2+supportSize; ++p) {
7137 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7137,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
7138 }
7139#endif
7140 }
7141 }
7142 /* Cell edges have 2 vertices and 4 faces */
7143 for (c = cStart; c < cEnd; ++c) {
7144 const PetscInt newFaces[24] = {0, 1, 2, 3, 4, 5, 6, 7, 0, 9, 4, 8, 2, 11, 6, 10, 1, 10, 5, 9, 3, 8, 7, 11};
7145 const PetscInt newv = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (fEnd - fStart) + (c - cStart);
7146 const PetscInt *cone;
7147 PetscInt coneNew[2], supportNew[4];
7148
7149 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7149,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7150 for (r = 0; r < 6; ++r) {
7151 const PetscInt newp = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + r;
7152
7153 coneNew[0] = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (cone[r] - fStart);
7154 coneNew[1] = newv;
7155 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7155,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7156#if defined(PETSC_USE_DEBUG1)
7157 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7157,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
7158 for (p = 0; p < 2; ++p) {
7159 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),7159,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
7160 }
7161#endif
7162 for (f = 0; f < 4; ++f) supportNew[f] = fStartNew + (fEnd - fStart)*4 + (c - cStart)*12 + newFaces[r*4+f];
7163 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7163,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7164#if defined(PETSC_USE_DEBUG1)
7165 if ((newp < eStartNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7165,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eEndNew)
;
7166 for (p = 0; p < 4; ++p) {
7167 if ((supportNew[p] < fStartNew) || (supportNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportNew[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7167,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportNew
[p],fStartNew,fEndNew)
;
7168 }
7169#endif
7170 }
7171 }
7172 /* Old vertices have identical supports */
7173 for (v = vStart; v < vEnd; ++v) {
7174 const PetscInt newp = vStartNew + (v - vStart);
7175 const PetscInt *support, *cone;
7176 PetscInt size, s;
7177
7178 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7178,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7179 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7179,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7180 for (s = 0; s < size; ++s) {
7181 PetscInt r = 0;
7182
7183 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7183,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7184 if (cone[1] == v) r = 1;
7185 supportRef[s] = eStartNew + (support[s] - eStart)*2 + r;
7186 }
7187 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7187,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7188#if defined(PETSC_USE_DEBUG1)
7189 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),7189,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
7190 for (p = 0; p < size; ++p) {
7191 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7191,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
7192 }
7193#endif
7194 }
7195 /* Edge vertices have 2 + faces supports */
7196 for (e = eStart; e < eEnd; ++e) {
7197 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
7198 const PetscInt *cone, *support;
7199 PetscInt size, s;
7200
7201 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7201,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7202 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7202,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7203 supportRef[0] = eStartNew + (e - eStart)*2 + 0;
7204 supportRef[1] = eStartNew + (e - eStart)*2 + 1;
7205 for (s = 0; s < size; ++s) {
7206 PetscInt r;
7207
7208 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7208,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7209 for (r = 0; r < 4; ++r) if (cone[r] == e) break;
7210 supportRef[2+s] = eStartNew + (eEnd - eStart)*2 + (support[s] - fStart)*4 + r;
7211 }
7212 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7212,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7213#if defined(PETSC_USE_DEBUG1)
7214 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),7214,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
7215 for (p = 0; p < 2+size; ++p) {
7216 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7216,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
7217 }
7218#endif
7219 }
7220 /* Face vertices have 4 + cells supports */
7221 for (f = fStart; f < fEnd; ++f) {
7222 const PetscInt newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (f - fStart);
7223 const PetscInt *cone, *support;
7224 PetscInt size, s;
7225
7226 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7226,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7227 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7227,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7228 for (r = 0; r < 4; ++r) supportRef[r] = eStartNew + (eEnd - eStart)*2 + (f - fStart)*4 + r;
7229 for (s = 0; s < size; ++s) {
7230 PetscInt r;
7231
7232 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7232,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7233 for (r = 0; r < 6; ++r) if (cone[r] == f) break;
7234 supportRef[4+s] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (support[s] - cStart)*6 + r;
7235 }
7236 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7236,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7237#if defined(PETSC_USE_DEBUG1)
7238 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),7238,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
7239 for (p = 0; p < 4+size; ++p) {
7240 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7240,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
7241 }
7242#endif
7243 }
7244 /* Cell vertices have 6 supports */
7245 for (c = cStart; c < cEnd; ++c) {
7246 const PetscInt newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (fEnd - fStart) + (c - cStart);
7247 PetscInt supportNew[6];
7248
7249 for (r = 0; r < 6; ++r) {
7250 supportNew[r] = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (c - cStart)*6 + r;
7251 }
7252 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7252,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7253 }
7254 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),7254,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7254,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7255 break;
7256 case REFINER_HYBRID_HEX_3D:
7257 ierr = DMPlexGetHybridBounds(rdm, &cMaxNew, &fMaxNew, &eMaxNew, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7257,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7258 /*
7259 Bottom (viewed from top) Top
7260 1---------2---------2 7---------2---------6
7261 | | | | | |
7262 | B 2 C | | H 2 G |
7263 | | | | | |
7264 3----3----0----1----1 3----3----0----1----1
7265 | | | | | |
7266 | A 0 D | | E 0 F |
7267 | | | | | |
7268 0---------0---------3 4---------0---------5
7269 */
7270 /* Interior cells have 6 faces: Bottom, Top, Front, Back, Right, Left */
7271 for (c = cStart; c < cMax; ++c) {
7272 const PetscInt newp = (c - cStart)*8;
7273 const PetscInt *cone, *ornt;
7274 PetscInt coneNew[6], orntNew[6];
7275
7276 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7276,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7277 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7277,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7278 /* A hex */
7279 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], 0);
7280 orntNew[0] = ornt[0];
7281 coneNew[1] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 8; /* AE */
7282 orntNew[1] = 0;
7283 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetQuadSubface_Static(ornt[2], 0);
7284 orntNew[2] = ornt[2];
7285 coneNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 3; /* AB */
7286 orntNew[3] = 0;
7287 coneNew[4] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 0; /* AD */
7288 orntNew[4] = 0;
7289 coneNew[5] = fStartNew + (cone[5] - fStart)*4 + GetQuadSubface_Static(ornt[5], 0);
7290 orntNew[5] = ornt[5];
7291 ierr = DMPlexSetCone(rdm, newp+0, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7291,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7292 ierr = DMPlexSetConeOrientation(rdm, newp+0, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7292,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7293#if defined(PETSC_USE_DEBUG1)
7294 if ((newp+0 < cStartNew) || (newp+0 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+0, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7294,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+0,cStartNew,cMaxNew)
;
7295 for (p = 0; p < 6; ++p) {
7296 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7296,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7297 }
7298#endif
7299 /* B hex */
7300 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], 1);
7301 orntNew[0] = ornt[0];
7302 coneNew[1] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 11; /* BH */
7303 orntNew[1] = 0;
7304 coneNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 3; /* AB */
7305 orntNew[2] = -1;
7306 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetQuadSubface_Static(ornt[3], 1);
7307 orntNew[3] = ornt[3];
7308 coneNew[4] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 2; /* BC */
7309 orntNew[4] = 0;
7310 coneNew[5] = fStartNew + (cone[5] - fStart)*4 + GetQuadSubface_Static(ornt[5], 3);
7311 orntNew[5] = ornt[5];
7312 ierr = DMPlexSetCone(rdm, newp+1, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7313 ierr = DMPlexSetConeOrientation(rdm, newp+1, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7313,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7314#if defined(PETSC_USE_DEBUG1)
7315 if ((newp+1 < cStartNew) || (newp+1 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+1, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7315,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+1,cStartNew,cMaxNew)
;
7316 for (p = 0; p < 6; ++p) {
7317 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7317,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7318 }
7319#endif
7320 /* C hex */
7321 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], 2);
7322 orntNew[0] = ornt[0];
7323 coneNew[1] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 10; /* CG */
7324 orntNew[1] = 0;
7325 coneNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 1; /* CD */
7326 orntNew[2] = -1;
7327 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetQuadSubface_Static(ornt[3], 0);
7328 orntNew[3] = ornt[3];
7329 coneNew[4] = fStartNew + (cone[4] - fStart)*4 + GetQuadSubface_Static(ornt[4], 1);
7330 orntNew[4] = ornt[4];
7331 coneNew[5] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 2; /* BC */
7332 orntNew[5] = -4;
7333 ierr = DMPlexSetCone(rdm, newp+2, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7333,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7334 ierr = DMPlexSetConeOrientation(rdm, newp+2, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7334,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7335#if defined(PETSC_USE_DEBUG1)
7336 if ((newp+2 < cStartNew) || (newp+2 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+2, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7336,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+2,cStartNew,cMaxNew)
;
7337 for (p = 0; p < 6; ++p) {
7338 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7338,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7339 }
7340#endif
7341 /* D hex */
7342 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], 3);
7343 orntNew[0] = ornt[0];
7344 coneNew[1] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 9; /* DF */
7345 orntNew[1] = 0;
7346 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetQuadSubface_Static(ornt[2], 1);
7347 orntNew[2] = ornt[2];
7348 coneNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 1; /* CD */
7349 orntNew[3] = 0;
7350 coneNew[4] = fStartNew + (cone[4] - fStart)*4 + GetQuadSubface_Static(ornt[4], 0);
7351 orntNew[4] = ornt[4];
7352 coneNew[5] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 0; /* AD */
7353 orntNew[5] = -4;
7354 ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7354,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7355 ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7355,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7356#if defined(PETSC_USE_DEBUG1)
7357 if ((newp+3 < cStartNew) || (newp+3 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+3, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7357,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+3,cStartNew,cMaxNew)
;
7358 for (p = 0; p < 6; ++p) {
7359 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7359,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7360 }
7361#endif
7362 /* E hex */
7363 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 8; /* AE */
7364 orntNew[0] = -4;
7365 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], 0);
7366 orntNew[1] = ornt[1];
7367 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetQuadSubface_Static(ornt[2], 3);
7368 orntNew[2] = ornt[2];
7369 coneNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 7; /* EH */
7370 orntNew[3] = 0;
7371 coneNew[4] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 4; /* EF */
7372 orntNew[4] = -1;
7373 coneNew[5] = fStartNew + (cone[5] - fStart)*4 + GetQuadSubface_Static(ornt[5], 1);
7374 orntNew[5] = ornt[5];
7375 ierr = DMPlexSetCone(rdm, newp+4, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7375,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7376 ierr = DMPlexSetConeOrientation(rdm, newp+4, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7376,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7377#if defined(PETSC_USE_DEBUG1)
7378 if ((newp+4 < cStartNew) || (newp+4 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+4, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7378,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+4,cStartNew,cMaxNew)
;
7379 for (p = 0; p < 6; ++p) {
7380 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7380,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7381 }
7382#endif
7383 /* F hex */
7384 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 9; /* DF */
7385 orntNew[0] = -4;
7386 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], 1);
7387 orntNew[1] = ornt[1];
7388 coneNew[2] = fStartNew + (cone[2] - fStart)*4 + GetQuadSubface_Static(ornt[2], 2);
7389 orntNew[2] = ornt[2];
7390 coneNew[3] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 5; /* FG */
7391 orntNew[3] = -1;
7392 coneNew[4] = fStartNew + (cone[4] - fStart)*4 + GetQuadSubface_Static(ornt[4], 3);
7393 orntNew[4] = ornt[4];
7394 coneNew[5] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 4; /* EF */
7395 orntNew[5] = 1;
7396 ierr = DMPlexSetCone(rdm, newp+5, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7396,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7397 ierr = DMPlexSetConeOrientation(rdm, newp+5, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7397,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7398#if defined(PETSC_USE_DEBUG1)
7399 if ((newp+5 < cStartNew) || (newp+5 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+5, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7399,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+5,cStartNew,cMaxNew)
;
7400 for (p = 0; p < 6; ++p) {
7401 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7401,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7402 }
7403#endif
7404 /* G hex */
7405 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 10; /* CG */
7406 orntNew[0] = -4;
7407 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], 2);
7408 orntNew[1] = ornt[1];
7409 coneNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 5; /* FG */
7410 orntNew[2] = 0;
7411 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetQuadSubface_Static(ornt[3], 3);
7412 orntNew[3] = ornt[3];
7413 coneNew[4] = fStartNew + (cone[4] - fStart)*4 + GetQuadSubface_Static(ornt[4], 2);
7414 orntNew[4] = ornt[4];
7415 coneNew[5] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 6; /* GH */
7416 orntNew[5] = -3;
7417 ierr = DMPlexSetCone(rdm, newp+6, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7417,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7418 ierr = DMPlexSetConeOrientation(rdm, newp+6, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7418,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7419#if defined(PETSC_USE_DEBUG1)
7420 if ((newp+6 < cStartNew) || (newp+6 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+6, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7420,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+6,cStartNew,cMaxNew)
;
7421 for (p = 0; p < 6; ++p) {
7422 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7422,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7423 }
7424#endif
7425 /* H hex */
7426 coneNew[0] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 11; /* BH */
7427 orntNew[0] = -4;
7428 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], 3);
7429 orntNew[1] = ornt[1];
7430 coneNew[2] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 7; /* EH */
7431 orntNew[2] = -1;
7432 coneNew[3] = fStartNew + (cone[3] - fStart)*4 + GetQuadSubface_Static(ornt[3], 2);
7433 orntNew[3] = ornt[3];
7434 coneNew[4] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 6; /* GH */
7435 orntNew[4] = 3;
7436 coneNew[5] = fStartNew + (cone[5] - fStart)*4 + GetQuadSubface_Static(ornt[5], 2);
7437 orntNew[5] = ornt[5];
7438 ierr = DMPlexSetCone(rdm, newp+7, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7438,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7439 ierr = DMPlexSetConeOrientation(rdm, newp+7, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7439,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7440#if defined(PETSC_USE_DEBUG1)
7441 if ((newp+7 < cStartNew) || (newp+7 >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", newp+7, cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7441,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",newp
+7,cStartNew,cMaxNew)
;
7442 for (p = 0; p < 6; ++p) {
7443 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7443,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7444 }
7445#endif
7446 }
7447 /* Hybrid cells have 6 faces: Front, Back, Sides */
7448 /*
7449 3---------2---------2
7450 | | |
7451 | D 2 C |
7452 | | |
7453 3----3----0----1----1
7454 | | |
7455 | A 0 B |
7456 | | |
7457 0---------0---------1
7458 */
7459 for (c = cMax; c < cEnd; ++c) {
7460 const PetscInt newp = (cMax - cStart)*8 + (c - cMax)*4;
7461 const PetscInt *cone, *ornt, *fornt;
7462 PetscInt coneNew[6], orntNew[6], o, of, i;
7463
7464 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7464,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7465 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7465,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7466 ierr = DMPlexGetConeOrientation(dm, cone[0], &fornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7466,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7467 o = ornt[0] < 0 ? -1 : 1;
7468 for (r = 0; r < 4; ++r) {
7469 PetscInt subfA = GetQuadSubface_Static(ornt[0], r);
7470 PetscInt edgeA = GetQuadEdge_Static(ornt[0], r);
7471 PetscInt edgeB = GetQuadEdge_Static(ornt[0], (r+3)%4);
7472 if (ornt[0] != ornt[1]) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Inconsistent ordering for matching ends of hybrid cell %D: %D != %D", c, ornt[0], ornt[1])return PetscError(((MPI_Comm)0x44000001),7472,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Inconsistent ordering for matching ends of hybrid cell %D: %D != %D"
,c,ornt[0],ornt[1])
;
7473 coneNew[0] = fStartNew + (cone[0] - fStart)*4 + subfA;
7474 orntNew[0] = ornt[0];
7475 coneNew[1] = fStartNew + (cone[1] - fStart)*4 + subfA;
7476 orntNew[1] = ornt[0];
7477 of = fornt[edgeA] < 0 ? -1 : 1;
7478 i = GetQuadEdgeInverse_Static(ornt[0], r) + 2;
7479 coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (cone[2+edgeA] - fMax)*2 + (o*of < 0 ? 1 : 0);
7480 orntNew[i] = ornt[edgeA];
7481 i = GetQuadEdgeInverse_Static(ornt[0], (r+1)%4) + 2;
7482 coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (c - cMax)*4 + edgeA;
7483 orntNew[i] = 0;
7484 i = GetQuadEdgeInverse_Static(ornt[0], (r+2)%4) + 2;
7485 coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (c - cMax)*4 + edgeB;
7486 orntNew[i] = -2;
7487 of = fornt[edgeB] < 0 ? -1 : 1;
7488 i = GetQuadEdgeInverse_Static(ornt[0], (r+3)%4) + 2;
7489 coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (cone[2+edgeB] - fMax)*2 + (o*of < 0 ? 0 : 1);
7490 orntNew[i] = ornt[edgeB];
7491 ierr = DMPlexSetCone(rdm, newp+r, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7491,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7492 ierr = DMPlexSetConeOrientation(rdm, newp+r, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7492,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7493#if defined(PETSC_USE_DEBUG1)
7494 if ((newp+r < cMaxNew) || (newp+r >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid cell [%D, %D)", newp+r, cMaxNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),7494,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid cell [%D, %D)"
,newp+r,cMaxNew,cEndNew)
;
7495 for (p = 0; p < 2; ++p) {
7496 if ((coneNew[p] < fStartNew) || (coneNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", coneNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7496,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",coneNew
[p],fStartNew,fMaxNew)
;
7497 }
7498 for (p = 2; p < 6; ++p) {
7499 if ((coneNew[p] < fMaxNew) || (coneNew[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", coneNew[p], fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7499,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,coneNew[p],fMaxNew,fEndNew)
;
7500 }
7501#endif
7502 }
7503 }
7504 /* Interior split faces have 4 edges and the same cells as the parent */
7505 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7505,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7506 ierr = PetscMalloc1(4 + maxSupportSize*2, &supportRef)PetscMallocA(1,PETSC_FALSE,7506,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(4 + maxSupportSize*2)*sizeof(**(&supportRef)),(
&supportRef))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7506,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7507 for (f = fStart; f < fMax; ++f) {
7508 for (r = 0; r < 4; ++r) {
7509 /* TODO: This can come from GetFaces_Internal() */
7510 const PetscInt newCells[24] = {0, 1, 2, 3, 4, 5, 6, 7, 0, 3, 5, 4, 2, 1, 7, 6, 3, 2, 6, 5, 0, 4, 7, 1};
7511 const PetscInt newp = fStartNew + (f - fStart)*4 + r;
7512 const PetscInt *cone, *ornt, *support;
7513 PetscInt coneNew[4], orntNew[4], coneSize, c, supportSize, s;
7514
7515 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7515,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7516 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7516,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7517 coneNew[(r+3)%4] = eStartNew + (cone[(r+3)%4] - eStart)*2 + (ornt[(r+3)%4] < 0 ? 0 : 1);
7518 orntNew[(r+3)%4] = ornt[(r+3)%4];
7519 coneNew[(r+0)%4] = eStartNew + (cone[r] - eStart)*2 + (ornt[r] < 0 ? 1 : 0);
7520 orntNew[(r+0)%4] = ornt[r];
7521 coneNew[(r+1)%4] = eStartNew + (eMax - eStart)*2 + (f - fStart)*4 + r;
7522 orntNew[(r+1)%4] = 0;
7523 coneNew[(r+2)%4] = eStartNew + (eMax - eStart)*2 + (f - fStart)*4 + (r+3)%4;
7524 orntNew[(r+2)%4] = -2;
7525 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7525,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7526 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7526,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7527#if defined(PETSC_USE_DEBUG1)
7528 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7528,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7529 for (p = 0; p < 4; ++p) {
7530 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7530,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7531 }
7532#endif
7533 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7533,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7534 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7534,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7535 for (s = 0; s < supportSize; ++s) {
7536 PetscInt subf;
7537 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7537,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7538 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7538,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7539 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7539,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7540 for (c = 0; c < coneSize; ++c) {
7541 if (cone[c] == f) break;
7542 }
7543 subf = GetQuadSubfaceInverse_Static(ornt[c], r);
7544 if (support[s] < cMax) {
7545 supportRef[s] = cStartNew + (support[s] - cStart)*8 + newCells[c*4+subf];
7546 } else {
7547 supportRef[s] = cStartNew + (cMax - cStart)*8 + (support[s] - cMax)*4 + subf;
7548 }
7549 }
7550 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7550,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7551#if defined(PETSC_USE_DEBUG1)
7552 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7552,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7553 for (p = 0; p < supportSize; ++p) {
7554 if ((supportRef[p] < cStartNew) || (supportRef[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportRef[p], cStartNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),7554,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportRef
[p],cStartNew,cEndNew)
;
7555 }
7556#endif
7557 }
7558 }
7559 /* Interior cell faces have 4 edges and 2 cells */
7560 for (c = cStart; c < cMax; ++c) {
7561 const PetscInt newCells[24] = {0, 3, 2, 3, 1, 2, 0, 1, 4, 5, 5, 6, 6, 7, 4, 7, 0, 4, 3, 5, 2, 6, 1, 7};
7562 const PetscInt *cone, *ornt;
7563 PetscInt newp, coneNew[4], orntNew[4], supportNew[2];
7564
7565 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7565,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7566 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7566,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7567 /* A-D face */
7568 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 0;
7569 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*4 + GetQuadEdge_Static(ornt[0], 3);
7570 orntNew[0] = 0;
7571 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 0;
7572 orntNew[1] = 0;
7573 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 2;
7574 orntNew[2] = -2;
7575 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*4 + GetQuadEdge_Static(ornt[2], 0);
7576 orntNew[3] = -2;
7577 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7577,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7578 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7578,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7579#if defined(PETSC_USE_DEBUG1)
7580 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7580,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7581 for (p = 0; p < 4; ++p) {
7582 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7582,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7583 }
7584#endif
7585 /* C-D face */
7586 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 1;
7587 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*4 + GetQuadEdge_Static(ornt[0], 2);
7588 orntNew[0] = 0;
7589 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 0;
7590 orntNew[1] = 0;
7591 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 4;
7592 orntNew[2] = -2;
7593 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[4] - fStart)*4 + GetQuadEdge_Static(ornt[4], 0);
7594 orntNew[3] = -2;
7595 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7595,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7596 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7596,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7597#if defined(PETSC_USE_DEBUG1)
7598 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7598,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7599 for (p = 0; p < 4; ++p) {
7600 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7600,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7601 }
7602#endif
7603 /* B-C face */
7604 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 2;
7605 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*4 + GetQuadEdge_Static(ornt[0], 1);
7606 orntNew[0] = -2;
7607 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*4 + GetQuadEdge_Static(ornt[3], 0);
7608 orntNew[1] = 0;
7609 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 3;
7610 orntNew[2] = 0;
7611 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 0;
7612 orntNew[3] = -2;
7613 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7613,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7614 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7614,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7615#if defined(PETSC_USE_DEBUG1)
7616 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7616,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7617 for (p = 0; p < 4; ++p) {
7618 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7618,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7619 }
7620#endif
7621 /* A-B face */
7622 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 3;
7623 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*4 + GetQuadEdge_Static(ornt[0], 0);
7624 orntNew[0] = -2;
7625 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[5] - fStart)*4 + GetQuadEdge_Static(ornt[5], 3);
7626 orntNew[1] = 0;
7627 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 5;
7628 orntNew[2] = 0;
7629 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 0;
7630 orntNew[3] = -2;
7631 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7631,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7632 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7632,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7633#if defined(PETSC_USE_DEBUG1)
7634 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7634,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7635 for (p = 0; p < 4; ++p) {
7636 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7636,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7637 }
7638#endif
7639 /* E-F face */
7640 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 4;
7641 coneNew[0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 2;
7642 orntNew[0] = -2;
7643 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*4 + GetQuadEdge_Static(ornt[2], 2);
7644 orntNew[1] = -2;
7645 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*4 + GetQuadEdge_Static(ornt[1], 0);
7646 orntNew[2] = 0;
7647 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 1;
7648 orntNew[3] = 0;
7649 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7649,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7650 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7650,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7651#if defined(PETSC_USE_DEBUG1)
7652 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7652,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7653 for (p = 0; p < 4; ++p) {
7654 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7654,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7655 }
7656#endif
7657 /* F-G face */
7658 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 5;
7659 coneNew[0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 4;
7660 orntNew[0] = -2;
7661 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[4] - fStart)*4 + GetQuadEdge_Static(ornt[4], 2);
7662 orntNew[1] = -2;
7663 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*4 + GetQuadEdge_Static(ornt[1], 1);
7664 orntNew[2] = 0;
7665 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 1;
7666 orntNew[3] = 0;
7667 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7667,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7668 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7668,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7669#if defined(PETSC_USE_DEBUG1)
7670 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7670,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7671 for (p = 0; p < 4; ++p) {
7672 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7672,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7673 }
7674#endif
7675 /* G-H face */
7676 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 6;
7677 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*4 + GetQuadEdge_Static(ornt[3], 2);
7678 orntNew[0] = -2;
7679 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*4 + GetQuadEdge_Static(ornt[1], 2);
7680 orntNew[1] = 0;
7681 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 1;
7682 orntNew[2] = 0;
7683 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 3;
7684 orntNew[3] = -2;
7685 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7685,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7686 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7686,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7687#if defined(PETSC_USE_DEBUG1)
7688 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7688,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7689 for (p = 0; p < 4; ++p) {
7690 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7690,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7691 }
7692#endif
7693 /* E-H face */
7694 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 7;
7695 coneNew[0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 5;
7696 orntNew[0] = -2;
7697 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[5] - fStart)*4 + GetQuadEdge_Static(ornt[5], 1);
7698 orntNew[1] = -2;
7699 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*4 + GetQuadEdge_Static(ornt[1], 3);
7700 orntNew[2] = 0;
7701 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 1;
7702 orntNew[3] = 0;
7703 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7703,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7704 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7704,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7705#if defined(PETSC_USE_DEBUG1)
7706 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7706,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7707 for (p = 0; p < 4; ++p) {
7708 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7708,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7709 }
7710#endif
7711 /* A-E face */
7712 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 8;
7713 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*4 + GetQuadEdge_Static(ornt[2], 3);
7714 orntNew[0] = 0;
7715 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 2;
7716 orntNew[1] = 0;
7717 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 5;
7718 orntNew[2] = -2;
7719 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[5] - fStart)*4 + GetQuadEdge_Static(ornt[5], 0);
7720 orntNew[3] = -2;
7721 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7721,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7722 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7722,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7723#if defined(PETSC_USE_DEBUG1)
7724 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7724,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7725 for (p = 0; p < 4; ++p) {
7726 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7726,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7727 }
7728#endif
7729 /* D-F face */
7730 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 9;
7731 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[2] - fStart)*4 + GetQuadEdge_Static(ornt[2], 1);
7732 orntNew[0] = -2;
7733 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[4] - fStart)*4 + GetQuadEdge_Static(ornt[4], 3);
7734 orntNew[1] = 0;
7735 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 4;
7736 orntNew[2] = 0;
7737 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 2;
7738 orntNew[3] = -2;
7739 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7739,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7740 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7740,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7741#if defined(PETSC_USE_DEBUG1)
7742 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7742,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7743 for (p = 0; p < 4; ++p) {
7744 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7744,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7745 }
7746#endif
7747 /* C-G face */
7748 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 10;
7749 coneNew[0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 4;
7750 orntNew[0] = -2;
7751 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[4] - fStart)*4 + GetQuadEdge_Static(ornt[4], 1);
7752 orntNew[1] = -2;
7753 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*4 + GetQuadEdge_Static(ornt[3], 3);
7754 orntNew[2] = 0;
7755 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 3;
7756 orntNew[3] = 0;
7757 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7757,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7758 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7758,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7759#if defined(PETSC_USE_DEBUG1)
7760 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7760,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7761 for (p = 0; p < 4; ++p) {
7762 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7762,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7763 }
7764#endif
7765 /* B-H face */
7766 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + 11;
7767 coneNew[0] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 5;
7768 orntNew[0] = 0;
7769 coneNew[1] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + 3;
7770 orntNew[1] = -2;
7771 coneNew[2] = eStartNew + (eMax - eStart)*2 + (cone[3] - fStart)*4 + GetQuadEdge_Static(ornt[3], 1);
7772 orntNew[2] = -2;
7773 coneNew[3] = eStartNew + (eMax - eStart)*2 + (cone[5] - fStart)*4 + GetQuadEdge_Static(ornt[5], 2);
7774 orntNew[3] = 0;
7775 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7775,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7776 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7776,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7777#if defined(PETSC_USE_DEBUG1)
7778 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7778,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7779 for (p = 0; p < 4; ++p) {
7780 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7780,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7781 }
7782#endif
7783 for (r = 0; r < 12; ++r) {
7784 newp = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + r;
7785 supportNew[0] = cStartNew + (c - cStart)*8 + newCells[r*2+0];
7786 supportNew[1] = cStartNew + (c - cStart)*8 + newCells[r*2+1];
7787 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7787,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7788#if defined(PETSC_USE_DEBUG1)
7789 if ((newp < fStartNew) || (newp >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", newp, fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),7789,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",newp
,fStartNew,fMaxNew)
;
7790 for (p = 0; p < 2; ++p) {
7791 if ((supportNew[p] < cStartNew) || (supportNew[p] >= cMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a cell [%D, %D)", supportNew[p], cStartNew, cMaxNew)return PetscError(((MPI_Comm)0x44000001),7791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a cell [%D, %D)",supportNew
[p],cStartNew,cMaxNew)
;
7792 }
7793#endif
7794 }
7795 }
7796 /* Hybrid split faces have 4 edges and same cells */
7797 for (f = fMax; f < fEnd; ++f) {
7798 const PetscInt *cone, *ornt, *support;
7799 PetscInt coneNew[4], orntNew[4];
7800 PetscInt supportNew[2], size, s, c;
7801
7802 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7802,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7803 ierr = DMPlexGetConeOrientation(dm, f, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7803,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7804 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7804,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7805 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7805,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7806 for (r = 0; r < 2; ++r) {
7807 const PetscInt newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (f - fMax)*2 + r;
7808
7809 coneNew[0] = eStartNew + (cone[0] - eStart)*2 + (ornt[0] < 0 ? 1-r : r);
7810 orntNew[0] = ornt[0];
7811 coneNew[1] = eStartNew + (cone[1] - eStart)*2 + (ornt[1] < 0 ? 1-r : r);
7812 orntNew[1] = ornt[1];
7813 coneNew[2+r] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (cone[2+r] - eMax);
7814 orntNew[2+r] = 0;
7815 coneNew[3-r] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (f - fMax);
7816 orntNew[3-r] = 0;
7817 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7817,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7818 ierr = DMPlexSetConeOrientation(rdm, newp, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7818,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7819#if defined(PETSC_USE_DEBUG1)
7820 if ((newp < fMaxNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", newp, fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7820,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,newp,fMaxNew,fEndNew)
;
7821 for (p = 0; p < 2; ++p) {
7822 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7822,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7823 }
7824 for (p = 2; p < 4; ++p) {
7825 if ((coneNew[p] < eMaxNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", coneNew[p], eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7825,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,coneNew[p],eMaxNew,eEndNew)
;
7826 }
7827#endif
7828 for (s = 0; s < size; ++s) {
7829 const PetscInt *coneCell, *orntCell, *fornt;
7830 PetscInt o, of;
7831
7832 ierr = DMPlexGetCone(dm, support[s], &coneCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7832,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7833 ierr = DMPlexGetConeOrientation(dm, support[s], &orntCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7833,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7834 o = orntCell[0] < 0 ? -1 : 1;
7835 for (c = 2; c < 6; ++c) if (coneCell[c] == f) break;
7836 if (c >= 6) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Could not find face %D in cone of cell %D", f, support[s])return PetscError(((MPI_Comm)0x44000001),7836,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Could not find face %D in cone of cell %D"
,f,support[s])
;
7837 ierr = DMPlexGetConeOrientation(dm, coneCell[0], &fornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7837,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7838 of = fornt[c-2] < 0 ? -1 : 1;
7839 supportNew[s] = cStartNew + (cMax - cStart)*8 + (support[s] - cMax)*4 + (GetQuadEdgeInverse_Static(orntCell[0], c-2) + (o*of < 0 ? 1-r : r))%4;
7840 }
7841 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7841,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7842#if defined(PETSC_USE_DEBUG1)
7843 if ((newp < fMaxNew) || (newp >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", newp, fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7843,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,newp,fMaxNew,fEndNew)
;
7844 for (p = 0; p < size; ++p) {
7845 if ((supportNew[p] < cMaxNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid cell [%D, %D)", supportNew[p], cMaxNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),7845,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid cell [%D, %D)"
,supportNew[p],cMaxNew,cEndNew)
;
7846 }
7847#endif
7848 }
7849 }
7850 /* Hybrid cell faces have 4 edges and 2 cells */
7851 for (c = cMax; c < cEnd; ++c) {
7852 PetscInt newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (c - cMax)*4;
7853 const PetscInt *cone, *ornt;
7854 PetscInt coneNew[4], orntNew[4];
7855 PetscInt supportNew[2];
7856
7857 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7857,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7858 ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7858,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7859 for (r = 0; r < 4; ++r) {
7860#if 0
7861 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*4 + GetQuadSubface_Static(ornt[0], r);
7862 orntNew[0] = 0;
7863 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*4 + GetQuadSubface_Static(ornt[1], r);
7864 orntNew[1] = 0;
7865 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (cone[2+GetQuadEdge_Static(ornt[0], r)] - fMax);
7866 orntNew[2] = 0;
7867 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (fEnd - fMax) + (c - cMax);
7868 orntNew[3] = 0;
7869#else
7870 coneNew[0] = eStartNew + (eMax - eStart)*2 + (cone[0] - fStart)*4 + r;
7871 orntNew[0] = 0;
7872 coneNew[1] = eStartNew + (eMax - eStart)*2 + (cone[1] - fStart)*4 + r;
7873 orntNew[1] = 0;
7874 coneNew[2] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (cone[2+r] - fMax);
7875 orntNew[2] = 0;
7876 coneNew[3] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (fEnd - fMax) + (c - cMax);
7877 orntNew[3] = 0;
7878#endif
7879 ierr = DMPlexSetCone(rdm, newp+r, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7879,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7880 ierr = DMPlexSetConeOrientation(rdm, newp+r, orntNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7880,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7881#if defined(PETSC_USE_DEBUG1)
7882 if ((newp+r < fMaxNew) || (newp+r >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", newp+r, fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7882,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,newp+r,fMaxNew,fEndNew)
;
7883 for (p = 0; p < 2; ++p) {
7884 if ((coneNew[p] < eStartNew) || (coneNew[p] >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", coneNew[p], eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7884,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",coneNew
[p],eStartNew,eMaxNew)
;
7885 }
7886 for (p = 2; p < 4; ++p) {
7887 if ((coneNew[p] < eMaxNew) || (coneNew[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", coneNew[p], eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),7887,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,coneNew[p],eMaxNew,eEndNew)
;
7888 }
7889#endif
7890 supportNew[0] = cStartNew + (cMax - cStart)*8 + (c - cMax)*4 + GetQuadSubface_Static(ornt[0], r);
7891 supportNew[1] = cStartNew + (cMax - cStart)*8 + (c - cMax)*4 + GetQuadSubface_Static(ornt[0], (r+1)%4);
7892 ierr = DMPlexSetSupport(rdm, newp+r, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7892,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7893#if defined(PETSC_USE_DEBUG1)
7894 if ((newp+r < fMaxNew) || (newp+r >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", newp+r, fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7894,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,newp+r,fMaxNew,fEndNew)
;
7895 for (p = 0; p < 2; ++p) {
7896 if ((supportNew[p] < cMaxNew) || (supportNew[p] >= cEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid cell [%D, %D)", supportNew[p], cMaxNew, cEndNew)return PetscError(((MPI_Comm)0x44000001),7896,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid cell [%D, %D)"
,supportNew[p],cMaxNew,cEndNew)
;
7897 }
7898#endif
7899 }
7900 }
7901 /* Interior split edges have 2 vertices and the same faces as the parent */
7902 ierr = DMPlexGetMaxSizes(dm, NULL((void*)0), &maxSupportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7902,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7903 for (e = eStart; e < eMax; ++e) {
7904 const PetscInt newv = vStartNew + (vEnd - vStart) + (e - eStart);
7905
7906 for (r = 0; r < 2; ++r) {
7907 const PetscInt newp = eStartNew + (e - eStart)*2 + r;
7908 const PetscInt *cone, *ornt, *support;
7909 PetscInt coneNew[2], coneSize, c, supportSize, s;
7910
7911 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7911,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7912 coneNew[0] = vStartNew + (cone[0] - vStart);
7913 coneNew[1] = vStartNew + (cone[1] - vStart);
7914 coneNew[(r+1)%2] = newv;
7915 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7915,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7916#if defined(PETSC_USE_DEBUG1)
7917 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7917,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
7918 for (p = 0; p < 2; ++p) {
7919 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),7919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
7920 }
7921#endif
7922 ierr = DMPlexGetSupportSize(dm, e, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7922,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7923 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7923,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7924 for (s = 0; s < supportSize; ++s) {
7925 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7925,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7926 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7926,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7927 ierr = DMPlexGetConeOrientation(dm, support[s], &ornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7927,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7928 for (c = 0; c < coneSize; ++c) {
7929 if (cone[c] == e) break;
7930 }
7931 if (support[s] < fMax) {
7932 supportRef[s] = fStartNew + (support[s] - fStart)*4 + (c + (ornt[c] < 0 ? 1-r : r))%4;
7933 } else {
7934 supportRef[s] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (support[s] - fMax)*2 + (ornt[c] < 0 ? 1-r : r);
7935 }
7936 }
7937 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7937,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7938#if defined(PETSC_USE_DEBUG1)
7939 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7939,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
7940 for (p = 0; p < supportSize; ++p) {
7941 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7941,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
7942 }
7943#endif
7944 }
7945 }
7946 /* Interior face edges have 2 vertices and 2+cells faces */
7947 for (f = fStart; f < fMax; ++f) {
7948 const PetscInt newFaces[24] = {3, 2, 1, 0, 4, 5, 6, 7, 0, 9, 4, 8, 2, 11, 6, 10, 1, 10, 5, 9, 8, 7, 11, 3};
7949 const PetscInt newv = vStartNew + (vEnd - vStart) + (eMax - eStart) + (f - fStart);
7950 const PetscInt *cone, *coneCell, *orntCell, *support;
7951 PetscInt coneNew[2], coneSize, c, supportSize, s;
7952
7953 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7953,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7954 for (r = 0; r < 4; ++r) {
7955 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (f - fStart)*4 + r;
7956
7957 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[r] - eStart);
7958 coneNew[1] = newv;
7959 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7959,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7960#if defined(PETSC_USE_DEBUG1)
7961 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7961,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
7962 for (p = 0; p < 2; ++p) {
7963 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),7963,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
7964 }
7965#endif
7966 ierr = DMPlexGetSupportSize(dm, f, &supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7966,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7967 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7967,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7968 supportRef[0] = fStartNew + (f - fStart)*4 + r;
7969 supportRef[1] = fStartNew + (f - fStart)*4 + (r+1)%4;
7970 for (s = 0; s < supportSize; ++s) {
7971 ierr = DMPlexGetConeSize(dm, support[s], &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7971,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7972 ierr = DMPlexGetCone(dm, support[s], &coneCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7972,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7973 ierr = DMPlexGetConeOrientation(dm, support[s], &orntCell);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7973,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7974 for (c = 0; c < coneSize; ++c) if (coneCell[c] == f) break;
7975 if (support[s] < cMax) {
7976 supportRef[2+s] = fStartNew + (fMax - fStart)*4 + (support[s] - cStart)*12 + newFaces[c*4 + GetQuadEdgeInverse_Static(orntCell[c], r)];
7977 } else {
7978 supportRef[2+s] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (support[s] - cMax)*4 + r;
7979 }
7980 }
7981 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7981,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7982#if defined(PETSC_USE_DEBUG1)
7983 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),7983,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
7984 for (p = 0; p < 2+supportSize; ++p) {
7985 if ((supportRef[p] < fStartNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportRef[p], fStartNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),7985,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportRef
[p],fStartNew,fEndNew)
;
7986 }
7987#endif
7988 }
7989 }
7990 /* Interior cell edges have 2 vertices and 4 faces */
7991 for (c = cStart; c < cMax; ++c) {
7992 const PetscInt newFaces[24] = {0, 1, 2, 3, 4, 5, 6, 7, 0, 9, 4, 8, 2, 11, 6, 10, 1, 10, 5, 9, 3, 8, 7, 11};
7993 const PetscInt newv = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax - fStart) + (c - cStart);
7994 const PetscInt *cone;
7995 PetscInt coneNew[2], supportNew[4];
7996
7997 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),7997,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7998 for (r = 0; r < 6; ++r) {
7999 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + r;
8000
8001 coneNew[0] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (cone[r] - fStart);
8002 coneNew[1] = newv;
8003 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8003,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8004#if defined(PETSC_USE_DEBUG1)
8005 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),8005,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
8006 for (p = 0; p < 2; ++p) {
8007 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),8007,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
8008 }
8009#endif
8010 for (f = 0; f < 4; ++f) supportNew[f] = fStartNew + (fMax - fStart)*4 + (c - cStart)*12 + newFaces[r*4+f];
8011 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8011,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8012#if defined(PETSC_USE_DEBUG1)
8013 if ((newp < eStartNew) || (newp >= eMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", newp, eStartNew, eMaxNew)return PetscError(((MPI_Comm)0x44000001),8013,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",newp
,eStartNew,eMaxNew)
;
8014 for (p = 0; p < 4; ++p) {
8015 if ((supportNew[p] < fStartNew) || (supportNew[p] >= fMaxNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a face [%D, %D)", supportNew[p], fStartNew, fMaxNew)return PetscError(((MPI_Comm)0x44000001),8015,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a face [%D, %D)",supportNew
[p],fStartNew,fMaxNew)
;
8016 }
8017#endif
8018 }
8019 }
8020 /* Hybrid edges have two vertices and the same faces */
8021 for (e = eMax; e < eEnd; ++e) {
8022 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (e - eMax);
8023 const PetscInt *cone, *support, *fcone;
8024 PetscInt coneNew[2], size, fsize, s;
8025
8026 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8026,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8027 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8027,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8028 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8028,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8029 coneNew[0] = vStartNew + (cone[0] - vStart);
8030 coneNew[1] = vStartNew + (cone[1] - vStart);
8031 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8031,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8032#if defined(PETSC_USE_DEBUG1)
8033 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8033,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
8034 for (p = 0; p < 2; ++p) {
8035 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),8035,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
8036 }
8037#endif
8038 for (s = 0; s < size; ++s) {
8039 ierr = DMPlexGetConeSize(dm, support[s], &fsize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8039,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8040 ierr = DMPlexGetCone(dm, support[s], &fcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8040,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8041 for (c = 0; c < fsize; ++c) if (fcone[c] == e) break;
8042 if ((c < 2) || (c > 3)) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Edge %D not found in cone of face %D", e, support[s])return PetscError(((MPI_Comm)0x44000001),8042,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Edge %D not found in cone of face %D"
,e,support[s])
;
8043 supportRef[s] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (support[s] - fMax)*2 + c-2;
8044 }
8045 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8045,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8046#if defined(PETSC_USE_DEBUG1)
8047 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8047,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
8048 for (p = 0; p < size; ++p) {
8049 if ((supportRef[p] < fMaxNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", supportRef[p], fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),8049,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,supportRef[p],fMaxNew,fEndNew)
;
8050 }
8051#endif
8052 }
8053 /* Hybrid face edges have 2 vertices and 2+cells faces */
8054 for (f = fMax; f < fEnd; ++f) {
8055 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (f - fMax);
8056 const PetscInt *cone, *support, *ccone, *cornt;
8057 PetscInt coneNew[2], size, csize, s;
8058
8059 ierr = DMPlexGetCone(dm, f, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8059,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8060 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8060,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8061 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8061,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8062 coneNew[0] = vStartNew + (vEnd - vStart) + (cone[0] - eStart);
8063 coneNew[1] = vStartNew + (vEnd - vStart) + (cone[1] - eStart);
8064 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8064,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8065#if defined(PETSC_USE_DEBUG1)
8066 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8066,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
8067 for (p = 0; p < 2; ++p) {
8068 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),8068,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
8069 }
8070#endif
8071 supportRef[0] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (f - fMax)*2 + 0;
8072 supportRef[1] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (f - fMax)*2 + 1;
8073 for (s = 0; s < size; ++s) {
8074 ierr = DMPlexGetConeSize(dm, support[s], &csize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8074,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8075 ierr = DMPlexGetCone(dm, support[s], &ccone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8075,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8076 ierr = DMPlexGetConeOrientation(dm, support[s], &cornt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8076,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8077 for (c = 0; c < csize; ++c) if (ccone[c] == f) break;
8078 if ((c < 2) || (c >= csize)) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Hybrid face %D is not in cone of hybrid cell %D", f, support[s])return PetscError(((MPI_Comm)0x44000001),8078,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Hybrid face %D is not in cone of hybrid cell %D"
,f,support[s])
;
8079 supportRef[2+s] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (support[s] - cMax)*4 + c-2;
8080 }
8081 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8081,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8082#if defined(PETSC_USE_DEBUG1)
8083 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8083,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
8084 for (p = 0; p < 2+size; ++p) {
8085 if ((supportRef[p] < fMaxNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", supportRef[p], fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),8085,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,supportRef[p],fMaxNew,fEndNew)
;
8086 }
8087#endif
8088 }
8089 /* Hybrid cell edges have 2 vertices and 4 faces */
8090 for (c = cMax; c < cEnd; ++c) {
8091 const PetscInt newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (fEnd - fMax) + (c - cMax);
8092 const PetscInt *cone, *support;
8093 PetscInt coneNew[2], size;
8094
8095 ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8095,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8096 ierr = DMPlexGetSupportSize(dm, c, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8096,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8097 ierr = DMPlexGetSupport(dm, c, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8097,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8098 coneNew[0] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (cone[0] - fStart);
8099 coneNew[1] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (cone[1] - fStart);
8100 ierr = DMPlexSetCone(rdm, newp, coneNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8100,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8101#if defined(PETSC_USE_DEBUG1)
8102 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8102,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
8103 for (p = 0; p < 2; ++p) {
8104 if ((coneNew[p] < vStartNew) || (coneNew[p] >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", coneNew[p], vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),8104,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",coneNew
[p],vStartNew,vEndNew)
;
8105 }
8106#endif
8107 supportRef[0] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (c - cMax)*4 + 0;
8108 supportRef[1] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (c - cMax)*4 + 1;
8109 supportRef[2] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (c - cMax)*4 + 2;
8110 supportRef[3] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (c - cMax)*4 + 3;
8111 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8111,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8112#if defined(PETSC_USE_DEBUG1)
8113 if ((newp < eMaxNew) || (newp >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid edge [%D, %D)", newp, eMaxNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8113,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid edge [%D, %D)"
,newp,eMaxNew,eEndNew)
;
8114 for (p = 0; p < 4; ++p) {
8115 if ((supportRef[p] < fMaxNew) || (supportRef[p] >= fEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a hybrid face [%D, %D)", supportRef[p], fMaxNew, fEndNew)return PetscError(((MPI_Comm)0x44000001),8115,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a hybrid face [%D, %D)"
,supportRef[p],fMaxNew,fEndNew)
;
8116 }
8117#endif
8118 }
8119 /* Interior vertices have identical supports */
8120 for (v = vStart; v < vEnd; ++v) {
8121 const PetscInt newp = vStartNew + (v - vStart);
8122 const PetscInt *support, *cone;
8123 PetscInt size, s;
8124
8125 ierr = DMPlexGetSupportSize(dm, v, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8125,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8126 ierr = DMPlexGetSupport(dm, v, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8126,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8127 for (s = 0; s < size; ++s) {
8128 PetscInt r = 0;
8129
8130 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8130,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8131 if (cone[1] == v) r = 1;
8132 if (support[s] < eMax) supportRef[s] = eStartNew + (support[s] - eStart)*2 + r;
8133 else supportRef[s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (support[s] - eMax);
8134 }
8135 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8135,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8136#if defined(PETSC_USE_DEBUG1)
8137 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),8137,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
8138 for (p = 0; p < size; ++p) {
8139 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8139,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
8140 }
8141#endif
8142 }
8143 /* Interior edge vertices have 2 + faces supports */
8144 for (e = eStart; e < eMax; ++e) {
8145 const PetscInt newp = vStartNew + (vEnd - vStart) + (e - eStart);
8146 const PetscInt *cone, *support;
8147 PetscInt size, s;
8148
8149 ierr = DMPlexGetSupportSize(dm, e, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8149,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8150 ierr = DMPlexGetSupport(dm, e, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8150,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8151 supportRef[0] = eStartNew + (e - eStart)*2 + 0;
8152 supportRef[1] = eStartNew + (e - eStart)*2 + 1;
8153 for (s = 0; s < size; ++s) {
8154 PetscInt r;
8155
8156 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8156,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8157 for (r = 0; r < 4; ++r) if (cone[r] == e) break;
8158 if (support[s] < fMax) {
8159 supportRef[2+s] = eStartNew + (eMax - eStart)*2 + (support[s] - fStart)*4 + r;
8160 } else {
8161 supportRef[2+s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (support[s] - fMax);
8162 }
8163 }
8164 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8164,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8165#if defined(PETSC_USE_DEBUG1)
8166 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),8166,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
8167 for (p = 0; p < 2+size; ++p) {
8168 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8168,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
8169 }
8170#endif
8171 }
8172 /* Interior face vertices have 4 + cells supports */
8173 for (f = fStart; f < fMax; ++f) {
8174 const PetscInt newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (f - fStart);
8175 const PetscInt *cone, *support;
8176 PetscInt size, s;
8177
8178 ierr = DMPlexGetSupportSize(dm, f, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8178,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8179 ierr = DMPlexGetSupport(dm, f, &support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8179,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8180 for (r = 0; r < 4; ++r) supportRef[r] = eStartNew + (eMax - eStart)*2 + (f - fStart)*4 + r;
8181 for (s = 0; s < size; ++s) {
8182 PetscInt r;
8183
8184 ierr = DMPlexGetCone(dm, support[s], &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8184,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8185 for (r = 0; r < 6; ++r) if (cone[r] == f) break;
8186 if (support[s] < cMax) {
8187 supportRef[4+s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (support[s] - cStart)*6 + r;
8188 } else {
8189 supportRef[4+s] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (fEnd - fMax) + (support[s] - cMax);
8190 }
8191 }
8192 ierr = DMPlexSetSupport(rdm, newp, supportRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8192,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8193#if defined(PETSC_USE_DEBUG1)
8194 if ((newp < vStartNew) || (newp >= vEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not a vertex [%D, %D)", newp, vStartNew, vEndNew)return PetscError(((MPI_Comm)0x44000001),8194,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not a vertex [%D, %D)",newp
,vStartNew,vEndNew)
;
8195 for (p = 0; p < 4+size; ++p) {
8196 if ((supportRef[p] < eStartNew) || (supportRef[p] >= eEndNew)) SETERRQ3(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %D is not an edge [%D, %D)", supportRef[p], eStartNew, eEndNew)return PetscError(((MPI_Comm)0x44000001),8196,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Point %D is not an edge [%D, %D)",supportRef
[p],eStartNew,eEndNew)
;
8197 }
8198#endif
8199 }
8200 /* Cell vertices have 6 supports */
8201 for (c = cStart; c < cMax; ++c) {
8202 const PetscInt newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax - fStart) + (c - cStart);
8203 PetscInt supportNew[6];
8204
8205 for (r = 0; r < 6; ++r) {
8206 supportNew[r] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (c - cStart)*6 + r;
8207 }
8208 ierr = DMPlexSetSupport(rdm, newp, supportNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8208,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8209 }
8210 ierr = PetscFree(supportRef)((*PetscTrFree)((void*)(supportRef),8210,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((supportRef) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8210,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8211 break;
8212 default:
8213 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),8213,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
8214 }
8215 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
8216}
8217
8218static PetscErrorCode CellRefinerSetCoordinates(CellRefiner refiner, DM dm, PetscInt depthSize[], DM rdm)
8219{
8220 PetscSection coordSection, coordSectionNew;
8221 Vec coordinates, coordinatesNew;
8222 PetscScalar *coords, *coordsNew;
8223 const PetscInt numVertices = depthSize ? depthSize[0] : 0;
1
Assuming 'depthSize' is null
2
'?' condition is false
8224 PetscInt dim, spaceDim, depth, bs, coordSizeNew, cStart, cEnd, cMax;
8225 PetscInt c, vStart, vStartNew, vEnd, v, eStart, eEnd, eMax, e, fStart, fEnd, fMax, f;
8226 PetscInt cStartNew, cEndNew, vEndNew, *parentId = NULL((void*)0);
8227 VecType vtype;
8228 PetscBool isperiodic, localize = PETSC_FALSE, needcoords = PETSC_FALSE;
8229 const PetscReal *maxCell, *L;
8230 const DMBoundaryType *bd;
8231 PetscErrorCode ierr;
8232
8233 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 8233; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
8234 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8234,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8235 ierr = DMPlexGetDepth(dm, &depth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8235,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8236 ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8236,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8237 ierr = DMPlexGetDepthStratum(dm, 1, &eStart, &eEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8237,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8238 ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8238,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8239 ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8239,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8240 ierr = DMPlexGetHybridBounds(dm, &cMax, &fMax, &eMax, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8240,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8241 if (cMax < 0) cMax = cEnd;
3
Assuming 'cMax' is >= 0
4
Taking false branch
8242 if (fMax < 0) fMax = fEnd;
5
Assuming 'fMax' is >= 0
6
Taking false branch
8243 if (eMax < 0) eMax = eEnd;
7
Assuming 'eMax' is >= 0
8
Taking false branch
8244 ierr = GetDepthStart_Private(depth, depthSize, &cStartNew, NULL((void*)0), NULL((void*)0), &vStartNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8244,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8245 ierr = GetDepthEnd_Private(depth, depthSize, &cEndNew, NULL((void*)0), NULL((void*)0), &vEndNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8245,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9
Passing null pointer value via 2nd parameter 'depthSize'
10
Calling 'GetDepthEnd_Private'
8246 ierr = DMGetPeriodicity(dm, &isperiodic, &maxCell, &L, &bd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8246,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8247 /* Determine if we need to localize coordinates when generating them */
8248 if (isperiodic && !maxCell) {
8249 ierr = DMGetCoordinatesLocalized(dm, &localize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8249,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8250 if (!localize) SETERRQ(PetscObjectComm((PetscObject)dm),PETSC_ERR_USER,"Cannot refine if coordinates have not been localized")return PetscError(PetscObjectComm((PetscObject)dm),8250,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,83,PETSC_ERROR_INITIAL,"Cannot refine if coordinates have not been localized"
)
;
8251 }
8252 if (isperiodic) {
8253 ierr = PetscOptionsBegin(PetscObjectComm((PetscObject)dm),((PetscObject)dm)->prefix,"DMPlex coords refinement options","DM")0; do { PetscOptionItems PetscOptionsObjectBase; PetscOptionItems
*PetscOptionsObject = &PetscOptionsObjectBase; PetscMemzero
(PetscOptionsObject,sizeof(PetscOptionItems)); for (PetscOptionsObject
->count=(PetscOptionsPublish?-1:1); PetscOptionsObject->
count<2; PetscOptionsObject->count++) { PetscErrorCode _5_ierr
= PetscOptionsBegin_Private(PetscOptionsObject,PetscObjectComm
((PetscObject)dm),((PetscObject)dm)->prefix,"DMPlex coords refinement options"
,"DM");do {if (__builtin_expect(!!(_5_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),8253,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,_5_ierr,PETSC_ERROR_REPEAT," ");} while (0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8253,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8254 ierr = PetscOptionsBool("-dm_plex_refine_localize","Automatically localize from parent cells",NULL,localize,&localize,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-dm_plex_refine_localize"
,"Automatically localize from parent cells",((void*)0),localize
,&localize,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8254,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8255 ierr = PetscOptionsEnd()_5_ierr = PetscOptionsEnd_Private(PetscOptionsObject);do {if (
__builtin_expect(!!(_5_ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8255,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,_5_ierr,PETSC_ERROR_REPEAT," ");} while (0);}} while (0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8255,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8256 if (localize) {
8257 ierr = DMLocalizeCoordinates(dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8257,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8258 }
8259 }
8260 ierr = DMSetPeriodicity(rdm, isperiodic, maxCell, L, bd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8260,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8261
8262 ierr = DMGetCoordinateSection(dm, &coordSection);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8262,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8263 ierr = PetscSectionGetFieldComponents(coordSection, 0, &spaceDim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8263,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8264 ierr = PetscSectionCreate(PetscObjectComm((PetscObject)dm), &coordSectionNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8264,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8265 ierr = PetscSectionSetNumFields(coordSectionNew, 1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8265,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8266 ierr = PetscSectionSetFieldComponents(coordSectionNew, 0, spaceDim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8266,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8267
8268 if (localize) {
8269 PetscInt p, r, newp, *pi;
8270
8271 /* New coordinates will be already localized on the cell */
8272 ierr = PetscSectionSetChart(coordSectionNew, 0, vStartNew+numVertices);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8272,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8273
8274 /* We need the parentId to properly localize coordinates */
8275 ierr = PetscMalloc1(cEndNew-cStartNew,&pi)PetscMallocA(1,PETSC_FALSE,8275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(cEndNew-cStartNew)*sizeof(**(&pi)),(&pi))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8276 switch (refiner) {
8277 case REFINER_NOOP:
8278 break;
8279 case REFINER_SIMPLEX_1D:
8280 for (p = cStart; p < cEnd; ++p) {
8281 for (r = 0; r < 2; ++r) {
8282 newp = (p - cStart)*2 + r;
8283 pi[newp] = p;
8284 }
8285 }
8286 break;
8287 case REFINER_SIMPLEX_2D:
8288 for (p = cStart; p < cEnd; ++p) {
8289 for (r = 0; r < 4; ++r) {
8290 newp = (p - cStart)*4 + r;
8291 pi[newp] = p;
8292 }
8293 }
8294 break;
8295 case REFINER_HEX_2D:
8296 for (p = cStart; p < cEnd; ++p) {
8297 for (r = 0; r < 4; ++r) {
8298 newp = (p - cStart)*4 + r;
8299 pi[newp] = p;
8300 }
8301 }
8302 break;
8303 case REFINER_SIMPLEX_TO_HEX_2D:
8304 for (p = cStart; p < cEnd; ++p) {
8305 for (r = 0; r < 3; ++r) {
8306 newp = (p - cStart)*3 + r;
8307 pi[newp] = p;
8308 }
8309 }
8310 break;
8311 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
8312 for (p = cStart; p < cMax; ++p) {
8313 for (r = 0; r < 3; ++r) {
8314 newp = (p - cStart)*3 + r;
8315 pi[newp] = p;
8316 }
8317 }
8318 for (p = cMax; p < cEnd; ++p) {
8319 for (r = 0; r < 4; ++r) {
8320 newp = (cMax - cStart)*3 + (p - cMax)*4 + r;
8321 pi[newp] = p;
8322 }
8323 }
8324 /* The refiner needs midpoint vertices on hybrid edges and hybrid cells */
8325 cMax = cEnd;
8326 eMax = eEnd;
8327 break;
8328 case REFINER_HYBRID_SIMPLEX_2D:
8329 for (p = cStart; p < cMax; ++p) {
8330 for (r = 0; r < 4; ++r) {
8331 newp = (p - cStart)*4 + r;
8332 pi[newp] = p;
8333 }
8334 }
8335 for (p = cMax; p < cEnd; ++p) {
8336 for (r = 0; r < 2; ++r) {
8337 newp = (cMax - cStart)*4 + (p - cMax)*2 + r;
8338 pi[newp] = p;
8339 }
8340 }
8341 break;
8342 case REFINER_HYBRID_HEX_2D:
8343 for (p = cStart; p < cMax; ++p) {
8344 for (r = 0; r < 4; ++r) {
8345 newp = (p - cStart)*4 + r;
8346 pi[newp] = p;
8347 }
8348 }
8349 for (p = cMax; p < cEnd; ++p) {
8350 for (r = 0; r < 2; ++r) {
8351 newp = (cMax - cStart)*4 + (p - cMax)*2 + r;
8352 pi[newp] = p;
8353 }
8354 }
8355 break;
8356 case REFINER_SIMPLEX_3D:
8357 for (p = cStart; p < cEnd; ++p) {
8358 for (r = 0; r < 8; ++r) {
8359 newp = (p - cStart)*8 + r;
8360 pi[newp] = p;
8361 }
8362 }
8363 break;
8364 case REFINER_HYBRID_SIMPLEX_3D:
8365 for (p = cStart; p < cMax; ++p) {
8366 for (r = 0; r < 8; ++r) {
8367 newp = (p - cStart)*8 + r;
8368 pi[newp] = p;
8369 }
8370 }
8371 for (p = cMax; p < cEnd; ++p) {
8372 for (r = 0; r < 4; ++r) {
8373 newp = (cMax - cStart)*8 + (p - cMax)*4 + r;
8374 pi[newp] = p;
8375 }
8376 }
8377 break;
8378 case REFINER_SIMPLEX_TO_HEX_3D:
8379 for (p = cStart; p < cEnd; ++p) {
8380 for (r = 0; r < 4; ++r) {
8381 newp = (p - cStart)*4 + r;
8382 pi[newp] = p;
8383 }
8384 }
8385 break;
8386 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
8387 for (p = cStart; p < cMax; ++p) {
8388 for (r = 0; r < 4; ++r) {
8389 newp = (p - cStart)*4 + r;
8390 pi[newp] = p;
8391 }
8392 }
8393 for (p = cMax; p < cEnd; ++p) {
8394 for (r = 0; r < 3; ++r) {
8395 newp = (cMax - cStart)*4 + (p - cMax)*3 + r;
8396 pi[newp] = p;
8397 }
8398 }
8399 break;
8400 case REFINER_HEX_3D:
8401 for (p = cStart; p < cEnd; ++p) {
8402 for (r = 0; r < 8; ++r) {
8403 newp = (p - cStart)*8 + r;
8404 pi[newp] = p;
8405 }
8406 }
8407 break;
8408 case REFINER_HYBRID_HEX_3D:
8409 for (p = cStart; p < cMax; ++p) {
8410 for (r = 0; r < 8; ++r) {
8411 newp = (p - cStart)*8 + r;
8412 pi[newp] = p;
8413 }
8414 }
8415 for (p = cMax; p < cEnd; ++p) {
8416 for (r = 0; r < 4; ++r) {
8417 newp = (cMax - cStart)*8 + (p - cMax)*4 + r;
8418 pi[newp] = p;
8419 }
8420 }
8421 break;
8422 default:
8423 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),8423,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
8424 }
8425 parentId = pi;
8426 } else {
8427 /* The refiner needs midpoint vertices on hybrid edges and hybrid cells */
8428 if (REFINER_HYBRID_SIMPLEX_TO_HEX_2D == refiner) { cMax = cEnd; eMax = eEnd; }
8429 ierr = PetscSectionSetChart(coordSectionNew, vStartNew, vStartNew+numVertices);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8429,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8430 }
8431
8432 /* All vertices have the spaceDim coordinates */
8433 if (localize) {
8434 PetscInt c;
8435
8436 for (c = cStartNew; c < cEndNew; ++c) {
8437 PetscInt *cone = NULL((void*)0);
8438 PetscInt closureSize, coneSize = 0, p, pdof;
8439
8440 ierr = PetscSectionGetDof(coordSection, parentId[c], &pdof); CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8440,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8441 if (pdof) { /* localize on all cells that are refinement of a localized parent cell */
8442 ierr = DMPlexGetTransitiveClosure(rdm, c, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8442,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8443 for (p = 0; p < closureSize*2; p += 2) {
8444 const PetscInt point = cone[p];
8445 if ((point >= vStartNew) && (point < vEndNew)) coneSize++;
8446 }
8447 ierr = DMPlexRestoreTransitiveClosure(rdm, c, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8447,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8448 ierr = PetscSectionSetDof(coordSectionNew, c, coneSize*spaceDim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8448,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8449 ierr = PetscSectionSetFieldDof(coordSectionNew, c, 0, coneSize*spaceDim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8449,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8450 }
8451 }
8452 }
8453 for (v = vStartNew; v < vStartNew+numVertices; ++v) {
8454 ierr = PetscSectionSetDof(coordSectionNew, v, spaceDim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8454,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8455 ierr = PetscSectionSetFieldDof(coordSectionNew, v, 0, spaceDim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8455,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8456 }
8457 ierr = PetscSectionSetUp(coordSectionNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8457,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8458 ierr = DMSetCoordinateSection(rdm, PETSC_DETERMINE-1, coordSectionNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8458,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8459 ierr = DMGetCoordinatesLocal(dm, &coordinates);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8459,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8460 ierr = PetscSectionGetStorageSize(coordSectionNew, &coordSizeNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8460,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8461 ierr = VecCreate(PETSC_COMM_SELF((MPI_Comm)0x44000001), &coordinatesNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8461,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8462 ierr = PetscObjectSetName((PetscObject) coordinatesNew, "coordinates");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8462,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8463 ierr = VecSetSizes(coordinatesNew, coordSizeNew, PETSC_DETERMINE-1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8463,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8464 ierr = VecGetBlockSize(coordinates, &bs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8464,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8465 ierr = VecSetBlockSize(coordinatesNew, bs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8465,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8466 ierr = VecGetType(coordinates, &vtype);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8466,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8467 ierr = VecSetType(coordinatesNew, vtype);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8467,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8468 ierr = VecGetArray(coordinates, &coords);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8468,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8469 ierr = VecGetArray(coordinatesNew, &coordsNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8469,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8470
8471 switch (refiner) {
8472 case REFINER_NOOP: break;
8473 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
8474 case REFINER_SIMPLEX_TO_HEX_3D:
8475 case REFINER_HEX_3D:
8476 case REFINER_HYBRID_HEX_3D:
8477 /* Face vertices have the average of corner coordinates */
8478 for (f = fStart; f < fMax; ++f) {
8479 const PetscInt newv = vStartNew + (vEnd - vStart) + (eMax - eStart) + (f - fStart);
8480 PetscInt *cone = NULL((void*)0);
8481 PetscInt closureSize, coneSize = 0, off[8], offnew, p, d;
8482
8483 ierr = DMPlexGetTransitiveClosure(dm, f, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8483,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8484 for (p = 0; p < closureSize*2; p += 2) {
8485 const PetscInt point = cone[p];
8486 if ((point >= vStart) && (point < vEnd)) cone[coneSize++] = point;
8487 }
8488 if (localize) {
8489 const PetscInt *support = NULL((void*)0);
8490 PetscInt *rStar = NULL((void*)0);
8491 PetscInt supportSize, rStarSize, coff, s, ccoff[8];
8492 PetscBool cellfound = PETSC_FALSE;
8493
8494 ierr = DMPlexGetTransitiveClosure(rdm, newv, PETSC_FALSE, &rStarSize, &rStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8494,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8495 ierr = DMPlexGetSupportSize(dm,f,&supportSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8495,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8496 ierr = DMPlexGetSupport(dm,f,&support);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8496,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8497 /* Compute average of coordinates for each cell sharing the face */
8498 for (s = 0; s < supportSize; ++s) {
8499 PetscScalar coordsNewAux[3] = { 0.0, 0.0, 0.0 };
8500 PetscInt *cellCone = NULL((void*)0);
8501 PetscInt cellClosureSize, cellConeSize = 0, cdof;
8502 const PetscInt cell = support[s];
8503 PetscBool copyoff = PETSC_FALSE;
8504
8505 ierr = DMPlexGetTransitiveClosure(dm, cell, PETSC_TRUE, &cellClosureSize, &cellCone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8505,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8506 for (p = 0; p < cellClosureSize*2; p += 2) {
8507 const PetscInt point = cellCone[p];
8508 if ((point >= vStart) && (point < vEnd)) cellCone[cellConeSize++] = point;
8509 }
8510 ierr = PetscSectionGetDof(coordSection, cell, &cdof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8510,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8511 if (!cdof) { /* the parent cell does not have localized coordinates */
8512 cellfound = PETSC_TRUE;
8513 for (v = 0; v < coneSize; ++v) {
8514 ierr = PetscSectionGetOffset(coordSection, cone[v], &off[v]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8514,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8515 for (d = 0; d < spaceDim; ++d) coordsNewAux[d] += coords[off[v]+d];
8516 }
8517 for (d = 0; d < spaceDim; ++d) coordsNewAux[d] /= coneSize;
8518 } else {
8519 ierr = PetscSectionGetOffset(coordSection, cell, &coff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8519,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8520 for (p = 0; p < coneSize; ++p) {
8521 const PetscInt tv = cone[p];
8522 PetscInt cv, voff;
8523 PetscBool locv = PETSC_TRUE;
8524
8525 for (cv = 0; cv < cellConeSize; ++cv) {
8526 if (cellCone[cv] == tv) {
8527 ccoff[p] = spaceDim*cv + coff;
8528 break;
8529 }
8530 }
8531 if (cv == cellConeSize) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Unable to map vertex %D",tv)return PetscError(((MPI_Comm)0x44000001),8531,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unable to map vertex %D",tv)
;
8532
8533 ierr = PetscSectionGetOffset(coordSection, cone[p], &voff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8533,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8534 for (d = 0; d < spaceDim; ++d) {
8535 coordsNewAux[d] += coords[ccoff[p]+d];
8536 if (!cellfound && coords[voff+d] != coords[ccoff[p]+d]) locv = PETSC_FALSE;
8537 }
8538 if (locv && !cellfound) {
8539 cellfound = PETSC_TRUE;
8540 copyoff = PETSC_TRUE;
8541 }
8542 }
8543 for (d = 0; d < spaceDim; ++d) coordsNewAux[d] /= coneSize;
8544
8545 /* Found a valid face for the "vertex" part of the Section (physical space)
8546 i.e., a face that has at least one corner in the physical space */
8547 if (copyoff) for (p = 0; p < coneSize; ++p) off[p] = ccoff[p];
8548 }
8549
8550 /* Localize new coordinates on each refined cell */
8551 for (v = 0; v < rStarSize*2; v += 2) {
8552 if ((rStar[v] >= cStartNew) && (rStar[v] < cEndNew) && parentId[rStar[v]-cStartNew] == cell) {
8553 PetscInt *rcone = NULL((void*)0), rclosureSize, lid, rcdof, rcoff;
8554 const PetscInt rcell = rStar[v];
8555
8556 ierr = PetscSectionGetDof(coordSectionNew, rcell, &rcdof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8556,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8557 if (!rcdof) continue;
8558 ierr = PetscSectionGetOffset(coordSectionNew, rcell, &rcoff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8558,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8559 ierr = DMPlexGetTransitiveClosure(rdm, rcell, PETSC_TRUE, &rclosureSize, &rcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8559,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8560 for (p = 0, lid = 0; p < rclosureSize*2; p += 2) {
8561 if (rcone[p] == newv) {
8562 for (d = 0; d < spaceDim; d++) coordsNew[rcoff + lid*spaceDim + d] = coordsNewAux[d];
8563 break;
8564 }
8565 if (rcone[p] >= vStartNew && rcone[p] < vEndNew) lid++;
8566 }
8567 ierr = DMPlexRestoreTransitiveClosure(rdm, rcell, PETSC_TRUE, &rclosureSize, &rcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8567,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8568 if (p == closureSize*2) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Unable to map new vertex %D",newv)return PetscError(((MPI_Comm)0x44000001),8568,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unable to map new vertex %D",newv)
;
8569 }
8570 }
8571 ierr = DMPlexRestoreTransitiveClosure(dm, cell, PETSC_TRUE, &cellClosureSize, &cellCone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8571,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8572 }
8573 ierr = DMPlexRestoreTransitiveClosure(rdm, newv, PETSC_FALSE, &rStarSize, &rStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8573,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8574 if (!cellfound) {
8575 /* Could not find a valid face for the vertex part, we will get this vertex later (final reduction) */
8576 needcoords = PETSC_TRUE;
8577 coneSize = 0;
8578 }
8579 } else {
8580 for (v = 0; v < coneSize; ++v) {
8581 ierr = PetscSectionGetOffset(coordSection, cone[v], &off[v]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8581,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8582 }
8583 }
8584 ierr = PetscSectionGetOffset(coordSectionNew, newv, &offnew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8584,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8585 if (coneSize) {
8586 for (d = 0; d < spaceDim; ++d) coordsNew[offnew+d] = 0.0;
8587 for (v = 0; v < coneSize; ++v) {ierr = DMLocalizeAddCoordinate_Internal(dm, spaceDim, &coords[off[0]], &coords[off[v]], &coordsNew[offnew]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8587,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
8588 for (d = 0; d < spaceDim; ++d) coordsNew[offnew+d] /= coneSize;
8589 } else {
8590 for (d = 0; d < spaceDim; ++d) coordsNew[offnew+d] = PETSC_MIN_REAL(-1.7976931348623157e+308);
8591 }
8592 ierr = DMPlexRestoreTransitiveClosure(dm, f, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8592,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8593 }
8594 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
8595 case REFINER_SIMPLEX_TO_HEX_2D:
8596 case REFINER_HEX_2D:
8597 case REFINER_HYBRID_HEX_2D:
8598 case REFINER_SIMPLEX_1D:
8599 /* Cell vertices have the average of corner coordinates */
8600 for (c = cStart; c < cMax; ++c) {
8601 const PetscInt newv = vStartNew + (vEnd - vStart) + (dim > 1 ? (eMax - eStart) : 0) + (c - cStart) + (dim > 2 ? (fMax - fStart) : 0);
8602 PetscInt *cone = NULL((void*)0);
8603 PetscInt closureSize, coneSize = 0, off[8], offnew, p, d, cdof = 0;
8604
8605 ierr = DMPlexGetTransitiveClosure(dm, c, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8605,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8606 for (p = 0; p < closureSize*2; p += 2) {
8607 const PetscInt point = cone[p];
8608 if ((point >= vStart) && (point < vEnd)) cone[coneSize++] = point;
8609 }
8610 if (localize) {
8611 ierr = PetscSectionGetDof(coordSection, c, &cdof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8611,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8612 }
8613 if (cdof) {
8614 PetscInt coff;
8615
8616 ierr = PetscSectionGetOffset(coordSection, c, &coff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8616,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8617 for (v = 0; v < coneSize; ++v) off[v] = spaceDim*v + coff;
8618 } else {
8619 for (v = 0; v < coneSize; ++v) {
8620 ierr = PetscSectionGetOffset(coordSection, cone[v], &off[v]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8620,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8621 }
8622 }
8623 ierr = PetscSectionGetOffset(coordSectionNew, newv, &offnew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8623,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8624 for (d = 0; d < spaceDim; ++d) coordsNew[offnew+d] = 0.0;
8625 for (v = 0; v < coneSize; ++v) {ierr = DMLocalizeAddCoordinate_Internal(dm, spaceDim, &coords[off[0]], &coords[off[v]], &coordsNew[offnew]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8625,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
8626 for (d = 0; d < spaceDim; ++d) coordsNew[offnew+d] /= coneSize;
8627 ierr = DMPlexRestoreTransitiveClosure(dm, c, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8627,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8628
8629 /* Localize new coordinates on each refined cell */
8630 if (cdof) {
8631 PetscInt *rStar = NULL((void*)0), rStarSize;
8632
8633 ierr = DMPlexGetTransitiveClosure(rdm, newv, PETSC_FALSE, &rStarSize, &rStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8633,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8634 for (v = 0; v < rStarSize*2; v += 2) {
8635 if ((rStar[v] >= cStartNew) && (rStar[v] < cEndNew)) {
8636 PetscInt *cone = NULL((void*)0), closureSize, lid, coff, rc, rcdof;
8637
8638 rc = rStar[v];
8639 ierr = PetscSectionGetDof(coordSectionNew, rc, &rcdof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8639,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8640 if (!rcdof) continue;
8641 ierr = PetscSectionGetOffset(coordSectionNew, rc, &coff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8641,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8642 ierr = DMPlexGetTransitiveClosure(rdm, rc, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8642,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8643 for (p = 0, lid = 0; p < closureSize*2; p += 2) {
8644 if (cone[p] == newv) {
8645 for (d = 0; d < spaceDim; d++) coordsNew[coff + lid*spaceDim + d] = coordsNew[offnew + d];
8646 break;
8647 }
8648 if (cone[p] >= vStartNew && cone[p] < vEndNew) lid++;
8649 }
8650 if (p == closureSize*2) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Unable to map new vertex %D",newv)return PetscError(((MPI_Comm)0x44000001),8650,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unable to map new vertex %D",newv)
;
8651 ierr = DMPlexRestoreTransitiveClosure(rdm, rc, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8651,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8652 }
8653 }
8654 ierr = DMPlexRestoreTransitiveClosure(rdm, newv, PETSC_FALSE, &rStarSize, &rStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8654,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8655 }
8656 }
8657 case REFINER_SIMPLEX_2D:
8658 case REFINER_HYBRID_SIMPLEX_2D:
8659 case REFINER_SIMPLEX_3D:
8660 case REFINER_HYBRID_SIMPLEX_3D:
8661 /* Edge vertices have the average of endpoint coordinates */
8662 for (e = eStart; e < eMax; ++e) {
8663 const PetscInt newv = vStartNew + (vEnd - vStart) + (e - eStart);
8664 const PetscInt *cone;
8665 PetscInt coneSize, offA, offB, offnew, d;
8666
8667 ierr = DMPlexGetConeSize(dm, e, &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8667,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8668 if (coneSize != 2) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Edge %D cone should have two vertices, not %D", e, coneSize)return PetscError(((MPI_Comm)0x44000001),8668,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Edge %D cone should have two vertices, not %D"
,e,coneSize)
;
8669 ierr = DMPlexGetCone(dm, e, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8669,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8670 if (localize) {
8671 PetscInt coff, toffA = -1, toffB = -1, voffA, voffB;
8672 PetscInt *eStar = NULL((void*)0), eStarSize;
8673 PetscInt *rStar = NULL((void*)0), rStarSize;
8674 PetscBool cellfound = PETSC_FALSE;
8675
8676 offA = offB = -1;
8677 ierr = PetscSectionGetOffset(coordSection, cone[0], &voffA);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8677,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8678 ierr = PetscSectionGetOffset(coordSection, cone[1], &voffB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8678,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8679 ierr = DMPlexGetTransitiveClosure(dm, e, PETSC_FALSE, &eStarSize, &eStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8679,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8680 ierr = DMPlexGetTransitiveClosure(rdm, newv, PETSC_FALSE, &rStarSize, &rStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8680,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8681 for (v = 0; v < eStarSize*2; v += 2) {
8682 if ((eStar[v] >= cStart) && (eStar[v] < cEnd)) {
8683 PetscScalar coordsNewAux[3];
8684 PetscInt *cellCone = NULL((void*)0);
8685 PetscInt cellClosureSize, s, cv, cdof;
8686 PetscBool locvA = PETSC_TRUE, locvB = PETSC_TRUE;
8687 const PetscInt cell = eStar[v];
8688
8689 ierr = PetscSectionGetDof(coordSection, cell, &cdof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8689,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8690 if (!cdof) {
8691 /* Found a valid edge for the "vertex" part of the Section */
8692 offA = voffA;
8693 offB = voffB;
8694 cellfound = PETSC_TRUE;
8695 } else {
8696 ierr = PetscSectionGetOffset(coordSection, cell, &coff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8696,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8697 ierr = DMPlexGetTransitiveClosure(dm, cell, PETSC_TRUE, &cellClosureSize, &cellCone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8697,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8698 for (s = 0, cv = 0; s < cellClosureSize*2; s += 2) {
8699 const PetscInt point = cellCone[s];
8700 if ((point >= vStart) && (point < vEnd)) {
8701 if (point == cone[0]) toffA = spaceDim*cv + coff;
8702 else if (point == cone[1]) toffB = spaceDim*cv + coff;
8703 cv++;
8704 }
8705 }
8706 ierr = DMPlexRestoreTransitiveClosure(dm, cell, PETSC_TRUE, &cellClosureSize, &cellCone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8706,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8707 for (d = 0; d < spaceDim; ++d) {
8708 coordsNewAux[d] = 0.5*(coords[toffA+d] + coords[toffB+d]);
8709 if (coords[toffA+d] != coords[voffA+d]) locvA = PETSC_FALSE;
8710 if (coords[toffB+d] != coords[voffB+d]) locvB = PETSC_FALSE;
8711 }
8712 /* Found a valid edge for the "vertex" part of the Section */
8713 if (!cellfound && (locvA || locvB)) {
8714 cellfound = PETSC_TRUE;
8715 offA = toffA;
8716 offB = toffB;
8717 }
8718 }
8719
8720 /* Localize new coordinates on each refined cell */
8721 for (s = 0; s < rStarSize*2; s += 2) {
8722 if ((rStar[s] >= cStartNew) && (rStar[s] < cEndNew) && parentId[rStar[s]-cStartNew] == cell) {
8723 PetscInt *rcone = NULL((void*)0), rclosureSize, lid, p, rcdof;
8724 const PetscInt rcell = rStar[s];
8725
8726 ierr = PetscSectionGetDof(coordSectionNew, rcell, &rcdof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8726,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8727 if (!rcdof) continue;
8728 ierr = PetscSectionGetOffset(coordSectionNew, rcell, &coff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8728,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8729 ierr = DMPlexGetTransitiveClosure(rdm, rcell, PETSC_TRUE, &rclosureSize, &rcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8729,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8730 for (p = 0, lid = 0; p < rclosureSize*2; p += 2) {
8731 if (rcone[p] == newv) {
8732 for (d = 0; d < spaceDim; d++) coordsNew[coff + lid*spaceDim + d] = coordsNewAux[d];
8733 break;
8734 }
8735 if (rcone[p] >= vStartNew && rcone[p] < vEndNew) lid++;
8736 }
8737 ierr = DMPlexRestoreTransitiveClosure(rdm, rcell, PETSC_TRUE, &rclosureSize, &rcone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8737,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8738 if (p == rclosureSize*2) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Unable to map new vertex %D",newv)return PetscError(((MPI_Comm)0x44000001),8738,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unable to map new vertex %D",newv)
;
8739 }
8740 }
8741 }
8742 }
8743 ierr = DMPlexRestoreTransitiveClosure(dm, e, PETSC_FALSE, &eStarSize, &eStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8743,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8744 ierr = DMPlexRestoreTransitiveClosure(rdm, newv, PETSC_FALSE, &rStarSize, &rStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8744,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8745 if (!cellfound) {
8746 /* Could not find a valid edge for the vertex part, we will get this vertex later (final reduction) */
8747 needcoords = PETSC_TRUE;
8748 }
8749 } else {
8750 ierr = PetscSectionGetOffset(coordSection, cone[0], &offA);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8750,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8751 ierr = PetscSectionGetOffset(coordSection, cone[1], &offB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8751,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8752 }
8753 ierr = PetscSectionGetOffset(coordSectionNew, newv, &offnew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8753,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8754 if (offA != -1 && offB != -1) {
8755 ierr = DMLocalizeCoordinate_Internal(dm, spaceDim, &coords[offA], &coords[offB], &coordsNew[offnew]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8755,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8756 for (d = 0; d < spaceDim; ++d) {
8757 coordsNew[offnew+d] = 0.5*(coords[offA+d] + coordsNew[offnew+d]);
8758 }
8759 } else {
8760 for (d = 0; d < spaceDim; ++d) coordsNew[offnew+d] = PETSC_MIN_REAL(-1.7976931348623157e+308);
8761 }
8762 }
8763 /* Old vertices have the same coordinates */
8764 for (v = vStart; v < vEnd; ++v) {
8765 const PetscInt newv = vStartNew + (v - vStart);
8766 PetscInt off, offnew, d;
8767
8768 ierr = PetscSectionGetOffset(coordSection, v, &off);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8768,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8769 ierr = PetscSectionGetOffset(coordSectionNew, newv, &offnew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8769,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8770 for (d = 0; d < spaceDim; ++d) {
8771 coordsNew[offnew+d] = coords[off+d];
8772 }
8773
8774 /* Localize new coordinates on each refined cell */
8775 if (localize) {
8776 PetscInt p;
8777 PetscInt *rStar = NULL((void*)0), rStarSize;
8778
8779 ierr = DMPlexGetTransitiveClosure(rdm, newv, PETSC_FALSE, &rStarSize, &rStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8779,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8780 for (p = 0; p < rStarSize*2; p += 2) {
8781 if ((rStar[p] >= cStartNew) && (rStar[p] < cEndNew)) {
8782 PetscScalar ocoords[3];
8783 PetscInt *cone = NULL((void*)0), closureSize, lid, coff, s, oc, cdof;
8784
8785 c = rStar[p];
8786 oc = parentId[c-cStartNew];
8787 ierr = PetscSectionGetDof(coordSectionNew, c, &cdof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8787,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8788 if (!cdof) continue;
8789 ierr = PetscSectionGetDof(coordSection, oc, &cdof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8789,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8790 if (!cdof) continue;
8791 ierr = PetscSectionGetOffset(coordSection, oc, &coff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8792 ierr = DMPlexGetTransitiveClosure(dm, oc, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8792,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8793 for (s = 0, lid = 0; s < closureSize*2; s += 2) {
8794 if (cone[s] == v) {
8795 for (d = 0; d < spaceDim; d++) ocoords[d] = coords[coff + lid*spaceDim + d];
8796 break;
8797 }
8798 if (cone[s] >= vStart && cone[s] < vEnd) lid++;
8799 }
8800 if (s == closureSize*2) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Unable to map old vertex %D",v)return PetscError(((MPI_Comm)0x44000001),8800,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unable to map old vertex %D",v)
;
8801 ierr = DMPlexRestoreTransitiveClosure(dm, oc, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8801,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8802
8803 ierr = PetscSectionGetOffset(coordSectionNew, c, &coff);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8803,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8804 ierr = DMPlexGetTransitiveClosure(rdm, c, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8804,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8805 for (s = 0, lid = 0; s < closureSize*2; s += 2) {
8806 if (cone[s] == newv) {
8807 for (d = 0; d < spaceDim; d++) coordsNew[coff + lid*spaceDim + d] = ocoords[d];
8808 break;
8809 }
8810 if (cone[s] >= vStartNew && cone[s] < vEndNew) lid++;
8811 }
8812 if (s == closureSize*2) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Unable to map new vertex %D",newv)return PetscError(((MPI_Comm)0x44000001),8812,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Unable to map new vertex %D",newv)
;
8813 ierr = DMPlexRestoreTransitiveClosure(rdm, c, PETSC_TRUE, &closureSize, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8813,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8814 }
8815 }
8816 ierr = DMPlexRestoreTransitiveClosure(rdm, newv, PETSC_FALSE, &rStarSize, &rStar);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8816,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8817 }
8818 }
8819 break;
8820 default:
8821 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),8821,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
8822 }
8823 ierr = VecRestoreArray(coordinates, &coords);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8823,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8824 ierr = VecRestoreArray(coordinatesNew, &coordsNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8824,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8825 ierr = DMSetCoordinatesLocal(rdm, coordinatesNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8825,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8826
8827 /* Final reduction (if needed) if we are localizing */
8828 if (localize) {
8829 PetscBool gred;
8830
8831 ierr = MPIU_Allreduce(&needcoords, &gred, 1, MPIU_BOOL, MPI_LOR, PetscObjectComm((PetscObject)rdm))(PetscAllreduceBarrierCheck(PetscObjectComm((PetscObject)rdm)
,1,8831,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)rdm))),0) || MPI_Allreduce((&needcoords),(&
gred),(1),(MPIU_BOOL),((MPI_Op)(0x58000007)),(PetscObjectComm
((PetscObject)rdm)))))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8831,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8832 if (gred) {
8833 DM cdm;
8834 Vec aux;
8835 PetscSF sf;
8836 const PetscScalar *lArray;
8837 PetscScalar *gArray;
8838#if defined(PETSC_USE_COMPLEX)
8839 PetscInt i, ln, gn;
8840 PetscReal *lrArray;
8841 PetscReal *grArray;
8842#endif
8843
8844 ierr = DMGetCoordinateDM(rdm, &cdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8844,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8845 ierr = DMCreateGlobalVector(cdm, &aux);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8845,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8846 ierr = DMGetDefaultSF(cdm, &sf);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8846,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8847 ierr = VecGetArrayRead(coordinatesNew, &lArray);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8847,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8848 ierr = VecSet(aux, PETSC_MIN_REAL(-1.7976931348623157e+308));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8848,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8849 ierr = VecGetArray(aux, &gArray);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8849,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8850#if defined(PETSC_USE_COMPLEX)
8851 ierr = VecGetLocalSize(aux, &gn);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8851,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8852 ierr = VecGetLocalSize(coordinatesNew, &ln);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8852,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8853 ierr = PetscMalloc2(ln,&lrArray,gn,&grArray)PetscMallocA(2,PETSC_FALSE,8853,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(ln)*sizeof(**(&lrArray)),(&lrArray),(size_t
)(gn)*sizeof(**(&grArray)),(&grArray))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8853,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8854 for (i=0;i<ln;i++) lrArray[i] = PetscRealPart(lArray[i])(lArray[i]);
8855 for (i=0;i<gn;i++) grArray[i] = PetscRealPart(gArray[i])(gArray[i]);
8856 ierr = PetscSFReduceBegin(sf, MPIU_REAL((MPI_Datatype)0x4c00080b), lrArray, grArray, MPIU_MAX(MPI_Op)(0x58000001));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8856,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8857 ierr = PetscSFReduceEnd(sf, MPIU_REAL((MPI_Datatype)0x4c00080b), lrArray, grArray, MPIU_MAX(MPI_Op)(0x58000001));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8857,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8858 for (i=0;i<gn;i++) gArray[i] = grArray[i];
8859 ierr = PetscFree2(lrArray,grArray)PetscFreeA(2,8859,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,&(lrArray),&(grArray))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8859,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8860#else
8861 ierr = PetscSFReduceBegin(sf, MPIU_SCALAR((MPI_Datatype)0x4c00080b), lArray, gArray, MPIU_MAX(MPI_Op)(0x58000001));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8861,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8862 ierr = PetscSFReduceEnd(sf, MPIU_SCALAR((MPI_Datatype)0x4c00080b), lArray, gArray, MPIU_MAX(MPI_Op)(0x58000001));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8862,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8863#endif
8864 ierr = VecRestoreArrayRead(coordinatesNew, &lArray);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8864,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8865 ierr = VecRestoreArray(aux, &gArray);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8865,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8866 ierr = DMGlobalToLocalBegin(cdm, aux, INSERT_VALUES, coordinatesNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8866,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8867 ierr = DMGlobalToLocalEnd(cdm, aux, INSERT_VALUES, coordinatesNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8867,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8868 ierr = VecDestroy(&aux);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8868,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8869 }
8870 }
8871 ierr = VecDestroy(&coordinatesNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8871,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8872 ierr = PetscSectionDestroy(&coordSectionNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8872,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8873 ierr = PetscFree(parentId)((*PetscTrFree)((void*)(parentId),8873,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((parentId) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8873,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8874 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
8875}
8876
8877/*@
8878 DMPlexCreateProcessSF - Create an SF which just has process connectivity
8879
8880 Collective on dm
8881
8882 Input Parameters:
8883+ dm - The DM
8884- sfPoint - The PetscSF which encodes point connectivity
8885
8886 Output Parameters:
8887+ processRanks - A list of process neighbors, or NULL
8888- sfProcess - An SF encoding the process connectivity, or NULL
8889
8890 Level: developer
8891
8892.seealso: PetscSFCreate(), DMPlexCreateTwoSidedProcessSF()
8893@*/
8894PetscErrorCode DMPlexCreateProcessSF(DM dm, PetscSF sfPoint, IS *processRanks, PetscSF *sfProcess)
8895{
8896 PetscInt numRoots, numLeaves, l;
8897 const PetscInt *localPoints;
8898 const PetscSFNode *remotePoints;
8899 PetscInt *localPointsNew;
8900 PetscSFNode *remotePointsNew;
8901 PetscInt *ranks, *ranksNew;
8902 PetscMPIInt size;
8903 PetscErrorCode ierr;
8904
8905 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 8905; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
8906 PetscValidHeaderSpecific(dm, DM_CLASSID, 1)do { if (!dm) return PetscError(((MPI_Comm)0x44000001),8906,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(dm,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),8906,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(dm))->classid != DM_CLASSID) { if (
((PetscObject)(dm))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),8906,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),8906,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
8907 PetscValidHeaderSpecific(sfPoint, PETSCSF_CLASSID, 2)do { if (!sfPoint) return PetscError(((MPI_Comm)0x44000001),8907
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(sfPoint,PETSC_OBJECT)) return PetscError((
(MPI_Comm)0x44000001),8907,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(sfPoint))->classid != PETSCSF_CLASSID
) { if (((PetscObject)(sfPoint))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),8907,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),8907,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,2); } } while (0)
;
8908 if (processRanks) {PetscValidPointer(processRanks, 3)do { if (!processRanks) return PetscError(((MPI_Comm)0x44000001
),8908,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(processRanks,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),8908,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;}
8909 if (sfProcess) {PetscValidPointer(sfProcess, 4)do { if (!sfProcess) return PetscError(((MPI_Comm)0x44000001)
,8909,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",4); if
(!PetscCheckPointer(sfProcess,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),8909,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",4);
} while (0)
;}
8910 ierr = MPI_Comm_size(PetscObjectComm((PetscObject) dm), &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8910,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8911 ierr = PetscSFGetGraph(sfPoint, &numRoots, &numLeaves, &localPoints, &remotePoints);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8911,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8912 ierr = PetscMalloc1(numLeaves, &ranks)PetscMallocA(1,PETSC_FALSE,8912,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeaves)*sizeof(**(&ranks)),(&ranks))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8912,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8913 for (l = 0; l < numLeaves; ++l) {
8914 ranks[l] = remotePoints[l].rank;
8915 }
8916 ierr = PetscSortRemoveDupsInt(&numLeaves, ranks);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8916,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8917 ierr = PetscMalloc1(numLeaves, &ranksNew)PetscMallocA(1,PETSC_FALSE,8917,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeaves)*sizeof(**(&ranksNew)),(&ranksNew
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8917,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8918 ierr = PetscMalloc1(numLeaves, &localPointsNew)PetscMallocA(1,PETSC_FALSE,8918,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeaves)*sizeof(**(&localPointsNew)),(&localPointsNew
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8918,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8919 ierr = PetscMalloc1(numLeaves, &remotePointsNew)PetscMallocA(1,PETSC_FALSE,8919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeaves)*sizeof(**(&remotePointsNew)),(&remotePointsNew
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8919,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8920 for (l = 0; l < numLeaves; ++l) {
8921 ranksNew[l] = ranks[l];
8922 localPointsNew[l] = l;
8923 remotePointsNew[l].index = 0;
8924 remotePointsNew[l].rank = ranksNew[l];
8925 }
8926 ierr = PetscFree(ranks)((*PetscTrFree)((void*)(ranks),8926,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((ranks) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8926,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8927 if (processRanks) {ierr = ISCreateGeneral(PetscObjectComm((PetscObject)dm), numLeaves, ranksNew, PETSC_OWN_POINTER, processRanks);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8927,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
8928 else {ierr = PetscFree(ranksNew)((*PetscTrFree)((void*)(ranksNew),8928,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((ranksNew) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8928,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
8929 if (sfProcess) {
8930 ierr = PetscSFCreate(PetscObjectComm((PetscObject)dm), sfProcess);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8930,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8931 ierr = PetscObjectSetName((PetscObject) *sfProcess, "Process SF");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8931,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8932 ierr = PetscSFSetFromOptions(*sfProcess);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8932,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8933 ierr = PetscSFSetGraph(*sfProcess, size, numLeaves, localPointsNew, PETSC_OWN_POINTER, remotePointsNew, PETSC_OWN_POINTER);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8933,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8934 }
8935 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
8936}
8937
8938static PetscErrorCode CellRefinerCreateSF(CellRefiner refiner, DM dm, PetscInt depthSize[], DM rdm)
8939{
8940 PetscSF sf, sfNew, sfProcess;
8941 IS processRanks;
8942 MPI_Datatype depthType;
8943 PetscInt numRoots, numLeaves, numLeavesNew = 0, l, m;
8944 const PetscInt *localPoints, *neighbors;
8945 const PetscSFNode *remotePoints;
8946 PetscInt *localPointsNew;
8947 PetscSFNode *remotePointsNew;
8948 PetscInt *depthSizeOld, *rdepthSize, *rdepthSizeOld, *rdepthMaxOld, *rvStart, *rvStartNew, *reStart, *reStartNew, *rfStart, *rfStartNew, *rcStart, *rcStartNew;
8949 PetscInt ldepth, depth, numNeighbors, pStartNew, pEndNew, cStart, cEnd, cMax, vStart, vEnd, vMax, fStart, fEnd, fMax, eStart, eEnd, eMax, r, n;
8950 PetscInt cStartNew = 0, vStartNew = 0, fStartNew = 0, eStartNew = 0;
8951 PetscErrorCode ierr;
8952
8953 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 8953; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
8954 ierr = DMPlexGetChart(rdm, &pStartNew, &pEndNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8954,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8955 ierr = DMPlexGetDepth(dm, &ldepth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8955,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8956 ierr = MPIU_Allreduce(&ldepth, &depth, 1, MPIU_INT, MPI_MAX, PetscObjectComm((PetscObject) dm))(PetscAllreduceBarrierCheck(PetscObjectComm((PetscObject) dm)
,1,8956,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject) dm))),0) || MPI_Allreduce((&ldepth),(&
depth),(1),(((MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)
),(PetscObjectComm((PetscObject) dm)))))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8956,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8957 if ((ldepth >= 0) && (depth != ldepth)) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Inconsistent Plex depth %D != %D", ldepth, depth)return PetscError(((MPI_Comm)0x44000001),8957,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Inconsistent Plex depth %D != %D",ldepth
,depth)
;
8958 ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8958,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8959 ierr = DMPlexGetDepthStratum(dm, 1, &eStart, &eEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8959,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8960 ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8960,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8961 ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8961,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8962 ierr = DMPlexGetHybridBounds(dm, &cMax, &fMax, &eMax, &vMax);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8962,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8963 cMax = cMax < 0 ? cEnd : cMax;
8964 fMax = fMax < 0 ? fEnd : fMax;
8965 eMax = eMax < 0 ? eEnd : eMax;
8966 if (refiner) {ierr = GetDepthStart_Private(depth, depthSize, &cStartNew, &fStartNew, &eStartNew, &vStartNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8966,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
8967 ierr = DMGetPointSF(dm, &sf);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8967,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8968 ierr = DMGetPointSF(rdm, &sfNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8968,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8969 /* Calculate size of new SF */
8970 ierr = PetscSFGetGraph(sf, &numRoots, &numLeaves, &localPoints, &remotePoints);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),8970,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
8971 if (numRoots < 0) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
8972 for (l = 0; l < numLeaves; ++l) {
8973 const PetscInt p = localPoints[l];
8974
8975 switch (refiner) {
8976 case REFINER_SIMPLEX_1D:
8977 if ((p >= vStart) && (p < vEnd)) {
8978 /* Interior vertices stay the same */
8979 ++numLeavesNew;
8980 } else if ((p >= cStart && p < cMax)) {
8981 /* Interior cells add new cells and interior vertices */
8982 numLeavesNew += 2 + 1;
8983 }
8984 break;
8985 case REFINER_SIMPLEX_2D:
8986 case REFINER_HYBRID_SIMPLEX_2D:
8987 if ((p >= vStart) && (p < vEnd)) {
8988 /* Interior vertices stay the same */
8989 ++numLeavesNew;
8990 } else if ((p >= fStart) && (p < fMax)) {
8991 /* Interior faces add new faces and vertex */
8992 numLeavesNew += 2 + 1;
8993 } else if ((p >= fMax) && (p < fEnd)) {
8994 /* Hybrid faces stay the same */
8995 ++numLeavesNew;
8996 } else if ((p >= cStart) && (p < cMax)) {
8997 /* Interior cells add new cells and interior faces */
8998 numLeavesNew += 4 + 3;
8999 } else if ((p >= cMax) && (p < cEnd)) {
9000 /* Hybrid cells add new cells and hybrid face */
9001 numLeavesNew += 2 + 1;
9002 }
9003 break;
9004 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
9005 case REFINER_SIMPLEX_TO_HEX_2D:
9006 if ((p >= vStart) && (p < vEnd)) {
9007 /* Interior vertices stay the same */
9008 ++numLeavesNew;
9009 } else if ((p >= fStart) && (p < fEnd)) {
9010 /* Interior faces add new faces and vertex */
9011 numLeavesNew += 2 + 1;
9012 } else if ((p >= cStart) && (p < cMax)) {
9013 /* Interior cells add new cells, interior faces, and vertex */
9014 numLeavesNew += 3 + 3 + 1;
9015 } else if ((p >= cMax) && (p < cEnd)) {
9016 /* Hybrid cells add new cells, interior faces, and vertex */
9017 numLeavesNew += 4 + 4 + 1;
9018 }
9019 break;
9020 case REFINER_HEX_2D:
9021 case REFINER_HYBRID_HEX_2D:
9022 if ((p >= vStart) && (p < vEnd)) {
9023 /* Interior vertices stay the same */
9024 ++numLeavesNew;
9025 } else if ((p >= fStart) && (p < fMax)) {
9026 /* Interior faces add new faces and vertex */
9027 numLeavesNew += 2 + 1;
9028 } else if ((p >= fMax) && (p < fEnd)) {
9029 /* Hybrid faces stay the same */
9030 ++numLeavesNew;
9031 } else if ((p >= cStart) && (p < cMax)) {
9032 /* Interior cells add new cells, interior faces, and vertex */
9033 numLeavesNew += 4 + 4 + 1;
9034 } else if ((p >= cMax) && (p < cEnd)) {
9035 /* Hybrid cells add new cells and hybrid face */
9036 numLeavesNew += 2 + 1;
9037 }
9038 break;
9039 case REFINER_SIMPLEX_3D:
9040 case REFINER_HYBRID_SIMPLEX_3D:
9041 if ((p >= vStart) && (p < vEnd)) {
9042 /* Interior vertices stay the same */
9043 ++numLeavesNew;
9044 } else if ((p >= eStart) && (p < eMax)) {
9045 /* Interior edges add new edges and vertex */
9046 numLeavesNew += 2 + 1;
9047 } else if ((p >= eMax) && (p < eEnd)) {
9048 /* Hybrid edges stay the same */
9049 ++numLeavesNew;
9050 } else if ((p >= fStart) && (p < fMax)) {
9051 /* Interior faces add new faces and edges */
9052 numLeavesNew += 4 + 3;
9053 } else if ((p >= fMax) && (p < fEnd)) {
9054 /* Hybrid faces add new faces and edges */
9055 numLeavesNew += 2 + 1;
9056 } else if ((p >= cStart) && (p < cMax)) {
9057 /* Interior cells add new cells, faces, and edges */
9058 numLeavesNew += 8 + 8 + 1;
9059 } else if ((p >= cMax) && (p < cEnd)) {
9060 /* Hybrid cells add new cells and faces */
9061 numLeavesNew += 4 + 3;
9062 }
9063 break;
9064 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
9065 case REFINER_SIMPLEX_TO_HEX_3D:
9066 if ((p >= vStart) && (p < vEnd)) {
9067 /* Interior vertices stay the same */
9068 ++numLeavesNew;
9069 } else if ((p >= eStart) && (p < eMax)) {
9070 /* Interior edges add new edges and vertex */
9071 numLeavesNew += 2 + 1;
9072 } else if ((p >= eMax) && (p < eEnd)) {
9073 /* Hybrid edges stay the same */
9074 ++numLeavesNew;
9075 } else if ((p >= fStart) && (p < fMax)) {
9076 /* Interior faces add new faces, edges and a vertex */
9077 numLeavesNew += 3 + 3 + 1;
9078 } else if ((p >= fMax) && (p < fEnd)) {
9079 /* Hybrid faces add new faces and an edge */
9080 numLeavesNew += 2 + 1;
9081 } else if ((p >= cStart) && (p < cMax)) {
9082 /* Interior cells add new cells, faces, edges and a vertex */
9083 numLeavesNew += 4 + 6 + 4 + 1;
9084 } else if ((p >= cMax) && (p < cEnd)) {
9085 /* Hybrid cells add new cells, faces and an edge */
9086 numLeavesNew += 3 + 3 + 1;
9087 }
9088 break;
9089 case REFINER_HEX_3D:
9090 case REFINER_HYBRID_HEX_3D:
9091 if ((p >= vStart) && (p < vEnd)) {
9092 /* Old vertices stay the same */
9093 ++numLeavesNew;
9094 } else if ((p >= eStart) && (p < eMax)) {
9095 /* Interior edges add new edges, and vertex */
9096 numLeavesNew += 2 + 1;
9097 } else if ((p >= eMax) && (p < eEnd)) {
9098 /* Hybrid edges stay the same */
9099 ++numLeavesNew;
9100 } else if ((p >= fStart) && (p < fMax)) {
9101 /* Interior faces add new faces, edges, and vertex */
9102 numLeavesNew += 4 + 4 + 1;
9103 } else if ((p >= fMax) && (p < fEnd)) {
9104 /* Hybrid faces add new faces and edges */
9105 numLeavesNew += 2 + 1;
9106 } else if ((p >= cStart) && (p < cMax)) {
9107 /* Interior cells add new cells, faces, edges, and vertex */
9108 numLeavesNew += 8 + 12 + 6 + 1;
9109 } else if ((p >= cStart) && (p < cEnd)) {
9110 /* Hybrid cells add new cells, faces, and edges */
9111 numLeavesNew += 4 + 4 + 1;
9112 }
9113 break;
9114 default:
9115 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),9115,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
9116 }
9117 }
9118 /* Communicate depthSizes for each remote rank */
9119 ierr = DMPlexCreateProcessSF(dm, sf, &processRanks, &sfProcess);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9119,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9120 ierr = ISGetLocalSize(processRanks, &numNeighbors);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9120,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9121 ierr = PetscMalloc5((depth+1)*numNeighbors,&rdepthSize,numNeighbors,&rvStartNew,numNeighbors,&reStartNew,numNeighbors,&rfStartNew,numNeighbors,&rcStartNew)PetscMallocA(5,PETSC_FALSE,9121,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)((depth+1)*numNeighbors)*sizeof(**(&rdepthSize))
,(&rdepthSize),(size_t)(numNeighbors)*sizeof(**(&rvStartNew
)),(&rvStartNew),(size_t)(numNeighbors)*sizeof(**(&reStartNew
)),(&reStartNew),(size_t)(numNeighbors)*sizeof(**(&rfStartNew
)),(&rfStartNew),(size_t)(numNeighbors)*sizeof(**(&rcStartNew
)),(&rcStartNew))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9121,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9122 ierr = PetscMalloc7(depth+1,&depthSizeOld,(depth+1)*numNeighbors,&rdepthSizeOld,(depth+1)*numNeighbors,&rdepthMaxOld,numNeighbors,&rvStart,numNeighbors,&reStart,numNeighbors,&rfStart,numNeighbors,&rcStart)PetscMallocA(7,PETSC_FALSE,9122,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(depth+1)*sizeof(**(&depthSizeOld)),(&depthSizeOld
),(size_t)((depth+1)*numNeighbors)*sizeof(**(&rdepthSizeOld
)),(&rdepthSizeOld),(size_t)((depth+1)*numNeighbors)*sizeof
(**(&rdepthMaxOld)),(&rdepthMaxOld),(size_t)(numNeighbors
)*sizeof(**(&rvStart)),(&rvStart),(size_t)(numNeighbors
)*sizeof(**(&reStart)),(&reStart),(size_t)(numNeighbors
)*sizeof(**(&rfStart)),(&rfStart),(size_t)(numNeighbors
)*sizeof(**(&rcStart)),(&rcStart))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9122,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9123 ierr = MPI_Type_contiguous(depth+1, MPIU_INT((MPI_Datatype)0x4c000405), &depthType);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9123,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9124 ierr = MPI_Type_commit(&depthType);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9124,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9125 ierr = PetscSFBcastBegin(sfProcess, depthType, depthSize, rdepthSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9125,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9126 ierr = PetscSFBcastEnd(sfProcess, depthType, depthSize, rdepthSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9126,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9127 for (n = 0; n < numNeighbors; ++n) {
9128 ierr = GetDepthStart_Private(depth, &rdepthSize[n*(depth+1)], &rcStartNew[n], &rfStartNew[n], &reStartNew[n], &rvStartNew[n]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9128,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9129 }
9130 depthSizeOld[depth] = cMax;
9131 depthSizeOld[0] = vMax;
9132 depthSizeOld[depth-1] = fMax;
9133 depthSizeOld[1] = eMax;
9134
9135 ierr = PetscSFBcastBegin(sfProcess, depthType, depthSizeOld, rdepthMaxOld);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9135,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9136 ierr = PetscSFBcastEnd(sfProcess, depthType, depthSizeOld, rdepthMaxOld);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9136,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9137
9138 depthSizeOld[depth] = cEnd - cStart;
9139 depthSizeOld[0] = vEnd - vStart;
9140 depthSizeOld[depth-1] = fEnd - fStart;
9141 depthSizeOld[1] = eEnd - eStart;
9142
9143 ierr = PetscSFBcastBegin(sfProcess, depthType, depthSizeOld, rdepthSizeOld);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9143,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9144 ierr = PetscSFBcastEnd(sfProcess, depthType, depthSizeOld, rdepthSizeOld);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9144,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9145 for (n = 0; n < numNeighbors; ++n) {
9146 ierr = GetDepthStart_Private(depth, &rdepthSizeOld[n*(depth+1)], &rcStart[n], &rfStart[n], &reStart[n], &rvStart[n]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9146,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9147 rdepthMaxOld[n*(depth+1)+depth] = rdepthMaxOld[n*(depth+1)+depth] < 0 ? rdepthSizeOld[n*(depth+1)+depth] +rcStart[n]: rdepthMaxOld[n*(depth+1)+depth];
9148 rdepthMaxOld[n*(depth+1)+depth-1] = rdepthMaxOld[n*(depth+1)+depth-1] < 0 ? rdepthSizeOld[n*(depth+1)+depth-1]+rfStart[n]: rdepthMaxOld[n*(depth+1)+depth-1];
9149 rdepthMaxOld[n*(depth+1)+1] = rdepthMaxOld[n*(depth+1)+1] < 0 ? rdepthSizeOld[n*(depth+1)+1] +reStart[n]: rdepthMaxOld[n*(depth+1)+1];
9150 }
9151 ierr = MPI_Type_free(&depthType);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9151,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9152 ierr = PetscSFDestroy(&sfProcess);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9152,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9153 /* Calculate new point SF */
9154 ierr = PetscMalloc1(numLeavesNew, &localPointsNew)PetscMallocA(1,PETSC_FALSE,9154,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeavesNew)*sizeof(**(&localPointsNew)),(&
localPointsNew))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9154,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9155 ierr = PetscMalloc1(numLeavesNew, &remotePointsNew)PetscMallocA(1,PETSC_FALSE,9155,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeavesNew)*sizeof(**(&remotePointsNew)),(&
remotePointsNew))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9155,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9156 ierr = ISGetIndices(processRanks, &neighbors);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9156,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9157 for (l = 0, m = 0; l < numLeaves; ++l) {
9158 PetscInt p = localPoints[l];
9159 PetscInt rp = remotePoints[l].index, n;
9160 PetscMPIInt rrank = remotePoints[l].rank;
9161
9162 ierr = PetscFindInt(rrank, numNeighbors, neighbors, &n);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9162,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9163 if (n < 0) SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Could not locate remote rank %D", rrank)return PetscError(((MPI_Comm)0x44000001),9163,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,63,PETSC_ERROR_INITIAL,"Could not locate remote rank %D",rrank
)
;
9164 switch (refiner) {
9165 case REFINER_SIMPLEX_1D:
9166 if ((p >= vStart) && (p < vEnd)) {
9167 /* Old vertices stay the same */
9168 localPointsNew[m] = vStartNew + (p - vStart);
9169 remotePointsNew[m].index = rvStartNew[n] + (rp - rvStart[n]);
9170 remotePointsNew[m].rank = rrank;
9171 ++m;
9172 } else if ((p >= cStart) && (p < cMax)) {
9173 /* Old interior cells add new cells and vertex */
9174 for (r = 0; r < 2; ++r, ++m) {
9175 localPointsNew[m] = cStartNew + (p - cStart)*2 + r;
9176 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*2 + r;
9177 remotePointsNew[m].rank = rrank;
9178 }
9179 localPointsNew[m] = vStartNew + (vEnd - vStart) + (p - cStart);
9180 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rp - rcStart[n]);
9181 remotePointsNew[m].rank = rrank;
9182 ++m;
9183 }
9184 break;
9185 case REFINER_SIMPLEX_2D:
9186 case REFINER_HYBRID_SIMPLEX_2D:
9187 if ((p >= vStart) && (p < vEnd)) {
9188 /* Old vertices stay the same */
9189 localPointsNew[m] = vStartNew + (p - vStart);
9190 remotePointsNew[m].index = rvStartNew[n] + (rp - rvStart[n]);
9191 remotePointsNew[m].rank = rrank;
9192 ++m;
9193 } else if ((p >= fStart) && (p < fMax)) {
9194 /* Old interior faces add new faces and vertex */
9195 for (r = 0; r < 2; ++r, ++m) {
9196 localPointsNew[m] = fStartNew + (p - fStart)*2 + r;
9197 remotePointsNew[m].index = rfStartNew[n] + (rp - rfStart[n])*2 + r;
9198 remotePointsNew[m].rank = rrank;
9199 }
9200 localPointsNew[m] = vStartNew + (vEnd - vStart) + (p - fStart);
9201 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rp - rfStart[n]);
9202 remotePointsNew[m].rank = rrank;
9203 ++m;
9204 } else if ((p >= fMax) && (p < fEnd)) {
9205 /* Old hybrid faces stay the same */
9206 localPointsNew[m] = fStartNew + (fMax - fStart)*2 + (p - fMax);
9207 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*2 + (rp - rdepthMaxOld[n*(depth+1)+depth-1]);
9208 remotePointsNew[m].rank = rrank;
9209 ++m;
9210 } else if ((p >= cStart) && (p < cMax)) {
9211 /* Old interior cells add new cells and interior faces */
9212 for (r = 0; r < 4; ++r, ++m) {
9213 localPointsNew[m] = cStartNew + (p - cStart)*4 + r;
9214 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*4 + r;
9215 remotePointsNew[m].rank = rrank;
9216 }
9217 for (r = 0; r < 3; ++r, ++m) {
9218 localPointsNew[m] = fStartNew + (fMax - fStart)*2 + (p - cStart)*3 + r;
9219 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*2 + (rp - rcStart[n])*3 + r;
9220 remotePointsNew[m].rank = rrank;
9221 }
9222 } else if ((p >= cMax) && (p < cEnd)) {
9223 /* Old hybrid cells add new cells and hybrid face */
9224 for (r = 0; r < 2; ++r, ++m) {
9225 localPointsNew[m] = cStartNew + (p - cStart)*4 + r;
9226 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*4 + r;
9227 remotePointsNew[m].rank = rrank;
9228 }
9229 localPointsNew[m] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (p - cMax);
9230 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*3 + (rp - rdepthMaxOld[n*(depth+1)+depth]);
9231 remotePointsNew[m].rank = rrank;
9232 ++m;
9233 }
9234 break;
9235 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
9236 case REFINER_SIMPLEX_TO_HEX_2D:
9237 if ((p >= vStart) && (p < vEnd)) {
9238 /* Old vertices stay the same */
9239 localPointsNew[m] = vStartNew + (p - vStart);
9240 remotePointsNew[m].index = rvStartNew[n] + (rp - rvStart[n]);
9241 remotePointsNew[m].rank = rrank;
9242 ++m;
9243 } else if ((p >= fStart) && (p < fEnd)) {
9244 /* Old interior faces add new faces and vertex */
9245 for (r = 0; r < 2; ++r, ++m) {
9246 localPointsNew[m] = fStartNew + (p - fStart)*2 + r;
9247 remotePointsNew[m].index = rfStartNew[n] + (rp - rfStart[n])*2 + r;
9248 remotePointsNew[m].rank = rrank;
9249 }
9250 localPointsNew[m] = vStartNew + (vEnd - vStart) + (p - fStart);
9251 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rp - rfStart[n]);
9252 remotePointsNew[m].rank = rrank;
9253 ++m;
9254 } else if ((p >= cStart) && (p < cMax)) {
9255 /* Old interior cells add new cells, interior faces, and a vertex */
9256 for (r = 0; r < 3; ++r, ++m) {
9257 localPointsNew[m] = cStartNew + (p - cStart)*3 + r;
9258 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*3 + r;
9259 remotePointsNew[m].rank = rrank;
9260 }
9261 for (r = 0; r < 3; ++r, ++m) {
9262 localPointsNew[m] = fStartNew + (fEnd - fStart)*2 + (p - cStart)*3 + r;
9263 remotePointsNew[m].index = rfStartNew[n] + rdepthSizeOld[n*(depth+1)+depth-1]*2 + (rp - rcStart[n])*3 + r;
9264 remotePointsNew[m].rank = rrank;
9265 }
9266 localPointsNew[m] = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (p - cStart);
9267 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + rdepthSizeOld[n*(depth+1)+depth-1] + (rp - rcStart[n]);
9268 remotePointsNew[m].rank = rrank;
9269 ++m;
9270 } else if ((p >= cMax) && (p < cEnd)) {
9271 /* Old interior hybrid cells add new cells, interior faces, and a vertex */
9272 for (r = 0; r < 4; ++r, ++m) {
9273 localPointsNew[m] = cStartNew + (cMax - cStart)*3 + (p - cMax)*4 + r;
9274 remotePointsNew[m].index = rcStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*3 + (rp - rdepthMaxOld[n*(depth+1)+depth])*4 + r;
9275 remotePointsNew[m].rank = rrank;
9276 }
9277 for (r = 0; r < 4; ++r, ++m) {
9278 localPointsNew[m] = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (p - cMax)*4 + r;
9279 remotePointsNew[m].index = rfStartNew[n] + rdepthSizeOld[n*(depth+1)+depth-1]*2 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*3 + (rp - rdepthMaxOld[n*(depth+1)+depth])*4 + r;
9280 remotePointsNew[m].rank = rrank;
9281 }
9282 localPointsNew[m] = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (p - cStart);
9283 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + rdepthSizeOld[n*(depth+1)+depth-1] + (rp - rcStart[n]);
9284 remotePointsNew[m].rank = rrank;
9285 ++m;
9286 }
9287 break;
9288 case REFINER_HEX_2D:
9289 case REFINER_HYBRID_HEX_2D:
9290 if ((p >= vStart) && (p < vEnd)) {
9291 /* Old vertices stay the same */
9292 localPointsNew[m] = vStartNew + (p - vStart);
9293 remotePointsNew[m].index = rvStartNew[n] + (rp - rvStart[n]);
9294 remotePointsNew[m].rank = rrank;
9295 ++m;
9296 } else if ((p >= fStart) && (p < fMax)) {
9297 /* Old interior faces add new faces and vertex */
9298 for (r = 0; r < 2; ++r, ++m) {
9299 localPointsNew[m] = fStartNew + (p - fStart)*2 + r;
9300 remotePointsNew[m].index = rfStartNew[n] + (rp - rfStart[n])*2 + r;
9301 remotePointsNew[m].rank = rrank;
9302 }
9303 localPointsNew[m] = vStartNew + (vEnd - vStart) + (p - fStart);
9304 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rp - rfStart[n]);
9305 remotePointsNew[m].rank = rrank;
9306 ++m;
9307 } else if ((p >= fMax) && (p < fEnd)) {
9308 /* Old hybrid faces stay the same */
9309 localPointsNew[m] = fStartNew + (fMax - fStart)*2 + (p - fMax);
9310 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*2 + (rp - rdepthMaxOld[n*(depth+1)+depth-1]);
9311 remotePointsNew[m].rank = rrank;
9312 ++m;
9313 } else if ((p >= cStart) && (p < cMax)) {
9314 /* Old interior cells add new cells, interior faces, and vertex */
9315 for (r = 0; r < 4; ++r, ++m) {
9316 localPointsNew[m] = cStartNew + (p - cStart)*4 + r;
9317 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*4 + r;
9318 remotePointsNew[m].rank = rrank;
9319 }
9320 for (r = 0; r < 4; ++r, ++m) {
9321 localPointsNew[m] = fStartNew + (fMax - fStart)*2 + (p - cStart)*4 + r;
9322 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*2 + (rp - rcStart[n])*4 + r;
9323 remotePointsNew[m].rank = rrank;
9324 }
9325 localPointsNew[m] = vStartNew + (vEnd - vStart) + (fMax - fStart) + (p - cStart);
9326 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n]) + (rp - rcStart[n]);
9327 remotePointsNew[m].rank = rrank;
9328 ++m;
9329 } else if ((p >= cStart) && (p < cMax)) {
9330 /* Old hybrid cells add new cells and hybrid face */
9331 for (r = 0; r < 2; ++r, ++m) {
9332 localPointsNew[m] = cStartNew + (p - cStart)*4 + r; /* TODO: is this a bug? */
9333 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*4 + r; /* TODO: is this a bug? */
9334 remotePointsNew[m].rank = rrank;
9335 }
9336 localPointsNew[m] = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (p - cMax);
9337 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*4 + (rp - rdepthMaxOld[n*(depth+1)+depth]);
9338 remotePointsNew[m].rank = rrank;
9339 ++m;
9340 }
9341 break;
9342 case REFINER_SIMPLEX_3D:
9343 case REFINER_HYBRID_SIMPLEX_3D:
9344 if ((p >= vStart) && (p < vEnd)) {
9345 /* Interior vertices stay the same */
9346 localPointsNew[m] = vStartNew + (p - vStart);
9347 remotePointsNew[m].index = rvStartNew[n] + (rp - rvStart[n]);
9348 remotePointsNew[m].rank = rrank;
9349 ++m;
9350 } else if ((p >= eStart) && (p < eMax)) {
9351 /* Interior edges add new edges and vertex */
9352 for (r = 0; r < 2; ++r, ++m) {
9353 localPointsNew[m] = eStartNew + (p - eStart)*2 + r;
9354 remotePointsNew[m].index = reStartNew[n] + (rp - reStart[n])*2 + r;
9355 remotePointsNew[m].rank = rrank;
9356 }
9357 localPointsNew[m] = vStartNew + (vEnd - vStart) + (p - eStart);
9358 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rp - reStart[n]);
9359 remotePointsNew[m].rank = rrank;
9360 ++m;
9361 } else if ((p >= eMax) && (p < eEnd)) {
9362 /* Hybrid edges stay the same */
9363 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (p - eMax);
9364 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*3 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n]) + (rp - rdepthMaxOld[n*(depth+1)+1]);
9365 remotePointsNew[m].rank = rrank;
9366 ++m;
9367 } else if ((p >= fStart) && (p < fMax)) {
9368 /* Interior faces add new faces and edges */
9369 for (r = 0; r < 4; ++r, ++m) {
9370 localPointsNew[m] = fStartNew + (p - fStart)*4 + r;
9371 remotePointsNew[m].index = rfStartNew[n] + (rp - rfStart[n])*4 + r;
9372 remotePointsNew[m].rank = rrank;
9373 }
9374 for (r = 0; r < 3; ++r, ++m) {
9375 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (p - fStart)*3 + r;
9376 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rp - rfStart[n])*3 + r;
9377 remotePointsNew[m].rank = rrank;
9378 }
9379 } else if ((p >= fMax) && (p < fEnd)) {
9380 /* Hybrid faces add new faces and edges */
9381 for (r = 0; r < 2; ++r, ++m) {
9382 localPointsNew[m] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (p - fMax)*2 + r;
9383 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*8 + (rp - rdepthMaxOld[n*(depth+1)+depth-1])*2 + r;
9384 remotePointsNew[m].rank = rrank;
9385 }
9386 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (eEnd - eMax) + (p - fMax);
9387 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*3 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n]) + (rdepthSizeOld[n*(depth+1)+1]+reStart[n] - rdepthMaxOld[n*(depth+1)+1]) + (rp - rdepthMaxOld[n*(depth+1)+depth-1]);
9388 remotePointsNew[m].rank = rrank;
9389 ++m;
9390 } else if ((p >= cStart) && (p < cMax)) {
9391 /* Interior cells add new cells, faces, and edges */
9392 for (r = 0; r < 8; ++r, ++m) {
9393 localPointsNew[m] = cStartNew + (p - cStart)*8 + r;
9394 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*8 + r;
9395 remotePointsNew[m].rank = rrank;
9396 }
9397 for (r = 0; r < 8; ++r, ++m) {
9398 localPointsNew[m] = fStartNew + (fMax - fStart)*4 + (p - cStart)*8 + r;
9399 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rp - rcStart[n])*8 + r;
9400 remotePointsNew[m].rank = rrank;
9401 }
9402 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (p - cStart)*1 + 0;
9403 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*3 + (rp - rcStart[n])*1 + 0;
9404 remotePointsNew[m].rank = rrank;
9405 ++m;
9406 } else if ((p >= cMax) && (p < cEnd)) {
9407 /* Hybrid cells add new cells and faces */
9408 for (r = 0; r < 4; ++r, ++m) {
9409 localPointsNew[m] = cStartNew + (cMax - cStart)*8 + (p - cMax)*4 + r;
9410 remotePointsNew[m].index = rcStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*8 + (rp - rdepthMaxOld[n*(depth+1)+depth])*4 + r;
9411 remotePointsNew[m].rank = rrank;
9412 }
9413 for (r = 0; r < 3; ++r, ++m) {
9414 localPointsNew[m] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (p - cMax)*3 + r;
9415 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*8 + (rdepthSizeOld[n*(depth+1)+depth-1]+rfStart[n] - rdepthMaxOld[n*(depth+1)+depth-1])*2 + (rp - rdepthMaxOld[n*(depth+1)+depth])*3 + r;
9416 remotePointsNew[m].rank = rrank;
9417 }
9418 }
9419 break;
9420 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
9421 case REFINER_SIMPLEX_TO_HEX_3D:
9422 if ((p >= vStart) && (p < vEnd)) {
9423 /* Interior vertices stay the same */
9424 localPointsNew[m] = vStartNew + (p - vStart);
9425 remotePointsNew[m].index = rvStartNew[n] + (rp - rvStart[n]);
9426 remotePointsNew[m].rank = rrank;
9427 ++m;
9428 } else if ((p >= eStart) && (p < eMax)) {
9429 /* Interior edges add new edges and vertex */
9430 for (r = 0; r < 2; ++r, ++m) {
9431 localPointsNew[m] = eStartNew + (p - eStart)*2 + r;
9432 remotePointsNew[m].index = reStartNew[n] + (rp - reStart[n])*2 + r;
9433 remotePointsNew[m].rank = rrank;
9434 }
9435 localPointsNew[m] = vStartNew + (vEnd - vStart) + (p - eStart);
9436 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rp - reStart[n]);
9437 remotePointsNew[m].rank = rrank;
9438 ++m;
9439 } else if ((p >= eMax) && (p < eEnd)) {
9440 /* Hybrid edges stay the same */
9441 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (p - eMax);
9442 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*3 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*4 + (rp - rdepthMaxOld[n*(depth+1)+1]);
9443 remotePointsNew[m].rank = rrank;
9444 ++m;
9445 } else if ((p >= fStart) && (p < fMax)) {
9446 /* Interior faces add new faces, edges and a vertex */
9447 for (r = 0; r < 3; ++r, ++m) {
9448 localPointsNew[m] = fStartNew + (p - fStart)*3 + r;
9449 remotePointsNew[m].index = rfStartNew[n] + (rp - rfStart[n])*3 + r;
9450 remotePointsNew[m].rank = rrank;
9451 }
9452 for (r = 0; r < 3; ++r, ++m) {
9453 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (p - fStart)*3 + r;
9454 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rp - rfStart[n])*3 + r;
9455 remotePointsNew[m].rank = rrank;
9456 }
9457 localPointsNew[m] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (p - fStart);
9458 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n]) + (rp - rfStart[n]);
9459 remotePointsNew[m].rank = rrank;
9460 ++m;
9461 } else if ((p >= fMax) && (p < fEnd)) {
9462 /* Interior hybrid faces add new faces and an edge */
9463 for (r = 0; r < 2; ++r, ++m) {
9464 localPointsNew[m] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (p - fMax)*2 + r;
9465 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1]- rfStart[n])*3 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*6 + (rp - rdepthMaxOld[n*(depth+1)+depth-1])*2 + r;
9466 remotePointsNew[m].rank = rrank;
9467 }
9468 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (p - fMax);
9469 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1]- rfStart[n])*3 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*4 + (rdepthSizeOld[n*(depth+1)+1]+reStart[n] - rdepthMaxOld[n*(depth+1)+1]) + (rp - rdepthMaxOld[n*(depth+1)+depth-1]);
9470 remotePointsNew[m].rank = rrank;
9471 ++m;
9472 } else if ((p >= cStart) && (p < cMax)) {
9473 /* Interior cells add new cells, faces, edges, and a vertex */
9474 for (r = 0; r < 4; ++r, ++m) {
9475 localPointsNew[m] = cStartNew + (p - cStart)*4 + r;
9476 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*4 + r;
9477 remotePointsNew[m].rank = rrank;
9478 }
9479 for (r = 0; r < 6; ++r, ++m) {
9480 localPointsNew[m] = fStartNew + (fMax - fStart)*3 + (p - cStart)*6 + r;
9481 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1]- rfStart[n])*3 + (rp - rcStart[n])*6 + r;
9482 remotePointsNew[m].rank = rrank;
9483 }
9484 for (r = 0; r < 4; ++r, ++m) {
9485 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (p - cStart)*4 + r;
9486 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1]- reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1]- rfStart[n])*3 + (rp - rcStart[n])*4 + r;
9487 remotePointsNew[m].rank = rrank;
9488 }
9489 localPointsNew[m] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax - fStart) + (p - cStart);
9490 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rdepthMaxOld[n*(depth+1)+1]- reStart[n]) + (rdepthMaxOld[n*(depth+1)+depth-1]- rfStart[n]) + (rp - rcStart[n]);
9491 remotePointsNew[m].rank = rrank;
9492 ++m;
9493 } else if ((p >= cMax) && (p < cEnd)) {
9494 /* Interior hybrid cells add new cells, faces and an edge */
9495 for (r = 0; r < 3; ++r, ++m) {
9496 localPointsNew[m] = cStartNew + (cMax - cStart)*4 + (p - cMax)*3 + r;
9497 remotePointsNew[m].index = rcStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*4 + (rp - rdepthMaxOld[n*(depth+1)+depth])*3 + r;
9498 remotePointsNew[m].rank = rrank;
9499 }
9500 for (r = 0; r < 3; ++r, ++m) {
9501 localPointsNew[m] = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (p - cMax)*3 + r;
9502 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1]- rfStart[n])*3 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*6 + (rdepthSizeOld[n*(depth+1)+depth-1]+rfStart[n] - rdepthMaxOld[n*(depth+1)+depth-1])*2 + (rp - rdepthMaxOld[n*(depth+1)+depth])*3 + r;
9503 remotePointsNew[m].rank = rrank;
9504 }
9505 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (fEnd - fMax) + (p - cMax);
9506 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1]- reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1]- rfStart[n])*3 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*4 + (rdepthSizeOld[n*(depth+1)+1]+reStart[n] - rdepthMaxOld[n*(depth+1)+1]) + (rdepthSizeOld[n*(depth+1)+depth-1]+rfStart[n] - rdepthMaxOld[n*(depth+1)+depth-1]) + (rp - rdepthMaxOld[n*(depth+1)+depth]);
9507 remotePointsNew[m].rank = rrank;
9508 ++m;
9509 }
9510 break;
9511 case REFINER_HEX_3D:
9512 case REFINER_HYBRID_HEX_3D:
9513 if ((p >= vStart) && (p < vEnd)) {
9514 /* Interior vertices stay the same */
9515 localPointsNew[m] = vStartNew + (p - vStart);
9516 remotePointsNew[m].index = rvStartNew[n] + (rp - rvStart[n]);
9517 remotePointsNew[m].rank = rrank;
9518 ++m;
9519 } else if ((p >= eStart) && (p < eMax)) {
9520 /* Interior edges add new edges and vertex */
9521 for (r = 0; r < 2; ++r, ++m) {
9522 localPointsNew[m] = eStartNew + (p - eStart)*2 + r;
9523 remotePointsNew[m].index = reStartNew[n] + (rp - reStart[n])*2 + r;
9524 remotePointsNew[m].rank = rrank;
9525 }
9526 localPointsNew[m] = vStartNew + (vEnd - vStart) + (p - eStart);
9527 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rp - reStart[n]);
9528 remotePointsNew[m].rank = rrank;
9529 ++m;
9530 } else if ((p >= eMax) && (p < eEnd)) {
9531 /* Hybrid edges stay the same */
9532 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (p - eMax);
9533 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*6 + (rp - rdepthMaxOld[n*(depth+1)+1]);
9534 remotePointsNew[m].rank = rrank;
9535 ++m;
9536 } else if ((p >= fStart) && (p < fMax)) {
9537 /* Interior faces add new faces, edges, and vertex */
9538 for (r = 0; r < 4; ++r, ++m) {
9539 localPointsNew[m] = fStartNew + (p - fStart)*4 + r;
9540 remotePointsNew[m].index = rfStartNew[n] + (rp - rfStart[n])*4 + r;
9541 remotePointsNew[m].rank = rrank;
9542 }
9543 for (r = 0; r < 4; ++r, ++m) {
9544 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (p - fStart)*4 + r;
9545 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rp - rfStart[n])*4 + r;
9546 remotePointsNew[m].rank = rrank;
9547 }
9548 localPointsNew[m] = vStartNew + (vEnd - vStart) + (eMax - eStart) + (p - fStart);
9549 remotePointsNew[m].index = rvStartNew[n] + rdepthSizeOld[n*(depth+1)+0] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n]) + (rp - rfStart[n]);
9550 remotePointsNew[m].rank = rrank;
9551 ++m;
9552 } else if ((p >= fMax) && (p < fEnd)) {
9553 /* Hybrid faces add new faces and edges */
9554 for (r = 0; r < 2; ++r, ++m) {
9555 localPointsNew[m] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (p - fMax)*2 + r;
9556 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*12 + (rp - rdepthMaxOld[n*(depth+1)+depth-1])*2 + r;
9557 remotePointsNew[m].rank = rrank;
9558 }
9559 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (p - fMax);
9560 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*6 + (rdepthSizeOld[n*(depth+1)+1]+reStart[n] - rdepthMaxOld[n*(depth+1)+1]) + (rp - rdepthMaxOld[n*(depth+1)+depth-1]);
9561 remotePointsNew[m].rank = rrank;
9562 ++m;
9563 } else if ((p >= cStart) && (p < cMax)) {
9564 /* Interior cells add new cells, faces, edges, and vertex */
9565 for (r = 0; r < 8; ++r, ++m) {
9566 localPointsNew[m] = cStartNew + (p - cStart)*8 + r;
9567 remotePointsNew[m].index = rcStartNew[n] + (rp - rcStart[n])*8 + r;
9568 remotePointsNew[m].rank = rrank;
9569 }
9570 for (r = 0; r < 12; ++r, ++m) {
9571 localPointsNew[m] = fStartNew + (fMax - fStart)*4 + (p - cStart)*12 + r;
9572 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rp - rcStart[n])*12 + r;
9573 remotePointsNew[m].rank = rrank;
9574 }
9575 for (r = 0; r < 6; ++r, ++m) {
9576 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (p - cStart)*6 + r;
9577 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rp - rcStart[n])*6 + r;
9578 remotePointsNew[m].rank = rrank;
9579 }
9580 for (r = 0; r < 1; ++r, ++m) {
9581 localPointsNew[m] = vStartNew + (eMax - eStart) + (fMax - fStart) + (p - cStart) + r;
9582 remotePointsNew[m].index = rvStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n]) + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n]) + (rp - rcStart[n]) + r;
9583 remotePointsNew[m].rank = rrank;
9584 }
9585 } else if ((p >= cMax) && (p < cEnd)) {
9586 /* Hybrid cells add new cells, faces, and edges */
9587 for (r = 0; r < 4; ++r, ++m) {
9588 localPointsNew[m] = cStartNew + (cMax - cStart)*8 + (p - cMax)*4 + r;
9589 remotePointsNew[m].index = rcStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*8 + (rp - rdepthMaxOld[n*(depth+1)+depth])*4 + r;
9590 remotePointsNew[m].rank = rrank;
9591 }
9592 for (r = 0; r < 4; ++r, ++m) {
9593 localPointsNew[m] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (p - cMax)*4 + r;
9594 remotePointsNew[m].index = rfStartNew[n] + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*12 + (rdepthSizeOld[n*(depth+1)+depth-1]+rfStart[n] - rdepthMaxOld[n*(depth+1)+depth-1])*2 + (rp - rdepthMaxOld[n*(depth+1)+depth])*4 + r;
9595 remotePointsNew[m].rank = rrank;
9596 }
9597 localPointsNew[m] = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (eEnd - eMax) + (fEnd - fMax) + (p - cMax);
9598 remotePointsNew[m].index = reStartNew[n] + (rdepthMaxOld[n*(depth+1)+1] - reStart[n])*2 + (rdepthMaxOld[n*(depth+1)+depth-1] - rfStart[n])*4 + (rdepthMaxOld[n*(depth+1)+depth] - rcStart[n])*6 + (rdepthSizeOld[n*(depth+1)+1]+reStart[n] - rdepthMaxOld[n*(depth+1)+1]) + (rdepthSizeOld[n*(depth+1)+depth-1]+rfStart[n] - rdepthMaxOld[n*(depth+1)+depth-1]) + (rp - rdepthMaxOld[n*(depth+1)+depth]);
9599 remotePointsNew[m].rank = rrank;
9600 ++m;
9601 }
9602 break;
9603 default:
9604 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),9604,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
9605 }
9606 }
9607 if (m != numLeavesNew) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Number of leaf point %D should be %D", m, numLeavesNew)return PetscError(((MPI_Comm)0x44000001),9607,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,77,PETSC_ERROR_INITIAL,"Number of leaf point %D should be %D"
,m,numLeavesNew)
;
9608 ierr = ISRestoreIndices(processRanks, &neighbors);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9608,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9609 ierr = ISDestroy(&processRanks);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9609,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9610 {
9611 PetscSFNode *rp, *rtmp;
9612 PetscInt *lp, *idx, *ltmp, i;
9613
9614 /* SF needs sorted leaves to correct calculate Gather */
9615 ierr = PetscMalloc1(numLeavesNew,&idx)PetscMallocA(1,PETSC_FALSE,9615,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeavesNew)*sizeof(**(&idx)),(&idx))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9615,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9616 ierr = PetscMalloc1(numLeavesNew, &lp)PetscMallocA(1,PETSC_FALSE,9616,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeavesNew)*sizeof(**(&lp)),(&lp))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9616,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9617 ierr = PetscMalloc1(numLeavesNew, &rp)PetscMallocA(1,PETSC_FALSE,9617,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(numLeavesNew)*sizeof(**(&rp)),(&rp))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9617,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9618 for (i = 0; i < numLeavesNew; ++i) {
9619 if ((localPointsNew[i] < pStartNew) || (localPointsNew[i] >= pEndNew)) SETERRQ4(PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Local SF point %D (%D) not in [%D, %D)", localPointsNew[i], i, pStartNew, pEndNew)return PetscError(((MPI_Comm)0x44000001),9619,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,63,PETSC_ERROR_INITIAL,"Local SF point %D (%D) not in [%D, %D)"
,localPointsNew[i],i,pStartNew,pEndNew)
;
9620 idx[i] = i;
9621 }
9622 ierr = PetscSortIntWithPermutation(numLeavesNew, localPointsNew, idx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9622,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9623 for (i = 0; i < numLeavesNew; ++i) {
9624 lp[i] = localPointsNew[idx[i]];
9625 rp[i] = remotePointsNew[idx[i]];
9626 }
9627 ltmp = localPointsNew;
9628 localPointsNew = lp;
9629 rtmp = remotePointsNew;
9630 remotePointsNew = rp;
9631 ierr = PetscFree(idx)((*PetscTrFree)((void*)(idx),9631,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((idx) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9631,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9632 ierr = PetscFree(ltmp)((*PetscTrFree)((void*)(ltmp),9632,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((ltmp) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9632,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9633 ierr = PetscFree(rtmp)((*PetscTrFree)((void*)(rtmp),9633,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((rtmp) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9633,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9634 }
9635 ierr = PetscSFSetGraph(sfNew, pEndNew-pStartNew, numLeavesNew, localPointsNew, PETSC_OWN_POINTER, remotePointsNew, PETSC_OWN_POINTER);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9635,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9636 ierr = PetscFree5(rdepthSize,rvStartNew,reStartNew,rfStartNew,rcStartNew)PetscFreeA(5,9636,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,&(rdepthSize),&(rvStartNew),&(reStartNew),&(
rfStartNew),&(rcStartNew))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9636,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9637 ierr = PetscFree7(depthSizeOld,rdepthSizeOld,rdepthMaxOld,rvStart,reStart,rfStart,rcStart)PetscFreeA(7,9637,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,&(depthSizeOld),&(rdepthSizeOld),&(rdepthMaxOld)
,&(rvStart),&(reStart),&(rfStart),&(rcStart))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9637,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9638 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
9639}
9640
9641static PetscErrorCode CellRefinerCreateLabels(CellRefiner refiner, DM dm, PetscInt depthSize[], DM rdm)
9642{
9643 PetscInt numLabels, l;
9644 PetscInt depth, newp, cStart, cEnd, cMax, vStart, vEnd, vMax, fStart, fEnd, fMax, eStart, eEnd, eMax, r;
9645 PetscInt cStartNew = 0, vStartNew = 0, fStartNew = 0, eStartNew = 0;
9646 PetscErrorCode ierr;
9647
9648 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 9648; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
9649 ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9649,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9650 ierr = DMPlexGetDepthStratum(dm, 1, &eStart, &eEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9650,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9651 ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9651,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9652 ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9652,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9653 ierr = DMPlexGetDepth(dm, &depth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9653,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9654 if (refiner) {ierr = GetDepthStart_Private(depth, depthSize, &cStartNew, &fStartNew, &eStartNew, &vStartNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9654,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
9655 ierr = DMGetNumLabels(dm, &numLabels);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9655,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9656 ierr = DMPlexGetHybridBounds(dm, &cMax, &fMax, &eMax, &vMax);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9656,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9657 switch (refiner) {
9658 case REFINER_NOOP:
9659 case REFINER_SIMPLEX_1D:
9660 case REFINER_SIMPLEX_2D:
9661 case REFINER_SIMPLEX_TO_HEX_2D:
9662 case REFINER_HEX_2D:
9663 case REFINER_SIMPLEX_3D:
9664 case REFINER_HEX_3D:
9665 case REFINER_SIMPLEX_TO_HEX_3D:
9666 break;
9667 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
9668 case REFINER_HYBRID_SIMPLEX_3D:
9669 case REFINER_HYBRID_HEX_3D:
9670 if (eMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No edge maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),9670,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No edge maximum specified in hybrid mesh"
)
;
9671 case REFINER_HYBRID_SIMPLEX_2D:
9672 case REFINER_HYBRID_HEX_2D:
9673 if (fMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No face maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),9673,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No face maximum specified in hybrid mesh"
)
;
9674 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
9675 if (cMax < 0) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "No cell maximum specified in hybrid mesh")return PetscError(((MPI_Comm)0x44000001),9675,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"No cell maximum specified in hybrid mesh"
)
;
9676 break;
9677 default:
9678 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),9678,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
9679 }
9680 cMax = cMax < 0 ? cEnd : cMax;
9681 fMax = fMax < 0 ? fEnd : fMax;
9682 eMax = eMax < 0 ? eEnd : eMax;
9683 for (l = 0; l < numLabels; ++l) {
9684 DMLabel label, labelNew;
9685 const char *lname;
9686 PetscBool isDepth;
9687 IS valueIS;
9688 const PetscInt *values;
9689 PetscInt defVal;
9690 PetscInt numValues, val;
9691
9692 ierr = DMGetLabelName(dm, l, &lname);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9692,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9693 ierr = PetscStrcmp(lname, "depth", &isDepth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9693,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9694 if (isDepth) continue;
9695 ierr = DMCreateLabel(rdm, lname);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9695,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9696 ierr = DMGetLabel(dm, lname, &label);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9696,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9697 ierr = DMGetLabel(rdm, lname, &labelNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9697,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9698 ierr = DMLabelGetDefaultValue(label,&defVal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9698,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9699 ierr = DMLabelSetDefaultValue(labelNew,defVal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9699,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9700 ierr = DMLabelGetValueIS(label, &valueIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9700,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9701 ierr = ISGetLocalSize(valueIS, &numValues);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9701,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9702 ierr = ISGetIndices(valueIS, &values);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9702,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9703 for (val = 0; val < numValues; ++val) {
9704 IS pointIS;
9705 const PetscInt *points;
9706 PetscInt numPoints, n;
9707
9708 ierr = DMLabelGetStratumIS(label, values[val], &pointIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9708,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9709 ierr = ISGetLocalSize(pointIS, &numPoints);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9709,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9710 ierr = ISGetIndices(pointIS, &points);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9710,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9711 /* Ensure refined label is created with same number of strata as
9712 * original (even if no entries here). */
9713 ierr = DMLabelAddStratum(labelNew, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9713,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9714 for (n = 0; n < numPoints; ++n) {
9715 const PetscInt p = points[n];
9716 switch (refiner) {
9717 case REFINER_SIMPLEX_1D:
9718 if ((p >= vStart) && (p < vEnd)) {
9719 /* Old vertices stay the same */
9720 newp = vStartNew + (p - vStart);
9721 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9721,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9722 } else if ((p >= cStart) && (p < cEnd)) {
9723 /* Old cells add new cells and vertex */
9724 newp = vStartNew + (vEnd - vStart) + (p - cStart);
9725 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9725,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9726 for (r = 0; r < 2; ++r) {
9727 newp = cStartNew + (p - cStart)*2 + r;
9728 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9728,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9729 }
9730 }
9731 break;
9732 case REFINER_SIMPLEX_2D:
9733 if ((p >= vStart) && (p < vEnd)) {
9734 /* Old vertices stay the same */
9735 newp = vStartNew + (p - vStart);
9736 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9736,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9737 } else if ((p >= fStart) && (p < fEnd)) {
9738 /* Old faces add new faces and vertex */
9739 newp = vStartNew + (vEnd - vStart) + (p - fStart);
9740 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9740,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9741 for (r = 0; r < 2; ++r) {
9742 newp = fStartNew + (p - fStart)*2 + r;
9743 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9743,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9744 }
9745 } else if ((p >= cStart) && (p < cEnd)) {
9746 /* Old cells add new cells and interior faces */
9747 for (r = 0; r < 4; ++r) {
9748 newp = cStartNew + (p - cStart)*4 + r;
9749 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9749,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9750 }
9751 for (r = 0; r < 3; ++r) {
9752 newp = fStartNew + (fEnd - fStart)*2 + (p - cStart)*3 + r;
9753 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9753,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9754 }
9755 }
9756 break;
9757 case REFINER_HYBRID_SIMPLEX_TO_HEX_2D:
9758 case REFINER_SIMPLEX_TO_HEX_2D:
9759 if ((p >= vStart) && (p < vEnd)) {
9760 /* Old vertices stay the same */
9761 newp = vStartNew + (p - vStart);
9762 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9762,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9763 } else if ((p >= fStart) && (p < fEnd)) {
9764 /* Old faces add new faces and vertex */
9765 newp = vStartNew + (vEnd - vStart) + (p - fStart);
9766 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9766,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9767 for (r = 0; r < 2; ++r) {
9768 newp = fStartNew + (p - fStart)*2 + r;
9769 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9769,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9770 }
9771 } else if ((p >= cStart) && (p < cMax)) {
9772 /* Old cells add new cells, interior faces, and a vertex */
9773 for (r = 0; r < 3; ++r) {
9774 newp = cStartNew + (p - cStart)*3 + r;
9775 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9775,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9776 }
9777 for (r = 0; r < 3; ++r) {
9778 newp = fStartNew + (fEnd - fStart)*2 + (p - cStart)*3 + r;
9779 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9779,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9780 }
9781 newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + p;
9782 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9782,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9783 } else if ((p >= cMax) && (p < cEnd)) {
9784 /* Old hybrid cells add new cells, interior faces, and a vertex */
9785 for (r = 0; r < 4; ++r) {
9786 newp = cStartNew + (cMax - cStart)*3 + (p - cMax)*4 + r;
9787 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9787,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9788 }
9789 for (r = 0; r < 4; ++r) {
9790 newp = fStartNew + (fEnd - fStart)*2 + (cMax - cStart)*3 + (p - cMax)*4 + r;
9791 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9792 }
9793 newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + p;
9794 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9794,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9795 }
9796 break;
9797 case REFINER_HEX_2D:
9798 if ((p >= vStart) && (p < vEnd)) {
9799 /* Old vertices stay the same */
9800 newp = vStartNew + (p - vStart);
9801 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9801,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9802 } else if ((p >= fStart) && (p < fEnd)) {
9803 /* Old faces add new faces and vertex */
9804 newp = vStartNew + (vEnd - vStart) + (p - fStart);
9805 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9805,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9806 for (r = 0; r < 2; ++r) {
9807 newp = fStartNew + (p - fStart)*2 + r;
9808 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9808,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9809 }
9810 } else if ((p >= cStart) && (p < cEnd)) {
9811 /* Old cells add new cells and interior faces and vertex */
9812 for (r = 0; r < 4; ++r) {
9813 newp = cStartNew + (p - cStart)*4 + r;
9814 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9814,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9815 }
9816 for (r = 0; r < 4; ++r) {
9817 newp = fStartNew + (fEnd - fStart)*2 + (p - cStart)*4 + r;
9818 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9818,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9819 }
9820 newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (p - cStart);
9821 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9821,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9822 }
9823 break;
9824 case REFINER_HYBRID_SIMPLEX_2D:
9825 if ((p >= vStart) && (p < vEnd)) {
9826 /* Old vertices stay the same */
9827 newp = vStartNew + (p - vStart);
9828 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9828,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9829 } else if ((p >= fStart) && (p < fMax)) {
9830 /* Old interior faces add new faces and vertex */
9831 newp = vStartNew + (vEnd - vStart) + (p - fStart);
9832 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9832,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9833 for (r = 0; r < 2; ++r) {
9834 newp = fStartNew + (p - fStart)*2 + r;
9835 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9835,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9836 }
9837 } else if ((p >= fMax) && (p < fEnd)) {
9838 /* Old hybrid faces stay the same */
9839 newp = fStartNew + (fMax - fStart)*2 + (p - fMax);
9840 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9840,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9841 } else if ((p >= cStart) && (p < cMax)) {
9842 /* Old interior cells add new cells and interior faces */
9843 for (r = 0; r < 4; ++r) {
9844 newp = cStartNew + (p - cStart)*4 + r;
9845 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9845,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9846 }
9847 for (r = 0; r < 3; ++r) {
9848 newp = fStartNew + (fEnd - fStart)*2 + (p - cStart)*3 + r;
9849 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9849,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9850 }
9851 } else if ((p >= cMax) && (p < cEnd)) {
9852 /* Old hybrid cells add new cells and hybrid face */
9853 for (r = 0; r < 2; ++r) {
9854 newp = cStartNew + (cMax - cStart)*4 + (p - cMax)*2 + r;
9855 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9855,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9856 }
9857 newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*3 + (p - cMax);
9858 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9858,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9859 }
9860 break;
9861 case REFINER_HYBRID_HEX_2D:
9862 if ((p >= vStart) && (p < vEnd)) {
9863 /* Old vertices stay the same */
9864 newp = vStartNew + (p - vStart);
9865 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9865,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9866 } else if ((p >= fStart) && (p < fMax)) {
9867 /* Old interior faces add new faces and vertex */
9868 newp = vStartNew + (vEnd - vStart) + (p - fStart);
9869 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9869,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9870 for (r = 0; r < 2; ++r) {
9871 newp = fStartNew + (p - fStart)*2 + r;
9872 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9872,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9873 }
9874 } else if ((p >= fMax) && (p < fEnd)) {
9875 /* Old hybrid faces stay the same */
9876 newp = fStartNew + (fMax - fStart)*2 + (p - fMax);
9877 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9877,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9878 } else if ((p >= cStart) && (p < cMax)) {
9879 /* Old interior cells add new cells, interior faces, and vertex */
9880 for (r = 0; r < 4; ++r) {
9881 newp = cStartNew + (p - cStart)*4 + r;
9882 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9882,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9883 }
9884 for (r = 0; r < 4; ++r) {
9885 newp = fStartNew + (fEnd - fStart)*2 + (p - cStart)*4 + r;
9886 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9886,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9887 }
9888 newp = vStartNew + (vEnd - vStart) + (fEnd - fStart) + (p - cStart);
9889 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9889,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9890 } else if ((p >= cMax) && (p < cEnd)) {
9891 /* Old hybrid cells add new cells and hybrid face */
9892 for (r = 0; r < 2; ++r) {
9893 newp = cStartNew + (cMax - cStart)*4 + (p - cMax)*2 + r;
9894 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9894,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9895 }
9896 newp = fStartNew + (fMax - fStart)*2 + (cMax - cStart)*4 + (p - cMax);
9897 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9897,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9898 }
9899 break;
9900 case REFINER_SIMPLEX_3D:
9901 if ((p >= vStart) && (p < vEnd)) {
9902 /* Old vertices stay the same */
9903 newp = vStartNew + (p - vStart);
9904 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9904,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9905 } else if ((p >= eStart) && (p < eEnd)) {
9906 /* Old edges add new edges and vertex */
9907 for (r = 0; r < 2; ++r) {
9908 newp = eStartNew + (p - eStart)*2 + r;
9909 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9909,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9910 }
9911 newp = vStartNew + (vEnd - vStart) + (p - eStart);
9912 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9912,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9913 } else if ((p >= fStart) && (p < fEnd)) {
9914 /* Old faces add new faces and edges */
9915 for (r = 0; r < 4; ++r) {
9916 newp = fStartNew + (p - fStart)*4 + r;
9917 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9917,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9918 }
9919 for (r = 0; r < 3; ++r) {
9920 newp = eStartNew + (eEnd - eStart)*2 + (p - fStart)*3 + r;
9921 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9921,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9922 }
9923 } else if ((p >= cStart) && (p < cEnd)) {
9924 /* Old cells add new cells and interior faces and edges */
9925 for (r = 0; r < 8; ++r) {
9926 newp = cStartNew + (p - cStart)*8 + r;
9927 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9927,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9928 }
9929 for (r = 0; r < 8; ++r) {
9930 newp = fStartNew + (fEnd - fStart)*4 + (p - cStart)*8 + r;
9931 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9931,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9932 }
9933 for (r = 0; r < 1; ++r) {
9934 newp = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*3 + (p - cStart)*1 + r;
9935 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9935,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9936 }
9937 }
9938 break;
9939 case REFINER_HYBRID_SIMPLEX_TO_HEX_3D:
9940 case REFINER_SIMPLEX_TO_HEX_3D:
9941 if ((p >= vStart) && (p < vEnd)) {
9942 /* Old vertices stay the same */
9943 newp = vStartNew + (p - vStart);
9944 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9944,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9945 } else if ((p >= eStart) && (p < eMax)) {
9946 /* Interior edges add new edges and vertex */
9947 for (r = 0; r < 2; ++r) {
9948 newp = eStartNew + (p - eStart)*2 + r;
9949 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9949,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9950 }
9951 newp = vStartNew + (vEnd - vStart) + (p - eStart);
9952 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9952,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9953 } else if ((p >= eMax) && (p < eEnd)) {
9954 /* Hybrid edges stay the same */
9955 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + p - eMax;
9956 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9956,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9957 } else if ((p >= fStart) && (p < fMax)) {
9958 /* Old faces add new faces, edges and a vertex */
9959 for (r = 0; r < 3; ++r) {
9960 newp = fStartNew + (p - fStart)*3 + r;
9961 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9961,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9962 }
9963 for (r = 0; r < 3; ++r) {
9964 newp = eStartNew + (eMax - eStart)*2 + (p - fStart)*3 + r;
9965 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9965,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9966 }
9967 } else if ((p >= fMax) && (p < fEnd)) {
9968 /* Old hybrid faces add new faces and an edge */
9969 for (r = 0; r < 2; ++r) {
9970 newp = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (p - fMax)*2 + r;
9971 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9971,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9972 }
9973 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (p - fMax);
9974 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9974,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9975 } else if ((p >= cStart) && (p < cMax)) {
9976 /* Old cells add new cells and interior faces and edges and a vertex */
9977 for (r = 0; r < 4; ++r) {
9978 newp = cStartNew + (p - cStart)*4 + r;
9979 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9979,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9980 }
9981 for (r = 0; r < 6; ++r) {
9982 newp = fStartNew + (fMax - fStart)*3 + (p - cStart)*6 + r;
9983 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9983,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9984 }
9985 for (r = 0; r < 4; ++r) {
9986 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (p - cStart)*4 + r;
9987 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9987,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9988 }
9989 newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax - fStart) + p - cStart;
9990 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9990,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9991 } else if ((p >= cMax) && (p < cEnd)) {
9992 /* Old hybrid cells add new cells and interior faces and an edge */
9993 for (r = 0; r < 3; ++r) {
9994 newp = cStartNew + (cMax - cStart)*4 + (p - cMax)*3 + r;
9995 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9995,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
9996 }
9997 for (r = 0; r < 3; ++r) {
9998 newp = fStartNew + (fMax - fStart)*3 + (cMax - cStart)*6 + (fEnd - fMax)*2 + (p - cMax)*3 + r;
9999 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),9999,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10000 }
10001 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart)*4 + (eEnd - eMax) + (fEnd - fMax) + p - cMax;
10002 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10002,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10003 }
10004 break;
10005 case REFINER_HYBRID_SIMPLEX_3D:
10006 if ((p >= vStart) && (p < vEnd)) {
10007 /* Interior vertices stay the same */
10008 newp = vStartNew + (p - vStart);
10009 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10009,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10010 } else if ((p >= eStart) && (p < eMax)) {
10011 /* Interior edges add new edges and vertex */
10012 for (r = 0; r < 2; ++r) {
10013 newp = eStartNew + (p - eStart)*2 + r;
10014 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10014,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10015 }
10016 newp = vStartNew + (vEnd - vStart) + (p - eStart);
10017 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10017,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10018 } else if ((p >= eMax) && (p < eEnd)) {
10019 /* Hybrid edges stay the same */
10020 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (p - eMax);
10021 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10021,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10022 } else if ((p >= fStart) && (p < fMax)) {
10023 /* Interior faces add new faces and edges */
10024 for (r = 0; r < 4; ++r) {
10025 newp = fStartNew + (p - fStart)*4 + r;
10026 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10026,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10027 }
10028 for (r = 0; r < 3; ++r) {
10029 newp = eStartNew + (eMax - eStart)*2 + (p - fStart)*3 + r;
10030 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10030,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10031 }
10032 } else if ((p >= fMax) && (p < fEnd)) {
10033 /* Hybrid faces add new faces and edges */
10034 for (r = 0; r < 2; ++r) {
10035 newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (p - fMax)*2 + r;
10036 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10036,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10037 }
10038 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (cMax - cStart) + (p - fMax);
10039 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10039,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10040 } else if ((p >= cStart) && (p < cMax)) {
10041 /* Interior cells add new cells, faces, and edges */
10042 for (r = 0; r < 8; ++r) {
10043 newp = cStartNew + (p - cStart)*8 + r;
10044 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10044,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10045 }
10046 for (r = 0; r < 8; ++r) {
10047 newp = fStartNew + (fMax - fStart)*4 + (p - cStart)*8 + r;
10048 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10048,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10049 }
10050 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*3 + (p - cStart);
10051 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10051,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10052 } else if ((p >= cMax) && (p < cEnd)) {
10053 /* Hybrid cells add new cells and faces */
10054 for (r = 0; r < 4; ++r) {
10055 newp = cStartNew + (cMax - cStart)*8 + (p - cMax)*4 + r;
10056 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10056,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10057 }
10058 for (r = 0; r < 3; ++r) {
10059 newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (p - cMax)*3 + r;
10060 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10060,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10061 }
10062 }
10063 break;
10064 case REFINER_HEX_3D:
10065 if ((p >= vStart) && (p < vEnd)) {
10066 /* Old vertices stay the same */
10067 newp = vStartNew + (p - vStart);
10068 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10068,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10069 } else if ((p >= eStart) && (p < eEnd)) {
10070 /* Old edges add new edges and vertex */
10071 for (r = 0; r < 2; ++r) {
10072 newp = eStartNew + (p - eStart)*2 + r;
10073 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10073,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10074 }
10075 newp = vStartNew + (vEnd - vStart) + (p - eStart);
10076 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10076,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10077 } else if ((p >= fStart) && (p < fEnd)) {
10078 /* Old faces add new faces, edges, and vertex */
10079 for (r = 0; r < 4; ++r) {
10080 newp = fStartNew + (p - fStart)*4 + r;
10081 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10081,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10082 }
10083 for (r = 0; r < 4; ++r) {
10084 newp = eStartNew + (eEnd - eStart)*2 + (p - fStart)*4 + r;
10085 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10085,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10086 }
10087 newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (p - fStart);
10088 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10088,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10089 } else if ((p >= cStart) && (p < cEnd)) {
10090 /* Old cells add new cells, faces, edges, and vertex */
10091 for (r = 0; r < 8; ++r) {
10092 newp = cStartNew + (p - cStart)*8 + r;
10093 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10093,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10094 }
10095 for (r = 0; r < 12; ++r) {
10096 newp = fStartNew + (fEnd - fStart)*4 + (p - cStart)*12 + r;
10097 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10097,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10098 }
10099 for (r = 0; r < 6; ++r) {
10100 newp = eStartNew + (eEnd - eStart)*2 + (fEnd - fStart)*4 + (p - cStart)*6 + r;
10101 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10101,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10102 }
10103 newp = vStartNew + (vEnd - vStart) + (eEnd - eStart) + (fEnd - fStart) + (p - cStart);
10104 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10104,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10105 }
10106 break;
10107 case REFINER_HYBRID_HEX_3D:
10108 if ((p >= vStart) && (p < vEnd)) {
10109 /* Interior vertices stay the same */
10110 newp = vStartNew + (p - vStart);
10111 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10111,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10112 } else if ((p >= eStart) && (p < eMax)) {
10113 /* Interior edges add new edges and vertex */
10114 for (r = 0; r < 2; ++r) {
10115 newp = eStartNew + (p - eStart)*2 + r;
10116 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10116,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10117 }
10118 newp = vStartNew + (vEnd - vStart) + (p - eStart);
10119 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10119,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10120 } else if ((p >= eMax) && (p < eEnd)) {
10121 /* Hybrid edges stay the same */
10122 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (p - eMax);
10123 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10123,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10124 } else if ((p >= fStart) && (p < fMax)) {
10125 /* Interior faces add new faces, edges, and vertex */
10126 for (r = 0; r < 4; ++r) {
10127 newp = fStartNew + (p - fStart)*4 + r;
10128 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10128,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10129 }
10130 for (r = 0; r < 4; ++r) {
10131 newp = eStartNew + (eMax - eStart)*2 + (p - fStart)*4 + r;
10132 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10132,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10133 }
10134 newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (p - fStart);
10135 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10135,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10136 } else if ((p >= fMax) && (p < fEnd)) {
10137 /* Hybrid faces add new faces and edges */
10138 for (r = 0; r < 2; ++r) {
10139 newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (p - fMax)*2 + r;
10140 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10140,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10141 }
10142 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (p - fMax);
10143 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10143,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10144 } else if ((p >= cStart) && (p < cMax)) {
10145 /* Interior cells add new cells, faces, edges, and vertex */
10146 for (r = 0; r < 8; ++r) {
10147 newp = cStartNew + (p - cStart)*8 + r;
10148 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10148,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10149 }
10150 for (r = 0; r < 12; ++r) {
10151 newp = fStartNew + (fMax - fStart)*4 + (p - cStart)*12 + r;
10152 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10152,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10153 }
10154 for (r = 0; r < 6; ++r) {
10155 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (p - cStart)*6 + r;
10156 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10156,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10157 }
10158 newp = vStartNew + (vEnd - vStart) + (eMax - eStart) + (fMax - fStart) + (p - cStart);
10159 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10159,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10160 } else if ((p >= cMax) && (p < cEnd)) {
10161 /* Hybrid cells add new cells, faces, and edges */
10162 for (r = 0; r < 4; ++r) {
10163 newp = cStartNew + (cMax - cStart)*8 + (p - cMax)*4 + r;
10164 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10164,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10165 }
10166 for (r = 0; r < 4; ++r) {
10167 newp = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*12 + (fEnd - fMax)*2 + (p - cMax)*4 + r;
10168 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10168,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10169 }
10170 newp = eStartNew + (eMax - eStart)*2 + (fMax - fStart)*4 + (cMax - cStart)*6 + (fEnd - fMax) + (p - cMax);
10171 ierr = DMLabelSetValue(labelNew, newp, values[val]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10171,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10172 }
10173 break;
10174 default:
10175 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[refiner])return PetscError(((MPI_Comm)0x44000001),10175,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[refiner])
;
10176 }
10177 }
10178 ierr = ISRestoreIndices(pointIS, &points);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10178,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10179 ierr = ISDestroy(&pointIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10179,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10180 }
10181 ierr = ISRestoreIndices(valueIS, &values);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10181,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10182 ierr = ISDestroy(&valueIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10182,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10183 }
10184 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10185}
10186
10187/* This will only work for interpolated meshes */
10188PetscErrorCode DMPlexRefineUniform_Internal(DM dm, CellRefiner cellRefiner, DM *dmRefined)
10189{
10190 DM rdm;
10191 PetscInt *depthSize;
10192 PetscInt dim, embedDim, depth = 0, d, pStart = 0, pEnd = 0;
10193 PetscErrorCode ierr;
10194
10195 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10195; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10196 ierr = DMCreate(PetscObjectComm((PetscObject)dm), &rdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10196,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10197 ierr = DMSetType(rdm, DMPLEX"plex");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10197,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10198 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10198,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10199 ierr = DMSetDimension(rdm, dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10199,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10200 ierr = DMGetCoordinateDim(dm, &embedDim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10200,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10201 ierr = DMSetCoordinateDim(rdm, embedDim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10201,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10202 /* Calculate number of new points of each depth */
10203 ierr = DMPlexGetDepth(dm, &depth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10203,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10204 if (depth >= 0 && dim != depth) SETERRQ(PetscObjectComm((PetscObject) dm), PETSC_ERR_ARG_WRONG, "Mesh must be interpolated for regular refinement")return PetscError(PetscObjectComm((PetscObject) dm),10204,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Mesh must be interpolated for regular refinement"
)
;
10205 ierr = PetscMalloc1(depth+1, &depthSize)PetscMallocA(1,PETSC_FALSE,10205,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(depth+1)*sizeof(**(&depthSize)),(&depthSize
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10205,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10206 ierr = PetscMemzero(depthSize, (depth+1) * sizeof(PetscInt));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10206,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10207 ierr = CellRefinerGetSizes(cellRefiner, dm, depthSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10207,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10208 /* Step 1: Set chart */
10209 for (d = 0; d <= depth; ++d) pEnd += depthSize[d];
10210 ierr = DMPlexSetChart(rdm, pStart, pEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10210,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10211 /* Step 2: Set cone/support sizes (automatically stratifies) */
10212 ierr = CellRefinerSetConeSizes(cellRefiner, dm, depthSize, rdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10212,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10213 /* Step 3: Setup refined DM */
10214 ierr = DMSetUp(rdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10214,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10215 /* Step 4: Set cones and supports (automatically symmetrizes) */
10216 ierr = CellRefinerSetCones(cellRefiner, dm, depthSize, rdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10216,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10217 /* Step 5: Create pointSF */
10218 ierr = CellRefinerCreateSF(cellRefiner, dm, depthSize, rdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10218,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10219 /* Step 6: Create labels */
10220 ierr = CellRefinerCreateLabels(cellRefiner, dm, depthSize, rdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10220,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10221 /* Step 7: Set coordinates */
10222 ierr = CellRefinerSetCoordinates(cellRefiner, dm, depthSize, rdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10222,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10223 ierr = PetscFree(depthSize)((*PetscTrFree)((void*)(depthSize),10223,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((depthSize) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10223,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10224
10225 *dmRefined = rdm;
10226 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10227}
10228
10229/*@
10230 DMPlexCreateCoarsePointIS - Creates an IS covering the coarse DM chart with the fine points as data
10231
10232 Input Parameter:
10233. dm - The coarse DM
10234
10235 Output Parameter:
10236. fpointIS - The IS of all the fine points which exist in the original coarse mesh
10237
10238 Level: developer
10239
10240.seealso: DMRefine(), DMPlexSetRefinementUniform(), DMPlexCreateSubpointIS()
10241@*/
10242PetscErrorCode DMPlexCreateCoarsePointIS(DM dm, IS *fpointIS)
10243{
10244 CellRefiner cellRefiner;
10245 PetscInt *depthSize, *fpoints;
10246 PetscInt cStartNew = 0, vStartNew = 0, fStartNew = 0, eStartNew = 0;
10247 PetscInt depth, pStart, pEnd, p, vStart, vEnd, v;
10248 PetscErrorCode ierr;
10249
10250 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10250; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10251 ierr = DMPlexGetDepth(dm, &depth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10251,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10252 ierr = DMPlexGetChart(dm, &pStart, &pEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10252,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10253 ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10253,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10254 ierr = DMPlexGetCellRefiner_Internal(dm, &cellRefiner);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10254,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10255 ierr = PetscMalloc1(depth+1, &depthSize)PetscMallocA(1,PETSC_FALSE,10255,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(depth+1)*sizeof(**(&depthSize)),(&depthSize
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10255,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10256 ierr = CellRefinerGetSizes(cellRefiner, dm, depthSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10256,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10257 if (cellRefiner) {ierr = GetDepthStart_Private(depth, depthSize, &cStartNew, &fStartNew, &eStartNew, &vStartNew);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10257,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
10258 ierr = PetscMalloc1(pEnd-pStart,&fpoints)PetscMallocA(1,PETSC_FALSE,10258,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,(size_t)(pEnd-pStart)*sizeof(**(&fpoints)),(&fpoints
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10258,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10259 for (p = 0; p < pEnd-pStart; ++p) fpoints[p] = -1;
10260 switch (cellRefiner) {
10261 case REFINER_SIMPLEX_1D:
10262 case REFINER_SIMPLEX_2D:
10263 case REFINER_HYBRID_SIMPLEX_2D:
10264 case REFINER_HEX_2D:
10265 case REFINER_HYBRID_HEX_2D:
10266 case REFINER_SIMPLEX_3D:
10267 case REFINER_HYBRID_SIMPLEX_3D:
10268 case REFINER_HEX_3D:
10269 case REFINER_HYBRID_HEX_3D:
10270 for (v = vStart; v < vEnd; ++v) fpoints[v-pStart] = vStartNew + (v - vStart);
10271 break;
10272 default:
10273 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown cell refiner %s", CellRefiners[cellRefiner])return PetscError(((MPI_Comm)0x44000001),10273,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown cell refiner %s",CellRefiners
[cellRefiner])
;
10274 }
10275 ierr = ISCreateGeneral(PETSC_COMM_SELF((MPI_Comm)0x44000001), pEnd-pStart, fpoints, PETSC_OWN_POINTER, fpointIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10275,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10276 ierr = PetscFree(depthSize)((*PetscTrFree)((void*)(depthSize),10276,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
) || ((depthSize) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10276,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10277 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10278}
10279
10280/*@
10281 DMPlexSetRefinementUniform - Set the flag for uniform refinement
10282
10283 Input Parameters:
10284+ dm - The DM
10285- refinementUniform - The flag for uniform refinement
10286
10287 Level: developer
10288
10289.seealso: DMRefine(), DMPlexGetRefinementUniform(), DMPlexGetRefinementLimit(), DMPlexSetRefinementLimit()
10290@*/
10291PetscErrorCode DMPlexSetRefinementUniform(DM dm, PetscBool refinementUniform)
10292{
10293 DM_Plex *mesh = (DM_Plex*) dm->data;
10294
10295 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10295; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10296 PetscValidHeaderSpecific(dm, DM_CLASSID, 1)do { if (!dm) return PetscError(((MPI_Comm)0x44000001),10296,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(dm,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),10296,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(dm))->classid != DM_CLASSID) { if (
((PetscObject)(dm))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),10296,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),10296,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
10297 mesh->refinementUniform = refinementUniform;
10298 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10299}
10300
10301/*@
10302 DMPlexGetRefinementUniform - Retrieve the flag for uniform refinement
10303
10304 Input Parameter:
10305. dm - The DM
10306
10307 Output Parameter:
10308. refinementUniform - The flag for uniform refinement
10309
10310 Level: developer
10311
10312.seealso: DMRefine(), DMPlexSetRefinementUniform(), DMPlexGetRefinementLimit(), DMPlexSetRefinementLimit()
10313@*/
10314PetscErrorCode DMPlexGetRefinementUniform(DM dm, PetscBool *refinementUniform)
10315{
10316 DM_Plex *mesh = (DM_Plex*) dm->data;
10317
10318 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10318; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10319 PetscValidHeaderSpecific(dm, DM_CLASSID, 1)do { if (!dm) return PetscError(((MPI_Comm)0x44000001),10319,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(dm,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),10319,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(dm))->classid != DM_CLASSID) { if (
((PetscObject)(dm))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),10319,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),10319,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
10320 PetscValidPointer(refinementUniform, 2)do { if (!refinementUniform) return PetscError(((MPI_Comm)0x44000001
),10320,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if
(!PetscCheckPointer(refinementUniform,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),10320,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
10321 *refinementUniform = mesh->refinementUniform;
10322 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10323}
10324
10325/*@
10326 DMPlexSetRefinementLimit - Set the maximum cell volume for refinement
10327
10328 Input Parameters:
10329+ dm - The DM
10330- refinementLimit - The maximum cell volume in the refined mesh
10331
10332 Level: developer
10333
10334.seealso: DMRefine(), DMPlexGetRefinementLimit(), DMPlexGetRefinementUniform(), DMPlexSetRefinementUniform()
10335@*/
10336PetscErrorCode DMPlexSetRefinementLimit(DM dm, PetscReal refinementLimit)
10337{
10338 DM_Plex *mesh = (DM_Plex*) dm->data;
10339
10340 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10340; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10341 PetscValidHeaderSpecific(dm, DM_CLASSID, 1)do { if (!dm) return PetscError(((MPI_Comm)0x44000001),10341,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(dm,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),10341,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(dm))->classid != DM_CLASSID) { if (
((PetscObject)(dm))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),10341,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),10341,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
10342 mesh->refinementLimit = refinementLimit;
10343 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10344}
10345
10346/*@
10347 DMPlexGetRefinementLimit - Retrieve the maximum cell volume for refinement
10348
10349 Input Parameter:
10350. dm - The DM
10351
10352 Output Parameter:
10353. refinementLimit - The maximum cell volume in the refined mesh
10354
10355 Level: developer
10356
10357.seealso: DMRefine(), DMPlexSetRefinementLimit(), DMPlexGetRefinementUniform(), DMPlexSetRefinementUniform()
10358@*/
10359PetscErrorCode DMPlexGetRefinementLimit(DM dm, PetscReal *refinementLimit)
10360{
10361 DM_Plex *mesh = (DM_Plex*) dm->data;
10362
10363 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10363; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10364 PetscValidHeaderSpecific(dm, DM_CLASSID, 1)do { if (!dm) return PetscError(((MPI_Comm)0x44000001),10364,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(dm,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),10364,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(dm))->classid != DM_CLASSID) { if (
((PetscObject)(dm))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),10364,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),10364,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
10365 PetscValidPointer(refinementLimit, 2)do { if (!refinementLimit) return PetscError(((MPI_Comm)0x44000001
),10365,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if
(!PetscCheckPointer(refinementLimit,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),10365,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
10366 /* if (mesh->refinementLimit < 0) = getMaxVolume()/2.0; */
10367 *refinementLimit = mesh->refinementLimit;
10368 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10369}
10370
10371/*@
10372 DMPlexSetRefinementFunction - Set the function giving the maximum cell volume for refinement
10373
10374 Input Parameters:
10375+ dm - The DM
10376- refinementFunc - Function giving the maximum cell volume in the refined mesh
10377
10378 Note: The calling sequence is refinementFunc(coords, limit)
10379$ coords - Coordinates of the current point, usually a cell centroid
10380$ limit - The maximum cell volume for a cell containing this point
10381
10382 Level: developer
10383
10384.seealso: DMRefine(), DMPlexGetRefinementFunction(), DMPlexGetRefinementUniform(), DMPlexSetRefinementUniform(), DMPlexGetRefinementLimit(), DMPlexSetRefinementLimit()
10385@*/
10386PetscErrorCode DMPlexSetRefinementFunction(DM dm, PetscErrorCode (*refinementFunc)(const PetscReal [], PetscReal *))
10387{
10388 DM_Plex *mesh = (DM_Plex*) dm->data;
10389
10390 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10390; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10391 PetscValidHeaderSpecific(dm, DM_CLASSID, 1)do { if (!dm) return PetscError(((MPI_Comm)0x44000001),10391,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(dm,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),10391,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(dm))->classid != DM_CLASSID) { if (
((PetscObject)(dm))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),10391,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),10391,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
10392 mesh->refinementFunc = refinementFunc;
10393 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10394}
10395
10396/*@
10397 DMPlexGetRefinementFunction - Get the function giving the maximum cell volume for refinement
10398
10399 Input Parameter:
10400. dm - The DM
10401
10402 Output Parameter:
10403. refinementFunc - Function giving the maximum cell volume in the refined mesh
10404
10405 Note: The calling sequence is refinementFunc(coords, limit)
10406$ coords - Coordinates of the current point, usually a cell centroid
10407$ limit - The maximum cell volume for a cell containing this point
10408
10409 Level: developer
10410
10411.seealso: DMRefine(), DMPlexSetRefinementFunction(), DMPlexGetRefinementUniform(), DMPlexSetRefinementUniform(), DMPlexGetRefinementLimit(), DMPlexSetRefinementLimit()
10412@*/
10413PetscErrorCode DMPlexGetRefinementFunction(DM dm, PetscErrorCode (**refinementFunc)(const PetscReal [], PetscReal *))
10414{
10415 DM_Plex *mesh = (DM_Plex*) dm->data;
10416
10417 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10417; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10418 PetscValidHeaderSpecific(dm, DM_CLASSID, 1)do { if (!dm) return PetscError(((MPI_Comm)0x44000001),10418,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(dm,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),10418,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(dm))->classid != DM_CLASSID) { if (
((PetscObject)(dm))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),10418,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),10418,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
10419 PetscValidPointer(refinementFunc, 2)do { if (!refinementFunc) return PetscError(((MPI_Comm)0x44000001
),10419,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if
(!PetscCheckPointer(refinementFunc,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),10419,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
10420 *refinementFunc = mesh->refinementFunc;
10421 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10422}
10423
10424PetscErrorCode DMPlexGetCellRefiner_Internal(DM dm, CellRefiner *cellRefiner)
10425{
10426 PetscInt dim, cStart, cEnd, coneSize, cMax, fMax;
10427 PetscErrorCode ierr;
10428
10429 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10429; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10430 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10430,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10431 ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10431,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10432 if (cEnd <= cStart) {*cellRefiner = REFINER_NOOP; PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
10433 ierr = DMPlexGetConeSize(dm, cStart, &coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10433,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10434 ierr = DMPlexGetHybridBounds(dm, &cMax, &fMax, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10434,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10435 switch (dim) {
10436 case 1:
10437 switch (coneSize) {
10438 case 2:
10439 *cellRefiner = REFINER_SIMPLEX_1D;
10440 break;
10441 default:
10442 SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown coneSize %D in dimension %D for cell refiner", coneSize, dim)return PetscError(((MPI_Comm)0x44000001),10442,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown coneSize %D in dimension %D for cell refiner"
,coneSize,dim)
;
10443 }
10444 break;
10445 case 2:
10446 switch (coneSize) {
10447 case 3:
10448 if (cMax >= 0) *cellRefiner = REFINER_HYBRID_SIMPLEX_2D;
10449 else *cellRefiner = REFINER_SIMPLEX_2D;
10450 break;
10451 case 4:
10452 if (cMax >= 0 && fMax >= 0) *cellRefiner = REFINER_HYBRID_HEX_2D;
10453 else *cellRefiner = REFINER_HEX_2D;
10454 break;
10455 default:
10456 SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown coneSize %D in dimension %D for cell refiner", coneSize, dim)return PetscError(((MPI_Comm)0x44000001),10456,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown coneSize %D in dimension %D for cell refiner"
,coneSize,dim)
;
10457 }
10458 break;
10459 case 3:
10460 switch (coneSize) {
10461 case 4:
10462 if (cMax >= 0) *cellRefiner = REFINER_HYBRID_SIMPLEX_3D;
10463 else *cellRefiner = REFINER_SIMPLEX_3D;
10464 break;
10465 case 5:
10466 if (cMax == 0) *cellRefiner = REFINER_HYBRID_SIMPLEX_3D;
10467 else SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown coneSize %D in dimension %D for cell refiner", coneSize, dim)return PetscError(((MPI_Comm)0x44000001),10467,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown coneSize %D in dimension %D for cell refiner"
,coneSize,dim)
;
10468 break;
10469 case 6:
10470 if (cMax >= 0) *cellRefiner = REFINER_HYBRID_HEX_3D;
10471 else *cellRefiner = REFINER_HEX_3D;
10472 break;
10473 default:
10474 SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown coneSize %D in dimension %D for cell refiner", coneSize, dim)return PetscError(((MPI_Comm)0x44000001),10474,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown coneSize %D in dimension %D for cell refiner"
,coneSize,dim)
;
10475 }
10476 break;
10477 default:
10478 SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Unknown dimension %D for cell refiner", dim)return PetscError(((MPI_Comm)0x44000001),10478,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,62,PETSC_ERROR_INITIAL,"Unknown dimension %D for cell refiner"
,dim)
;
10479 }
10480 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10481}
10482
10483PetscErrorCode DMRefine_Plex(DM dm, MPI_Comm comm, DM *dmRefined)
10484{
10485 PetscBool isUniform;
10486 PetscErrorCode ierr;
10487
10488 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10488; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10489 ierr = DMPlexGetRefinementUniform(dm, &isUniform);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10489,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10490 if (isUniform) {
10491 CellRefiner cellRefiner;
10492 PetscBool localized;
10493
10494 ierr = DMGetCoordinatesLocalized(dm, &localized);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10494,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10495 ierr = DMPlexGetCellRefiner_Internal(dm, &cellRefiner);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10495,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10496 ierr = DMPlexRefineUniform_Internal(dm, cellRefiner, dmRefined);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10496,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10497 ierr = DMPlexSetRegularRefinement(*dmRefined, PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10497,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10498 ierr = DMCopyBoundary(dm, *dmRefined);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10498,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10499 if (localized) {ierr = DMLocalizeCoordinates(*dmRefined);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10499,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
10500 } else {
10501 ierr = DMPlexRefine_Internal(dm, NULL((void*)0), dmRefined);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10501,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10502 }
10503 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10504}
10505
10506PetscErrorCode DMRefineHierarchy_Plex(DM dm, PetscInt nlevels, DM dmRefined[])
10507{
10508 DM cdm = dm;
10509 PetscInt r;
10510 PetscBool isUniform, localized;
10511 PetscErrorCode ierr;
10512
10513 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
; petscstack->line[petscstack->currentsize] = 10513; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
10514 ierr = DMPlexGetRefinementUniform(dm, &isUniform);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10514,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10515 ierr = DMGetCoordinatesLocalized(dm, &localized);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10515,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10516 if (isUniform) {
10517 for (r = 0; r < nlevels; ++r) {
10518 CellRefiner cellRefiner;
10519
10520 ierr = DMPlexGetCellRefiner_Internal(cdm, &cellRefiner);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10520,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10521 ierr = DMPlexRefineUniform_Internal(cdm, cellRefiner, &dmRefined[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10521,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10522 ierr = DMSetCoarsenLevel(dmRefined[r], cdm->leveldown);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10522,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10523 ierr = DMSetRefineLevel(dmRefined[r], cdm->levelup+1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10523,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10524 ierr = DMCopyBoundary(cdm, dmRefined[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10524,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10525 if (localized) {ierr = DMLocalizeCoordinates(dmRefined[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10525,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
10526 ierr = DMSetCoarseDM(dmRefined[r], cdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10526,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10527 ierr = DMPlexSetRegularRefinement(dmRefined[r], PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10527,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10528 cdm = dmRefined[r];
10529 }
10530 } else {
10531 for (r = 0; r < nlevels; ++r) {
10532 ierr = DMRefine(cdm, PetscObjectComm((PetscObject) dm), &dmRefined[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10532,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10533 ierr = DMCopyBoundary(cdm, dmRefined[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10533,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10534 if (localized) {ierr = DMLocalizeCoordinates(dmRefined[r]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10534,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
10535 ierr = DMSetCoarseDM(dmRefined[r], cdm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),10535,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/impls/plex/plexrefine.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
10536 cdm = dmRefined[r];
10537 }
10538 }
10539 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
10540}