Welcome to mirror list, hosted at ThFree Co, Russian Federation.

original-main.cpp « intern « smoke « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0cf76e367c352bd4b39863d2e705d8e28b5fcc29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//////////////////////////////////////////////////////////////////////
// This file is part of Wavelet Turbulence.
// 
// Wavelet Turbulence is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// Wavelet Turbulence is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with Wavelet Turbulence.  If not, see <http://www.gnu.org/licenses/>.
// 
// Copyright 2008 Theodore Kim and Nils Thuerey
// 
//////////////////////////////////////////////////////////////////////

#include <iostream>
#include "FLUID_3D.h"

using namespace std;

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
int main(int argc, char *argv[])
{
  cout << "=========================================================================" << endl;
  cout << " Wavelet Turbulence simulator " << endl;
  cout << "=========================================================================" << endl;
  cout << " This code is Copyright 2008 Theodore Kim and Nils Thuerey and released" << endl;
  cout << " under the GNU public license. For more information see:" << endl << endl;
  cout << "   http://www.cs.cornell.edu/~tedkim/WTURB" << endl;
  cout << "=========================================================================" << endl;

  int xRes = 48;
  int yRes = 64;
  int zRes = 48;
  int amplify = 4;
  int totalCells = xRes * yRes * zRes;
  int amplifiedCells = totalCells * amplify * amplify * amplify;
  
  // print out memory requirements
  long long int coarseSize = sizeof(float) * totalCells * 22 + 
                   sizeof(unsigned char) * totalCells;
  long long int fineSize = sizeof(float) * amplifiedCells * 7 + // big grids
                 sizeof(float) * totalCells * 8 +     // small grids
                 sizeof(float) * 128 * 128 * 128;     // noise tile
  long long int totalMB = (coarseSize + fineSize) / 1048576;
  cout << " Current coarse resolution: " << xRes << " x " << yRes << " x " << zRes << endl;
  cout << " Current amplified resolution: " << xRes * amplify << " x " << yRes * amplify 
                                            << " x " << zRes * amplify << endl;
  cout << " At least " << totalMB << " MB of RAM needed " << endl;
  cout << "=========================================================================" << endl;
  cout.flush();

  // create output directories
  system("mkdir original.preview");
  system("mkdir amplified.preview");
  system("mkdir pbrt");
  
	FLUID_3D fluid(xRes, yRes, zRes, amplify);
  for (int x = 0; x < 300; x++)
  {
    fluid.addSmokeColumn();
    fluid.step();
  }

	return EXIT_SUCCESS;
}