Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
bitpit::LevelSetObject Interface Referenceabstract

Interface class for all objects with respect to whom the levelset function may be computed. More...

Inheritance diagram for bitpit::LevelSetObject:
Inheritance graph
[legend]
Collaboration diagram for bitpit::LevelSetObject:
Collaboration graph
[legend]

Public Types

typedef LevelSetCachedKernel::CellCacheCollection CellCacheCollection
 

Public Member Functions

virtual ~LevelSetObject ()
 
 BITPIT_DEPRECATED_FOR (double getValue(long cellId) const, double evalCellValue(long id, bool signedLevelSet) const)
 
 BITPIT_DEPRECATED_FOR (short getSign(long cellId) const, short evalCellSign(long id) const)
 
 BITPIT_DEPRECATED_FOR (std::array< double BITPIT_COMMA 3 > getGradient(long cellId) const, std::array< double BITPIT_COMMA 3 > evalCellGradient(long id, bool signedLevelSet) const)
 
virtual LevelSetObjectclone () const =0
 
std::array< double BITPIT_COMMA 3 > computeProjectionPoint (const std::array< double, 3 > &point) const
 
std::array< double BITPIT_COMMA 3 > computeProjectionPoint (long cellId) const
 
std::array< double BITPIT_COMMA 3 > computeVertexProjectionPoint (long vertexId) const
 
void disableFieldCellCache (LevelSetField field)
 
virtual bool empty () const =0
 
void enableFieldCellCache (LevelSetField field, LevelSetCacheMode cacheMode)
 
void enableVTKOutput (const LevelSetFieldset &fieldset, bool enable=true)
 
void enableVTKOutput (const LevelSetFieldset &fieldset, const std::string &objectName, bool enable=true)
 
void enableVTKOutput (LevelSetField field, bool enable=true)
 
void enableVTKOutput (LevelSetField field, const std::string &objectName, bool enable=true)
 
void enableVTKOutput (LevelSetWriteField field, bool enable=true)
 
void enableVTKOutput (LevelSetWriteField fieldset, const std::string &objectName, bool enable=true)
 
virtual std::array< double, 3 > evalCellGradient (long id, bool signedLevelSet) const
 
virtual std::array< double, 3 > evalCellProjectionPoint (long id) const
 
virtual short evalCellSign (long id) const
 
virtual double evalCellValue (long id, bool signedLevelSet) const
 
virtual std::array< double, 3 > evalGradient (const std::array< double, 3 > &point, bool signedLevelSet) const
 
virtual std::array< double, 3 > evalProjectionPoint (const std::array< double, 3 > &point) const
 
virtual short evalSign (const std::array< double, 3 > &point) const
 
virtual double evalValue (const std::array< double, 3 > &point, bool signedLevelSet) const
 
void flushData (std::fstream &, const std::string &, VTKFormat) override
 
LevelSetBulkEvaluationMode getCellBulkEvaluationMode () const
 
LevelSetCacheMode getFieldCellCacheMode (LevelSetField field) const
 
int getId () const
 
virtual const LevelSetKernelgetKernel () const
 
LevelSetInfo getLevelSetInfo (long cellId) const
 
double getLS (long cellId) const
 
double getNarrowBandSize () const
 
std::size_t getReferenceCount () const
 
double getSizeNarrowBand () const
 
virtual LevelSetFieldset getSupportedFields () const
 
LevelSetIntersectionStatus intersectSurface (long, LevelSetIntersectionMode=LevelSetIntersectionMode::FAST_FUZZY) const
 
virtual bool isCellInNarrowBand (long id) const
 
virtual bool isInNarrowBand (const std::array< double, 3 > &point) const
 
virtual bool isPrimary () const
 
void setCellBulkEvaluationMode (LevelSetBulkEvaluationMode evaluationMode)
 
void update (const std::vector< adaption::Info > &adaptionData)
 
- Public Member Functions inherited from bitpit::VTKBaseStreamer
virtual void absorbData (std::fstream &, const std::string &, VTKFormat, uint64_t, uint8_t, VTKDataType)
 
template<typename T >
void flushValue (std::fstream &, VTKFormat, const T &value) const
 
template<typename T >
void flushValue (std::fstream &, VTKFormat, const T *values, int nValues) const
 

Protected Types

template<typename data_t >
using CellCacheEntry = typename CellCacheCollection::ValueCache<data_t>::Entry
 

Protected Member Functions

 LevelSetObject (const LevelSetObject &other)
 
 LevelSetObject (int)
 
 LevelSetObject (LevelSetObject &&other)
 
virtual std::array< double, 3 > _evalCellGradient (long id, bool signedLevelSet) const =0
 
virtual short _evalCellSign (long id) const =0
 
virtual double _evalCellValue (long id, bool signedLevelSet) const =0
 
virtual std::array< double, 3 > _evalGradient (const std::array< double, 3 > &point, bool signedLevelSet) const =0
 
virtual short _evalSign (const std::array< double, 3 > &point) const
 
virtual double _evalValue (const std::array< double, 3 > &point, bool signedLevelSet) const =0
 
virtual LevelSetIntersectionStatus _intersectSurface (long, double distance, LevelSetIntersectionMode=LevelSetIntersectionMode::FAST_FUZZY) const
 
void adaptCellCaches (const std::vector< adaption::Info > &adaptionData)
 
virtual void addVTKOutputData (LevelSetField field, const std::string &objectName)
 
void clearCellCache (std::size_t cacheId, bool release)
 
void completeCellCacheExchange (const std::unordered_map< int, std::vector< long > > &sendCellIds, std::size_t cacheIds, DataCommunicator *)
 
void completeCellCachesExchange (const std::unordered_map< int, std::vector< long > > &sendCellIds, const std::vector< std::size_t > &cacheIds, DataCommunicator *)
 
template<typename value_t >
std::size_t createCellCache (LevelSetFillIn expectedFillIn, std::size_t cacheId=CellCacheCollection::NULL_CACHE_ID)
 
virtual std::size_t createCellLocationCache (std::size_t cacheId=CellCacheCollection::NULL_CACHE_ID)
 
virtual std::size_t createCellPropagatedSignCache (std::size_t cacheId=CellCacheCollection::NULL_CACHE_ID)
 
virtual std::size_t createFieldCellCache (LevelSetField field, std::size_t cacheId=CellCacheCollection::NULL_CACHE_ID)
 
template<typename value_t >
std::size_t createFieldCellCache (LevelSetField field, std::size_t cacheId=CellCacheCollection::NULL_CACHE_ID)
 
void destroyCellBulkData ()
 
void destroyCellCache (std::size_t cacheId)
 
void destroyCellLocationCache ()
 
void destroyCellNarrowBandData ()
 
void destroyCellPropagatedSignCache ()
 
virtual void destroyFieldCellCache (LevelSetField field)
 
virtual void dump (std::ostream &)
 
std::vector< long > evalCellCacheFillIds (LevelSetZone zone, LevelSetCacheMode cacheMode) const
 
std::vector< long > evalCellCacheFillIds (LevelSetZone zone, LevelSetCacheMode cacheMode, const std::vector< adaption::Info > &adaptionData) const
 
std::vector< long > evalCellCacheStaleIds (const std::vector< adaption::Info > &adaptionData) const
 
template<typename value_t , typename evaluator_t , typename fallback_t >
value_t evalCellField (LevelSetField field, long id, const evaluator_t &evaluator, const fallback_t &fallback) const
 
template<typename value_t , typename evaluator_t , typename fallback_t >
value_t evalCellFieldCached (LevelSetField field, long id, const evaluator_t &evaluator, const fallback_t &fallback) const
 
std::vector< long > evalCellFullCacheFillIds (LevelSetZone zone) const
 
std::vector< long > evalCellFullCacheFillIds (LevelSetZone zone, const std::vector< adaption::Info > &adaptionData) const
 
std::vector< long > evalCellNarrowBandCacheFillIds (LevelSetZone zone) const
 
std::vector< long > evalCellNarrowBandCacheFillIds (LevelSetZone zone, const std::vector< adaption::Info > &adaptionData) const
 
std::vector< long > evalCellOnDemandCacheFillIds (LevelSetZone zone) const
 
