7#ifndef GEOMETRYINTERSECTION_H
8#define GEOMETRYINTERSECTION_H
36template <
typename T, std::
size_t n>
44template <
typename T, std::
size_t n, std::
size_t m>
45constexpr std::array<std::array<T, m>, n>
make_array(
const T v) {
46 std::array<std::array<T, m>, n>
a{};
47 for(std::size_t i = 0; i < n; i++) {
48 for(std::size_t j = 0; j < m; j++) {
72 const MInt gridCellId =
grid().tree().solver2grid(cellId);
73 return grid().raw().a_coordinate(gridCellId, dir);
82 return grid().cellLengthAtCell(cellId);
90 return grid().gridCellVolume(
grid().tree().level(cellId));
157 std::vector<MInt>& candidatesOrder);
159 const MInt* bodyIdField,
const MBool*
const gapPropertyField,
const MBool gapClosure);
174 if(
grid().domainId() == 0) {
175 std::cerr <<
"Tested cases: " << std::endl;
176 for(
MInt i = 0; i < 256; i++) {
216 c[0] =
a[1] *
b[2] -
a[2] *
b[1];
217 c[1] =
a[2] *
b[0] -
a[0] *
b[2];
218 c[2] =
a[0] *
b[1] -
a[1] *
b[0];
299 typedef typename std::conditional<nDim_ == 3, polyEdge3D, polyEdge2D>::type
polyEdge;
303 std::vector<std::pair<MInt, MInt>>
edges;
330 std::list<std::pair<MInt, MInt>>
edges;
355 typedef typename std::conditional<nDim_ == 3, polyCutCell3D, polyCutCell2D>::type
polyCutCell;
372 void addPoint(
const std::vector<polyVertex>*,
const MInt*,
const MInt, std::array<MFloat, nDim>);
374 const std::vector<polyVertex>*);
386 template <
class T =
void>
387 inline typename std::enable_if<nDim_ == 2, T>::type
388 computeNormal(
const std::array<MFloat, nDim> p0,
const std::array<MFloat, nDim> p1, std::array<MFloat, nDim> res,
390 const MFloat dx = p1[0] - p0[0], dy = p1[1] - p0[1];
393 const MFloat abs = sqrt(res[0] * res[0] + res[1] * res[1]);
396 w = -res[0] * p0[0] - res[1] * p0[1];
399 template <
class T = MFloat>
400 inline typename std::enable_if<nDim_ == 3, T>::type
401 computeNormal(
const std::array<MFloat, nDim> p0,
const std::array<MFloat, nDim> p1,
const std::array<MFloat, nDim> p2,
402 std::array<MFloat, nDim>& res,
MFloat& w) {
403 const MFloat a0 = p1[0] - p0[0], a1 = p1[1] - p0[1], a2 = p1[2] - p0[2], b0 = p2[0] - p0[0], b1 = p2[1] - p0[1],
405 res[0] = a1 * b2 - a2 * b1;
406 res[1] = a2 * b0 - a0 * b2;
407 res[2] = a0 * b1 - a1 * b0;
408 const MFloat abs = sqrt(res[0] * res[0] + res[1] * res[1] + res[2] * res[2]);
412 w = -res[0] * p0[0] - res[1] * p0[1] - res[2] * p0[2];
421 std::array<MFloat, nDim>
xx = make_array<MFloat, nDim>(0.0);
437 tmp.
xx[i] = this->xx[i] +
a.xx[i];
443 tmp.
xx[i] = this->xx[i] -
a.xx[i];
449 tmp.
xx[i] = this->xx[i] *
a;
455 tmp.
xx[i] = this->xx[i] /
a;
461 dotp += this->xx[i] *
a.xx[i];
467 template <
class T = CsgVector>
468 typename std::enable_if<nDim_ == 3, T>::type
470 ASSERT(
nDim == 3,
"");
472 tmp.
xx[0] = this->xx[1] *
a.xx[2] - this->xx[2] *
a.xx[1];
473 tmp.
xx[1] = this->xx[2] *
a.xx[0] - this->xx[0] *
a.xx[2];
474 tmp.
xx[2] = this->xx[0] *
a.xx[1] - this->xx[1] *
a.xx[0];
479 this->xx[i] = -this->xx[i];
504 static constexpr MFloat eps = (
nDim == 3) ? 10000 * MFloatEps : 1000 * MFloatEps;
511 template <
class T = CsgVector>
512 typename std::enable_if<nDim_ == 2, T>::type
517 template <
class T = CsgVector>
518 typename std::enable_if<nDim_ == 3, T>::type
526 else IF_CONSTEXPR(
nDim == 2) {
541 template <
class T =
void>
542 typename std::enable_if<nDim_ == 2, T>::type
544 std::vector<CsgPolygon>* coplanarFront,
545 std::vector<CsgPolygon>* coplanarBack,
546 std::vector<CsgPolygon>* front,
547 std::vector<CsgPolygon>* back) {
548 const MInt COPLANAR = 0;
549 const MInt FRONT = 1;
551 const MInt SPANNING = 3;
553 MInt polygonType = 0;
554 std::vector<MInt> types;
556 for(
MInt i = 0; (unsigned)i < polygon->vertices.size(); i++) {
558 MInt type = (t < -
eps) ? BACK : (t >
eps) ? FRONT : COPLANAR;
560 types.push_back(type);
563 switch(polygonType) {
565 (this->
normal.
dot((polygon->
plane.
normal)) > F0 ? coplanarFront : coplanarBack)->push_back(*polygon);
568 front->push_back(*polygon);
571 back->push_back(*polygon);
574 std::vector<CsgVertex> f;
575 std::vector<CsgVertex>
b;
578 MInt ti = types[i], tj = types[j];
581 if(ti != BACK) f.push_back(vi);
582 if(ti != FRONT)
b.push_back(ti != BACK ? vi.
clone() : vi);
583 if((ti | tj) == SPANNING) {
589 if(tj != BACK) f.push_back(vj);
590 if(tj != FRONT)
b.push_back(tj != BACK ? vj.
clone() : vj);
602 template <
class T =
void>
603 typename std::enable_if<nDim_ == 3, T>::type
605 std::vector<CsgPolygon>* coplanarFront,
606 std::vector<CsgPolygon>* coplanarBack,
607 std::vector<CsgPolygon>* front,
608 std::vector<CsgPolygon>* back) {
609 const MInt COPLANAR = 0;
610 const MInt FRONT = 1;
612 const MInt SPANNING = 3;
614 MInt polygonType = 0;
615 std::vector<MInt> types;
618 MBool normalsEqual =
false;
620 && std::abs(std::abs(this->normal.xx[1]) - std::abs(polygon->
plane.
normal.
xx[1])) < MFloatEps
621 && std::abs(std::abs(this->normal.xx[2]) - std::abs(polygon->
plane.
normal.
xx[2])) < MFloatEps)
624 MBool coplanarVertex =
false;
625 for(
MInt i = 0; (unsigned)i < polygon->vertices.size(); i++) {
627 MInt type = (t < -
eps) ? BACK : (t >
eps) ? FRONT : COPLANAR;
629 types.push_back(type);
630 if(type == 0) coplanarVertex =
true;
634 if(normalsEqual && coplanarVertex) polygonType = COPLANAR;
636 switch(polygonType) {
638 (this->
normal.
dot((polygon->
plane.
normal)) > F0 ? coplanarFront : coplanarBack)->push_back(*polygon);
641 front->push_back(*polygon);
644 back->push_back(*polygon);
647 std::vector<CsgVertex> f;
648 std::vector<CsgVertex>
b;
649 for(
MInt i = 0; (unsigned)i < polygon->vertices.size(); i++) {
651 MInt ti = types[i], tj = types[j];
654 if(ti != BACK) f.push_back(vi);
655 if(ti != FRONT)
b.push_back(ti != BACK ? vi.
clone() : vi);
656 if((ti | tj) == SPANNING) {
676 std::vector<CsgPolygon>* coplanarFront,
677 std::vector<CsgPolygon>* coplanarBack) {
679 (this->
normal.
dot((polygon->
plane.
normal)) > F0 ? coplanarFront : coplanarBack)->push_back(*polygon);
694 for(
MInt i = 0; (unsigned)i < _vertices.size(); i++) {
710 for(
MInt i = 0; (unsigned)i < _vertices.size(); i++) {
729 std::vector<CsgVertex> tmp;
731 tmp.push_back((*rit));
748 explicit CsgNode(std::vector<CsgPolygon> _polygons) {
753 this->
build(_polygons);
764 this->polygons.clear();
770 for(
MInt i = 0; (unsigned)i < this->
polygons.size(); i++) {
771 this->polygons[i].flip();
774 if(this->front) this->front->
invert();
775 if(this->back) this->back->
invert();
777 this->front = this->
back;
781 std::vector<CsgPolygon>
clipPolygons(std::vector<CsgPolygon> _polygons) {
785 std::vector<CsgPolygon> _front;
786 std::vector<CsgPolygon> _back;
787 for(
MInt i = 0; (unsigned)i < _polygons.size(); i++) {
788 this->plane.
splitPolygon(&_polygons[i], &_front, &_back, &_front, &_back);
790 if(this->front) _front = this->front->
clipPolygons(_front);
795 for(
MInt i = 0; (unsigned)i < _back.size(); i++)
796 _front.push_back(_back[i]);
802 if(this->front) this->front->
clipTo(bsp);
803 if(this->back) this->back->
clipTo(bsp);
807 std::vector<CsgPolygon> _polygons(this->polygons);
809 std::vector<CsgPolygon> _polygons_front = this->front->
allPolygons();
810 for(
MInt i = 0; (unsigned)i < _polygons_front.size(); i++)
811 _polygons.push_back(_polygons_front[i]);
814 std::vector<CsgPolygon> _polygons_back = this->back->
allPolygons();
815 for(
MInt i = 0; (unsigned)i < _polygons_back.size(); i++)
816 _polygons.push_back(_polygons_back[i]);
823 template <
class T =
void>
824 typename std::enable_if<nDim_ == 2, T>::type
build(std::vector<CsgPolygon> _polygons) {
825 if(_polygons.empty())
return;
827 this->plane = _polygons[0].plane.
clone();
830 std::vector<CsgPolygon> _front;
831 std::vector<CsgPolygon> _back;
833 for(
MInt i = 1; (unsigned)i < _polygons.size(); i++) {
834 this->plane.
splitPolygon(&_polygons[i], &this->polygons, &this->polygons, &_front, &_back);
836 if(!_front.empty()) {
837 if(!this->front) this->front =
new CsgNode();
838 this->front->
build(_front);
841 if(!this->back) this->back =
new CsgNode();
842 this->back->
build(_back);
845 template <
class T =
void>
846 typename std::enable_if<nDim_ == 3, T>::type
build(std::vector<CsgPolygon> _polygons) {
847 if(_polygons.empty())
return;
848 std::vector<CsgPolygon> _front;
849 std::vector<CsgPolygon> _back;
850 MInt polygonStartIndex = 0;
852 this->plane = _polygons[0].plane.
clone();
854 this->polygons.push_back(_polygons[0]);
855 polygonStartIndex = 1;
857 for(
MInt i = polygonStartIndex; (unsigned)i < _polygons.size(); i++) {
858 this->plane.
splitPolygon(&_polygons[i], &this->polygons, &this->polygons, &_front, &_back);
860 if(!_front.empty()) {
861 if(!this->front) this->front =
new CsgNode();
862 this->front->
build(_front);
865 if(!this->back) this->back =
new CsgNode();
866 this->back->
build(_back);
877 explicit Csg(std::vector<CsgPolygon> _polygons) {
878 for(
MInt i = 0; (unsigned)i < _polygons.size(); i++) {
879 polygons.push_back(_polygons[i].clone());
886 std::vector<CsgPolygon> _polygons(this->polygons);
900 a.build(
b.allPolygons());
902 return a.allPolygons();
924 for(
MInt i = 0; (unsigned)i < this->
polygons.size(); i++)
925 this->polygons[i].flip();
954 std::array<MInt, maxNoJumps>
dirs = make_array<MInt, maxNoJumps>(-1);
955 std::array<MInt, maxNoJumps>
diagonalDirs = make_array<MInt, maxNoJumps>(-1);
960 std::array<MInt, maxNoJumps>
neighborType = make_array<MInt, maxNoJumps>(-1);
990 std::array<MFloat, nDim>
b = make_array<MFloat, nDim>(0.0);
994 std::array<MInt, maxNoCutPoints>
cutBodyIds = make_array<MInt, maxNoCutPoints>(-1);
995 std::array<MInt, maxNoCutPoints>
cutEdges = make_array<MInt, maxNoCutPoints>(-1);
998 std::array<std::array<MBool, no3dFaces>,
maxNoSets>
a;
999 std::array<MBool, no3dFaces>
b = make_array<MBool, no3dFaces>(0.0);
1004 std::array<std::array<MBool, noCorners>,
maxNoSets>
a;
1005 std::array<MBool, noCorners>
b = make_array<MBool, noCorners>(
false);
1017 std::array<MInt, maxSplitCells>
splitChildIds = make_array<MInt, maxSplitCells>(-1);
1022 std::array<MFloat, nDim>
b = make_array<MFloat, nDim>(0.0);
1026 std::array<MFloat, maxNoCartesianSurfaces>
cartFaceArea = make_array<MFloat, maxNoCartesianSurfaces>(0.0);
1027 std::array<MInt, maxNoCartesianSurfaces>
cartFaceDir = make_array<MInt, maxNoCartesianSurfaces>(-1);
1032 std::array<MFloat, nDim>
b = make_array<MFloat, nDim>(0.0);
1038 std::array<MFloat, nDim>
b = make_array<MFloat, nDim>(0.0);
1042 std::array<MFloat, maxNoBoundarySurfaces>
boundarySurfaceArea = make_array<MFloat, maxNoBoundarySurfaces>(0.0);
1047 std::array<MInt, maxNoTotalSurfaces>
allFacesBodyId = make_array<MInt, maxNoTotalSurfaces>(-1);
1049 make_array<MInt, maxNoTotalSurfaces>(0);
1052 std::array<MInt, maxNoFaceVertices>
b = make_array<MInt, maxNoFaceVertices>(-1);
1061 std::array<MFloat, nDim>
b = make_array<MFloat, nDim>(0.0);
1085 std::array<std::array<MFloat, noCorners>,
maxNoSets>
a{};
1086 std::array<MFloat, noCorners>
b = make_array<MFloat, noCorners>(-1.0);
1091 std::array<MBool, noCorners>
nodeValueSet = make_array<MBool, noCorners>(
false);
1098 std::array<MFloat, nDim>
b = make_array<MFloat, nDim>(0.0);
1103 std::array<MInt, maxNoCutPoints>
cutBodyIds = make_array<MInt, maxNoCutPoints>(-1);
1104 std::array<MInt, maxNoCutPoints>
cutEdges = make_array<MInt, maxNoCutPoints>(-1);
1105 std::array<MBool, noEdges>
edgeChecked = make_array<MBool, noEdges>(
false);
void mAlloc(T *&a, const MLong N, const MString &objectName, MString function)
allocates memory for one-dimensional array 'a' of size N
static constexpr MInt maxNoCutPoints
static constexpr MInt noCorners
std::array< MInt, maxNoSets > associatedBodyIds
static constexpr MInt maxNoSets
std::array< MInt, noEdges > noCutPointsOnEdge
std::array< MBool, noCorners > nodeValueSet
std::array< MBool, noEdges > edgeChecked
std::array< std::array< MFloat, noCorners >, maxNoSets > nodalValues
static constexpr MInt noEdges
std::array< std::array< MFloat, nDim >, maxNoCutPoints > cutPoints
std::array< MInt, maxNoCutPoints > cutEdges
MBool isbndryLvlJumpParent
std::array< MInt, maxNoCutPoints > cutBodyIds
std::array< MInt, maxNoCutPoints > cutBodyIds
std::array< std::array< MFloat, nDim >, maxNoAdditionalVertices > additionalVertices
std::array< MInt, maxSplitCells > splitChildIds
static constexpr MInt maxNoTotalSurfaces
std::array< MFloat, maxNoCartesianSurfaces > cartFaceArea
std::array< std::array< MBool, no3dFaces >, maxNoSets > faceCentroidIsInsideGeometry
static constexpr MInt maxNoBoundarySurfaces
std::array< std::array< MInt, maxNoFaceVertices >, maxNoTotalSurfaces > allFacesPointIds
std::array< MInt, noFaces > noFacesPerCartesianDir
std::array< MInt, maxNoTotalSurfaces > allFacesNoPoints
static constexpr MInt noFaces
std::array< MInt, maxNoCutPoints > cutEdges
std::array< MInt, maxNoBoundarySurfaces > boundarySurfaceBodyId
std::array< MFloat, nDim > volumetricCentroid
std::array< MBool, noFaces > externalFaces
std::array< MInt, maxNoBoundarySurfaces > boundarySurfaceBndryCndId
static constexpr MInt maxNoSets
static constexpr MInt noCorners
std::array< std::array< MFloat, nDim >, maxNoBoundarySurfaces > boundarySurfaceCentroid
static constexpr MInt maxNoAdditionalVertices
std::array< std::array< MFloat, nDim >, maxNoBoundarySurfaces > boundarySurfaceNormal
static constexpr MInt maxNoFaceVertices
std::array< std::array< MFloat, nDim >, maxNoCartesianSurfaces > cartFaceCentroid
std::array< MInt, maxNoCartesianSurfaces > cartFaceDir
static constexpr MInt no3dFaces
MInt noAdditionalVertices
static constexpr MInt maxSplitCells
static constexpr MInt maxNoCartesianSurfaces
std::array< MFloat, maxNoBoundarySurfaces > boundarySurfaceArea
std::array< std::array< MBool, noCorners >, maxNoSets > cornerIsInsideGeometry
static constexpr MInt noEdges
static constexpr MInt maxNoCutPoints
std::array< MInt, maxNoSets > associatedBodyIds
std::array< MInt, maxNoTotalSurfaces > allFacesBodyId
std::array< std::array< MFloat, nDim >, maxNoCutPoints > cutPoints
MBool propertyExists(MString name, MInt solver)
GeometryProperty * getProperty(const MString &name, MInt segment)
GeometryContext & geometryContext()
std::vector< CsgPolygon > intersect(Csg csg)
std::vector< CsgPolygon > toPolygons()
Csg(std::vector< CsgPolygon > _polygons)
std::vector< CsgPolygon > polygons
void clipTo(CsgNode &bsp)
std::enable_if< nDim_==2, T >::type build(std::vector< CsgPolygon > _polygons)
std::vector< CsgPolygon > allPolygons()
std::vector< CsgPolygon > polygons
CsgNode(std::vector< CsgPolygon > _polygons)
std::vector< CsgPolygon > clipPolygons(std::vector< CsgPolygon > _polygons)
std::enable_if< nDim_==3, T >::type build(std::vector< CsgPolygon > _polygons)
std::enable_if< nDim_==3, T >::type splitPolygon(CsgPolygon *polygon, std::vector< CsgPolygon > *coplanarFront, std::vector< CsgPolygon > *coplanarBack, std::vector< CsgPolygon > *front, std::vector< CsgPolygon > *back)
std::enable_if< nDim_==2, T >::type initPlane(CsgVector abc[nDim]) const
CsgPlane(CsgVector abc[nDim])
std::enable_if< nDim_==2, T >::type splitPolygon(CsgPolygon *polygon, std::vector< CsgPolygon > *coplanarFront, std::vector< CsgPolygon > *coplanarBack, std::vector< CsgPolygon > *front, std::vector< CsgPolygon > *back)
std::enable_if< nDim_==3, T >::type initPlane(CsgVector abc[nDim]) const
CsgPlane(CsgVector _normal, MFloat _w)
void insertCoplanarPolygon(CsgPolygon *polygon, std::vector< CsgPolygon > *coplanarFront, std::vector< CsgPolygon > *coplanarBack)
static constexpr MFloat eps
CsgPolygon(std::vector< CsgVertex > _vertices, MInt _setIndex, MInt _faceId, MInt _faceType, MInt _bodyId, CsgPlane _plane)
std::vector< CsgVertex > vertices
CsgPolygon(std::vector< CsgVertex > _vertices, MInt _setIndex, MInt _faceId, MInt _faceType, MInt _bodyId)
CsgVector(CsgVector &&)=default
CsgVector(const std::array< MFloat, nDim > X)
CsgVector lerp(const CsgVector &a, const MFloat t) const
std::array< MFloat, nDim > xx
CsgVector dividedBy(const MFloat a) const
std::enable_if< nDim_==3, T >::type cross(const CsgVector a) const
CsgVector(const CsgVector &Y)
CsgVector & operator=(const CsgVector &)=default
CsgVector plus(const CsgVector &a) const
CsgVector minus(const CsgVector &a) const
MFloat dot(const CsgVector &a) const
CsgVector & operator=(CsgVector &&)=default
CsgVector times(const MFloat a) const
CsgVertex(CsgVector _pos, MInt _vertexId, MInt _setIndex)
CsgVertex interpolate(CsgVertex *other, MFloat t) const
cellWithSplitFace(MInt id)
std::vector< splitCartesianFace > splitFaces
polyCutCell2D(MInt cartCell, const MFloat *_center)
std::vector< MInt > edges
polyCutCell3D(MInt cartCell, const MFloat *_center)
std::vector< MInt > faces
polyCutCellBase(MInt cartCell, const MFloat *_center)
polyEdge2D(MInt v0, MInt v1, MInt eId, MInt eType, MInt _bodyId)
polyEdge3D(MInt v0, MInt v1, MInt eId, MInt eType)
polyEdgeBase(MInt v0, MInt v1, MInt eId, MInt eType)
std::vector< std::pair< MInt, MInt > > edges
std::vector< MInt > vertices
polyFace(MInt fId, MInt fType, MInt _bodyId)
std::list< std::pair< MInt, MInt > > edges
std::vector< MInt > faces
polyVertex(std::array< MFloat, nDim > coords, MInt pId, MInt pType)
std::vector< MInt > edges
std::vector< MInt > faceIds
std::set< MInt > surfaceIdentificators
polyVertex(MInt pId, MInt pType)
std::array< MFloat, nDim > coordinates
splitCartesianFace(MInt dir)
std::vector< MInt > srfcIds
std::array< MFloat, nDim > center
std::array< MFloat, nDim > normal
MFloat m_bodyFaceJoinCriterion
static constexpr MInt m_noCorners
GridProxy *const m_gridProxy
static constexpr MInt m_noEdges
const std::vector< CutCell< nDim > > & cutCellData_()
std::vector< CutCell< nDim > > m_cutCellData
MFloat * m_scaledCoordinate
const GridProxy & grid() const
static constexpr MInt nDim
std::enable_if< nDim_==3, T >::type computeNormal(const std::array< MFloat, nDim > p0, const std::array< MFloat, nDim > p1, const std::array< MFloat, nDim > p2, std::array< MFloat, nDim > &res, MFloat &w)
void compVolumeIntegrals_pyraBased3(std::vector< polyCutCell > *, std::vector< polyFace > *, const std::vector< polyVertex > *)
void writeVTKFileOfCell(MInt cellId, std::vector< polyFace > *faces, const std::vector< polyVertex > *vertices, MInt set)
GeometryIntersection(GridProxy *gridProxy_, Geom *geometry_)
MFloat & a_coordinate(const MInt cellId, const MInt dir)
Returns the coordinate of the cell cellId for dimension dir.
void addPoint(const std::vector< polyVertex > *, const MInt *, const MInt, std::array< MFloat, nDim >)
adds an additional MC point in the cell sums up all n points passed in indices. points have to be sto...
MInt m_noLevelSetsUsedForMb
std::vector< lvlJumpCandidates< nDim > > m_cutLvlJumpCandidates
void writeInfo(std::vector< CutCell< nDim > > &cutCellData, MUint, MInt)
void computeCutFaces(std::vector< CutCell< nDim > > &cutCellData, const MInt maxNoSurfaces, const MInt tCutGroup)
GeometryContext & geometryContext()
const Geom & geometry() const
std::vector< CutCandidate< nDim > > m_cutCandidates
void exchangeNodalValues(const MInt **maxLevelWindowCells, const MInt *noMaxLevelWindowCells, const MInt **maxLevelHaloCells, std::vector< CutCandidate< nDim > > &candidates, MInt *candidateIds)
halo cell - window cell exchange of nodal scalar field data
void crossProduct(MFloat *c, const MFloat *a, const MFloat *b)
void fillCutCellData(std::vector< CutCandidate< nDim > > &candidates, std::vector< CutCell< nDim > > &cutCellData, std::vector< MInt > cutCellIdMapping)
typename maia::grid::Proxy< nDim > GridProxy
void getNeighborNodes(const MInt, const MInt, MInt, MInt *, MInt *)
gets all neighbor cellIds and matching nodes for a given cell and node
MFloat a_gridCellVolume(const MInt cellId) const
Returns the volume of the cell cellId.
static constexpr MInt m_noDirs
void computeNodalValues(std::vector< CutCandidate< nDim > > &candidates, MInt *candidateIds, const MFloat *scalarField, const MInt *bodyIdField, const MBool *const gapPropertyField, const MBool gapClosure)
1) add cutCandidates based on the solver m_bndryCandidates 2) set cutCandidate information 3) set the...
const std::vector< CutCandidate< nDim > > & cutCandidates_()
void compFaceIntegrals_pyraBased3(polyFace *face, const std::vector< polyVertex > *vertices, MFloat *MC, MFloat *VC, MFloat *XC)
void correctNodalValuesAtLevelJump(std::vector< CutCandidate< nDim > > &candidates, const MInt *)
corrects the nodal values at bndry level jumps for ls-based geometries
std::enable_if< nDim_==2, T >::type computeNormal(const std::array< MFloat, nDim > p0, const std::array< MFloat, nDim > p1, std::array< MFloat, nDim > res, MFloat &w)
returns the normal corresponding to the triangle abc and returns the result in res
std::conditional< nDim_==3, polyEdge3D, polyEdge2D >::type polyEdge
std::conditional< nDim_==3, polyCutCell3D, polyCutCell2D >::type polyCutCell
void computeCutPointsFromSTL(std::vector< CutCandidate< nDim > > &candidates)
computes cut points where candidate intersects with the geometry note: can not handle bndryRefinement...
MFloat a_cellLengthAtCell(const MInt cellId) const
Returns the cellLength of the cell cellId.
MInt ** m_setToBodiesTable
void computeCutPoints(std::vector< CutCandidate< nDim > > &candidates, const MInt *candidateIds, std::vector< MInt > &candidatesOrder)
Computes cutpoints for the scalar-Field with grid edges and updates cutPoint-Info in the cutCandidate...
static constexpr MInt m_maxNoChilds
MBool computeCutFaceSimple(CutCell< nDim > &cutCell)
std::array< MInt, maxNoJumps > neighborType
static constexpr MInt maxNoJumps
std::array< MInt, maxNoJumps > diagonalDirs
std::array< MInt, maxNoJumps > dirs
constexpr std::array< T, n > make_array(const T v)
constexpr MLong IPOW2(MInt x)
std::basic_string< char > MString
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allreduce