MeshChecker is the class to evaluate the quality of a volume mesh. More...

#include <MeshChecker.hpp>

Inheritance diagram for mimmo::MeshChecker:
Collaboration diagram for mimmo::MeshChecker:

Public Types

enum  CMeshOutput {
  NOTRUN = -1, GOOD = 0, FACEVALIDITY = 1, VOLUMECHANGERATIO = 2,
  BOUNDARYSKEWNESS = 3, SKEWNESS = 4, MINIMUMVOLUME = 5, MAXIMUMVOLUME = 6
}
 
- Public Types inherited from mimmo::BaseManipulation
typedef std::unordered_map< BaseManipulation *, int > bmumap
 
typedef pin::ConnectionType ConnectionType
 
typedef std::string PortID
 

Public Member Functions

 MeshChecker ()
 
 MeshChecker (const bitpit::Config::Section &rootXML)
 
 MeshChecker (const MeshChecker &other)
 
virtual ~MeshChecker ()
 
virtual void absorbSectionXML (const bitpit::Config::Section &slotXML, std::string name="")
 
void buildPorts ()
 
void execute ()
 
virtual void flushSectionXML (bitpit::Config::Section &slotXML, std::string name="")
 
CMeshOutput getQualityStatus ()
 
int getQualityStatusInt ()
 
bool isGood ()
 
MeshCheckeroperator= (MeshChecker other)
 
void plotOptionalResults ()
 
void setGeometry (MimmoSharedPointer< MimmoObject > obj)
 
void setMaximumBoundarySkewnessTolerance (double tol)
 
void setMaximumSkewnessTolerance (double tol)
 
void setMaximumVolumeTolerance (double tol)
 
void setMinimumFaceValidityTolerance (double tol)
 
void setMinimumVolumeChangeTolerance (double tol)
 
void setMinimumVolumeTolerance (double tol)
 
void setPrintResumeFile (bool flag)
 
- Public Member Functions inherited from mimmo::BaseManipulation
 BaseManipulation ()
 
 BaseManipulation (const BaseManipulation &other)
 
virtual ~BaseManipulation ()
 
void activate ()
 
bool arePortsBuilt ()
 
void clear ()
 
void disable ()
 
void exec ()
 
BaseManipulationgetChild (int i=0)
 
ConnectionType getConnectionType ()
 
MimmoSharedPointer< MimmoObjectgetGeometry ()
 
MimmoSharedPointer< MimmoObject > & getGeometryReference ()
 
int getId ()
 
bitpit::Logger & getLog ()
 
std::string getName ()
 
int getNChild ()
 
int getNParent ()
 
int getNPortsIn ()
 
int getNPortsOut ()
 
BaseManipulationgetParent (int i=0)
 
std::unordered_map< PortID, PortIn * > getPortsIn ()
 
std::unordered_map< PortID, PortOut * > getPortsOut ()
 
uint getPriority ()
 
virtual std::vector< BaseManipulation * > getSubBlocksEmbedded ()
 
bool isActive ()
 
bool isApply ()
 
bool isChild (BaseManipulation *, int &)
 
bool isParent (BaseManipulation *, int &)
 
bool isPlotInExecution ()
 
BaseManipulationoperator= (const BaseManipulation &other)
 
void removePins ()
 
void removePinsIn ()
 
void removePinsOut ()
 
void setApply (bool flag=true)
 
void setGeometry (MimmoSharedPointer< MimmoObject > geometry)
 
void setId (int)
 
void setLog (bitpit::Logger &log)
 
void setName (std::string name)
 
void setOutputPlot (std::string path)
 
void setPlotInExecution (bool)
 
void setPriority (uint priority)
 
void unsetGeometry ()
 

Protected Member Functions

bool checkFaceValidity ()
 
CMeshOutput checkMeshQuality ()
 
bool checkSkewness ()
 
bool checkVolume ()
 
void clear ()
 
void initializeVolumes ()
 
void printResumeFile ()
 
void setDefault ()
 
void swap (MeshChecker &x) noexcept
 
- Protected Member Functions inherited from mimmo::BaseManipulation
void _apply (MimmoPiercedVector< darray3E > &displacements)
 
void addChild (BaseManipulation *child)
 
void addParent (BaseManipulation *parent)
 
void addPinIn (BaseManipulation *objIn, PortID portR)
 
void addPinOut (BaseManipulation *objOut, PortID portS, PortID portR)
 
virtual void apply ()
 
void cleanBufferIn (PortID port)
 
template<typename T , typename O >
bool createPortIn (O *obj, void(O::*setVar_)(T), PortID portR, bool mandatory=false, int family=0)
 
template<typename T , typename O >
bool createPortIn (T *var_, PortID portR, bool mandatory=false, int family=0)
 
template<typename T , typename O >
bool createPortOut (O *obj, T(O::*getVar_)(), PortID portS)
 
template<typename T , typename O >
bool createPortOut (T *var_, PortID portS)
 
void deletePorts ()
 
PortID findPinIn (PortIn &pin)
 
PortID findPinOut (PortOut &pin)
 
void initializeLogger (bool logexists)
 
void readBufferIn (PortID port)
 
void removePinIn (BaseManipulation *objIn, PortID portR)
 
void removePinIn (PortID portR, int j)
 
void removePinOut (BaseManipulation *objOut, PortID portS)
 
void removePinOut (PortID portS, int j)
 
void setBufferIn (PortID port, mimmo::IBinaryStream &input)
 
void swap (BaseManipulation &x) noexcept
 
void unsetChild (BaseManipulation *child)
 
void unsetParent (BaseManipulation *parent)
 
void write (MimmoSharedPointer< MimmoObject > geometry)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, MimmoPiercedVector< mpv_t > &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, MimmoPiercedVector< mpv_t > &data, Args ... args)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t > * > &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t > * > &data, Args ... args)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t >> &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t >> &data, Args ... args)
 

Protected Attributes

std::unique_ptr< MimmoObjectm_facevalidity
 
bool m_isGood
 
double m_maxFaceValidity
 
double m_maxSkewness
 
double m_maxSkewnessBoundary
 
double m_maxSkewnessBoundaryTol
 
double m_maxSkewnessTol
 
double m_maxVolume
 
double m_maxVolumeTol
 
double m_minFaceValidity
 
double m_minFaceValidityTol
 
double m_minVolume
 
double m_minVolumeChange
 
double m_minVolumeChangeTol
 
double m_minVolumeTol
 
bool m_printResumeFile
 
CMeshOutput m_qualityStatus
 
std::unique_ptr< MimmoObjectm_skewness
 
std::unique_ptr< MimmoObjectm_volume
 
std::unique_ptr< MimmoObjectm_volumechange
 
MimmoPiercedVector< double > m_volumes
 
- Protected Attributes inherited from mimmo::BaseManipulation
bool m_active
 
bool m_apply
 
bool m_arePortsBuilt
 
bmumap m_child
 
int m_counter
 
bool m_execPlot
 
MimmoSharedPointer< MimmoObjectm_geometry
 
bitpit::Logger * m_log
 
std::string m_name
 
std::string m_outputPlot
 
bmumap m_parent
 
std::unordered_map< PortID, PortIn * > m_portIn
 
std::unordered_map< PortID, PortOut * > m_portOut
 
ConnectionType m_portsType
 
uint m_priority
 

Additional Inherited Members

- Static Protected Attributes inherited from mimmo::BaseManipulation
static int sm_baseManipulationCounter
 

Detailed Description

MeshChecker is the class to evaluate the quality of a volume mesh.

The available quality indices computed are :

  • minimum and maximum cell volume
  • maximum skweness angle inside the mesh and at boundaries
  • minimum and maximum face validity
  • minimum volume change ratio

It writes a resume of the quality mesh check directly on the mimmo::Logger. Optional results writes sick elements on file vtu.


Ports available in MeshChecker Class :


Port Input
PortType variable/function DataType
M_GEOM setGeometry (MC_SCALAR, MD_MIMMO_)
Port Output
PortType variable/function DataType
M_VALUEB isGood (MC_SCALAR, MD_BOOL)
M_VALUEI getQualityStatusInt (MC_SCALAR, MD_INT)


The xml available parameters, sections and subsections are the following :

Inherited from BaseManipulation/MimmoFvMesh:

  • ClassName: name of the class as mimmo.MeshChecker;
  • Priority: uint marking priority in multi-chain execution;

Proper of the class:

  • MinVolTOL: tolerance for minimum volume allowable.
  • MaxVolTOL: tolerance for maximum volume allowable.
  • MaxSkewTOL: tolerance for maximum skewness allowable.
  • MaxBoundarySkewTOL: tolerance for maximum skewness on boundary allowable.
  • MinFaceValidityTOL: tolerance for maximum skewness on boundary allowable.
  • MinVolChangeTOL: tolerance for maximum skewness on boundary allowable.
  • ResumeFile: boolean 1-print Resume on file, 0-do nothing.

Geometry has to be mandatorily passed by port.

Examples
iocgns_example_00002.cpp.

Definition at line 87 of file MeshChecker.hpp.

Constructor & Destructor Documentation

◆ MeshChecker() [1/3]

mimmo::MeshChecker::MeshChecker ( )

Constructor

Definition at line 33 of file MeshChecker.cpp.

◆ MeshChecker() [2/3]

mimmo::MeshChecker::MeshChecker ( const bitpit::Config::Section &  rootXML)

Custom constructor reading xml data

Parameters
[in]rootXMLreference to your xml tree section

Definition at line 43 of file MeshChecker.cpp.

◆ ~MeshChecker()

mimmo::MeshChecker::~MeshChecker ( )
virtual

Destructor

Definition at line 61 of file MeshChecker.cpp.

◆ MeshChecker() [3/3]

mimmo::MeshChecker::MeshChecker ( const MeshChecker other)

Copy Constructor. Result displacements are never copied.

Parameters
[in]otherMeshChecker where copy from

Definition at line 66 of file MeshChecker.cpp.

Member Function Documentation

◆ absorbSectionXML()

void mimmo::MeshChecker::absorbSectionXML ( const bitpit::Config::Section &  slotXML,
std::string  name = "" 
)
virtual

It sets infos reading from a XML bitpit::Config::section.

Parameters
[in]slotXMLbitpit::Config::Section of XML file
[in]namename associated to the slot

Reimplemented from mimmo::BaseManipulation.

Definition at line 723 of file MeshChecker.cpp.

◆ buildPorts()

void mimmo::MeshChecker::buildPorts ( )
virtual

It builds the input/output ports of the object

Implements mimmo::BaseManipulation.

Definition at line 175 of file MeshChecker.cpp.

◆ checkFaceValidity()

bool mimmo::MeshChecker::checkFaceValidity ( )
protected

It check the face validity of the cells of the mesh

Returns
false if face validity tolerance is not satisfied

Definition at line 563 of file MeshChecker.cpp.

◆ checkMeshQuality()

MeshChecker::CMeshOutput mimmo::MeshChecker::checkMeshQuality ( )
protected

It check the quality of the mesh

Returns
error flag. If mesh is good return 0. Otherwise the error with highest priority. See enum CMeshOutput for errors and their priority.

Definition at line 291 of file MeshChecker.cpp.

◆ checkSkewness()

bool mimmo::MeshChecker::checkSkewness ( )
protected

It check the quality of the skewness of the cells of the mesh

Returns
false if skewness or boundary skewness tolerance is not satisfied

Definition at line 478 of file MeshChecker.cpp.

◆ checkVolume()

bool mimmo::MeshChecker::checkVolume ( )
protected

It check the quality of the volume cells of the mesh

Returns
false if one of the volumes tolerance is not satisfied

Definition at line 391 of file MeshChecker.cpp.

◆ clear()

void mimmo::MeshChecker::clear ( )
protected

Clear auxiliary variables

Definition at line 663 of file MeshChecker.cpp.

◆ execute()

void mimmo::MeshChecker::execute ( )
virtual

Set Default Value

Implements mimmo::BaseManipulation.

Definition at line 147 of file MeshChecker.cpp.

◆ flushSectionXML()

void mimmo::MeshChecker::flushSectionXML ( bitpit::Config::Section &  slotXML,
std::string  name = "" 
)
virtual

It sets infos from class members in a XML bitpit::Config::section.

