[Bf-blender-cvs] [0baa0894672] fluid-mantaflow: name cleanup for levelset grids

Sebastián Barschkis noreply at git.blender.org
Fri Aug 18 01:23:14 CEST 2017


Commit: 0baa08946728cffb732213c6da0d16236141021f
Author: Sebastián Barschkis
Date:   Sat Aug 12 17:33:29 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB0baa08946728cffb732213c6da0d16236141021f

name cleanup for levelset grids

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

M	intern/mantaflow/extern/manta_fluid_API.h
M	intern/mantaflow/intern/FLUID.cpp
M	intern/mantaflow/intern/FLUID.h
M	intern/mantaflow/intern/manta_fluid_API.cpp
M	source/blender/blenkernel/intern/smoke.c

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

diff --git a/intern/mantaflow/extern/manta_fluid_API.h b/intern/mantaflow/extern/manta_fluid_API.h
index 1365d278f80..6da6429f853 100644
--- a/intern/mantaflow/extern/manta_fluid_API.h
+++ b/intern/mantaflow/extern/manta_fluid_API.h
@@ -93,8 +93,8 @@ void smoke_ensure_colors(struct FLUID *smoke, struct SmokeModifierData *smd);
 
 // Liquid grids
 float *liquid_get_phiin(struct FLUID *liquid);
-float *liquid_get_phiobs(struct FLUID *liquid);
-float *liquid_get_phiout(struct FLUID *liquid);
+float *liquid_get_phiobsin(struct FLUID *liquid);
+float *liquid_get_phioutin(struct FLUID *liquid);
 void liquid_ensure_init(struct FLUID *liquid, struct SmokeModifierData *smd);
 void liquid_manta_export(struct FLUID* smoke, struct SmokeModifierData *smd);
 
diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index 37220921e5e..dbdb312945a 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -118,8 +118,8 @@ FLUID::FLUID(int *res, SmokeModifierData *smd) : mCurrentID(++solverID)
 
 	// Liquid low res grids
 	mPhiIn          = NULL;
-	mPhiObs         = NULL;
-	mPhiOut         = NULL;
+	mPhiObsIn       = NULL;
+	mPhiOutIn       = NULL;
 	mPhi            = NULL;
 
 	mNumVertices  = 0;
@@ -478,10 +478,10 @@ FLUID::~FLUID()
 	mTextureW2      = NULL;
 
 	// Liquid
-	mPhiIn  = NULL;
-	mPhiObs = NULL;
-	mPhiOut = NULL;
-	mPhi    = NULL;
+	mPhiIn      = NULL;
+	mPhiObsIn   = NULL;
+	mPhiOutIn   = NULL;
+	mPhi        = NULL;
 
 	mFlipParticleData      = NULL;
 	mFlipParticleVelocity  = NULL;
@@ -1110,8 +1110,8 @@ void FLUID::updatePointers()
 	mForceY    = (float*) getDataPointer("y_force" + solver_ext, solver);
 	mForceZ    = (float*) getDataPointer("z_force" + solver_ext, solver);
 	
-	mPhiObs = (float*) getDataPointer("phiObsIn" + solver_ext, solver);
-	mPhiOut = (float*) getDataPointer("phiOutIn" + solver_ext, solver);
+	mPhiObsIn = (float*) getDataPointer("phiObsIn" + solver_ext, solver);
+	mPhiOutIn = (float*) getDataPointer("phiOutIn" + solver_ext, solver);
 
 	// Liquid
 	if (mUsingLiquid) {
diff --git a/intern/mantaflow/intern/FLUID.h b/intern/mantaflow/intern/FLUID.h
index 0b3d4b262bb..ea5e8f99030 100644
--- a/intern/mantaflow/intern/FLUID.h
+++ b/intern/mantaflow/intern/FLUID.h
@@ -131,10 +131,10 @@ public:
 	inline float* getTextureV2() { return mTextureV2; }
 	inline float* getTextureW2() { return mTextureW2; }
 	
-	inline float* getPhiIn()  { return mPhiIn; }
-	inline float* getPhiObs() { return mPhiObs; }
-	inline float* getPhiOut() { return mPhiOut; }
-	inline float* getPhi()    { return mPhi; }
+	inline float* getPhiIn()      { return mPhiIn; }
+	inline float* getPhiObsIn()   { return mPhiObsIn; }
+	inline float* getPhiOutIn()   { return mPhiOutIn; }
+	inline float* getPhi()        { return mPhi; }
 
 	static std::atomic<bool> mantaInitialized;
 	static std::atomic<int> solverID;
@@ -266,8 +266,8 @@ private:
 
 	// Liquids
 	float* mPhiIn;
-	float* mPhiObs;
-	float* mPhiOut;
+	float* mPhiObsIn;
+	float* mPhiOutIn;
 	float* mPhi;
 
 	// Mesh fields for liquid surface
diff --git a/intern/mantaflow/intern/manta_fluid_API.cpp b/intern/mantaflow/intern/manta_fluid_API.cpp
index c075851aea9..31ef047e609 100644
--- a/intern/mantaflow/intern/manta_fluid_API.cpp
+++ b/intern/mantaflow/intern/manta_fluid_API.cpp
@@ -515,14 +515,14 @@ extern "C" float *liquid_get_phiin(FLUID *liquid)
 	return liquid->getPhiIn();
 }
 
-extern "C" float *liquid_get_phiobs(FLUID *liquid)
+extern "C" float *liquid_get_phiobsin(FLUID *liquid)
 {
-	return liquid->getPhiObs();
+	return liquid->getPhiObsIn();
 }
 
-extern "C" float *liquid_get_phiout(FLUID *liquid)
+extern "C" float *liquid_get_phioutin(FLUID *liquid)
 {
-	return liquid->getPhiOut();
+	return liquid->getPhiOutIn();
 }
 
 extern "C" void liquid_save_mesh(FLUID *liquid, char *filename)
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 62e8ad57872..2b4ba8e557b 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2604,7 +2604,7 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
 				float *velocity_y_in = smoke_get_in_velocity_y(sds->fluid);
 				float *velocity_z_in = smoke_get_in_velocity_z(sds->fluid);
 				float *phiin = liquid_get_phiin(sds->fluid);
-				float *phiout = liquid_get_phiout(sds->fluid);
+				float *phioutin = liquid_get_phioutin(sds->fluid);
 				float *manta_inflow = fluid_get_inflow(sds->fluid); // Copy of emission map for inflow modeling in Mantaflow standalone
 
 				int bigres[3];
@@ -2637,7 +2637,7 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
 							if (dx < 0 || dy < 0 || dz < 0 || dx >= sds->res[0] || dy >= sds->res[1] || dz >= sds->res[2]) continue;
 
 							if (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_OUTFLOW) { // outflow
-								apply_outflow_fields(d_index, distance_map[e_index], density, heat, fuel, react, color_r, color_g, color_b, phiout);
+								apply_outflow_fields(d_index, distance_map[e_index], density, heat, fuel, react, color_r, color_g, color_b, phioutin);
 							}
 							else if (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_GEOMETRY && smd2->time > 2) {
 								apply_inflow_fields(sfs, 0.0f, 0.5f, d_index, density, heat, fuel, react, color_r, color_g, color_b, phiin, manta_inflow);
@@ -2772,7 +2772,7 @@ typedef struct UpdateEffectorsData {
 	float *velocity_y;
 	float *velocity_z;
 	int *flags;
-	float *phiObs;
+	float *phiObsIn;
 } UpdateEffectorsData;
 
 static void update_effectors_task_cb(void *userdata, const int x)
@@ -2790,7 +2790,7 @@ static void update_effectors_task_cb(void *userdata, const int x)
 
 			if ((data->fuel && MAX2(data->density[index], data->fuel[index]) < FLT_EPSILON) ||
 				(data->density && data->density[index] < FLT_EPSILON) ||
-				(data->phiObs  && data->phiObs[index] < 0.0f) ||
+				(data->phiObsIn  && data->phiObsIn[index] < 0.0f) ||
 				// TODO (sebbas): isnt checking phiobs enough? maybe remove flags check
 				 data->flags[index] & 2) // mantaflow convention: 2 == FlagObstacle
 			{
@@ -2851,7 +2851,7 @@ static void update_effectors(Scene *scene, Object *ob, SmokeDomainSettings *sds,
 		data.velocity_y = smoke_get_velocity_y(sds->fluid);
 		data.velocity_z = smoke_get_velocity_z(sds->fluid);
 		data.flags = smoke_get_obstacle(sds->fluid);
-		data.phiObs = liquid_get_phiobs(sds->fluid);
+		data.phiObsIn = liquid_get_phiobsin(sds->fluid);
 
 		BLI_task_parallel_range(0, sds->res[0], &data, update_effectors_task_cb, true);
 	}



More information about the Bf-blender-cvs mailing list