Elbeem: fix memory leak and add guarded allocator directives

This commit is contained in:
Sergey Sharybin
2013-09-27 18:55:26 +00:00
parent 16da43ef19
commit dad37860e2
25 changed files with 285 additions and 3 deletions

View File

@@ -25,6 +25,7 @@
set(INC set(INC
extern extern
../guardedalloc
) )
set(INC_SYS set(INC_SYS

View File

@@ -43,6 +43,6 @@ if env['WITH_BF_OPENMP']:
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
defs += ' USE_MSVC6FIXES' defs += ' USE_MSVC6FIXES'
incs += ' ' + env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] incs += ' ' + env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC']
incs += ' extern ' incs += ' extern ../../guardedalloc'
env.BlenderLib ('bf_intern_elbeem', sources, Split(incs), Split(defs), libtype='intern', priority=0 ) env.BlenderLib ('bf_intern_elbeem', sources, Split(incs), Split(defs), libtype='intern', priority=0 )

View File

@@ -14,6 +14,11 @@
#ifndef NTL_ATTRIBUTES_H #ifndef NTL_ATTRIBUTES_H
#include "utilities.h" #include "utilities.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
template<class T> class ntlMatrix4x4; template<class T> class ntlMatrix4x4;
class ntlSetVec3f; class ntlSetVec3f;
std::ostream& operator<<( std::ostream& os, const ntlSetVec3f& i ); std::ostream& operator<<( std::ostream& os, const ntlSetVec3f& i );
@@ -110,6 +115,11 @@ class AnimChannel
vector<Scalar> mValue; vector<Scalar> mValue;
/*! anim channel attr times */ /*! anim channel attr times */
vector<double> mTimes; vector<double> mTimes;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:AnimChannel")
#endif
}; };
@@ -127,6 +137,11 @@ class ntlSetVec3f {
ntlSetVec3f& operator*=( const ntlSetVec3f &v ); ntlSetVec3f& operator*=( const ntlSetVec3f &v );
vector<ntlVec3f> mVerts; vector<ntlVec3f> mVerts;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlSetVec3f")
#endif
}; };
@@ -163,6 +178,11 @@ class Attribute
protected: protected:
bool initChannel(int elemSize); bool initChannel(int elemSize);
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:Attribute")
#endif
}; };
@@ -195,6 +215,11 @@ class AttributeList
bool ignoreParameter(string name, string source); bool ignoreParameter(string name, string source);
void print(); void print();
protected: protected:
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:AttributeList")
#endif
}; };
ntlVec3f channelFindMaxVf (AnimChannel<ntlVec3f> channel); ntlVec3f channelFindMaxVf (AnimChannel<ntlVec3f> channel);

View File

@@ -18,6 +18,10 @@
#include "ntl_geometrymodel.h" #include "ntl_geometrymodel.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
// indicator for LBM inclusion // indicator for LBM inclusion
//#ifndef LBMDIM //#ifndef LBMDIM
@@ -80,6 +84,11 @@ public:
forceAtt = forceVel = forceMaxd = LbmVec(0.,0.,0.); forceAtt = forceVel = forceMaxd = LbmVec(0.,0.,0.);
compAvWeight=0.; compAv=LbmVec(0.); compAvWeight=0.; compAv=LbmVec(0.);
}; };
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ControlForces")
#endif
}; };
@@ -115,6 +124,11 @@ public:
// init all zero / defaults // init all zero / defaults
void reset(); void reset();
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ControlParticle")
#endif
}; };
@@ -128,6 +142,10 @@ public:
// particle positions // particle positions
std::vector<ControlParticle> particles; std::vector<ControlParticle> particles;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ControlParticleSet")
#endif
}; };
@@ -296,6 +314,11 @@ protected:
void initTimeArray(LbmFloat t, std::vector<ControlParticle> &parts); void initTimeArray(LbmFloat t, std::vector<ControlParticle> &parts);
bool checkPointInside(ntlTree *tree, ntlVec3Gfx org, gfxReal &distance); bool checkPointInside(ntlTree *tree, ntlVec3Gfx org, gfxReal &distance);
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ControlParticles")
#endif
}; };

View File