std::vector< long > evalCellOnDemandCacheFillIds (LevelSetZone zone, const std::vector< adaption::Info > &adaptionData) const
 
void evaluate ()
 
void evaluateCellBulkData ()
 
void evaluateCellNarrowBandData ()
 
short evalValueSign (double value) const
 
virtual LevelSetCellLocation fillCellGeometricNarrowBandLocationCache (long id)
 
virtual void fillCellLocationCache ()
 
virtual void fillCellLocationCache (const std::vector< adaption::Info > &adaptionData)
 
virtual void fillCellPropagatedSignCache ()
 
void fillFieldCellCache (LevelSetField field, const std::vector< long > &cellIds)
 
virtual void fillFieldCellCache (LevelSetField field, long id)
 
template<typename value_t >
void fillFieldCellCache (LevelSetField field, long id, const value_t &value) const
 
void fillFieldCellCaches (LevelSetZone zone, const std::vector< LevelSetField > &fields)
 
void fillFieldCellCaches (LevelSetZone zone, const std::vector< LevelSetField > &fields, const std::vector< adaption::Info > &adaptionData)
 
virtual void flushVTKOutputData (std::fstream &stream, VTKFormat format, LevelSetField field) const
 
template<typename value_t , typename evaluator_t , typename fallback_t >
void flushVTKOutputData (std::fstream &stream, VTKFormat format, LevelSetField field, const evaluator_t evluator, const fallback_t fallback) const
 
template<typename value_t >
CellCacheCollection::ValueCache< value_t > * getCellCache (std::size_t cacheId) const
 
CellCacheCollection::CachegetCellCache (std::size_t cacheId) const
 
LevelSetCellLocation getCellLocation (long id) const
 
LevelSetZone getCellZone (long id) const
 
template<typename value_t >
CellCacheCollection::ValueCache< value_t > * getFieldCellCache (LevelSetField field) const
 
CellCacheCollection::CachegetFieldCellCache (LevelSetField field) const
 
std::size_t getFieldCellCacheId (LevelSetField field) const
 
virtual LevelSetKernelgetKernel ()
 
std::string getVTKOutputDataName (LevelSetField field, const std::string &objectName) const
 
virtual std::string getVTKOutputFieldName (LevelSetField field) const
 
bool hasVTKOutputData (LevelSetField field, const std::string &objectName) const
 
void pruneCellCache (std::size_t cacheId, const std::vector< long > &cellIds)
 
void removeVTKOutputData (LevelSetField field, const std::string &objectName)
 
virtual void restore (std::istream &)
 
void setDefaultLevelSetSigndness (bool signedLevelSet)
 
virtual void setKernel (LevelSetKernel *)
 
void setNarrowBandSize (double size)
 
void setSizeNarrowBand (double)
 
void startCellCacheExchange (const std::unordered_map< int, std::vector< long > > &recvCellIds, std::size_t cacheIds, DataCommunicator *) const
 
void startCellCachesExchange (const std::unordered_map< int, std::vector< long > > &recvCellIds, const std::vector< std::size_t > &cacheIds, DataCommunicator *) const
 
void update ()
 
void updateCellBulkData (const std::vector< adaption::Info > &adaptionData)
 
void updateCellNarrowBandData (const std::vector< adaption::Info > &adaptionData)
 

Protected Attributes

std::size_t m_cellLocationCacheId
 Id of the cache that will keep track if cell zones.
 
std::size_t m_cellPropagatedSignCacheId
 Id of the cache that will keep track if cell propagated sign.
 
bool m_defaultSignedLevelSet
 
LevelSetFieldMap< std::string > m_enabledOutputFields
 
LevelSetKernelm_kernel
 
double m_narrowBandSize
 Size of narrow band.
 

Static Protected Attributes

static const bool CELL_CACHE_IS_SIGNED = false
 
static const LevelSetIntersectionMode CELL_LOCATION_INTERSECTION_MODE = LevelSetIntersectionMode::FAST_GUARANTEE_FALSE
 

Friends

class LevelSet
 
template<typename SourceLevelSetObject , typename BaseLevelSetObject >
class LevelSetProxyObject
 

Detailed Description

Interface class for all objects with respect to whom the levelset function may be computed.

Evaluation of the fields inside the narrow band is always performed using an exact algorithm, on the other hand evaluation of the fields in the bulk can be performed choosing one of the following modes:

Fields evaluated by the object on cell centroids can be cached. Cache can be enabled for each individual field separately and one of the following modes can be chosen:

Examples
RBF_example_00001.cpp.

Definition at line 55 of file levelSetObject.hpp.

Member Typedef Documentation

◆ CellCacheCollection

Definition at line 63 of file levelSetObject.hpp.

◆ CellCacheEntry

template<typename data_t >
using bitpit::LevelSetObject::CellCacheEntry = typename CellCacheCollection::ValueCache<data_t>::Entry
protected

Definition at line 129 of file levelSetObject.hpp.

Constructor & Destructor Documentation

◆ ~LevelSetObject()

bitpit::LevelSetObject::~LevelSetObject ( )
virtual

Destructor.

Definition at line 151 of file levelSetObject.cpp.

◆ LevelSetObject() [1/3]

bitpit::LevelSetObject::LevelSetObject ( int id)
protected

Constructor

Parameters
[in]idid assigned to object

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 84 of file levelSetObject.cpp.

◆ LevelSetObject() [2/3]

bitpit::LevelSetObject::LevelSetObject ( const LevelSetObject & other)
protected

Copy constructor

Parameters
[in]otheris another object whose content is copied in this object

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 102 of file levelSetObject.cpp.

◆ LevelSetObject() [3/3]

bitpit::LevelSetObject::LevelSetObject ( LevelSetObject && other)
protected

Move constructor

Parameters
[in]otheris another object whose content is moved in this object

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 126 of file levelSetObject.cpp.

Member Function Documentation

◆ _evalCellGradient()

virtual std::array< double, 3 > bitpit::LevelSetObject::_evalCellGradient ( long id,
bool signedLevelSet ) const
protectedpure virtual

◆ _evalCellSign()

virtual short bitpit::LevelSetObject::_evalCellSign ( long id) const
protectedpure virtual

◆ _evalCellValue()

virtual double bitpit::LevelSetObject::_evalCellValue ( long id,
bool signedLevelSet ) const
protectedpure virtual

◆ _evalGradient()

virtual std::array< double, 3 > bitpit::LevelSetObject::_evalGradient ( const std::array< double, 3 > & point,
bool signedLevelSet ) const
protectedpure virtual

◆ _evalSign()

short bitpit::LevelSetObject::_evalSign ( const std::array< double, 3 > & point) const
protectedvirtual

Evaluate levelset sign at the specified point.

Parameters
pointare the coordinates of the point
Returns
The sign of the levelset at the specified point.

Implemented in bitpit::LevelSetComplementBaseObject< LevelSetObject >, bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.

Definition at line 1651 of file levelSetObject.cpp.

◆ _evalValue()

virtual double bitpit::LevelSetObject::_evalValue ( const std::array< double, 3 > & point,
bool signedLevelSet ) const
protectedpure virtual

◆ _intersectSurface()

LevelSetIntersectionStatus bitpit::LevelSetObject::_intersectSurface ( long id,
double distance,
LevelSetIntersectionMode mode = LevelSetIntersectionMode::FAST_FUZZY ) const
protectedvirtual

Check if the specified cell intersects the zero-levelset iso-surface.

If mode==LevelSetIntersectionMode::FAST_FUZZY the method will compare the levelset value to tangent and bounding radius of a cell. If the value is smaller than the tangent radius LevelSetIntersectionStatus::TRUE is returned, if it is larger than the bounding radius LevelSetIntersectionStatus::FALSE is returned. If it is in-between LevelSetIntersectionStatus::CLOSE is returned.

If mode==LevelSetIntersectionMode::FAST_GUARANTEE_TRUE and the levelset value is smaller than the rangent radius LevelSetIntersectionStatus::TRUE is returned, otherwise LevelSetIntersectionStatus::FALSE.

If mode==LevelSetIntersectionMode::FAST_GURANTEE_FALSE and the levelset value is larger than the bounding radius LevelSetIntersectionStatus::FALSE is returned, otherwise LevelSetIntersectionStatus::TRUE.

If mode==LevelSetIntersectionMode::ACCURATE, the same checks of fuzzy mode are performed, however, in the cases where fuzzy mode would return CLOSE, an additional check on the intersection between the tangent plane at the projection point and the cell is performed. Errors of the method are related to the ratio of surface curvature over cell size.

The bounding sphere is the sphere with the minimum radius that contains all the cell vertices and has the center in the cell centroid.

The tangent sphere is a sphere having the center in the level centroid and tangent to the cell.

Parameters
[in]idcell id
[in]distanceis the unsigned distance of the cell centroid from the zero-levelset iso-surface
[in]modedescribes the types of check that should be performed
Returns
indicator regarding intersection

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 1402 of file levelSetObject.cpp.

◆ adaptCellCaches()

void bitpit::LevelSetObject::adaptCellCaches ( const std::vector< adaption::Info > & adaptionData)
protected

Adapt cell cache after a mesh update.

Only the transformation listed in the adaption data will be applied, entries associated with new cell will not be filled.

Parameters
adaptionDataare the information about the mesh update

Definition at line 2312 of file levelSetObject.cpp.

◆ addVTKOutputData()

void bitpit::LevelSetObject::addVTKOutputData ( LevelSetField field,
const std::string & objectName )
protectedvirtual

Add the VTK data associated with the specified field.

Parameters
[in]fieldis the field
[in]objectNameis the name that will be associated with the object

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 1990 of file levelSetObject.cpp.

◆ clearCellCache()

void bitpit::LevelSetObject::clearCellCache ( std::size_t cacheId,
bool release )
protected

Clear the specified cell cache.

Parameters
cacheIdis the id of the cached that will be cleared
releaseif set to true the memory hold by the caches will be released, otherwise the caches will be cleared but its memory may not be released

Definition at line 2433 of file levelSetObject.cpp.

◆ clone()

virtual LevelSetObject * bitpit::LevelSetObject::clone ( ) const
pure virtual

◆ completeCellCacheExchange()

void bitpit::LevelSetObject::completeCellCacheExchange ( const std::unordered_map< int, std::vector< long > > & recvCellIds,
std::size_t cacheId,
DataCommunicator * dataCommunicator )
protected

Complete exchange of cell cache data.

Parameters
[in]recvCellIdsis the list of cell ids to receive
[in]cacheIdis the id of the cache whose data will be exchanged
[in,out]dataCommunicatoris the data communicator that will be used for the data exchange

Definition at line 2190 of file levelSetObject.cpp.

◆ completeCellCachesExchange()

void bitpit::LevelSetObject::completeCellCachesExchange ( const std::unordered_map< int, std::vector< long > > & recvCellIds,
const std::vector< std::size_t > & cacheIds,
DataCommunicator * dataCommunicator )
protected

Complete exchange of cell cache data.

Parameters
[in]recvCellIdsis the list of cell ids to receive
[in]cacheIdis the id of the cache whose data will be exchanged
[in,out]dataCommunicatoris the data communicator that will be used for the data exchange

Definition at line 2203 of file levelSetObject.cpp.

◆ computeProjectionPoint() [1/2]

std::array< double, 3 > bitpit::LevelSetObject::computeProjectionPoint ( const std::array< double, 3 > & point) const

Projects a vertex on the zero levelset

Parameters
[in]pointpoint coordinates
Returns
the projected point

Definition at line 3220 of file levelSetObject.cpp.

◆ computeProjectionPoint() [2/2]

std::array< double, 3 > bitpit::LevelSetObject::computeProjectionPoint ( long cellId) const

Computes the projection point of the cell center, i.e. the closest point to the cell center on the zero level set

Parameters
[in]cellIdcell id
Returns
the projection point

Definition at line 3200 of file levelSetObject.cpp.

◆ computeVertexProjectionPoint()

std::array< double, 3 > bitpit::LevelSetObject::computeVertexProjectionPoint ( long vertexId) const

Computes the projection point of the vertex, i.e. the closest point to the vertex on the zero level set

Parameters
[in]vertexIdvertex id
Returns
the projection point

Definition at line 3210 of file levelSetObject.cpp.

◆ createCellCache()

template<typename value_t >
std::size_t bitpit::LevelSetObject::createCellCache ( LevelSetFillIn expectedFillIn,
std::size_t cacheId = CellCacheCollection::NULL_CACHE_ID )
protected

Create the cache that will be used for storing cell information of the specified field.

Parameters
expectedFillInis the expected fill-in of the cache
cacheIdis the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically
Returns
The id associated with the registered cache.

Definition at line 112 of file levelSetObject.tpp.

◆ createCellLocationCache()

std::size_t bitpit::LevelSetObject::createCellLocationCache ( std::size_t cacheId = CellCacheCollection::NULL_CACHE_ID)
protectedvirtual

Create the cache that will be used for storing cell location information.

Parameters
cacheIdis the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically
Returns
The id associated with the cache.

Definition at line 865 of file levelSetObject.cpp.

◆ createCellPropagatedSignCache()

std::size_t bitpit::LevelSetObject::createCellPropagatedSignCache ( std::size_t cacheId = CellCacheCollection::NULL_CACHE_ID)
protectedvirtual

Create the cache that will be used for storing cell propagated sign.

Parameters
cacheIdis the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically
Returns
The id associated with the cache.

Definition at line 1292 of file levelSetObject.cpp.

◆ createFieldCellCache() [1/2]

std::size_t bitpit::LevelSetObject::createFieldCellCache ( LevelSetField field,
std::size_t cacheId = CellCacheCollection::NULL_CACHE_ID )
protectedvirtual

Create the cache that will be used for storing cell information of the specified field.

Parameters
fieldis the field for which the caches will be added
cacheIdis the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically
Returns
The id associated with the cache.

Implemented in bitpit::LevelSetSegmentationBaseObject, bitpit::LevelSetSegmentationBaseObject, and bitpit::LevelSetSegmentationBaseObject.

Definition at line 2842 of file levelSetObject.cpp.

◆ createFieldCellCache() [2/2]

template<typename value_t >
std::size_t bitpit::LevelSetObject::createFieldCellCache ( LevelSetField field,
std::size_t cacheId = CellCacheCollection::NULL_CACHE_ID )
protected

Create the cache that will be used for storing cell information of the specified field.

Parameters
fieldis the field for which the caches will be added
cacheIdis the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically
Returns
The id associated with the registered cache.

Implemented in bitpit::LevelSetSegmentationBaseObject, bitpit::LevelSetSegmentationBaseObject, and bitpit::LevelSetSegmentationBaseObject.

Definition at line 79 of file levelSetObject.tpp.

◆ destroyCellBulkData()

void bitpit::LevelSetObject::destroyCellBulkData ( )
protected

Destroy cell data in the bulk.

Definition at line 1021 of file levelSetObject.cpp.

◆ destroyCellCache()

void bitpit::LevelSetObject::destroyCellCache ( std::size_t cacheId)
protected

Destroy the specified cache.

Parameters
cacheIdthe id of the cell that will be unregistered

Definition at line 3189 of file levelSetObject.cpp.

◆ destroyCellLocationCache()

void bitpit::LevelSetObject::destroyCellLocationCache ( )
protected

Destroy identification of cell location.

Definition at line 875 of file levelSetObject.cpp.

◆ destroyCellNarrowBandData()

void bitpit::LevelSetObject::destroyCellNarrowBandData ( )
protected

Destroy cell data inside the narrow band.

Definition at line 469 of file levelSetObject.cpp.

◆ destroyCellPropagatedSignCache()

void bitpit::LevelSetObject::destroyCellPropagatedSignCache ( )
protected

Destroy data related to sign propagation in the bulk.

Definition at line 1302 of file levelSetObject.cpp.

◆ destroyFieldCellCache()

void bitpit::LevelSetObject::destroyFieldCellCache ( LevelSetField field)
protectedvirtual

Unregister the specified field cache.

Parameters
fieldis the field for which the caches will be added

Definition at line 2866 of file levelSetObject.cpp.

◆ disableFieldCellCache()

void bitpit::LevelSetObject::disableFieldCellCache ( LevelSetField field)

Disable the cache for the specified specified field.

Parameters
fieldis the field for which cache will be disabled

Definition at line 2289 of file levelSetObject.cpp.

◆ dump()

void bitpit::LevelSetObject::dump ( std::ostream & stream)
protectedvirtual

Writes LevelSetObject to stream in binary format

Parameters
[in]streamoutput stream

Definition at line 1677 of file levelSetObject.cpp.

◆ empty()

virtual bool bitpit::LevelSetObject::empty ( ) const
pure virtual

◆ enableFieldCellCache()

void bitpit::LevelSetObject::enableFieldCellCache ( LevelSetField field,
LevelSetCacheMode cacheMode )

Enable the cache for the specified specified field.

If a cache with the same mode is already defined for the specified field, the function will exit without performing any action. If a cache with a different mode is already defined for the specified field, the existing cache will be destroyed and a new cache with the requested mode will be created from scratch.

Parameters
fieldis the field for which cache will be enabled
cacheModeis the cache mode that will be used for field

Definition at line 2251 of file levelSetObject.cpp.

◆ enableVTKOutput() [1/6]

void bitpit::LevelSetObject::enableVTKOutput ( const LevelSetFieldset & fieldset,
bool enable = true )

Enables or disables the VTK output

Parameters
[in]fieldsetis the fieldset that that should be enabled/disabled
[in]enabletrue for enabling, false for disabling
Examples
RBF_example_00001.cpp.

Definition at line 1836 of file levelSetObject.cpp.

◆ enableVTKOutput() [2/6]

void bitpit::LevelSetObject::enableVTKOutput ( const LevelSetFieldset & fieldset,
const std::string & objectName,
bool enable = true )

Enables or disables the VTK output The output will be enabled only if the object supports it.

Parameters
[in]fieldsetis the fieldset that that should be enabled/disabled
[in]objectNameis the name that will be associated with the object
[in]enabletrue for enabling, false for disabling

Definition at line 1852 of file levelSetObject.cpp.

◆ enableVTKOutput() [3/6]

void bitpit::LevelSetObject::enableVTKOutput ( LevelSetField field,
bool enable = true )

Enables or disables the VTK output

Parameters
[in]fieldis the field that that should be enabled/disabled
[in]enabletrue for enabling, false for disabling

Definition at line 1865 of file levelSetObject.cpp.

◆ enableVTKOutput() [4/6]

void bitpit::LevelSetObject::enableVTKOutput ( LevelSetField field,
const std::string & objectName,
bool enable = true )

Enables or disables the VTK output The output will be enabled only if the object supports it.

Parameters
[in]fieldis the field that that should be enabled/disabled
[in]objectNameis the name that will be associated with the object
[in]enabletrue for enabling, false for disabling

Definition at line 1881 of file levelSetObject.cpp.

◆ enableVTKOutput() [5/6]

void bitpit::LevelSetObject::enableVTKOutput ( LevelSetWriteField field,
bool enable = true )

Enables or disables the VTK output

Parameters
[in]fieldis the field that that should be enabled/disabled
[in]enabletrue for enabling, false for disabling

Definition at line 1910 of file levelSetObject.cpp.

◆ enableVTKOutput() [6/6]

void bitpit::LevelSetObject::enableVTKOutput ( LevelSetWriteField writeField,
const std::string & objectName,
bool enable = true )

Enables or disables the VTK output The output will be enabled only if the object supports it.

Parameters
[in]writeFieldis the write field that that should be enabled/disabled
[in]objectNameis the name that will be associated with the object
[in]enabletrue for enabling, false for disabling

Definition at line 1926 of file levelSetObject.cpp.

◆ evalCellCacheFillIds() [1/2]

std::vector< long > bitpit::LevelSetObject::evalCellCacheFillIds ( LevelSetZone zone,
LevelSetCacheMode cacheMode ) const
protected

Identify the cells that should be inserted in a cache operating in the specified mode.

Parameters
zoneis the zone for which the fillable cells are requested
cacheModeis the cache mode for which the fillable cells are requested
Returns
The ids of the cells that should be inserted in a cache operating in the specified mode.

Definition at line 2477 of file levelSetObject.cpp.

◆ evalCellCacheFillIds() [2/2]

std::vector< long > bitpit::LevelSetObject::evalCellCacheFillIds ( LevelSetZone zone,
LevelSetCacheMode cacheMode,
const std::vector< adaption::Info > & adaptionData ) const
protected

Identify the newly added cells that should be inserted after a mesh update in a cache operating in the specified mode.

Parameters
zoneis the zone for which the fillable cells are requested
cacheModeis the cache mode for which the fillable cells are requested
adaptionDataare the information about the mesh update
Returns
The ids of newly added cells that should be inserted after a mesh update in a cache operating in the specified mode.

Definition at line 2506 of file levelSetObject.cpp.

◆ evalCellCacheStaleIds()

std::vector< long > bitpit::LevelSetObject::evalCellCacheStaleIds ( const std::vector< adaption::Info > & adaptionData) const
protected

Identify the stale cell ids that should be removed from the cache after a mesh update.

Parameters
adaptionDataare the information about the mesh update
Returns
The stale cell ids that should be removed from the cache after a mesh update.

Definition at line 2778 of file levelSetObject.cpp.

◆ evalCellField()

template<typename value_t , typename evaluator_t , typename fallback_t >
value_t bitpit::LevelSetObject::evalCellField ( LevelSetField field,
long id,
const evaluator_t & evaluator,
const fallback_t & fallback ) const
protected

Evaluate the specified field for the given cell.

Parameters
[in]fieldis the field that should be evaluated
[in]idis the id of the cell where the field should be evaluated
[in]evaluatoris the function that should be used to evaluate the field when an exact value is requested
[in]fallbackis the function that should be used to evaluate the field when a dummy value is requested

Definition at line 267 of file levelSetObject.tpp.

◆ evalCellFieldCached()

template<typename value_t , typename evaluator_t , typename fallback_t >
value_t bitpit::LevelSetObject::evalCellFieldCached ( LevelSetField field,
long id,
const evaluator_t & evaluator,
const fallback_t & fallback ) const
protected

Evaluate the specified field for the given cell.

The value is first searched in the cache. If the cache doesn't contain an entry for the specified cell, the value is evaluated from scratch and the cache is updated.

Parameters
[in]fieldis the field that should be evaluated
[in]idis the id of the cell where the field should be evaluated
[in]evaluatoris the function that should be used to evaluate the field when an exact value is requested
[in]fallbackis the function that should be used to evaluate the field when a dummy value is requested

Definition at line 236 of file levelSetObject.tpp.

◆ evalCellFullCacheFillIds() [1/2]

std::vector< long > bitpit::LevelSetObject::evalCellFullCacheFillIds ( LevelSetZone zone) const
protected

Identify the cells that should be inserted in a cache operating in "full" mode.

Cache operating in "full" mode should contain all the cells inside the requested zone.

Parameters
zoneis the zone for which the fillable cells are requested
Returns
The ids of cells that should be inserted in a cache operating in "full" mode.

Definition at line 2674 of file levelSetObject.cpp.

◆ evalCellFullCacheFillIds() [2/2]

std::vector< long > bitpit::LevelSetObject::evalCellFullCacheFillIds ( LevelSetZone zone,
const std::vector< adaption::Info > & adaptionData ) const
protected

Identify the newly added cells that should be inserted after a mesh update in a cache operating in "full" mode.

Cache operating in "full" mode should contain all the cells inside the requested zone.

Parameters
zoneis the zone for which the fillable cells are requested
adaptionDataare the information about the mesh update
Returns
The ids of the cells that should be inserted after a mesh update in a cache operating in "full" mode.

Definition at line 2732 of file levelSetObject.cpp.

◆ evalCellGradient()

std::array< double, 3 > bitpit::LevelSetObject::evalCellGradient ( long id,
bool signedLevelSet ) const
virtual

Evaluate levelset gradient at the specified cell.

Parameters
[in]idcell id
[in]signedLevelSetcontrols if signed levelset function will be used
Returns
The gradient of the levelset at the specified cell.

