clean up namespace

This commit is contained in:
dqueteschiner
2015-04-01 11:45:24 +02:00
parent fd3a6362bf
commit 077e0ff8aa
7 changed files with 62 additions and 48 deletions

View File

@ -17,6 +17,7 @@ smoothingModels = subModels/smoothingModel
probeModels = subModels/probeModel
$(cfdemCloud)/cfdemCloud.C
$(cfdemCloud)/cfdemCloudIO.C
derived/cfdemCloudIB/cfdemCloudIB.C
derived/cfdemCloudMS/cfdemCloudMS.C

View File

@ -45,8 +45,11 @@ Description
#include "smoothingModel.H"
#include "liggghtsCommandModel.H"
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cfdemCloud::cfdemCloud
cfdemCloud::cfdemCloud
(
const fvMesh& mesh
)
@ -279,14 +282,14 @@ Foam::cfdemCloud::cfdemCloud
}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
Foam::cfdemCloud::~cfdemCloud()
cfdemCloud::~cfdemCloud()
{
clockM().evalPar();
clockM().normHist();
destroyArrays();
}
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
void Foam::cfdemCloud::getDEMdata()
void cfdemCloud::getDEMdata()
{
dataExchangeM().getData("radius","scalar-atom",radii_);
dataExchangeM().getData("x","vector-atom",positions_);
@ -296,7 +299,7 @@ void Foam::cfdemCloud::getDEMdata()
dataExchangeM().getData("dragAcc","vector-atom",fAcc_); // array is used twice - might be necessary to clean it first
}
void Foam::cfdemCloud::giveDEMdata()
void cfdemCloud::giveDEMdata()
{
if(forceM(0).coupleForce())
{
@ -316,7 +319,7 @@ void Foam::cfdemCloud::giveDEMdata()
// * * * * * * * * * * * * * * * protected Member Functions * * * * * * * * * * * * * //
void Foam::cfdemCloud::setNumberOfParticles(int nP)
void cfdemCloud::setNumberOfParticles(int nP)
{
if(nP != numberOfParticles())
{
@ -325,12 +328,12 @@ void Foam::cfdemCloud::setNumberOfParticles(int nP)
}
}
void Foam::cfdemCloud::findCells()
void cfdemCloud::findCells()
{
locateM().findCell(NULL,positions_,cellIDs_,numberOfParticles());
}
void Foam::cfdemCloud::setForces()
void cfdemCloud::setForces()
{
resetArray(fluidVel_,numberOfParticles(),3);
resetArray(impForces_,numberOfParticles(),3);
@ -340,7 +343,7 @@ void Foam::cfdemCloud::setForces()
for (int i=0;i<cfdemCloud::nrForceModels();i++) cfdemCloud::forceM(i).setForce();
}
void Foam::cfdemCloud::setParticleForceField()
void cfdemCloud::setParticleForceField()
{
averagingM().setVectorSum
(
@ -358,7 +361,7 @@ void Foam::cfdemCloud::setParticleForceField()
);
}
void Foam::cfdemCloud::setVectorAverages()
void cfdemCloud::setVectorAverages()
{
if(verbose_) Info << "- setVectorAverage(Us,velocities_,weights_)" << endl;
averagingM().setVectorAverage
@ -372,12 +375,12 @@ void Foam::cfdemCloud::setVectorAverages()
if(verbose_) Info << "setVectorAverage done." << endl;
}
// * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * //
void Foam::cfdemCloud::checkCG(bool ok)
void cfdemCloud::checkCG(bool ok)
{
if(!cgOK_) return;
if(!ok) cgOK_ = ok;
}
void Foam::cfdemCloud::setPos(double**& pos)
void cfdemCloud::setPos(double**& pos)
{
for(int index = 0;index < numberOfParticles(); ++index)
{
@ -388,49 +391,49 @@ void Foam::cfdemCloud::setPos(double**& pos)
}
// * * * * * * * * * * * * * * * ACCESS * * * * * * * * * * * * * //
label Foam::cfdemCloud::particleCell(int index)
label cfdemCloud::particleCell(int index)
{
label cellI = cellIDs()[index][0];
return cellI;
}
vector Foam::cfdemCloud::position(int index)
vector cfdemCloud::position(int index)
{
vector pos;
for(int i=0;i<3;i++) pos[i] = positions()[index][i];
return pos;
}
vector Foam::cfdemCloud::velocity(int index)
vector cfdemCloud::velocity(int index)
{
vector vel;
for(int i=0;i<3;i++) vel[i] = velocities()[index][i];
return vel;
}
vector Foam::cfdemCloud::fluidVel(int index)
vector cfdemCloud::fluidVel(int index)
{
vector vel;
for(int i=0;i<3;i++) vel[i] = fluidVels()[index][i];
return vel;
}
const forceModel& Foam::cfdemCloud::forceM(int i)
const forceModel& cfdemCloud::forceM(int i)
{
return forceModel_[i];
}
int Foam::cfdemCloud::nrForceModels()
int cfdemCloud::nrForceModels()
{
return forceModels_.size();
}
scalar Foam::cfdemCloud::voidfraction(int index)
scalar cfdemCloud::voidfraction(int index)
{
return voidfractions()[index][0];
}
label Foam::cfdemCloud::liggghtsCommandModelIndex(word name)
label cfdemCloud::liggghtsCommandModelIndex(word name)
{
int index=-1;
forAll(liggghtsCommandModelList_,i)
@ -444,12 +447,12 @@ label Foam::cfdemCloud::liggghtsCommandModelIndex(word name)
return index;
}
std::vector< std::vector<double*> >* Foam::cfdemCloud::getVprobe()
std::vector< std::vector<double*> >* cfdemCloud::getVprobe()
{
return probeModel_->getVprobe();
}
std::vector< std::vector<double> >* Foam::cfdemCloud::getSprobe()
std::vector< std::vector<double> >* cfdemCloud::getSprobe()
{
return probeModel_->getSprobe();
}
@ -458,7 +461,7 @@ std::vector< std::vector<double> >* Foam::cfdemCloud::getSprobe()
// * * * write cfdemCloud internal data * * * //
bool Foam::cfdemCloud::evolve
bool cfdemCloud::evolve
(
volScalarField& alpha,
volVectorField& Us,
@ -597,7 +600,7 @@ bool Foam::cfdemCloud::evolve
return doCouple;
}
void Foam::cfdemCloud::destroyArrays()
void cfdemCloud::destroyArrays()
{
dataExchangeM().destroy(positions_,3);
dataExchangeM().destroy(velocities_,3);
@ -615,7 +618,7 @@ void Foam::cfdemCloud::destroyArrays()
dataExchangeM().destroy(particleV_,1);
}
void Foam::cfdemCloud::allocArrays()
void cfdemCloud::allocArrays()
{
dataExchangeM().allocateArray(positions_,0.,3);
dataExchangeM().allocateArray(velocities_,0.,3);
@ -633,7 +636,7 @@ void Foam::cfdemCloud::allocArrays()
dataExchangeM().allocateArray(particleV_,0.,1);
}
void Foam::cfdemCloud::allocArrays(int nP)
void cfdemCloud::allocArrays(int nP)
{
dataExchangeM().allocateArray(positions_,0.,3,nP);
dataExchangeM().allocateArray(velocities_,0.,3,nP);
@ -649,7 +652,7 @@ void Foam::cfdemCloud::allocArrays(int nP)
dataExchangeM().allocateArray(particleVolumes_,0.,voidFractionM().maxCellsPerParticle(),nP);
}
bool Foam::cfdemCloud::reAllocArrays()
bool cfdemCloud::reAllocArrays()
{
if(numberOfParticlesChanged_ && !arraysReallocated_)
{
@ -663,7 +666,7 @@ bool Foam::cfdemCloud::reAllocArrays()
return false;
}
bool Foam::cfdemCloud::reAllocArrays(int nP, bool forceRealloc)
bool cfdemCloud::reAllocArrays(int nP, bool forceRealloc)
{
if( (numberOfParticlesChanged_ && !arraysReallocated_) || forceRealloc)
{
@ -746,8 +749,9 @@ void cfdemCloud::resetArray(double**& array,int length,int width,double resetVal
}
}
}
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
#include "cfdemCloudIO.C"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -177,7 +177,7 @@ inline double ** cfdemCloud::particleWeights() const
return particleWeights_;
}
inline label Foam::cfdemCloud::body(int index)
inline label cfdemCloud::body(int index)
{
return index;
}

View File

@ -32,6 +32,9 @@ Description
#include "cfdemCloud.H"
namespace Foam
{
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -45,7 +48,7 @@ Description
// * * * * * * * * * * * * * * * IO * * * * * * * * * * * * * //
void Foam::cfdemCloud::writeScalarFieldToTerminal(double**& array)
void cfdemCloud::writeScalarFieldToTerminal(double**& array)
{
// init double array
for (int i=0; i<numberOfParticles(); i++)
@ -54,7 +57,7 @@ void Foam::cfdemCloud::writeScalarFieldToTerminal(double**& array)
}
}
void Foam::cfdemCloud::writeVectorFieldToTerminal(double**& array)
void cfdemCloud::writeVectorFieldToTerminal(double**& array)
{
// init double array
for (int i=0; i<numberOfParticles(); i++)
@ -65,4 +68,8 @@ void Foam::cfdemCloud::writeVectorFieldToTerminal(double**& array)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -79,7 +79,7 @@ cfdemCloudIB::~cfdemCloudIB()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::cfdemCloudIB::getDEMdata()
void cfdemCloudIB::getDEMdata()
{
cfdemCloud::getDEMdata();
Info << "=== cfdemCloudIB::getDEMdata() === particle rotation not considered in CFD" << endl;
@ -111,7 +111,7 @@ bool cfdemCloudIB::reAllocArrays()
return false;
}
bool Foam::cfdemCloudIB::evolve()
bool cfdemCloudIB::evolve()
{
numberOfParticlesChanged_ = false;
arraysReallocated_=false;
@ -172,7 +172,7 @@ bool Foam::cfdemCloudIB::evolve()
return doCouple;
}
void Foam::cfdemCloudIB::calcVelocityCorrection
void cfdemCloudIB::calcVelocityCorrection
(
volScalarField& p,
volVectorField& U,
@ -238,7 +238,7 @@ void Foam::cfdemCloudIB::calcVelocityCorrection
}
vector Foam::cfdemCloudIB::angularVelocity(int index)
vector cfdemCloudIB::angularVelocity(int index)
{
vector vel;
for(int i=0;i<3;i++) vel[i] = angularVelocities_[index][i];

View File

@ -151,7 +151,7 @@ void cfdemCloudMS::getDEMdata()
//dataExchangeM().getScalarData("Cclump_ey",Cclump_ey_); // cross section of the clump in ey normal direction
}
void Foam::cfdemCloudMS::giveDEMdata()
void cfdemCloudMS::giveDEMdata()
{
/*for(int index = 0;index < numberOfClumps(); ++index)
{
@ -223,7 +223,7 @@ bool cfdemCloudMS::reAllocArrays()
return false;
}
void Foam::cfdemCloudMS::setNumberOfParticles(int nP)
void cfdemCloudMS::setNumberOfParticles(int nP)
{
cfdemCloud::setNumberOfParticles(nP);
int nC = dataExchangeM().getNumberOfClumps();
@ -238,13 +238,13 @@ void Foam::cfdemCloudMS::setNumberOfParticles(int nP)
numberOfClumps_ = min(numberOfParticles(),numberOfClumps_);
}
void Foam::cfdemCloudMS::findCells()
void cfdemCloudMS::findCells()
{
cfdemCloud::findCells();
locateM().findCell(NULL,positionsCM_,cellIDsCM_,numberOfClumps());
}
void Foam::cfdemCloudMS::setForces()
void cfdemCloudMS::setForces()
{
resetArray(impForces_,numberOfParticles(),3);
resetArray(expForces_,numberOfParticles(),3);
@ -258,7 +258,7 @@ void Foam::cfdemCloudMS::setForces()
for (int i=0;i<cfdemCloudMS::nrForceModels();i++) cfdemCloudMS::forceM(i).setForce();
}
void Foam::cfdemCloudMS::setParticleForceField()
void cfdemCloudMS::setParticleForceField()
{
// set forces per particle
cfdemCloud::setParticleForceField();
@ -287,7 +287,7 @@ void Foam::cfdemCloudMS::setParticleForceField()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// PUBLIC MEMBER FUNCTIONS
const forceModel& Foam::cfdemCloudMS::forceM(int i)
const forceModel& cfdemCloudMS::forceM(int i)
{
return forceModel_[i];
}

View File

@ -29,12 +29,14 @@ Description
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
#include "cfdemCloudMS.H"
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline label Foam::cfdemCloudMS::body(int index)
inline label cfdemCloudMS::body(int index)
{
return bodies_[0][index]-1;
}
@ -54,31 +56,31 @@ inline double cfdemCloudMS::particleVolume(int index)
return Vp;
}
inline vector Foam::cfdemCloudMS::positionCM(int index)
inline vector cfdemCloudMS::positionCM(int index)
{
vector pos;
for(int i=0;i<3;i++) pos[i] = positionsCM()[index][i];
return pos;
}
inline vector Foam::cfdemCloudMS::velocityCM(int index)
inline vector cfdemCloudMS::velocityCM(int index)
{
vector vel;
for(int i=0;i<3;i++) vel[i] = velocitiesCM()[index][i];
return vel;
}
inline label Foam::cfdemCloudMS::cellIDCM(int index)
inline label cfdemCloudMS::cellIDCM(int index)
{
return cellIDsCM_[index][0];
}
inline label Foam::cfdemCloudMS::nrigid(int index)
inline label cfdemCloudMS::nrigid(int index)
{
return nrigids_[0][index];
}
inline int Foam::cfdemCloudMS::nrForceModels()
inline int cfdemCloudMS::nrForceModels()
{
return forceModels_.size();
}