@@ -15,6 +15,10 @@
#include "ntl_geometryobject.h" #include "ntl_geometryobject.h"
#include "ntl_bsptree.h" #include "ntl_bsptree.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
#define ISO_STRICT_DEBUG 0 #define ISO_STRICT_DEBUG 0
#define ISOSTRICT_EXIT *((int *)0)=0; #define ISOSTRICT_EXIT *((int *)0)=0;
@@ -224,6 +228,11 @@ class IsoSurface :
vector<int> mDboundary; vector<int> mDboundary;
float mSCrad1, mSCrad2; float mSCrad1, mSCrad2;
ntlVec3Gfx mSCcenter; ntlVec3Gfx mSCcenter;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:IsoSurface")
#endif
}; };

View File

@@ -34,6 +34,10 @@
#include "ieeefp.h" #include "ieeefp.h"
#endif #endif
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
// weight and triangle index // weight and triangle index
class mvmIndexWeight { class mvmIndexWeight {
public: public:
@@ -49,6 +53,11 @@ class mvmIndexWeight {
mvmFloat weight; mvmFloat weight;
int index; int index;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:mvmIndexWeight")
#endif
}; };
// transfer point with weights // transfer point with weights
@@ -58,6 +67,11 @@ class mvmTransferPoint {
ntlVec3Gfx lastpos; ntlVec3Gfx lastpos;
//! triangle weights //! triangle weights
std::vector<mvmIndexWeight> weights; std::vector<mvmIndexWeight> weights;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:mvmTransferPoint")
#endif
}; };
@@ -86,6 +100,10 @@ class MeanValueMeshCoords {
std::vector<mvmTransferPoint> mVertices; std::vector<mvmTransferPoint> mVertices;
int mNumVerts; int mNumVerts;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:MeanValueMeshCoords")
#endif
}; };
#endif #endif

View File

@@ -12,6 +12,10 @@
#ifndef NTL_BLENDERDUMPER_H #ifndef NTL_BLENDERDUMPER_H
#include "ntl_world.h" #include "ntl_world.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class ntlBlenderDumper : class ntlBlenderDumper :
public ntlWorld public ntlWorld
{ {
@@ -27,6 +31,10 @@ public:
protected: protected:
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlBlenderDumper")
#endif
}; };
#define NTL_BLENDERDUMPER_H #define NTL_BLENDERDUMPER_H

View File

@@ -22,6 +22,9 @@
#define BSP_STACK_SIZE 50 #define BSP_STACK_SIZE 50
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
//! bsp tree stack classes, defined in ntl_bsptree.cpp, //! bsp tree stack classes, defined in ntl_bsptree.cpp,
// detailed definition unnecesseary here // detailed definition unnecesseary here
@@ -120,6 +123,10 @@ class ntlTree
//! duplicated triangles, inited during subdivide //! duplicated triangles, inited during subdivide
int mTriDoubles; int mTriDoubles;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlTree")
#endif
}; };

View File

@@ -16,6 +16,10 @@
#include "attributes.h" #include "attributes.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
//! geometry class type ids //! geometry class type ids
#define GEOCLASSTID_OBJECT 1 #define GEOCLASSTID_OBJECT 1
#define GEOCLASSTID_SHADER 2 #define GEOCLASSTID_SHADER 2
@@ -111,6 +115,10 @@ class ntlGeometryClass
private: private:
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlGeometryClass")
#endif
}; };

View File

@@ -14,6 +14,10 @@
#include "ntl_geometryobject.h" #include "ntl_geometryobject.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/*! A simple box object generatedd by 12 triangles */ /*! A simple box object generatedd by 12 triangles */
class ntlGeometryObjModel : public ntlGeometryObject class ntlGeometryObjModel : public ntlGeometryObject
{ {
@@ -89,6 +93,11 @@ class ntlGeometryObjModel : public ntlGeometryObject
/*! set data file name */ /*! set data file name */
inline void setFilename(string set) { mFilename = set; } inline void setFilename(string set) { mFilename = set; }
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlGeometryObjModel")
#endif
}; };
#endif #endif

View File

@@ -16,6 +16,11 @@
#include "ntl_geometryclass.h" #include "ntl_geometryclass.h"
#include "ntl_lighting.h" #include "ntl_lighting.h"
#include "ntl_ray.h" #include "ntl_ray.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class ntlRenderGlobals; class ntlRenderGlobals;
class ntlTriangle; class ntlTriangle;
@@ -240,6 +245,10 @@ class ntlGeometryObject : public ntlGeometryClass
public: public:
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlGeometryObject")
#endif
}; };
#endif #endif

View File

@@ -13,6 +13,11 @@
#define NTL_GEOMETRYSHADER_H #define NTL_GEOMETRYSHADER_H
#include "ntl_geometryclass.h" #include "ntl_geometryclass.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class ntlGeometryObject; class ntlGeometryObject;
class ntlRenderGlobals; class ntlRenderGlobals;
@@ -57,6 +62,11 @@ class ntlGeometryShader :
/*! surface output name for this simulation */ /*! surface output name for this simulation */
string mOutFilename; string mOutFilename;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlGeometryShader")
#endif
}; };
#endif #endif

View File

@@ -14,6 +14,11 @@
#define NTL_LIGHTING_H #define NTL_LIGHTING_H
#include "ntl_vector3dim.h" #include "ntl_vector3dim.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class ntlMaterial; class ntlMaterial;
class ntlRay; class ntlRay;
class ntlRenderGlobals; class ntlRenderGlobals;
@@ -88,6 +93,10 @@ protected:
private: private:
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlLightObject")
#endif
}; };
@@ -195,6 +204,10 @@ public:
//! Set Fresnel on/off //! Set Fresnel on/off
inline void setFresnel(int set) { mFresnel = set; } inline void setFresnel(int set) { mFresnel = set; }
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlMaterial")
#endif
}; };

View File

@@ -14,6 +14,9 @@
#include "ntl_vector3dim.h" #include "ntl_vector3dim.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
// The basic vector class // The basic vector class
template<class Scalar> template<class Scalar>
@@ -96,6 +99,10 @@ public:
protected: protected:
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlMatrix4x4")
#endif
}; };

View File

@@ -18,6 +18,10 @@
#include "ntl_geometryobject.h" #include "ntl_geometryobject.h"
#include "ntl_bsptree.h" #include "ntl_bsptree.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class ntlTriangle; class ntlTriangle;
class ntlRay; class ntlRay;
class ntlTree; class ntlTree;
@@ -39,6 +43,11 @@ class ntlIntersection {
ntlRay *ray; ntlRay *ray;
ntlTriangle *tri; ntlTriangle *tri;
char flags; char flags;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlIntersection")
#endif
}; };
//! the main ray class //! the main ray class
@@ -138,6 +147,10 @@ private:
/*! ID of this ray (from renderglobals */ /*! ID of this ray (from renderglobals */
int mID; int mID;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlRay")
#endif
}; };
@@ -225,6 +238,10 @@ private:
/*! ID of last ray that an intersection was calculated for */ /*! ID of last ray that an intersection was calculated for */
int mLastRay; int mLastRay;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlTriangle")
#endif
}; };
@@ -410,6 +427,10 @@ private:
/*! shader/obj initializations are only done on first init */ /*! shader/obj initializations are only done on first init */
bool mFirstInitDone; bool mFirstInitDone;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlScene")
#endif
}; };

View File

@@ -32,6 +32,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* absolute value */ /* absolute value */
template < class T > template < class T >
inline T inline T
@@ -205,6 +209,11 @@ protected:
private: private:
Scalar value[3]; //< Storage of vector values Scalar value[3]; //< Storage of vector values
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlVector3Dim")
#endif
}; };

View File

@@ -18,6 +18,11 @@
#include "ntl_geometryobject.h" #include "ntl_geometryobject.h"
#include "simulation_object.h" #include "simulation_object.h"
#include "elbeem.h" #include "elbeem.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class ntlOpenGLRenderer; class ntlOpenGLRenderer;
class ntlScene; class ntlScene;
class SimulationObject; class SimulationObject;
@@ -119,6 +124,11 @@ class ntlWorld
/*! count no. of frame for correct sim time */ /*! count no. of frame for correct sim time */
int mSimFrameCnt; int mSimFrameCnt;
vector<int> mSimFrameValue; vector<int> mSimFrameValue;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlWorld")
#endif
}; };
@@ -389,6 +399,11 @@ private:
bool mSingleFrameMode; bool mSingleFrameMode;
//! filename for single frame mode //! filename for single frame mode
string mSingleFrameFilename; string mSingleFrameFilename;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlRenderGlobals")
#endif
}; };

View File

@@ -17,6 +17,10 @@
#include "utilities.h" #include "utilities.h"
#include "attributes.h" #include "attributes.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
/* parametrizer accuracy */ /* parametrizer accuracy */
typedef double ParamFloat; typedef double ParamFloat;
typedef ntlVec3d ParamVec; typedef ntlVec3d ParamVec;
@@ -306,6 +310,11 @@ class Parametrizer {
/*! pointer to the attribute list */ /*! pointer to the attribute list */
AttributeList *mpAttrs; AttributeList *mpAttrs;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:Parametrizer")
#endif
}; };

View File

@@ -53,6 +53,7 @@ ParticleTracer::ParticleTracer() :
ParticleTracer::~ParticleTracer() { ParticleTracer::~ParticleTracer() {
debMsgStd("ParticleTracer::~ParticleTracer",DM_MSG,"destroyed",10); debMsgStd("ParticleTracer::~ParticleTracer",DM_MSG,"destroyed",10);
if(mpTrafo) delete mpTrafo;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@@ -12,6 +12,11 @@
#ifndef NTL_PARTICLETRACER_H #ifndef NTL_PARTICLETRACER_H
#include "ntl_geometryobject.h" #include "ntl_geometryobject.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
template<class Scalar> class ntlMatrix4x4; template<class Scalar> class ntlMatrix4x4;
// particle types // particle types
@@ -131,6 +136,11 @@ class ParticleObject
/* for list constructions */ /* for list constructions */
ParticleObject *mpNext; ParticleObject *mpNext;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ParticleObject")
#endif
}; };
@@ -274,6 +284,11 @@ class ParticleTracer :
/* prev pos save interval */ /* prev pos save interval */
float mTrailTimeLast, mTrailInterval; float mTrailTimeLast, mTrailInterval;
int mTrailLength; int mTrailLength;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ParticleTracer")
#endif
}; };
#define NTL_PARTICLETRACER_H #define NTL_PARTICLETRACER_H

View File

@@ -18,6 +18,10 @@
#include "ntl_geometryshader.h" #include "ntl_geometryshader.h"
#include "parametrizer.h" #include "parametrizer.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class LbmSolverInterface; class LbmSolverInterface;
class CellIdentifierInterface; class CellIdentifierInterface;
class ntlTree; class ntlTree;
@@ -188,6 +192,11 @@ class SimulationObject :
virtual inline ntlVec3Gfx *getBBStart() { return &mGeoStart; } virtual inline ntlVec3Gfx *getBBStart() { return &mGeoStart; }
virtual inline ntlVec3Gfx *getBBEnd() { return &mGeoEnd; } virtual inline ntlVec3Gfx *getBBEnd() { return &mGeoEnd; }
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:SimulationObject")
#endif
}; };

View File

@@ -21,6 +21,10 @@
#include "ntl_ray.h" #include "ntl_ray.h"
#include <stdio.h> #include <stdio.h>
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
#if PARALLEL==1 #if PARALLEL==1
#include <omp.h> #include <omp.h>
#endif // PARALLEL=1 #endif // PARALLEL=1
@@ -145,6 +149,11 @@ class UniformFsgrCellIdentifier :
if( x==cid->x && y==cid->y && z==cid->z && level==cid->level ) return true; if( x==cid->x && y==cid->y && z==cid->z && level==cid->level ) return true;
return false; return false;
} }
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:UniformFsgrCellIdentifier")
#endif
}; };
//! information needed for each level in the simulation //! information needed for each level in the simulation
@@ -193,6 +202,10 @@ public:
int lSizex, lSizey, lSizez; int lSizex, lSizey, lSizez;
int lOffsx, lOffsy, lOffsz; int lOffsx, lOffsy, lOffsz;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:FsgrLevelData")
#endif
}; };
@@ -740,6 +753,11 @@ class LbmFsgrSolver :
static LbmFloat lesCoeffOffdiag[ 2 ][ 9 ]; static LbmFloat lesCoeffOffdiag[ 2 ][ 9 ];
# endif // LBMDIM==2 # endif // LBMDIM==2
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:LbmFsgrSolver")
#endif
}; };
#undef STCON #undef STCON

View File

@@ -225,7 +225,10 @@ LbmFsgrSolver::initCpdata()
// manually switch on! if this is zero, nothing is done... // manually switch on! if this is zero, nothing is done...
mpControl->mSetForceStrength = this->mTForceStrength = 1.; mpControl->mSetForceStrength = this->mTForceStrength = 1.;
mpControl->mCons.clear(); while (!mpControl->mCons.empty()) {
delete mpControl->mCons.back(); mpControl->mCons.pop_back();
}
// init all control fluid objects // init all control fluid objects
int numobjs = (int)(mpGiObjects->size()); int numobjs = (int)(mpGiObjects->size());
@@ -264,7 +267,9 @@ LbmFsgrSolver::initCpdata()
if(0) { if(0) {
// manually switch on! if this is zero, nothing is done... // manually switch on! if this is zero, nothing is done...
mpControl->mSetForceStrength = this->mTForceStrength = 1.; mpControl->mSetForceStrength = this->mTForceStrength = 1.;
mpControl->mCons.clear(); while (!mpControl->mCons.empty()) {
delete mpControl->mCons.back(); mpControl->mCons.pop_back();
}
// add new set // add new set
LbmControlSet *cset; LbmControlSet *cset;

View File

@@ -16,6 +16,10 @@
#ifndef LBM_TESTCLASS_H #ifndef LBM_TESTCLASS_H
#define LBM_TESTCLASS_H #define LBM_TESTCLASS_H
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
//class IsoSurface; //class IsoSurface;
class ParticleObject; class ParticleObject;
class ControlParticles; class ControlParticles;
@@ -147,6 +151,11 @@ class LbmControlSet {
AnimChannel<ntlVec3f> mcCpScale; AnimChannel<ntlVec3f> mcCpScale;
AnimChannel<ntlVec3f> mcCpOffset; AnimChannel<ntlVec3f> mcCpOffset;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:LbmControlSet")
#endif
}; };
@@ -180,6 +189,11 @@ class LbmControlData
// cp debug displau // cp debug displau
LbmFloat mDebugCpscale, mDebugVelScale, mDebugCompavScale, mDebugAttScale, mDebugMaxdScale, mDebugAvgVelScale; LbmFloat mDebugCpscale, mDebugVelScale, mDebugCompavScale, mDebugAttScale, mDebugMaxdScale, mDebugAvgVelScale;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:LbmControlData ")
#endif
}; };
#endif // LBM_TESTCLASS_H #endif // LBM_TESTCLASS_H

View File

@@ -35,6 +35,11 @@
#include "parametrizer.h" #include "parametrizer.h"
#include "attributes.h" #include "attributes.h"
#include "isosurface.h" #include "isosurface.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class ParticleTracer; class ParticleTracer;
class ParticleObject; class ParticleObject;
@@ -171,6 +176,11 @@ class LbmCellContents {
CellFlagType flag; CellFlagType flag;
BubbleId bubble; BubbleId bubble;
LbmFloat ffrac; LbmFloat ffrac;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:LbmCellContents")
#endif
}; };
/* struct for the coordinates of a cell in the grid */ /* struct for the coordinates of a cell in the grid */
@@ -224,6 +234,10 @@ class CellIdentifierInterface {
//! has the grid been traversed? //! has the grid been traversed?
bool mEnd; bool mEnd;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:CellIdentifierInterface")
#endif
}; };
@@ -601,6 +615,11 @@ class LbmSolverInterface
#if PARALLEL==1 #if PARALLEL==1
int mNumOMPThreads; int mNumOMPThreads;
#endif // PARALLEL==1 #endif // PARALLEL==1
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:LbmSolverInterface")
#endif
}; };