MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
geometry.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#include "geometry.h"
8#include "IO/context.h"
9#include "MEMORY/collector.h"
10#include "MEMORY/scratch.h"
11#include "UTIL/debug.h"
12#include "UTIL/functions.h"
13#include "geometryadt.h"
14#include "property.h"
15
16using namespace std;
17
18template <MInt nDim>
19Geometry<nDim>::Geometry(const MInt solverId_, const MPI_Comm comm)
20 : m_solverId(solverId_), m_mpiComm(comm), m_geometryContext(comm), m_haloElementOffset(0) {
21 // Determine domain id and number of domains
22 MPI_Comm_rank(mpiComm(), &m_domainId);
23 MPI_Comm_size(mpiComm(), &m_noDomains);
24
25
38 // TODO labels:GEOM,DOC
39 m_inOutTest = "perpOp";
40 m_inOutTest = Context::getSolverProperty<MString>("inOutTest", m_solverId, AT_, &m_inOutTest);
41
42 m_parallelGeometry = false;
55 m_parallelGeometry = Context::getSolverProperty<MBool>("parallelGeometry", m_solverId, AT_, &m_parallelGeometry);
56 if(m_noDomains == 1) m_parallelGeometry = 0;
58 m_debugParGeom = 0;
71 m_debugParGeom = Context::getSolverProperty<MBool>("debugParGeom", m_solverId, AT_, &m_debugParGeom);
72
73 // Store in if flow solver is enabled to differentiate the cases grid generator of flow solver for
74 // parallel geometry
75 m_flowSolver = false;
76 m_flowSolver = Context::getBasicProperty<MBool>("flowSolver", AT_, &m_flowSolver);
77}
78
79
83template <MInt nDim>
84void Geometry<nDim>::getBoundingBox(MFloat* const bBox) const {
85 for(MInt i = 0; i < nDim * 2; i++) {
86 bBox[i] = m_minMax[i];
87 }
88}
89
90
91template <MInt nDim>
93 for(MInt i = 0; i < nDim * 2; i++) {
94 bBox[i] = m_mbminMax[i];
95 }
96}
97
98template <MInt nDim>
100 m_adt->writeTreeToDx();
101}
102
113template <MInt nDim>
115 MBool ret = true;
116 for(MInt d = 0; d < nDim; d++)
117 ret = ret && approx(a[d], b[d], MFloatEps);
119 return ret;
120}
121
132template <MInt nDim>
134 MFloat circ = 0.0;
135 MFloat tmp_length = 0.0;
136 std::array<MFloat, nDim> edge;
137 for(MInt i = 0; i < num; i++) {
138 tmp_length = 0.0;
139 for(MInt j = 0; j < nDim; j++) {
140 edge[j] = bndVs[(i + 1) % num][j] - bndVs[i][j];
141 tmp_length += edge[j] * edge[j];
142 }
143 circ += sqrt(tmp_length);
144 }
145
146 return circ;
147}
148
157template <MInt nDim>
158MBool Geometry<nDim>::pointIsInside(const MFloat* const coordinates) {
159 std::array<MInt, nDim> numcutsperdir{};
160 return pointIsInside(coordinates, numcutsperdir.data());
161}
162
171template <MInt nDim>
172MBool Geometry<nDim>::pointIsInside(const MFloat* const coordinates, MInt* numcutsperdir) {
173 // TODO labels:GEOM,toenhance This function is not considering the distance from the next triangle.
174 // If coordinates is located exactly on the surface the result
175 // (inside/outside) is depended on its orientation.
176 // By using distance to next element and one single ray the state
177 // (inside/outside) should be defined better.
178 TRACE();
179
180 const MFloat* const box = boundingBox();
181 MBool isInside = true;
182 for(MInt dir = 0; dir < nDim; dir++) {
183 // cast ray between point in question and a point out side the domain
184 array<MFloat, 2 * nDim> ray;
185 for(MInt i = 0; i < nDim; i++) {
186 ray[i] = coordinates[i];
187 ray[i + nDim] = coordinates[i]; // point in question
188 }
189 ray[dir] = box[dir] - (ray[dir] - box[dir]); // outside point
190
191 // get list of intersecting geometry elements
192 std::vector<MInt> nodeList;
193 getLineIntersectionElements(&ray[0], nodeList);
194 numcutsperdir[dir] = nodeList.size();
195 isInside = isInside && (numcutsperdir[dir] % 2 == 0);
196 }
197 return isInside;
198}
199
200
211// TODO labels:GEOM,DLB optimize this further to speedup reinitialization during DLB!
212template <MInt nDim>
213MBool Geometry<nDim>::pointIsInside2(const MFloat* const coordinates, MInt* numcutsperdir) {
214 TRACE();
215 MInt noNodes = 0;
216 std::vector<MInt> nodeList;
217
218 const MBool onlyCheck = (numcutsperdir == nullptr);
219
220 MInt spaceDirectionId[3];
221 MFloat target[6];
222 const MFloat* tmp = boundingBox();
223
224 // 1. Take an arbitrary unmarked cell
225 // Cast rays in x,y and z direction and check for intersections
226 for(MInt j = 0; j < nDim; j++) {
227 target[j] = coordinates[j];
228 target[j + nDim] = coordinates[j];
229 }
230
231 target[0] = tmp[0] - (target[0] - tmp[0]); // x-ray to bounding box
232
233 if(m_inOutTest == "perpOp") {
234 getLineIntersectionElements(target, nodeList);
235 } else {
236 spaceDirectionId[0] = 1;
237 spaceDirectionId[1] = 2;
238 spaceDirectionId[2] = 0;
239 getLineIntersectionElementsOld2(target, spaceDirectionId, nodeList);
240 }
241 const MInt noNodesX = nodeList.size();
242
243 for(MInt j = 0; j < nDim; j++) {
244 target[j] = coordinates[j];
245 target[j + nDim] = coordinates[j];
246 }
247
248 target[1] = tmp[1] - (target[1] - tmp[1]); // y-ray to bounding box
249 nodeList.clear();
250 if(m_inOutTest == "perpOp") {
251 getLineIntersectionElements(target, nodeList);
252 } else {
253 spaceDirectionId[0] = 2;
254 spaceDirectionId[1] = 0;
255 spaceDirectionId[2] = 1;
256 getLineIntersectionElementsOld2(target, spaceDirectionId, nodeList);
257 }
258 const MInt noNodesY = nodeList.size();
259
260 // if modulo for x and y do not match return early if the number of cuts per direction is not needed
261 if(onlyCheck) {
262 if(noNodesX % 2 != noNodesY % 2) {
263 return false;
264 }
265 }
266
267 // only for 3D
268 MInt noNodesZ = 0;
269 IF_CONSTEXPR(nDim == 3) {
270 for(MInt j = 0; j < nDim; j++) {
271 target[j] = coordinates[j];
272 target[j + nDim] = coordinates[j];
273 }
274
275 target[2] = tmp[2] - (target[2] - tmp[2]); // z-ray to bounding box
276 // 2.b and c
277 nodeList.clear();
278 if(m_inOutTest == "perpOp") {
279 getLineIntersectionElements(target, nodeList);
280 } else {
281 spaceDirectionId[0] = 0;
282 spaceDirectionId[1] = 1;
283 spaceDirectionId[2] = 2;
284 getLineIntersectionElementsOld2(target, spaceDirectionId, nodeList);
285 }
286 noNodesZ = nodeList.size();
287
288 if(noNodesX % 2 == noNodesY % 2 && noNodesX % 2 == noNodesZ % 2) {
289 noNodes = noNodesX;
290 } else {
291 // cerr << " Different results for ray intersection, casting further rays. " << endl;
292 // if(noNodesX)
293 // noNodes = noNodesX;
294 // else if(noNodesY)
295 // noNodes = noNodesY;
296 // else
297 // noNodes = noNodesZ;
298 noNodes = 1;
299 }
300 }
301 else {
302 if(noNodesX % 2 == noNodesY % 2) {
303 noNodes = noNodesX;
304 } else {
305 // cerr << " Different results for ray intersection, casting further rays. " << endl;
306 noNodes = 1;
307 }
308 }
309
310 if(!onlyCheck) {
311 numcutsperdir[0] = noNodesX;
312 numcutsperdir[1] = noNodesY;
313 numcutsperdir[2] = noNodesZ;
314 }
315
316 if(noNodes % 2) {
317 return false;
318 } else {
319 return true;
320 }
321}
322
323// not very efficient - replace by some more sophisticated algorithm for multiple bodies
324// 2D-version! does not allow for overlapping mb-Elements!
325template <MInt nDim>
327 MInt* bodyBndryCndIds,
328 MInt* setToBodiesTable,
329 MInt noBodiesInSet) {
330 TRACE();
331
332 MInt noNodes;
333 MInt noNodesX_set = 0;
334 MInt noNodesY_set = 0;
335 MInt noNodesZ_set = 0;
336 MInt body;
337 MInt bcId;
338 std::vector<MInt> nodeList;
339
340 MFloat target[2 * nDim]{};
341 MFloat tmp[2 * nDim]{};
342 getBoundingBoxMB(&tmp[0]);
343
344 // 1. Take an arbitrary unmarked cell
345 // Cast rays in x,y and z direction and check for intersections
346 for(MInt j = 0; j < nDim; j++) {
347 target[j] = coordinates[j];
348 target[j + nDim] = coordinates[j];
349 }
350 target[0] = tmp[0] - (target[0] - tmp[0]); // x-ray to bounding box
351 getLineIntersectionMBElements(target, nodeList);
352 const MInt noNodesX = nodeList.size();
353 for(MInt node = 0; node < noNodesX; node++) {
354 for(MInt b = 0; b < noBodiesInSet; b++) {
355 body = setToBodiesTable[b];
356 bcId = bodyBndryCndIds[body];
357 if(mbelements[nodeList[node]].m_bndCndId == bcId) {
358 noNodesX_set++;
359 break;
360 }
361 }
362 }
363
364 for(MInt j = 0; j < nDim; j++) {
365 target[j] = coordinates[j];
366 target[j + nDim] = coordinates[j];
367 }
368 target[1] = tmp[1] - (target[1] - tmp[1]); // y-ray to bounding box
369 nodeList.clear();
370 getLineIntersectionMBElements(target, nodeList);
371 const MInt noNodesY = nodeList.size();
372 for(MInt node = 0; node < noNodesY; node++) {
373 for(MInt b = 0; b < noBodiesInSet; b++) {
374 body = setToBodiesTable[b];
375 bcId = bodyBndryCndIds[body];
376 if(mbelements[nodeList[node]].m_bndCndId == bcId) {
377 noNodesY_set++;
378 break;
379 }
380 }
381 }
382
383 // only for 3D
384 IF_CONSTEXPR(nDim == 3) {
385 for(MInt j = 0; j < nDim; j++) {
386 target[j] = coordinates[j];
387 target[j + nDim] = coordinates[j];
388 }
389
390 target[2] = tmp[2] - (target[2] - tmp[2]); // z-ray to bounding box
391 // 2.b and c
392 nodeList.clear();
393 getLineIntersectionMBElements(target, nodeList);
394 const MInt noNodesZ = nodeList.size();
395 for(MInt node = 0; node < noNodesZ; node++) {
396 for(MInt b = 0; b < noBodiesInSet; b++) {
397 body = setToBodiesTable[b];
398 bcId = bodyBndryCndIds[body];
399 if(mbelements[nodeList[node]].m_bndCndId == bcId) {
400 noNodesZ_set++;
401 break;
402 }
403 }
404 }
405
406 if(noNodesX_set % 2 == noNodesY_set % 2 && noNodesX_set % 2 == noNodesZ_set % 2) {
407 noNodes = noNodesX_set;
408 } else {
409 // cerr << " Different results for ray intersection, casting further rays. " << endl;
410 // if(noNodesX)
411 // noNodes = noNodesX;
412 // else if(noNodesY)
413 // noNodes = noNodesY;
414 // else
415 // noNodes = noNodesZ;
416 noNodes = 1;
417 }
418 }
419 else {
420 if(noNodesX_set % 2 == noNodesY_set % 2) {
421 noNodes = noNodesX_set;
422 } else {
423 // cerr << " Different results for ray intersection, casting further rays. " << endl;
424 noNodes = 1;
425 }
426 }
427
428 // delete [] tmp; tmp=nullptr;
429
430 if(noNodes % 2) {
431 // 3.
432 return true;
433 } else {
434 return false;
435 }
436}
437
438// not very efficient - replace by some more sophisticated algorithm for multiple bodies
439// only intended for 3D, getLineIntersectionMBElements2 has no 2D implementation!
440// allows for multiple overlapping geometries (however untested)
441template <MInt nDim>
443 MInt* bodyBndryCndIds,
444 MInt* setToBodiesTable,
445 MInt noBodiesInSet) {
446 TRACE();
447
448 MInt noNodes;
449 MInt noNodesX = 0;
450 MInt noNodesY = 0;
451 MInt noNodesZ = 0;
452 MInt noNodesX_set = 0;
453 MInt noNodesY_set = 0;
454 MInt noNodesZ_set = 0;
455 MInt body;
456 MInt bcId;
457 MBool debug = false;
458 const MInt maxNoNodesDebug = 1000;
459 MIntScratchSpace nodesXBackup(maxNoNodesDebug, AT_, "nodesXBackup");
460 MIntScratchSpace nodesYBackup(maxNoNodesDebug, AT_, "nodesYBackup");
461 MIntScratchSpace nodesZBackup(maxNoNodesDebug, AT_, "nodesZBackup");
462
463 MInt spaceDirectionId[3];
464 MFloat target[6];
465
466 MFloat tmp[6];
467 MFloat* tmpPtr = &tmp[0];
468 getBoundingBoxMB(tmpPtr);
469
470 // 1. Take an arbitrary unmarked cell
471 // Cast rays in x,y and z direction and check for intersections
472 for(MInt j = 0; j < nDim; j++) {
473 target[j] = coordinates[j];
474 target[j + nDim] = coordinates[j];
475 }
476 spaceDirectionId[0] = 1;
477 spaceDirectionId[1] = 2;
478 spaceDirectionId[2] = 0;
479
480
481 target[0] = tmp[0] - (target[0] - tmp[0]); // x-ray to bounding box
482 MInt count = 0;
483 for(MInt b = 0; b < noBodiesInSet; b++) {
484 body = setToBodiesTable[b];
485 bcId = bodyBndryCndIds[body];
486 std::vector<MInt> nodeList;
487 getLineIntersectionMBElements2(target, spaceDirectionId, nodeList, bcId);
488 noNodesX = nodeList.size();
489 noNodesX_set += noNodesX;
490 if(debug) {
491 if(noNodesX > maxNoNodesDebug)
492 mTerm(1, AT_, " too many intersecting nodes to debug... please check or increase maxNoNodesDebug! ");
493 for(MInt n = 0; n < noNodesX; n++) {
494 nodesXBackup[count] = nodeList[n];
495 count++;
496 }
497 }
498 }
499
500 for(MInt j = 0; j < nDim; j++) {
501 target[j] = coordinates[j];
502 target[j + nDim] = coordinates[j];
503 }
504 spaceDirectionId[0] = 2;
505 spaceDirectionId[1] = 0;
506 spaceDirectionId[2] = 1;
507
508 target[1] = tmp[1] - (target[1] - tmp[1]); // y-ray to bounding box
509 count = 0;
510 for(MInt b = 0; b < noBodiesInSet; b++) {
511 body = setToBodiesTable[b];
512 bcId = bodyBndryCndIds[body];
513 std::vector<MInt> nodeList;
514 getLineIntersectionMBElements2(target, spaceDirectionId, nodeList, bcId);
515 noNodesY = nodeList.size();
516 noNodesY_set += noNodesY;
517 if(debug) {
518 if(noNodesY > maxNoNodesDebug)
519 mTerm(1, AT_, " too many intersecting nodes to debug... please check or increase maxNoNodesDebug! ");
520 for(MInt n = 0; n < noNodesY; n++) {
521 nodesYBackup[count] = nodeList[n];
522 count++;
523 }
524 }
525 }
526
527 // only for 3D
528 IF_CONSTEXPR(nDim == 3) {
529 for(MInt j = 0; j < nDim; j++) {
530 target[j] = coordinates[j];
531 target[j + nDim] = coordinates[j];
532 }
533 spaceDirectionId[0] = 0;
534 spaceDirectionId[1] = 1;
535 spaceDirectionId[2] = 2;
536
537
538 target[2] = tmp[2] - (target[2] - tmp[2]); // z-ray to bounding box
539 count = 0;
540 // 2.b and c
541 for(MInt b = 0; b < noBodiesInSet; b++) {
542 body = setToBodiesTable[b];
543 bcId = bodyBndryCndIds[body];
544 std::vector<MInt> nodeList;
545 getLineIntersectionMBElements2(target, spaceDirectionId, nodeList, bcId);
546 noNodesZ = nodeList.size();
547 noNodesZ_set += noNodesZ;
548 if(debug) {
549 if(noNodesZ > maxNoNodesDebug)
550 mTerm(1, AT_, " too many intersecting nodes to debug... please check or increase maxNoNodesDebug! ");
551 for(MInt n = 0; n < noNodesZ; n++) {
552 nodesZBackup[count] = nodeList[n];
553 count++;
554 }
555 }
556 }
557
558 if(noNodesX_set % 2 == noNodesY_set % 2 && noNodesX_set % 2 == noNodesZ_set % 2) {
559 noNodes = noNodesX_set;
560 } else {
561 cerr << " Different results for ray intersection, continue with most probable result. Please check your "
562 "geometry! "
563 << endl;
564 cerr << " nodesX: " << noNodesX << " " << noNodesX_set << " nodesY: " << noNodesY << " " << noNodesY_set
565 << " nodesZ: " << noNodesZ << " " << noNodesZ_set << endl;
566 cerr << " write stl of all intersecting nodes, point is " << coordinates[0] << " " << coordinates[1];
567 IF_CONSTEXPR(nDim == 3) cerr << " " << coordinates[2];
568 cerr << endl;
569 cerr << " bounding box is " << tmp[0] << " " << tmp[1] << " " << tmp[2] << " " << tmp[3] << " " << tmp[4] << " "
570 << tmp[5] << endl;
571 for(MInt j = 0; j < nDim; j++) {
572 target[j] = coordinates[j];
573 target[j + nDim] = coordinates[j];
574 }
575
576 ofstream ofl;
577 stringstream filename;
578 filename << "IntersectingNodes_D" << domainId() << ".stl";
579 ofl.open((filename.str()).c_str());
580 ofl.precision(12);
581
582 if(ofl) {
583 if(noNodesX_set) {
584 ofl << "solid intersecting triangles X " << domainId() << endl;
585
586 for(MInt i = 0; i < noNodesX_set; i++) {
587 ofl << " facet normal";
588 for(MInt j = 0; j < 3; j++)
589 ofl << " " << mbelements[nodesXBackup[i]].m_normal[j];
590 ofl << endl << " outer loop" << endl;
591
592 for(MInt k = 0; k < 3; k++) {
593 ofl << " vertex";
594 for(MInt l = 0; l < 3; l++) {
595 ofl << " " << mbelements[nodesXBackup[i]].m_vertices[k][l];
596 }
597 ofl << endl;
598 }
599
600 ofl << " endloop" << endl << " endfacet" << endl;
601 }
602 ofl << "endsolid intersecting triangles X " << domainId() << endl;
603 }
604 if(noNodesY_set) {
605 ofl << "solid intersecting triangles Y " << domainId() << endl;
606
607 for(MInt i = 0; i < noNodesY_set; i++) {
608 ofl << " facet normal";
609 for(MInt j = 0; j < 3; j++)
610 ofl << " " << mbelements[nodesYBackup[i]].m_normal[j];
611 ofl << endl << " outer loop" << endl;
612
613 for(MInt k = 0; k < 3; k++) {
614 ofl << " vertex";
615 for(MInt l = 0; l < 3; l++) {
616 ofl << " " << mbelements[nodesYBackup[i]].m_vertices[k][l];
617 }
618 ofl << endl;
619 }
620
621 ofl << " endloop" << endl << " endfacet" << endl;
622 }
623 ofl << "endsolid intersecting triangles Y " << domainId() << endl;
624 }
625 if(noNodesZ_set) {
626 ofl << "solid intersecting triangles Z " << domainId() << endl;
627
628 for(MInt i = 0; i < noNodesZ_set; i++) {
629 ofl << " facet normal";
630 for(MInt j = 0; j < 3; j++)
631 ofl << " " << mbelements[nodesZBackup[i]].m_normal[j];
632 ofl << endl << " outer loop" << endl;
633
634 for(MInt k = 0; k < 3; k++) {
635 ofl << " vertex";
636 for(MInt l = 0; l < 3; l++) {
637 ofl << " " << mbelements[nodesZBackup[i]].m_vertices[k][l];
638 }
639 ofl << endl;
640 }
641
642 ofl << " endloop" << endl << " endfacet" << endl;
643 }
644 ofl << "endsolid intersecting triangles Z " << domainId() << endl;
645 }
646 }
647
648
649 if(noNodesX % 2 == noNodesY % 2)
650 noNodes = noNodesX;
651 else if(noNodesX % 2 == noNodesZ % 2)
652 noNodes = noNodesX;
653 else if(noNodesY % 2 == noNodesZ % 2)
654 noNodes = noNodesY;
655 else
656 noNodes = 1;
657 }
658 }
659 else {
660 if(noNodesX_set % 2 == noNodesY_set % 2) {
661 noNodes = noNodesX_set;
662 } else {
663 cerr << " Different results for ray intersection, continue with most probable result. Please check your "
664 "geometry! "
665 << endl;
666 noNodes = 1;
667 }
668 }
669
670 // delete [] tmp; tmp=nullptr;
671
672 if(noNodes % 2) {
673 return true;
674 } else {
675 return false;
676 }
677}
678
679
695template <MInt nDim>
697 vector<vector<MInt>>* resultnodes) {
698 TRACE();
699
700 std::vector<MInt> nodeList;
701 const MFloat* bb = boundingBox();
702
703 // 1. create the orginal target from the coordinates
704 std::array<MFloat, nDim * 2> target;
705 for(MInt j = 0; j < nDim; j++) {
706 target[j] = coordinates[j];
707 target[j + nDim] = coordinates[j];
708 }
709
710 // 2. do the check for all directions
711 for(MInt dim = 0; dim < nDim; dim++) {
712 // 2.1 create a ray from current target to bounding box in direction dim
713 std::array<MFloat, nDim * 2> raybb;
714 for(MInt j = 0; j < 2 * nDim; j++)
715 raybb[j] = target[j];
716 raybb[dim] = bb[dim] - (target[dim] - bb[dim]);
717
718 // 2.2 get the intersecting elements
719 getLineIntersectionElements(raybb.data(), nodeList);
720
721 // 2.3 create the resulting nodes vector
722 vector<MInt> v;
723 for(MInt i = 0; i < (signed)nodeList.size(); i++)
724 v.push_back(nodeList[i]);
725
726 resultnodes->push_back(v);
727 }
728}
729
730
732template <MInt nDim>
733void Geometry<nDim>::getLineIntersectingElementsBcIds(const MFloat* const line, std::set<MInt>& bcIds) {
734 std::vector<MInt> nodeList;
735 MFloat tmp_line[2 * nDim];
736 std::copy_n(line, 2 * nDim, tmp_line);
737
738 getLineIntersectionElements(tmp_line, nodeList);
739
740 bcIds.clear();
741 for(MInt i = 0; i < (signed)nodeList.size(); i++) {
742 const MInt bndCndId = elements[nodeList[i]].m_bndCndId;
743 bcIds.insert(bndCndId);
744 }
745}
746
747template <MInt nDim>
748MBool Geometry<nDim>::isOnGeometry(const MFloat cellHalfLength, const MFloat* coordinates, MString gridCutTest) {
749 MFloat target[2 * nDim] = {0.0};
750 std::vector<MInt> nodeList;
751
752 for(MInt dim = 0; dim < nDim; dim++) {
753 target[dim] = coordinates[dim] - cellHalfLength;
754 target[dim + nDim] = coordinates[dim] + cellHalfLength;
755 }
756
757 if(gridCutTest == "SAT") {
758 this->getIntersectionElements(target, nodeList, cellHalfLength, coordinates);
759 } else {
760 this->getIntersectionElements(target, nodeList);
761 }
762
763 return nodeList.size() > 0;
764}
765
766// Explicit instantiations for 2D and 3D
767template class Geometry<2>;
768template class Geometry<3>;
MBool isOnGeometry(const MFloat, const MFloat *, MString)
Definition: geometry.cpp:748
void getBoundingBox(MFloat *const bBox) const
Returns the bounding box for the geometry.
Definition: geometry.cpp:84
MFloat calcCircumference(MFloat **bndVs, MInt num)
Returns the circumference of a segment.
Definition: geometry.cpp:133
MBool pointIsInsideMBElements2(const MFloat *const coordinates, MInt *, MInt *, MInt)
Definition: geometry.cpp:442
MBool pointIsInsideMBElements(const MFloat *const coordinates, MInt *, MInt *, MInt)
Definition: geometry.cpp:326
void getLineIntersectingElementsBcIds(const MFloat *const line, std::set< MInt > &bcIds)
Return the set of boundary condition ids of the elements cut by the given line.
Definition: geometry.cpp:733
virtual void writeSegmentsToDX()
Definition: geometry.cpp:99
MBool pointIsInside2(const MFloat *const coordinates, MInt *numcutsperdir=nullptr)
Determines if a point is in or outside the geometry.
Definition: geometry.cpp:213
void getBoundingBoxMB(MFloat *const bBox) const
Definition: geometry.cpp:92
Geometry(const MInt solverId_, const MPI_Comm comm)
void determineRayIntersectedElements(const MFloat *const coordinates, std::vector< std::vector< MInt > > *resultnodes)
returns the geometry elements that have a cut with rays originating in the provided coordinates
Definition: geometry.cpp:696
MBool vectorsEqual(MFloat *a, MFloat *b)
Compares two vectors entry by entry.
Definition: geometry.cpp:114
MBool pointIsInside(const MFloat *const coordinates)
Determines if a point is inside of the geometry.
Definition: geometry.cpp:158
This class is a ScratchSpace.
Definition: scratch.h:758
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29
MBool approx(const T &, const U &, const T)
Definition: functions.h:272
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58
Definition: contexttypes.h:19