www.cemf.ir
regularParticleIdHandler.cpp
Go to the documentation of this file.
2 
3 
4 
6 (
8 )
9 :
11 {
12  initialIdCheck();
13 }
14 
17 {
18 
19  if(nNewParticles==0) return {0,0};
20 
21  uint32 startId;
22  if(maxId_== static_cast<uint32>(-1))
23  {
24  startId = 0;
25  }
26  else
27  {
28  startId = maxId_+1;
29  }
30  uint32 endId = startId+nNewParticles-1;
31  maxId_ = endId;
32  return {startId, endId};
33 }
34 
36 {
38  if( pStruct().empty() ) return true;
39 
40  uint32 maxId = max( *this );
41 
43  if(maxId == static_cast<uint32>(-1))
44  {
45  fillSequence(*this,0u);
46  maxId_ = size()-1;
47  }
48  else
49  {
50  maxId_ = maxId;
51  }
52 
53  return true;
54 }
pFlow::regularParticleIdHandler::regularParticleIdHandler
regularParticleIdHandler(pointStructure &pStruct)
Definition: regularParticleIdHandler.cpp:6
pFlow::empty
Definition: empty.hpp:30
pFlow::Pair
Kokkos::pair< T1, T2 > Pair
Pair of two variables.
Definition: KokkosTypes.hpp:85
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::particleIdHandler
Definition: particleIdHandler.hpp:30
pFlow::regularParticleIdHandler::initialIdCheck
bool initialIdCheck() override
Definition: regularParticleIdHandler.cpp:35
pFlow::max
T max(const internalField< T, MemorySpace > &iField)
Definition: internalFieldAlgorithms.hpp:79
pFlow::regularParticleIdHandler::getIdRange
Pair< uint32, uint32 > getIdRange(uint32 nNewParticles) override
Definition: regularParticleIdHandler.cpp:16
pFlow::regularParticleIdHandler::maxId_
uint32 maxId_
Definition: regularParticleIdHandler.hpp:34
regularParticleIdHandler.hpp
pFlow::pointStructure
Definition: pointStructure.hpp:34
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::fillSequence
void fillSequence(internalField< T, MemorySpace > &iField, const T &startVal)
Definition: internalFieldAlgorithms.hpp:198