ViennaLS
Loading...
Searching...
No Matches
viennals::CompareVolume< T, D > Class Template Reference

Computes an estimate of the volume/area where two level sets differ. The volume is calculated by iterating through the bounding box of the two level sets and comparing the cell values. The grid delta is used as the unit of volume. Custom increment values can be set for specific x, y and z ranges, allowing to count certain areas multiple times or skip them. Optionally, a passed mesh can be filled with the volume information, allowing for visualization of the differences. The code is intended for 2D and 3D level sets. More...

#include <lsCompareVolume.hpp>

Public Member Functions

 CompareVolume ()
 CompareVolume (SmartPointer< Domain< T, D > > passedLevelSetTarget, SmartPointer< Domain< T, D > > passedLevelSetSample)
void setLevelSetTarget (SmartPointer< Domain< T, D > > passedLevelSet)
 Sets the target level set.
void setLevelSetSample (SmartPointer< Domain< T, D > > passedLevelSet)
 Sets the sample level set.
void setDefaultIncrement (unsigned short int increment)
 Set default increment value.
void setXRangeAndIncrement (hrleIndexType minXRange, hrleIndexType maxXRange, unsigned short int Xincrement)
 Sets the x-range and custom increment value.
void setYRangeAndIncrement (hrleIndexType minYRange, hrleIndexType maxYRange, unsigned short int Yincrement)
 Sets the y-range and custom increment value.
void setZRangeAndIncrement (hrleIndexType minZRange, hrleIndexType maxZRange, unsigned short int Zincrement)
 Sets the z-range and custom increment value.
void setOutputMesh (SmartPointer< Mesh< T > > passedMesh)
 Set the output mesh where difference areas will be stored for visualization. Each cell in the mesh will have a cell data: 0: Areas where both level sets are inside 1: Areas where only one level set is inside (mismatched areas).
double getVolumeMismatch () const
 Returns the computed volume/area mismatch.
double getAreaMismatch () const
 Alias for getVolumeMismatch for 2D compatibility.
double getCustomVolumeMismatch () const
 Returns the computed volume/area mismatch, with custom increments applied.
double getCustomAreaMismatch () const
 Alias for getCustomVolumeMismatch for 2D compatibility.
unsigned long int getCellCount () const
 Returns the number of cells where the level sets differ.
unsigned long int getCustomCellCount () const
 Returns the number of cells where the level sets differ, with custom increments applied.
void apply ()
 Computes the volume/area difference between the two level sets.

Detailed Description

template<class T, int D = 3>
class viennals::CompareVolume< T, D >

Computes an estimate of the volume/area where two level sets differ. The volume is calculated by iterating through the bounding box of the two level sets and comparing the cell values. The grid delta is used as the unit of volume. Custom increment values can be set for specific x, y and z ranges, allowing to count certain areas multiple times or skip them. Optionally, a passed mesh can be filled with the volume information, allowing for visualization of the differences. The code is intended for 2D and 3D level sets.

Constructor & Destructor Documentation

◆ CompareVolume() [1/2]

template<class T, int D = 3>
viennals::CompareVolume< T, D >::CompareVolume ( )
inline

◆ CompareVolume() [2/2]

template<class T, int D = 3>
viennals::CompareVolume< T, D >::CompareVolume ( SmartPointer< Domain< T, D > > passedLevelSetTarget,
SmartPointer< Domain< T, D > > passedLevelSetSample )
inline

Member Function Documentation

◆ apply()

template<class T, int D = 3>
void viennals::CompareVolume< T, D >::apply ( )
inline

Computes the volume/area difference between the two level sets.

◆ getAreaMismatch()

template<class T, int D = 3>
double viennals::CompareVolume< T, D >::getAreaMismatch ( ) const
inline

Alias for getVolumeMismatch for 2D compatibility.

◆ getCellCount()

template<class T, int D = 3>
unsigned long int viennals::CompareVolume< T, D >::getCellCount ( ) const
inline

Returns the number of cells where the level sets differ.

◆ getCustomAreaMismatch()

template<class T, int D = 3>
double viennals::CompareVolume< T, D >::getCustomAreaMismatch ( ) const
inline

Alias for getCustomVolumeMismatch for 2D compatibility.

◆ getCustomCellCount()

template<class T, int D = 3>
unsigned long int viennals::CompareVolume< T, D >::getCustomCellCount ( ) const
inline

Returns the number of cells where the level sets differ, with custom increments applied.

◆ getCustomVolumeMismatch()

template<class T, int D = 3>
double viennals::CompareVolume< T, D >::getCustomVolumeMismatch ( ) const
inline

Returns the computed volume/area mismatch, with custom increments applied.

◆ getVolumeMismatch()

template<class T, int D = 3>
double viennals::CompareVolume< T, D >::getVolumeMismatch ( ) const
inline

Returns the computed volume/area mismatch.

◆ setDefaultIncrement()

template<class T, int D = 3>
void viennals::CompareVolume< T, D >::setDefaultIncrement ( unsigned short int increment)
inline

Set default increment value.

◆ setLevelSetSample()

template<class T, int D = 3>
void viennals::CompareVolume< T, D >::setLevelSetSample ( SmartPointer< Domain< T, D > > passedLevelSet)
inline

Sets the sample level set.

◆ setLevelSetTarget()

template<class T, int D = 3>
void viennals::CompareVolume< T, D >::setLevelSetTarget ( SmartPointer< Domain< T, D > > passedLevelSet)
inline

Sets the target level set.

◆ setOutputMesh()

template<class T, int D = 3>
void viennals::CompareVolume< T, D >::setOutputMesh ( SmartPointer< Mesh< T > > passedMesh)
inline

Set the output mesh where difference areas will be stored for visualization. Each cell in the mesh will have a cell data: 0: Areas where both level sets are inside 1: Areas where only one level set is inside (mismatched areas).

◆ setXRangeAndIncrement()

template<class T, int D = 3>
void viennals::CompareVolume< T, D >::setXRangeAndIncrement ( hrleIndexType minXRange,
hrleIndexType maxXRange,
unsigned short int Xincrement )
inline

Sets the x-range and custom increment value.

◆ setYRangeAndIncrement()

template<class T, int D = 3>
void viennals::CompareVolume< T, D >::setYRangeAndIncrement ( hrleIndexType minYRange,
hrleIndexType maxYRange,
unsigned short int Yincrement )
inline

Sets the y-range and custom increment value.

◆ setZRangeAndIncrement()

template<class T, int D = 3>
void viennals::CompareVolume< T, D >::setZRangeAndIncrement ( hrleIndexType minZRange,
hrleIndexType maxZRange,
unsigned short int Zincrement )
inline

Sets the z-range and custom increment value.


The documentation for this class was generated from the following file: