[Bf-blender-cvs] [04421709956] fluid-mantaflow: Mantaflow: Cleanup Mantaflow source files
Sebastián Barschkis
noreply at git.blender.org
Mon May 27 11:30:04 CEST 2019
Commit: 04421709956e3cbaa6e3a0e2c907e9604657cbbc
Author: Sebastián Barschkis
Date: Mon May 27 11:27:46 2019 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB04421709956e3cbaa6e3a0e2c907e9604657cbbc
Mantaflow: Cleanup Mantaflow source files
No need to have numpy bindings in Blender right now
===================================================================
D intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/numpyconvert.cpp
D intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/tfplugins.cpp
D intern/mantaflow/intern/manta_develop/preprocessed/tbb/plugin/numpyconvert.cpp
D intern/mantaflow/intern/manta_develop/preprocessed/tbb/plugin/tfplugins.cpp
===================================================================
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/numpyconvert.cpp b/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/numpyconvert.cpp
deleted file mode 100644
index 30b0683c246..00000000000
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/numpyconvert.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-
-
-
-
-
-// DO NOT EDIT !
-// This file is generated using the MantaFlow preprocessor (prep generate).
-
-
-
-
-/******************************************************************************
-*
-* MantaFlow fluid solver framework
-* Copyright 2017 Steffen Wiewel, Moritz Becher
-*
-* This program is free software, distributed under the terms of the
-* Apache License, Version 2.0
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Plugins to convert mantaflow grids to/from numpy arrays, also support pdata fields
-# (only compiled if NUMPY is enabled)
-*
-******************************************************************************/
-
-#include "manta.h"
-#include "kernel.h"
-#include "grid.h"
-#include "particle.h"
-#include "levelset.h"
-
-using namespace std;
-namespace Manta
-{
-
-//====================================================================================================
-// Grid numpy conversion
-//----------------------------------------------------------------------------------------------------
-
-template<typename T>
-void copyArrayToGridScalar(const PyArrayContainer source, T& target)
-{
- target.setConst(0.0f);
- unsigned int uGridSize = target.getSizeX() * target.getSizeY() * target.getSizeZ();
- assertMsg(source.TotalSize == uGridSize, "The size of the numpy array doesn't match the size of the Grid!");
-
- NumpyTypes eDataType = source.DataType;
-
- switch (eDataType)
- {
- case NumpyTypes::N_FLOAT:
- FOR_IDX(target) { target(idx) = (reinterpret_cast<float*>(source.pData))[idx]; }
- break;
- case NumpyTypes::N_DOUBLE:
- FOR_IDX(target) { target(idx) = (reinterpret_cast<double*>(source.pData))[idx]; }
- break;
- default:
- errMsg("unknown/unsupported type of Numpy array");
- return;
- }
-}
-
-template<typename T>
-void copyGridToArrayScalar(const T& source, PyArrayContainer target)
-{
- unsigned int uGridsize = source.getSizeX() * source.getSizeY() * source.getSizeZ();
- assertMsg(target.TotalSize == uGridsize, "The size of the numpy array doesn't match the size of the grid!");
-
- NumpyTypes eDataType = target.DataType;
-
- switch (eDataType)
- {
- case NumpyTypes::N_FLOAT:
- FOR_IDX(source) { reinterpret_cast<float*>(target.pData)[idx] = source(idx); }
- break;
- case NumpyTypes::N_DOUBLE:
- FOR_IDX(source) { reinterpret_cast<double*>(target.pData)[idx] = source(idx); }
- break;
- default:
- errMsg("unknown/unsupported type of Numpy array");
- break;
- }
-}
-
-template<typename T>
-void copyArrayToGridVector(const PyArrayContainer source, T& target)
-{
- unsigned int uSizeX = target.getSizeX();
- unsigned int uSizeY = target.getSizeY();
- unsigned int uSizeZ = target.getSizeZ();
- unsigned int uSizeW = 3u;
-
- assertMsg(source.TotalSize == uSizeX * uSizeY * uSizeZ * uSizeW, "The size of the numpy array doesn't match the size of the grid!");
-
- NumpyTypes eDataType = source.DataType;
-
- switch (eDataType)
- {
- case NumpyTypes::N_FLOAT:
- FOR_IDX(target) { for(int w = 0; w < 3; ++w) { target(idx)[w] = (reinterpret_cast<float*>(source.pData))[idx*3+w]; } }
- break;
- case NumpyTypes::N_DOUBLE:
- FOR_IDX(target) { for(int w = 0; w < 3; ++w) { target(idx)[w] = (reinterpret_cast<double*>(source.pData))[idx*3+w]; } }
- break;
- default:
- errMsg("unknown/unsupported type of Vec3 Numpy array");
- break;
- }
-}
-
-template<typename T>
-void copyGridToArrayVector(const T& source, PyArrayContainer target)
-{
- unsigned int uSizeX = source.getSizeX();
- unsigned int uSizeY = source.getSizeY();
- unsigned int uSizeZ = source.getSizeZ();
- unsigned int uSizeW = 3u;
-
- assertMsg(target.TotalSize == uSizeX * uSizeY * uSizeZ * uSizeW, "The size of the numpy array doesn't match the size of the grid!");
-
- NumpyTypes eDataType = target.DataType;
-
- switch (eDataType)
- {
- case NumpyTypes::N_FLOAT:
- FOR_IDX(source) { for(int w = 0; w < 3; ++w) { (reinterpret_cast<float*>(target.pData))[idx*3+w] = source(idx)[w]; } }
- break;
- case NumpyTypes::N_DOUBLE:
- FOR_IDX(source) { for(int w = 0; w < 3; ++w) { (reinterpret_cast<double*>(target.pData))[idx*3+w] = source(idx)[w]; } }
- break;
- default:
- errMsg("unknown/unsupported type of Vec3 Numpy array");
- break;
- }
-}
-
-//====================================================================================================
-// Python interface
-//----------------------------------------------------------------------------------------------------
-
-void copyArrayToGridReal(const PyArrayContainer source, Grid<Real>& target) {
- copyArrayToGridScalar<Grid<Real>>(source, target);
-} static PyObject* _W_0 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
- try {
- PbArgs _args(_linargs, _kwds); FluidSolver *parent = _args.obtainParent(); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(parent, "copyArrayToGridReal" , !noTiming ); PyObject *_retval = 0; {
- ArgLocker _lock; const PyArrayContainer source = _args.get<PyArrayContainer >("source",0,&_lock); Grid<Real>& target = *_args.getPtr<Grid<Real> >("target",1,&_lock); _retval = getPyNone(); copyArrayToGridReal(source,target); _args.check(); }
- pbFinalizePlugin(parent,"copyArrayToGridReal", !noTiming ); return _retval; }
- catch(std::exception& e) {
- pbSetError("copyArrayToGridReal",e.what()); return 0; }
- }
- static const Pb::Register _RP_copyArrayToGridReal ("","copyArrayToGridReal",_W_0);
-extern "C" {
- void PbRegister_copyArrayToGridReal() {
- KEEP_UNUSED(_RP_copyArrayToGridReal); }
- }
-
-
-
-void copyGridToArrayReal(const Grid<Real>& source, PyArrayContainer target) {
- copyGridToArrayScalar<Grid<Real>>(source, target);
-} static PyObject* _W_1 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
- try {
- PbArgs _args(_linargs, _kwds); FluidSolver *parent = _args.obtainParent(); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(parent, "copyGridToArrayReal" , !noTiming ); PyObject *_retval = 0; {
- ArgLocker _lock; const Grid<Real>& source = *_args.getPtr<Grid<Real> >("source",0,&_lock); PyArrayContainer target = _args.get<PyArrayContainer >("target",1,&_lock); _retval = getPyNone(); copyGridToArrayReal(source,target); _args.check(); }
- pbFinalizePlugin(parent,"copyGridToArrayReal", !noTiming ); return _retval; }
- catch(std::exception& e) {
- pbSetError("copyGridToArrayReal",e.what()); return 0; }
- }
- static const Pb::Register _RP_copyGridToArrayReal ("","copyGridToArrayReal",_W_1);
-extern "C" {
- void PbRegister_copyGridToArrayReal() {
- KEEP_UNUSED(_RP_copyGridToArrayReal); }
- }
-
-
-
-void copyArrayToGridLevelset(const PyArrayContainer source, LevelsetGrid& target) {
- copyArrayToGridScalar<LevelsetGrid>(source, target);
-} static PyObject* _W_2 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
- try {
- PbArgs _args(_linargs, _kwds); FluidSolver *parent = _args.obtainParent(); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(parent, "copyArrayToGridLevelset" , !noTiming ); PyObject *_retval = 0; {
- ArgLocker _lock; const PyArrayContainer source = _args.get<PyArrayContainer >("source",0,&_lock); LevelsetGrid& target = *_args.getPtr<LevelsetGrid >("target",1,&_lock); _retval = getPyNone(); copyArrayToGridLevelset(source,target); _args.check(); }
- pbFinalizePlugin(parent,"copyArrayToGridLevelset", !noTiming ); return _retval; }
- catch(std::exception& e) {
- pbSetError("copyArrayToGridLevelset",e.what()); return 0; }
- }
- static const Pb::Register _RP_copyArrayToGridLevelset ("","copyArrayToGridLevelset",_W_2);
-extern "C" {
- void PbRegister_copyArrayToGridLevelset() {
- KEEP_UNUSED(_RP_copyArrayToGridLevelset); }
- }
-
-
-
-void copyGridToArrayLevelset(const LevelsetGrid& source, PyArrayContainer target) {
- copyGridToArrayScalar<LevelsetGrid>(source, target);
-} static PyObject* _W_3 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
- try {
- PbArgs _args(_linargs, _kwds); FluidSolver *parent = _args.obtainParent(); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(parent, "copyGridToArrayLevelset" , !noTiming ); PyObject *_retval = 0; {
- ArgLocker _lock; const LevelsetGrid& source = *_args.getPtr<LevelsetGrid >("source",0,&_lock); PyArrayContainer target = _args.get<PyArrayContainer >("target",1,&_lock); _retval = getPyNone(); copyGridToArrayLevelset(source,target); _args.check(); }
- pbFinalizePlugin(parent,"copyGridToArrayLevelset", !noTiming ); return _retval; }
- catch(std::exception& e) {
- pbSetError("copyGridToArrayLevelset",e.what()); return 0; }
- }
- static const Pb::Register _RP_copyGridToArrayLevelset ("","copyGridToArrayLevelset",_W_3);
-extern "C" {
- void PbRegister_copyGridToArrayLevelset() {
- KEEP_UNUSED(_RP_copyGridToArrayLevelset); }
- }
-
-
-
-void copyArrayToGridVec3(const PyArrayContainer source, Grid<Vec3>& target) {
- copyArrayToGridVector<Grid<Vec3>>(source, target);
-} static PyObject* _W_4 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
- try {
- PbArgs _args(_linargs, _kwds); FluidSolver *parent = _args.obtainParent(); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(parent, "copyArrayToGridVec3" , !noTiming ); PyObject *_retval = 0; {
- ArgLocker _lock; const PyArrayContainer source = _args.get<PyArrayContainer >("source",0,&_lock); Grid<Vec3>& target = *_args.getPtr<Grid<Vec3> >("target",1,&_lock); _retval = getPyNone(); copyArrayToGridVec3(source,target); _args.check(); }
- pbFinalizePlugin(parent,"copyArrayToGridVec3", !noTiming ); return _retval; }
- catch(std::exception& e) {
- pbSetError("copyArrayToGridVec3",e.what()); return 0; }
- }
- static const Pb::Register _RP_copyArrayToGridVec3 ("","copyArrayToGridVec3",_W_4);
-extern "C" {
- void PbRegister_copyArrayToGridVec3() {
- KEEP_UNUSED(_RP_copyArrayToGridVec3); }
- }
-
-
-
-void copyGridToArrayVec3(const Grid<Vec3>& source, PyArrayContainer target) {
- cop
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list