Blender V2.61 - r43446

DNA_object_fluidsim.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2004-2005 by Blender Foundation
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00034 #ifndef DNA_OBJECT_FLUIDSIM_H
00035 #define DNA_OBJECT_FLUIDSIM_H
00036 
00037 #include "DNA_ID.h"
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042     
00043 struct Mesh;
00044 struct Ipo;
00045 
00046 typedef struct FluidVertexVelocity {
00047     float vel[3];
00048 } FluidVertexVelocity;
00049     
00050 typedef struct FluidsimSettings {
00051     struct FluidsimModifierData *fmd; /* for fast RNA access */
00052     /* domain,fluid or obstacle */
00053     short type;
00054     /* display advanced options in fluid sim tab (on=1,off=0)*/
00055     short show_advancedoptions;
00056 
00057     /* domain object settings */
00058     /* resolutions */
00059     short resolutionxyz;
00060     short previewresxyz;
00061     /* size of the domain in real units (meters along largest resolution x,y,z extent) */
00062     float realsize;
00063     /* show original meshes, preview or final sim */
00064     short guiDisplayMode;
00065     short renderDisplayMode;
00066 
00067     /* fluid properties */
00068     float viscosityValue;
00069     short viscosityMode;
00070     short viscosityExponent;
00071     /* gravity strength */
00072     float grav[3];
00073     /* anim start end time (in seconds) */
00074     float animStart, animEnd;
00075     /* bake start end time (in blender frames) */
00076     int bakeStart, bakeEnd;
00077     /* g star param (LBM compressibility) */
00078     float gstar;
00079     /* activate refinement? */
00080     int maxRefine;
00081     
00082     /* fluid object type settings */
00083     /* gravity strength */
00084     float iniVelx,iniVely,iniVelz;
00085 
00086     /* store pointer to original mesh (for replacing the current one) */
00087     struct Mesh *orgMesh;
00088     /* a mesh to display the bounding box used for simulation */
00089     struct Mesh *meshBB;
00090 
00091     /* store output path, and file prefix for baked fluid surface */
00092     /* strlens; 80= FILE_MAXFILE, 160= FILE_MAXDIR */
00093     char surfdataPath[240];
00094 
00095     /* store start coords of axis aligned bounding box together with size */
00096     /* values are inited during derived mesh display */
00097     float bbStart[3], bbSize[3];
00098 
00099     /* animated params */
00100     struct Ipo *ipo;
00101 
00102     /* additional flags depending on the type, lower short contains flags
00103      * to check validity, higher short additional flags */
00104     short typeFlags;
00105     /* switch off velocity genration, volume init type for fluid/obstacles (volume=1,shell=2,both=3) */
00106     char  domainNovecgen,volumeInitType;
00107 
00108     /* boundary "stickiness" for part slip values */
00109     float partSlipValue;
00110 
00111     /* number of tracers to generate */
00112     int generateTracers;
00113     /* particle generation - on if >0, then determines amount (experimental...) */
00114     float generateParticles;
00115     /* smooth fluid surface? */
00116     float surfaceSmoothing;
00117     /* number of surface subdivisions*/
00118     int surfaceSubdivs;
00119     int flag; /* GUI flags */
00120 
00121     /* particle display - size scaling, and alpha influence */
00122     float particleInfSize, particleInfAlpha;
00123     /* testing vars */
00124     float farFieldSize;
00125 
00126     /* vertex velocities of simulated fluid mesh */
00127     struct FluidVertexVelocity *meshVelocities;
00128     /* number of vertices in simulated fluid mesh */
00129     int totvert;
00130     
00131     /* Fluid control settings */
00132     float cpsTimeStart;
00133     float cpsTimeEnd;
00134     float cpsQuality;
00135     
00136     float attractforceStrength;
00137     float attractforceRadius;
00138     float velocityforceStrength;
00139     float velocityforceRadius;
00140 
00141     int lastgoodframe;
00142     
00143     int pad;
00144 
00145 } FluidsimSettings;
00146 
00147 /* ob->fluidsimSettings defines */
00148 #define OB_FLUIDSIM_ENABLE          1
00149 #define OB_FLUIDSIM_DOMAIN          2
00150 #define OB_FLUIDSIM_FLUID           4
00151 #define OB_FLUIDSIM_OBSTACLE        8
00152 #define OB_FLUIDSIM_INFLOW          16
00153 #define OB_FLUIDSIM_OUTFLOW         32
00154 #define OB_FLUIDSIM_PARTICLE        64
00155 #define OB_FLUIDSIM_CONTROL         128
00156 
00157 #define OB_TYPEFLAG_START       7
00158 #define OB_FSGEO_THIN           (1<<(OB_TYPEFLAG_START+1))
00159 #define OB_FSBND_NOSLIP         (1<<(OB_TYPEFLAG_START+2))
00160 #define OB_FSBND_PARTSLIP       (1<<(OB_TYPEFLAG_START+3))
00161 #define OB_FSBND_FREESLIP       (1<<(OB_TYPEFLAG_START+4))
00162 #define OB_FSINFLOW_LOCALCOORD  (1<<(OB_TYPEFLAG_START+5))
00163 
00164 /* surface generation flag (part of enabling chapter 6 of "Free Surface Flows with Moving and Deforming Objects for LBM") */
00165 #define OB_FSSG_NOOBS           (1<<(OB_TYPEFLAG_START+6))
00166 
00167 // guiDisplayMode particle flags
00168 #define OB_FSDOM_GEOM     1
00169 #define OB_FSDOM_PREVIEW  2
00170 #define OB_FSDOM_FINAL    3
00171 #define OB_FSPART_BUBBLE  (1<<1)
00172 #define OB_FSPART_DROP    (1<<2)
00173 #define OB_FSPART_NEWPART (1<<3)
00174 #define OB_FSPART_FLOAT   (1<<4)
00175 #define OB_FSPART_TRACER  (1<<5)
00176 
00177 // new fluid bit flags for fss->flags
00178 #define OB_FLUIDSIM_REVERSE         (1 << 0)
00179 #define OB_FLUIDSIM_ACTIVE          (1 << 1)
00180 #define OB_FLUIDSIM_OVERRIDE_TIME   (1 << 2)
00181 
00182 #define OB_FLUIDSIM_SURF_PREVIEW_OBJ_FNAME "fluidsurface_preview_####.bobj.gz"
00183 #define OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME   "fluidsurface_final_####.bobj.gz"
00184 #define OB_FLUIDSIM_SURF_FINAL_VEL_FNAME   "fluidsurface_final_####.bvel.gz"
00185 #define OB_FLUIDSIM_SURF_PARTICLES_FNAME   "fluidsurface_particles_####.gz"
00186 
00187 #ifdef __cplusplus
00188 }
00189 #endif
00190 
00191 #endif
00192 
00193