Parameters
[in]slotXMLbitpit::Config::Section of XML file
[in]namename associated to the slot

Reimplemented from mimmo::BaseManipulation.

Definition at line 813 of file MeshChecker.cpp.

◆ getQualityStatus()

MeshChecker::CMeshOutput mimmo::MeshChecker::getQualityStatus ( )
Returns
quality flag (see class doc)

Definition at line 272 of file MeshChecker.cpp.

◆ getQualityStatusInt()

int mimmo::MeshChecker::getQualityStatusInt ( )
Returns
quality flag (see class doc)

Definition at line 281 of file MeshChecker.cpp.

◆ initializeVolumes()

void mimmo::MeshChecker::initializeVolumes ( )
protected

Initialize cells volumes

Definition at line 650 of file MeshChecker.cpp.

◆ isGood()

bool mimmo::MeshChecker::isGood ( )
Returns
true is quality is good

Definition at line 263 of file MeshChecker.cpp.

◆ operator=()

MeshChecker & mimmo::MeshChecker::operator= ( MeshChecker  other)

Assignement operator. Result displacements are never copied.

Definition at line 88 of file MeshChecker.cpp.

◆ plotOptionalResults()

void mimmo::MeshChecker::plotOptionalResults ( )
virtual

Plot mesh with failed check fields

Reimplemented from mimmo::BaseManipulation.

Definition at line 671 of file MeshChecker.cpp.

◆ printResumeFile()

void mimmo::MeshChecker::printResumeFile ( )
protected

Print resume file, of performing mesh check

Definition at line 859 of file MeshChecker.cpp.

◆ setDefault()

void mimmo::MeshChecker::setDefault ( )
protected

Set Default Value

Definition at line 122 of file MeshChecker.cpp.

◆ setGeometry()

void mimmo::MeshChecker::setGeometry ( MimmoSharedPointer< MimmoObject geo)

Overload BaseManipulation setGeometry

Parameters
[in]geotarget geometry

Definition at line 187 of file MeshChecker.cpp.

◆ setMaximumBoundarySkewnessTolerance()

void mimmo::MeshChecker::setMaximumBoundarySkewnessTolerance ( double  tol)

Set the tolerance in degrees

Examples
iocgns_example_00002.cpp.

Definition at line 226 of file MeshChecker.cpp.

◆ setMaximumSkewnessTolerance()

void mimmo::MeshChecker::setMaximumSkewnessTolerance ( double  tol)

Set the tolerance in degrees

Examples
iocgns_example_00002.cpp.

Definition at line 217 of file MeshChecker.cpp.

◆ setMaximumVolumeTolerance()

void mimmo::MeshChecker::setMaximumVolumeTolerance ( double  tol)

Set the tolerance

Examples
iocgns_example_00002.cpp.

Definition at line 208 of file MeshChecker.cpp.

◆ setMinimumFaceValidityTolerance()

void mimmo::MeshChecker::setMinimumFaceValidityTolerance ( double  tol)

Set the tolerance

Examples
iocgns_example_00002.cpp.

Definition at line 235 of file MeshChecker.cpp.

◆ setMinimumVolumeChangeTolerance()

void mimmo::MeshChecker::setMinimumVolumeChangeTolerance ( double  tol)

Set the tolerance

Examples
iocgns_example_00002.cpp.

Definition at line 244 of file MeshChecker.cpp.

◆ setMinimumVolumeTolerance()

void mimmo::MeshChecker::setMinimumVolumeTolerance ( double  tol)

Set the tolerance

Examples
iocgns_example_00002.cpp.

Definition at line 199 of file MeshChecker.cpp.

◆ setPrintResumeFile()

void mimmo::MeshChecker::setPrintResumeFile ( bool  flag)

set true to print resume file

Definition at line 253 of file MeshChecker.cpp.

◆ swap()

void mimmo::MeshChecker::swap ( MeshChecker x)
protectednoexcept

Swap function.

Parameters
[in]xobject to be swapped

Definition at line 98 of file MeshChecker.cpp.

Member Data Documentation

◆ m_facevalidity

std::unique_ptr<MimmoObject> mimmo::MeshChecker::m_facevalidity
protected

INTERNAL USE Cells with poor face validity.

