GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmTriSurfaceDiscontinuity Class Reference

Surface 3D representation for a discontinuity. More...

#include <gmTriSurfaceDiscontinuity.h>

Inheritance diagram for GmTriSurfaceDiscontinuity:
Collaboration diagram for GmTriSurfaceDiscontinuity:

Public Types

enum class  CellIntersectionType {
  COMPLETE , PARTIAL , EXTENDED , AMBIGUOUS ,
  EMPTY
}
 
using EdgeId = QPair<int, signed char>
 
using CellIntersection = QVector<EdgeId>
 
using BoolMat = QVector<QVector<bool>>
 

Public Member Functions

const char * ciTypeToStr (const CellIntersectionType t) const
 
virtual ~GmTriSurfaceDiscontinuity ()
 Destructor.
 
virtual int numElements () const
 A generic interface to return the original discontinuity data number of geometric elements. For 2d meshes it will be either the number of polyline segments or the number of edges. For 3d meshes, the number of triangles or the number of faces.
 
virtual int numIntersections () const
 A generic interface to return the number of intersections between the mesh and the user given geometry. Is the number of line segments or faces (triangles an/or quads) in the intersection set.
 
virtual bool extendGeometry (GmCellMesh *sMesh, double size, const GmLogCategory &logger)
 
virtual int numPoints () const
 Returns the number of surface points.
 
const double * pointCoordinates () const
 Returns the surface coordinates vector, organized as x1, y1, z1, x2, y2, z2, .... Size equal to numPoints() * 3.
 
int numTriangles () const
 Returns the number of surface triangles.
 
int numOriginalTriangles () const
 
const int * triangleIncidences () const
 Returns the incidence vector, organized as p11, p12, p13, p21, p22, p23, .... Size equal to numTriangles() * 3.
 
const QHash< int, CellIntersection > & intersectionEdgeList () const
 
const QHash< int, CellIntersectionType > & intersectionTypeList () const
 
const QVector< bool > & validIntersectionPointList () const
 
const QSet< int > & extendedCellSet () const
 
const QVector< RayIntersection > & intersectionPointList () const
 
virtual void clearGeometry ()
 Clears the original discontinuity geometry information, releasing memory.
 
virtual void printGeometry (const GmLogCategory &logger, GmLogLevel level) const
 Prints the discontinuity geometry information.
 
virtual size_t usedGeometryMemory () const
 Returns an estimative of the memory used by the discontinuity geometry in bytes.
 
virtual size_t usedIntersectionMemory () const
 Returns an estimative of the memory used by the intersection data in bytes.
 
virtual bool findIntersections (const GmLogCategory &logger)
 Builds the element intersection list for this discontinuity.
 
virtual void printIntersections (const GmLogCategory &logger, GmLogLevel level) const
 Prints the discontinuity-mesh intersection information.
 
const BoolMatgetOrBuildEEMatrix (const GmCellType type)
 
const BoolMatgetOrBuildFEMatrix (const GmCellType type)
 
- Public Member Functions inherited from GmDiscontinuity
virtual ~GmDiscontinuity ()
 Virtuald destructor.
 
int index () const
 Returns this discontinuity index in the father set.
 
QString id () const
 Returns the discontinuity id (name)
 
int cellGroupIndex () const
 Returns the cell group index associated with this discontinuity, if any. This is the index of the group in the list returned by GmCellMesh::cellGroupIds() Returns -1 for an unspecified cell group.
 
void setCellGroupIndex (int group)
 
virtual int propertyIndex (int propertySet) const
 Given a property set number, returns the line of the property set that contains property values for this discontinuity. The returned value can be used to get a property from a property accessor retrieved from the discontinuity set.
 

Private Member Functions

 GmTriSurfaceDiscontinuity (const GmDiscontinuitySet *ds, int index, QString id, int groupIndex, const QVector< int > &psIndex)
 Constructor.
 
virtual void setGeometry (double *dvec, int nd, int *ivec, int ni)
 Sets the geometry. dvec should be a vector with coordinates (size nd * 3), nd the number of coordinates. ivec should be the triangle incidence list (size ni * 3), ni the number of triangles. No calculation should be done here!
 
virtual bool loadGeometryFromTable (LuaTable &tab, const GmLogCategory &logger)
 
int markAmbiguousEdges ()
 
CellIntersectionType reorderIntersections (CellIntersection &ci, const GmCellType type, bool removeInvalid=true)
 For each cellIntersection[i] reorder its edges indexes to form a polygon with the intersection points. Return cellIntersection type after reorder.
 
CellIntersection correctOrientation (CellIntersection &ci)
 
QVector< EdgeIdpopEdgesOnFace (QVector< EdgeId > &edges, const QVector< bool > &FELine)
 
BoolMat buildEEMatrix (const QVector< QVector< int > > &faceEdge, int nedges)
 
BoolMat buildFEMatrix (const QVector< QVector< int > > &edgeFace, int nface)
 
bool checkConsistency ()
 
void clearIntersections ()
 
void DebugCell (int cellId, GmMatrix &points, CellIntersection &ci)
 
void DebugSurface ()
 
bool checkCoherence ()
 

Private Attributes

int _numPoints
 The number of points in the surface.
 
int _numTriangles
 The number of triangles in the surface.
 
double * _pointCoord
 The coordinate vector. Size == _numPoints * 3.
 
int * _triList
 The list with triangle incidences. Size == _numTriangles * 3.
 
int _originalNumTriangles
 
QHash< int, CellIntersection_cellIntersection
 
QHash< int, CellIntersectionType > _cellIntersectionType
 
QSet< int > _extendedCell
 
QVector< RayIntersection_intPoint
 
QVector< bool > _validIntPoint
 
QSet< int > _ambiguousCells
 
int _invalidCellCount
 
int _validCellCount
 
QHash< GmCellType, BoolMat_accelEE
 
QHash< GmCellType, BoolMat_accelFE
 
QHash< GmCellType, QVector< QVector< signed char > > > _accelNN
 

Friends

class GmDiscontinuitySet
 
class GmDiscontinuitySetStateDumpItem
 
QDataStreamoperator<< (QDataStream &stream, const GmDiscontinuitySet &ds)
 
QDataStreamoperator>> (QDataStream &stream, GmDiscontinuitySet &ds)
 

Additional Inherited Members

- Protected Member Functions inherited from GmDiscontinuity
 GmDiscontinuity (const GmDiscontinuitySet *ds, int index, QString id, int groupIndex, const QVector< int > &psIndex)
 Private constructor. Discontinuities are only created by the DiscontinuitySet.
 
- Static Protected Member Functions inherited from GmDiscontinuity
template<class T , class V >
static T * loadIntoVector (LuaTable &tab, V validator, int n, int *realSize, QString discontinuityId, const char *msg, const GmLogCategory &logger)
 Allocate a vector of type T with at most tab.size() * n elements and reads the tab contents into it. Expects that tab is a vector with sub-tables storing n elements. Each loaded element is passed as a variant to the validator function, that should return the converted value to T. The validator should also fill a status variable that says if the value is ok (>=0), ignored (-1) or invalid(-2). Invalid values raise an error and causes loadIntoVector() to log a message and return NULL. Ignored values are simply not added to the result vector (which will be resized accordingly) and are targeted into ignoring cells that don't belong to the current mesh partition. Returns the real size of the vector in the realSize output parameter.
 
- Protected Attributes inherited from GmDiscontinuity
const GmDiscontinuitySet_ds
 Our "father" discontinuity set.
 
int _index
 The discontinuity index in its "father" discontinuity set.
 
QString _id
 The discontinuity id.
 
int _groupIndex
 The index in the mesh for the associated cell group or -1 if there is none.
 
QVector< int > _psIndex
 The property set line index for this discontinuity. One entry per associated property set.
 

Detailed Description

Surface 3D representation for a discontinuity.

Member Function Documentation

◆ clearGeometry()

void GmTriSurfaceDiscontinuity::clearGeometry ( )
virtual

Clears the original discontinuity geometry information, releasing memory.

Implements GmDiscontinuity.

◆ extendGeometry()

bool GmTriSurfaceDiscontinuity::extendGeometry ( GmCellMesh * sMesh,
double size,
const GmLogCategory & logger )
virtual

\breif A generic interface for extending the original geometry by size units. The 'sMesh' is a empty mesh that supports addition of elements and topological consults.

Implements GmDiscontinuity.

◆ findIntersections()

bool GmTriSurfaceDiscontinuity::findIntersections ( const GmLogCategory & logger)
virtual

Builds the element intersection list for this discontinuity.

Reimplemented from GmDiscontinuity.

◆ loadGeometryFromTable()

bool GmTriSurfaceDiscontinuity::loadGeometryFromTable ( LuaTable & tab,
const GmLogCategory & logger )
privatevirtual

Implements GmDiscontinuity.

◆ numElements()

virtual int GmTriSurfaceDiscontinuity::numElements ( ) const
inlinevirtual

A generic interface to return the original discontinuity data number of geometric elements. For 2d meshes it will be either the number of polyline segments or the number of edges. For 3d meshes, the number of triangles or the number of faces.

Implements GmDiscontinuity.

◆ numIntersections()

virtual int GmTriSurfaceDiscontinuity::numIntersections ( ) const
inlinevirtual

A generic interface to return the number of intersections between the mesh and the user given geometry. Is the number of line segments or faces (triangles an/or quads) in the intersection set.

Implements GmDiscontinuity.

◆ numPoints()

virtual int GmTriSurfaceDiscontinuity::numPoints ( ) const
inlinevirtual

Returns the number of surface points.

Implements GmDiscontinuity.

◆ printGeometry()

void GmTriSurfaceDiscontinuity::printGeometry ( const GmLogCategory & logger,
GmLogLevel level ) const
virtual

Prints the discontinuity geometry information.

Implements GmDiscontinuity.

◆ printIntersections()

void GmTriSurfaceDiscontinuity::printIntersections ( const GmLogCategory & logger,
GmLogLevel level ) const
virtual

Prints the discontinuity-mesh intersection information.

Reimplemented from GmDiscontinuity.

◆ setGeometry()

virtual void GmTriSurfaceDiscontinuity::setGeometry ( double * dvec,
int nd,
int * ivec,
int ni )
inlineprivatevirtual

Sets the geometry. dvec should be a vector with coordinates (size nd * 3), nd the number of coordinates. ivec should be the triangle incidence list (size ni * 3), ni the number of triangles. No calculation should be done here!

Implements GmDiscontinuity.

◆ usedGeometryMemory()

virtual size_t GmTriSurfaceDiscontinuity::usedGeometryMemory ( ) const
inlinevirtual

Returns an estimative of the memory used by the discontinuity geometry in bytes.

It returns in general the variable memory that depends on the number of lines in a polyline, edges or faces for boundary lists or points & triangles for surfaces, ignoring "constant" sizes.

Implements GmDiscontinuity.

◆ usedIntersectionMemory()

virtual size_t GmTriSurfaceDiscontinuity::usedIntersectionMemory ( ) const
inlinevirtual

Returns an estimative of the memory used by the intersection data in bytes.

Reimplemented from GmDiscontinuity.


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