mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
correction in the macros to be compatible with OpenFOAM
This commit is contained in:
@ -29,7 +29,7 @@ bool pFlow::geometry::findPropertyId()
|
||||
propId.clear();
|
||||
|
||||
uint32 pId;
|
||||
forAll(matI, materialName_)
|
||||
ForAll(matI, materialName_)
|
||||
{
|
||||
|
||||
if( !wallProperty_.nameToIndex( materialName_[matI], pId ) )
|
||||
@ -249,11 +249,11 @@ pFlow::uniquePtr<pFlow::geometry>
|
||||
|
||||
auto geomModel = angleBracketsNames("geometry", model);
|
||||
|
||||
Report(1)<< "Selecting geometry model . . ."<<endReport;
|
||||
REPORT(1)<< "Selecting geometry model . . ."<<endREPORT;
|
||||
if( systemControlvCtorSelector_.search(geomModel) )
|
||||
{
|
||||
auto objPtr = systemControlvCtorSelector_[geomModel] (control, prop);
|
||||
Report(2)<<"Model "<< greenText(geomModel)<<" is created.\n"<<endReport;
|
||||
REPORT(2)<<"Model "<< greenText(geomModel)<<" is created.\n"<<endREPORT;
|
||||
return objPtr;
|
||||
}
|
||||
else
|
||||
@ -285,7 +285,7 @@ pFlow::uniquePtr<pFlow::geometry>
|
||||
|
||||
auto geomModel = angleBracketsNames("geometry", model);
|
||||
|
||||
Report(1)<< "Selecting geometry model . . ."<<endReport;
|
||||
REPORT(1)<< "Selecting geometry model . . ."<<endREPORT;
|
||||
|
||||
if( dictionaryvCtorSelector_.search(geomModel) )
|
||||
{
|
||||
@ -298,7 +298,7 @@ pFlow::uniquePtr<pFlow::geometry>
|
||||
motionCompName,
|
||||
propName
|
||||
);
|
||||
Report(2)<<"Model "<< greenText(geomModel)<<" is created.\n"<<endReport;
|
||||
REPORT(2)<<"Model "<< greenText(geomModel)<<" is created.\n"<<endREPORT;
|
||||
return objPtr;
|
||||
}
|
||||
else
|
||||
|
@ -53,7 +53,7 @@ bool pFlow::geometryMotion<MotionModel>::findMotionIndex()
|
||||
triMotionIndex_.reserve( this->surface().capacity() );
|
||||
triMotionIndex_.clear();
|
||||
|
||||
forAll( surfI, motionComponentName_)
|
||||
ForAll( surfI, motionComponentName_)
|
||||
{
|
||||
auto mName = motionComponentName_[surfI];
|
||||
auto mInd = motionModel_.nameToIndex(mName);
|
||||
@ -71,7 +71,7 @@ bool pFlow::geometryMotion<MotionModel>::findMotionIndex()
|
||||
pointMotionIndex_.reserve(triSurface_.numPoints());
|
||||
pointMotionIndex_.clear();
|
||||
|
||||
forAll(surfI, motionIndex_)
|
||||
ForAll(surfI, motionIndex_)
|
||||
{
|
||||
auto nP = triSurface_.surfNumPoints(surfI);
|
||||
for(int32 i=0; i<nP; i++)
|
||||
|
@ -135,7 +135,7 @@ protected:
|
||||
|
||||
realVector etha_n(nElem);
|
||||
realVector etha_t(nElem);
|
||||
forAll(i , kn)
|
||||
ForAll(i , kn)
|
||||
{
|
||||
etha_n[i] = -2.0*log(en[i])*sqrt(kn[i])/
|
||||
sqrt(pow(log(en[i]),2.0)+ pow(Pi,2.0));
|
||||
@ -145,7 +145,7 @@ protected:
|
||||
}
|
||||
|
||||
Vector<linearProperties> prop(nElem);
|
||||
forAll(i,kn)
|
||||
ForAll(i,kn)
|
||||
{
|
||||
prop[i] = {kn[i], kt[i], etha_n[i], etha_t[i], mu[i]};
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ protected:
|
||||
|
||||
realVector etha_n(nElem);
|
||||
|
||||
forAll(i , en)
|
||||
ForAll(i , en)
|
||||
{
|
||||
//K_hertz = 4.0/3.0*Yeff*sqrt(Reff);
|
||||
//-2.2664*log(en)*sqrt(meff*K_hertz)/sqrt( log(en)**2 + 10.1354);
|
||||
@ -138,7 +138,7 @@ protected:
|
||||
}
|
||||
|
||||
Vector<nonLinearProperties> prop(nElem);
|
||||
forAll(i,Yeff)
|
||||
ForAll(i,Yeff)
|
||||
{
|
||||
prop[i] = {Yeff[i], Geff[i], etha_n[i], mu[i]};
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ protected:
|
||||
|
||||
|
||||
Vector<nonLinearProperties> prop(nElem);
|
||||
forAll(i,Yeff)
|
||||
ForAll(i,Yeff)
|
||||
{
|
||||
prop[i] = {Yeff[i], Geff[i], etha_n[i], mu[i]};
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ public:
|
||||
position,
|
||||
diam
|
||||
);
|
||||
Report(2)<<"Contact search algorithm for particle-particle is "<<
|
||||
greenText(particleContactSearch_().typeName())<<endReport;
|
||||
REPORT(2)<<"Contact search algorithm for particle-particle is "<<
|
||||
greenText(particleContactSearch_().typeName())<<endREPORT;
|
||||
|
||||
|
||||
auto wmDict = dict().subDict(wmMethod+"Info");
|
||||
@ -120,8 +120,8 @@ public:
|
||||
wPoints,
|
||||
wVertices
|
||||
);
|
||||
Report(2)<<"Wall mapping algorithm for particle-wall is "<<
|
||||
greenText(wallMapping_().typeName())<< endReport;
|
||||
REPORT(2)<<"Wall mapping algorithm for particle-wall is "<<
|
||||
greenText(wallMapping_().typeName())<< endREPORT;
|
||||
|
||||
}
|
||||
|
||||
|
@ -53,13 +53,13 @@ pFlow::uniquePtr<pFlow::contactSearch> pFlow::contactSearch::create(
|
||||
auto model = angleBracketsNames2("ContactSearch", baseMethName, wallMethod);
|
||||
|
||||
|
||||
Report(1)<<"Selecting contact search model . . ."<<endReport;
|
||||
REPORT(1)<<"Selecting contact search model . . ."<<endREPORT;
|
||||
|
||||
|
||||
if( dictionaryvCtorSelector_.search(model))
|
||||
{
|
||||
auto objPtr = dictionaryvCtorSelector_[model] (dict, domain, prtcl, geom, timers);
|
||||
Report(2)<<"Model "<< greenText(model)<<" is created."<<endReport;
|
||||
REPORT(2)<<"Model "<< greenText(model)<<" is created."<<endREPORT;
|
||||
return objPtr;
|
||||
}
|
||||
else
|
||||
|
@ -200,8 +200,8 @@ public:
|
||||
|
||||
pairs.increaseCapacityBy(len);
|
||||
|
||||
Info<< "The contact pair container capacity increased from "<<
|
||||
oldCap << " to "<<pairs.capacity()<<" in NBSLevel0."<<endInfo;
|
||||
INFORMATION<< "The contact pair container capacity increased from "<<
|
||||
oldCap << " to "<<pairs.capacity()<<" in NBSLevel0."<<endINFO;
|
||||
|
||||
}
|
||||
|
||||
|
@ -108,11 +108,11 @@ protected:
|
||||
copy(sizeRangeLevels_, sizeRangeLevelsHost_);
|
||||
copy(maxSizeLevels_, maxSizeLevelsHost_);
|
||||
|
||||
Report(2)<<"Grids with "<< yellowText(numLevels_)<< " levels have been created."<<endReport;
|
||||
REPORT(2)<<"Grids with "<< yellowText(numLevels_)<< " levels have been created."<<endREPORT;
|
||||
for(int32 lvl=0; lvl<numLevels_; lvl++)
|
||||
{
|
||||
Report(3)<<"Cell gird No "<< yellowText(lvl)<<" with size range ("
|
||||
<<sizeRangeLevelsHost_[lvl].first<<","<<sizeRangeLevelsHost_[lvl].second<<"]."<<endReport;
|
||||
REPORT(3)<<"Cell gird No "<< yellowText(lvl)<<" with size range ("
|
||||
<<sizeRangeLevelsHost_[lvl].first<<","<<sizeRangeLevelsHost_[lvl].second<<"]."<<endREPORT;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -235,8 +235,8 @@ public:
|
||||
|
||||
pairs.increaseCapacityBy(len);
|
||||
|
||||
Info<< "The contact pair container capacity increased from "<<
|
||||
oldCap << " to "<<pairs.capacity()<<" in NBSLevels."<<endInfo;
|
||||
INFORMATION<< "The contact pair container capacity increased from "<<
|
||||
oldCap << " to "<<pairs.capacity()<<" in NBSLevels."<<endINFO;
|
||||
|
||||
}
|
||||
|
||||
|
@ -196,9 +196,9 @@ public:
|
||||
auto oldCap = pairs.capacity();
|
||||
pairs.increaseCapacityBy(len);
|
||||
|
||||
Info<<"Contact pair container capacity increased from "<<
|
||||
INFORMATION<<"Contact pair container capacity increased from "<<
|
||||
oldCap << " to "
|
||||
<< pairs.capacity() <<" in cellsWallLevel0."<<endInfo;
|
||||
<< pairs.capacity() <<" in cellsWallLevel0."<<endINFO;
|
||||
|
||||
Kokkos::fence();
|
||||
}
|
||||
|
@ -132,9 +132,9 @@ public:
|
||||
auto oldCap = pairs.capacity();
|
||||
pairs.increaseCapacityBy(len);
|
||||
|
||||
Info<<"Contact pair container capacity increased from "<<
|
||||
INFORMATION<<"Contact pair container capacity increased from "<<
|
||||
oldCap << " to "
|
||||
<< pairs.capacity() <<" in cellsWallLevels."<<endInfo;
|
||||
<< pairs.capacity() <<" in cellsWallLevels."<<endINFO;
|
||||
|
||||
Kokkos::fence();
|
||||
}
|
||||
|
@ -115,8 +115,8 @@ public:
|
||||
)
|
||||
{
|
||||
|
||||
Report(3)<<"Multi-grid wall mapping with "<<
|
||||
yellowText(numLevels)<<" levels has been created."<<endReport;
|
||||
REPORT(3)<<"Multi-grid wall mapping with "<<
|
||||
yellowText(numLevels)<<" levels has been created."<<endREPORT;
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,14 +79,14 @@ pFlow::uniquePtr<pFlow::interaction> pFlow::interaction::create
|
||||
clType);
|
||||
|
||||
|
||||
Report(1)<< "Selecting interaction model..."<<endReport;
|
||||
REPORT(1)<< "Selecting interaction model..."<<endREPORT;
|
||||
if( systemControlvCtorSelector_.search(interactionModel) )
|
||||
{
|
||||
auto objPtr =
|
||||
systemControlvCtorSelector_[interactionModel]
|
||||
(control, prtcl, geom);
|
||||
|
||||
Report(2)<<"Model "<<greenText(interactionModel)<<" is created."<<endReport;
|
||||
REPORT(2)<<"Model "<<greenText(interactionModel)<<" is created."<<endREPORT;
|
||||
return objPtr;
|
||||
}
|
||||
else
|
||||
|
@ -30,7 +30,7 @@ bool pFlow::sphereInteraction<contactForceModel,geometryMotionModel, contactList
|
||||
|
||||
auto modelDict = this->fileDict().subDict("model");
|
||||
|
||||
Report(1)<<"Createing contact force model . . ."<<endReport;
|
||||
REPORT(1)<<"Createing contact force model . . ."<<endREPORT;
|
||||
forceModel_ = makeUnique<ContactForceModel>(
|
||||
this->numMaterials(),
|
||||
rhoD.deviceVector(),
|
||||
|
@ -96,7 +96,7 @@ bool pFlow::rotatingAxisMotion::writeDictionary
|
||||
|
||||
auto& motionInfo = dict.subDictOrCreate("rotatingAxisMotionInfo");
|
||||
|
||||
forAll(i, axis_)
|
||||
ForAll(i, axis_)
|
||||
{
|
||||
|
||||
auto& axDict = motionInfo.subDictOrCreate(axisName_[i]);
|
||||
|
@ -37,7 +37,7 @@ bool pFlow::Insertion<ShapeType>::readInsertionDict
|
||||
|
||||
for(auto& name:regionDicNames)
|
||||
{
|
||||
Report(2)<<"reading insertion region "<< greenText(name)<<endReport;
|
||||
REPORT(2)<<"reading insertion region "<< greenText(name)<<endREPORT;
|
||||
regions_.push_backSafe(dict.subDict(name), shapes_);
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ bool pFlow::Insertion<ShapeType>::writeInsertionDict
|
||||
|
||||
if( !this->isActive() ) return true;
|
||||
|
||||
forAll(i,regions_)
|
||||
ForAll(i,regions_)
|
||||
{
|
||||
auto& rgnDict = dict.subDictOrCreate(regions_[i].name());
|
||||
|
||||
@ -92,7 +92,7 @@ bool pFlow::Insertion<ShapeType>::insertParticles
|
||||
if(!isActive()) return true;
|
||||
|
||||
|
||||
forAll(i,regions_)
|
||||
ForAll(i,regions_)
|
||||
{
|
||||
bool insertionOccured = false;
|
||||
auto& rgn = regions_[i];
|
||||
@ -106,9 +106,9 @@ bool pFlow::Insertion<ShapeType>::insertParticles
|
||||
|
||||
if(insertionOccured)
|
||||
{
|
||||
Report(0)<<"\nParticle insertion from "<< greenText(rgn.name())<<endReport;
|
||||
Report(1)<< cyanText(pos.size()) << " new particles is being inserted at Time: "<<
|
||||
cyanText(currentTime) <<" s."<<endReport;
|
||||
REPORT(0)<<"\nParticle insertion from "<< greenText(rgn.name())<<endREPORT;
|
||||
REPORT(1)<< cyanText(pos.size()) << " new particles is being inserted at Time: "<<
|
||||
cyanText(currentTime) <<" s."<<endREPORT;
|
||||
|
||||
if(!particles_.insertParticles(pos, shapes, rgn.setFields()))
|
||||
{
|
||||
@ -117,8 +117,8 @@ bool pFlow::Insertion<ShapeType>::insertParticles
|
||||
" to particles. \n";
|
||||
return false;
|
||||
}
|
||||
Report(1)<<"Total number of particles inserted from this region is "<<
|
||||
cyanText(rgn.totalInserted())<<'\n'<<endReport;
|
||||
REPORT(1)<<"Total number of particles inserted from this region is "<<
|
||||
cyanText(rgn.totalInserted())<<'\n'<<endREPORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -130,8 +130,8 @@ bool pFlow::Insertion<ShapeType>::insertParticles
|
||||
{
|
||||
if(insertionOccured)
|
||||
{
|
||||
Warning<< "\n fewer number of particles are inserted from region "<< rgn.name() <<
|
||||
" than expected. You may stop the simulation to change settings."<<endWarning;
|
||||
yWARNING<< "\n fewer number of particles are inserted from region "<< rgn.name() <<
|
||||
" than expected. You may stop the simulation to change settings."<<endyWARNING;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
@ -28,7 +28,7 @@ bool pFlow::InsertionRegion<ShapeType>::checkForContact
|
||||
)
|
||||
{
|
||||
|
||||
forAll(i, pos)
|
||||
ForAll(i, pos)
|
||||
{
|
||||
if( length(pos[i]-p) < 0.5*(diams[i]+d) ) return true;
|
||||
}
|
||||
|
@ -33,11 +33,11 @@ bool pFlow::insertion::readInsertionDict
|
||||
active_ = dict.getVal<Logical>("active");
|
||||
|
||||
if(active_)
|
||||
Report(1)<< "Particle insertion mechanism is "<<
|
||||
yellowText("active")<<" in the simulation."<<endReport;
|
||||
REPORT(1)<< "Particle insertion mechanism is "<<
|
||||
yellowText("active")<<" in the simulation."<<endREPORT;
|
||||
else
|
||||
Report(1)<< "Particle insertion mechanism is "<<
|
||||
yellowText("not active")<<" in the simulation."<<endReport;
|
||||
REPORT(1)<< "Particle insertion mechanism is "<<
|
||||
yellowText("not active")<<" in the simulation."<<endREPORT;
|
||||
|
||||
|
||||
return true;
|
||||
|
@ -37,7 +37,7 @@ pFlow::shapeMixture::shapeMixture
|
||||
pFlow::word pFlow::shapeMixture::getNextShapeName()
|
||||
{
|
||||
|
||||
forAll(i, names_)
|
||||
ForAll(i, names_)
|
||||
{
|
||||
if(current_[i]< number_[i])
|
||||
{
|
||||
@ -116,7 +116,7 @@ bool pFlow::shapeMixture::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
current_.clear();
|
||||
forAll(i, numberInserted_)
|
||||
ForAll(i, numberInserted_)
|
||||
{
|
||||
current_.push_back(numberInserted_[i]%number_[i]);
|
||||
}
|
||||
@ -130,7 +130,7 @@ bool pFlow::shapeMixture::write
|
||||
) const
|
||||
{
|
||||
|
||||
forAll(i, names_)
|
||||
ForAll(i, names_)
|
||||
{
|
||||
if(!dict.add(names_[i],number_[i]))
|
||||
{
|
||||
|
@ -84,13 +84,13 @@ bool pFlow::sphereParticles::beforeIteration()
|
||||
|
||||
intPredictTimer_.start();
|
||||
|
||||
//Info<<"before dyn predict"<<endInfo;
|
||||
//INFO<<"before dyn predict"<<endINFO;
|
||||
dynPointStruct_.predict(this->dt(), accelertion_);
|
||||
//Info<<"after dyn predict"<<endInfo;
|
||||
//INFO<<"after dyn predict"<<endINFO;
|
||||
|
||||
//Info<<"before revel predict"<<endInfo;
|
||||
//INFO<<"before revel predict"<<endINFO;
|
||||
rVelIntegration_().predict(this->dt(),rVelocity_, rAcceleration_);
|
||||
//Info<<"after rvel predict"<<endInfo;
|
||||
//INFO<<"after rvel predict"<<endINFO;
|
||||
|
||||
intPredictTimer_.end();
|
||||
|
||||
@ -102,7 +102,7 @@ bool pFlow::sphereParticles::iterate()
|
||||
{
|
||||
|
||||
accelerationTimer_.start();
|
||||
//Info<<"before accelerationTimer_ "<<endInfo;
|
||||
//INFO<<"before accelerationTimer_ "<<endINFO;
|
||||
pFlow::sphereParticlesKernels::acceleration(
|
||||
control().g(),
|
||||
mass().deviceVectorAll(),
|
||||
@ -116,11 +116,11 @@ bool pFlow::sphereParticles::iterate()
|
||||
accelerationTimer_.end();
|
||||
|
||||
intCorrectTimer_.start();
|
||||
//Info<<"before correct dyn "<<endInfo;
|
||||
//INFO<<"before correct dyn "<<endINFO;
|
||||
dynPointStruct_.correct(this->dt(), accelertion_);
|
||||
//Info<<"after correct dyn "<<endInfo;
|
||||
//INFO<<"after correct dyn "<<endINFO;
|
||||
rVelIntegration_().correct(this->dt(), rVelocity_, rAcceleration_);
|
||||
//Info<<"after correct rvel "<<endInfo;
|
||||
//INFO<<"after correct rvel "<<endINFO;
|
||||
intCorrectTimer_.end();
|
||||
|
||||
return true;
|
||||
@ -158,7 +158,7 @@ bool pFlow::sphereParticles::insertSphereParticles(
|
||||
real d, m, I;
|
||||
int8 pId;
|
||||
|
||||
forAll(i, names )
|
||||
ForAll(i, names )
|
||||
{
|
||||
if (diameterMassInertiaPropId(names[i], d, m, I, pId))
|
||||
{
|
||||
@ -280,8 +280,8 @@ pFlow::sphereParticles::sphereParticles(
|
||||
|
||||
{
|
||||
|
||||
Report(1)<<"Creating integration method "<<greenText(this->integrationMethod())
|
||||
<< " for rotational velocity."<<endReport;
|
||||
REPORT(1)<<"Creating integration method "<<greenText(this->integrationMethod())
|
||||
<< " for rotational velocity."<<endREPORT;
|
||||
|
||||
rVelIntegration_ =
|
||||
integration::create(
|
||||
@ -315,7 +315,7 @@ pFlow::sphereParticles::sphereParticles(
|
||||
rvel.push_back( hrVel[index(i)]);
|
||||
}
|
||||
|
||||
Report(2)<< "Initializing the required vectors for rotational velocity integratoin\n "<<endReport;
|
||||
REPORT(2)<< "Initializing the required vectors for rotational velocity integratoin\n "<<endREPORT;
|
||||
rVelIntegration_->setInitialVals(indexHD, rvel);
|
||||
|
||||
}
|
||||
@ -400,9 +400,9 @@ bool pFlow::sphereParticles::insertParticles
|
||||
|
||||
auto activeR = this->activeRange();
|
||||
|
||||
Report(1)<< "Active range is "<<yellowText("["<<activeR.first<<", "<<activeR.second<<")")<<
|
||||
REPORT(1)<< "Active range is "<<yellowText("["<<activeR.first<<", "<<activeR.second<<")")<<
|
||||
" and number of active points is "<< cyanText(this->numActive())<<
|
||||
" and pointStructure capacity is "<<cyanText(this->capacity())<<endReport;
|
||||
" and pointStructure capacity is "<<cyanText(this->capacity())<<endREPORT;
|
||||
|
||||
return true;
|
||||
|
||||
|
@ -56,8 +56,8 @@ pFlow::dynamicPointStructure::dynamicPointStructure
|
||||
|
||||
this->subscribe(pStruct());
|
||||
|
||||
Report(1)<< "Creating integration method "<<
|
||||
greenText(integrationMethod_)<<" for dynamicPointStructure."<<endReport;
|
||||
REPORT(1)<< "Creating integration method "<<
|
||||
greenText(integrationMethod_)<<" for dynamicPointStructure."<<endREPORT;
|
||||
|
||||
integrationPos_ = integration::create(
|
||||
"pStructPosition",
|
||||
@ -110,10 +110,10 @@ pFlow::dynamicPointStructure::dynamicPointStructure
|
||||
//output<< "pos "<< pos<<endl;
|
||||
//output<< "vel "<< vel<<endl;
|
||||
|
||||
Report(2)<< "Initializing the required vectors for position integratoin "<<endReport;
|
||||
REPORT(2)<< "Initializing the required vectors for position integratoin "<<endREPORT;
|
||||
integrationPos_->setInitialVals(indexHD, pos);
|
||||
|
||||
Report(2)<< "Initializing the required vectors for velocity integratoin\n "<<endReport;
|
||||
REPORT(2)<< "Initializing the required vectors for velocity integratoin\n "<<endREPORT;
|
||||
integrationVel_->setInitialVals(indexHD, vel);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
nextId_ = 0;
|
||||
id.modifyOnHost();
|
||||
|
||||
forAll(i,id)
|
||||
ForAll(i,id)
|
||||
{
|
||||
if(id.isActive(i))
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ template<typename T, typename... properties>
|
||||
using ViewType1D = Kokkos::View<T*,properties...>;
|
||||
|
||||
template<typename T, typename... properties>
|
||||
using DualViewType1D = Kokkos::View<T*,properties...>;
|
||||
using DualViewType1D = Kokkos::DualView<T*,properties...>;
|
||||
|
||||
template<typename T, typename... properties>
|
||||
using ViewType3D = Kokkos::View<T***,properties...>;
|
||||
|
@ -208,7 +208,7 @@ bool pFlow::Vector<T, Allocator>::insertSetElement(
|
||||
|
||||
auto hIndices = indices.hostView();
|
||||
|
||||
forAll(i, indices)
|
||||
ForAll(i, indices)
|
||||
{
|
||||
auto s = size();
|
||||
auto idx = hIndices[i];
|
||||
@ -240,7 +240,7 @@ bool pFlow::Vector<T, Allocator>::insertSetElement(
|
||||
|
||||
auto hIndices = indices.hostView();
|
||||
|
||||
forAll(i, indices)
|
||||
ForAll(i, indices)
|
||||
{
|
||||
auto s = size();
|
||||
auto idx = hIndices[i];
|
||||
@ -271,7 +271,7 @@ bool pFlow::Vector<T, Allocator>::insertSetElement
|
||||
{
|
||||
if(indices.size() == 0)return true;
|
||||
|
||||
forAll(i, indices)
|
||||
ForAll(i, indices)
|
||||
{
|
||||
auto s = size();
|
||||
auto idx = indices[i];
|
||||
@ -303,7 +303,7 @@ bool pFlow::Vector<T, Allocator>::insertSetElement
|
||||
if(indices.size() == 0)return true;
|
||||
if(indices.size() != vals.size())return false;
|
||||
|
||||
forAll(i, indices)
|
||||
ForAll(i, indices)
|
||||
{
|
||||
auto s = size();
|
||||
auto idx = indices[i];
|
||||
|
@ -68,7 +68,7 @@ inline void sort(Vector<T, Allocator>& vec)
|
||||
template<typename T, typename Allocator>
|
||||
inline int64 find(Vector<T, Allocator>& vec, const T& val)
|
||||
{
|
||||
forAll( i,vec)
|
||||
ForAll( i,vec)
|
||||
{
|
||||
if ( vec[i] == val) return static_cast<int64>(i);
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ T maxActive(const pointField<VectorDual, T, MemorySpace>& pField)
|
||||
fill_n(field, field.size(), val);
|
||||
return;
|
||||
}
|
||||
forAll(i, field)
|
||||
ForAll(i, field)
|
||||
{
|
||||
if(field.pStruct().isActive(i)) field[i] = val;
|
||||
}
|
||||
@ -191,7 +191,7 @@ template<typename T>
|
||||
void inline fillMarkedDelete( pointField<T>& field, const T& val)
|
||||
{
|
||||
if(field.pStruct().allActive())return;
|
||||
forAll(i,field)
|
||||
ForAll(i,field)
|
||||
{
|
||||
if(!field.pStruct().isActive(i)) field[i] = val;
|
||||
}
|
||||
@ -215,14 +215,14 @@ inline auto for_eachActive(pointField<T>& field, UnaryPredicate func)
|
||||
{
|
||||
if(field.pStruct().allActive())
|
||||
{
|
||||
forAll(i,field)
|
||||
ForAll(i,field)
|
||||
{
|
||||
func(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(i, field)
|
||||
ForAll(i, field)
|
||||
{
|
||||
if(field.pStruct().isActive(i)) func(i);
|
||||
}
|
||||
@ -235,14 +235,14 @@ inline bool for_eachActiveBreak(pointField<T>& field, UnaryPredicate func)
|
||||
{
|
||||
if(field.pStruct().allActive())
|
||||
{
|
||||
forAll(i,field)
|
||||
ForAll(i,field)
|
||||
{
|
||||
if(!func(i))return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(i, field)
|
||||
ForAll(i, field)
|
||||
{
|
||||
if(field.pStruct().isActive(i))
|
||||
{
|
||||
@ -258,7 +258,7 @@ inline auto for_eachMarkedDelete(pointField<T>& field, UnaryPredicate func)
|
||||
{
|
||||
if(field.pStruct().allActive()) return func;
|
||||
|
||||
forAll(i, field)
|
||||
ForAll(i, field)
|
||||
{
|
||||
if(!field.pStruct().isActive(i)) func(i);
|
||||
}
|
||||
|
@ -41,10 +41,10 @@ namespace pFlow
|
||||
|
||||
#define fatalErrorInFunction fatalErrorIn(FUNCTION_NAME)
|
||||
|
||||
#define notImplemented(functionName) \
|
||||
#define Not_Implemented(functionName) \
|
||||
notImplementedErrorMessage ((functionName), __FILE__, __LINE__ )
|
||||
|
||||
#define notImplementedFunction notImplemented(FUNCTION_NAME);
|
||||
#define notImplementedFunction Not_Implemented(FUNCTION_NAME);
|
||||
|
||||
#define ioErrorInFile( fileName, lineNumber) \
|
||||
ioErrorMessage( fileName, lineNumber, FUNCTION_NAME, __FILE__, __LINE__ )
|
||||
|
@ -68,7 +68,7 @@ Licence:
|
||||
#endif
|
||||
|
||||
|
||||
#define forAll(i, container) for(auto i=0; i < container.size(); ++i)
|
||||
#define ForAll(i, container) for(auto i=0; i < container.size(); ++i)
|
||||
|
||||
#ifdef USE_STD_PARALLEL_ALG
|
||||
static inline const bool useStdParallel__ = true;
|
||||
|
@ -85,7 +85,7 @@ bool pFlow::Time::write
|
||||
{
|
||||
if(outputToFile())
|
||||
{
|
||||
Report(0)<<"\nWriting to file at time: "<< cyanText(currentTimeWord())<<endReport;
|
||||
REPORT(0)<<"\nWriting to file at time: "<< cyanText(currentTimeWord())<<endREPORT;
|
||||
return repository::write(verbose);
|
||||
}
|
||||
return true;
|
||||
|
@ -158,7 +158,7 @@ public:
|
||||
currentTime_ += dt_;
|
||||
if(screenReport())
|
||||
{
|
||||
Report(0)<<"Time (s): "<<cyanText( currentTimeWord() )<<endReport;
|
||||
REPORT(0)<<"Time (s): "<<cyanText( currentTimeWord() )<<endREPORT;
|
||||
}
|
||||
// switch outputToFile_ on/off
|
||||
checkForOutputToFile();
|
||||
|
@ -245,7 +245,7 @@ bool pFlow::repository::write
|
||||
{
|
||||
if(verbose)
|
||||
{
|
||||
Report(1)<< "Writing to " << obj.second.path()<<endReport;
|
||||
REPORT(1)<< "Writing to " << obj.second.path()<<endREPORT;
|
||||
}
|
||||
|
||||
if(!obj.second.write())
|
||||
|
@ -50,8 +50,8 @@ void* pFlow::setFieldEntry::setPointFieldDefaultValueNew
|
||||
Type defValue = entry_.secondPartVal<Type>();
|
||||
|
||||
if(verbose)
|
||||
Report(2)<<"Creating pointField " << greenText(fieldName())<< " with default value " << cyanText(defValue)<<
|
||||
" in repository "<< owner.name() <<endReport;
|
||||
REPORT(2)<<"Creating pointField " << greenText(fieldName())<< " with default value " << cyanText(defValue)<<
|
||||
" in repository "<< owner.name() <<endREPORT;
|
||||
|
||||
|
||||
auto& field =
|
||||
@ -85,8 +85,8 @@ void* pFlow::setFieldEntry::setPointFieldDefaultValueStdNew
|
||||
Type defValue = entry_.secondPartVal<Type>();
|
||||
|
||||
if(verbose)
|
||||
Report(2)<<"Creating pointField " << greenText(fieldName())<< " with default value " << cyanText(defValue)<<
|
||||
" in repository "<< owner.name() <<endReport;
|
||||
REPORT(2)<<"Creating pointField " << greenText(fieldName())<< " with default value " << cyanText(defValue)<<
|
||||
" in repository "<< owner.name() <<endREPORT;
|
||||
|
||||
// by default we perform operations on host
|
||||
auto& field =
|
||||
@ -129,8 +129,8 @@ void* pFlow::setFieldEntry::setPointFieldSelected
|
||||
Type value = entry_.secondPartVal<Type>();
|
||||
|
||||
if(verbose)
|
||||
Report(2)<< "Setting selected points of " << greenText(fName)
|
||||
<< " to value " << cyanText(value) <<endReport;
|
||||
REPORT(2)<< "Setting selected points of " << greenText(fName)
|
||||
<< " to value " << cyanText(value) <<endREPORT;
|
||||
|
||||
|
||||
auto fieldTypeName = owner.lookupObjectTypeName(fName);
|
||||
@ -196,8 +196,8 @@ void* pFlow::setFieldEntry::setPointFieldSelectedStd
|
||||
Type value = entry_.secondPartVal<Type>();
|
||||
|
||||
if(verbose)
|
||||
Report(2)<< "Setting selected points of " << greenText(fName)
|
||||
<< " to value " << cyanText(value) <<endReport;
|
||||
REPORT(2)<< "Setting selected points of " << greenText(fName)
|
||||
<< " to value " << cyanText(value) <<endREPORT;
|
||||
|
||||
|
||||
auto fieldTypeName = owner.lookupObjectTypeName(fName);
|
||||
|
@ -34,16 +34,17 @@ namespace pFlow
|
||||
#define cyanText(text) cyanColor<<text<<defaultColor
|
||||
#define boldText(text) boldChar<<text<<defaultColor
|
||||
|
||||
#define Info pFlow::output<<boldChar<<magentaColor<<"> Info: "<<defaultColor<<magentaColor
|
||||
#define endInfo defaultColor<<pFlow::nl
|
||||
#define INFORMATION pFlow::output<<boldChar<<magentaColor<<"> INFO: "<<defaultColor<<magentaColor
|
||||
#define endINFO defaultColor<<pFlow::nl
|
||||
|
||||
#define Report(n) pFlow::output.space(2*n)
|
||||
#define endReport pFlow::nl
|
||||
#define REPORT(n) pFlow::output.space(2*n)
|
||||
#define endREPORT pFlow::nl
|
||||
|
||||
#define Warning pFlow::output<<boldChar<<yellowColor<<"> Warning\n"<<defaultColor<<yellowColor<<" "
|
||||
#define endWarning defaultColor<<pFlow::nl
|
||||
|
||||
#define Err pFlow::output<<boldChar<<redColor<<"> Error\n"<<defaultColor<<redColor<<" "
|
||||
#define endErr defaultColor<<pFlow::nl
|
||||
#define yWARNING pFlow::output<<boldChar<<yellowColor<<"> WARNING\n"<<defaultColor<<yellowColor<<" "
|
||||
#define endyWARNING defaultColor<<pFlow::nl
|
||||
|
||||
#define ERR pFlow::output<<boldChar<<redColor<<"> ERROR\n"<<defaultColor<<redColor<<" "
|
||||
#define endERR defaultColor<<pFlow::nl
|
||||
|
||||
#endif
|
||||
|
@ -116,6 +116,11 @@ iIstream& operator >>(iIstream& is, box& b);
|
||||
FUNCTION_H
|
||||
iOstream& operator << (iOstream& os, const box& b);
|
||||
|
||||
INLINE_FUNCTION_HD
|
||||
box extendBox(const box& b, const realx3& dl)
|
||||
{
|
||||
return box(b.minPoint()-dl , b.maxPoint()+dl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ pFlow::uniquePtr<pFlow::int32IndexContainer>
|
||||
|
||||
newPoints.clear();
|
||||
int32 numAdded = 0;
|
||||
forAll(i, pointFlag_)
|
||||
ForAll(i, pointFlag_)
|
||||
{
|
||||
if(!isActive(i))
|
||||
{
|
||||
@ -469,7 +469,7 @@ pFlow::pointStructure::newPointsIndices(
|
||||
// otherwise scan the points from first to the end to find empty spaces
|
||||
newPoints.clear();
|
||||
int32 numAdded = 0;
|
||||
forAll(i, pointFlag_)
|
||||
ForAll(i, pointFlag_)
|
||||
{
|
||||
if(!isActive(i))
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ void pFlow::selectBox::selectAllPointsInBox()
|
||||
selectedPoints_.clear();
|
||||
auto pPos = pStruct().pointPosition().hostVector();
|
||||
|
||||
forAll(i , pPos)
|
||||
ForAll(i , pPos)
|
||||
{
|
||||
if( box_.isInside( pPos[i] )) selectedPoints_.push_back(i);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ void pFlow::multiTriSurface::calculateVars()
|
||||
|
||||
pointsStartPos_.push_back(0);
|
||||
|
||||
forAll( i, surfaceNumPoints_)
|
||||
ForAll( i, surfaceNumPoints_)
|
||||
{
|
||||
if(i==0)continue;
|
||||
|
||||
@ -72,7 +72,7 @@ void pFlow::multiTriSurface::calculateVars()
|
||||
verticesStartPos_.clear();
|
||||
|
||||
verticesStartPos_.push_back(0);
|
||||
forAll(i, surfaceNumVertices_)
|
||||
ForAll(i, surfaceNumVertices_)
|
||||
{
|
||||
if(i==0)continue;
|
||||
verticesStartPos_.push_back(verticesStartPos_[i-1] + surfaceNumVertices_[i-1]);
|
||||
|
@ -22,9 +22,9 @@ Licence:
|
||||
#define __initialize_hpp__
|
||||
|
||||
// initilized and finalize should be placed in onc scope
|
||||
Report(0)<<"Initializing host/device execution spaces . . . \n";
|
||||
Report(1)<<"Host execution space is "<< greenText(pFlow::DefaultHostExecutionSpace::name())<<endReport;
|
||||
Report(1)<<"Device execution space is "<<greenText(pFlow::DefaultExecutionSpace::name())<<endReport;
|
||||
REPORT(0)<<"Initializing host/device execution spaces . . . \n";
|
||||
REPORT(1)<<"Host execution space is "<< greenText(pFlow::DefaultHostExecutionSpace::name())<<endREPORT;
|
||||
REPORT(1)<<"Device execution space is "<<greenText(pFlow::DefaultExecutionSpace::name())<<endREPORT;
|
||||
|
||||
Kokkos::initialize( argc, argv );
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ Licence:
|
||||
// initilized and finalize should be placed in onc scope
|
||||
#include "initialize.hpp"
|
||||
|
||||
Report(0)<<"\nCreating Control repository . . ."<<endReport;
|
||||
REPORT(0)<<"\nCreating Control repository . . ."<<endREPORT;
|
||||
pFlow::uniquePtr<pFlow::systemControl> ControlPtr = nullptr;
|
||||
|
||||
if(isCoupling)
|
||||
|
@ -22,7 +22,7 @@ Licence:
|
||||
#ifndef __setProperty_hpp__
|
||||
#define __setProperty_hpp__
|
||||
|
||||
Report(0)<<"\nReading proprties . . . "<<endReport;
|
||||
REPORT(0)<<"\nReading proprties . . . "<<endREPORT;
|
||||
|
||||
auto proprties = pFlow::property(Control.caseSetup().path()+pFlow::propertyFile__);
|
||||
|
||||
|
@ -21,7 +21,7 @@ Licence:
|
||||
#ifndef __setSurfaceGeometry_hpp__
|
||||
#define __setSurfaceGeometry_hpp__
|
||||
|
||||
Report(0)<< "\nCreating surface geometry . . . "<<endReport;
|
||||
REPORT(0)<< "\nCreating surface geometry . . . "<<endREPORT;
|
||||
auto surfGeometryPtr = pFlow::geometry::create(Control, proprties);
|
||||
auto& surfGeometry = surfGeometryPtr();
|
||||
|
||||
|
Reference in New Issue
Block a user