116 GO totalFineElements = fineElementPDOFs->numRows();
119 GO totalCoarseElements = totalFineElements/4;
120 LO nCoarseElements = (int) sqrt(totalCoarseElements);
123 size_t EdgeCount = (nCoarseElements + 1) * (nCoarseElements + 1);
124 size_t CenterCount = EdgeCount + 2 * nCoarseElements * (nCoarseElements + 1);
128 RCP<Teuchos::SerialDenseMatrix<GO,GO> > coarseElementVDOFs = rcp(
new Teuchos::SerialDenseMatrix<GO,GO>(totalCoarseElements,18));
129 RCP<Teuchos::SerialDenseMatrix<GO,GO> > coarseElementPDOFs = rcp(
new Teuchos::SerialDenseMatrix<GO,GO>(totalCoarseElements,4));
130 RCP<Teuchos::SerialDenseMatrix<GO,GO> > coarseElementMDOFs = rcp(
new Teuchos::SerialDenseMatrix<GO,GO>(totalCoarseElements,9));
133 for ( GO coarseElement=0; coarseElement < totalCoarseElements; coarseElement++ )
144 if (coarseElement < nCoarseElements)
147 (*coarseElementMDOFs)(coarseElement,0) = coarseElement;
148 (*coarseElementMDOFs)(coarseElement,1) = coarseElement+1;
151 (*coarseElementMDOFs)(coarseElement,4) = EdgeCount++;
157 (*coarseElementMDOFs)(coarseElement,0) = (*coarseElementMDOFs)(coarseElement-nCoarseElements,3);
158 (*coarseElementMDOFs)(coarseElement,1) = (*coarseElementMDOFs)(coarseElement-nCoarseElements,2);
161 (*coarseElementMDOFs)(coarseElement,4) = (*coarseElementMDOFs)(coarseElement-nCoarseElements,6);
167 (*coarseElementMDOFs)(coarseElement,5) = EdgeCount++;
168 (*coarseElementMDOFs)(coarseElement,6) = EdgeCount++;
172 if (coarseElement % nCoarseElements == 0)
175 (*coarseElementMDOFs)(coarseElement,3) = (*coarseElementMDOFs)(coarseElement,0)+nCoarseElements+1;
178 (*coarseElementMDOFs)(coarseElement,7) = EdgeCount++;
184 (*coarseElementMDOFs)(coarseElement,3) = (*coarseElementMDOFs)(coarseElement-1,2);
187 (*coarseElementMDOFs)(coarseElement,7) = (*coarseElementMDOFs)(coarseElement-1,5);
191 (*coarseElementMDOFs)(coarseElement,2) = (*coarseElementMDOFs)(coarseElement,3)+1;
194 (*coarseElementMDOFs)(coarseElement,8) = CenterCount++;
200 (*coarseElementVDOFs)(coarseElement,0) = 2*(*coarseElementMDOFs)(coarseElement,0);
201 (*coarseElementVDOFs)(coarseElement,1) = 2*(*coarseElementMDOFs)(coarseElement,0)+1;
202 (*coarseElementVDOFs)(coarseElement,2) = 2*(*coarseElementMDOFs)(coarseElement,1);
203 (*coarseElementVDOFs)(coarseElement,3) = 2*(*coarseElementMDOFs)(coarseElement,1)+1;
204 (*coarseElementVDOFs)(coarseElement,4) = 2*(*coarseElementMDOFs)(coarseElement,2);
205 (*coarseElementVDOFs)(coarseElement,5) = 2*(*coarseElementMDOFs)(coarseElement,2)+1;
206 (*coarseElementVDOFs)(coarseElement,6) = 2*(*coarseElementMDOFs)(coarseElement,3);
207 (*coarseElementVDOFs)(coarseElement,7) = 2*(*coarseElementMDOFs)(coarseElement,3)+1;
208 (*coarseElementVDOFs)(coarseElement,8) = 2*(*coarseElementMDOFs)(coarseElement,4);
209 (*coarseElementVDOFs)(coarseElement,9) = 2*(*coarseElementMDOFs)(coarseElement,4)+1;
210 (*coarseElementVDOFs)(coarseElement,10) = 2*(*coarseElementMDOFs)(coarseElement,5);
211 (*coarseElementVDOFs)(coarseElement,11) = 2*(*coarseElementMDOFs)(coarseElement,5)+1;
212 (*coarseElementVDOFs)(coarseElement,12) = 2*(*coarseElementMDOFs)(coarseElement,6);
213 (*coarseElementVDOFs)(coarseElement,13) = 2*(*coarseElementMDOFs)(coarseElement,6)+1;
214 (*coarseElementVDOFs)(coarseElement,14) = 2*(*coarseElementMDOFs)(coarseElement,7);
215 (*coarseElementVDOFs)(coarseElement,15) = 2*(*coarseElementMDOFs)(coarseElement,7)+1;
216 (*coarseElementVDOFs)(coarseElement,16) = 2*(*coarseElementMDOFs)(coarseElement,8);
217 (*coarseElementVDOFs)(coarseElement,17) = 2*(*coarseElementMDOFs)(coarseElement,8)+1;
220 (*coarseElementPDOFs)(coarseElement,0) = (*coarseElementMDOFs)(coarseElement,0);
221 (*coarseElementPDOFs)(coarseElement,1) = (*coarseElementMDOFs)(coarseElement,1);
222 (*coarseElementPDOFs)(coarseElement,2) = (*coarseElementMDOFs)(coarseElement,2);
223 (*coarseElementPDOFs)(coarseElement,3) = (*coarseElementMDOFs)(coarseElement,3);
227 Set(coarseLevel,
"VElementList",coarseElementVDOFs);
228 Set(coarseLevel,
"PElementList",coarseElementPDOFs);
229 Set(coarseLevel,
"MElementList",coarseElementMDOFs);