svn merge -r 15529:15649 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / intern / elbeem / intern / solver_init.cpp
index a873f3c69874587ad84d61382ee1d2dee4f3b26a..b1222d48ce54508be9ba42d57ebca51ae0519dd4 100644 (file)
@@ -328,7 +328,10 @@ LbmFsgrSolver::LbmFsgrSolver() :
        mInit2dYZ(false),
        mForceTadapRefine(-1), mCutoff(-1)
 {
-  // not much to do here... 
+#if LBM_INCLUDE_CONTROL==1
+       mpControl = new LbmControlData();
+#endif
+
 #if LBM_INCLUDE_TESTSOLVERS==1
        mpTest = new LbmTestdata();
        mMpNum = mMpIndex = 0;
@@ -438,6 +441,10 @@ LbmFsgrSolver::~LbmFsgrSolver()
        delete mpIso;
        if(mpPreviewSurface) delete mpPreviewSurface;
        // cleanup done during scene deletion...
+       
+#if LBM_INCLUDE_CONTROL==1
+       if(mpControl) delete mpControl;
+#endif
 
        // always output performance estimate
        debMsgStd("LbmFsgrSolver::~LbmFsgrSolver",DM_MSG," Avg. MLSUPS:"<<(mAvgMLSUPS/mAvgMLSUPSCnt), 5);
@@ -488,6 +495,10 @@ void LbmFsgrSolver::parseAttrList()
        mSimulationTime += starttimeskip;
        if(starttimeskip>0.) debMsgStd("LbmFsgrSolver::parseStdAttrList",DM_NOTIFY,"Used starttimeskip="<<starttimeskip<<", t="<<mSimulationTime, 1);
 
+#if LBM_INCLUDE_CONTROL==1
+       mpControl->parseControldataAttrList(mpSifAttrs);
+#endif
+
 #if LBM_INCLUDE_TESTSOLVERS==1
        mUseTestdata = 0;
        mUseTestdata = mpSifAttrs->readBool("use_testdata", mUseTestdata,"LbmFsgrSolver", "mUseTestdata", false);
@@ -689,21 +700,21 @@ bool LbmFsgrSolver::initializeSolverMemory()
 
                // restrict max. chunk of 1 mem block to 1GB for windos
                bool memBlockAllocProblem = false;
-               double maxWinMemChunk = 1100.*1024.*1024.;
-               double maxMacMemChunk = 1200.*1024.*1024.;
                double maxDefaultMemChunk = 2.*1024.*1024.*1024.;
                //std::cerr<<" memEstFine "<< memEstFine <<" maxWin:" <<maxWinMemChunk <<" maxMac:" <<maxMacMemChunk ; // DEBUG
 #ifdef WIN32
+               double maxWinMemChunk = 1100.*1024.*1024.;
                if(sizeof(void *)==4 && memEstFine>maxWinMemChunk) {
                        memBlockAllocProblem = true;
                }
 #endif // WIN32
 #ifdef __APPLE__
+               double maxMacMemChunk = 1200.*1024.*1024.;
                if(memEstFine> maxMacMemChunk) {
                        memBlockAllocProblem = true;
                }
 #endif // Mac
-               if(sizeof(void *)==4 && memEstFine>maxDefaultMemChunk) {
+               if(sizeof(void*)==4 && memEstFine>maxDefaultMemChunk) {
                        // max memory chunk for 32bit systems 2gig
                        memBlockAllocProblem = true;
                }
@@ -1264,8 +1275,11 @@ bool LbmFsgrSolver::initializeSolverPostinit() {
   debMsgStd("LbmFsgrSolver::initialize",DM_MSG,"Init done ... ",10);
        mInitDone = 1;
 
-#if LBM_INCLUDE_TESTSOLVERS==1
+#if LBM_INCLUDE_CONTROL==1
        initCpdata();
+#endif // LBM_INCLUDE_CONTROL==1
+
+#if LBM_INCLUDE_TESTSOLVERS==1
        initTestdata();
 #endif // ELBEEM_PLUGIN!=1
        // not inited? dont use...