particles and sphereParticles classes were tested for exit boundary

This commit is contained in:
Hamidreza Norouzi
2024-03-22 08:26:14 -07:00
parent acfaacfe4a
commit 49af1119f9
15 changed files with 287 additions and 92 deletions

View File

@ -36,18 +36,23 @@ class baseShapeNames
{
private:
size_t numShapes_;
size_t numShapes_ = 0;
// - hashed list of spheres names
wordHashMap<uint32> hashNames_;
/// list of shape names
wordVector shapeNames_;
wordVector shapeNames_{"shapeNames"};
/// hash for names
Vector<size_t> hashes_{"hashes"};
bool createHashNames();
bool readFromDictionary1();
using hasher = typename wordHashMap<uint32>::hasher;
protected:
virtual
@ -78,6 +83,12 @@ public:
return wl;
}
inline
const auto& hashes()const
{
return hashes_;
}
inline
size_t numShapes()const
{
@ -111,6 +122,20 @@ public:
return false;
}
inline bool hashToIndex(const size_t& hs, uint32& idx)
{
for(auto i=0; i<hashes_.size(); i++)
{
if(hashes_[i]==hs)
{
idx = i;
return true;
}
}
idx = -1;
return false;
}
inline
bool indexValid(uint32 index)const
{