bug correction for the time when empty is used
This commit is contained in:
parent
191801b344
commit
774afd5f37
|
@ -30,7 +30,7 @@ pFlow::empty::empty(
|
||||||
positionParticles(control, dict),
|
positionParticles(control, dict),
|
||||||
position_
|
position_
|
||||||
(
|
(
|
||||||
"empty",maxNumberOfParticles(), 0, RESERVE()
|
"empty",1, 0, RESERVE()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
|
@ -146,7 +146,7 @@ pFlow::positionOrdered::positionOrdered
|
||||||
position_
|
position_
|
||||||
(
|
(
|
||||||
"positionOrdered",
|
"positionOrdered",
|
||||||
max(maxNumberOfParticles(), numPoints_),
|
numPoints_,
|
||||||
numPoints_,
|
numPoints_,
|
||||||
RESERVE()
|
RESERVE()
|
||||||
)
|
)
|
||||||
|
|
|
@ -32,45 +32,10 @@ pFlow::realx3Vector pFlow::positionParticles::sortByMortonCode(
|
||||||
uint64 index;
|
uint64 index;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*realx3 minP = min(position);
|
|
||||||
realx3 maxP = max(position);
|
|
||||||
real cellsize = maxDiameter();
|
|
||||||
cells<uint64> allCells( box(minP, maxP), cellsize);
|
|
||||||
|
|
||||||
Vector<indexMorton> indMor(position.size(),RESERVE());
|
|
||||||
|
|
||||||
indMor.clear();
|
|
||||||
|
|
||||||
uint64 ind=0;
|
|
||||||
for(const auto& p:position)
|
|
||||||
{
|
|
||||||
auto cellInd = allCells.pointIndex(p);
|
|
||||||
indMor.push_back(
|
|
||||||
{ xyzToMortonCode64(cellInd.x(), cellInd.y(), cellInd.z()),
|
|
||||||
ind++});
|
|
||||||
}
|
|
||||||
|
|
||||||
INFORMATION<<"Performing morton sorting."<<END_INFO;
|
|
||||||
std::sort(
|
|
||||||
indMor.begin(),
|
|
||||||
indMor.end(),
|
|
||||||
[]( const indexMorton &lhs, const indexMorton &rhs){
|
|
||||||
return lhs.morton < rhs.morton; } );
|
|
||||||
|
|
||||||
realx3Vector sortedPos(position.capacity(), RESERVE());
|
|
||||||
sortedPos.clear();
|
|
||||||
|
|
||||||
|
|
||||||
for(auto& ind:indMor)
|
|
||||||
{
|
|
||||||
sortedPos.push_back( position[ind.index] );
|
|
||||||
}*/
|
|
||||||
|
|
||||||
WARNING<<"Morton sorting is inactive!"<<END_WARNING;
|
WARNING<<"Morton sorting is inactive!"<<END_WARNING;
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pFlow::positionParticles::positionParticles
|
pFlow::positionParticles::positionParticles
|
||||||
(
|
(
|
||||||
systemControl& control,
|
systemControl& control,
|
||||||
|
@ -78,12 +43,8 @@ pFlow::positionParticles::positionParticles
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
regionType_(dict.getValOrSet<word>("regionType", "domain")),
|
regionType_(dict.getValOrSet<word>("regionType", "domain")),
|
||||||
maxNumberOfParticles_(dict.getValOrSet(
|
|
||||||
"maxNumberOfParticles",
|
|
||||||
static_cast<uint32>(10000))),
|
|
||||||
mortonSorting_(dict.getValOrSet("mortonSorting", Logical("Yes")))
|
mortonSorting_(dict.getValOrSet("mortonSorting", Logical("Yes")))
|
||||||
{
|
{
|
||||||
|
|
||||||
if( regionType_ != "domain" )
|
if( regionType_ != "domain" )
|
||||||
{
|
{
|
||||||
pRegion_ = peakableRegion::create(
|
pRegion_ = peakableRegion::create(
|
||||||
|
@ -92,7 +53,7 @@ pFlow::positionParticles::positionParticles
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileDictionary domainDict
|
fileDictionary domainDictionary
|
||||||
(
|
(
|
||||||
objectFile
|
objectFile
|
||||||
{
|
{
|
||||||
|
@ -103,12 +64,10 @@ pFlow::positionParticles::positionParticles
|
||||||
},
|
},
|
||||||
&control.settings()
|
&control.settings()
|
||||||
);
|
);
|
||||||
pRegion_ = peakableRegion::create(regionType_,domainDict.subDict("globalBox"));
|
pRegion_ = peakableRegion::create("box", domainDictionary.subDict("globalBox"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pFlow::realx3Vector pFlow::positionParticles::getFinalPosition()
|
pFlow::realx3Vector pFlow::positionParticles::getFinalPosition()
|
||||||
{
|
{
|
||||||
if(mortonSorting_)
|
if(mortonSorting_)
|
||||||
|
@ -130,10 +89,8 @@ pFlow::uniquePtr<pFlow::positionParticles>
|
||||||
const dictionary & dict
|
const dictionary & dict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
word method = dict.getVal<word>("method");
|
word method = dict.getVal<word>("method");
|
||||||
|
|
||||||
|
|
||||||
if( dictionaryvCtorSelector_.search(method) )
|
if( dictionaryvCtorSelector_.search(method) )
|
||||||
{
|
{
|
||||||
return dictionaryvCtorSelector_[method] (control, dict);
|
return dictionaryvCtorSelector_[method] (control, dict);
|
||||||
|
|
|
@ -40,12 +40,8 @@ private:
|
||||||
|
|
||||||
word regionType_;
|
word regionType_;
|
||||||
|
|
||||||
uint32 maxNumberOfParticles_ = 10000;
|
|
||||||
|
|
||||||
Logical mortonSorting_;
|
Logical mortonSorting_;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
realx3Vector sortByMortonCode(const realx3Vector& position)const;
|
realx3Vector sortByMortonCode(const realx3Vector& position)const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -83,12 +79,6 @@ public:
|
||||||
return mortonSorting_();
|
return mortonSorting_();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
auto maxNumberOfParticles()const
|
|
||||||
{
|
|
||||||
return maxNumberOfParticles_;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual uint32 numPoints()const = 0;
|
virtual uint32 numPoints()const = 0;
|
||||||
|
|
||||||
virtual uint32 size()const = 0;
|
virtual uint32 size()const = 0;
|
||||||
|
|
|
@ -122,14 +122,14 @@ pFlow::positionRandom::positionRandom
|
||||||
position_
|
position_
|
||||||
(
|
(
|
||||||
"position",
|
"position",
|
||||||
maxNumberOfParticles(),
|
1,
|
||||||
0,
|
0,
|
||||||
RESERVE()
|
RESERVE()
|
||||||
),
|
),
|
||||||
diameters_
|
diameters_
|
||||||
(
|
(
|
||||||
"diameters",
|
"diameters",
|
||||||
maxNumberOfParticles(),
|
1,
|
||||||
0,
|
0,
|
||||||
RESERVE()
|
RESERVE()
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue