[Bf-blender-cvs] [a3328a8699a] fluid-mantaflow: Mantaflow: Fixed issues raised in part 10 of the review (D3860)

Sebastián Barschkis noreply at git.blender.org
Wed Dec 11 11:24:19 CET 2019


Commit: a3328a8699addcd301e815d67e33074a5b331c5c
Author: Sebastián Barschkis
Date:   Wed Dec 11 11:24:13 2019 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rBa3328a8699addcd301e815d67e33074a5b331c5c

Mantaflow: Fixed issues raised in part 10 of the review (D3860)

===================================================================

M	source/blender/blenkernel/intern/manta.c
M	source/blender/makesdna/DNA_manta_types.h
M	source/blender/makesrna/intern/rna_manta.c

===================================================================

diff --git a/source/blender/blenkernel/intern/manta.c b/source/blender/blenkernel/intern/manta.c
index 172e7121358..c3f6e69c4f5 100644
--- a/source/blender/blenkernel/intern/manta.c
+++ b/source/blender/blenkernel/intern/manta.c
@@ -901,7 +901,7 @@ void mantaModifier_createType(struct MantaModifierData *mmd)
       mmd->flow->color[1] = 0.7f;
       mmd->flow->color[2] = 0.7f;
       mmd->flow->fuel_amount = 1.0f;
-      mmd->flow->temp = 1.0f;
+      mmd->flow->temperature = 1.0f;
       mmd->flow->volume_density = 0.0f;
       mmd->flow->surface_distance = 1.5f;
       mmd->flow->particle_size = 1.0f;
@@ -1134,7 +1134,7 @@ void mantaModifier_copy(const struct MantaModifierData *mmd,
     tmfs->density = mfs->density;
     copy_v3_v3(tmfs->color, mfs->color);
     tmfs->fuel_amount = mfs->fuel_amount;
-    tmfs->temp = mfs->temp;
+    tmfs->temperature = mfs->temperature;
     tmfs->volume_density = mfs->volume_density;
     tmfs->surface_distance = mfs->surface_distance;
     tmfs->particle_size = mfs->particle_size;
@@ -3043,7 +3043,7 @@ BLI_INLINE void apply_inflow_fields(MantaFlowSettings *mfs,
   /* add heat */
   if (heat && heat_in) {
     if (emission_value > 0.0f) {
-      heat_in[index] = ADD_IF_LOWER(heat[index], mfs->temp);
+      heat_in[index] = ADD_IF_LOWER(heat[index], mfs->temperature);
       /* Scale inflow by dt/framelength. This is to ensure that adaptive steps don't apply too much
        * emission. */
     }
@@ -3149,7 +3149,7 @@ static void update_flowsflags(MantaDomainSettings *mds, Object **flowobjs, int n
       }
 
       /* activate heat field if flow produces any heat */
-      if (mfs->temp) {
+      if (mfs->temperature) {
         active_fields |= FLUID_DOMAIN_ACTIVE_HEAT;
       }
       /* activate fuel field if flow adds any fuel */
diff --git a/source/blender/makesdna/DNA_manta_types.h b/source/blender/makesdna/DNA_manta_types.h
index 2e4b4b0a843..1cd070b7f21 100644
--- a/source/blender/makesdna/DNA_manta_types.h
+++ b/source/blender/makesdna/DNA_manta_types.h
@@ -24,26 +24,26 @@
 #ifndef __DNA_MANTA_TYPES_H__
 #define __DNA_MANTA_TYPES_H__
 
-/* flags */
+/* Domain flags. */
 enum {
-  FLUID_DOMAIN_USE_NOISE = (1 << 1),        /* use noise */
-  FLUID_DOMAIN_USE_DISSOLVE = (1 << 2),     /* let smoke dissolve */
-  FLUID_DOMAIN_USE_DISSOLVE_LOG = (1 << 3), /* using 1/x for dissolve */
+  FLUID_DOMAIN_USE_NOISE = (1 << 1),        /* Use noise. */
+  FLUID_DOMAIN_USE_DISSOLVE = (1 << 2),     /* Let smoke dissolve. */
+  FLUID_DOMAIN_USE_DISSOLVE_LOG = (1 << 3), /* Using 1/x for dissolve. */
 
 #ifdef DNA_DEPRECATED
   FLUID_DOMAIN_USE_HIGH_SMOOTH = (1 << 5), /* -- Deprecated -- */
 #endif
-  FLUID_DOMAIN_FILE_LOAD = (1 << 6), /* flag for file load */
+  FLUID_DOMAIN_FILE_LOAD = (1 << 6), /* Flag for file load. */
   FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN = (1 << 7),
-  FLUID_DOMAIN_USE_ADAPTIVE_TIME = (1 << 8),    /* adaptive time stepping in domain */
-  FLUID_DOMAIN_USE_MESH = (1 << 9),             /* use mesh */
-  FLUID_DOMAIN_USE_GUIDING = (1 << 10),         /* use guiding */
-  FLUID_DOMAIN_USE_SPEED_VECTORS = (1 << 11),   /* generate mesh speed vectors */
-  FLUID_DOMAIN_EXPORT_MANTA_SCRIPT = (1 << 12), /* export mantaflow script during bake */
-  FLUID_DOMAIN_USE_FRACTIONS = (1 << 13),       /* use second order obstacles */
+  FLUID_DOMAIN_USE_ADAPTIVE_TIME = (1 << 8),    /* Adaptive time stepping in domain. */
+  FLUID_DOMAIN_USE_MESH = (1 << 9),             /* Use mesh. */
+  FLUID_DOMAIN_USE_GUIDING = (1 << 10),         /* Use guiding. */
+  FLUID_DOMAIN_USE_SPEED_VECTORS = (1 << 11),   /* Generate mesh speed vectors. */
+  FLUID_DOMAIN_EXPORT_MANTA_SCRIPT = (1 << 12), /* Export mantaflow script during bake. */
+  FLUID_DOMAIN_USE_FRACTIONS = (1 << 13),       /* Use second order obstacles. */
 };
 
-/* border collisions */
+/* Border collisions. */
 enum {
   FLUID_DOMAIN_BORDER_FRONT = (1 << 1),
   FLUID_DOMAIN_BORDER_BACK = (1 << 2),
@@ -53,7 +53,7 @@ enum {
   FLUID_DOMAIN_BORDER_BOTTOM = (1 << 6),
 };
 
-/* cache file formats */
+/* Cache file formats. */
 enum {
   FLUID_DOMAIN_FILE_UNI = (1 << 0),
   FLUID_DOMAIN_FILE_OPENVDB = (1 << 1),
@@ -62,19 +62,19 @@ enum {
   FLUID_DOMAIN_FILE_BIN_OBJECT = (1 << 4),
 };
 
-/* slice method */
+/* Slice method. */
 enum {
   FLUID_DOMAIN_SLICE_VIEW_ALIGNED = 0,
   FLUID_DOMAIN_SLICE_AXIS_ALIGNED = 1,
 };
 
-/* axis aligned method */
+/* Axis aligned method. */
 enum {
   AXIS_SLICE_FULL = 0,
   AXIS_SLICE_SINGLE = 1,
 };
 
-/* single slice direction */
+/* Single slice direction. */
 enum {
   SLICE_AXIS_AUTO = 0,
   SLICE_AXIS_X = 1,
@@ -82,7 +82,7 @@ enum {
   SLICE_AXIS_Z = 3,
 };
 
-/* axis aligned method */
+/* Axis aligned method. */
 enum {
   VOLUME_INTERP_LINEAR = 0,
   VOLUME_INTERP_CUBIC = 1,
@@ -123,58 +123,74 @@ enum {
   FLUID_DOMAIN_FIELD_FORCE_Z = 13,
 };
 
-/* domain types */
-#define FLUID_DOMAIN_TYPE_GAS 0
-#define FLUID_DOMAIN_TYPE_LIQUID 1
-
-/* noise */
-#define FLUID_NOISE_TYPE_WAVELET (1 << 0)
-
-/* mesh levelset generator types */
-#define FLUID_DOMAIN_MESH_IMPROVED 0
-#define FLUID_DOMAIN_MESH_UNION 1
-
-/* guiding velocity source */
-#define FLUID_DOMAIN_GUIDING_SRC_DOMAIN 0
-#define FLUID_DOMAIN_GUIDING_SRC_EFFECTOR 1
-
-/* fluid data fields (active_fields) */
-#define FLUID_DOMAIN_ACTIVE_HEAT (1 << 0)
-#define FLUID_DOMAIN_ACTIVE_FIRE (1 << 1)
-#define FLUID_DOMAIN_ACTIVE_COLORS (1 << 2)
-#define FLUID_DOMAIN_ACTIVE_COLOR_SET (1 << 3)
-#define FLUID_DOMAIN_ACTIVE_OBSTACLE (1 << 4)
-#define FLUID_DOMAIN_ACTIVE_GUIDING (1 << 5)
-#define FLUID_DOMAIN_ACTIVE_INVEL (1 << 6)
-#define FLUID_DOMAIN_ACTIVE_OUTFLOW (1 << 7)
-
-/* particle types */
-#define FLUID_DOMAIN_PARTICLE_FLIP (1 << 0)
-#define FLUID_DOMAIN_PARTICLE_SPRAY (1 << 1)
-#define FLUID_DOMAIN_PARTICLE_BUBBLE (1 << 2)
-#define FLUID_DOMAIN_PARTICLE_FOAM (1 << 3)
-#define FLUID_DOMAIN_PARTICLE_TRACER (1 << 4)
-
-/* liquid simulation methods */
-#define FLUID_DOMAIN_METHOD_FLIP (1 << 0)
-#define FLUID_DOMAIN_METHOD_APIC (1 << 1)
-
-/* cache options */
-#define FLUID_DOMAIN_BAKING_DATA (1 << 0)
-#define FLUID_DOMAIN_BAKED_DATA (1 << 1)
-#define FLUID_DOMAIN_BAKING_NOISE (1 << 2)
-#define FLUID_DOMAIN_BAKED_NOISE (1 << 3)
-#define FLUID_DOMAIN_BAKING_MESH (1 << 4)
-#define FLUID_DOMAIN_BAKED_MESH (1 << 5)
-#define FLUID_DOMAIN_BAKING_PARTICLES (1 << 6)
-#define FLUID_DOMAIN_BAKED_PARTICLES (1 << 7)
-#define FLUID_DOMAIN_BAKING_GUIDING (1 << 8)
-#define FLUID_DOMAIN_BAKED_GUIDING (1 << 9)
-#define FLUID_DOMAIN_OUTDATED_DATA (1 << 10)
-#define FLUID_DOMAIN_OUTDATED_NOISE (1 << 11)
-#define FLUID_DOMAIN_OUTDATED_MESH (1 << 12)
-#define FLUID_DOMAIN_OUTDATED_PARTICLES (1 << 13)
-#define FLUID_DOMAIN_OUTDATED_GUIDING (1 << 14)
+/* Fluid domain types. */
+enum {
+  FLUID_DOMAIN_TYPE_GAS = 0,
+  FLUID_DOMAIN_TYPE_LIQUID = 1,
+};
+
+/* Smoke noise types. */
+enum {
+  FLUID_NOISE_TYPE_WAVELET = (1 << 0),
+};
+
+/* Mesh levelset generator types. */
+enum {
+  FLUID_DOMAIN_MESH_IMPROVED = 0,
+  FLUID_DOMAIN_MESH_UNION = 1,
+};
+
+/* Guiding velocity source. */
+enum {
+  FLUID_DOMAIN_GUIDING_SRC_DOMAIN = 0,
+  FLUID_DOMAIN_GUIDING_SRC_EFFECTOR = 1,
+};
+
+/* Fluid data fields (active_fields). */
+enum {
+  FLUID_DOMAIN_ACTIVE_HEAT = (1 << 0),
+  FLUID_DOMAIN_ACTIVE_FIRE = (1 << 1),
+  FLUID_DOMAIN_ACTIVE_COLORS = (1 << 2),
+  FLUID_DOMAIN_ACTIVE_COLOR_SET = (1 << 3),
+  FLUID_DOMAIN_ACTIVE_OBSTACLE = (1 << 4),
+  FLUID_DOMAIN_ACTIVE_GUIDING = (1 << 5),
+  FLUID_DOMAIN_ACTIVE_INVEL = (1 << 6),
+  FLUID_DOMAIN_ACTIVE_OUTFLOW = (1 << 7),
+};
+
+/* Particle types. */
+enum {
+  FLUID_DOMAIN_PARTICLE_FLIP = (1 << 0),
+  FLUID_DOMAIN_PARTICLE_SPRAY = (1 << 1),
+  FLUID_DOMAIN_PARTICLE_BUBBLE = (1 << 2),
+  FLUID_DOMAIN_PARTICLE_FOAM = (1 << 3),
+  FLUID_DOMAIN_PARTICLE_TRACER = (1 << 4),
+};
+
+/* Liquid simulation methods. */
+enum {
+  FLUID_DOMAIN_METHOD_FLIP = (1 << 0),
+  FLUID_DOMAIN_METHOD_APIC = (1 << 1),
+};
+
+/* Cache options. */
+enum {
+  FLUID_DOMAIN_BAKING_DATA = (1 << 0),
+  FLUID_DOMAIN_BAKED_DATA = (1 << 1),
+  FLUID_DOMAIN_BAKING_NOISE = (1 << 2),
+  FLUID_DOMAIN_BAKED_NOISE = (1 << 3),
+  FLUID_DOMAIN_BAKING_MESH = (1 << 4),
+  FLUID_DOMAIN_BAKED_MESH = (1 << 5),
+  FLUID_DOMAIN_BAKING_PARTICLES = (1 << 6),
+  FLUID_DOMAIN_BAKED_PARTICLES = (1 << 7),
+  FLUID_DOMAIN_BAKING_GUIDING = (1 << 8),
+  FLUID_DOMAIN_BAKED_GUIDING = (1 << 9),
+  FLUID_DOMAIN_OUTDATED_DATA = (1 << 10),
+  FLUID_DOMAIN_OUTDATED_NOISE = (1 << 11),
+  FLUID_DOMAIN_OUTDATED_MESH = (1 << 12),
+  FLUID_DOMAIN_OUTDATED_PARTICLES = (1 << 13),
+  FLUID_DOMAIN_OUTDATED_GUIDING = (1 << 14),
+};
 
 #define FLUID_DOMAIN_DIR_DEFAULT "cache_fluid"
 #define FLUID_DOMAIN_DIR_CONFIG "config"
@@ -187,19 +203,25 @@ enum {
 #define FLUID_DOMAIN_SMOKE_SCRIPT "smoke_script.py"
 #define FLUID_DOMAIN_LIQUID_SCRIPT "liquid_script.py"
 
-#define FLUID_DOMAIN_CACHE_REPLAY 0
-#define FLUID_DOMAIN_CACHE_MODULAR 1
-#define FLUID_DOMAIN_CACHE_FINAL 2
+enum {
+  FLUID_DOMAIN_CACHE_REPLAY = 0,
+  FLUID_DOMAIN_CACHE_MODULAR = 1,
+  FLUID_DOMAIN_CACHE_FINAL = 2,
+};
 
-/* Deprecated values (i.e. all defines and enums below this line up until typedefs)*/
-/* cache compression */
-#define SM_CACHE_LIGHT 0
-#define SM_CACHE_HEAVY 1
+/* Deprecated values (i.e. all defines and enums below this line up until typedefs). */
+/* Cache compression. */
+enum {
+  SM_CACHE_LIGHT = 0,
+  SM_CACHE_HEAVY = 1,
+};
 
-/* high resolution sampling types */
-#define SM_HRES_NEAREST 0
-#define SM_HRES_LINEAR 1
-#define SM_HRES_FULLSAMPLE 2
+/* High resolution sampling types. */
+enum {
+  SM_HRES_NEAREST = 0,
+  SM_HRES_LINEAR = 1,
+  SM_HRES_FULLSAMPLE = 2,
+};
 
 enum {
   VDB_COMPRESSION_BLOSC = 0,
@@ -212,13 +234,16 @@ typedef struct MantaVertexVelocity {
 } MantaVertexVelocity;
 
 typedef struct MantaDomainSettings {
-  struct MantaModifierData *mmd; /* for fast RNA access */
+
+  /* -- Runtime-only fields (from here on). -- */
+
+  struct MantaModifierData *mmd; /* For fast RNA access. */
   struct MANTA *fluid;
-  struct MANTA *fluid_old; /* adaptive domain needs access to old fluid state */
+  struct MANTA *fluid_old; /* Adaptive domain needs access to old fluid state. */
   void *fluid_mutex;
   struct Collection *fluid_group;
-  struct Collection 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list