Loading...
Searching...
No Matches
levelSetSegmentationObject.cpp
58LevelSetSegmentationSurfaceInfo::LevelSetSegmentationSurfaceInfo(const LevelSetSegmentationSurfaceInfo &other)
103LevelSetSegmentationSurfaceInfo::LevelSetSegmentationSurfaceInfo(std::unique_ptr<const SurfUnstructured> &&surface, double featureAngle, LevelSetSurfaceSmoothing surfaceSmoothing)
116LevelSetSegmentationSurfaceInfo::LevelSetSegmentationSurfaceInfo(const SurfUnstructured *surface, double featureAngle, LevelSetSurfaceSmoothing surfaceSmoothing)
134void LevelSetSegmentationSurfaceInfo::setSurface(std::unique_ptr<const SurfUnstructured> &&surface, double featureAngle){
146void LevelSetSegmentationSurfaceInfo::setSurface(const SurfUnstructured *surface, double featureAngle, LevelSetSurfaceSmoothing surfaceSmoothing){
193void LevelSetSegmentationSurfaceInfo::setSurface(const SurfUnstructured *surface, double featureAngle){
238 BITPIT_CREATE_WORKSPACE(lambda, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
257 if (utils::DoubleFloatingEqual()(pointProjectionNormalComponent, 0., distanceTolerance, distanceTolerance)) {
258 bool pointOnSegmentation = utils::DoubleFloatingEqual()(unsignedDistance, 0., distanceTolerance, distanceTolerance);
290std::array<double, 3> LevelSetSegmentationSurfaceInfo::evalDistanceVector(const std::array<double, 3> &point,
294 BITPIT_CREATE_WORKSPACE(lambda, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
307std::array<double, 3> LevelSetSegmentationSurfaceInfo::evalNormal(const std::array<double, 3> &point,
325std::array<double,3> LevelSetSegmentationSurfaceInfo::evalPseudoNormal(const SegmentConstIterator &segmentItr,
415void LevelSetSegmentationSurfaceInfo::evalHighOrderProjectionOnLine(const std::array<double,3> &point,
616void LevelSetSegmentationSurfaceInfo::evalHighOrderProjectionOnTriangle(const std::array<double,3> &point,
634 std::array<double, 3> point_s = CGElem::projectPointTriangle(point, point0, point1, point2, &(tau[0]));
838 double d0_lambda_ij = -(dotProduct(edge - lambda_ij * normal_s, d0_normal_i) + dotProduct(d0_edge, normal_i)) / dotProduct(normal_s, normal_i);
839 double d1_lambda_ij = -(dotProduct(edge - lambda_ij * normal_s, d1_normal_i) + dotProduct(d1_edge, normal_i)) / dotProduct(normal_s, normal_i);
842 double d0_lambda_ji = (dotProduct(edge - lambda_ji * normal_s, d0_normal_j) + dotProduct(d0_edge, normal_j)) / dotProduct(normal_s, normal_j);
843 double d1_lambda_ji = (dotProduct(edge - lambda_ji * normal_s, d1_normal_j) + dotProduct(d1_edge, normal_j)) / dotProduct(normal_s, normal_j);
848 + t[i] * t[j] * (d0_lambda_ij * t[i] + lambda_ij * d0_t[i] + d0_lambda_ji * t[j] + lambda_ji * d0_t[j]);
850 + t[i] * t[j] * (d1_lambda_ij * t[i] + lambda_ij * d1_t[i] + d1_lambda_ji * t[j] + lambda_ji * d1_t[j]);
889void LevelSetSegmentationSurfaceInfo::evalHighOrderProjectionOnPolygon(const std::array<double,3> &point,
901 BITPIT_CREATE_WORKSPACE(segmentVertexCoords, std::array<double BITPIT_COMMA 3>, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
902 m_surface->getVertexCoords(segmentVertexIds.size(), segmentVertexIds.data(), segmentVertexCoords);
904 BITPIT_CREATE_WORKSPACE(tau, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
905 std::array<double, 3> point_s = CGElem::projectPointPolygon(point, nSegmentVertices, segmentVertexCoords, tau);
907 std::array<double, 3> lowOrderProjectionNormal = tau[0] * computeSegmentVertexNormal(segmentItr, 0, true);
965 BITPIT_CREATE_WORKSPACE(edgePoint_s, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
966 BITPIT_CREATE_WORKSPACE(d0_edgePoint_s, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
967 BITPIT_CREATE_WORKSPACE(d1_edgePoint_s, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
968 BITPIT_CREATE_WORKSPACE(edgePoint_p, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
969 BITPIT_CREATE_WORKSPACE(d0_edgePoint_p, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
970 BITPIT_CREATE_WORKSPACE(d1_edgePoint_p, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
971 BITPIT_CREATE_WORKSPACE(edgeNormal_p, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
972 BITPIT_CREATE_WORKSPACE(d0_edgeNormal_p, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
973 BITPIT_CREATE_WORKSPACE(d1_edgeNormal_p, std::array<double BITPIT_COMMA 3>, nSegmentEdges, ReferenceElementInfo::MAX_ELEM_EDGES);
1074 BITPIT_CREATE_WORKSPACE(d0_d, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
1075 BITPIT_CREATE_WORKSPACE(d1_d, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
1083 d0_d[i] = 4.0 * d[i] * dotProduct((edgePoint_s[i] - point_s), (d0_edgePoint_s[i] - d0_point_s));
1084 d1_d[i] = 4.0 * d[i] * dotProduct((edgePoint_s[i] - point_s), (d1_edgePoint_s[i] - d1_point_s));
1088 BITPIT_CREATE_WORKSPACE(d0_t, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
1089 BITPIT_CREATE_WORKSPACE(d1_t, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
1126 d0_point_m += d0_t[i] * (edgePoint_p[i]- edgePoint_s[i]) + t[i] * (d0_edgePoint_p[i] - d0_edgePoint_s[i]);
1127 d1_point_m += d1_t[i] * (edgePoint_p[i]- edgePoint_s[i]) + t[i] * (d1_edgePoint_p[i] - d1_edgePoint_s[i]);
1164 double d0_lambda_ij = -(dotProduct(edge - lambda_ij * normal_s, d0_normal_i) + dotProduct(d0_edge, normal_i)) / dotProduct(normal_s, normal_i);
1165 double d1_lambda_ij = -(dotProduct(edge - lambda_ij * normal_s, d1_normal_i) + dotProduct(d1_edge, normal_i)) / dotProduct(normal_s, normal_i);
1168 double d0_lambda_ji = (dotProduct(edge - lambda_ji * normal_s, d0_normal_j) + dotProduct(d0_edge, normal_j)) / dotProduct(normal_s, normal_j);
1169 double d1_lambda_ji = (dotProduct(edge - lambda_ji * normal_s, d1_normal_j) + dotProduct(d1_edge, normal_j)) / dotProduct(normal_s, normal_j);
1174 + t[i] * t[j] * (d0_lambda_ij * t[i] + lambda_ij * d0_t[i] + d0_lambda_ji * t[j] + lambda_ji * d0_t[j]);
1176 + t[i] * t[j] * (d1_lambda_ij * t[i] + lambda_ij * d1_t[i] + d1_lambda_ji * t[j] + lambda_ji * d1_t[j]);
1213void LevelSetSegmentationSurfaceInfo::evalHighOrderProjection(const std::array<double,3> &point,
1258void LevelSetSegmentationSurfaceInfo::evalLowOrderProjectionOnLine(const std::array<double, 3> &point,
1272 BITPIT_CREATE_WORKSPACE(lambda, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
1290void LevelSetSegmentationSurfaceInfo::evalLowOrderProjectionOnTriangle(const std::array<double, 3> &point,
1305 BITPIT_CREATE_WORKSPACE(lambda, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
1324void LevelSetSegmentationSurfaceInfo::evalLowOrderProjectionOnPolygon(const std::array<double, 3> &point,
1334 BITPIT_CREATE_WORKSPACE(segmentVertexCoords, std::array<double BITPIT_COMMA 3>, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
1335 m_surface->getVertexCoords(segmentVertexIds.size(), segmentVertexIds.data(), segmentVertexCoords);
1337 BITPIT_CREATE_WORKSPACE(lambda, double, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
1338 (*projectionPoint) = CGElem::projectPointPolygon(point, nSegmentVertices, segmentVertexCoords, lambda);
1355void LevelSetSegmentationSurfaceInfo::evalLowOrderProjection(const std::array<double, 3> &point,
1436std::array<double, 3> LevelSetSegmentationSurfaceInfo::evalProjection(const std::array<double, 3> &point,
1470std::array<double,3> LevelSetSegmentationSurfaceInfo::computePseudoNormal(const SegmentConstIterator &segmentItr,
1486 positionFlag = CGElem::convertBarycentricToFlagPolygon(nSegmentVertices, lambda, m_surface->getTol());
1526std::array<double,3> LevelSetSegmentationSurfaceInfo::computeSurfaceNormal(const SegmentConstIterator &segmentItr,
1538 std::array<double,3> surfaceNormal = lambda[0] * computeSegmentVertexNormal(segmentItr, 0, true);
1555std::array<double,3> LevelSetSegmentationSurfaceInfo::computeSegmentNormal(const SegmentConstIterator &segmentItr ) const {
1576std::array<double,3> LevelSetSegmentationSurfaceInfo::computeSegmentEdgeNormal(const SegmentConstIterator &segmentItr, int edge, bool limited ) const {
1582 m_surface->evalEdgeNormals(segmentId, edge, m_featureAngle, &unlimitedEdgeNormal, &limitedEdgeNormal) ;
1602std::array<double,3> LevelSetSegmentationSurfaceInfo::computeSegmentVertexNormal(const SegmentConstIterator &segmentItr, int vertex, bool limited ) const {
1616 bool hasLimitedNormal = m_limitedSegmentVertexNormalValid[m_segmentVertexOffset.rawAt(segmentRawId) + vertex];
1626 limitedVertexNormal = m_surface->evalLimitedVertexNormal(segmentId, vertex, vertexNeighbours.size(), vertexNeighbours.data(), m_featureAngle) ;
1629 m_surface->evalVertexNormals(segmentId, vertex, vertexNeighbours.size(), vertexNeighbours.data(), m_featureAngle, &unlimitedVertexNormal, &limitedVertexNormal) ;
1641 m_limitedSegmentVertexNormalStorage.insert({segmentVertexKey, std::move(limitedVertexNormal)}) ;
1687std::size_t LevelSetSegmentationBaseObject::createFieldCellCache(LevelSetField field, std::size_t cacheId)
1806LevelSetIntersectionStatus LevelSetSegmentationBaseObject::_isCellIntersected(long id, double distance, LevelSetIntersectionMode mode) const
1840LevelSetIntersectionStatus LevelSetSegmentationBaseObject::_isInterfaceIntersected(long id, bool invert,
1864 LevelSetSegmentationSurfaceInfo::SegmentConstIterator segmentItr = surface.getCellConstIterator(support);
1885 isIntersected = m_kernel->getMesh()->intersectInterfacePlane(id, projectionPoint, projectionNormal, intersection, polygon);
1900 isIntersected = m_kernel->getMesh()->intersectInterfacePlane(id, projectionPoint, projectionNormal, intersection, polygon);
1915std::array<double,3> LevelSetSegmentationBaseObject::evalCellNormal(long id, bool signedLevelSet) const
1933 std::array<double, 3> normal = evalCellFieldCached<std::array<double, 3>>(field, id, evaluator, fallback);
2003 supportSearchRadius = std::min(2 * m_kernel->computeCellBoundingRadius(neighId), supportSearchRadius);
2035 if (searchRadius < std::numeric_limits<double>::max() && searchRadius != AUTOMATIC_SEARCH_RADIUS) {
2057const SurfUnstructured & LevelSetSegmentationBaseObject::evalSurface(const std::array<double,3> &point) const
2080std::array<double,3> LevelSetSegmentationBaseObject::evalNormal(const std::array<double,3> &point, bool signedLevelSet) const
2109long LevelSetSegmentationBaseObject::evalSupport(const std::array<double,3> &point, double searchRadius) const
2175void LevelSetSegmentationBaseObject::addVTKOutputData( LevelSetField field, const std::string &objectName)
2258 auto evaluator = [this] (long id) -> std::array<double,3> { return evalCellNormal(id, true); };
2259 auto fallback = [] (long id) -> const std::array<double,3> & { BITPIT_UNUSED(id); return levelSetDefaults::NORMAL; };
2339std::array<double,3> LevelSetSegmentationBaseObject::getNormal(const std::array<double,3> &point) const
2361double LevelSetSegmentationBaseObject::getSurfaceFeatureSize(const std::array<double,3> &point) const
2395LevelSetSegmentationObject::LevelSetSegmentationObject(int id, std::unique_ptr<const SurfUnstructured> &&surface, double featureAngle)
2407LevelSetSegmentationObject::LevelSetSegmentationObject(int id, const SurfUnstructured *surface, double featureAngle)
2420LevelSetSegmentationObject::LevelSetSegmentationObject(int id, const SurfUnstructured *surface, double featureAngle, LevelSetSurfaceSmoothing surfaceSmoothing)
2481void LevelSetSegmentationObject::setSurface(std::unique_ptr<const SurfUnstructured> &&surface, bool force){
2498void LevelSetSegmentationObject::setSurface(std::unique_ptr<const SurfUnstructured> &&surface, double featureAngle, bool force){
2512 m_surfaceInfo = std::unique_ptr<LevelSetSegmentationSurfaceInfo>(new LevelSetSegmentationSurfaceInfo(std::move(surface), featureAngle));
2547void LevelSetSegmentationObject::setSurface(const SurfUnstructured *surface, double featureAngle, bool force){
2561 m_surfaceInfo = std::unique_ptr<LevelSetSegmentationSurfaceInfo>(new LevelSetSegmentationSurfaceInfo(surface, featureAngle));
2579void LevelSetSegmentationObject::setSurface(const SurfUnstructured *surface, double featureAngle, LevelSetSurfaceSmoothing surfaceSmoothing, bool force){
2593 m_surfaceInfo = std::unique_ptr<LevelSetSegmentationSurfaceInfo>(new LevelSetSegmentationSurfaceInfo(surface, featureAngle, surfaceSmoothing));
2656void LevelSetSegmentationObject::fillCellLocationCache(const std::vector<adaption::Info> &adaptionData)
2685 const LevelSetCartesianKernel *cartesianKernel = dynamic_cast<LevelSetCartesianKernel*>(m_kernel);
2722 surface.getVertexCoords(nSegmentVertices, segmentVertexIds.data(), segmentVertexCoords.data());
2739 if (CGElem::intersectBoxPolygon(meshMinPoint, meshMaxPoint, segmentVertexCoords, false, true, true, intersectionPoints, meshDimension)) {
2749 CellCacheCollection::ValueCache<char> *locationCache = getCellCache<char>(m_cellLocationCacheId);
2814 locationCache->insertEntry(neighId, static_cast<char>(LevelSetCellLocation::NARROW_BAND_NEIGHBOUR));
2825 CellCacheCollection::ValueCache<char>::Entry locationCacheEntry = locationCache->findEntry(cellId);
2835 startCellCacheExchange(mesh.getGhostCellExchangeSources(), m_cellLocationCacheId, dataCommunicator.get());
2836 completeCellCacheExchange(mesh.getGhostCellExchangeTargets(), m_cellLocationCacheId, dataCommunicator.get());
2855LevelSetCellLocation LevelSetSegmentationObject::fillCellGeometricNarrowBandLocationCache(long id)
2881 if (_isCellIntersected(id, cellUnsigendValue, CELL_LOCATION_INTERSECTION_MODE) == LevelSetIntersectionStatus::TRUE) {
2886 assert((getSurfaceSmoothing() == LevelSetSurfaceSmoothing::HIGH_ORDER) || (cellLocation != LevelSetCellLocation::UNKNOWN));
2889 CellCacheCollection::ValueCache<char> *locationCache = getCellCache<char>(m_cellLocationCacheId);
2953std::array<double,3> LevelSetSegmentationObject::_evalCellGradient(long id, bool signedLevelSet) const
2987std::array<double,3> LevelSetSegmentationObject::_evalCellNormal(long id, bool signedLevelSet) const
3005const SurfUnstructured & LevelSetSegmentationObject::_evalSurface(const std::array<double,3> &point) const
3032double LevelSetSegmentationObject::_evalValue(const std::array<double,3> &point, bool signedLevelSet) const
3046std::array<double,3> LevelSetSegmentationObject::_evalGradient(const std::array<double,3> &point, bool signedLevelSet) const
3088short LevelSetSegmentationObject::_evalSign(const std::array<double,3> &point, long support) const
3099 LevelSetSegmentationSurfaceInfo::SegmentConstIterator supportItr = getSurface().getCellConstIterator(support);
3123 throw std::runtime_error("With an invalid support, only the unsigend levelset can be evaluated.");
3127 LevelSetSegmentationSurfaceInfo::SegmentConstIterator supportItr = getSurface().getCellConstIterator(support);
3154std::array<double,3> LevelSetSegmentationObject::_evalGradient(const std::array<double,3> &point, long support,
3165 throw std::runtime_error("With an invalid support, only the unsigend levelset can be evaluated.");
3169 LevelSetSegmentationSurfaceInfo::SegmentConstIterator supportItr = getSurface().getCellConstIterator(support);
3171 double distance = m_surfaceInfo->evalDistance(point, supportItr, signedLevelSet, &distanceVector);
3207long LevelSetSegmentationObject::_evalSupport(const std::array<double,3> &point, double searchRadius) const
3256 throw std::runtime_error("With an invalid support, only the unsigend levelset can be evaluated.");
3260 LevelSetSegmentationSurfaceInfo::SegmentConstIterator segmentItr = getSurface().getCellConstIterator(support);
3299LevelSetIntersectionStatus LevelSetSegmentationObject::_isInterfaceIntersected(long id, bool invert,
3307 return LevelSetSegmentationBaseObject::_isInterfaceIntersected(id, invert, intersection, polygon);
3365LevelSetBooleanObject<LevelSetSegmentationBaseObject>::LevelSetBooleanObject( int id, LevelSetBooleanOperation op, const LevelSetSegmentationBaseObject *source1, const LevelSetSegmentationBaseObject *source2 )
3376LevelSetBooleanObject<LevelSetSegmentationBaseObject>::LevelSetBooleanObject( int id, LevelSetBooleanOperation op, const std::vector<const LevelSetSegmentationBaseObject *> &sourceObjects )
3394const SurfUnstructured & LevelSetBooleanObject<LevelSetSegmentationBaseObject>::_evalCellSurface(long id) const
3405long LevelSetBooleanObject<LevelSetSegmentationBaseObject>::_evalCellSupport(long id, double searchRadius) const
3428std::array<double,3> LevelSetBooleanObject<LevelSetSegmentationBaseObject>::_evalCellNormal(long id, bool signedLevelSet) const
3430 return _evalCellFunction<std::array<double,3>>(id, signedLevelSet, [&id, signedLevelSet] (const LevelSetBooleanResult<LevelSetSegmentationBaseObject> &result) -> std::array<double,3>
3452const SurfUnstructured & LevelSetBooleanObject<LevelSetSegmentationBaseObject>::_evalSurface(const std::array<double,3> &point) const
3463long LevelSetBooleanObject<LevelSetSegmentationBaseObject>::_evalSupport(const std::array<double,3> &point) const
3476long LevelSetBooleanObject<LevelSetSegmentationBaseObject>::_evalSupport(const std::array<double,3> &point, double searchRadius) const
3498void LevelSetBooleanObject<LevelSetSegmentationBaseObject>::_evalProjection(const std::array<double,3> &point,
3503 return _evalFunction<void>(point, signedLevelSet, [&point, projectionPoint, projectionNormal, signedLevelSet] (const LevelSetBooleanResult<LevelSetSegmentationBaseObject> &result)
3524int LevelSetBooleanObject<LevelSetSegmentationBaseObject>::_evalPart(const std::array<double,3> &point) const
3554const SurfUnstructured & LevelSetComplementObject<LevelSetSegmentationBaseObject>::_evalCellSurface(long id) const
3571long LevelSetComplementObject<LevelSetSegmentationBaseObject>::_evalCellSupport(long id, double searchRadius) const
3594std::array<double,3> LevelSetComplementObject<LevelSetSegmentationBaseObject>::_evalCellNormal(long id, bool signedLevelSet) const
3610const SurfUnstructured & LevelSetComplementObject<LevelSetSegmentationBaseObject>::_evalSurface(const std::array<double,3> &point) const
3621long LevelSetComplementObject<LevelSetSegmentationBaseObject>::_evalSupport(const std::array<double,3> &point) const
3634long LevelSetComplementObject<LevelSetSegmentationBaseObject>::_evalSupport(const std::array<double,3> &point, double searchRadius) const
3645int LevelSetComplementObject<LevelSetSegmentationBaseObject>::_evalPart(const std::array<double,3> &point) const
3667void LevelSetComplementObject<LevelSetSegmentationBaseObject>::_evalProjection(const std::array<double,3> &point,
static ConstProxyVector< long > getVertexIds(ElementType type, const long *connectivity)
Definition element.cpp:1193
const LevelSetSegmentationBaseObject * getCellReferenceObject(long id) const override
Definition levelSetBooleanObject.tpp:443
LevelSetBooleanBaseObject(int, LevelSetBooleanOperation, const LevelSetSegmentationBaseObject *, const LevelSetSegmentationBaseObject *)
Definition levelSetBooleanObject.tpp:144
const LevelSetSegmentationBaseObject * getReferenceObject(const std::array< double, 3 > &point) const override
Definition levelSetBooleanObject.tpp:469
data_t _evalCellFunction(long id, bool signedLevelSet, const function_t &function) const
Definition levelSetBooleanObject.tpp:412
data_t _evalFunction(const std::array< double, 3 > &point, bool signedLevelSet, const function_t &function) const
Definition levelSetBooleanObject.tpp:428
LevelSetBooleanObject(int, LevelSetBooleanOperation, const LevelSetSegmentationBaseObject *, const LevelSetSegmentationBaseObject *)
Definition levelSetSegmentationObject.cpp:3365
Allow to evaluate the result of a boolean operation between two LevelSetObjects.
Definition levelSetBooleanObject.hpp:44
const SourceLevelSetObject * getObject() const
Definition levelSetBooleanObject.tpp:110
int getObjectSign() const
Definition levelSetBooleanObject.tpp:118
Implements LevelSetKernel for cartesian meshes.
Definition levelSetCartesianKernel.hpp:34
VolCartesian * getMesh() const override
Definition levelSetCartesianKernel.cpp:69
const LevelSetSegmentationBaseObject * getCellReferenceObject(long id) const override
Definition levelSetComplementObject.tpp:234
virtual const LevelSetSegmentationBaseObject * getSourceObject() const
Definition levelSetComplementObject.tpp:263
bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >::LevelSetComplementBaseObject
LevelSetComplementBaseObject(int id, const LevelSetSegmentationBaseObject *source)
Definition levelSetComplementObject.tpp:50
LevelSetComplementObject(int id, const LevelSetSegmentationBaseObject *source)
Definition levelSetSegmentationObject.cpp:3535
double getDistanceTolerance() const
Definition levelSetKernel.cpp:102
CellCacheCollection::ValueCache< value_t > * getCellCache(std::size_t cacheId) const
Definition levelSetObject.tpp:61
static const LevelSetIntersectionMode CELL_LOCATION_INTERSECTION_MODE
Definition levelSetObject.hpp:135
void fillFieldCellCache(LevelSetField field, const std::vector< long > &cellIds)
Definition levelSetObject.cpp:3145
short evalValueSign(double value) const
Definition levelSetObject.cpp:1771
void completeCellCacheExchange(const std::unordered_map< int, std::vector< long > > &sendCellIds, std::size_t cacheIds, DataCommunicator *)
Definition levelSetObject.cpp:2292
virtual const LevelSetKernel * getKernel() const
Definition levelSetObject.cpp:271
virtual void addVTKOutputData(LevelSetField field, const std::string &objectName)
Definition levelSetObject.cpp:2092
static const bool CELL_CACHE_IS_SIGNED
Definition levelSetObject.hpp:134
virtual std::string getVTKOutputFieldName(LevelSetField field) const
Definition levelSetObject.cpp:2142
virtual short evalSign(const std::array< double, 3 > &point) const
Definition levelSetObject.cpp:1723
virtual LevelSetIntersectionStatus _isInterfaceIntersected(long id, bool positivePart, std::array< std::array< double, 3 >, 2 > *intersection, std::vector< std::array< double, 3 > > *polygon) const
Definition levelSetObject.cpp:1573
virtual LevelSetFieldset getSupportedFields() const
Definition levelSetObject.cpp:175
virtual void fillCellLocationCache()
Definition levelSetObject.cpp:550
virtual short evalCellSign(long id) const
Definition levelSetObject.cpp:1598
LevelSetCellLocation getCellLocation(long id) const
Definition levelSetObject.cpp:483
value_t evalCellFieldCached(LevelSetField field, long id, const evaluator_t &evaluator, const fallback_t &fallback) const
Definition levelSetObject.tpp:236
std::size_t m_cellLocationCacheId
Id of the cache that will keep track if cell zones.
Definition levelSetObject.hpp:145
virtual void flushVTKOutputData(std::fstream &stream, VTKFormat format, LevelSetField field) const
Definition levelSetObject.cpp:2197
value_t evalCellField(LevelSetField field, long id, const evaluator_t &evaluator, const fallback_t &fallback) const
Definition levelSetObject.tpp:267
virtual LevelSetIntersectionStatus _isCellIntersected(long, double distance, LevelSetIntersectionMode=LevelSetIntersectionMode::FAST_FUZZY) const
Definition levelSetObject.cpp:1481
virtual std::size_t createFieldCellCache(LevelSetField field, std::size_t cacheId=CellCacheCollection::NULL_CACHE_ID)
Definition levelSetObject.cpp:2944
std::string getVTKOutputDataName(LevelSetField field, const std::string &objectName) const
Definition levelSetObject.cpp:2126
void startCellCacheExchange(const std::unordered_map< int, std::vector< long > > &recvCellIds, std::size_t cacheIds, DataCommunicator *) const
Definition levelSetObject.cpp:2241
Implements visitor pattern fo segmentated geometries.
Definition levelSetSegmentationObject.hpp:126
void evalProjection(const std::array< double, 3 > &point, bool signedLevelSet, std::array< double, 3 > *projectionPoint, std::array< double, 3 > *projectionNormal) const
Definition levelSetSegmentationObject.cpp:2131
void fillFieldCellCache(LevelSetField field, long id) override
Definition levelSetSegmentationObject.cpp:1720
void flushVTKOutputData(std::fstream &stream, VTKFormat format, LevelSetField field) const override
Definition levelSetSegmentationObject.cpp:2235
std::array< double, 3 > evalNormal(const std::array< double, 3 > &point, bool signedLevelSet) const
Definition levelSetSegmentationObject.cpp:2080
long getSupport(long cellId) const
Definition levelSetSegmentationObject.cpp:2299
const SurfUnstructured & evalSurface(const std::array< double, 3 > &point) const
Definition levelSetSegmentationObject.cpp:2057
LevelSetFieldset getSupportedFields() const override
Definition levelSetSegmentationObject.cpp:1704
std::array< double BITPIT_COMMA 3 > getNormal(long cellId) const
Definition levelSetSegmentationObject.cpp:2288
virtual int _evalPart(const std::array< double, 3 > &point) const
Definition levelSetSegmentationObject.cpp:2160
void addVTKOutputData(LevelSetField field, const std::string &objectName) override
Definition levelSetSegmentationObject.cpp:2175
int getPart(long cellId) const
Definition levelSetSegmentationObject.cpp:2277
std::array< double, 3 > evalCellNormal(long id, bool signedLevelSet) const
Definition levelSetSegmentationObject.cpp:1915
double getSurfaceFeatureSize(long cellId) const
Definition levelSetSegmentationObject.cpp:2310
virtual int _evalCellPart(long id) const
Definition levelSetSegmentationObject.cpp:2145
std::size_t createFieldCellCache(LevelSetField field, std::size_t cacheId=CellCacheCollection::NULL_CACHE_ID) override
Definition levelSetSegmentationObject.cpp:1687
LevelSetIntersectionStatus _isCellIntersected(long, double distance, LevelSetIntersectionMode=LevelSetIntersectionMode::FAST_FUZZY) const override
Definition levelSetSegmentationObject.cpp:1806
int evalPart(const std::array< double, 3 > &point) const
Definition levelSetSegmentationObject.cpp:2068
long evalCellSupport(long id, double searchRadius=AUTOMATIC_SEARCH_RADIUS) const
Definition levelSetSegmentationObject.cpp:1963
int evalCellPart(long id) const
Definition levelSetSegmentationObject.cpp:1751
static BITPIT_PUBLIC_API const double AUTOMATIC_SEARCH_RADIUS
Definition levelSetSegmentationObject.hpp:129
virtual LevelSetIntersectionStatus _isInterfaceIntersected(long id, bool invert, std::array< std::array< double, 3 >, 2 > *intersection, std::vector< std::array< double, 3 > > *polygon) const override
Definition levelSetSegmentationObject.cpp:1840
long evalSupport(const std::array< double, 3 > &point) const
Definition levelSetSegmentationObject.cpp:2096
const SurfUnstructured & evalCellSurface(long id) const
Definition levelSetSegmentationObject.cpp:1740
std::string getVTKOutputFieldName(LevelSetField field) const override
Definition levelSetSegmentationObject.cpp:2207
const SurfUnstructured & _evalSurface(const std::array< double, 3 > &point) const override
Definition levelSetSegmentationObject.cpp:3005
double getMaxSurfaceFeatureSize() const
Definition levelSetSegmentationObject.cpp:3345
LevelSetSegmentationObject * clone() const override
Definition levelSetSegmentationObject.cpp:2455
long _evalCellSupport(long id, double searchRadius=AUTOMATIC_SEARCH_RADIUS) const override
Definition levelSetSegmentationObject.cpp:2973
LevelSetCellLocation fillCellGeometricNarrowBandLocationCache(long id) override
Definition levelSetSegmentationObject.cpp:2855
LevelSetIntersectionStatus _isInterfaceIntersected(long id, bool invert, std::array< std::array< double, 3 >, 2 > *intersection, std::vector< std::array< double, 3 > > *polygon) const override
Definition levelSetSegmentationObject.cpp:3299
long _evalSupport(const std::array< double, 3 > &point) const override
Definition levelSetSegmentationObject.cpp:3194
short _evalSign(const std::array< double, 3 > &point) const override
Definition levelSetSegmentationObject.cpp:3018
std::array< double, 3 > _evalGradient(const std::array< double, 3 > &point, bool signedLevelSet) const override
Definition levelSetSegmentationObject.cpp:3046
double _evalCellValue(long id, bool signedLevelSet) const override
Definition levelSetSegmentationObject.cpp:2938
bool empty() const override
Definition levelSetSegmentationObject.cpp:2446
std::array< double, 3 > _evalCellGradient(long id, bool signedLevelSet) const override
Definition levelSetSegmentationObject.cpp:2953
void fillCellLocationCache() override
Definition levelSetSegmentationObject.cpp:2632
LevelSetSurfaceSmoothing getSurfaceSmoothing() const
Definition levelSetSegmentationObject.cpp:2618
LevelSetSegmentationObject(int)
Definition levelSetSegmentationObject.cpp:2383
short _evalCellSign(long id) const override
Definition levelSetSegmentationObject.cpp:2923
double _evalValue(const std::array< double, 3 > &point, bool signedLevelSet) const override
Definition levelSetSegmentationObject.cpp:3032
void setSurface(std::unique_ptr< const SurfUnstructured > &&surface, bool force=false)
Definition levelSetSegmentationObject.cpp:2481
double getMinSurfaceFeatureSize() const
Definition levelSetSegmentationObject.cpp:3316
const SurfUnstructured & getSurface() const
Definition levelSetSegmentationObject.cpp:2463
std::array< double, 3 > _evalCellNormal(long id, bool signedLevelSet) const override
Definition levelSetSegmentationObject.cpp:2987
const SurfUnstructured & _evalCellSurface(long id) const override
Definition levelSetSegmentationObject.cpp:2910
double getFeatureAngle() const
Definition levelSetSegmentationObject.cpp:2609
void _evalProjection(const std::array< double, 3 > &point, bool signedLevelSet, std::array< double, 3 > *projectionPoint, std::array< double, 3 > *projectionNormal) const override
Definition levelSetSegmentationObject.cpp:3070
const SurfaceSkdTree & getSearchTree() const
Definition levelSetSegmentationObject.cpp:2601
Segmentation kernel.
Definition levelSetSegmentationObject.hpp:51
void evalProjection(const std::array< double, 3 > &point, const SegmentConstIterator &segmentItr, std::array< double, 3 > *projectionPoint, std::array< double, 3 > *projectionNormal) const
Definition levelSetSegmentationObject.cpp:1399
double evalDistance(const std::array< double, 3 > &point, const SegmentConstIterator &segmentItr, bool signedDistance, std::array< double, 3 > *distanceVector) const
Definition levelSetSegmentationObject.cpp:231
const SurfaceSkdTree & getSearchTree() const
Definition levelSetSegmentationObject.cpp:201
const SurfUnstructured & getSurface() const
Definition levelSetSegmentationObject.cpp:125
std::array< double, 3 > evalDistanceVector(const std::array< double, 3 > &point, const SegmentConstIterator &segmentItr) const
Definition levelSetSegmentationObject.cpp:290
void setSurface(std::unique_ptr< const SurfUnstructured > &&surface, double featureAngle=DEFAULT_FEATURE_ANGLE)
Definition levelSetSegmentationObject.cpp:134
std::array< double, 3 > evalNormal(const std::array< double, 3 > &point, const SegmentConstIterator &segmentItr) const
Definition levelSetSegmentationObject.cpp:307
double getFeatureAngle() const
Definition levelSetSegmentationObject.cpp:209
static BITPIT_PUBLIC_API const double DEFAULT_FEATURE_ANGLE
Definition levelSetSegmentationObject.hpp:57
LevelSetSurfaceSmoothing getSurfaceSmoothing() const
Definition levelSetSegmentationObject.cpp:218
std::array< double, 3 > evalPseudoNormal(const SurfUnstructured::CellConstIterator &segmentIterator, const double *lambda) const
Definition levelSetSegmentationObject.cpp:325
LevelSetSegmentationSurfaceInfo()
Definition levelSetSegmentationObject.cpp:48
AdjacenciesBuildStrategy getAdjacenciesBuildStrategy() const
Definition patch_kernel.cpp:5891
void processCellFaceNeighbours(long seedId, int nLayers, Function function) const
Definition patch_kernel.tpp:497
const std::array< double, 3 > & getVertexCoords(long id) const
Definition patch_kernel.cpp:2335
CellConstIterator getCellConstIterator(long id) const
Definition patch_kernel.cpp:2695
The SurfUnstructured class defines an unstructured surface triangulation.
Definition surfunstructured.hpp:36
double evalCellSize(long id) const override
Definition surface_kernel.cpp:232
The SurfaceSkdTree implements a Bounding Volume Hierarchy tree for surface patches.
Definition surface_skd_tree.hpp:33
The VolumeKernel class provides an interface for defining volume patches.
Definition volume_kernel.hpp:33
array3D projectPointTriangle(array3D const &, array3D const &, array3D const &, array3D const &)
Definition CG_elem.cpp:1050
array3D projectPointSegment(array3D const &, array3D const &, array3D const &)
Definition CG_elem.cpp:997
int convertBarycentricToFlagSegment(std::array< double, 2 > const &, double tolerance=DEFAULT_DISTANCE_TOLERANCE)
Definition CG_elem.cpp:619
int convertBarycentricToFlagPolygon(std::vector< double > const &, double tolerance=DEFAULT_DISTANCE_TOLERANCE)
Definition CG_elem.cpp:687
bool intersectBoxPolygon(array3D const &, array3D const &, std::vector< array3D > const &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
Definition CG_elem.cpp:2931
array3D projectPointPolygon(array3D const &, std::vector< array3D > const &)
Definition CG_elem.cpp:1215
std::array< T, 3 > crossProduct(const std::array< T, 3 > &x, const std::array< T, 3 > &y)
Definition MathOperators_array.tpp:890
T dotProduct(const std::array< T, d > &x, const std::array< T, d > &y)
Definition MathOperators_array.tpp:851
#define BITPIT_CREATE_WORKSPACE(workspace, item_type, size, stack_size)
Definition commonUtils.hpp:76
@ NARROW_BAND_NEIGHBOUR
Definition levelSetCommon.hpp:85
@ NARROW_BAND_INTERSECTED
Narrow band zone, the cell intersects the surface.
Definition levelSetCommon.hpp:84
@ NARROW_BAND_DISTANCE
Definition levelSetCommon.hpp:82
const std::array< double, 3 > GRADIENT
Definition levelSetCommon.hpp:48
const std::array< double, 3 > NORMAL
Definition levelSetCommon.hpp:55
