move methods from dataExchangeModel to cfdemCloud
methods operate directly on data owned by cfdemCloud, thus cfdemCloud should have the control over it
This commit is contained in:
@ -403,6 +403,10 @@ public:
|
||||
// Write
|
||||
|
||||
// write cfdemCloud internal data
|
||||
inline void setPositions(label n,double* pos);
|
||||
inline void setCellIDs(label n,int* ID);
|
||||
inline void setCellIDs(labelList const& IDs);
|
||||
|
||||
virtual bool evolve(volScalarField&,volVectorField&,volVectorField&);
|
||||
|
||||
virtual void postFlow() {}
|
||||
|
||||
@ -50,6 +50,25 @@ inline void cfdemCloud::setCG(double cg)
|
||||
Info << "cg is set to: " << cg_ << endl;
|
||||
}
|
||||
|
||||
inline void cfdemCloud::setPositions(label n,double* pos)
|
||||
{
|
||||
for (int i=0; i<n; ++i)
|
||||
for (int j=0; j<3; ++j)
|
||||
positions_[i][j]=pos[i*3+j];
|
||||
}
|
||||
|
||||
inline void cfdemCloud::setCellIDs(label n,int* ID)
|
||||
{
|
||||
for (int i=0; i<n; ++i)
|
||||
cellIDs_[i][0]=ID[i];
|
||||
}
|
||||
|
||||
inline void cfdemCloud::setCellIDs(labelList const& IDs)
|
||||
{
|
||||
for (int i=0; i<IDs.size(); ++i)
|
||||
cellIDs_[i][0] = IDs[i];
|
||||
}
|
||||
|
||||
inline bool cfdemCloud::impDEMdrag() const
|
||||
{
|
||||
return impDEMdrag_;
|
||||
|
||||
@ -244,27 +244,6 @@ public:
|
||||
virtual int getNumberOfTypes() const;
|
||||
virtual double* getTypeVol() const;
|
||||
|
||||
inline void setPositions(label n,double* pos)
|
||||
{
|
||||
for (int i=0;i<n;i++)
|
||||
for (int j=0;j<3;j++)
|
||||
particleCloud_.positions_[i][j]=pos[i*3+j];
|
||||
}
|
||||
|
||||
inline void setCellIDs(label n,int* ID)
|
||||
{
|
||||
for (int i=0;i<n;i++)
|
||||
particleCloud_.cellIDs_[i][0]=ID[i];
|
||||
}
|
||||
inline void setCellIDs(labelList const& ids)
|
||||
{
|
||||
for (int i = 0; i < ids.size(); i++)
|
||||
{
|
||||
particleCloud_.cellIDs_[i][0] = ids[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
virtual scalar getCG() const { Warning << "getCG() not executed correctly!" << endl; return 1.; }
|
||||
};
|
||||
|
||||
|
||||
@ -435,8 +435,8 @@ bool twoWayMany2Many::couple(int i)
|
||||
// re-allocate arrays of cloud
|
||||
particleCloud_.reAllocArrays();
|
||||
|
||||
setPositions(nlocal_foam_,pos_foam_);
|
||||
setCellIDs(nlocal_foam_,cellID_foam_);
|
||||
particleCloud_.setPositions(nlocal_foam_,pos_foam_);
|
||||
particleCloud_.setCellIDs(nlocal_foam_,cellID_foam_);
|
||||
|
||||
Info <<"Foam::twoWayMany2Many::couple(i) done." << endl;
|
||||
}
|
||||
|
||||
@ -816,11 +816,11 @@ void twoWayOne2One::locateParticles()
|
||||
extracted_flattened_positions,
|
||||
3
|
||||
);
|
||||
setPositions(getNumberOfParticles(), extracted_flattened_positions);
|
||||
particleCloud_.setPositions(getNumberOfParticles(), extracted_flattened_positions);
|
||||
destroy(extracted_flattened_positions);
|
||||
destroy(collected_flattened_positions);
|
||||
|
||||
setCellIDs(cellIds);
|
||||
particleCloud_.setCellIDs(cellIds);
|
||||
}
|
||||
|
||||
void twoWayOne2One::setupFoam2LigCommunication()
|
||||
|
||||
Reference in New Issue
Block a user