Commit 019236ff authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

add a method to reset the potential and forces of the FP2PParticleContainer

parent 0734af0a
......@@ -306,6 +306,11 @@ public:
memset(attributes[idx], 0, sizeof(AttributeClass) * allocatedParticles);
}
}
/** Reset the attributes to zeros */
void resetToInitialState(const int idxAttribute){
memset(attributes[idxAttribute], 0, sizeof(AttributeClass) * allocatedParticles);
}
};
......
......@@ -62,6 +62,12 @@ public:
const FReal* getForcesZ(const int idxLhs = 0) const {
return Parent::getAttribute(NRHS+3*NLHS+idxLhs);
}
void resetForcesAndPotential(){
for(int idx = 0 ; idx < 4*NLHS ; ++idx){
Parent::resetToInitialState(idx + NRHS);
}
}
};
#endif // FP2PPARTICLECONTAINER_HPP
......@@ -92,7 +92,7 @@ class TestRotationDirectSeveralTime : public FUTester<TestRotationDirectSeveralT
});
// If we want to reset the leaf
//tree.forEachLeaf([&](LeafClass* leaf){
// leaf->resetToInitialState();
// leaf->resetForcesAndPotential();
//}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment