25 return Point3D(x + other.x, y + other.y, z + other.z);
30 return Point3D(x - other.x, y - other.y, z - other.z);
35 return x * other.x + y * other.y + z * other.z;
40 return Point3D(a * p.x, a * p.y, a * p.z);
45 return Point3D(a * p.x, a * p.y, a * p.z);
51 result.x = p1.y * p2.z - p1.z * p2.y;
52 result.y = p1.z * p2.x - p1.x * p2.z;
53 result.z = p1.x * p2.y - p1.y * p2.x;
60 result.x = M[0][0] * v.x + M[0][1] * v.y + M[0][2] * v.z;
61 result.y = M[1][0] * v.x + M[1][1] * v.y + M[1][2] * v.z;
62 result.z = M[2][0] * v.x + M[2][1] * v.y + M[2][2] * v.z;
69 (h.p0.x * (h.p1.y * (-h.p2.z - h.p3.z + h.p4.z + h.p5.z) +
70 h.p2.y * (h.p1.z - h.p3.z) +
71 h.p3.y * (h.p1.z + h.p2.z - h.p4.z - h.p7.z) +
72 h.p4.y * (-h.p1.z + h.p3.z - h.p5.z + h.p7.z) +
73 h.p5.y * (-h.p1.z + h.p4.z) + h.p7.y * (h.p3.z - h.p4.z)) +
74 h.p1.x * (h.p0.y * (+h.p2.z + h.p3.z - h.p4.z - h.p5.z) +
75 h.p2.y * (-h.p0.z - h.p3.z + h.p5.z + h.p6.z) +
76 h.p3.y * (-h.p0.z + h.p2.z) + h.p4.y * (h.p0.z - h.p5.z) +
77 h.p5.y * (h.p0.z - h.p2.z + h.p4.z - h.p6.z) +
78 h.p6.y * (-h.p2.z + h.p5.z)) +
79 h.p2.x * (h.p0.y * (-h.p1.z + h.p3.z) +
80 h.p1.y * (h.p0.z + h.p3.z - h.p5.z - h.p6.z) +
81 h.p3.y * (-h.p0.z - h.p1.z + h.p6.z + h.p7.z) +
82 h.p5.y * (h.p1.z - h.p6.z) +
83 h.p6.y * (h.p1.z - h.p3.z + h.p5.z - h.p7.z) +
84 h.p7.y * (-h.p3.z + h.p6.z)) +
85 h.p3.x * (h.p0.y * (-h.p1.z - h.p2.z + h.p4.z + h.p7.z) +
86 h.p1.y * (h.p0.z - h.p2.z) +
87 h.p2.y * (h.p0.z + h.p1.z - h.p6.z - h.p7.z) +
88 h.p4.y * (-h.p0.z + h.p7.z) + h.p6.y * (h.p2.z - h.p7.z) +
89 h.p7.y * (-h.p0.z + h.p2.z - h.p4.z + h.p6.z)) +
90 h.p4.x * (h.p0.y * (h.p1.z - h.p3.z + h.p5.z - h.p7.z) +
91 h.p1.y * (-h.p0.z + h.p5.z) + h.p3.y * (h.p0.z - h.p7.z) +
92 h.p5.y * (-h.p0.z - h.p1.z + h.p6.z + h.p7.z) +
93 h.p6.y * (-h.p5.z + h.p7.z) +
94 h.p7.y * (h.p0.z + h.p3.z - h.p5.z - h.p6.z)) +
95 h.p5.x * (h.p0.y * (h.p1.z - h.p4.z) +
96 h.p1.y * (-h.p0.z + h.p2.z - h.p4.z + h.p6.z) +
97 h.p2.y * (-h.p1.z + h.p6.z) +
98 h.p4.y * (h.p0.z + h.p1.z - h.p6.z - h.p7.z) +
99 h.p6.y * (-h.p1.z - h.p2.z + h.p4.z + h.p7.z) +
100 h.p7.y * (h.p4.z - h.p6.z)) +
101 h.p6.x * (h.p1.y * (h.p2.z - h.p5.z) +
102 h.p2.y * (-h.p1.z + h.p3.z - h.p5.z + h.p7.z) +
103 h.p3.y * (-h.p2.z + h.p7.z) + h.p4.y * (h.p5.z - h.p7.z) +
104 h.p5.y * (h.p1.z + h.p2.z - h.p4.z - h.p7.z) +
105 h.p7.y * (-h.p2.z - h.p3.z + h.p4.z + h.p5.z)) +
106 h.p7.x * (h.p0.y * (-h.p3.z + h.p4.z) + h.p2.y * (h.p3.z - h.p6.z) +
107 h.p3.y * (h.p0.z - h.p2.z + h.p4.z - h.p6.z) +
108 h.p4.y * (-h.p0.z - h.p3.z + h.p5.z + h.p6.z) +
109 h.p5.y * (-h.p4.z + h.p6.z) +
110 h.p6.y * (h.p2.z + h.p3.z - h.p4.z - h.p5.z))) /
118 Point3D result = r * (h.p0 + h.p1 + h.p2 + h.p3 + h.p4 + h.p5 + h.p6 + h.p7);
136 Point3D result = r * (f.p0 + f.p1 + f.p2 + f.p3);
146 OCP_DBL a11, a12, a21, a22, b1, b2, detA, detX, detY;
156 a11 = Line1[1].y - Line1[0].y;
157 a12 = Line1[0].x - Line1[1].x;
158 a21 = Line2[1].y - Line2[0].y;
159 a22 = Line2[0].x - Line2[1].x;
160 b1 = a11 * Line1[0].x + a12 * Line1[0].y;
161 b2 = a21 * Line2[0].x + a22 * Line2[0].y;
162 detA = a11 * a22 - a12 * a21;
165 detX = b1 * a22 - b2 * a12;
166 detY = a11 * b2 - a21 * b1;
167 crosspoint.x = detX / detA;
168 crosspoint.y = detY / detA;
170 crosspoint = Line1[0];
196 Point3D area, point1, point2, point3;
209 Line1[0] =
Point2D(FACE1.p0.x, FACE1.p0.y);
210 Line1[1] =
Point2D(FACE1.p1.x, FACE1.p1.y);
211 Line2[0] =
Point2D(FACE2.p0.x, FACE2.p0.y);
212 Line2[1] =
Point2D(FACE2.p1.x, FACE2.p1.y);
214 if ((crosspoint[0].x - Line1[0].x) * (crosspoint[0].x - Line1[1].x) < 0)
219 Line1[0] =
Point2D(FACE1.p2.x, FACE1.p2.y);
220 Line1[1] =
Point2D(FACE1.p3.x, FACE1.p3.y);
221 Line2[0] =
Point2D(FACE2.p0.x, FACE2.p0.y);
222 Line2[1] =
Point2D(FACE2.p1.x, FACE2.p1.y);
224 if ((crosspoint[1].x - Line1[0].x) * (crosspoint[1].x - Line1[1].x) < 0)
229 Line1[0] =
Point2D(FACE1.p0.x, FACE1.p0.y);
230 Line1[1] =
Point2D(FACE1.p1.x, FACE1.p1.y);
231 Line2[0] =
Point2D(FACE2.p2.x, FACE2.p2.y);
232 Line2[1] =
Point2D(FACE2.p3.x, FACE2.p3.y);
234 if ((crosspoint[2].x - Line1[0].x) * (crosspoint[2].x - Line1[1].x) < 0)
239 Line1[0] =
Point2D(FACE1.p2.x, FACE1.p2.y);
240 Line1[1] =
Point2D(FACE1.p3.x, FACE1.p3.y);
241 Line2[0] =
Point2D(FACE2.p2.x, FACE2.p2.y);
242 Line2[1] =
Point2D(FACE2.p3.x, FACE2.p3.y);
244 if ((crosspoint[3].x - Line1[0].x) * (crosspoint[3].x - Line1[1].x) < 0)
254 FACEtmp1.p1 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
255 FACEtmp2.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
257 if (FACE1.p0.y > FACE2.p0.y) {
258 FACEtmp1.p0 = FACE1.p0;
260 FACEtmp1.p0 = FACE2.p0;
263 if (FACE1.p1.y > FACE2.p1.y) {
264 FACEtmp2.p1 = FACE1.p1;
266 FACEtmp2.p1 = FACE2.p1;
269 if (FACE1.p3.y > FACE2.p3.y) {
270 FACEtmp1.p3 = FACE2.p3;
272 FACEtmp1.p3 = FACE1.p3;
275 if (FACE1.p2.y > FACE2.p2.y) {
276 FACEtmp2.p2 = FACE2.p2;
278 FACEtmp2.p2 = FACE1.p2;
281 FACEtmp1.p2 =
Point3D(0.5 * (FACEtmp1.p3.x + FACEtmp2.p2.x),
282 0.5 * (FACEtmp1.p3.y + FACEtmp2.p2.y), 0);
283 FACEtmp2.p3 = FACEtmp1.p2;
294 if (FACE1.p3.y > FACE2.p0.y) {
301 point3 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
310 FACEtmp1.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
311 FACEtmp1.p1 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
312 if (FACE1.p0.y < FACE2.p0.y) {
313 FACEtmp1.p2 = FACE1.p2;
314 FACEtmp1.p3 = FACE1.p1;
316 FACEtmp1.p2 = FACE1.p3;
317 FACEtmp1.p3 = FACE1.p0;
326 if (FACE1.p0.y < FACE2.p3.y) {
333 point3 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
342 FACEtmp1.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
343 FACEtmp1.p1 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
344 if (FACE2.p3.y > FACE1.p0.y) {
345 FACEtmp1.p2 = FACE2.p3;
346 FACEtmp1.p3 = FACE2.p0;
348 FACEtmp1.p2 = FACE2.p2;
349 FACEtmp1.p3 = FACE2.p1;
358 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
359 FACEtmp2.p3 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
361 if (FACE1.p0.y > FACE2.p0.y) {
362 FACEtmp1.p0 = FACE1.p0;
364 FACEtmp1.p0 = FACE2.p0;
367 if (FACE1.p1.y > FACE2.p1.y) {
368 FACEtmp2.p1 = FACE1.p1;
370 FACEtmp2.p1 = FACE2.p1;
373 if (FACE1.p3.y > FACE2.p3.y) {
374 FACEtmp1.p3 = FACE2.p3;
376 FACEtmp1.p3 = FACE1.p3;
379 if (FACE1.p2.y > FACE2.p2.y) {
380 FACEtmp2.p2 = FACE2.p2;
382 FACEtmp2.p2 = FACE1.p2;
385 FACEtmp1.p1 =
Point3D(0.5 * (FACEtmp1.p0.x + FACEtmp2.p1.x),
386 0.5 * (FACEtmp1.p0.y + FACEtmp2.p1.y), 0);
387 FACEtmp2.p0 = FACEtmp1.p1;
399 FACEtmp1.p1 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
400 FACEtmp2.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
401 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
402 FACEtmp2.p3 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
404 if (FACE1.p0.y > FACE2.p0.y) {
405 FACEtmp1.p0 = FACE1.p0;
407 FACEtmp1.p0 = FACE2.p0;
410 if (FACE1.p1.y > FACE2.p1.y) {
411 FACEtmp2.p1 = FACE1.p1;
413 FACEtmp2.p1 = FACE2.p1;
416 if (FACE1.p3.y > FACE2.p3.y) {
417 FACEtmp1.p3 = FACE2.p3;
419 FACEtmp1.p3 = FACE1.p3;
422 if (FACE1.p2.y > FACE2.p2.y) {
423 FACEtmp2.p2 = FACE2.p2;
425 FACEtmp2.p2 = FACE1.p2;
438 FACEtmp1.p0 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
439 FACEtmp1.p1 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
440 if (FACE1.p2.y > FACE2.p1.y) {
441 FACEtmp1.p2 = FACE2.p1;
442 FACEtmp1.p3 = FACE2.p2;
444 FACEtmp1.p2 = FACE2.p3;
445 FACEtmp1.p3 = FACE2.p0;
456 FACEtmp1.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
457 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
458 FACEtmp1.p3 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
459 FACEtmp2.p3 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
461 if (FACE1.p0.y < FACE2.p0.y) {
462 FACEtmp2.p1 = FACE1.p1;
463 FACEtmp2.p2 = FACE2.p2;
465 FACEtmp2.p1 = FACE1.p0;
466 FACEtmp2.p2 = FACE2.p3;
469 FACEtmp1.p1 =
Point3D(0.5 * (FACEtmp1.p0.x + FACEtmp2.p1.x),
470 0.5 * (FACEtmp1.p0.y + FACEtmp2.p1.y), 0);
471 FACEtmp2.p0 = FACEtmp1.p1;
483 FACEtmp1.p0 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
484 FACEtmp1.p1 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
485 if (FACE1.p2.y > FACE2.p2.y) {
486 FACEtmp1.p2 = FACE1.p3;
487 FACEtmp1.p3 = FACE1.p0;
489 FACEtmp1.p2 = FACE1.p2;
490 FACEtmp1.p3 = FACE1.p1;
501 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
502 FACEtmp2.p1 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
503 FACEtmp2.p2 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
504 FACEtmp2.p3 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
506 if (FACE1.p2.y > FACE2.p2.y) {
507 FACEtmp1.p0 = FACE2.p0;
508 FACEtmp1.p3 = FACE1.p3;
510 FACEtmp1.p0 = FACE2.p1;
511 FACEtmp1.p3 = FACE1.p2;
514 FACEtmp1.p1 =
Point3D(0.5 * (FACEtmp1.p0.x + FACEtmp2.p1.x),
515 0.5 * (FACEtmp1.p0.y + FACEtmp2.p1.y), 0);
516 FACEtmp2.p0 = FACEtmp1.p1;
530 FACEtmp1.p0 =
Point3D(crosspoint[0].x, crosspoint[0].y, 0);
531 FACEtmp1.p1 =
Point3D(crosspoint[2].x, crosspoint[2].y, 0);
532 FACEtmp1.p2 =
Point3D(crosspoint[3].x, crosspoint[3].y, 0);
533 FACEtmp1.p3 =
Point3D(crosspoint[1].x, crosspoint[1].y, 0);
544 void ConnGrid::Allocate(
const USI& max_neighbor)
547 maxConn = max_neighbor;
548 halfConn.resize(maxConn);
554 if (nConn >= maxConn) {
556 halfConn.resize(maxConn);
562 halfConn[nConn].Ad_dd = area * d / (d * d) * flag;
563 halfConn[nConn].d = d;
564 halfConn[nConn].neigh = n;
565 halfConn[nConn].directionType = direction;
571 void COORD::Allocate(
const USI& Nx,
const USI& Ny,
const USI& Nz)
576 numGrid = nx * ny * nz;
579 for (
USI i = 0; i < 3; i++) {
580 COORDDATA[i] =
new OCP_DBL*[2];
581 for (
USI j = 0; j < 2; j++) {
582 COORDDATA[i][j] =
new OCP_DBL[(nx + 1) * (ny + 1)];
586 ZCORNDATA =
new OCP_DBL***[nx];
587 for (
USI i = 0; i < nx; i++) {
588 ZCORNDATA[i] =
new OCP_DBL**[ny];
589 for (
USI j = 0; j < ny; j++) {
590 ZCORNDATA[i][j] =
new OCP_DBL*[nz];
591 for (
USI k = 0; k < nz; k++) {
592 ZCORNDATA[i][j][k] =
new OCP_DBL[8];
598 for (
USI i = 0; i < nx; i++) {
600 for (
USI j = 0; j < ny; j++) {
606 depth.resize(numGrid);
610 center.resize(numGrid);
613 void COORD::InputData(
const vector<OCP_DBL>& coord,
const vector<OCP_DBL>& zcorn)
615 if (coord.empty() || !InputCOORDDATA(coord)) {
618 if (zcorn.empty() || !InputZCORNDATA(zcorn)) {
623 bool COORD::InputCOORDDATA(
const vector<OCP_DBL>& coord)
629 for (
USI J = 0; J < ny + 1; J++) {
630 for (
USI I = 0; I < nx + 1; I++) {
632 for (
USI i = 0; i < 3; i++) {
633 COORDDATA[i][0][J * (nx + 1) + I] = coord[iter];
637 for (
USI i = 0; i < 3; i++) {
638 COORDDATA[i][1][J * (nx + 1) + I] = coord[iter];
648 bool COORD::InputZCORNDATA(
const vector<OCP_DBL>& zcorn)
654 for (
USI K = 0; K < nz; K++) {
655 for (
USI J = 0; J < ny; J++) {
656 for (
USI I = 0; I < nx; I++) {
657 ZCORNDATA[I][J][K][0] = zcorn[iter];
659 ZCORNDATA[I][J][K][1] = zcorn[iter];
662 for (
USI I = 0; I < nx; I++) {
663 ZCORNDATA[I][J][K][3] = zcorn[iter];
665 ZCORNDATA[I][J][K][2] = zcorn[iter];
669 for (
USI J = 0; J < ny; J++) {
670 for (
USI I = 0; I < nx; I++) {
671 ZCORNDATA[I][J][K][4] = zcorn[iter];
673 ZCORNDATA[I][J][K][5] = zcorn[iter];
676 for (
USI I = 0; I < nx; I++) {
677 ZCORNDATA[I][J][K][7] = zcorn[iter];
679 ZCORNDATA[I][J][K][6] = zcorn[iter];
694 if (oFace.p0.z > Face.p0.z +
TEENY) {
695 tmpFace.p0 = oFace.p0; flagp0 = 1;
697 else if (oFace.p0.z < Face.p0.z -
TEENY) flagp0 = -1;
701 if (oFace.p1.z > Face.p1.z +
TEENY) flagp1 = 1;
702 else if (oFace.p1.z < Face.p1.z -
TEENY) {
703 tmpFace.p1 = oFace.p1; flagp1 = -1;
708 if (oFace.p2.z > Face.p2.z +
TEENY) flagp2 = 1;
709 else if (oFace.p2.z < Face.p2.z -
TEENY) {
710 tmpFace.p2 = oFace.p2; flagp2 = -1;
714 if (oFace.p3.z > Face.p3.z +
TEENY) {
715 tmpFace.p3 = oFace.p3; flagp3 = 1;
717 else if (oFace.p3.z < Face.p3.z -
TEENY) flagp3 = -1;
724 if (((oFace.p1.z <= Face.p0.z) && (oFace.p2.z <= Face.p3.z)) ||
725 ((oFace.p0.z >= Face.p1.z) && (oFace.p3.z >= Face.p2.z))){
730 if ((flagp0 * flagp3 >= 0) && (oFace.p0.z <= Face.p1.z) && (oFace.p3.z <= Face.p2.z) &&
731 (flagp1 * flagp2 >= 0) && (oFace.p1.z >= Face.p0.z) && (oFace.p2.z >= Face.p3.z)) {
741 void COORD::SetupCornerPoints()
747 vector<ConnGrid> blockconn(numGrid);
748 for (
OCP_USI iloop = 0; iloop < numGrid; iloop++) {
749 blockconn[iloop].Allocate(10);
753 OCP_DBL xtop, ytop, ztop, xbottom, ybottom, zbottom, xvalue, yvalue, zvalue;
754 for (
USI k = 0; k < nz; k++) {
755 for (
USI j = 0; j < ny; j++) {
756 for (
USI i = 0; i < nx; i++) {
760 xtop = COORDDATA[0][0][j * (nx + 1) + i];
761 ytop = COORDDATA[1][0][j * (nx + 1) + i];
762 ztop = COORDDATA[2][0][j * (nx + 1) + i];
763 xbottom = COORDDATA[0][1][j * (nx + 1) + i];
764 ybottom = COORDDATA[1][1][j * (nx + 1) + i];
765 zbottom = COORDDATA[2][1][j * (nx + 1) + i];
767 zvalue = ZCORNDATA[i][j][k][0];
768 xvalue = xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
769 yvalue = ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
770 cornerPoints[i][j][k].p0 =
Point3D(xvalue, yvalue, zvalue);
772 zvalue = ZCORNDATA[i][j][k][4];
773 xvalue = xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
774 yvalue = ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
775 cornerPoints[i][j][k].p4 =
Point3D(xvalue, yvalue, zvalue);
779 xtop = COORDDATA[0][0][j * (nx + 1) + i + 1];
780 ytop = COORDDATA[1][0][j * (nx + 1) + i + 1];
781 ztop = COORDDATA[2][0][j * (nx + 1) + i + 1];
782 xbottom = COORDDATA[0][1][j * (nx + 1) + i + 1];
783 ybottom = COORDDATA[1][1][j * (nx + 1) + i + 1];
784 zbottom = COORDDATA[2][1][j * (nx + 1) + i + 1];
786 zvalue = ZCORNDATA[i][j][k][1];
787 xvalue = xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
788 yvalue = ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
789 cornerPoints[i][j][k].p1 =
Point3D(xvalue, yvalue, zvalue);
791 zvalue = ZCORNDATA[i][j][k][5];
792 xvalue = xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
793 yvalue = ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
794 cornerPoints[i][j][k].p5 =
Point3D(xvalue, yvalue, zvalue);
798 xtop = COORDDATA[0][0][(j + 1) * (nx + 1) + i + 1];
799 ytop = COORDDATA[1][0][(j + 1) * (nx + 1) + i + 1];
800 ztop = COORDDATA[2][0][(j + 1) * (nx + 1) + i + 1];
801 xbottom = COORDDATA[0][1][(j + 1) * (nx + 1) + i + 1];
802 ybottom = COORDDATA[1][1][(j + 1) * (nx + 1) + i + 1];
803 zbottom = COORDDATA[2][1][(j + 1) * (nx + 1) + i + 1];
805 zvalue = ZCORNDATA[i][j][k][2];
806 xvalue = xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
807 yvalue = ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
808 cornerPoints[i][j][k].p2 =
Point3D(xvalue, yvalue, zvalue);
810 zvalue = ZCORNDATA[i][j][k][6];
811 xvalue = xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
812 yvalue = ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
813 cornerPoints[i][j][k].p6 =
Point3D(xvalue, yvalue, zvalue);
817 xtop = COORDDATA[0][0][(j + 1) * (nx + 1) + i];
818 ytop = COORDDATA[1][0][(j + 1) * (nx + 1) + i];
819 ztop = COORDDATA[2][0][(j + 1) * (nx + 1) + i];
820 xbottom = COORDDATA[0][1][(j + 1) * (nx + 1) + i];
821 ybottom = COORDDATA[1][1][(j + 1) * (nx + 1) + i];
822 zbottom = COORDDATA[2][1][(j + 1) * (nx + 1) + i];
824 zvalue = ZCORNDATA[i][j][k][3];
825 xvalue = xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
826 yvalue = ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
827 cornerPoints[i][j][k].p3 =
Point3D(xvalue, yvalue, zvalue);
829 zvalue = ZCORNDATA[i][j][k][7];
830 xvalue = xbottom - (zbottom - zvalue) / (zbottom - ztop) * (xbottom - xtop);
831 yvalue = ybottom - (zbottom - zvalue) / (zbottom - ztop) * (ybottom - ytop);
832 cornerPoints[i][j][k].p7 =
Point3D(xvalue, yvalue, zvalue);
836 cindex = k * nxny + j * nx + i;
842 v[cindex] = fabs(v[cindex]);
844 depth[cindex] = center[cindex].z;
857 Point3D dxpoint, dypoint, dzpoint;
886 if (COORDDATA[1][0][nx + 1] > COORDDATA[1][0][0]) flagForward = 1.0;
887 else flagForward = -1.0;
889 for (
USI k = 0; k < nz; k++) {
890 for (
USI j = 0; j < ny; j++) {
891 for (
USI i = 0; i < nx; i++) {
893 const Hexahedron& block = cornerPoints[i][j][k];
894 cindex = k * nxny + j * nx + i;
895 Pcenter = center[cindex];
907 Pc2f = Pface - Pcenter;
915 const Hexahedron& leftblock = cornerPoints[i-1][j][k];
916 oindex = k * nxny + j * nx + i - 1;
918 oFace.p0 = leftblock.p1;
919 oFace.p1 = leftblock.p5;
920 oFace.p2 = leftblock.p6;
921 oFace.p3 = leftblock.p2;
923 SetAllFlags(oFace, Face);
934 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
935 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
936 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
937 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
938 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
939 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
940 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
941 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
946 if (fabs(areaV.x) < 1E-6) {
950 areaV.y = areaV.y / fabs(areaV.x) * areaP;
951 areaV.z = areaV.z / fabs(areaV.x) * areaP;
952 areaV.x = OCP_SIGN(areaV.x) * areaP;
955 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1, flagForward);
961 if ((flagp0 > 0) || (flagp3 > 0)) upNNC =
true;
963 if ((flagp1 < 0) || (flagp2 < 0)) downNNC =
true;
964 else downNNC =
false;
968 if (-iznnc > k)
break;
970 const Hexahedron& leftblock = cornerPoints[i - 1][j][k + iznnc];
971 oindex = (k + iznnc) * nxny + j * nx + i - 1;
972 oFace.p0 = leftblock.p1;
973 oFace.p1 = leftblock.p5;
974 oFace.p2 = leftblock.p6;
975 oFace.p3 = leftblock.p2;
977 SetAllFlags(oFace, Face);
988 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
989 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
990 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
991 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
992 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
993 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
994 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
995 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1000 if (fabs(areaV.x) < 1E-6) {
1004 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1005 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1006 areaV.x = OCP_SIGN(areaV.x) * areaP;
1009 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1, flagForward);
1014 if ((flagp0 > 0) || (flagp3 > 0)) upNNC =
true;
1020 if (k + iznnc > nz - 1)
break;
1022 const Hexahedron& leftblock = cornerPoints[i - 1][j][k + iznnc];
1023 oindex = (k + iznnc) * nxny + j * nx + i - 1;
1024 oFace.p0 = leftblock.p1;
1025 oFace.p1 = leftblock.p5;
1026 oFace.p2 = leftblock.p6;
1027 oFace.p3 = leftblock.p2;
1029 SetAllFlags(oFace, Face);
1040 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1041 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1042 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1043 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1044 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1045 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1046 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1047 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1052 if (fabs(areaV.x) < 1E-6) {
1056 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1057 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1058 areaV.x = OCP_SIGN(areaV.x) * areaP;
1061 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1, flagForward);
1066 if ((flagp1 < 0) || (flagp2 < 0)) downNNC =
true;
1067 else downNNC =
false;
1079 Pc2f = Pface - Pcenter;
1080 dxpoint = Pc2f - dxpoint;
1087 const Hexahedron& rightblock = cornerPoints[i + 1][j][k];
1088 oindex = k * nxny + j * nx + i + 1;
1090 oFace.p0 = rightblock.p3;
1091 oFace.p1 = rightblock.p7;
1092 oFace.p2 = rightblock.p4;
1093 oFace.p3 = rightblock.p0;
1095 SetAllFlags(oFace, Face);
1106 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1107 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1108 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1109 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1110 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1111 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1112 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1113 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1118 if (fabs(areaV.x) < 1E-6) {
1122 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1123 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1124 areaV.x = OCP_SIGN(areaV.x) * areaP;
1127 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1, flagForward);
1132 if ((flagp0 > 0) || (flagp3 > 0)) upNNC =
true;
1134 if ((flagp1 < 0) || (flagp2 < 0)) downNNC =
true;
1135 else downNNC =
false;
1139 if (-iznnc > k)
break;
1141 const Hexahedron& rightblock = cornerPoints[i + 1][j][k + iznnc];
1142 oindex = (k + iznnc) * nxny + j * nx + i + 1;
1143 oFace.p0 = rightblock.p3;
1144 oFace.p1 = rightblock.p7;
1145 oFace.p2 = rightblock.p4;
1146 oFace.p3 = rightblock.p0;
1148 SetAllFlags(oFace, Face);
1159 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1160 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1161 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1162 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1163 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1164 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1165 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1166 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1171 if (fabs(areaV.x) < 1E-6) {
1175 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1176 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1177 areaV.x = OCP_SIGN(areaV.x) * areaP;
1180 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1, flagForward);
1185 if ((flagp0 > 0) || (flagp3 > 0)) upNNC =
true;
1191 if (k + iznnc > nz - 1)
break;
1193 const Hexahedron& rightblock = cornerPoints[i + 1][j][k + iznnc];
1194 oindex = (k + iznnc) * nxny + j * nx + i + 1;
1195 oFace.p0 = rightblock.p3;
1196 oFace.p1 = rightblock.p7;
1197 oFace.p2 = rightblock.p4;
1198 oFace.p3 = rightblock.p0;
1200 SetAllFlags(oFace, Face);
1211 FaceP.p0 =
Point3D(Face.p3.y, Face.p3.z, 0);
1212 FaceP.p1 =
Point3D(Face.p0.y, Face.p0.z, 0);
1213 FaceP.p2 =
Point3D(Face.p1.y, Face.p1.z, 0);
1214 FaceP.p3 =
Point3D(Face.p2.y, Face.p2.z, 0);
1215 oFaceP.p0 =
Point3D(oFace.p3.y, oFace.p3.z, 0);
1216 oFaceP.p1 =
Point3D(oFace.p0.y, oFace.p0.z, 0);
1217 oFaceP.p2 =
Point3D(oFace.p1.y, oFace.p1.z, 0);
1218 oFaceP.p3 =
Point3D(oFace.p2.y, oFace.p2.z, 0);
1223 if (fabs(areaV.x) < 1E-6) {
1227 areaV.y = areaV.y / fabs(areaV.x) * areaP;
1228 areaV.z = areaV.z / fabs(areaV.x) * areaP;
1229 areaV.x = OCP_SIGN(areaV.x) * areaP;
1232 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 1, flagForward);
1237 if ((flagp1 < 0) || (flagp2 < 0)) downNNC =
true;
1238 else downNNC =
false;
1250 Pc2f = Pface - Pcenter;
1258 const Hexahedron& backblock = cornerPoints[i][j - 1][k];
1259 oindex = k * nxny + (j - 1) * nx + i;
1261 oFace.p0 = backblock.p2;
1262 oFace.p1 = backblock.p6;
1263 oFace.p2 = backblock.p7;
1264 oFace.p3 = backblock.p3;
1266 SetAllFlags(oFace, Face);
1277 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1278 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1279 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1280 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1281 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1282 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1283 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1284 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1289 if (fabs(areaV.y) < 1E-6) {
1293 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1294 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1295 areaV.y = OCP_SIGN(areaV.y) * areaP;
1298 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2, flagForward);
1303 if ((flagp0 > 0) || (flagp3 > 0)) upNNC =
true;
1305 if ((flagp1 < 0) || (flagp2 < 0)) downNNC =
true;
1306 else downNNC =
false;
1310 if (-iznnc > k)
break;
1312 const Hexahedron& backblock = cornerPoints[i][j - 1][k + iznnc];
1313 oindex = (k + iznnc) * nxny + (j - 1) * nx + i;
1314 oFace.p0 = backblock.p2;
1315 oFace.p1 = backblock.p6;
1316 oFace.p2 = backblock.p7;
1317 oFace.p3 = backblock.p3;
1319 SetAllFlags(oFace, Face);
1330 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1331 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1332 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1333 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1334 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1335 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1336 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1337 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1342 if (fabs(areaV.y) < 1E-6) {
1346 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1347 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1348 areaV.y = OCP_SIGN(areaV.y) * areaP;
1351 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2, flagForward);
1356 if ((flagp0 > 0) || (flagp3 > 0)) upNNC =
true;
1362 if (k + iznnc > nz - 1)
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);
1382 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1383 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1384 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1385 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1386 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1387 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1388 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1389 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1394 if (fabs(areaV.y) < 1E-6) {
1398 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1399 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1400 areaV.y = OCP_SIGN(areaV.y) * areaP;
1403 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2, flagForward);
1408 if ((flagp1 < 0) || (flagp2 < 0)) downNNC =
true;
1409 else downNNC =
false;
1421 Pc2f = Pface - Pcenter;
1422 dypoint = Pc2f - dypoint;
1429 const Hexahedron& frontblock = cornerPoints[i][j + 1][k];
1430 oindex = k * nxny + (j + 1) * nx + i;
1432 oFace.p0 = frontblock.p0;
1433 oFace.p1 = frontblock.p4;
1434 oFace.p2 = frontblock.p5;
1435 oFace.p3 = frontblock.p1;
1437 SetAllFlags(oFace, Face);
1448 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1449 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1450 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1451 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1452 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1453 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1454 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1455 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1460 if (fabs(areaV.y) < 1E-6) {
1464 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1465 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1466 areaV.y = OCP_SIGN(areaV.y) * areaP;
1469 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2, flagForward);
1474 if ((flagp0 > 0) || (flagp3 > 0)) upNNC =
true;
1476 if ((flagp1 < 0) || (flagp2 < 0)) downNNC =
true;
1477 else downNNC =
false;
1481 if (-iznnc > k)
break;
1483 const Hexahedron& frontblock = cornerPoints[i][j + 1][k + iznnc];
1484 oindex = (k + iznnc) * nxny + (j + 1) * nx + i;
1485 oFace.p0 = frontblock.p0;
1486 oFace.p1 = frontblock.p4;
1487 oFace.p2 = frontblock.p5;
1488 oFace.p3 = frontblock.p1;
1490 SetAllFlags(oFace, Face);
1501 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1502 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1503 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1504 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1505 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1506 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1507 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1508 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1513 if (fabs(areaV.y) < 1E-6) {
1517 areaV.x = areaV.x / fabs(areaV.y) * areaP;
1518 areaV.z = areaV.z / fabs(areaV.y) * areaP;
1519 areaV.y = OCP_SIGN(areaV.y) * areaP;
1522 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 2, flagForward);
1527 if ((flagp0 > 0) || (flagp3 > 0)) upNNC =
true;
1533 if (k + iznnc > nz - 1)
break;
1535 const Hexahedron& frontblock = cornerPoints[i][j + 1][k + iznnc];
1536 oindex = (k + iznnc) * nxny + (j + 1) * nx + i;
1537 oFace.p0 = frontblock.p0;
1538 oFace.p1 = frontblock.p4;
1539 oFace.p2 = frontblock.p5;
1540 oFace.p3 = frontblock.p1;
1542 SetAllFlags(oFace, Face);
1553 FaceP.p0 =
Point3D(Face.p0.x, Face.p0.z, 0);
1554 FaceP.p1 =
Point3D(Face.p3.x, Face.p3.z, 0);
1555 FaceP.p2 =
Point3D(Face.p2.x, Face.p2.z, 0);
1556 FaceP.p3 =
Point3D(Face.p1.x, Face.p1.z, 0);
1557 oFaceP.p0 =
Point3D(oFace.p0.x, oFace.p0.z, 0);
1558 oFaceP.p1 =
Point3D(oFace.p3.x, oFace.p3.z, 0);
1559 oFaceP.p2 =
Point3D(oFace.p2.x, oFace.p2.z, 0);
1560 oFaceP.p3 =
Point3D(oFace.p1.x, oFace.p1.z, 0);
1565 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, flagForward);
1579 if ((flagp1 < 0) || (flagp2 < 0)) downNNC =
true;
1580 else downNNC =
false;
1592 Pc2f = Pface - Pcenter;
1599 oindex = (k - 1) * nxny + j * nx + i;
1603 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 3, flagForward);
1615 Pc2f = Pface - Pcenter;
1616 dzpoint = Pc2f - dzpoint;
1623 oindex = (k + 1) * nxny + j * nx + i;
1627 blockconn[cindex].AddHalfConn(oindex, areaV, Pc2f, 3, flagForward);
1632 dx[cindex] = sqrt(dxpoint.x * dxpoint.x + dxpoint.y * dxpoint.y +
1633 dxpoint.z * dxpoint.z);
1634 dy[cindex] = sqrt(dypoint.x * dypoint.x + dypoint.y * dypoint.y +
1635 dypoint.z * dypoint.z);
1636 dz[cindex] = sqrt(dzpoint.x * dzpoint.x + dzpoint.y * dzpoint.y +
1637 dzpoint.z * dzpoint.z);
1639 OCP_ASSERT(!isfinite(dx[cindex]),
"Wrong dx!");
1640 OCP_ASSERT(!isfinite(dy[cindex]),
"Wrong dy!");
1641 OCP_ASSERT(!isfinite(dz[cindex]),
"Wrong dz!");
1647 OCP_ASSERT(num_conn % 2 == 0,
"Wrong Conn!");
1648 numConnMax = num_conn / 2;
1649 connect.resize(numConnMax);
1655 for (
OCP_USI n = 0; n < numGrid; n++) {
1656 for (
USI j = 0; j < blockconn[n].nConn; j++) {
1657 OCP_USI nn = blockconn[n].halfConn[j].neigh;
1658 if (nn < n)
continue;
1660 for (jj = 0; jj < blockconn[nn].nConn; jj++) {
1661 if (blockconn[nn].halfConn[jj].neigh == n) {
1665 if (jj == blockconn[nn].nConn) {
1668 if (blockconn[n].halfConn[j].Ad_dd <= 0 ||
1669 blockconn[nn].halfConn[jj].Ad_dd <= 0) {
1678 connect[iter_conn].begin = n;
1679 connect[iter_conn].Ad_dd_begin = blockconn[n].halfConn[j].Ad_dd;
1680 connect[iter_conn].end = nn;
1681 connect[iter_conn].Ad_dd_end = blockconn[nn].halfConn[jj].Ad_dd;
1682 connect[iter_conn].directionType = blockconn[n].halfConn[j].directionType;
1686 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.
#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
Substraction.
Point3D operator+(const Point3D &other) const
Addition.
Point3D & operator=(const Point3D &other)
equal
OCP_DBL operator*(const Point3D &other) const
Multiplication.