Bugfix for sphere-in-control-object (reported by broken)
authorDaniel Genrich <daniel.genrich@gmx.net>
Wed, 3 Sep 2008 16:01:25 +0000 (16:01 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Wed, 3 Sep 2008 16:01:25 +0000 (16:01 +0000)
intern/elbeem/intern/controlparticles.cpp
intern/elbeem/intern/solver_control.cpp

index c08501d5847ed099cd4cfbf46735649688aa7714..18c87011971f508012ce02c3d94645d7645fa3af 100644 (file)
@@ -168,7 +168,7 @@ int ControlParticles::initFromObject(ntlGeometryObjModel *model) {
                mvm.transfer(vertices, ninspos);
                
                tcnt++;
-               for(int i=0; i<(int)ninspos.size(); i++) {
+               for(size_t i=0; i < ninspos.size(); i++) {
                        
                        if(useCP[i]) {
                                ControlParticle p; p.reset();
@@ -178,6 +178,8 @@ int ControlParticles::initFromObject(ntlGeometryObjModel *model) {
                }
        }
        
+       printf("tcnt: %d\n", tcnt);
+       
        model->setGeoInitType(FGI_CONTROL);
 
        delete tree;
@@ -238,7 +240,7 @@ ControlParticles::ControlParticles() :
        _fluidSpacing(1.), _kernelWeight(-1.),
        _charLength(1.), _charLengthInv(1.),
        mvCPSStart(-10000.), mvCPSEnd(10000.),
-       mCPSWidth(0.1), mCPSTimestep(0.05),
+       mCPSWidth(0.1), mCPSTimestep(0.02), // was 0.05
        mCPSTimeStart(0.), mCPSTimeEnd(0.5), mCPSWeightFac(1.),
        mDebugInit(0)
 {
@@ -281,6 +283,7 @@ void ControlParticles::setInfluenceVelocity(LbmFloat set, LbmFloat dt) {
 int ControlParticles::initExampleSet()
 {
        // unused
+       return 0;
 }
 
 int ControlParticles::getTotalSize()
index 6b4c31b8f3e32650eea8b223a0360d4eb9b3217b..15b9468ed0d0e66e5358bad19df0f7a23e29fba9 100644 (file)
@@ -49,7 +49,9 @@ void LbmControlSet::initCparts() {
 
 LbmControlData::LbmControlData() : 
        mSetForceStrength(0.),
-       mCons(), mCpUpdateInterval(16), mCpOutfile(""),
+       mCons(), 
+       mCpUpdateInterval(8), // DG: was 16 --> causes problems (big sphere after some time), unstable
+       mCpOutfile(""), 
        mCpForces(), mCpKernel(), mMdKernel(),
        mDiffVelCon(1.),
        mDebugCpscale(0.),