Definition at line 1576 of file levelSetObject.cpp.

◆ evalCellNarrowBandCacheFillIds() [1/2]

std::vector< long > bitpit::LevelSetObject::evalCellNarrowBandCacheFillIds ( LevelSetZone zone) const
protected

Identify the cells that should be inserted in a cache operating in "narrow band" mode.

Cache operating in "narrow band" mode should contain the cells inside the narrow band.

Parameters
zoneis the zone for which the fillable cells are requested
Returns
The ids of cells that should be inserted in a cache operating in "narrow band" mode.

Definition at line 2568 of file levelSetObject.cpp.

◆ evalCellNarrowBandCacheFillIds() [2/2]

std::vector< long > bitpit::LevelSetObject::evalCellNarrowBandCacheFillIds ( LevelSetZone zone,
const std::vector< adaption::Info > & adaptionData ) const
protected

Identify the newly added cells that should be inserted after a mesh update in a cache operating in "narrow band" mode.

Cache operating in "narrow band" mode should contain the cells inside the narrow band.

Parameters
zoneis the zone for which the fillable cells are requested
adaptionDataare the information about the mesh update
Returns
The ids of the cells that should be inserted after a mesh update in a cache operating in "narrow band" mode.

Definition at line 2630 of file levelSetObject.cpp.

◆ evalCellOnDemandCacheFillIds() [1/2]

std::vector< long > bitpit::LevelSetObject::evalCellOnDemandCacheFillIds ( LevelSetZone zone) const
protected

Identify the cells that should be inserted in a cache operating in "on-demand" mode.

No cells should be automatically added to caches operating in "on-demand" mode.

Parameters
zoneis the zone for which the fillable cells are requested
Returns
The ids of cells that should be inserted in a cache operating in "on-demand" mode.

Definition at line 2534 of file levelSetObject.cpp.

◆ evalCellOnDemandCacheFillIds() [2/2]

std::vector< long > bitpit::LevelSetObject::evalCellOnDemandCacheFillIds ( LevelSetZone zone,
const std::vector< adaption::Info > & adaptionData ) const
protected

Identify the newly added cells that should be inserted after a mesh update in a cache operating in "on-demand" mode.

No cells should be automatically added to caches operating in "on-demand" mode.

Parameters
zoneis the zone for which the fillable cells are requested
adaptionDataare the information about the mesh update
Returns
The ids of the cells that should be inserted after a mesh update in a cache operating in "on-demand" mode.

Definition at line 2552 of file levelSetObject.cpp.

◆ evalCellProjectionPoint()

std::array< double, 3 > bitpit::LevelSetObject::evalCellProjectionPoint ( long id) const
virtual

Computes the projection point of the cell center, i.e. the closest point to the cell center on the zero level set

Parameters
[in]idcell id
Returns
the projection point

Definition at line 1612 of file levelSetObject.cpp.

◆ evalCellSign()

short bitpit::LevelSetObject::evalCellSign ( long id) const
virtual

Evaluate levelset sign at the specified cell.

Parameters
[in]idcell id
Returns
The sign of the levelset at the specified cell.

Definition at line 1481 of file levelSetObject.cpp.

◆ evalCellValue()

double bitpit::LevelSetObject::evalCellValue ( long id,
bool signedLevelSet ) const
virtual

Evaluate levelset value at the specified cell.

Parameters
[in]idcell id
[in]signedLevelSetcontrols if signed levelset function will be used
Returns
The value of the levelset at the specified cell.
Examples
RBF_example_00001.cpp.

Definition at line 1542 of file levelSetObject.cpp.

◆ evalGradient()

std::array< double, 3 > bitpit::LevelSetObject::evalGradient ( const std::array< double, 3 > & point,
bool signedLevelSet ) const
virtual

Evaluate levelset gradient at the specified point.

Parameters
pointare the coordinates of the point
[in]signedLevelSetcontrols if signed levelset function will be used
Returns
The gradient of the levelset at the specified point.

Definition at line 1641 of file levelSetObject.cpp.

◆ evalProjectionPoint()

std::array< double, 3 > bitpit::LevelSetObject::evalProjectionPoint ( const std::array< double, 3 > & point) const
virtual

Projects a vertex on the zero levelset

Parameters
[in]pointpoint coordinates
Returns
the projected point

Definition at line 1660 of file levelSetObject.cpp.

◆ evalSign()

short bitpit::LevelSetObject::evalSign ( const std::array< double, 3 > & point) const
virtual

Evaluate levelset sign at the specified point.

Parameters
pointare the coordinates of the point
Returns
The sign of the levelset at the specified point.

Definition at line 1621 of file levelSetObject.cpp.

◆ evaluate()

void bitpit::LevelSetObject::evaluate ( )
protected

Evaluate object data.

Definition at line 295 of file levelSetObject.cpp.

◆ evaluateCellBulkData()

void bitpit::LevelSetObject::evaluateCellBulkData ( )
protected

Evaluate cell data inside the bulk.

Definition at line 998 of file levelSetObject.cpp.

◆ evaluateCellNarrowBandData()

void bitpit::LevelSetObject::evaluateCellNarrowBandData ( )
protected

Evaluate cell data inside the narrow band.

Definition at line 444 of file levelSetObject.cpp.

◆ evalValue()

double bitpit::LevelSetObject::evalValue ( const std::array< double, 3 > & point,
bool signedLevelSet ) const
virtual

Evaluate levelset value at the specified point.

Parameters
pointare the coordinates of the point
[in]signedLevelSetcontrols if signed levelset function will be used
Returns
The value of the levelset at the specified point.

Definition at line 1631 of file levelSetObject.cpp.

◆ evalValueSign()

short bitpit::LevelSetObject::evalValueSign ( double value) const
protected

Evaluates the sign of the given levelset value.

Parameters
[in]valueis the levleset value
Returns
The sign of the given levelset value.

Definition at line 1669 of file levelSetObject.cpp.

◆ fillCellGeometricNarrowBandLocationCache()

LevelSetCellLocation bitpit::LevelSetObject::fillCellGeometricNarrowBandLocationCache ( long id)
protectedvirtual

Fill location cache for the specified cell if it is geometrically inside the narrow band

A cell is geometrically inside the narrow band if its distance from the surface is smaller than the narrow band side or if it intersects the surface.

This function may require the evaluation of some levelset fields. To improve performance, it is important to attempt filling the cache of the evaluated fields. It is then up to the caches to decide if the fields can be cached.

Parameters
[in]idis the cell id
Returns
The cell location of the cache or LevelSetCellLocation::UNKNOWN if the cell location was not identified.

Implemented in bitpit::LevelSetSegmentationObject.

Definition at line 826 of file levelSetObject.cpp.

◆ fillCellLocationCache() [1/2]

void bitpit::LevelSetObject::fillCellLocationCache ( )
protectedvirtual

Fill the cache that contains the location associated to the cells.

A cell can be either in the narrow band or in the bulk. It will be considered inside the narrow band if one of the following conditions holds:

  • its distance from the surface is less than the narrow band size;
  • it intersects the zero-levelset iso-surface (intersections are checked using the FAST_GUARANTEE_FALSE criterium);
  • one of its neighbors intersects the zero-levelset iso-surface.

Implemented in bitpit::LevelSetProxyObject< SourceLevelSetObject, BaseLevelSetObject >, bitpit::LevelSetProxyObject< LevelSetObject, LevelSetObject >, bitpit::LevelSetProxyObject< LevelSetSegmentationBaseObject, LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.

Definition at line 550 of file levelSetObject.cpp.

◆ fillCellLocationCache() [2/2]

void bitpit::LevelSetObject::fillCellLocationCache ( const std::vector< adaption::Info > & adaptionData)
protectedvirtual

Fill the cache that contains the location associated to the cells.

A cell can be either in the narrow band or in the bulk. It will be considered inside the narrow band if one of the following conditions holds:

  • its distance from the surface is less than the narrow band size;
  • it intersects the zero-levelset iso-surface (intersections are checked using the FAST_GUARANTEE_FALSE criterium);
  • one of its neighbors intersects the zero-levelset iso-surface.
Parameters
adaptionDataare the information about the mesh update

