Some debugging (initialization of arrays etc.).

This commit is contained in:
tlichtenegger
2018-04-23 14:15:34 +02:00
parent d8682c6a79
commit bdfdb23cdd
4 changed files with 22 additions and 1 deletions

View File

@ -97,6 +97,8 @@ cfdemCloud::cfdemCloud
radii_(NULL),
voidfractions_(NULL),
cellIDs_(NULL),
particleDensities_(NULL),
particleTypes_(NULL),
particleWeights_(NULL),
particleVolumes_(NULL),
particleV_(NULL),
@ -743,8 +745,10 @@ bool cfdemCloud::reAllocArrays()
dataExchangeM().allocateArray(particleWeights_,0.,voidFractionM().maxCellsPerParticle());
dataExchangeM().allocateArray(particleVolumes_,0.,voidFractionM().maxCellsPerParticle());
dataExchangeM().allocateArray(particleV_,0.,1);
Info << "\nnow allocating particle densities array.\n" << endl;
if(getParticleDensities_) dataExchangeM().allocateArray(particleDensities_,0.,1);
if(getParticleTypes_) dataExchangeM().allocateArray(particleTypes_,0.,1);
Info << "\nnow allocating particle types array.\n" << endl;
if(getParticleTypes_) dataExchangeM().allocateArray(particleTypes_,0,1);
arraysReallocated_ = true;
return true;
}

View File

@ -335,8 +335,10 @@ public:
virtual inline int maxType() {return -1;}
virtual inline bool multipleTypesDMax() {return false;}
virtual inline bool multipleTypesDMin() {return false;}
inline bool getParticleDensities() const;
virtual inline double ** particleDensity() const;
virtual inline double particleDensity(label index) const;
inline bool getParticleTypes() const;
virtual inline int ** particleTypes() const;
virtual inline label particleType(label index) const;

View File

@ -216,6 +216,11 @@ inline double cfdemCloud::d32(bool recalc)
return d32_;
}
inline bool cfdemCloud::getParticleDensities() const
{
return getParticleDensities_;
}
inline double ** cfdemCloud::particleDensity() const
{
if(!getParticleDensities_) return NULL;
@ -234,6 +239,11 @@ inline double cfdemCloud::particleDensity(label index) const
}
}
inline bool cfdemCloud::getParticleTypes() const
{
return getParticleTypes_;
}
inline int ** cfdemCloud::particleTypes() const
{
if(!getParticleTypes_) return NULL;

View File

@ -187,6 +187,11 @@ void ZehnerSchluenderThermCond::calcPartKsField() const
{
if (typeKs_.size() <= 1) return;
if (!particleCloud_.getParticleTypes())
{
FatalError << "ZehnerSchluenderThermCond needs data for more than one type, but types are not communicated." << abort(FatalError);
}
allocateMyArrays();
label cellI=0;
label partType = 0;