Definition at line 175 of file MeshChecker.hpp.

◆ m_isGood

bool mimmo::MeshChecker::m_isGood
protected

true is good, false there are some errors

Definition at line 165 of file MeshChecker.hpp.

◆ m_maxFaceValidity

double mimmo::MeshChecker::m_maxFaceValidity
protected

maxFaceValidity variable

Definition at line 154 of file MeshChecker.hpp.

◆ m_maxSkewness

double mimmo::MeshChecker::m_maxSkewness
protected

maxSkewness variable

Definition at line 151 of file MeshChecker.hpp.

◆ m_maxSkewnessBoundary

double mimmo::MeshChecker::m_maxSkewnessBoundary
protected

maxSkewness on Boundary variable

Definition at line 152 of file MeshChecker.hpp.

◆ m_maxSkewnessBoundaryTol

double mimmo::MeshChecker::m_maxSkewnessBoundaryTol
protected

check tolerance for maxSkewness on Boundary variable

Definition at line 161 of file MeshChecker.hpp.

◆ m_maxSkewnessTol

double mimmo::MeshChecker::m_maxSkewnessTol
protected

check tolerance for maxSkewness variable

Definition at line 160 of file MeshChecker.hpp.

◆ m_maxVolume

double mimmo::MeshChecker::m_maxVolume
protected

maxVolume variable

Definition at line 150 of file MeshChecker.hpp.

◆ m_maxVolumeTol

double mimmo::MeshChecker::m_maxVolumeTol
protected

check tolerance for maxVolume variable

Definition at line 159 of file MeshChecker.hpp.

◆ m_minFaceValidity

double mimmo::MeshChecker::m_minFaceValidity
protected

minFaceValidity variable

Definition at line 153 of file MeshChecker.hpp.

◆ m_minFaceValidityTol

double mimmo::MeshChecker::m_minFaceValidityTol
protected

check tolerance for minFaceValidity variable

Definition at line 162 of file MeshChecker.hpp.

◆ m_minVolume

double mimmo::MeshChecker::m_minVolume
protected

minVolume variable

Definition at line 149 of file MeshChecker.hpp.

◆ m_minVolumeChange

double mimmo::MeshChecker::m_minVolumeChange
protected

minVolumeChange variable

Definition at line 155 of file MeshChecker.hpp.

◆ m_minVolumeChangeTol

double mimmo::MeshChecker::m_minVolumeChangeTol
protected

check tolerance for minVolumeChange variable

Definition at line 163 of file MeshChecker.hpp.

◆ m_minVolumeTol

double mimmo::MeshChecker::m_minVolumeTol
protected

check tolerance for minVolume variable

Definition at line 158 of file MeshChecker.hpp.

◆ m_printResumeFile

bool mimmo::MeshChecker::m_printResumeFile
protected

true, print a resume file after checking

Definition at line 178 of file MeshChecker.hpp.

◆ m_qualityStatus

CMeshOutput mimmo::MeshChecker::m_qualityStatus
protected

Quality check flag of the mesh related to tolerance exceeded (first error encountered with this order): -1, not computed; 0, mesh good with input tolerances; 1, minimum face validity too low; 2, volume change error; 3, skewness on boundary error; 4, skewness error; 5, minimum volume error; 6, max volume error.

Definition at line 166 of file MeshChecker.hpp.

◆ m_skewness

std::unique_ptr<MimmoObject> mimmo::MeshChecker::m_skewness
protected

INTERNAL USE Cells with poor skewness.

Definition at line 174 of file MeshChecker.hpp.

◆ m_volume

std::unique_ptr<MimmoObject> mimmo::MeshChecker::m_volume
protected

INTERNAL USE Cells with poor volume.

Definition at line 173 of file MeshChecker.hpp.

◆ m_volumechange

std::unique_ptr<MimmoObject> mimmo::MeshChecker::m_volumechange
protected

INTERNAL USE Cells with poor volume change ratio.

Definition at line 176 of file MeshChecker.hpp.

◆ m_volumes

MimmoPiercedVector<double> mimmo::MeshChecker::m_volumes
protected

Cell volumes.

Definition at line 171 of file MeshChecker.hpp.


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