[Bf-blender-cvs] [2b3ada655a4] fluid-mantaflow: Mantaflow: Added fluid wrapper files

Sebastián Barschkis noreply at git.blender.org
Sat Apr 6 22:12:45 CEST 2019


Commit: 2b3ada655a49a337e1b351dbf0d24b2bf6bfa53a
Author: Sebastián Barschkis
Date:   Sun Oct 28 14:58:55 2018 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB2b3ada655a49a337e1b351dbf0d24b2bf6bfa53a

Mantaflow: Added fluid wrapper files

Wrapper files manage communication between /source/blender C code and Mantaflow Cpp/Python code (preprocessed files)

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

A	intern/mantaflow/CMakeLists.txt
A	intern/mantaflow/extern/manta_fluid_API.h
A	intern/mantaflow/extern/manta_python_API.h
A	intern/mantaflow/intern/FLUID.cpp
A	intern/mantaflow/intern/FLUID.h
A	intern/mantaflow/intern/manta_fluid_API.cpp
A	intern/mantaflow/intern/manta_python_API.cpp
A	intern/mantaflow/intern/strings/fluid_script.h
A	intern/mantaflow/intern/strings/liquid_script.h
A	intern/mantaflow/intern/strings/smoke_script.h

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

diff --git a/intern/mantaflow/CMakeLists.txt b/intern/mantaflow/CMakeLists.txt
new file mode 100644
index 00000000000..5ffdd9f3402
--- /dev/null
+++ b/intern/mantaflow/CMakeLists.txt
@@ -0,0 +1,228 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program 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 2
+# of the License, or (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2016, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Sebastian Barschkis (sebbas)
+#
+# ***** END GPL LICENSE BLOCK *****
+
+if(WITH_OPENMP)
+	set(MANTA_PP
+		intern/manta_pp/omp
+	)
+	add_definitions(-DOPENMP=1)
+else()
+	set(MANTA_PP
+		intern/manta_pp/tbb
+	)
+	add_definitions(-DTBB=1)
+endif()
+
+if(WITH_OPENVDB)
+	add_definitions(-DOPENVDB=1)
+endif()
+
+set(INC
+	extern
+	intern/strings
+	${MANTA_PP}
+	${MANTA_PP}/fileio
+	${MANTA_PP}/python
+	${MANTA_PP}/plugin
+	${MANTA_PP}/pwrapper
+	${MANTA_PP}/util
+	../../source/blender/makesdna
+	../../source/blender/blenlib
+)
+
+if(WITH_PYTHON)
+	add_definitions(-DWITH_PYTHON)
+endif()
+
+set(INC_SYS
+	${PYTHON_INCLUDE_DIRS}
+	${ZLIB_INCLUDE_DIRS}
+)
+
+if(NOT WITH_OPENMP)
+	list(APPEND INC_SYS
+		${TBB_INCLUDE_DIRS}
+	)
+endif()
+
+if(WITH_OPENVDB)
+	list(APPEND INC_SYS
+		${BOOST_INCLUDE_DIR}
+		${OPENEXR_INCLUDE_DIRS}
+		${OPENVDB_INCLUDE_DIRS}
+	)
+endif()
+
+set(SRC
+	intern/manta_python_API.cpp
+	intern/manta_fluid_API.cpp
+	intern/FLUID.cpp
+
+	extern/manta_python_API.h
+	extern/manta_fluid_API.h
+	intern/FLUID.h
+	intern/strings/fluid_script.h
+	intern/strings/smoke_script.h
+	intern/strings/liquid_script.h
+
+	${MANTA_PP}/commonkernels.h
+	${MANTA_PP}/commonkernels.h.reg
+	${MANTA_PP}/commonkernels.h.reg.cpp
+	${MANTA_PP}/conjugategrad.cpp
+	${MANTA_PP}/conjugategrad.h
+	${MANTA_PP}/conjugategrad.h.reg
+	${MANTA_PP}/conjugategrad.h.reg.cpp
+	${MANTA_PP}/edgecollapse.cpp
+	${MANTA_PP}/edgecollapse.h
+	${MANTA_PP}/edgecollapse.h.reg
+	${MANTA_PP}/edgecollapse.h.reg.cpp
+	${MANTA_PP}/fastmarch.cpp
+	${MANTA_PP}/fastmarch.h
+	${MANTA_PP}/fastmarch.h.reg
+	${MANTA_PP}/fastmarch.h.reg.cpp
+	${MANTA_PP}/fileio/iogrids.cpp
+	${MANTA_PP}/fileio/iomeshes.cpp
+	${MANTA_PP}/fileio/ioparticles.cpp
+	${MANTA_PP}/fileio/mantaio.h
+	${MANTA_PP}/fileio/mantaio.h.reg
+	${MANTA_PP}/fileio/mantaio.h.reg.cpp
+	${MANTA_PP}/fluidsolver.cpp
+	${MANTA_PP}/fluidsolver.h
+	${MANTA_PP}/fluidsolver.h.reg
+	${MANTA_PP}/fluidsolver.h.reg.cpp
+	${MANTA_PP}/general.cpp
+	${MANTA_PP}/general.h
+	${MANTA_PP}/general.h.reg
+	${MANTA_PP}/general.h.reg.cpp
+	${MANTA_PP}/gitinfo.h
+	${MANTA_PP}/grid.cpp
+	${MANTA_PP}/grid.h
+	${MANTA_PP}/grid.h.reg
+	${MANTA_PP}/grid.h.reg.cpp
+	${MANTA_PP}/grid4d.cpp
+	${MANTA_PP}/grid4d.h
+	${MANTA_PP}/grid4d.h.reg
+	${MANTA_PP}/grid4d.h.reg.cpp
+	${MANTA_PP}/kernel.cpp
+	${MANTA_PP}/kernel.h
+	${MANTA_PP}/kernel.h.reg
+	${MANTA_PP}/kernel.h.reg.cpp
+	${MANTA_PP}/levelset.cpp
+	${MANTA_PP}/levelset.h
+	${MANTA_PP}/levelset.h.reg
+	${MANTA_PP}/levelset.h.reg.cpp
+	${MANTA_PP}/mesh.cpp
+	${MANTA_PP}/mesh.h
+	${MANTA_PP}/mesh.h.reg
+	${MANTA_PP}/mesh.h.reg.cpp
+	${MANTA_PP}/movingobs.cpp
+	${MANTA_PP}/movingobs.h
+	${MANTA_PP}/movingobs.h.reg
+	${MANTA_PP}/movingobs.h.reg.cpp
+	${MANTA_PP}/multigrid.cpp
+	${MANTA_PP}/multigrid.h
+	${MANTA_PP}/multigrid.h.reg
+	${MANTA_PP}/multigrid.h.reg.cpp
+	${MANTA_PP}/noisefield.cpp
+	${MANTA_PP}/noisefield.h
+	${MANTA_PP}/noisefield.h.reg
+	${MANTA_PP}/noisefield.h.reg.cpp
+	${MANTA_PP}/particle.cpp
+	${MANTA_PP}/particle.h
+	${MANTA_PP}/particle.h.reg
+	${MANTA_PP}/particle.h.reg.cpp
+	${MANTA_PP}/plugin/advection.cpp
+	${MANTA_PP}/plugin/apic.cpp
+	${MANTA_PP}/plugin/extforces.cpp
+	${MANTA_PP}/plugin/fire.cpp
+	${MANTA_PP}/plugin/flip.cpp
+	${MANTA_PP}/plugin/fluidguiding.cpp
+	${MANTA_PP}/plugin/initplugins.cpp
+	${MANTA_PP}/plugin/kepsilon.cpp
+	${MANTA_PP}/plugin/meshplugins.cpp
+#	${MANTA_PP}/plugin/numpyconvert.cpp
+	${MANTA_PP}/plugin/pressure.cpp
+	${MANTA_PP}/plugin/ptsplugins.cpp
+	${MANTA_PP}/plugin/secondaryparticles
+	${MANTA_PP}/plugin/sndparticles.cpp
+	${MANTA_PP}/plugin/surfaceturbulence.cpp
+#	${MANTA_PP}/plugin/tfplugins.cpp
+	${MANTA_PP}/plugin/vortexplugins.cpp
+	${MANTA_PP}/plugin/waveletturbulence.cpp
+	${MANTA_PP}/plugin/waves.cpp
+	${MANTA_PP}/pwrapper/manta.h
+#	${MANTA_PP}/pwrapper/numpyWrap.cpp
+#	${MANTA_PP}/pwrapper/numpyWrap.h
+	${MANTA_PP}/pwrapper/pclass.cpp
+	${MANTA_PP}/pwrapper/pclass.h
+	${MANTA_PP}/pwrapper/pconvert.cpp
+	${MANTA_PP}/pwrapper/pconvert.h
+	${MANTA_PP}/pwrapper/pvec3.cpp
+	${MANTA_PP}/pwrapper/pythonInclude.h
+	${MANTA_PP}/pwrapper/registry.cpp
+	${MANTA_PP}/pwrapper/registry.h
+	${MANTA_PP}/python/defines.py
+	${MANTA_PP}/python/defines.py.reg
+	${MANTA_PP}/python/defines.py.reg.cpp
+	${MANTA_PP}/registration.cpp
+	${MANTA_PP}/shapes.cpp
+	${MANTA_PP}/shapes.h
+	${MANTA_PP}/shapes.h.reg
+	${MANTA_PP}/shapes.h.reg.cpp
+	${MANTA_PP}/test.cpp
+	${MANTA_PP}/timing.cpp
+	${MANTA_PP}/timing.h
+	${MANTA_PP}/timing.h.reg
+	${MANTA_PP}/timing.h.reg.cpp
+	${MANTA_PP}/turbulencepart.cpp
+	${MANTA_PP}/turbulencepart.h
+	${MANTA_PP}/turbulencepart.h.reg
+	${MANTA_PP}/turbulencepart.h.reg.cpp
+	${MANTA_PP}/util/integrator.h
+	${MANTA_PP}/util/interpol.h
+	${MANTA_PP}/util/interpolHigh.h
+	${MANTA_PP}/util/matrixbase.h
+	${MANTA_PP}/util/mcubes.h
+	${MANTA_PP}/util/quaternion.h
+	${MANTA_PP}/util/randomstream.h
+	${MANTA_PP}/util/rcmatrix.h
+	${MANTA_PP}/util/simpleimage.cpp
+	${MANTA_PP}/util/simpleimage.h
+	${MANTA_PP}/util/solvana.h
+	${MANTA_PP}/util/vector4d.cpp
+	${MANTA_PP}/util/vector4d.h
+	${MANTA_PP}/util/vectorbase.cpp
+	${MANTA_PP}/util/vectorbase.h
+	${MANTA_PP}/vortexpart.cpp
+	${MANTA_PP}/vortexpart.h
+	${MANTA_PP}/vortexpart.h.reg
+	${MANTA_PP}/vortexpart.h.reg.cpp
+	${MANTA_PP}/vortexsheet.cpp
+	${MANTA_PP}/vortexsheet.h
+	${MANTA_PP}/vortexsheet.h.reg
+	${MANTA_PP}/vortexsheet.h.reg.cpp
+)
+
+blender_add_lib(bf_intern_mantaflow "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/intern/mantaflow/extern/manta_fluid_API.h b/intern/mantaflow/extern/manta_fluid_API.h
new file mode 100644
index 00000000000..07e54f1fa7c
--- /dev/null
+++ b/intern/mantaflow/extern/manta_fluid_API.h
@@ -0,0 +1,184 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program 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 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2016 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Sebastian Barschkis (sebbas)
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file mantaflow/extern/manta_smoke_API.h
+ *  \ingroup mantaflow
+ */
+
+#ifndef MANTA_FLUID_API_H
+#define MANTA_FLUID_API_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct FLUID;
+
+/* Fluid functions */
+struct FLUID *fluid_init(int *res, struct SmokeModifierData *smd);
+void fluid_free(struct FLUID *fluid);
+void fluid_ensure_obstacle(struct FLUID *fluid, struct SmokeModifierData *smd);
+void fluid_ensure_guiding(struct FLUID *fluid, struct SmokeModifierData *smd);
+void fluid_ensure_invelocity(struct FLUID *fluid, struct SmokeModifierData *smd);
+int fluid_write_data(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_read_data(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_read_noise(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_read_mesh(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_read_particles(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_read_guiding(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr, bool sourceDomain);
+int fluid_update_liquid_structures(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_update_mesh_structures(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_update_particle_structures(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_bake_data(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_bake_noise(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_bake_mesh(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_bake_particles(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+int fluid_bake_guiding(struct FLUID* fluid, struct SmokeModifierData *smd, int framenr);
+void fluid_update_variables(struct FLUID* fluid, struct SmokeModifierData *smd);
+int fluid_get_frame(struct FLUID* fluid);
+float fluid_get_timestep(struct FLUID* fluid);
+void fluid_adapt_timestep(struct FLUID* fluid);
+
+/* Fluid accessors */
+size_t fluid_get_index(int x, int max_x, int y, int max_y, int z /*, int max_z */);
+size_t fluid_get_index2d(int x, int max_x, int y /*, int max_y, int z, int max_z */);
+float *fluid_get_velocity_x(struct FLUID *fluid);
+float *fluid_get_velocity_y(struct FLUID *fluid);
+float *fluid_get_velocity_z(struct FLUID *fluid);
+float *fluid_get

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list