mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
refactor up to particles.hpp
This commit is contained in:
@ -72,21 +72,10 @@ int main( int argc, char* argv[] )
|
||||
// this should be palced in each main
|
||||
#include "initialize_Control.hpp"
|
||||
|
||||
auto objCPDict = IOobject::make<fileDictionary>
|
||||
(
|
||||
objectFile
|
||||
(
|
||||
"particlesDict",
|
||||
Control.settings().path(),
|
||||
objectFile::READ_ALWAYS,
|
||||
objectFile::WRITE_ALWAYS
|
||||
),
|
||||
"particlesDict"
|
||||
);
|
||||
fileDictionary cpDict("particlesDict", Control.settings().path());
|
||||
|
||||
|
||||
auto& cpDict = objCPDict().getObject<fileDictionary>();
|
||||
|
||||
pointStructure* pStructPtr = nullptr;
|
||||
uniquePtr<pointStructure> pStructPtr = nullptr;
|
||||
|
||||
|
||||
if(!setOnly)
|
||||
@ -100,24 +89,11 @@ int main( int argc, char* argv[] )
|
||||
|
||||
auto finalPos = pointPosition().getFinalPosition();
|
||||
|
||||
|
||||
auto& pStruct = Control.time().emplaceObject<pointStructure>
|
||||
(
|
||||
objectFile
|
||||
(
|
||||
pointStructureFile__,
|
||||
Control.time().path(),
|
||||
objectFile::READ_NEVER,
|
||||
objectFile::WRITE_ALWAYS
|
||||
),
|
||||
Control,
|
||||
finalPos
|
||||
);
|
||||
pStructPtr = makeUnique<pointStructure>(Control, finalPos);
|
||||
|
||||
pStructPtr = &pStruct;
|
||||
|
||||
REPORT(1)<< "Created pStruct with "<< pStruct.size() << " points and capacity "<<
|
||||
pStruct.capacity()<<" . . ."<< END_REPORT;
|
||||
REPORT(1)<< "Created pStruct with "<< pStructPtr().size() << " points and capacity "<<
|
||||
pStructPtr().capacity()<<" . . ."<< END_REPORT;
|
||||
|
||||
//REPORT(1)<< "Writing pStruct to " << Control.time().path()+ pointStructureFile__<< END_REPORT<<endl<<endl;
|
||||
|
||||
@ -130,20 +106,8 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
auto& pStruct = Control.time().emplaceObject<pointStructure>
|
||||
(
|
||||
objectFile
|
||||
(
|
||||
pointStructureFile__,
|
||||
Control.time().path(),
|
||||
objectFile::READ_NEVER,
|
||||
objectFile::WRITE_ALWAYS
|
||||
),
|
||||
Control
|
||||
);
|
||||
|
||||
pStructPtr = &pStruct;
|
||||
// read the content of pStruct from 0/pStructure
|
||||
pStructPtr = makeUnique<pointStructure>(Control);
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ Licence:
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
#include "positionParticles.hpp"
|
||||
#include "vocabs.hpp"
|
||||
#include "box.hpp"
|
||||
#include "cylinder.hpp"
|
||||
#include "sphere.hpp"
|
||||
@ -101,7 +102,18 @@ pFlow::positionParticles::positionParticles
|
||||
}
|
||||
else
|
||||
{
|
||||
region_ = makeUnique<region<box>>( control.domainDict().subDict("globalBox"));
|
||||
fileDictionary domainDict
|
||||
(
|
||||
objectFile
|
||||
{
|
||||
domainFile__,
|
||||
"",
|
||||
objectFile::READ_ALWAYS,
|
||||
objectFile::WRITE_NEVER
|
||||
},
|
||||
&control.settings()
|
||||
);
|
||||
region_ = makeUnique<region<box>>( domainDict.subDict("globalBox"));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user