Implemented in bitpit::LevelSetProxyObject< SourceLevelSetObject, BaseLevelSetObject >, bitpit::LevelSetProxyObject< LevelSetObject, LevelSetObject >, bitpit::LevelSetProxyObject< LevelSetSegmentationBaseObject, LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.

Definition at line 655 of file levelSetObject.cpp.

◆ fillCellPropagatedSignCache()

void bitpit::LevelSetObject::fillCellPropagatedSignCache ( )
protectedvirtual

◆ fillFieldCellCache() [1/3]

void bitpit::LevelSetObject::fillFieldCellCache ( LevelSetField field,
const std::vector< long > & cellIds )
protected

Fill the cache values associated with the given cell ids for the specified field.

Parameters
fieldis the field whose cache will be filled
cellIdsare the ids of the cells whose values will be filled

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 3043 of file levelSetObject.cpp.

◆ fillFieldCellCache() [2/3]

void bitpit::LevelSetObject::fillFieldCellCache ( LevelSetField field,
long id )
protectedvirtual

Fill the specified field cache of the given cell.

Parameters
fieldis the field whose cache will be filled
idis the id of the cell whose cache will be filled

Implemented in bitpit::LevelSetSegmentationBaseObject, and bitpit::LevelSetSegmentationBaseObject.

Definition at line 3138 of file levelSetObject.cpp.

◆ fillFieldCellCache() [3/3]

template<typename value_t >
void bitpit::LevelSetObject::fillFieldCellCache ( LevelSetField field,
long id,
const value_t & value ) const
protected

Fill the cache value associated with the given cell ids for the specified field.

Depending on the cache mode and on the bulk evaluation mode the cached may not need to be filled for the specified cell. If the cache already contains a value for the specified cell, that value will be replaced with the given one.

Parameters
[in]fieldis the field that should be evaluated
[in]idis the id of the cell where the field should be evaluated
[in]valueis the value that will be added to the cell

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 302 of file levelSetObject.tpp.

◆ fillFieldCellCaches() [1/2]

void bitpit::LevelSetObject::fillFieldCellCaches ( LevelSetZone zone,
const std::vector< LevelSetField > & fields )
protected

Fill the cell caches of the specified fields.

Parameters
zoneis the zone where the cell caches will be filled
fieldsare the fields whose caches will be filled

Definition at line 2883 of file levelSetObject.cpp.

◆ fillFieldCellCaches() [2/2]

void bitpit::LevelSetObject::fillFieldCellCaches ( LevelSetZone zone,
const std::vector< LevelSetField > & fields,
const std::vector< adaption::Info > & adaptionData )
protected

Fill the cell caches of the specified fields after a mesh update.

Parameters
zoneis the zone where the cell caches will be filled
fieldsare the fields whose caches will be filled
adaptionDataare the information about the mesh update

Definition at line 2925 of file levelSetObject.cpp.

◆ flushData()

void bitpit::LevelSetObject::flushData ( std::fstream & stream,
const std::string & name,
VTKFormat format )
overridevirtual

Interface for writing data to the VTK stream.

Parameters
[in]streamoutput stream
[in]nameis the name of the data to be written. Either user data or patch data
[in]formatis the format which must be used. Supported options are "ascii" or "appended". For "appended" type an unformatted binary stream must be used

Implements bitpit::VTKBaseStreamer.

Definition at line 2071 of file levelSetObject.cpp.

◆ flushVTKOutputData() [1/2]

void bitpit::LevelSetObject::flushVTKOutputData ( std::fstream & stream,
VTKFormat format,
LevelSetField field ) const
protectedvirtual

Write the VTK data associated with the specified field to the given stream.

Only data currently stored in the cache will be written, no new field data will be evaluated by the function.

Parameters
[in]fieldis the field
[in]streamis the output stream
[in]formatis the format which must be used. Supported options are "ascii" or "appended". For "appended" type an unformatted binary stream must be used

Implemented in bitpit::LevelSetSegmentationBaseObject, and bitpit::LevelSetSegmentationBaseObject.

Definition at line 2095 of file levelSetObject.cpp.

◆ flushVTKOutputData() [2/2]

template<typename value_t , typename evaluator_t , typename fallback_t >
void bitpit::LevelSetObject::flushVTKOutputData ( std::fstream & stream,
VTKFormat format,
LevelSetField field,
const evaluator_t evaluator,
const fallback_t fallback ) const
protected

Write the VTK data associated with the specified field to the given stream.

Only data currently stored in the cache will be written, no new field data will be evaluated by the function.

Parameters
[in]streamis the output stream
[in]formatis the format which must be used. Supported options are "ascii" or "appended". For "appended" type an unformatted binary stream must be used
[in]fieldis the field
[in]evaluatoris the functor that should be used to evaluate the field
[in]fallbackis the functor that should be used to evaluate the field fallback value

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 164 of file levelSetObject.tpp.

◆ getCellBulkEvaluationMode()

LevelSetBulkEvaluationMode bitpit::LevelSetObject::getCellBulkEvaluationMode ( ) const

Get the mode that will be used to evaluate cell data in the bulk.

Returns
The mode that will be used to evaluate cell data in the bulk.

Definition at line 945 of file levelSetObject.cpp.

◆ getCellCache() [1/2]

template<typename value_t >
LevelSetObject::CellCacheCollection::ValueCache< value_t > * bitpit::LevelSetObject::getCellCache ( std::size_t cacheId) const
protected

Get a pointer to the specified cell cache.

If the specified cell cache was not registered, a null pointer is returned.

Parameters
cacheIdthe id of the cache that will be unregistered
Returns
A pointer to the specified cell cache or a null pointer if the cache was not registered.

Definition at line 61 of file levelSetObject.tpp.

◆ getCellCache() [2/2]

LevelSetObject::CellCacheCollection::Cache * bitpit::LevelSetObject::getCellCache ( std::size_t cacheId) const
protected

Get a pointer to the specified cell cache.

If specified cell cache was not registered or if an invalid cache id is specified, a null pointer is returned.

Parameters
cacheIdthe id of the cell that will be unregistered
Returns
A pointer to the specified cell cache.

Definition at line 3175 of file levelSetObject.cpp.

◆ getCellLocation()

LevelSetCellLocation bitpit::LevelSetObject::getCellLocation ( long id) const
protected

Get the location associated with the specified cell.

Parameters
[in]idis the cell id
Returns
The location associated with the specified cell.

Definition at line 483 of file levelSetObject.cpp.

◆ getCellZone()

LevelSetZone bitpit::LevelSetObject::getCellZone ( long id) const
protected

Get the zone of the specified cell.

Parameters
[in]idis the cell id
Returns
Return the zone of the specified cell.

Definition at line 517 of file levelSetObject.cpp.

◆ getFieldCellCache() [1/2]

template<typename value_t >
LevelSetObject::CellCacheCollection::ValueCache< value_t > * bitpit::LevelSetObject::getFieldCellCache ( LevelSetField field) const
protected

Get a pointer to the cell cache for the specified field.

If a cache was not enabled for the specified field, a null pointer is returned. If a cache was enabled for the field, but it was not yet created, it will be created now.

Parameters
fieldis the field for which the caches is requested
Returns
A pointer to the cell cache for the specified field.

Definition at line 40 of file levelSetObject.tpp.

◆ getFieldCellCache() [2/2]

LevelSetObject::CellCacheCollection::Cache * bitpit::LevelSetObject::getFieldCellCache ( LevelSetField field) const
protected

Get a pointer to the cell cache for the specified field.

If no cache was registered for the specified field, a null pointer is returned.

Parameters
fieldis the field whose cache will be retrieved
Returns
A pointer to the cell cache for the specified field.

Definition at line 2808 of file levelSetObject.cpp.

◆ getFieldCellCacheId()

std::size_t bitpit::LevelSetObject::getFieldCellCacheId ( LevelSetField field) const
protected

Get the id of the cache associated with the specified field.

Parameters
fieldis the specified field
Returns
The id of the cache associated with the specified field.

Definition at line 2827 of file levelSetObject.cpp.

◆ getFieldCellCacheMode()

LevelSetCacheMode bitpit::LevelSetObject::getFieldCellCacheMode ( LevelSetField field) const

