24#ifndef _GEMA_DISCONTINUITY_SET_H_
25#define _GEMA_DISCONTINUITY_SET_H_
31#include "gmSurfaceCellIntersection.h"
81 bool addElements,
bool addGhostNodes,
bool extraDofs,
82 double snapTol,
double repelTol,
double repelDistance,
double parallelCosThreshold,
83 bool noInternalNodes,
bool internalIntersections,
bool discardOriginalGeometry,
bool extendGeometry,
bool visibilityOnly);
124 bool internalIntersections()
const {
return _internalIntersections; }
141 int startAddedNodeIndex()
const {
return _startNode; }
143 int discontinuityIndex(
QString id)
const;
151 int dimension()
const {
166 bool intersects(
const GmCell* c,
bool def)
const;
172 int numAttributeStates(
QString id)
const;
186 int propertySetIndex(
QString id)
const;
193 const SegmentCell2DIntersectionList& cell2DPolylineIntersections(
const GmCell* c)
const;
209 static DiscontinuityType getTypeFromTable(
LuaTable& data);
210 static QString getTableFieldFromType(DiscontinuityType type);
215 GmDiscontinuity* addDiscontinuity(
QString id, DiscontinuityType dType,
int* indexes,
int ni,
double* points,
int np,
const QVector<int>& propIndex,
int cellGroupId = -1);
221 size_t usedMemory()
const;
223 static QString discontinuityTypeToStr(DiscontinuityType type);
224 static int strToDiscontinuityType(
QString str);
234 bool checkVisibility(
const double* src,
const double* dst,
bool inclusive,
double eps = 3e-5)
const;
237 int getNumberOfDiscontinuities(
const GmCell* c)
const;
240 int getNumberOfDiscontinuityElements(
const GmCell* c)
const;
243 int getIdDiscontinuityElementInMesh(
const GmCell* c,
int k)
const;
246 int getLocalIdDiscontinuityElement(
const GmCell* c,
int k)
const;
249 void fillDiscontinuityNodesGlobalToLocalMap(
const GmCell* c,
QMap<int, int>& globalToLocal)
const;
262 const QVector<GmVector3>& consolidated3DPoints()
const {
return _consolidatedPoints; }
267 GmSpatialIndex* index,
bool addElements,
bool addGhostNodes,
bool extraDofs,
double snapTol,
double repelTol,
268 double repelDistance,
double parallelCosThreshold,
bool noInternalNodes,
bool internalIntersections,
bool discardOriginalGeometry,
272 bool add2DSegmentCellIntersectionsToMesh(
const GmLogCategory& logger);
273 bool add3DTriangleCellIntersectionsToMesh(
const GmLogCategory& logger);
274 bool addGhostNodeIntersectionsToMesh(
const GmLogCategory& logger);
275 bool break2DPolylinesAtIntersections(
const GmLogCategory& logger);
279 size_t encDiscPoint(
int discId,
int pointId)
const;
280 int push3DPoint(
int discId,
int pointId, GmIntersectionPointType ptype,
const GmVector3& point);
281 int get3DPoint(
int discId,
int pointId)
const;
283 void removeUnused3DPoints();
286 bool consolidate3DSurfIntersections(
const GmLogCategory& logger);
292 size_t usedElementMapMemory()
const;
346 static int _buildItem;
347 static int _extendGItem;
348 static int _intersecItem;
349 static int _consol3Ditem;
350 static int _add2MeshItem;
351 static int _buildVisItem;
364 virtual bool addStateItemsToGroup(
GmStateDump* state,
int groupId);
367 virtual bool fillDumpControlMapData(QVariantMap* map,
const GmLogCategory& logger);
368 virtual bool dumpControlMapDataLoaded(QVariantMap* map,
const GmLogCategory& logger);
372 QVariantMap _controlMap;
Definition gmBVHAcceleration.h:102
A simple accessor used to access 3d surface cell intersection data with possible unit conversion from...
Definition gmDiscontinuityAccessor.h:219
Definition gmCellGeometryInfo.h:202
Base interface for mesh cells.
Definition gmCell.h:88
Base interface class for CellMesh type plugins.
Definition gmCellMesh.h:40
A (much more) compact version of GmSegmentCellIntersection for 2d intersections only....
Definition gmSegmentCellIntersection.h:109
The GmDiscontinuityAccessor class is a proxy object to a value accesor implementing a more convenient...
Definition gmDiscontinuityAccessor.h:48
The geometric representation for a single discontinuity from the Discontinuity set....
Definition gmDiscontinuity.h:38
Base interface for providing discontinuity geometry information for spatial indices.
Definition gmDiscontinuitySet.h:59
bool discardOriginalGeometry() const
Returns true if the original intersection geometry data will be discarded after intersection handling...
Definition gmDiscontinuitySet.h:127
bool _discardOriginalGeometry
Flag controlling if the original geometry should be discarded after intersection handling for memory ...
Definition gmDiscontinuitySet.h:312
bool visibilityOnly() const
Returns true if this discSet is for visibilityOnly (no mesh, index or intersections)
Definition gmDiscontinuitySet.h:133
int _startNode
When elementts are added to mesh, this points to the starting added node.
Definition gmDiscontinuitySet.h:333
double _parallelCosThreshold
The cosine threshold used to detect parallelism between surfaces.
Definition gmDiscontinuitySet.h:309
QMap< QString, int > _dataMap
Maps discontinuity names to their indices in _data.
Definition gmDiscontinuitySet.h:321
QVector< GmVector3 > _consolidatedPoints
List of consolidated points from 'consolidate3DSurfIntersections'.
Definition gmDiscontinuitySet.h:335
bool _addedInterfElemHaveExtraDofs
Should added interface elements for EDGELIST/FACELIST have extra dof nodes?
Definition gmDiscontinuitySet.h:305
GmDiscontinuity * discontinuity(int index)
Returns the given discontinuity. Index shoulde be between 0 and numDiscontinuities() - 1.
Definition gmDiscontinuitySet.h:146
bool _visibilityOnly
Flag for discontinuity with only visibility test (no intersections computed)
Definition gmDiscontinuitySet.h:315
bool _addGhostNodes
Should we automatically add the discontinuity geometry as ghost nodes?
Definition gmDiscontinuitySet.h:304
bool extendedOriginalGeometry() const
Returns true if the original geometry was extended.
Definition gmDiscontinuitySet.h:130
DiscontinuityType
Discontinuity type (defining how the disc. geometry is defined)
Definition gmDiscontinuitySet.h:63
@ GM_DISC_POLYLINE
The disc. geometry is given by a polyline. Inserted elements are bars.
Definition gmDiscontinuitySet.h:64
@ GM_DISC_FACELIST
The disc. geometry is given by a face list. Inserted elements are 3d interface elements.
Definition gmDiscontinuitySet.h:67
@ GM_DISC_TRISURFACE
The disc. geometry is given by a trinagulated surface. Inserted elements are triangles or quads.
Definition gmDiscontinuitySet.h:65
@ GM_DISC_EDGELIST
The disc. geometry is given by an edge list. Inserted elements are 2d interface elements.
Definition gmDiscontinuitySet.h:66
QString id() const
Returns the discontinuity set name.
Definition gmDiscontinuitySet.h:88
QString description() const
Returns the discontinuity set description.
Definition gmDiscontinuitySet.h:91
double _repelDistance
The percentual distance for repeling a intersection point from a node detected by repelTol.
Definition gmDiscontinuitySet.h:308
QVector< GmValueSet * > _attributes
List with the set of defined attribute values.
Definition gmDiscontinuitySet.h:317
double repelDistance() const
Returns the percentual distance used for repelling intersection points from nodes.
Definition gmDiscontinuitySet.h:118
GmSpatialIndex * _index
The optional spatial index used to speedup queries.
Definition gmDiscontinuitySet.h:302
QString _description
A description of the discontinuity set.
Definition gmDiscontinuitySet.h:299
QVector< GmDiscontinuity * > _data
The list with discontinuity data.
Definition gmDiscontinuitySet.h:319
const QVector< GmPropertySet * > & propertySets() const
Returns a reference to the list of property sets associated to this set.
Definition gmDiscontinuitySet.h:184
bool _noInternalNodes
Flag controlling if internal nodes are allowed (false) or not (true) in the intersection segments.
Definition gmDiscontinuitySet.h:310
bool autoAddGhostNodes() const
Returns true if the dicontinuity-cell intersections are added as ghost nodes to the mesh.
Definition gmDiscontinuitySet.h:106
bool _addElements
Should we automatically add the discontinuity geometry - cell intersections as elements to the mesh?
Definition gmDiscontinuitySet.h:303
GmSpatialIndex * spatialIndex() const
Returns the mesh spatial index that this discontinuity set is tied to.
Definition gmDiscontinuitySet.h:100
double _snapTol
The percentual snap tolerance for atracting intersection points to nodes, edges or faces.
Definition gmDiscontinuitySet.h:306
QVector< GmPropertySet * > _propertySets
List with the associated property sets.
Definition gmDiscontinuitySet.h:318
int numPropertySets() const
Returns the number of property sets attached to this discontinuity set.
Definition gmDiscontinuitySet.h:175
GmCellMesh * _mesh
The mesh that this discontinuity set is tied to.
Definition gmDiscontinuitySet.h:301
GmBVHVisibility * _visibilityBVH
Acceleration structure for visibility queries.
Definition gmDiscontinuitySet.h:328
bool autoAddElements() const
Returns true if the dicontinuity-cell intersections are added as new elements to the mesh.
Definition gmDiscontinuitySet.h:103
QMap< QString, int > _attributesMap
Maps attribute ids to their indices in _attributes.
Definition gmDiscontinuitySet.h:320
QVector< Gm3DSurfacePointInfo > _consolidatedPointsInfo
Definition gmDiscontinuitySet.h:336
const GmDiscontinuity * discontinuity(int index) const
Returns the given discontinuity as a const object. Index shoulde be between 0 and numDiscontinuities(...
Definition gmDiscontinuitySet.h:149
bool noInternalNodes() const
Return true if internal intersections between segments are "broken".
Definition gmDiscontinuitySet.h:121
GmCellMesh * mesh() const
Returns the mesh that this discontinuity set is tied to.
Definition gmDiscontinuitySet.h:97
GmSimulationData * _simData
Definition gmDiscontinuitySet.h:331
bool extraDofsInAddedElements() const
Returns true if added interface elements for type() == EDGELIST or FACELIST should have extra dof nod...
Definition gmDiscontinuitySet.h:109
bool _extendGeometry
Flag controlling if the original geometry should be expanded before computing intersections.
Definition gmDiscontinuitySet.h:313
DiscontinuityType type() const
Returns the discontinuity geometry definition type.
Definition gmDiscontinuitySet.h:94
double snapTolerance() const
Returns the percentual tolerance used for snapping intersection points to nodes, edges or faces.
Definition gmDiscontinuitySet.h:112
QMap< int, SegmentCell2DIntersectionList > _elementPolylineIntersectionsMap
The map with per element intersections with polyline discontinuities.
Definition gmDiscontinuitySet.h:324
QMap< size_t, int > _pointMapId
Map used to translate local point to global points list.
Definition gmDiscontinuitySet.h:334
bool _intersectionsBuilt
Signals if intersections are built, aftewards no data changes are allowed.
Definition gmDiscontinuitySet.h:314
DiscontinuityType _type
The type of the discontinuities geometric data.
Definition gmDiscontinuitySet.h:300
int numDiscontinuities() const
Returns the number of discontinuities (lines) stored in the object.
Definition gmDiscontinuitySet.h:136
bool _internalIntersections
Flag controlling if internal intersections should be handled or not.
Definition gmDiscontinuitySet.h:311
QString _id
The discontinuity set id (name)
Definition gmDiscontinuitySet.h:298
double _repelTol
The percentual tolerance for repeling a intersection point from a node. (Used for GmTriSurfaceDiscont...
Definition gmDiscontinuitySet.h:307
double repelTolerance() const
Returns the percentual tolerance used for repelling intersection points from nodes.
Definition gmDiscontinuitySet.h:115
const QVector< GmDiscontinuity * > & discontinuities() const
Returns the stored list of discontinuities.
Definition gmDiscontinuitySet.h:139
Definition gmDiscontinuitySet.h:357
A basic interface used for creating dump items for objects that can be dumped by a composition of mul...
Definition gmStateDumpItem.h:53
A helper class used to parse and retrieve data from am hdf5 model file. Used by the mesh plugin to re...
Definition gmHdf5ModelReader.h:53
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Interface storing property descriptions and values.
Definition gmPropertySet.h:38
A simple accessor used to access 2d segment cell intersection data with possible unit conversion from...
Definition gmDiscontinuityAccessor.h:152
Auxiliar class used to store the complete set of simulation data.
Definition gmSimulationData.h:55
Base interface class for Spatial Index type plugins.
Definition gmSpatialIndex.h:66
The GmStateDump class presents a higher level of abstraction over GmMemoryDump, storing accessor data...
Definition gmStateDump.h:54
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition gmValueInfo.h:132
Basic class used to store sets of values, bound to a common definition, on behalf of another object (...
Definition gmValueSet.h:54
Declaration of the GmCellType enum.
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition gmCellType.h:31
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of support functions and macros for information logging.
GmLogLevel
Available log levels list.
Definition gmLog.h:36
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition gmMatrix.h:38
Declaration of the GmStateDumpBaseDataItem and basic derived classes.
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34
arma::vec3 GmVector3
A 3D vector with fixed size of 3 elements.
Definition gmVector.h:35
void print(const GmMatrix &m, const GmLogCategory &logger, GmLogLevel level, int fieldWidth, char format, int precision)
Prints the matrix using the specified logger, level and precision fields.
Definition gmMatrixUtils.cpp:34
Definition gmSurfaceCellIntersection.h:27
Representation for the intersection between a polyline segment and a mesh cell. Can be used both in 2...
Definition gmSegmentCellIntersection.h:61
Definition gmBVHAcceleration.h:36