mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
before checking parallelIO for dictionary
This commit is contained in:
@ -3,7 +3,7 @@ set(source_files
|
||||
particlesPhasicFlow.cpp
|
||||
positionParticles/positionParticles.cpp
|
||||
positionOrdered/positionOrdered.cpp
|
||||
positionRandom/positionRandom.cpp
|
||||
#positionRandom/positionRandom.cpp
|
||||
empty/empty.cpp
|
||||
)
|
||||
set(link_lib phasicFlow Kokkos::kokkos Interaction Utilities)
|
||||
|
@ -30,7 +30,7 @@ pFlow::empty::empty(
|
||||
positionParticles(control, dict),
|
||||
position_
|
||||
(
|
||||
maxNumberOfParticles_, 0, RESERVE()
|
||||
"empty",maxNumberOfParticles_, 0, RESERVE()
|
||||
)
|
||||
{
|
||||
}
|
@ -24,6 +24,8 @@ Licence:
|
||||
#include "setFields.hpp"
|
||||
#include "systemControl.hpp"
|
||||
#include "commandLine.hpp"
|
||||
#include "vocabs.hpp"
|
||||
|
||||
//#include "readControlDict.hpp"
|
||||
|
||||
using pFlow::output;
|
||||
@ -74,7 +76,7 @@ int main( int argc, char* argv[] )
|
||||
if(setOnly && positionOnly)
|
||||
{
|
||||
ERR<<
|
||||
"Options --positionParticles-only and --setFields-only cannot be used simeltanuously. \n"<<endERR;
|
||||
"Options --positionParticles-only and --setFields-only cannot be used simeltanuously. \n"<<END_ERR;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -103,8 +105,8 @@ int main( int argc, char* argv[] )
|
||||
{
|
||||
|
||||
// position particles based on the dict content
|
||||
REPORT(0)<< "Positioning points . . . \n"<<endREPORT;
|
||||
auto pointPosition = positionParticles::create(cpDict.subDict("positionParticles"));
|
||||
REPORT(0)<< "Positioning points . . . \n"<<END_REPORT;
|
||||
auto pointPosition = positionParticles::create(Control, cpDict.subDict("positionParticles"));
|
||||
|
||||
fileSystem pStructPath = Control.time().path()+pointStructureFile__;
|
||||
|
||||
@ -120,16 +122,17 @@ int main( int argc, char* argv[] )
|
||||
objectFile::READ_NEVER,
|
||||
objectFile::WRITE_ALWAYS
|
||||
),
|
||||
finalPos
|
||||
Control,
|
||||
finalPos
|
||||
);
|
||||
|
||||
pStructPtr = &pStruct;
|
||||
|
||||
|
||||
REPORT(1)<< "Created pStruct with "<< pStruct.size() << " points and capacity "<<
|
||||
pStruct.capacity()<<" . . ."<< endREPORT;
|
||||
pStruct.capacity()<<" . . ."<< END_REPORT;
|
||||
|
||||
REPORT(1)<< "Writing pStruct to " << Control.time().path()+ pointStructureFile__<< endREPORT<<endl<<endl;
|
||||
REPORT(1)<< "Writing pStruct to " << Control.time().path()+ pointStructureFile__<< END_REPORT<<endl<<endl;
|
||||
|
||||
if( !Control.time().write())
|
||||
{
|
||||
@ -148,7 +151,8 @@ int main( int argc, char* argv[] )
|
||||
Control.time().path(),
|
||||
objectFile::READ_NEVER,
|
||||
objectFile::WRITE_ALWAYS
|
||||
)
|
||||
),
|
||||
Control
|
||||
);
|
||||
|
||||
pStructPtr = &pStruct;
|
||||
@ -170,7 +174,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"<<END_ERR;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -183,13 +187,13 @@ int main( int argc, char* argv[] )
|
||||
|
||||
for(auto name: selNames)
|
||||
{
|
||||
REPORT(1)<< "Applying selector " << greenText(name) <<endREPORT;
|
||||
REPORT(1)<< "Applying selector " << Green_Text(name) <<END_REPORT;
|
||||
|
||||
if(
|
||||
!applySelector(Control, pStruct, selectorsDict.subDict(name))
|
||||
)
|
||||
{
|
||||
ERR<<"\n error occured in setting selector. \n"<<endERR;
|
||||
ERR<<"\n error occured in setting selector. \n"<<END_ERR;
|
||||
return 1;
|
||||
}
|
||||
output<<endl;
|
||||
@ -197,7 +201,7 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
|
||||
Control.time().write(true);
|
||||
REPORT(0)<< greenText("\nFinished successfully.\n")<<endREPORT;
|
||||
REPORT(0)<< Green_Text("\nFinished successfully.\n")<<END_REPORT;
|
||||
|
||||
|
||||
// this should be palced in each main
|
||||
|
@ -127,7 +127,7 @@ pFlow::positionOrdered::positionOrdered
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
positionParticles(dict),
|
||||
positionParticles(control, dict),
|
||||
poDict_
|
||||
(
|
||||
dict.subDict("positionOrderedInfo")
|
||||
@ -138,7 +138,7 @@ pFlow::positionOrdered::positionOrdered
|
||||
),
|
||||
numPoints_
|
||||
(
|
||||
poDict_.getVal<size_t>("numPoints")
|
||||
poDict_.getVal<uint64>("numPoints")
|
||||
),
|
||||
axisOrder_
|
||||
(
|
||||
@ -146,7 +146,7 @@ pFlow::positionOrdered::positionOrdered
|
||||
),
|
||||
position_
|
||||
(
|
||||
maxNumberOfParticles_, RESERVE()
|
||||
"positionOrdered", maxNumberOfParticles_, numPoints_ ,RESERVE()
|
||||
)
|
||||
{
|
||||
|
||||
|
@ -76,12 +76,12 @@ public:
|
||||
|
||||
//// - Methods
|
||||
|
||||
virtual label numPoints()const
|
||||
virtual uint64 numPoints()const
|
||||
{
|
||||
return position_.size();
|
||||
}
|
||||
|
||||
virtual label size()const
|
||||
virtual uint64 size()const
|
||||
{
|
||||
return position_.size();
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ pFlow::realx3Vector pFlow::positionParticles::sortByMortonCode(realx3Vector& pos
|
||||
ind++});
|
||||
}
|
||||
|
||||
INFORMATION<<"Performing morton sorting."<<endINFO;
|
||||
INFORMATION<<"Performing morton sorting."<<END_INFO;
|
||||
std::sort(
|
||||
indMor.begin(),
|
||||
indMor.end(),
|
||||
@ -120,7 +120,11 @@ pFlow::realx3Vector pFlow::positionParticles::getFinalPosition()
|
||||
}
|
||||
|
||||
pFlow::uniquePtr<pFlow::positionParticles>
|
||||
pFlow::positionParticles::create(const dictionary & dict)
|
||||
pFlow::positionParticles::create
|
||||
(
|
||||
systemControl& control,
|
||||
const dictionary & dict
|
||||
)
|
||||
{
|
||||
|
||||
word method = dict.getVal<word>("method");
|
||||
|
@ -127,8 +127,8 @@ public:
|
||||
(
|
||||
positionParticles,
|
||||
dictionary,
|
||||
(const dictionary& dict),
|
||||
(dict)
|
||||
(systemControl& control, const dictionary& dict),
|
||||
(control, dict)
|
||||
);
|
||||
|
||||
virtual ~positionParticles() = default;
|
||||
@ -151,7 +151,7 @@ public:
|
||||
virtual realx3Vector getFinalPosition();
|
||||
|
||||
static
|
||||
uniquePtr<positionParticles> create(const dictionary & dict);
|
||||
uniquePtr<positionParticles> create(systemControl& control, const dictionary & dict);
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user