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:
@ -40,8 +40,8 @@ if(!cmds.parse(argc, argv)) return 0;
|
||||
#include "initialize.hpp"
|
||||
|
||||
output<<endl;
|
||||
Report(1)<< "You are using "<<yellowText(cmds.productNameCopyright())<<endReport;
|
||||
Report(1)<< yellowText(pFlow::floatingPointDescription())<<endReport;
|
||||
REPORT(1)<< "You are using "<<yellowText(cmds.productNameCopyright())<<endREPORT;
|
||||
REPORT(1)<< yellowText(pFlow::floatingPointDescription())<<endREPORT;
|
||||
|
||||
|
||||
// this should be palced in each main
|
||||
|
@ -59,7 +59,7 @@ int main( int argc, char* argv[] )
|
||||
|
||||
#include "setProperty.hpp"
|
||||
|
||||
Report(0)<<"\nReading "<<"createGeometryDict"<<" . . ."<<endReport;
|
||||
REPORT(0)<<"\nReading "<<"createGeometryDict"<<" . . ."<<endREPORT;
|
||||
auto objDict = IOobject::make<dictionary>
|
||||
(
|
||||
objectFile
|
||||
@ -87,26 +87,26 @@ int main( int argc, char* argv[] )
|
||||
|
||||
for(auto& name:wallsDictName)
|
||||
{
|
||||
Report(1)<<"Creating wall "<<greenText(name)<<" from file dictionary . . . "<<endReport;
|
||||
REPORT(1)<<"Creating wall "<<greenText(name)<<" from file dictionary . . . "<<endREPORT;
|
||||
auto wallPtr = Wall::create( surfacesDict.subDict(name));
|
||||
auto& wall = wallPtr();
|
||||
Report(1)<<"wall type is "<<greenText(wall.typeName())<<'\n'<<endReport;
|
||||
REPORT(1)<<"wall type is "<<greenText(wall.typeName())<<'\n'<<endREPORT;
|
||||
|
||||
surface.addTriSurface(wall.name(), wall.triangles());
|
||||
materials.push_back(wall.materialName());
|
||||
motion.push_back(wall.motionName());
|
||||
}
|
||||
|
||||
Report(1)<<"Selected wall materials are "<<cyanText(materials)<<'\n'<<endReport;
|
||||
REPORT(1)<<"Selected wall materials are "<<cyanText(materials)<<'\n'<<endREPORT;
|
||||
|
||||
Report(0)<< "\nCreating geometry . . ."<<endReport;
|
||||
REPORT(0)<< "\nCreating geometry . . ."<<endREPORT;
|
||||
auto geomPtr = geometry::create(Control, proprties, geometryDict, surface, motion, materials);
|
||||
Report(1)<< "geometry type is "<< greenText(geomPtr().typeName())<<endReport;
|
||||
REPORT(1)<< "geometry type is "<< greenText(geomPtr().typeName())<<endREPORT;
|
||||
|
||||
Report(1)<< "Writing geometry to folder "<< geomPtr().path()<<endl;
|
||||
REPORT(1)<< "Writing geometry to folder "<< geomPtr().path()<<endREPORT;
|
||||
geomPtr().write();
|
||||
|
||||
Report(0)<< greenText("\nFinished successfully.\n");
|
||||
REPORT(0)<< greenText("\nFinished successfully.\n");
|
||||
|
||||
// this should be palced in each main
|
||||
#include "finalize.hpp"
|
||||
|
@ -45,7 +45,7 @@ bool geomObjectToVTK(IOfileHeader& header, real time, fileSystem destPath, word
|
||||
|
||||
if(!vtk) return false;
|
||||
|
||||
Report(1)<<"Converting geometry to vtk."<<endReport;
|
||||
REPORT(1)<<"Converting geometry to vtk."<<endREPORT;
|
||||
|
||||
if(!dataToVTK(vtk, data) )
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ bool convertIntTypesPointField(
|
||||
|
||||
int64* data = Field.hostVectorAll().data();
|
||||
|
||||
Report(2)<<"writing "<< greenColor <<header.objectName()<<defaultColor<<" field to vtk.\n";
|
||||
REPORT(2)<<"writing "<< greenColor <<header.objectName()<<defaultColor<<" field to vtk.\n";
|
||||
|
||||
return addInt64PointField(
|
||||
os,
|
||||
@ -136,7 +136,7 @@ bool convertRealTypePointField(
|
||||
|
||||
real* data = Field.hostVectorAll().data();
|
||||
|
||||
Report(2)<<"writing "<< greenColor <<header.objectName()<<defaultColor<<" field to vtk."<<endReport;
|
||||
REPORT(2)<<"writing "<< greenColor <<header.objectName()<<defaultColor<<" field to vtk."<<endREPORT;
|
||||
|
||||
return addRealPointField(
|
||||
os,
|
||||
@ -166,7 +166,7 @@ bool convertRealx3TypePointField(
|
||||
|
||||
realx3* data = Field.hostVectorAll().data();
|
||||
|
||||
Report(2)<<"writing "<< greenColor <<header.objectName()<<defaultColor<<" field to vtk."<<endReport;
|
||||
REPORT(2)<<"writing "<< greenColor <<header.objectName()<<defaultColor<<" field to vtk."<<endREPORT;
|
||||
|
||||
return addRealx3PointField(
|
||||
os,
|
||||
@ -324,8 +324,8 @@ bool convertTimeFolderPointFields(
|
||||
auto posVec = std::as_const(pStruct).pointPosition().hostVectorAll();
|
||||
auto* pos = posVec.data();
|
||||
|
||||
Report(1)<<"Writing pointStructure to vtk file with "<< yellowText(pStruct.numActive())
|
||||
<<" active particles"<<endReport;
|
||||
REPORT(1)<<"Writing pointStructure to vtk file with "<< yellowText(pStruct.numActive())
|
||||
<<" active particles"<<endREPORT;
|
||||
addUndstrcuturedGridField(
|
||||
vtk(),
|
||||
pStruct.numActive(),
|
||||
@ -395,8 +395,8 @@ bool convertTimeFolderPointFieldsSelected(
|
||||
auto posVec = std::as_const(pStruct).pointPosition().hostVectorAll();
|
||||
auto* pos = posVec.data();
|
||||
|
||||
Report(1)<<"Writing pointStructure to vtk file with "<< yellowText(pStruct.numActive())
|
||||
<<" active particles"<<endReport;
|
||||
REPORT(1)<<"Writing pointStructure to vtk file with "<< yellowText(pStruct.numActive())
|
||||
<<" active particles"<<endREPORT;
|
||||
addUndstrcuturedGridField(
|
||||
vtk(),
|
||||
pStruct.numActive(),
|
||||
@ -433,7 +433,7 @@ bool convertTimeFolderPointFieldsSelected(
|
||||
}
|
||||
else
|
||||
{
|
||||
Report(1)<<"Could not find "<<yellowText(fieldAddress) <<" skipping . . ."<<endReport;
|
||||
REPORT(1)<<"Could not find "<<yellowText(fieldAddress) <<" skipping . . ."<<endREPORT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ bool convertRealx3TypetriSurfaceField(
|
||||
|
||||
realx3* data = Field.hostVectorAll().data();
|
||||
|
||||
Report(2)<<"writing "<< greenColor <<header.objectName()<<defaultColor<<" field to vtk."<<endReport;
|
||||
REPORT(2)<<"writing "<< greenColor <<header.objectName()<<defaultColor<<" field to vtk."<<endREPORT;
|
||||
|
||||
return addRealx3TriSurfaceField(
|
||||
os,
|
||||
@ -209,7 +209,7 @@ bool convertTimeFolderTriSurfaceFields(
|
||||
auto& tSurface = triSurfaceObjPtr().getObject<multiTriSurface>();
|
||||
|
||||
// get a list of files in this timeFolder;
|
||||
Report(1)<<"Wrting triSurface mesh/Geometry to vtk file."<<endReport;
|
||||
REPORT(1)<<"Wrting triSurface mesh/Geometry to vtk file."<<endREPORT;
|
||||
if(!triDataToVTK(vtk(), tSurface))
|
||||
{
|
||||
fatalErrorInFunction<<
|
||||
|
@ -73,8 +73,8 @@ int main( int argc, char* argv[] )
|
||||
|
||||
if(setOnly && positionOnly)
|
||||
{
|
||||
Err<<
|
||||
"Options --positionParticles-only and --setFields-only cannot be used simeltanuously. \n"<<endErr;
|
||||
ERR<<
|
||||
"Options --positionParticles-only and --setFields-only cannot be used simeltanuously. \n"<<endERR;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ int main( int argc, char* argv[] )
|
||||
{
|
||||
|
||||
// position particles based on the dict content
|
||||
Report(0)<< "Positioning points . . . \n"<<endReport;
|
||||
REPORT(0)<< "Positioning points . . . \n"<<endREPORT;
|
||||
auto pointPosition = positionParticles::create(cpDict.subDict("positionParticles"));
|
||||
|
||||
fileSystem pStructPath = Control.time().path()+pointStructureFile__;
|
||||
@ -124,15 +124,15 @@ int main( int argc, char* argv[] )
|
||||
|
||||
auto& pSruct = pStructObj().getObject<pointStructure>();
|
||||
|
||||
Report(1)<< "Created pStruct with "<< pSruct.size() << " points and capacity "<<
|
||||
pSruct.capacity()<<" . . ."<< endReport;
|
||||
REPORT(1)<< "Created pStruct with "<< pSruct.size() << " points and capacity "<<
|
||||
pSruct.capacity()<<" . . ."<< endREPORT;
|
||||
|
||||
Report(1)<< "Writing pStruct to " << pStructObj().path() << endReport<<endl<<endl;
|
||||
REPORT(1)<< "Writing pStruct to " << pStructObj().path() << endREPORT<<endl<<endl;
|
||||
|
||||
if( !pStructObj().write())
|
||||
{
|
||||
fatalErrorInFunction<<
|
||||
"Error in writing to file. \n ";
|
||||
"ERRor in writing to file. \n ";
|
||||
return 1;
|
||||
}
|
||||
}else
|
||||
@ -164,7 +164,7 @@ int main( int argc, char* argv[] )
|
||||
{
|
||||
if( !sfEntry.setPointFieldDefaultValueNewAll(Control.time(), pStruct, true))
|
||||
{
|
||||
Err<< "\n error occured in setting default value fields.\n"<<endErr;
|
||||
ERR<< "\n error occured in setting default value fields.\n"<<endERR;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -177,13 +177,13 @@ int main( int argc, char* argv[] )
|
||||
|
||||
for(auto name: selNames)
|
||||
{
|
||||
Report(1)<< "Applying selector " << greenText(name) <<endReport;
|
||||
REPORT(1)<< "Applying selector " << greenText(name) <<endREPORT;
|
||||
|
||||
if(
|
||||
!applySelector(Control, pStruct, selectorsDict.subDict(name))
|
||||
)
|
||||
{
|
||||
Err<<"\n error occured in setting selector. \n"<<endErr;
|
||||
ERR<<"\n error occured in setting selector. \n"<<endERR;
|
||||
return 1;
|
||||
}
|
||||
output<<endl;
|
||||
@ -191,7 +191,7 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
|
||||
Control.time().write(true);
|
||||
Report(0)<< greenText("\nFinished successfully.\n")<<endReport;
|
||||
REPORT(0)<< greenText("\nFinished successfully.\n")<<endREPORT;
|
||||
|
||||
|
||||
// this should be palced in each main
|
||||
|
@ -54,7 +54,7 @@ pFlow::realx3Vector pFlow::positionParticles::sortByMortonCode(realx3Vector& pos
|
||||
ind++});
|
||||
}
|
||||
|
||||
Info<<"Performing morton sorting."<<endInfo;
|
||||
INFORMATION<<"Performing morton sorting."<<endINFO;
|
||||
std::sort(
|
||||
indMor.begin(),
|
||||
indMor.end(),
|
||||
|
@ -74,9 +74,9 @@ bool pFlow::positionRandom::positionOnePass(int32 pass, int32 startNum)
|
||||
|
||||
ContainerType pairs(3*startNum);
|
||||
|
||||
Report(1)<< "Positioning "<<
|
||||
REPORT(1)<< "Positioning "<<
|
||||
greenText("(Pass #"<< pass+1<<")")<<
|
||||
": started with "<< startNum <<" points."<<endReport;
|
||||
": started with "<< startNum <<" points."<<endREPORT;
|
||||
|
||||
fillPoints(startNum, positionHD, flagHD);
|
||||
|
||||
@ -86,13 +86,13 @@ bool pFlow::positionRandom::positionOnePass(int32 pass, int32 startNum)
|
||||
int32 numCollisions = findCollisions(pairs, flagHD);
|
||||
|
||||
|
||||
Report(2)<< "Positioned " << cyanText(startNum - numCollisions) <<
|
||||
" without collision \n"<<endReport;
|
||||
REPORT(2)<< "Positioned " << cyanText(startNum - numCollisions) <<
|
||||
" without collision \n"<<endREPORT;
|
||||
|
||||
if(startNum-numCollisions >= numPoints_ )
|
||||
{
|
||||
|
||||
Report(1)<<"Selected "<< cyanText(numPoints_)<< " for the final field.\n"<<endReport;
|
||||
REPORT(1)<<"Selected "<< cyanText(numPoints_)<< " for the final field.\n"<<endREPORT;
|
||||
|
||||
positionHD.syncViews();
|
||||
position_.clear();
|
||||
|
@ -85,7 +85,7 @@ pFlow::uniquePtr<pFlow::includeMask> pFlow::includeMask::create(
|
||||
auto objPtr =
|
||||
dictionaryvCtorSelector_[method]
|
||||
(dict, opType, timeFolder);
|
||||
Report(2)<< dict.name()<< " with model "<<greenText(method)<<" is processed."<<endReport;
|
||||
REPORT(2)<< dict.name()<< " with model "<<greenText(method)<<" is processed."<<endREPORT;
|
||||
return objPtr;
|
||||
}
|
||||
else
|
||||
|
@ -29,20 +29,20 @@ pFlow::postprocess::postprocess(systemControl& control)
|
||||
control_(control),
|
||||
dict_(postprocessFile__, control_.settings().path()+postprocessFile__)
|
||||
{
|
||||
Report(1)<<"Reading numberBased dictionary ..."<<endReport;
|
||||
REPORT(1)<<"Reading numberBased dictionary ..."<<endREPORT;
|
||||
auto nbDict = dict_.subDictOrCreate("numberBased");
|
||||
|
||||
numberBasedDictNames_ = dict_.subDictOrCreate("numberBased").dictionaryKeywords();
|
||||
if(!numberBasedDictNames_.empty())
|
||||
{
|
||||
Report(1)<< "numberBased dictionary contains " << yellowText(numberBasedDictNames_)<<endReport<<endl;
|
||||
REPORT(1)<< "numberBased dictionary contains " << yellowText(numberBasedDictNames_)<<endREPORT<<endl;
|
||||
}
|
||||
|
||||
|
||||
weightBasedDictNames_ = dict_.subDictOrCreate("weightBased").dictionaryKeywords();
|
||||
if(!weightBasedDictNames_.empty())
|
||||
{
|
||||
Report(1)<< "numberBased dictionary contains " << yellowText(weightBasedDictNames_)<<endReport<<endl;
|
||||
REPORT(1)<< "numberBased dictionary contains " << yellowText(weightBasedDictNames_)<<endREPORT<<endl;
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ bool pFlow::postprocess::processTimeFolder(real time, const word& tName, const f
|
||||
|
||||
time_ = time;
|
||||
|
||||
Report(0)<<"Working on time folder "<< cyanText(time)<<endReport;
|
||||
REPORT(0)<<"Working on time folder "<< cyanText(time)<<endREPORT;
|
||||
timeFolderReposiory_ =
|
||||
makeUnique<repository>
|
||||
(
|
||||
@ -64,7 +64,7 @@ bool pFlow::postprocess::processTimeFolder(real time, const word& tName, const f
|
||||
&control_
|
||||
);
|
||||
|
||||
Report(1)<<"Reading pointStructure"<<endReport;
|
||||
REPORT(1)<<"Reading pointStructure"<<endREPORT;
|
||||
timeFolderReposiory().emplaceObject<pointStructure>(
|
||||
objectFile
|
||||
(
|
||||
@ -75,7 +75,7 @@ bool pFlow::postprocess::processTimeFolder(real time, const word& tName, const f
|
||||
));
|
||||
|
||||
|
||||
Report(1)<<"Creating mesh and point to cell mapper"<<endReport;
|
||||
REPORT(1)<<"Creating mesh and point to cell mapper"<<endREPORT;
|
||||
pointToCell_ = makeUnique<pointRectCell>(
|
||||
dict_.subDict("rectMesh"),
|
||||
timeFolderReposiory().lookupObject<pointStructure>(pointStructureFile__),
|
||||
@ -125,11 +125,11 @@ bool pFlow::postprocess::writeToVTK(fileSystem destPath, word bName)const
|
||||
|
||||
if(!vtk) return false;
|
||||
|
||||
Report(1)<<"Writing processed fields to vtk file..."<<endReport;
|
||||
REPORT(1)<<"Writing processed fields to vtk file..."<<endREPORT;
|
||||
// mesh
|
||||
pointToCell_->mesh().writeToVtk(vtk());
|
||||
|
||||
forAll( i, processedFields_)
|
||||
ForAll( i, processedFields_)
|
||||
{
|
||||
|
||||
if( !processedFields_[i].writeToVTK(vtk()))
|
||||
|
@ -115,7 +115,7 @@ pFlow::processField::create(
|
||||
auto objPtr =
|
||||
dictionaryvCtorSelector_[method]
|
||||
(dict, pToCell, rep);
|
||||
Report(2)<<"Processing/creating " << yellowText(dict.name())<< " with model "<<greenText(method)<<"."<<endReport;
|
||||
REPORT(2)<<"Processing/creating " << yellowText(dict.name())<< " with model "<<greenText(method)<<"."<<endREPORT;
|
||||
return objPtr;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user