Get the cache mode associated with the specified field.

Parameters
fieldis the specified field
Returns
The cache mode associated with the specified field.

Definition at line 2233 of file levelSetObject.cpp.

◆ getId()

int bitpit::LevelSetObject::getId ( ) const

Get the id of the object.

Returns
The id of the object.

Definition at line 279 of file levelSetObject.cpp.

◆ getKernel() [1/2]

LevelSetKernel * bitpit::LevelSetObject::getKernel ( )
protectedvirtual

Gets a pointer to the kernel of the object.

Returns
A pointer to the kernel of the object.

Definition at line 263 of file levelSetObject.cpp.

◆ getKernel() [2/2]

const LevelSetKernel * bitpit::LevelSetObject::getKernel ( ) const
virtual

Gets a constant pointer to the kernel of the object.

Returns
A constant pointer to the kernel of the object.

Definition at line 271 of file levelSetObject.cpp.

◆ getLevelSetInfo()

LevelSetInfo bitpit::LevelSetObject::getLevelSetInfo ( long cellId) const

Get LevelSetInfo of cell

Parameters
[in]cellIdcell idex
Returns
LevelSetInfo of cell

Definition at line 3262 of file levelSetObject.cpp.

◆ getLS()

double bitpit::LevelSetObject::getLS ( long cellId) const

Get the levelset value of cell

Parameters
[in]cellIdcell id
Returns
levelset value in cell

Definition at line 3273 of file levelSetObject.cpp.

◆ getNarrowBandSize()

double bitpit::LevelSetObject::getNarrowBandSize ( ) const

Get the physical size of the narrow band.

The size of the narrow band is the absolute distance from the zero-levelset iso surface below which a point is considered belonging to the narrow band. Setting the size of the narrow band to LEVELSET_NARROW_BAND_UNLIMITED means that the whole domain belongs to the narrow band. Regardless of the specified size, the narrow band will always contain the intersected cells and their neighbours.

Returns
The physical size of the narrow band.

Definition at line 384 of file levelSetObject.cpp.

◆ getReferenceCount()

std::size_t bitpit::LevelSetObject::getReferenceCount ( ) const

Count how many times the object is referenced by other objects.

Returns
The number of times the object is referenced by other objects.

Definition at line 221 of file levelSetObject.cpp.

◆ getSizeNarrowBand()

double bitpit::LevelSetObject::getSizeNarrowBand ( ) const

Get the current size of the narrow band. The function will always return an "infinite" distance.

Returns
size of the current narrow band

Definition at line 3284 of file levelSetObject.cpp.

◆ getSupportedFields()

LevelSetFieldset bitpit::LevelSetObject::getSupportedFields ( ) const
virtual

Get the list of supported field.

Returns
The list of supported field.

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 175 of file levelSetObject.cpp.

◆ getVTKOutputDataName()

std::string bitpit::LevelSetObject::getVTKOutputDataName ( LevelSetField field,
const std::string & objectName ) const
protected

Get the name that will be used by the VTK writer for the specifed data.

Parameters
[in]fieldis the field
[in]objectNameis the name that will be associated with the object
Returns
The name that will be used by the VTK writer for the specifed data.

Definition at line 2024 of file levelSetObject.cpp.

◆ getVTKOutputFieldName()

std::string bitpit::LevelSetObject::getVTKOutputFieldName ( LevelSetField field) const
protectedvirtual

Get the name that will be used by the VTK writer for the specifed field.

Parameters
[in]fieldis the field
Returns
The name that will be used by the VTK writer for the specifed field.

Implemented in bitpit::LevelSetSegmentationBaseObject.

Definition at line 2040 of file levelSetObject.cpp.

◆ hasVTKOutputData()

bool bitpit::LevelSetObject::hasVTKOutputData ( LevelSetField field,
const std::string & objectName ) const
protected

Check if the VTK writer has data associated with the specified field.

Parameters
[in]fieldis the field
[in]objectNameis the name that will be associated with the object
Returns
True if the VTK writer has data associated with the specified field, false otherwise.

Definition at line 1960 of file levelSetObject.cpp.

◆ intersectSurface()

LevelSetIntersectionStatus bitpit::LevelSetObject::intersectSurface ( long id,
LevelSetIntersectionMode mode = LevelSetIntersectionMode::FAST_FUZZY ) const

Function for checking if the specified cell intersects the zero-levelset iso-surface.

If mode==LevelSetIntersectionMode::FAST_FUZZY the method will compare the levelset value to tangent and bounding radius of a cell. If the value is smaller than the tangent radius LevelSetIntersectionStatus::TRUE is returned, if it is larger than the bounding radius LevelSetIntersectionStatus::FALSE is returned. If it is in-between LevelSetIntersectionStatus::CLOSE is returned.

If mode==LevelSetIntersectionMode::FAST_GUARANTEE_TRUE and the levelset value is smaller than the rangent radius LevelSetIntersectionStatus::TRUE is returned, otherwise LevelSetIntersectionStatus::FALSE.

If mode==LevelSetIntersectionMode::FAST_GURANTEE_FALSE and the levelset value is larger than the bounding radius LevelSetIntersectionStatus::FALSE is returned, otherwise LevelSetIntersectionStatus::TRUE.

If mode==LevelSetIntersectionMode::ACCURATE, the same checks of fuzzy mode are performed, however, in the cases where fuzzy mode would return CLOSE, an additional check on the intersection between the tangent plane at the projection point and the cell is performed. Errors of the method are related to the ratio of surface curvature over cell size.

The bounding sphere is the sphere with the minimum radius that contains all the cell vertices and has the center in the cell centroid.

The tangent sphere is a sphere having the center in the level centroid and tangent to the cell.

Parameters
[in]idcell id
[in]modedescribes the types of check that should be performed
Returns
indicator regarding intersection

Definition at line 1341 of file levelSetObject.cpp.

◆ isCellInNarrowBand()

bool bitpit::LevelSetObject::isCellInNarrowBand ( long id) const
virtual

Check if the specified cell lies inside the narrow band.

A cell is considered inside the narrow band if one of the following conditions hold:

  • its distance from the surface is less than the narrow band size;
  • it intersects the zero-levelset iso-surface (intersections are checked using the FAST_GUARANTEE_FALSE criterium);
  • one of its neighbors intersects the zero-levelset iso-surface.

If no caches with "narrow band" mode have been filled, the function may return wrong results if the cell is on the last layer of ghosts.

Parameters
[in]idis the cell id
Returns
Return true if the cell is in the narrow band, false otherwise.

Implemented in bitpit::LevelSetProxyObject< SourceLevelSetObject, BaseLevelSetObject >, bitpit::LevelSetProxyObject< LevelSetObject, LevelSetObject >, and bitpit::LevelSetProxyObject< LevelSetSegmentationBaseObject, LevelSetSegmentationBaseObject >.

Definition at line 896 of file levelSetObject.cpp.

◆ isInNarrowBand()

bool bitpit::LevelSetObject::isInNarrowBand ( const std::array< double, 3 > & point) const
virtual

Check if the specified point lies inside the narrow band.

The value of the levelset is evaluated and compared with the specified narrow band size.

If a point is inside a cell that belongs to the narrow band because it is a neighbour of a cell with a different levelset sign, its function may identify the point as outside the narrow band. That's because it will only compare the levelset of the point with the narrow band size. The extreme case is when the narrow band size is set to zero and being a neighbour of a cell with a different levelset sign is the only criterion to identify cells inside the narrow band. In this situation, this function will identify as inside the narrow band only the points that lie on the levelset-zero iso surface.

Parameters
pointare the coordinates of the point
Returns
Return true if the cell is in the narrow band, false otherwise.

Implemented in bitpit::LevelSetProxyObject< SourceLevelSetObject, BaseLevelSetObject >, bitpit::LevelSetProxyObject< LevelSetObject, LevelSetObject >, and bitpit::LevelSetProxyObject< LevelSetSegmentationBaseObject, LevelSetSegmentationBaseObject >.

Definition at line 919 of file levelSetObject.cpp.

◆ isPrimary()

bool bitpit::LevelSetObject::isPrimary ( ) const
virtual

