35 #include "ModeLaplace3DQ1.h"
36 #include "Teuchos_Assert.hpp"
39 const int ModeLaplace3DQ1::dofEle = 8;
40 const int ModeLaplace3DQ1::maxConnect = 27;
42 const double ModeLaplace3DQ1::M_PI = 3.14159265358979323846;
46 ModeLaplace3DQ1::ModeLaplace3DQ1(
const Epetra_Comm &_Comm,
double _Lx,
int _nX,
47 double _Ly,
int _nY,
double _Lz,
int _nZ)
70 ModeLaplace3DQ1::~ModeLaplace3DQ1() {
99 void ModeLaplace3DQ1::preProcess() {
105 bool *isTouched =
new bool[nX*nY*nZ];
107 for (k = 0; k < nZ; ++k)
108 for (j = 0; j < nY; ++j)
110 isTouched[i + j*nX + k*nX*nY] =
false;
112 int numEle = countElements(isTouched);
115 int *elemTopo =
new int[dofEle*numEle];
116 makeMyElementsTopology(elemTopo, isTouched);
121 int localSize = Map->NumMyElements();
122 int *numNz =
new int[localSize];
123 int *connectivity =
new int[localSize*maxConnect];
124 makeMyConnectivity(elemTopo, numEle, connectivity, numNz);
127 makeStiffness(elemTopo, numEle, connectivity, numNz);
130 makeMass(elemTopo, numEle, connectivity, numNz);
135 delete[] connectivity;
142 x =
new double[localSize];
143 y =
new double[localSize];
144 z =
new double[localSize];
146 for (k=0; k<nZ-1; ++k) {
147 for (j=0; j<nY-1; ++j) {
148 for (i=0; i<nX-1; ++i) {
149 int node = i + j*(nX-1) + k*(nX-1)*(nY-1);
150 if (Map->LID(node) > -1) {
151 x[Map->LID(node)] = (i+1)*hx;
152 y[Map->LID(node)] = (j+1)*hy;
153 z[Map->LID(node)] = (k+1)*hz;
162 void ModeLaplace3DQ1::makeMap() {
164 int numProc = MyComm.NumProc();
165 int globalSize = (nX - 1)*(nY - 1)*(nZ - 1);
166 assert(globalSize > numProc);
170 int *start =
new int[globalSize+1];
171 memset(start, 0, (globalSize+1)*
sizeof(
int));
174 for (k=0; k<nZ-1; ++k) {
175 for (j=0; j<nY-1; ++j) {
176 for (i=0; i<nX-1; ++i) {
177 int node = i + j*(nX-1) + k*(nX-1)*(nY-1);
179 connect *= ((i == 0) || (i == nX-2)) ? 2 : 3;
180 connect *= ((j == 0) || (j == nY-2)) ? 2 : 3;
181 connect *= ((k == 0) || (k == nZ-2)) ? 2 : 3;
183 start[node+1] = connect - 1;
188 for (i = 0; i < globalSize; ++i)
189 start[i+1] += start[i];
191 int *adjacency =
new int[start[globalSize]];
192 memset(adjacency, 0, start[globalSize]*
sizeof(
int));
194 int *elemTopo =
new int[dofEle];
195 for (k=0; k<nZ; ++k) {
196 for (j=0; j<nY; ++j) {
197 for (i=0; i<nX; ++i) {
198 int leftCorner = i-1 + (j-1)*(nX-1) + (k-1)*(nX-1)*(nY-1);
199 elemTopo[0] = ((i==0) || (j==0) || (k==0)) ? -1 : leftCorner;
200 elemTopo[1]= ((i==nX-1) || (j==0) || (k==0)) ? -1 : leftCorner+1;
201 elemTopo[2]= ((i==nX-1) || (j==nY-1) || (k==0)) ? -1 : leftCorner+nX;
202 elemTopo[3]= ((i==0) || (j==nY-1) || (k==0)) ? -1 : leftCorner+nX-1;
203 elemTopo[4]= ((i==0) || (j==0) || (k==nZ-1)) ? -1 : leftCorner+(nX-1)*(nY-1);
204 elemTopo[5]= ((i==nX-1) || (j==0) || (k==nZ-1)) ? -1 : leftCorner+1+(nX-1)*(nY-1);
205 elemTopo[6]= ((i==nX-1) || (j==nY-1) || (k==nZ-1)) ? -1 : leftCorner+nX+(nX-1)*(nY-1);
206 elemTopo[7]= ((i==0) || (j==nY-1) || (k==nZ-1)) ? -1 : leftCorner+nX-1+(nX-1)*(nY-1);
207 for (
int iD = 0; iD < dofEle; ++iD) {
208 if (elemTopo[iD] == -1)
210 for (
int jD = 0; jD < dofEle; ++jD) {
211 int neighbor = elemTopo[jD];
213 if ((neighbor == -1) || (iD == jD))
216 for (
int l = start[elemTopo[iD]]; l < start[elemTopo[iD]+1]; ++l) {
218 if (adjacency[l] == neighbor + 1)
220 if (adjacency[l] == 0) {
223 adjacency[l] = elemTopo[jD] + 1;
238 short int *partition =
new short int[globalSize];
240 interface(globalSize, start, adjacency, 0, 0, 0, 0, 0, 0, 0,
241 partition, 1, 1, nDir, 0, 1, 1, 1, 250, 1, 0.001, 7654321L);
244 int myPid = MyComm.MyPID();
245 for (i = 0; i < globalSize; ++i) {
246 if (partition[i] == myPid)
249 int *myRows =
new int[localSize];
251 for (i = 0; i < globalSize; ++i) {
252 if (partition[i] == myPid) {
253 myRows[localSize] = i;
260 Map =
new Epetra_Map(globalSize, localSize, myRows, 0, MyComm);
270 int ModeLaplace3DQ1::countElements(
bool *isTouched) {
278 for (k=0; k<nZ; ++k) {
279 for (j=0; j<nY; ++j) {
280 for (i=0; i<nX; ++i) {
281 isTouched[i + j*nX + k*nX*nY] =
false;
282 int leftCorner = i-1 + (j-1)*(nX-1) + (k-1)*(nX-1)*(nY-1);
284 node = ((i==0) || (j==0) || (k==0)) ? -1 : leftCorner;
285 if ((node > -1) && (Map->LID(node) > -1)) {
286 isTouched[i + j*nX + k*nX*nY] =
true;
290 node = ((i==nX-1) || (j==0) || (k==0)) ? -1 : leftCorner+1;
291 if ((node > -1) && (Map->LID(node) > -1)) {
292 isTouched[i + j*nX + k*nX*nY] =
true;
296 node = ((i==nX-1) || (j==nY-1) || (k==0)) ? -1 : leftCorner+nX;
297 if ((node > -1) && (Map->LID(node) > -1)) {
298 isTouched[i + j*nX + k*nX*nY] =
true;
302 node = ((i==0) || (j==nY-1) || (k==0)) ? -1 : leftCorner+nX-1;
303 if ((node > -1) && (Map->LID(node) > -1)) {
304 isTouched[i + j*nX + k*nX*nY] =
true;
308 node = ((i==0) || (j==0) || (k==nZ-1)) ? -1 : leftCorner+(nX-1)*(nY-1);
309 if ((node > -1) && (Map->LID(node) > -1)) {
310 isTouched[i + j*nX + k*nX*nY] =
true;
314 node = ((i==nX-1) || (j==0) || (k==nZ-1)) ? -1 : leftCorner+1+(nX-1)*(nY-1);
315 if ((node > -1) && (Map->LID(node) > -1)) {
316 isTouched[i + j*nX + k*nX*nY] =
true;
320 node = ((i==nX-1) || (j==nY-1) || (k==nZ-1)) ? -1 : leftCorner+nX+(nX-1)*(nY-1);
321 if ((node > -1) && (Map->LID(node) > -1)) {
322 isTouched[i + j*nX + k*nX*nY] =
true;
326 node = ((i==0) || (j==nY-1) || (k==nZ-1)) ? -1 : leftCorner+nX-1+(nX-1)*(nY-1);
327 if ((node > -1) && (Map->LID(node) > -1)) {
328 isTouched[i + j*nX + k*nX*nY] =
true;
341 void ModeLaplace3DQ1::makeMyElementsTopology(
int *elemTopo,
bool *isTouched) {
349 for (k=0; k<nZ; ++k) {
350 for (j=0; j<nY; ++j) {
351 for (i=0; i<nX; ++i) {
352 if (isTouched[i + j*nX + k*nX*nY] ==
false)
354 int leftCorner = i-1 + (j-1)*(nX-1) + (k-1)*(nX-1)*(nY-1);
355 elemTopo[8*numEle] = ((i==0) || (j==0) || (k==0)) ?
357 elemTopo[8*numEle+1]= ((i==nX-1) || (j==0) || (k==0)) ?
359 elemTopo[8*numEle+2]= ((i==nX-1) || (j==nY-1) || (k==0)) ?
361 elemTopo[8*numEle+3]= ((i==0) || (j==nY-1) || (k==0)) ?
362 -1 : leftCorner+nX-1;
363 elemTopo[8*numEle+4]= ((i==0) || (j==0) || (k==nZ-1)) ?
364 -1 : leftCorner+(nX-1)*(nY-1);
365 elemTopo[8*numEle+5]= ((i==nX-1) || (j==0) || (k==nZ-1)) ?
366 -1 : leftCorner+1+(nX-1)*(nY-1);
367 elemTopo[8*numEle+6]= ((i==nX-1) || (j==nY-1) || (k==nZ-1)) ?
368 -1 : leftCorner+nX+(nX-1)*(nY-1);
369 elemTopo[8*numEle+7]= ((i==0) || (j==nY-1) || (k==nZ-1)) ?
370 -1 : leftCorner+nX-1+(nX-1)*(nY-1);
379 void ModeLaplace3DQ1::makeMyConnectivity(
int *elemTopo,
int numEle,
int *connectivity,
386 int localSize = Map->NumMyElements();
388 for (i=0; i<localSize; ++i) {
390 for (j=0; j<maxConnect; ++j) {
391 connectivity[i*maxConnect + j] = -1;
395 for (i=0; i<numEle; ++i) {
396 for (j=0; j<dofEle; ++j) {
397 if (elemTopo[dofEle*i+j] == -1)
399 int node = Map->LID(elemTopo[dofEle*i+j]);
402 for (k=0; k<dofEle; ++k) {
403 int neighbor = elemTopo[dofEle*i+k];
408 for (l=0; l<maxConnect; ++l) {
409 if (neighbor == connectivity[node*maxConnect + l])
411 if (connectivity[node*maxConnect + l] == -1) {
412 connectivity[node*maxConnect + l] = neighbor;
425 void ModeLaplace3DQ1::makeStiffness(
int *elemTopo,
int numEle,
int *connectivity,
432 int localSize = Map->NumMyElements();
434 double *values =
new double[maxConnect];
435 for (i=0; i<maxConnect; ++i)
438 for (i=0; i<localSize; ++i) {
439 int info = K->InsertGlobalValues(Map->GID(i), numNz[i], values, connectivity+maxConnect*i);
441 "ModeLaplace3DQ1::makeStiffness(): InsertGlobalValues() returned error code " << info);
449 double *kel =
new double[dofEle*dofEle];
451 kel[0] = (hx*hz/hy + hy*hz/hx + hx*hy/hz)/9.0;
452 kel[1] = (hx*hz/hy - 2.0*hy*hz/hx + hx*hy/hz)/18.0;
453 kel[2] = (-2.0*hx*hz/hy - 2.0*hy*hz/hx + hx*hy/hz)/36.0;
454 kel[3] = (-2.0*hx*hz/hy + hy*hz/hx + hx*hy/hz)/18.0;
455 kel[4] = (hx*hz/hy + hy*hz/hx - 2.0*hx*hy/hz)/18.0;
456 kel[5] = (hx*hz/hy - 2.0*hy*hz/hx - 2.0*hx*hy/hz)/36.0;
457 kel[6] = - (hx*hz/hy + hy*hz/hx + hx*hy/hz)/36.0;
458 kel[7] = (-2.0*hx*hz/hy + hy*hz/hx - 2.0*hx*hy/hz)/36.0;
460 kel[ 8] = kel[1]; kel[ 9] = kel[0]; kel[10] = kel[3]; kel[11] = kel[2];
461 kel[12] = kel[5]; kel[13] = kel[4]; kel[14] = kel[7]; kel[15] = kel[6];
463 kel[16] = kel[2]; kel[17] = kel[3]; kel[18] = kel[0]; kel[19] = kel[1];
464 kel[20] = kel[6]; kel[21] = kel[7]; kel[22] = kel[4]; kel[23] = kel[5];
466 kel[24] = kel[3]; kel[25] = kel[2]; kel[26] = kel[1]; kel[27] = kel[0];
467 kel[28] = kel[7]; kel[29] = kel[6]; kel[30] = kel[5]; kel[31] = kel[4];
469 kel[32] = kel[4]; kel[33] = kel[5]; kel[34] = kel[6]; kel[35] = kel[7];
470 kel[36] = kel[0]; kel[37] = kel[1]; kel[38] = kel[2]; kel[39] = kel[3];
472 kel[40] = kel[5]; kel[41] = kel[4]; kel[42] = kel[7]; kel[43] = kel[6];
473 kel[44] = kel[1]; kel[45] = kel[0]; kel[46] = kel[3]; kel[47] = kel[2];
475 kel[48] = kel[6]; kel[49] = kel[7]; kel[50] = kel[4]; kel[51] = kel[5];
476 kel[52] = kel[2]; kel[53] = kel[3]; kel[54] = kel[0]; kel[55] = kel[1];
478 kel[56] = kel[7]; kel[57] = kel[6]; kel[58] = kel[5]; kel[59] = kel[4];
479 kel[60] = kel[3]; kel[61] = kel[2]; kel[62] = kel[1]; kel[63] = kel[0];
482 int *indices =
new int[dofEle];
485 for (i=0; i<numEle; ++i) {
486 for (j=0; j<dofEle; ++j) {
487 if (elemTopo[dofEle*i + j] == -1)
489 if (Map->LID(elemTopo[dofEle*i+j]) == -1)
493 for (k=0; k<dofEle; ++k) {
494 if (elemTopo[dofEle*i+k] == -1)
496 indices[numEntries] = elemTopo[dofEle*i+k];
497 values[numEntries] = kel[dofEle*j + k];
500 int info = K->SumIntoGlobalValues(elemTopo[dofEle*i+j], numEntries, values, indices);
502 "ModeLaplace3DQ1::makeStiffness(): SumIntoGlobalValues() returned error code " << info);
510 int info = K->FillComplete();
512 "ModeLaplace3DQ1::makeStiffness(): FillComplete() returned error code " << info);
513 info = K->OptimizeStorage();
515 "ModeLaplace3DQ1::makeStiffness(): OptimizeStorage() returned error code " << info);
520 void ModeLaplace3DQ1::makeMass(
int *elemTopo,
int numEle,
int *connectivity,
527 int localSize = Map->NumMyElements();
529 double *values =
new double[maxConnect];
530 for (i=0; i<maxConnect; ++i)
532 for (i=0; i<localSize; ++i) {
533 int info = M->InsertGlobalValues(Map->GID(i), numNz[i], values, connectivity + maxConnect*i);
535 "ModeLaplace3DQ1::makeMass(): InsertGlobalValues() returned error code " << info);
543 double *mel =
new double[dofEle*dofEle];
545 mel[0] = hx*hy*hz/27.0; mel[1] = hx*hy*hz/54.0; mel[2] = hx*hy*hz/108.0; mel[3] = hx*hy*hz/54.0;
546 mel[4] = hx*hy*hz/54.0; mel[5] = hx*hy*hz/108.0; mel[6]= hx*hy*hz/216.0; mel[7] =hx*hy*hz/108.0;
548 mel[ 8] = mel[1]; mel[ 9] = mel[0]; mel[10] = mel[3]; mel[11] = mel[2];
549 mel[12] = mel[5]; mel[13] = mel[4]; mel[14] = mel[7]; mel[15] = mel[6];
551 mel[16] = mel[2]; mel[17] = mel[3]; mel[18] = mel[0]; mel[19] = mel[1];
552 mel[20] = mel[6]; mel[21] = mel[7]; mel[22] = mel[4]; mel[23] = mel[5];
554 mel[24] = mel[3]; mel[25] = mel[2]; mel[26] = mel[1]; mel[27] = mel[0];
555 mel[28] = mel[7]; mel[29] = mel[6]; mel[30] = mel[5]; mel[31] = mel[4];
557 mel[32] = mel[4]; mel[33] = mel[5]; mel[34] = mel[6]; mel[35] = mel[7];
558 mel[36] = mel[0]; mel[37] = mel[1]; mel[38] = mel[2]; mel[39] = mel[3];
560 mel[40] = mel[5]; mel[41] = mel[4]; mel[42] = mel[7]; mel[43] = mel[6];
561 mel[44] = mel[1]; mel[45] = mel[0]; mel[46] = mel[3]; mel[47] = mel[2];
563 mel[48] = mel[6]; mel[49] = mel[7]; mel[50] = mel[4]; mel[51] = mel[5];
564 mel[52] = mel[2]; mel[53] = mel[3]; mel[54] = mel[0]; mel[55] = mel[1];
566 mel[56] = mel[7]; mel[57] = mel[6]; mel[58] = mel[5]; mel[59] = mel[4];
567 mel[60] = mel[3]; mel[61] = mel[2]; mel[62] = mel[1]; mel[63] = mel[0];
570 int *indices =
new int[dofEle];
573 for (i=0; i<numEle; ++i) {
574 for (j=0; j<dofEle; ++j) {
575 if (elemTopo[dofEle*i + j] == -1)
577 if (Map->LID(elemTopo[dofEle*i+j]) == -1)
581 for (k=0; k<dofEle; ++k) {
582 if (elemTopo[dofEle*i+k] == -1)
584 indices[numEntries] = elemTopo[dofEle*i+k];
585 values[numEntries] = mel[dofEle*j + k];
588 int info = M->SumIntoGlobalValues(elemTopo[dofEle*i+j], numEntries, values, indices);
590 "ModeLaplace3DQ1::makeMass(): SumIntoGlobalValues() returned error code " << info);
598 int info = M->FillComplete();
600 "ModeLaplace3DQ1::makeMass(): FillComplete() returned error code " << info);
601 info = M->OptimizeStorage();
603 "ModeLaplace3DQ1::makeMass(): OptimizeStorage() returned error code " << info);
608 double ModeLaplace3DQ1::getFirstMassEigenValue()
const {
610 return Lx/(3.0*nX)*(2.0-cos(M_PI/nX))*Ly/(3.0*nY)*(2.0-cos(M_PI/nY))*
611 Lz/(3.0*nZ)*(2.0-cos(M_PI/nZ));
617 double *normWeight)
const {
620 int qc = Q.NumVectors();
621 int myPid = MyComm.MyPID();
624 cout.setf(ios::scientific, ios::floatfield);
627 double tmp = myVerify.errorOrthonormality(&Q, M);
629 cout <<
" Maximum coefficient in matrix Q^T M Q - I = " << tmp << endl;
632 myVerify.errorEigenResiduals(Q, lambda, K, M, normWeight);
635 int numX = (int) ceil(sqrt(Lx*Lx*lambda[qc-1]/M_PI/M_PI));
636 numX = (numX > nX) ? nX : numX;
637 int numY = (int) ceil(sqrt(Ly*Ly*lambda[qc-1]/M_PI/M_PI));
638 numY = (numY > nY) ? nY : numY;
639 int numZ = (int) ceil(sqrt(Lz*Lz*lambda[qc-1]/M_PI/M_PI));
640 numZ = (numZ > nZ) ? nZ : numZ;
641 int newSize = (numX-1)*(numY-1)*(numZ-1);
642 double *discrete =
new (nothrow)
double[2*newSize];
646 double *continuous = discrete + newSize;
653 for (k = 1; k < numZ; ++k) {
654 for (j = 1; j < numY; ++j) {
655 for (i = 1; i < numX; ++i) {
656 int pos = i-1 + (j-1)*(numX-1) + (k-1)*(numX-1)*(numY-1);
657 continuous[pos] = M_PI*M_PI*(i*i/(Lx*Lx) + j*j/(Ly*Ly) + k*k/(Lz*Lz));
658 discrete[pos] = 6.0*(1.0-cos(i*(M_PI/Lx)*hx))/(2.0+cos(i*(M_PI/Lx)*hx))/hx/hx;
659 discrete[pos] += 6.0*(1.0-cos(j*(M_PI/Ly)*hy))/(2.0+cos(j*(M_PI/Ly)*hy))/hy/hy;
660 discrete[pos] += 6.0*(1.0-cos(k*(M_PI/Lz)*hz))/(2.0+cos(k*(M_PI/Lz)*hz))/hz/hz;
666 mySort.sortScalars(newSize, continuous);
668 int *used =
new (nothrow)
int[newSize];
674 mySort.sortScalars(newSize, discrete, used);
676 int *index =
new (nothrow)
int[newSize];
683 for (i=0; i<newSize; ++i) {
688 int nMax = myVerify.errorLambda(continuous, discrete, newSize, lambda, qc);
691 int localSize = Map->NumMyElements();
692 double *vQ =
new (nothrow)
double[(nMax+1)*localSize + nMax];
700 double *normL2 = vQ + (nMax+1)*localSize;
703 if ((myPid == 0) && (nMax > 0)) {
705 cout <<
" --- Relative discretization errors for exact eigenvectors ---" << endl;
707 cout <<
" Cont. Values Disc. Values Error H^1 norm L^2 norm\n";
710 for (k=1; k < numZ; ++k) {
711 for (j=1; j < numY; ++j) {
712 for (i=1; i < numX; ++i) {
713 int pos = i-1 + (j-1)*(numX-1) + (k-1)*(numX-1)*(numY-1);
714 if (index[pos] < nMax) {
715 double coeff = (2.0 + cos(i*M_PI/Lx*hx))*Lx/6.0;
716 coeff *= (2.0 + cos(j*M_PI/Ly*hy))*Ly/6.0;
717 coeff *= (2.0 + cos(k*M_PI/Lz*hz))*Lz/6.0;
718 coeff = 1.0/sqrt(coeff);
720 for (ii=0; ii<localSize; ++ii) {
721 Qex.ReplaceMyValue(ii, index[pos], coeff*sin(i*(M_PI/Lx)*x[ii])
722 *sin(j*(M_PI/Ly)*y[ii])*sin(k*(M_PI/Lz)*z[ii]) );
727 for (ii=0; ii<localSize; ++ii) {
728 double iX = 4.0*sqrt(2.0/Lx)*sin(i*(M_PI/Lx)*x[ii])/hx*
729 pow(sin(i*(M_PI/Lx)*0.5*hx)/(i*M_PI/Lx), 2.0);
730 double iY = 4.0*sqrt(2.0/Ly)*sin(j*(M_PI/Ly)*y[ii])/hy*
731 pow(sin(j*(M_PI/Ly)*0.5*hy)/(j*M_PI/Ly), 2.0);
732 double iZ = 4.0*sqrt(2.0/Lz)*sin(k*(M_PI/Lz)*z[ii])/hz*
733 pow(sin(k*(M_PI/Lz)*0.5*hz)/(k*M_PI/Lz), 2.0);
734 shapeInt.ReplaceMyValue(ii, 0, iX*iY*iZ);
736 normL2[index[pos]] = 0.0;
737 Qi.Dot(shapeInt, normL2 + index[pos]);
744 for (i = 0; i < nMax; ++i) {
745 double normH1 = continuous[i]*(1.0 - 2.0*normL2[i]) + discrete[i];
746 normL2[i] = 2.0 - 2.0*normL2[i];
753 cout.setf(ios::scientific, ios::floatfield);
755 cout << continuous[i] <<
" " << discrete[i] <<
" ";
757 cout << fabs(discrete[i] - continuous[i])/continuous[i] <<
" ";
758 cout << sqrt(fabs(normH1)/(continuous[i]+1.0)) <<
" ";
759 cout << sqrt(fabs(normL2[i])) << endl;
769 myVerify.errorSubspaces(Q, Qex, M);
778 void ModeLaplace3DQ1::memoryInfo()
const {
780 int myPid = MyComm.MyPID();
783 if ((myPid == 0) && (Mat)) {
784 cout <<
" Total number of nonzero entries in mass matrix = ";
789 cout <<
" Memory requested for mass matrix per processor = (EST) ";
792 cout.setf(ios::fixed, ios::floatfield);
793 cout << memSize/1024.0/1024.0/MyComm.NumProc() <<
" MB " << endl;
798 if ((myPid == 0) && (Mat)) {
799 cout <<
" Total number of nonzero entries in stiffness matrix = ";
804 cout <<
" Memory requested for stiffness matrix per processor = (EST) ";
807 cout.setf(ios::fixed, ios::floatfield);
808 cout << memSize/1024.0/1024.0/MyComm.NumProc() <<
" MB " << endl;
815 void ModeLaplace3DQ1::problemInfo()
const {
817 int myPid = MyComm.MyPID();
821 cout.setf(ios::fixed, ios::floatfield);
822 cout <<
" --- Problem definition ---\n\n";
823 cout <<
" >> Laplace equation in 3D with homogeneous Dirichlet condition\n";
824 cout <<
" >> Domain = [0, " << Lx <<
"] x [0, " << Ly <<
"] x [0, " << Lz <<
"]\n";
825 cout <<
" >> Orthogonal mesh uniform per direction with Q1 elements\n";
827 cout <<
" Global size = " << Map->NumGlobalElements() << endl;
829 cout <<
" Number of elements in [0, " << Lx <<
"] (X-direction): " << nX << endl;
830 cout <<
" Number of elements in [0, " << Ly <<
"] (Y-direction): " << nY << endl;
831 cout <<
" Number of elements in [0, " << Lz <<
"] (Z-direction): " << nZ << endl;
833 cout <<
" Number of interior nodes in the X-direction: " << nX-1 << endl;
834 cout <<
" Number of interior nodes in the Y-direction: " << nY-1 << endl;
835 cout <<
" Number of interior nodes in the Z-direction: " << nZ-1 << endl;
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual int NumGlobalNonzeros() const =0
virtual int NumGlobalRows() const =0