24 return Point3D(x + other.x, y + other.y, z + other.z);
29 return Point3D(x - other.x, y - other.y, z - other.z);
34 return x * other.x + y * other.y + z * other.z;
63 return Point3D(a * p.x, a * p.y, a * p.z);
68 return Point3D(a * p.x, a * p.y, a * p.z);
74 result.x = p1.y * p2.z - p1.z * p2.y;
75 result.y = p1.z * p2.x - p1.x * p2.z;
76 result.z = p1.x * p2.y - p1.y * p2.x;
83 result.x = M[0][0] * v.x + M[0][1] * v.y + M[0][2] * v.z;
84 result.y = M[1][0] * v.x + M[1][1] * v.y + M[1][2] * v.z;
85 result.z = M[2][0] * v.x + M[2][1] * v.y + M[2][2] * v.z;
92 (h.p0.x * (h.p1.y * (-h.p2.z - h.p3.z + h.p4.z + h.p5.z) +
93 h.p2.y * (h.p1.z - h.p3.z) +
94 h.p3.y * (h.p1.z + h.p2.z - h.p4.z - h.p7.z) +
95 h.p4.y * (-h.p1.z + h.p3.z - h.p5.z + h.p7.z) +
96 h.p5.y * (-h.p1.z + h.p4.z) + h.p7.y * (h.p3.z - h.p4.z)) +
97 h.p1.x * (h.p0.y * (+h.p2.z + h.p3.z - h.p4.z - h.p5.z) +
98 h.p2.y * (-h.p0.z - h.p3.z + h.p5.z + h.p6.z) +
99 h.p3.y * (-h.p0.z + h.p2.z) + h.p4.y * (h.p0.z - h.p5.z) +
100 h.p5.y * (h.p0.z - h.p2.z + h.p4.z - h.p6.z) +
101 h.p6.y * (-h.p2.z + h.p5.z)) +
102 h.p2.x * (h.p0.y * (-h.p1.z + h.p3.z) +
103 h.p1.y * (h.p0.z + h.p3.z - h.p5.z - h.p6.z) +
104 h.p3.y * (-h.p0.z - h.p1.z + h.p6.z + h.p7.z) +
105 h.p5.y * (h.p1.z - h.p6.z) +
106 h.p6.y * (h.p1.z - h.p3.z + h.p5.z - h.p7.z) +
107 h.p7.y * (-h.p3.z + h.p6.z)) +
108 h.p3.x * (h.p0.y * (-h.p1.z - h.p2.z + h.p4.z + h.p7.z) +
109 h.p1.y * (h.p0.z - h.p2.z) +
110 h.p2.y * (h.p0.z + h.p1.z - h.p6.z - h.p7.z) +
111 h.p4.y * (-h.p0.z + h.p7.z) + h.p6.y * (h.p2.z - h.p7.z) +
112 h.p7.y * (-h.p0.z + h.p2.z - h.p4.z + h.p6.z)) +
113 h.p4.x * (h.p0.y * (h.p1.z - h.p3.z + h.p5.z - h.p7.z) +
114 h.p1.y * (-h.p0.z + h.p5.z) + h.p3.y * (h.p0.z - h.p7.z) +
115 h.p5.y * (-h.p0.z - h.p1.z + h.p6.z + h.p7.z) +
116 h.p6.y * (-h.p5.z + h.p7.z) +
117 h.p7.y * (h.p0.z + h.p3.z - h.p5.z - h.p6.z)) +
118 h.p5.x * (h.p0.y * (h.p1.z - h.p4.z) +
119 h.p1.y * (-h.p0.z + h.p2.z - h.p4.z + h.p6.z) +
120 h.p2.y * (-h.p1.z + h.p6.z) +
121 h.p4.y * (h.p0.z + h.p1.z - h.p6.z - h.p7.z) +
122 h.p6.y * (-h.p1.z - h.p2.z + h.p4.z + h.p7.z) +
123 h.p7.y * (h.p4.z - h.p6.z)) +
124 h.p6.x * (h.p1.y * (h.p2.z - h.p5.z) +
125 h.p2.y * (-h.p1.z + h.p3.z - h.p5.z + h.p7.z) +
126 h.p3.y * (-h.p2.z + h.p7.z) + h.p4.y * (h.p5.z - h.p7.z) +
127 h.p5.y * (h.p1.z + h.p2.z - h.p4.z - h.p7.z) +
128 h.p7.y * (-h.p2.z - h.p3.z + h.p4.z + h.p5.z)) +
129 h.p7.x * (h.p0.y * (-h.p3.z + h.p4.z) + h.p2.y * (h.p3.z - h.p6.z) +
130 h.p3.y * (h.p0.z - h.p2.z + h.p4.z - h.p6.z) +
131 h.p4.y * (-h.p0.z - h.p3.z + h.p5.z + h.p6.z) +
132 h.p5.y * (-h.p4.z + h.p6.z) +
133 h.p6.y * (h.p2.z + h.p3.z - h.p4.z - h.p5.z))) /
141 Point3D result = r * (h.p0 + h.p1 + h.p2 + h.p3 + h.p4 + h.p5 + h.p6 + h.p7);
159 Point3D result = r * (f.p0 + f.p1 + f.p2 + f.p3);
169 OCP_DBL a11, a12, a21, a22, b1, b2, detA, detX, detY;
179 a11 = Line1[1].y - Line1[0].y;
180 a12 = Line1[0].x - Line1[1].x;
181 a21 = Line2[1].y - Line2[0].y;
182 a22 = Line2[0].x - Line2[1].x;
183 b1 = a11 * Line1[0].x + a12 * Line1[0].y;
184 b2 = a21 * Line2[0].x + a22 * Line2[0].y;
185 detA = a11 * a22 - a12 * a21;
188 detX = b1 * a22 - b2 * a12;
189 detY = a11 * b2 - a21 * b1;
190 crosspoint.x = detX / detA;
191 crosspoint.y = detY / detA;
193 crosspoint = Line1[0];
219 Point3D area, point1, point2, point3;
232 Line1[0] =
Point2D(FACE1.p0.x, FACE1.p0.y);
233 Line1[1] =
Point2D(FACE1.p1.x, FACE1.p1.y);
234 Line2[0] =
Point2D(FACE2.p0.x, FACE2.p0.y);
235 Line2[1] =
Point2D(FACE2.p1.x, FACE2.p1.y);
237 if ((crosspoint[0].x - Line1[0].x) * (crosspoint[0].x - Line1[1].x) < 0)
242 Line1[0] =
Point2D(FACE1.p2.x, FACE1.p2.y);
243 Line1[1] =
Point2D(FACE1.p3.x, FACE1.p3.y);
244 Line2[0] =
Point2D(FACE2.p0.x, FACE2.p0.y);
245 Line2[1] =
Point2D(FACE2.p1.x, FACE2.p1.y);
247 if ((crosspoint[1].x - Line1[0].x) * (crosspoint[1].x - Line1[1].x) < 0)
252 Line1[0] =
Point2D(FACE1.p0.x, FACE1.p0.y);
253 Line1[1] =
Point2D(FACE1.p1.x, FACE1.p1.y);
254 Line2[0] =
Point2D(FACE2.p2.x, FACE2.p2.y);
255 Line2[1] =
Point2D(FACE2.p3.x, FACE2.p3.y);
257 if ((crosspoint[2].x - Line1[0].x) * (crosspoint[2].x - Line1[1].x) < 0)
262 Line1[0] =
Point2D(FACE1.p2.x, FACE1.p2.y);
263 Line1[1] =
Point2D(FACE1.p3.x, FACE1.p3.y);
264 Line2[0] =
Point2D(FACE2.p2.x, FACE2.p2.y);
265 Line2[1] =
Point2D(FACE2.p3.x, FACE2.p3.y);
267 if ((crosspoint[3].x - Line1[0].x) * (crosspoint[3].x - Line1[1].x) < 0)
277 FACEtmp1.p1 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
278 FACEtmp2.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
280 if (FACE1.p0.y > FACE2.p0.y) {
281 FACEtmp1.p0 = FACE1.p0;
283 FACEtmp1.p0 = FACE2.p0;
286 if (FACE1.p1.y > FACE2.p1.y) {
287 FACEtmp2.p1 = FACE1.p1;
289 FACEtmp2.p1 = FACE2.p1;
292 if (FACE1.p3.y > FACE2.p3.y) {
293 FACEtmp1.p3 = FACE2.p3;
295 FACEtmp1.p3 = FACE1.p3;
298 if (FACE1.p2.y > FACE2.p2.y) {
299 FACEtmp2.p2 = FACE2.p2;
301 FACEtmp2.p2 = FACE1.p2;
304 FACEtmp1.p2 =
Point3D(0.5 * (FACEtmp1.p3.x + FACEtmp2.p2.x),
305 0.5 * (FACEtmp1.p3.y + FACEtmp2.p2.y), 0);
306 FACEtmp2.p3 = FACEtmp1.p2;
317 if (FACE1.p3.y > FACE2.p0.y) {
324 point3 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
333 FACEtmp1.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
334 FACEtmp1.p1 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
335 if (FACE1.p0.y < FACE2.p0.y) {
336 FACEtmp1.p2 = FACE1.p2;
337 FACEtmp1.p3 = FACE1.p1;
339 FACEtmp1.p2 = FACE1.p3;
340 FACEtmp1.p3 = FACE1.p0;
349 if (FACE1.p0.y < FACE2.p3.y) {
356 point3 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
365 FACEtmp1.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
366 FACEtmp1.p1 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
367 if (FACE2.p3.y > FACE1.p0.y) {
368 FACEtmp1.p2 = FACE2.p3;
369 FACEtmp1.p3 = FACE2.p0;
371 FACEtmp1.p2 = FACE2.p2;
372 FACEtmp1.p3 = FACE2.p1;
381 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
382 FACEtmp2.p3 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
384 if (FACE1.p0.y > FACE2.p0.y) {
385 FACEtmp1.p0 = FACE1.p0;
387 FACEtmp1.p0 = FACE2.p0;
390 if (FACE1.p1.y > FACE2.p1.y) {
391 FACEtmp2.p1 = FACE1.p1;
393 FACEtmp2.p1 = FACE2.p1;
396 if (FACE1.p3.y > FACE2.p3.y) {
397 FACEtmp1.p3 = FACE2.p3;
399 FACEtmp1.p3 = FACE1.p3;
402 if (FACE1.p2.y > FACE2.p2.y) {
403 FACEtmp2.p2 = FACE2.p2;
405 FACEtmp2.p2 = FACE1.p2;
408 FACEtmp1.p1 =
Point3D(0.5 * (FACEtmp1.p0.x + FACEtmp2.p1.x),
409 0.5 * (FACEtmp1.p0.y + FACEtmp2.p1.y), 0);
410 FACEtmp2.p0 = FACEtmp1.p1;
422 FACEtmp1.p1 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
423 FACEtmp2.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
424 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
425 FACEtmp2.p3 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
427 if (FACE1.p0.y > FACE2.p0.y) {
428 FACEtmp1.p0 = FACE1.p0;
430 FACEtmp1.p0 = FACE2.p0;
433 if (FACE1.p1.y > FACE2.p1.y) {
434 FACEtmp2.p1 = FACE1.p1;
436 FACEtmp2.p1 = FACE2.p1;
439 if (FACE1.p3.y > FACE2.p3.y) {
440 FACEtmp1.p3 = FACE2.p3;
442 FACEtmp1.p3 = FACE1.p3;
445 if (FACE1.p2.y > FACE2.p2.y) {
446 FACEtmp2.p2 = FACE2.p2;
448 FACEtmp2.p2 = FACE1.p2;
461 FACEtmp1.p0 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
462 FACEtmp1.p1 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
463 if (FACE1.p2.y > FACE2.p1.y) {
464 FACEtmp1.p2 = FACE2.p1;
465 FACEtmp1.p3 = FACE2.p2;
467 FACEtmp1.p2 = FACE2.p3;
468 FACEtmp1.p3 = FACE2.p0;
479 FACEtmp1.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
480 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
481 FACEtmp1.p3 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
482 FACEtmp2.p3 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
484 if (FACE1.p0.y < FACE2.p0.y) {
485 FACEtmp2.p1 = FACE1.p1;
486 FACEtmp2.p2 = FACE2.p2;
488 FACEtmp2.p1 = FACE1.p0;
489 FACEtmp2.p2 = FACE2.p3;
492 FACEtmp1.p1 =
Point3D(0.5 * (FACEtmp1.p0.x + FACEtmp2.p1.x),
493 0.5 * (FACEtmp1.p0.y + FACEtmp2.p1.y), 0);
494 FACEtmp2.p0 = FACEtmp1.p1;
506 FACEtmp1.p0 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
507 FACEtmp1.p1 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
508 if (FACE1.p2.y > FACE2.p2.y) {
509 FACEtmp1.p2 = FACE1.p3;
510 FACEtmp1.p3 = FACE1.p0;
512 FACEtmp1.p2 = FACE1.p2;
513 FACEtmp1.p3 = FACE1.p1;
524 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
525 FACEtmp2.p1 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
526 FACEtmp2.p2 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
527 FACEtmp2.p3 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
529 if (FACE1.p2.y > FACE2.p2.y) {
530 FACEtmp1.p0 = FACE2.p0;
531 FACEtmp1.p3 = FACE1.p3;
533 FACEtmp1.p0 = FACE2.p1;
534 FACEtmp1.p3 = FACE1.p2;
537 FACEtmp1.p1 =
Point3D(0.5 * (FACEtmp1.p0.x + FACEtmp2.p1.x),
538 0.5 * (FACEtmp1.p0.y + FACEtmp2.p1.y), 0);
539 FACEtmp2.p0 = FACEtmp1.p1;
553 FACEtmp1.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
554 FACEtmp1.p1 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
555 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
556 FACEtmp1.p3 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
567 void ConnGrid::Allocate(
const USI& max_neighbor)
570 maxConn = max_neighbor;
571 halfConn.resize(maxConn);
574 void ConnGrid::AddHalfConn(
const OCP_USI& n,
577 const USI& direction,
580 if (nConn >= maxConn) {
582 halfConn.resize(maxConn);
588 halfConn[nConn].Ad_dd = area * d / (d * d) * flag;
589 halfConn[nConn].d = d;
590 halfConn[nConn].neigh = n;
591 halfConn[nConn].directionType = direction;
597 void OCP_COORD::Allocate(
const USI& Nx,
const USI& Ny,
const USI& Nz)
602 numGrid = nx * ny * nz;
605 for (
USI i = 0; i < 3; i++) {
606 COORDDATA[i] =
new OCP_DBL*[2];
607 for (
USI j = 0; j < 2; j++) {
608 COORDDATA[i][j] =
new OCP_DBL[(nx + 1) * (ny + 1)];
612 ZCORNDATA =
new OCP_DBL***[nx];
613 for (
USI i = 0; i < nx; i++) {
614 ZCORNDATA[i] =
new OCP_DBL**[ny];
615 for (
USI j = 0; j < ny; j++) {
616 ZCORNDATA[i][j] =
new OCP_DBL*[nz];
617 for (
USI k = 0; k < nz; k++) {
618 ZCORNDATA[i][j][k] =
new OCP_DBL[8];
624 for (
USI i = 0; i < nx; i++) {
626 for (
USI j = 0; j < ny; j++) {
632 depth.resize(numGrid);
636 center.resize(numGrid);
639 void OCP_COORD::InputData(
const vector<OCP_DBL>& coord,
const vector<OCP_DBL>& zcorn)
641 if (coord.empty() || !InputCOORDDATA(coord)) {
644 if (zcorn.empty() || !InputZCORNDATA(zcorn)) {
649 OCP_BOOL OCP_COORD::InputCOORDDATA(
const vector<OCP_DBL>& coord)
655 for (
USI J = 0; J < ny + 1; J++) {
656 for (
USI I = 0; I < nx + 1; I++) {
658 for (
USI i = 0; i < 3; i++) {
659 COORDDATA[i][0][J * (nx + 1) + I] = coord[iter];
663 for (
USI i = 0; i < 3; i++) {
664 COORDDATA[i][1][J * (nx + 1) + I] = coord[iter];
674 OCP_BOOL OCP_COORD::InputZCORNDATA(
const vector<OCP_DBL>& zcorn)
680 for (
USI K = 0; K < nz; K++) {
681 for (
USI J = 0; J < ny; J++) {
682 for (
USI I = 0; I < nx; I++) {
683 ZCORNDATA[I][J][K][0] = zcorn[iter];
685 ZCORNDATA[I][J][K][1] = zcorn[iter];
688 for (
USI I = 0; I < nx; I++) {
689 ZCORNDATA[I][J][K][3] = zcorn[iter];
691 ZCORNDATA[I][J][K][2] = zcorn[iter];
695 for (
USI J = 0; J < ny; J++) {
696 for (
USI I = 0; I < nx; I++) {
697 ZCORNDATA[I][J][K][4] = zcorn[iter];
699 ZCORNDATA[I][J][K][5] = zcorn[iter];
702 for (
USI I = 0; I < nx; I++) {
703 ZCORNDATA[I][J][K][7] = zcorn[iter];
705 ZCORNDATA[I][J][K][6] = zcorn[iter];
719 if (oFace.p0.z > Face.p0.z +
TEENY) {
720 tmpFace.p0 = oFace.p0;
722 }
else if (oFace.p0.z < Face.p0.z -
TEENY)
727 if (oFace.p1.z > Face.p1.z +
TEENY)
729 else if (oFace.p1.z < Face.p1.z -
TEENY) {
730 tmpFace.p1 = oFace.p1;
735 if (oFace.p2.z > Face.p2.z +
TEENY)
737 else if (oFace.p2.z < Face.p2.z -
TEENY) {
738 tmpFace.p2 = oFace.p2;
743 if (oFace.p3.z > Face.p3.z +
TEENY) {
744 tmpFace.p3 = oFace.p3;
746 }
else if (oFace.p3.z < Face.p3.z -
TEENY)
755 if (((oFace.p1.z <= Face.p0.z) && (oFace.p2.z <= Face.p3.z)) ||
756 ((oFace.p0.z >= Face.p1.z) && (oFace.p3.z >= Face.p2.z))) {
759 flagJump = OCP_FALSE;
760 if ((flagp0 * flagp3 >= 0) && (oFace.p0.z <= Face.p1.z) &&
761 (oFace.p3.z <= Face.p2.z) && (flagp1 * flagp2 >= 0) &&
762 (oFace.p1.z >= Face.p0.z) && (oFace.p2.z >= Face.p3.z)) {
765 flagQuad = OCP_FALSE;
770 void OCP_COORD::SetupCornerPoints()
776 vector<ConnGrid> blockconn(numGrid);
777 for (
OCP_USI iloop = 0; iloop < numGrid; iloop++) {
778 blockconn[iloop].Allocate(10);
782 OCP_DBL xtop, ytop, ztop, xbottom, ybottom, zbottom, xvalue, yvalue, zvalue;
783 for (
USI k = 0; k < nz; k++) {
784 for (
USI j = 0; j < ny; j++) {
785 for (
USI i = 0; i < nx; i++) {
789 xtop = COORDDATA[0][0][j * (nx + 1) + i];
790 ytop = COORDDATA[1][0][j * (nx + 1) + i];
791 ztop = COORDDATA[2][0][j * (nx + 1) + i];
792 xbottom = COORDDATA[0][1][j * (nx + 1) + i];
793 ybottom = COORDDATA[1][1][j * (nx + 1) + i];
794 zbottom = COORDDATA[2][1][j * (nx + 1) + i];
796 zvalue = ZCORNDATA[i][j][k][0];
798 xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
800 ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
801 cornerPoints[i][j][k].p0 =
Point3D(xvalue, yvalue, zvalue);
803 zvalue = ZCORNDATA[i][j][k][4];
805 xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
807 ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
808 cornerPoints[i][j][k].p4 =
Point3D(xvalue, yvalue, zvalue);
812 xtop = COORDDATA[0][0][j * (nx + 1) + i + 1];
813 ytop = COORDDATA[1][0][j * (nx + 1) + i + 1];
814 ztop = COORDDATA[2][0][j * (nx + 1) + i + 1];
815 xbottom = COORDDATA[0][1][j * (nx + 1) + i + 1];
816 ybottom = COORDDATA[1][1][j * (nx + 1) + i + 1];
817 zbottom = COORDDATA[2][1][j * (nx + 1) + i + 1];
819 zvalue = ZCORNDATA[i][j][k][1];
821 xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
823 ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
824 cornerPoints[i][j][k].p1 =
Point3D(xvalue, yvalue, zvalue);
826 zvalue = ZCORNDATA[i][j][k][5];
828 xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
830 ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
831 cornerPoints[i][j][k].p5 =
Point3D(xvalue, yvalue, zvalue);
835 xtop = COORDDATA[0][0][(j + 1) * (nx + 1) + i + 1];
836 ytop = COORDDATA[1][0][(j + 1) * (nx + 1) + i + 1];
837 ztop = COORDDATA[2][0][(j + 1) * (nx + 1) + i + 1];
838 xbottom = COORDDATA[0][1][(j + 1) * (nx + 1) + i + 1];
839 ybottom = COORDDATA[1][1][(j + 1) * (nx + 1) + i + 1];
840 zbottom = COORDDATA[2][1][(j + 1) * (nx + 1) + i + 1];
842 zvalue = ZCORNDATA[i][j][k][2];
844 xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
846 ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
847 cornerPoints[i][j][k].p2 =
Point3D(xvalue, yvalue, zvalue);
849 zvalue = ZCORNDATA[i][j][k][6];
851 xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
853 ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
854 cornerPoints[i][j][k].p6 =
Point3D(xvalue, yvalue, zvalue);
858 xtop = COORDDATA[0][0][(j + 1) * (nx + 1) + i];
859 ytop = COORDDATA[1][0][(j + 1) * (nx + 1) + i];
860 ztop = COORDDATA[2][0][(j + 1) * (nx + 1) + i];
861 xbottom = COORDDATA[0][1][(j + 1) * (nx + 1) + i];
862 ybottom = COORDDATA[1][1][(j + 1) * (nx + 1) + i];
863 zbottom = COORDDATA[2][1][(j + 1) * (nx + 1) + i];
865 zvalue = ZCORNDATA[i][j][k][3];
867 xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
869 ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
870 cornerPoints[i][j][k].p3 =
Point3D(xvalue, yvalue, zvalue);
872 zvalue = ZCORNDATA[i][j][k][7];
874 xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
876 ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
877 cornerPoints[i][j][k].p7 =
Point3D(xvalue, yvalue, zvalue);
880 cindex = k * nxny + j * nx + i;
886 v[cindex] = fabs(v[cindex]);
888 depth[cindex] = center[cindex].z;
901 Point3D dxpoint, dypoint, dzpoint;
929 if (COORDDATA[1][0][nx + 1] > COORDDATA[1][0][0])
934 for (
USI k = 0; k < nz; k++) {
935 for (
USI j = 0; j < ny; j++) {
936 for (
USI i = 0; i < nx; i++) {
938 const Hexahedron& block = cornerPoints[i][j][k];
939 cindex = k * nxny + j * nx + i;
940 Pcenter = center[cindex];
952 Pc2f = Pface - Pcenter;
959 const Hexahedron& leftblock = cornerPoints[i - 1][j][k];
960 oindex = k * nxny + j * nx + i - 1;
962 oFace.p0 = leftblock.p1;
963 oFace.p1 = leftblock.p5;
964 oFace.p2 = leftblock.p6;
965 oFace.p3 = leftblock.p2;
967 SetAllFlags(oFace, Face);
976 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
977 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
978 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
979 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
980 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
981 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
982 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
983 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
988 if (fabs(areaV.x) < 1E-6) {
991 areaV.y = areaV.y / fabs(areaV.x) * areaP;
992 areaV.z = areaV.z / fabs(areaV.x) * areaP;
993 areaV.x = OCP_SIGN(areaV.x) * areaP;
996 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1,
1003 if ((flagp0 > 0) || (flagp3 > 0))
1007 if ((flagp1 < 0) || (flagp2 < 0))
1010 downNNC = OCP_FALSE;
1015 if (-iznnc -
static_cast<OCP_INT>(k) > 0)
break;
1017 const Hexahedron& leftblock = cornerPoints[i - 1][j][k + iznnc];
1018 oindex = (k + iznnc) * nxny + j * nx + i - 1;
1019 oFace.p0 = leftblock.p1;
1020 oFace.p1 = leftblock.p5;
1021 oFace.p2 = leftblock.p6;
1022 oFace.p3 = leftblock.p2;
1024 SetAllFlags(oFace, Face);
1033 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1034 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1035 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1036 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1037 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1038 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1039 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1040 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1045 if (fabs(areaV.x) < 1E-6) {
1048 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1049 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1050 areaV.x = OCP_SIGN(areaV.x) * areaP;
1053 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1,
1058 if ((flagp0 > 0) || (flagp3 > 0))
1066 if (k + iznnc > nz - 1)
break;
1068 const Hexahedron& leftblock = cornerPoints[i - 1][j][k + iznnc];
1069 oindex = (k + iznnc) * nxny + j * nx + i - 1;
1070 oFace.p0 = leftblock.p1;
1071 oFace.p1 = leftblock.p5;
1072 oFace.p2 = leftblock.p6;
1073 oFace.p3 = leftblock.p2;
1075 SetAllFlags(oFace, Face);
1084 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1085 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1086 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1087 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1088 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1089 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1090 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1091 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1096 if (fabs(areaV.x) < 1E-6) {
1099 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1100 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1101 areaV.x = OCP_SIGN(areaV.x) * areaP;
1104 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1,
1110 if ((flagp1 < 0) || (flagp2 < 0))
1113 downNNC = OCP_FALSE;
1125 Pc2f = Pface - Pcenter;
1126 dxpoint = Pc2f - dxpoint;
1132 const Hexahedron& rightblock = cornerPoints[i + 1][j][k];
1133 oindex = k * nxny + j * nx + i + 1;
1135 oFace.p0 = rightblock.p3;
1136 oFace.p1 = rightblock.p7;
1137 oFace.p2 = rightblock.p4;
1138 oFace.p3 = rightblock.p0;
1140 SetAllFlags(oFace, Face);
1149 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1150 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1151 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1152 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1153 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1154 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1155 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1156 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1161 if (fabs(areaV.x) < 1E-6) {
1164 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1165 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1166 areaV.x = OCP_SIGN(areaV.x) * areaP;
1169 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1,
1175 if ((flagp0 > 0) || (flagp3 > 0))
1179 if ((flagp1 < 0) || (flagp2 < 0))
1182 downNNC = OCP_FALSE;
1187 if (-iznnc -
static_cast<OCP_INT>(k) > 0)
break;
1190 cornerPoints[i + 1][j][k + iznnc];
1191 oindex = (k + iznnc) * nxny + j * nx + i + 1;
1192 oFace.p0 = rightblock.p3;
1193 oFace.p1 = rightblock.p7;
1194 oFace.p2 = rightblock.p4;
1195 oFace.p3 = rightblock.p0;
1197 SetAllFlags(oFace, Face);
1206 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1207 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1208 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1209 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1210 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1211 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1212 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1213 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1218 if (fabs(areaV.x) < 1E-6) {
1221 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1222 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1223 areaV.x = OCP_SIGN(areaV.x) * areaP;
1226 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1,
1232 if ((flagp0 > 0) || (flagp3 > 0))
1240 if (k + iznnc > nz - 1)
break;
1243 cornerPoints[i + 1][j][k + iznnc];
1244 oindex = (k + iznnc) * nxny + j * nx + i + 1;
1245 oFace.p0 = rightblock.p3;
1246 oFace.p1 = rightblock.p7;
1247 oFace.p2 = rightblock.p4;
1248 oFace.p3 = rightblock.p0;
1250 SetAllFlags(oFace, Face);
1259 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1260 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1261 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1262 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1263 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1264 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1265 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1266 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1271 if (fabs(areaV.x) < 1E-6) {
1274 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1275 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1276 areaV.x = OCP_SIGN(areaV.x) * areaP;
1279 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1,
1285 if ((flagp1 < 0) || (flagp2 < 0))
1288 downNNC = OCP_FALSE;
1300 Pc2f = Pface - Pcenter;
1307 const Hexahedron& backblock = cornerPoints[i][j - 1][k];
1308 oindex = k * nxny + (j - 1) * nx + i;
1310 oFace.p0 = backblock.p2;
1311 oFace.p1 = backblock.p6;
1312 oFace.p2 = backblock.p7;
1313 oFace.p3 = backblock.p3;
1315 SetAllFlags(oFace, Face);
1324 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1325 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1326 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1327 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1328 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1329 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1330 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1331 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1336 if (fabs(areaV.y) < 1E-6) {
1339 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1340 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1341 areaV.y = OCP_SIGN(areaV.y) * areaP;
1344 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2,
1350 if ((flagp0 > 0) || (flagp3 > 0))
1354 if ((flagp1 < 0) || (flagp2 < 0))
1357 downNNC = OCP_FALSE;
1362 if (-iznnc -
static_cast<OCP_INT>(k) > 0)
break;
1364 const Hexahedron& backblock = cornerPoints[i][j - 1][k + iznnc];
1365 oindex = (k + iznnc) * nxny + (j - 1) * nx + i;
1366 oFace.p0 = backblock.p2;
1367 oFace.p1 = backblock.p6;
1368 oFace.p2 = backblock.p7;
1369 oFace.p3 = backblock.p3;
1371 SetAllFlags(oFace, Face);
1380 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1381 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1382 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1383 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1384 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1385 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1386 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1387 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1392 if (fabs(areaV.y) < 1E-6) {
1395 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1396 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1397 areaV.y = OCP_SIGN(areaV.y) * areaP;
1400 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2,
1406 if ((flagp0 > 0) || (flagp3 > 0))
1414 if (k + iznnc > nz - 1)
break;
1416 const Hexahedron& backblock = cornerPoints[i][j - 1][k + iznnc];
1417 oindex = (k + iznnc) * nxny + (j - 1) * nx + i;
1418 oFace.p0 = backblock.p2;
1419 oFace.p1 = backblock.p6;
1420 oFace.p2 = backblock.p7;
1421 oFace.p3 = backblock.p3;
1423 SetAllFlags(oFace, Face);
1432 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1433 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1434 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1435 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1436 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1437 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1438 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1439 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1444 if (fabs(areaV.y) < 1E-6) {
1447 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1448 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1449 areaV.y = OCP_SIGN(areaV.y) * areaP;
1452 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2,
1458 if ((flagp1 < 0) || (flagp2 < 0))
1461 downNNC = OCP_FALSE;
1473 Pc2f = Pface - Pcenter;
1474 dypoint = Pc2f - dypoint;
1480 const Hexahedron& frontblock = cornerPoints[i][j + 1][k];
1481 oindex = k * nxny + (j + 1) * nx + i;
1483 oFace.p0 = frontblock.p0;
1484 oFace.p1 = frontblock.p4;
1485 oFace.p2 = frontblock.p5;
1486 oFace.p3 = frontblock.p1;
1488 SetAllFlags(oFace, Face);
1497 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1498 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1499 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1500 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1501 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1502 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1503 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1504 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1509 if (fabs(areaV.y) < 1E-6) {
1512 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1513 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1514 areaV.y = OCP_SIGN(areaV.y) * areaP;
1517 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2,
1523 if ((flagp0 > 0) || (flagp3 > 0))
1527 if ((flagp1 < 0) || (flagp2 < 0))
1530 downNNC = OCP_FALSE;
1535 if (-iznnc -
static_cast<OCP_INT>(k) > 0)
break;
1538 cornerPoints[i][j + 1][k + iznnc];
1539 oindex = (k + iznnc) * nxny + (j + 1) * nx + i;
1540 oFace.p0 = frontblock.p0;
1541 oFace.p1 = frontblock.p4;
1542 oFace.p2 = frontblock.p5;
1543 oFace.p3 = frontblock.p1;
1545 SetAllFlags(oFace, Face);
1554 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1555 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1556 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1557 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1558 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1559 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1560 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1561 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1566 if (fabs(areaV.y) < 1E-6) {
1569 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1570 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1571 areaV.y = OCP_SIGN(areaV.y) * areaP;
1574 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2,
1580 if ((flagp0 > 0) || (flagp3 > 0))
1588 if (k + iznnc > nz - 1)
break;
1591 cornerPoints[i][j + 1][k + iznnc];
1592 oindex = (k + iznnc) * nxny + (j + 1) * nx + i;
1593 oFace.p0 = frontblock.p0;
1594 oFace.p1 = frontblock.p4;
1595 oFace.p2 = frontblock.p5;
1596 oFace.p3 = frontblock.p1;
1598 SetAllFlags(oFace, Face);
1607 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1608 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1609 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1610 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1611 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1612 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1613 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1614 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1619 if (fabs(areaV.y) < 1E-6) {
1622 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1623 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1624 areaV.y = OCP_SIGN(areaV.y) * areaP;
1627 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2,
1633 if ((flagp1 < 0) || (flagp2 < 0))
1636 downNNC = OCP_FALSE;
1648 Pc2f = Pface - Pcenter;
1654 oindex = (k - 1) * nxny + j * nx + i;
1658 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 3, flagForward);
1670 Pc2f = Pface - Pcenter;
1671 dzpoint = Pc2f - dzpoint;
1677 oindex = (k + 1) * nxny + j * nx + i;
1681 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 3, flagForward);
1686 dx[cindex] = sqrt(dxpoint.x * dxpoint.x + dxpoint.y * dxpoint.y +
1687 dxpoint.z * dxpoint.z);
1688 dy[cindex] = sqrt(dypoint.x * dypoint.x + dypoint.y * dypoint.y +
1689 dypoint.z * dypoint.z);
1690 dz[cindex] = sqrt(dzpoint.x * dzpoint.x + dzpoint.y * dzpoint.y +
1691 dzpoint.z * dzpoint.z);
1693 OCP_ASSERT(isfinite(dx[cindex]),
"Wrong dx!");
1694 OCP_ASSERT(isfinite(dy[cindex]),
"Wrong dy!");
1695 OCP_ASSERT(isfinite(dz[cindex]),
"Wrong dz!");
1700 OCP_ASSERT(num_conn % 2 == 0,
"Wrong Conn!");
1701 numConnMax = num_conn / 2;
1702 connect.resize(numConnMax);
1708 for (
OCP_USI n = 0; n < numGrid; n++) {
1709 for (
USI j = 0; j < blockconn[n].nConn; j++) {
1710 OCP_USI nn = blockconn[n].halfConn[j].neigh;
1711 if (nn < n)
continue;
1713 for (jj = 0; jj < blockconn[nn].nConn; jj++) {
1714 if (blockconn[nn].halfConn[jj].neigh == n) {
1718 if (jj == blockconn[nn].nConn) {
1721 if (blockconn[n].halfConn[j].Ad_dd <= 0 ||
1722 blockconn[nn].halfConn[jj].Ad_dd <= 0) {
1731 connect[iter_conn].begin = n;
1732 connect[iter_conn].Ad_dd_begin = blockconn[n].halfConn[j].Ad_dd;
1733 connect[iter_conn].end = nn;
1734 connect[iter_conn].Ad_dd_end = blockconn[nn].halfConn[jj].Ad_dd;
1735 connect[iter_conn].directionType = blockconn[n].halfConn[j].directionType;
1739 numConn = iter_conn;
OCP_DBL CalAreaNotQuadr(const HexahedronFace &FACE1, const HexahedronFace &FACE2)
???
Point3D VectorFace(const HexahedronFace &f)
Find the normal vector of a face.
Point3D CrossProduct(const Point3D &p1, const Point3D &p2)
Cross product.
Point2D CalCrossingPoint(const Point2D Line1[2], const Point2D Line2[2])
???
Point3D CenterHexahedron(const Hexahedron &h)
Find the center of a hexahedron.
Point3D CenterFace(const HexahedronFace &f)
Find the center of a face.
Point3D operator*(const Point3D &p, const OCP_DBL &a)
Point * a.
OCP_DBL VolumHexahedron(const Hexahedron &h)
Get the volume of a hexahedron.
Declaration of classes related to the corner grid.
const OCP_DBL TEENY
Used for checking distance b/w center to face.
const OCP_DBL SMALL_REAL
Used for checking determinate of a small matrix.
const USI MAX_NEIGHBOR
Max number of neighbors allowed.
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
unsigned int OCP_USI
Long unsigned integer.
unsigned int OCP_BOOL
OCP_BOOL in OCP.
#define OCP_WARNING(msg)
Log warning messages.
#define OCP_ASSERT(cond, msg)
Assert condition and log user messages in DEBUG mode.
#define OCP_ABORT(msg)
Abort if critical error happens.
A face of a hexahedron cell.
Point3D operator-(const Point3D &other) const
Subtraction.
Point3D operator+(const Point3D &other) const
Addition.
Point3D & operator=(const Point3D &other)
equal
OCP_DBL operator*(const Point3D &other) const
Multiplication.