Check if the levelset is a primary object (e.g. of a surface triangulation) or not (e.g. derived by boolean operations between two levelsets)

Returns
Returns true if object is a primary object, false otherwise.

Implemented in bitpit::LevelSetProxyObject< SourceLevelSetObject, BaseLevelSetObject >, bitpit::LevelSetProxyObject< LevelSetObject, LevelSetObject >, and bitpit::LevelSetProxyObject< LevelSetSegmentationBaseObject, LevelSetSegmentationBaseObject >.

Definition at line 288 of file levelSetObject.cpp.

◆ pruneCellCache()

void bitpit::LevelSetObject::pruneCellCache ( std::size_t cacheId,
const std::vector< long > & cellIds )
protected

Remove the values associated with the given cell ids from the specified cache.

Parameters
cacheIdis the id of the cache
cellIdsare the ids of the cells whose values will be removed from the cache

Definition at line 2451 of file levelSetObject.cpp.

◆ removeVTKOutputData()

void bitpit::LevelSetObject::removeVTKOutputData ( LevelSetField field,
const std::string & objectName )
protected

Remove the VTK data associated with the specified field.

Parameters
[in]fieldis the field
[in]objectNameis the name that will be associated with the object

Definition at line 1975 of file levelSetObject.cpp.

◆ restore()

void bitpit::LevelSetObject::restore ( std::istream & stream)
protectedvirtual

Reads LevelSetObject from stream in binary format

Parameters
[in]streamoutput stream

Definition at line 1741 of file levelSetObject.cpp.

◆ setCellBulkEvaluationMode()

void bitpit::LevelSetObject::setCellBulkEvaluationMode ( LevelSetBulkEvaluationMode evaluationMode)

Set the mode that will be used to evaluate cell data in the bulk.

Parameters
evaluationModeis the mode that will be used to evaluate cell data in the bulk.
Examples
RBF_example_00001.cpp.

Definition at line 955 of file levelSetObject.cpp.

◆ setDefaultLevelSetSigndness()

void bitpit::LevelSetObject::setDefaultLevelSetSigndness ( bool signedLevelSet)
protected

Set whether a signed or unsigned levelset is used when signdness is not explicitly specified. This function is only needed for guarantee backwards compatibility with older versions. In such versions, functions for evaluating levelset information were not taking in input the signdness.

Parameters
signedLevelSetcontrols if signed levelset function will be used

Definition at line 234 of file levelSetObject.cpp.

◆ setKernel()

void bitpit::LevelSetObject::setKernel ( LevelSetKernel * kernel)
protectedvirtual

Sets the kernel for the object.

Parameters
[in]kernelis the kernel that will be associated with the object

Definition at line 242 of file levelSetObject.cpp.

◆ setNarrowBandSize()

void bitpit::LevelSetObject::setNarrowBandSize ( double size)
protected

Set the physical size of the narrow band.

The size of the narrow band is the absolute distance from the zero-levelset iso surface below which a point is considered belonging to the narrow band. Setting the size of the narrow band to LEVELSET_NARROW_BAND_UNLIMITED means that the whole domain belongs to the narrow band. Regardless of the specified size, the narrow band will always contain the intersected cells and their neighbours.

Parameters
sizeis the physical size of the narrow band

Definition at line 400 of file levelSetObject.cpp.

◆ setSizeNarrowBand()

void bitpit::LevelSetObject::setSizeNarrowBand ( double r)
protected

Manually set the size of the narrow band. The function is a no-op.

Parameters
[in]rsize of the narrow band.

Definition at line 3293 of file levelSetObject.cpp.

◆ startCellCacheExchange()

void bitpit::LevelSetObject::startCellCacheExchange ( const std::unordered_map< int, std::vector< long > > & sendCellIds,
std::size_t cacheId,
DataCommunicator * dataCommunicator ) const
protected

Start data exchange for the specified cell cache.

Parameters
[in]sendCellIdsis the list of cell ids to send
[in]cacheIdis the id of the caches whose data will be exchanged
[in,out]dataCommunicatoris the data communicator that will be used for the data exchange

Definition at line 2139 of file levelSetObject.cpp.

◆ startCellCachesExchange()

void bitpit::LevelSetObject::startCellCachesExchange ( const std::unordered_map< int, std::vector< long > > & sendCellIds,
const std::vector< std::size_t > & cacheIds,
DataCommunicator * dataCommunicator ) const
protected

Start data exchange for the specified cell caches.

Parameters
[in]sendCellIdsis the list of cell ids to send
[in]cacheIdsare the ids of the caches whose data will be exchanged
[in,out]dataCommunicatoris the data communicator that will be used for the data exchange

Definition at line 2152 of file levelSetObject.cpp.

◆ update()

void bitpit::LevelSetObject::update ( const std::vector< adaption::Info > & adaptionData)

Updates object data after a mesh update.

Parameters
[in]adaptionDataare the information about the mesh update

Definition at line 337 of file levelSetObject.cpp.

◆ updateCellBulkData()

void bitpit::LevelSetObject::updateCellBulkData ( const std::vector< adaption::Info > & adaptionData)
protected

Update cell data inside the bulk.

Definition at line 1009 of file levelSetObject.cpp.

◆ updateCellNarrowBandData()

void bitpit::LevelSetObject::updateCellNarrowBandData ( const std::vector< adaption::Info > & adaptionData)
protected

Update cell data inside the narrow band after a mesh update.

Parameters
adaptionDataare the information about the mesh update

Definition at line 458 of file levelSetObject.cpp.

Friends And Related Symbol Documentation

◆ LevelSet

friend class LevelSet
friend

Definition at line 57 of file levelSetObject.hpp.

◆ LevelSetProxyObject

template<typename SourceLevelSetObject , typename BaseLevelSetObject >
friend class LevelSetProxyObject
friend

Definition at line 60 of file levelSetObject.hpp.

Member Data Documentation

◆ CELL_CACHE_IS_SIGNED

const bool bitpit::LevelSetObject::CELL_CACHE_IS_SIGNED = false
staticprotected

Controls if the cache stores signed values.

The implemented algorithms requires that the cache stores unsigned values.

Definition at line 131 of file levelSetObject.hpp.

◆ CELL_LOCATION_INTERSECTION_MODE

const LevelSetIntersectionMode bitpit::LevelSetObject::CELL_LOCATION_INTERSECTION_MODE = LevelSetIntersectionMode::FAST_GUARANTEE_FALSE
staticprotected

Intersection mode that should be used when detecting the location of a cell.

This intersection mode needs to be FAST_GUARANTEE_FALSE because we can accept cells tagged as intersecting the surface but actually not intersecting it, but we cannot accept cells tagged as not intersecting the surface but actually intersecting it. There are places where we make use of the fact that the identification of the location uses the FAST_GUARANTEE_FALSE mode (for example when checking if a cell intersects the zero-levelset iso-surface).

Definition at line 132 of file levelSetObject.hpp.

◆ m_cellLocationCacheId

std::size_t bitpit::LevelSetObject::m_cellLocationCacheId
protected

Id of the cache that will keep track if cell zones.

Definition at line 142 of file levelSetObject.hpp.

◆ m_cellPropagatedSignCacheId

std::size_t bitpit::LevelSetObject::m_cellPropagatedSignCacheId
protected

Id of the cache that will keep track if cell propagated sign.

Definition at line 143 of file levelSetObject.hpp.

◆ m_defaultSignedLevelSet

bool bitpit::LevelSetObject::m_defaultSignedLevelSet
protected

Definition at line 136 of file levelSetObject.hpp.

◆ m_enabledOutputFields

LevelSetFieldMap<std::string> bitpit::LevelSetObject::m_enabledOutputFields
protected

Definition at line 138 of file levelSetObject.hpp.

◆ m_kernel

LevelSetKernel* bitpit::LevelSetObject::m_kernel
protected

Levelset kernel

Definition at line 134 of file levelSetObject.hpp.

◆ m_narrowBandSize

double bitpit::LevelSetObject::m_narrowBandSize
protected

Size of narrow band.

Definition at line 140 of file levelSetObject.hpp.


The documentation for this interface was generated from the following files:
--- layout: doxygen_footer ---