Commit: 67df724a1fdc72fb34a5b4159f33805fa20099b7
Author: Sebastián Barschkis
Date: Sun Jun 25 17:37:04 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB67df724a1fdc72fb34a5b4159f33805fa20099b7
added particle data pointer getter to mantaflow files
===================================================================
M intern/mantaflow/intern/manta_pp/omp/particle.cpp
M intern/mantaflow/intern/manta_pp/omp/particle.h
M intern/mantaflow/intern/manta_pp/omp/particle.h.reg
M intern/mantaflow/intern/manta_pp/omp/particle.h.reg.cpp
M intern/mantaflow/intern/manta_pp/tbb/particle.cpp
M intern/mantaflow/intern/manta_pp/tbb/particle.h
M intern/mantaflow/intern/manta_pp/tbb/particle.h.reg
M intern/mantaflow/intern/manta_pp/tbb/particle.h.reg.cpp
===================================================================
diff --git a/intern/mantaflow/intern/manta_pp/omp/particle.cpp
b/intern/mantaflow/intern/manta_pp/omp/particle.cpp
index 19a58bc24c3..58355f67cf4 100644
--- a/intern/mantaflow/intern/manta_pp/omp/particle.cpp
+++ b/intern/mantaflow/intern/manta_pp/omp/particle.cpp
@@ -239,6 +239,12 @@ void BasicParticleSystem::printParts(IndexInt start,
IndexInt stop, bool printIn
debMsg( sstr.str() , 1 );
}
+std::string BasicParticleSystem::getDataPointer() {
+ std::ostringstream out;
+ out << &mData;
+ return out.str();
+}
+
void BasicParticleSystem::readParticles(BasicParticleSystem* from) {
// re-allocate all data
this->resizeAll( from->size() );
@@ -390,7 +396,7 @@ template <class T> struct knSetPdataConst : public
KernelBase { knSetPdataConst
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,pdata,value); } }
ParticleDataImpl<T>& pdata; T value; };
-#line 376 "particle.cpp"
+#line 382 "particle.cpp"
@@ -399,7 +405,7 @@ template <class T, class S> struct knPdataSet : public
KernelBase { knPdataSet(
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const ParticleDataImpl<S>& other; };
-#line 378 "particle.cpp"
+#line 384 "particle.cpp"
template <class T, class S> struct knPdataAdd : public KernelBase {
knPdataAdd(ParticleDataImpl<T>& me, const ParticleDataImpl<S>& other) :
KernelBase(me.size()) ,me(me),other(other) { runMessage(); run(); } inline
void op(IndexInt idx, ParticleDataImpl<T>& me, const ParticleDataImpl<S>& other
) { me[idx] += other[idx]; } inline ParticleDataImpl<T>& getArg0() { return
me; } typedef ParticleDataImpl<T> type0;inline const ParticleDataImpl<S>&
getArg1() { return other; } typedef P [...]
@@ -407,7 +413,7 @@ template <class T, class S> struct knPdataAdd : public
KernelBase { knPdataAdd(
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const ParticleDataImpl<S>& other; };
-#line 379 "particle.cpp"
+#line 385 "particle.cpp"
template <class T, class S> struct knPdataSub : public KernelBase {
knPdataSub(ParticleDataImpl<T>& me, const ParticleDataImpl<S>& other) :
KernelBase(me.size()) ,me(me),other(other) { runMessage(); run(); } inline
void op(IndexInt idx, ParticleDataImpl<T>& me, const ParticleDataImpl<S>& other
) { me[idx] -= other[idx]; } inline ParticleDataImpl<T>& getArg0() { return
me; } typedef ParticleDataImpl<T> type0;inline const ParticleDataImpl<S>&
getArg1() { return other; } typedef P [...]
@@ -415,7 +421,7 @@ template <class T, class S> struct knPdataSub : public
KernelBase { knPdataSub(
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const ParticleDataImpl<S>& other; };
-#line 380 "particle.cpp"
+#line 386 "particle.cpp"
template <class T, class S> struct knPdataMult : public KernelBase {
knPdataMult(ParticleDataImpl<T>& me, const ParticleDataImpl<S>& other) :
KernelBase(me.size()) ,me(me),other(other) { runMessage(); run(); } inline
void op(IndexInt idx, ParticleDataImpl<T>& me, const ParticleDataImpl<S>& other
) { me[idx] *= other[idx]; } inline ParticleDataImpl<T>& getArg0() { return
me; } typedef ParticleDataImpl<T> type0;inline const ParticleDataImpl<S>&
getArg1() { return other; } typedef [...]
@@ -423,7 +429,7 @@ template <class T, class S> struct knPdataMult : public
KernelBase { knPdataMul
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const ParticleDataImpl<S>& other; };
-#line 381 "particle.cpp"
+#line 387 "particle.cpp"
template <class T, class S> struct knPdataDiv : public KernelBase {
knPdataDiv(ParticleDataImpl<T>& me, const ParticleDataImpl<S>& other) :
KernelBase(me.size()) ,me(me),other(other) { runMessage(); run(); } inline
void op(IndexInt idx, ParticleDataImpl<T>& me, const ParticleDataImpl<S>& other
) { me[idx] /= other[idx]; } inline ParticleDataImpl<T>& getArg0() { return
me; } typedef ParticleDataImpl<T> type0;inline const ParticleDataImpl<S>&
getArg1() { return other; } typedef P [...]
@@ -431,7 +437,7 @@ template <class T, class S> struct knPdataDiv : public
KernelBase { knPdataDiv(
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const ParticleDataImpl<S>& other; };
-#line 382 "particle.cpp"
+#line 388 "particle.cpp"
@@ -440,7 +446,7 @@ template <class T, class S> struct knPdataSetScalar :
public KernelBase { knPda
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const S& other; };
-#line 384 "particle.cpp"
+#line 390 "particle.cpp"
template <class T, class S> struct knPdataAddScalar : public KernelBase {
knPdataAddScalar(ParticleDataImpl<T>& me, const S& other) :
KernelBase(me.size()) ,me(me),other(other) { runMessage(); run(); } inline
void op(IndexInt idx, ParticleDataImpl<T>& me, const S& other ) { me[idx] +=
other; } inline ParticleDataImpl<T>& getArg0() { return me; } typedef
ParticleDataImpl<T> type0;inline const S& getArg1() { return other; } typedef S
type1; void runMessage() { debMsg("Executing k [...]
@@ -448,7 +454,7 @@ template <class T, class S> struct knPdataAddScalar :
public KernelBase { knPda
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const S& other; };
-#line 385 "particle.cpp"
+#line 391 "particle.cpp"
template <class T, class S> struct knPdataMultScalar : public KernelBase {
knPdataMultScalar(ParticleDataImpl<T>& me, const S& other) :
KernelBase(me.size()) ,me(me),other(other) { runMessage(); run(); } inline
void op(IndexInt idx, ParticleDataImpl<T>& me, const S& other ) { me[idx] *=
other; } inline ParticleDataImpl<T>& getArg0() { return me; } typedef
ParticleDataImpl<T> type0;inline const S& getArg1() { return other; } typedef S
type1; void runMessage() { debMsg("Executing [...]
@@ -456,7 +462,7 @@ template <class T, class S> struct knPdataMultScalar :
public KernelBase { knPd
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const S& other; };
-#line 386 "particle.cpp"
+#line 392 "particle.cpp"
template <class T, class S> struct knPdataScaledAdd : public KernelBase {
knPdataScaledAdd(ParticleDataImpl<T>& me, const ParticleDataImpl<T>& other,
const S& factor) : KernelBase(me.size()) ,me(me),other(other),factor(factor)
{ runMessage(); run(); } inline void op(IndexInt idx, ParticleDataImpl<T>&
me, const ParticleDataImpl<T>& other, const S& factor ) { me[idx] += factor *
other[idx]; } inline ParticleDataImpl<T>& getArg0() { return me; } typedef
ParticleDataImpl<T> type0;i [...]
@@ -464,7 +470,7 @@ template <class T, class S> struct knPdataScaledAdd :
public KernelBase { knPda
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other,factor); } }
ParticleDataImpl<T>& me; const ParticleDataImpl<T>& other; const S& factor; };
-#line 387 "particle.cpp"
+#line 393 "particle.cpp"
@@ -473,7 +479,7 @@ template <class T> struct knPdataSafeDiv : public
KernelBase { knPdataSafeDiv(P
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,other); } }
ParticleDataImpl<T>& me; const ParticleDataImpl<T>& other; };
-#line 389 "particle.cpp"
+#line 395 "particle.cpp"
template <class T> struct knPdataSetConst : public KernelBase {
knPdataSetConst(ParticleDataImpl<T>& pdata, T value) :
KernelBase(pdata.size()) ,pdata(pdata),value(value) { runMessage(); run(); }
inline void op(IndexInt idx, ParticleDataImpl<T>& pdata, T value ) {
pdata[idx] = value; } inline ParticleDataImpl<T>& getArg0() { return pdata;
} typedef ParticleDataImpl<T> type0;inline T& getArg1() { return value; }
typedef T type1; void runMessage() { debMsg("Executing kernel knPda [...]
@@ -481,7 +487,7 @@ template <class T> struct knPdataSetConst : public
KernelBase { knPdataSetConst
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,pdata,value); } }
ParticleDataImpl<T>& pdata; T value; };
-#line 390 "particle.cpp"
+#line 396 "particle.cpp"
@@ -490,7 +496,7 @@ template <class T> struct knPdataClamp : public KernelBase
{ knPdataClamp(Parti
{
#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,me,min,max); } }
ParticleDataImpl<T>& me; T min; T max; };
-#line 392 "particle.cpp"
+#line 398 "particle.cpp"
@@ -555,7 +561,7 @@ template<typename T>
for (IndexInt i = 0; i < _sz; i++) op(i,val,minVal);
#pragma omp critical
{this->minVal = min(minVal, this->minVal); } } } const ParticleDataImpl<T>&
val; Real minVal; };
@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs