24#ifndef _GEMA_DISCONTINUITY_H_
25#define _GEMA_DISCONTINUITY_H_
44 int index()
const {
return _index; }
55 void setCellGroupIndex(
int group) { _groupIndex = group; }
65 virtual int propertyIndex(
int propertySet)
const {
return _psIndex[propertySet]; }
121 : _ds(ds), _index(index), _id(id), _groupIndex(groupIndex), _psIndex(psIndex) {}
124 virtual void setGeometry(
double* dvec,
int nd,
int* ivec,
int ni) = 0;
127 template <
class T,
class V>
128 static T* loadIntoVector(
LuaTable& tab, V validator,
int n,
int* realSize,
150template <
class T,
class V>
159 int npoints = tab.
size();
167 if(!tvec.
resize(npoints * n))
169 gmFatalMsg(logger,
QObject::tr(
"Error allocating memory for %1 %2 points for discontinuity %3.").arg(npoints).arg(msg).arg(discontinuityId));
173 for(
int i = 0, k = 0; i < npoints; i++)
179 gmFatalMsg(logger,
QObject::tr(
"Invalid %1 entry %2 for discontinuity %3. Expecting a table.").arg(msg).arg(i + 1).arg(discontinuityId));
184 for(
int j = 0; j < n; j++)
186 T v = validator(j, entry.
getIndex(j + 1), &status);
191 gmFatalMsg(logger,
QObject::tr(
"Invalid %1 entry %2, column %3, for discontinuity %4.").arg(msg).arg(i + 1).arg(j + 1).arg(discontinuityId));
Base interface class for CellMesh type plugins.
Definition gmCellMesh.h:40
The geometric representation for a single discontinuity from the Discontinuity set....
Definition gmDiscontinuity.h:38
int index() const
Returns this discontinuity index in the father set.
Definition gmDiscontinuity.h:44
const GmDiscontinuitySet * _ds
Our "father" discontinuity set.
Definition gmDiscontinuity.h:133
virtual void printIntersections(const GmLogCategory &logger, GmLogLevel level) const
Prints the discontinuity-mesh intersection information.
Definition gmDiscontinuity.h:110
QString _id
The discontinuity id.
Definition gmDiscontinuity.h:135
virtual int numPoints() const =0
A generic interface to return the original discontinuity data number of points.
virtual size_t usedIntersectionMemory() const
Returns an estimative of the memory used by the intersection data in bytes.
Definition gmDiscontinuity.h:113
virtual ~GmDiscontinuity()
Virtuald destructor.
Definition gmDiscontinuity.h:41
int _index
The discontinuity index in its "father" discontinuity set.
Definition gmDiscontinuity.h:134
virtual void clearGeometry()=0
Clears the original discontinuity geometry information, releasing memory.
int cellGroupIndex() const
Returns the cell group index associated with this discontinuity, if any. This is the index of the gro...
Definition gmDiscontinuity.h:53
virtual int numIntersections() const =0
A generic interface to return the number of intersections between the mesh and the user given geometr...
QString id() const
Returns the discontinuity id (name)
Definition gmDiscontinuity.h:47
virtual size_t usedGeometryMemory() const =0
Returns an estimative of the memory used by the discontinuity geometry in bytes.
virtual int numElements() const =0
A generic interface to return the original discontinuity data number of geometric elements....
GmDiscontinuity(const GmDiscontinuitySet *ds, int index, QString id, int groupIndex, const QVector< int > &psIndex)
Private constructor. Discontinuities are only created by the DiscontinuitySet.
Definition gmDiscontinuity.h:120
virtual bool extendGeometry(GmCellMesh *sMesh, double size, const GmLogCategory &logger)=0
virtual void printGeometry(const GmLogCategory &logger, GmLogLevel level) const =0
Prints the discontinuity geometry information.
int _groupIndex
The index in the mesh for the associated cell group or -1 if there is none.
Definition gmDiscontinuity.h:136
QVector< int > _psIndex
The property set line index for this discontinuity. One entry per associated property set.
Definition gmDiscontinuity.h:137
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....
Definition gmDiscontinuity.h:151
virtual int propertyIndex(int propertySet) const
Given a property set number, returns the line of the property set that contains property values for t...
Definition gmDiscontinuity.h:65
virtual bool findIntersections(const GmLogCategory &logger)
Builds the element intersection list for this discontinuity.
Definition gmDiscontinuity.h:107
virtual void setGeometry(double *dvec, int nd, int *ivec, int ni)=0
A function to set the geometry data. See the parameter descriptions on the concrete classes.
Base interface for providing discontinuity geometry information for spatial indices.
Definition gmDiscontinuitySet.h:59
Class representing a category with multiple logging levels.
Definition gmLog.h:58
A simple vector for Plain Old Data (POD) types with the control size variable type parameterized to a...
Definition gmPODVector.h:88
T * takeData()
For the bold who REALLY knows what he is doing! This is a very specialized function that takes the ow...
Definition gmPODVector.h:127
bool resize(ControlSize newSize, GmPODGrowT grow=Grow)
Resizes the vector to the given size using the specified grow policy.
Definition gmPODVector.h:182
void shrink()
Shrinks the allocated size to match the vector size if possible. Never fails but might do nothing.
Definition gmPODVector.h:234
QVariant getIndex(int index, LuaEnv::StackOption opt=LuaEnv::STACK_AUTO)
#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
Implementation of the GmPODVector template class.
#define S_TRACE()
Macro for run time stack tracking at release build.
Definition gmTrace.h:44
QString tr(const char *sourceText, const char *disambiguation, int n)