Interface class for all objects with respect to whom the levelset function may be computed. More...
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 LevelSetObject * | clone () 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 LevelSetKernel * | getKernel () 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::Cache * | getCellCache (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::Cache * | getFieldCellCache (LevelSetField field) const |
std::size_t | getFieldCellCacheId (LevelSetField field) const |
virtual LevelSetKernel * | getKernel () |
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 |
LevelSetKernel * | m_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 |
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:
Definition at line 55 of file levelSetObject.hpp.
Definition at line 63 of file levelSetObject.hpp.
|
protected |
Definition at line 129 of file levelSetObject.hpp.
|
virtual |
Destructor.
Definition at line 151 of file levelSetObject.cpp.
|
protected |
Constructor
[in] | id | id assigned to object |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 84 of file levelSetObject.cpp.
|
protected |
Copy constructor
[in] | other | is another object whose content is copied in this object |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 102 of file levelSetObject.cpp.
|
protected |
Move constructor
[in] | other | is another object whose content is moved in this object |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 126 of file levelSetObject.cpp.
|
protectedpure virtual |
Implemented in bitpit::LevelSetBooleanBaseObject< LevelSetObject >, bitpit::LevelSetBooleanBaseObject< LevelSetSegmentationBaseObject >, bitpit::LevelSetComplementBaseObject< LevelSetObject >, bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.
|
protectedpure virtual |
Implemented in bitpit::LevelSetBooleanBaseObject< LevelSetObject >, bitpit::LevelSetBooleanBaseObject< LevelSetSegmentationBaseObject >, bitpit::LevelSetComplementBaseObject< LevelSetObject >, bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.
|
protectedpure virtual |
Implemented in bitpit::LevelSetBooleanBaseObject< LevelSetObject >, bitpit::LevelSetBooleanBaseObject< LevelSetSegmentationBaseObject >, bitpit::LevelSetComplementBaseObject< LevelSetObject >, bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.
|
protectedpure virtual |
Implemented in bitpit::LevelSetBooleanBaseObject< LevelSetObject >, bitpit::LevelSetBooleanBaseObject< LevelSetSegmentationBaseObject >, bitpit::LevelSetComplementBaseObject< LevelSetObject >, bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.
|
protectedvirtual |
Evaluate levelset sign at the specified point.
point | are the coordinates of the point |
Implemented in bitpit::LevelSetComplementBaseObject< LevelSetObject >, bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.
Definition at line 1651 of file levelSetObject.cpp.
|
protectedpure virtual |
Implemented in bitpit::LevelSetBooleanBaseObject< LevelSetObject >, bitpit::LevelSetBooleanBaseObject< LevelSetSegmentationBaseObject >, bitpit::LevelSetComplementBaseObject< LevelSetObject >, bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.
|
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.
[in] | id | cell id |
[in] | distance | is the unsigned distance of the cell centroid from the zero-levelset iso-surface |
[in] | mode | describes the types of check that should be performed |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 1402 of file levelSetObject.cpp.
|
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.
adaptionData | are the information about the mesh update |
Definition at line 2312 of file levelSetObject.cpp.
|
protectedvirtual |
Add the VTK data associated with the specified field.
[in] | field | is the field |
[in] | objectName | is the name that will be associated with the object |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 1990 of file levelSetObject.cpp.
|
protected |
Clear the specified cell cache.
cacheId | is the id of the cached that will be cleared |
release | if 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.
|
pure virtual |
|
protected |
Complete exchange of cell cache data.
[in] | recvCellIds | is the list of cell ids to receive |
[in] | cacheId | is the id of the cache whose data will be exchanged |
[in,out] | dataCommunicator | is the data communicator that will be used for the data exchange |
Definition at line 2190 of file levelSetObject.cpp.
|
protected |
Complete exchange of cell cache data.
[in] | recvCellIds | is the list of cell ids to receive |
[in] | cacheId | is the id of the cache whose data will be exchanged |
[in,out] | dataCommunicator | is the data communicator that will be used for the data exchange |
Definition at line 2203 of file levelSetObject.cpp.
std::array< double, 3 > bitpit::LevelSetObject::computeProjectionPoint | ( | const std::array< double, 3 > & | point | ) | const |
Projects a vertex on the zero levelset
[in] | point | point coordinates |
Definition at line 3220 of file levelSetObject.cpp.
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
[in] | cellId | cell id |
Definition at line 3200 of file levelSetObject.cpp.
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
[in] | vertexId | vertex id |
Definition at line 3210 of file levelSetObject.cpp.
|
protected |
Create the cache that will be used for storing cell information of the specified field.
expectedFillIn | is the expected fill-in of the cache |
cacheId | is the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically |
Definition at line 112 of file levelSetObject.tpp.
|
protectedvirtual |
Create the cache that will be used for storing cell location information.
cacheId | is the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically |
Definition at line 865 of file levelSetObject.cpp.
|
protectedvirtual |
Create the cache that will be used for storing cell propagated sign.
cacheId | is the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically |
Definition at line 1292 of file levelSetObject.cpp.
|
protectedvirtual |
Create the cache that will be used for storing cell information of the specified field.
field | is the field for which the caches will be added |
cacheId | is the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically |
Implemented in bitpit::LevelSetSegmentationBaseObject, bitpit::LevelSetSegmentationBaseObject, and bitpit::LevelSetSegmentationBaseObject.
Definition at line 2842 of file levelSetObject.cpp.
|
protected |
Create the cache that will be used for storing cell information of the specified field.
field | is the field for which the caches will be added |
cacheId | is the id that will be associated with the cache, if a NULL_ID is specified the cache id will be assigned automatically |
Implemented in bitpit::LevelSetSegmentationBaseObject, bitpit::LevelSetSegmentationBaseObject, and bitpit::LevelSetSegmentationBaseObject.
Definition at line 79 of file levelSetObject.tpp.
|
protected |
Destroy cell data in the bulk.
Definition at line 1021 of file levelSetObject.cpp.
|
protected |
Destroy the specified cache.
cacheId | the id of the cell that will be unregistered |
Definition at line 3189 of file levelSetObject.cpp.
|
protected |
Destroy identification of cell location.
Definition at line 875 of file levelSetObject.cpp.
|
protected |
Destroy cell data inside the narrow band.
Definition at line 469 of file levelSetObject.cpp.
|
protected |
Destroy data related to sign propagation in the bulk.
Definition at line 1302 of file levelSetObject.cpp.
|
protectedvirtual |
Unregister the specified field cache.
field | is the field for which the caches will be added |
Definition at line 2866 of file levelSetObject.cpp.
void bitpit::LevelSetObject::disableFieldCellCache | ( | LevelSetField | field | ) |
Disable the cache for the specified specified field.
field | is the field for which cache will be disabled |
Definition at line 2289 of file levelSetObject.cpp.
|
protectedvirtual |
Writes LevelSetObject to stream in binary format
[in] | stream | output stream |
Definition at line 1677 of file levelSetObject.cpp.
|
pure virtual |
Implemented in bitpit::LevelSetBooleanBaseObject< LevelSetObject >, bitpit::LevelSetBooleanBaseObject< LevelSetSegmentationBaseObject >, bitpit::LevelSetComplementBaseObject< LevelSetObject >, bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >, and bitpit::LevelSetSegmentationObject.
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.
field | is the field for which cache will be enabled |
cacheMode | is the cache mode that will be used for field |
Definition at line 2251 of file levelSetObject.cpp.
void bitpit::LevelSetObject::enableVTKOutput | ( | const LevelSetFieldset & | fieldset, |
bool | enable = true ) |
Enables or disables the VTK output
[in] | fieldset | is the fieldset that that should be enabled/disabled |
[in] | enable | true for enabling, false for disabling |
Definition at line 1836 of file levelSetObject.cpp.
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.
[in] | fieldset | is the fieldset that that should be enabled/disabled |
[in] | objectName | is the name that will be associated with the object |
[in] | enable | true for enabling, false for disabling |
Definition at line 1852 of file levelSetObject.cpp.
void bitpit::LevelSetObject::enableVTKOutput | ( | LevelSetField | field, |
bool | enable = true ) |
Enables or disables the VTK output
[in] | field | is the field that that should be enabled/disabled |
[in] | enable | true for enabling, false for disabling |
Definition at line 1865 of file levelSetObject.cpp.
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.
[in] | field | is the field that that should be enabled/disabled |
[in] | objectName | is the name that will be associated with the object |
[in] | enable | true for enabling, false for disabling |
Definition at line 1881 of file levelSetObject.cpp.
void bitpit::LevelSetObject::enableVTKOutput | ( | LevelSetWriteField | field, |
bool | enable = true ) |
Enables or disables the VTK output
[in] | field | is the field that that should be enabled/disabled |
[in] | enable | true for enabling, false for disabling |
Definition at line 1910 of file levelSetObject.cpp.
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.
[in] | writeField | is the write field that that should be enabled/disabled |
[in] | objectName | is the name that will be associated with the object |
[in] | enable | true for enabling, false for disabling |
Definition at line 1926 of file levelSetObject.cpp.
|
protected |
Identify the cells that should be inserted in a cache operating in the specified mode.
zone | is the zone for which the fillable cells are requested |
cacheMode | is the cache mode for which the fillable cells are requested |
Definition at line 2477 of file levelSetObject.cpp.
|
protected |
Identify the newly added cells that should be inserted after a mesh update in a cache operating in the specified mode.
zone | is the zone for which the fillable cells are requested |
cacheMode | is the cache mode for which the fillable cells are requested |
adaptionData | are the information about the mesh update |
Definition at line 2506 of file levelSetObject.cpp.
|
protected |
Identify the stale cell ids that should be removed from the cache after a mesh update.
adaptionData | are the information about the mesh update |
Definition at line 2778 of file levelSetObject.cpp.
|
protected |
Evaluate the specified field for the given cell.
[in] | field | is the field that should be evaluated |
[in] | id | is the id of the cell where the field should be evaluated |
[in] | evaluator | is the function that should be used to evaluate the field when an exact value is requested |
[in] | fallback | is the function that should be used to evaluate the field when a dummy value is requested |
Definition at line 267 of file levelSetObject.tpp.
|
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.
[in] | field | is the field that should be evaluated |
[in] | id | is the id of the cell where the field should be evaluated |
[in] | evaluator | is the function that should be used to evaluate the field when an exact value is requested |
[in] | fallback | is the function that should be used to evaluate the field when a dummy value is requested |
Definition at line 236 of file levelSetObject.tpp.
|
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.
zone | is the zone for which the fillable cells are requested |
Definition at line 2674 of file levelSetObject.cpp.
|
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.
zone | is the zone for which the fillable cells are requested |
adaptionData | are the information about the mesh update |
Definition at line 2732 of file levelSetObject.cpp.
|
virtual |
Evaluate levelset gradient at the specified cell.
[in] | id | cell id |
[in] | signedLevelSet | controls if signed levelset function will be used |
Definition at line 1576 of file levelSetObject.cpp.
|
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.
zone | is the zone for which the fillable cells are requested |
Definition at line 2568 of file levelSetObject.cpp.
|
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.
zone | is the zone for which the fillable cells are requested |
adaptionData | are the information about the mesh update |
Definition at line 2630 of file levelSetObject.cpp.
|
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.
zone | is the zone for which the fillable cells are requested |
Definition at line 2534 of file levelSetObject.cpp.
|
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.
zone | is the zone for which the fillable cells are requested |
adaptionData | are the information about the mesh update |
Definition at line 2552 of file levelSetObject.cpp.
|
virtual |
Computes the projection point of the cell center, i.e. the closest point to the cell center on the zero level set
[in] | id | cell id |
Definition at line 1612 of file levelSetObject.cpp.
|
virtual |
Evaluate levelset sign at the specified cell.
[in] | id | cell id |
Definition at line 1481 of file levelSetObject.cpp.
|
virtual |
Evaluate levelset value at the specified cell.
[in] | id | cell id |
[in] | signedLevelSet | controls if signed levelset function will be used |
Definition at line 1542 of file levelSetObject.cpp.
|
virtual |
Evaluate levelset gradient at the specified point.
point | are the coordinates of the point | |
[in] | signedLevelSet | controls if signed levelset function will be used |
Definition at line 1641 of file levelSetObject.cpp.
|
virtual |
Projects a vertex on the zero levelset
[in] | point | point coordinates |
Definition at line 1660 of file levelSetObject.cpp.
|
virtual |
Evaluate levelset sign at the specified point.
point | are the coordinates of the point |
Definition at line 1621 of file levelSetObject.cpp.
|
protected |
Evaluate object data.
Definition at line 295 of file levelSetObject.cpp.
|
protected |
Evaluate cell data inside the bulk.
Definition at line 998 of file levelSetObject.cpp.
|
protected |
Evaluate cell data inside the narrow band.
Definition at line 444 of file levelSetObject.cpp.
|
virtual |
Evaluate levelset value at the specified point.
point | are the coordinates of the point | |
[in] | signedLevelSet | controls if signed levelset function will be used |
Definition at line 1631 of file levelSetObject.cpp.
|
protected |
Evaluates the sign of the given levelset value.
[in] | value | is the levleset value |
Definition at line 1669 of file levelSetObject.cpp.
|
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.
[in] | id | is the cell id |
Implemented in bitpit::LevelSetSegmentationObject.
Definition at line 826 of file levelSetObject.cpp.
|
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:
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.
|
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:
adaptionData | are 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.
|
protectedvirtual |
Fill the cache that contains the propagated cell sign.
Implemented in bitpit::LevelSetBooleanBaseObject< LevelSetObject >, bitpit::LevelSetBooleanBaseObject< LevelSetSegmentationBaseObject >, bitpit::LevelSetComplementBaseObject< LevelSetObject >, and bitpit::LevelSetComplementBaseObject< LevelSetSegmentationBaseObject >.
Definition at line 1031 of file levelSetObject.cpp.
|
protected |
Fill the cache values associated with the given cell ids for the specified field.
field | is the field whose cache will be filled |
cellIds | are the ids of the cells whose values will be filled |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 3043 of file levelSetObject.cpp.
|
protectedvirtual |
Fill the specified field cache of the given cell.
field | is the field whose cache will be filled |
id | is 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.
|
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.
[in] | field | is the field that should be evaluated |
[in] | id | is the id of the cell where the field should be evaluated |
[in] | value | is the value that will be added to the cell |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 302 of file levelSetObject.tpp.
|
protected |
Fill the cell caches of the specified fields.
zone | is the zone where the cell caches will be filled |
fields | are the fields whose caches will be filled |
Definition at line 2883 of file levelSetObject.cpp.
|
protected |
Fill the cell caches of the specified fields after a mesh update.
zone | is the zone where the cell caches will be filled |
fields | are the fields whose caches will be filled |
adaptionData | are the information about the mesh update |
Definition at line 2925 of file levelSetObject.cpp.
|
overridevirtual |
Interface for writing data to the VTK stream.
[in] | stream | output stream |
[in] | name | is the name of the data to be written. Either user data or patch data |
[in] | format | is 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.
|
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.
[in] | field | is the field |
[in] | stream | is the output stream |
[in] | format | is 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.
|
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.
[in] | stream | is the output stream |
[in] | format | is the format which must be used. Supported options are "ascii" or "appended". For "appended" type an unformatted binary stream must be used |
[in] | field | is the field |
[in] | evaluator | is the functor that should be used to evaluate the field |
[in] | fallback | is the functor that should be used to evaluate the field fallback value |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 164 of file levelSetObject.tpp.
LevelSetBulkEvaluationMode bitpit::LevelSetObject::getCellBulkEvaluationMode | ( | ) | const |
Get the mode that will be used to evaluate cell data in the bulk.
Definition at line 945 of file levelSetObject.cpp.
|
protected |
Get a pointer to the specified cell cache.
If the specified cell cache was not registered, a null pointer is returned.
cacheId | the id of the cache that will be unregistered |
Definition at line 61 of file levelSetObject.tpp.
|
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.
cacheId | the id of the cell that will be unregistered |
Definition at line 3175 of file levelSetObject.cpp.
|
protected |
Get the location associated with the specified cell.
[in] | id | is the cell id |
Definition at line 483 of file levelSetObject.cpp.
|
protected |
Get the zone of the specified cell.
[in] | id | is the cell id |
Definition at line 517 of file levelSetObject.cpp.
|
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.
field | is the field for which the caches is requested |
Definition at line 40 of file levelSetObject.tpp.
|
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.
field | is the field whose cache will be retrieved |
Definition at line 2808 of file levelSetObject.cpp.
|
protected |
Get the id of the cache associated with the specified field.
field | is the specified field |
Definition at line 2827 of file levelSetObject.cpp.
LevelSetCacheMode bitpit::LevelSetObject::getFieldCellCacheMode | ( | LevelSetField | field | ) | const |
Get the cache mode associated with the specified field.
field | is the specified field |
Definition at line 2233 of file levelSetObject.cpp.
int bitpit::LevelSetObject::getId | ( | ) | const |
Get the id of the object.
Definition at line 279 of file levelSetObject.cpp.
|
protectedvirtual |
Gets a pointer to the kernel of the object.
Definition at line 263 of file levelSetObject.cpp.
|
virtual |
Gets a constant pointer to the kernel of the object.
Definition at line 271 of file levelSetObject.cpp.
LevelSetInfo bitpit::LevelSetObject::getLevelSetInfo | ( | long | cellId | ) | const |
Get LevelSetInfo of cell
[in] | cellId | cell idex |
Definition at line 3262 of file levelSetObject.cpp.
double bitpit::LevelSetObject::getLS | ( | long | cellId | ) | const |
Get the levelset value of cell
[in] | cellId | cell id |
Definition at line 3273 of file levelSetObject.cpp.
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.
Definition at line 384 of file levelSetObject.cpp.
std::size_t bitpit::LevelSetObject::getReferenceCount | ( | ) | const |
Count how many times the object is referenced by other objects.
Definition at line 221 of file levelSetObject.cpp.
double bitpit::LevelSetObject::getSizeNarrowBand | ( | ) | const |
Get the current size of the narrow band. The function will always return an "infinite" distance.
Definition at line 3284 of file levelSetObject.cpp.
|
virtual |
Get the list of supported field.
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 175 of file levelSetObject.cpp.
|
protected |
Get the name that will be used by the VTK writer for the specifed data.
[in] | field | is the field |
[in] | objectName | is the name that will be associated with the object |
Definition at line 2024 of file levelSetObject.cpp.
|
protectedvirtual |
Get the name that will be used by the VTK writer for the specifed field.
[in] | field | is the field |
Implemented in bitpit::LevelSetSegmentationBaseObject.
Definition at line 2040 of file levelSetObject.cpp.
|
protected |
Check if the VTK writer has data associated with the specified field.
[in] | field | is the field |
[in] | objectName | is the name that will be associated with the object |
Definition at line 1960 of file levelSetObject.cpp.
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.
[in] | id | cell id |
[in] | mode | describes the types of check that should be performed |
Definition at line 1341 of file levelSetObject.cpp.
|
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:
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.
[in] | id | is the cell id |
Implemented in bitpit::LevelSetProxyObject< SourceLevelSetObject, BaseLevelSetObject >, bitpit::LevelSetProxyObject< LevelSetObject, LevelSetObject >, and bitpit::LevelSetProxyObject< LevelSetSegmentationBaseObject, LevelSetSegmentationBaseObject >.
Definition at line 896 of file levelSetObject.cpp.
|
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.
point | are the coordinates of the point |
Implemented in bitpit::LevelSetProxyObject< SourceLevelSetObject, BaseLevelSetObject >, bitpit::LevelSetProxyObject< LevelSetObject, LevelSetObject >, and bitpit::LevelSetProxyObject< LevelSetSegmentationBaseObject, LevelSetSegmentationBaseObject >.
Definition at line 919 of file levelSetObject.cpp.
|
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)
Implemented in bitpit::LevelSetProxyObject< SourceLevelSetObject, BaseLevelSetObject >, bitpit::LevelSetProxyObject< LevelSetObject, LevelSetObject >, and bitpit::LevelSetProxyObject< LevelSetSegmentationBaseObject, LevelSetSegmentationBaseObject >.
Definition at line 288 of file levelSetObject.cpp.
|
protected |
Remove the values associated with the given cell ids from the specified cache.
cacheId | is the id of the cache |
cellIds | are the ids of the cells whose values will be removed from the cache |
Definition at line 2451 of file levelSetObject.cpp.
|
protected |
Remove the VTK data associated with the specified field.
[in] | field | is the field |
[in] | objectName | is the name that will be associated with the object |
Definition at line 1975 of file levelSetObject.cpp.
|
protectedvirtual |
Reads LevelSetObject from stream in binary format
[in] | stream | output stream |
Definition at line 1741 of file levelSetObject.cpp.
void bitpit::LevelSetObject::setCellBulkEvaluationMode | ( | LevelSetBulkEvaluationMode | evaluationMode | ) |
Set the mode that will be used to evaluate cell data in the bulk.
evaluationMode | is the mode that will be used to evaluate cell data in the bulk. |
Definition at line 955 of file levelSetObject.cpp.
|
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.
signedLevelSet | controls if signed levelset function will be used |
Definition at line 234 of file levelSetObject.cpp.
|
protectedvirtual |
Sets the kernel for the object.
[in] | kernel | is the kernel that will be associated with the object |
Definition at line 242 of file levelSetObject.cpp.
|
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.
size | is the physical size of the narrow band |
Definition at line 400 of file levelSetObject.cpp.
|
protected |
Manually set the size of the narrow band. The function is a no-op.
[in] | r | size of the narrow band. |
Definition at line 3293 of file levelSetObject.cpp.
|
protected |
Start data exchange for the specified cell cache.
[in] | sendCellIds | is the list of cell ids to send |
[in] | cacheId | is the id of the caches whose data will be exchanged |
[in,out] | dataCommunicator | is the data communicator that will be used for the data exchange |
Definition at line 2139 of file levelSetObject.cpp.
|
protected |
Start data exchange for the specified cell caches.
[in] | sendCellIds | is the list of cell ids to send |
[in] | cacheIds | are the ids of the caches whose data will be exchanged |
[in,out] | dataCommunicator | is the data communicator that will be used for the data exchange |
Definition at line 2152 of file levelSetObject.cpp.
void bitpit::LevelSetObject::update | ( | const std::vector< adaption::Info > & | adaptionData | ) |
Updates object data after a mesh update.
[in] | adaptionData | are the information about the mesh update |
Definition at line 337 of file levelSetObject.cpp.
|
protected |
Update cell data inside the bulk.
Definition at line 1009 of file levelSetObject.cpp.
|
protected |
Update cell data inside the narrow band after a mesh update.
adaptionData | are the information about the mesh update |
Definition at line 458 of file levelSetObject.cpp.
|
friend |
Definition at line 57 of file levelSetObject.hpp.
|
friend |
Definition at line 60 of file levelSetObject.hpp.
|
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.
|
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.
|
protected |
Id of the cache that will keep track if cell zones.
Definition at line 142 of file levelSetObject.hpp.
|
protected |
Id of the cache that will keep track if cell propagated sign.
Definition at line 143 of file levelSetObject.hpp.
|
protected |
Definition at line 136 of file levelSetObject.hpp.
|
protected |
Definition at line 138 of file levelSetObject.hpp.
|
protected |
Levelset kernel
Definition at line 134 of file levelSetObject.hpp.
|
protected |
Size of narrow band.
Definition at line 140 of file levelSetObject.hpp.