iterateGeometry and geometryPhasicFlow refactor

This commit is contained in:
Hamidreza Norouzi 2024-02-05 21:28:30 -08:00
parent 5b4a524afe
commit c0cf200fa8
4 changed files with 47 additions and 33 deletions

View File

@ -2,6 +2,6 @@
add_subdirectory(iterateSphereParticles) add_subdirectory(iterateSphereParticles)
#add_subdirectory(iterateGeometry) add_subdirectory(iterateGeometry)
#add_subdirectory(sphereGranFlow) #add_subdirectory(sphereGranFlow)

View File

@ -29,12 +29,14 @@ Licence:
* folder. * folder.
*/ */
#include "vocabs.hpp"
#include "systemControl.hpp" #include "systemControl.hpp"
#include "geometryMotion.hpp" #include "geometry.hpp"
//#include "geometryMotion.hpp"
#include "commandLine.hpp" #include "commandLine.hpp"
#include "readControlDict.hpp" //#include "readControlDict.hpp"
using pFlow::commandLine; using namespace pFlow;
int main( int argc, char* argv[] ) int main( int argc, char* argv[] )
{ {
@ -57,14 +59,15 @@ commandLine cmds(
#include "initialize_Control.hpp" #include "initialize_Control.hpp"
#include "setProperty.hpp" #include "setProperty.hpp"
#include "setSurfaceGeometry.hpp" //#include "setSurfaceGeometry.hpp"
WARNING<<"Code should be changed "<<END_WARNING;
do auto geom = geometry(Control, proprties);
/*do
{ {
surfGeometry.iterate(); surfGeometry.iterate();
}while( Control++); }while( Control++);*/
// this should be palced in each main // this should be palced in each main
#include "finalize.hpp" #include "finalize.hpp"

View File

@ -2,6 +2,6 @@
set(source_files set(source_files
geometryPhasicFlow.cpp geometryPhasicFlow.cpp
) )
set(link_lib phasicFlow Kokkos::kokkos Utilities) set(link_lib phasicFlow Kokkos::kokkos Geometry Utilities)
pFlow_make_executable_install(geometryPhasicFlow source_files link_lib) pFlow_make_executable_install(geometryPhasicFlow source_files link_lib)

View File

@ -20,12 +20,10 @@ Licence:
#include "vocabs.hpp" #include "vocabs.hpp"
#include "systemControl.hpp" #include "systemControl.hpp"
#include "fileDictionary.hpp"
#include "Wall.hpp" #include "Wall.hpp"
#include "Lists.hpp"
#include "Vectors.hpp" #include "Vectors.hpp"
#include "VectorSingles.hpp" #include "geometry.hpp"
#include "multiTriSurface.hpp"
//#include "geometryMotion.hpp"
#include "commandLine.hpp" #include "commandLine.hpp"
//#include "readControlDict.hpp" //#include "readControlDict.hpp"
@ -52,7 +50,7 @@ int main( int argc, char* argv[] )
// this should be palced in each main // this should be palced in each main
#include "initialize_Control.hpp" #include "initialize_Control.hpp"
//#include "setProperty.hpp" #include "setProperty.hpp"
REPORT(0)<<"\nReading "<<"geometryDict"<<" . . ."<<END_REPORT; REPORT(0)<<"\nReading "<<"geometryDict"<<" . . ."<<END_REPORT;
auto geometryDict = fileDictionary( auto geometryDict = fileDictionary(
@ -71,21 +69,24 @@ int main( int argc, char* argv[] )
auto wallsDictName = surfacesDict.dictionaryKeywords(); auto wallsDictName = surfacesDict.dictionaryKeywords();
word mSurfaceName = word("geometryPhasicFlow_")+word(triSurfaceFile__);
multiTriSurface surface multiTriSurface surface
( (
objectFile objectFile
( (
triSurfaceFile__, mSurfaceName,
"", "",
objectFile::READ_NEVER, objectFile::READ_NEVER,
objectFile::WRITE_ALWAYS objectFile::WRITE_ALWAYS
), ),
&Control.geometry() nullptr
); );
//wordVector materials; wordVector materials;
//wordVector motion; wordList materialsList;
wordVector motion;
wordList motionList;
for(auto& name:wallsDictName) for(auto& name:wallsDictName)
{ {
@ -97,19 +98,29 @@ int main( int argc, char* argv[] )
realx3x3Vector trinalges(wall.name(), wall.triangles()); realx3x3Vector trinalges(wall.name(), wall.triangles());
surface.appendTriSurface(wall.name(), trinalges); surface.appendTriSurface(wall.name(), trinalges);
/*materials.push_back(wall.materialName()); materials.push_back(wall.materialName());
motion.push_back(wall.motionName());*/ materialsList.push_back(wall.materialName());
motion.push_back(wall.motionName());
motionList.push_back(wall.motionName());
} }
output<<surface<<endl;
//REPORT(1)<<"Selected wall materials are "<<cyanText(materials)<<'\n'<<endREPORT;
/*REPORT(0)<< "\nCreating geometry . . ."<<endREPORT; REPORT(1)<<"Selected wall materials are "<<Cyan_Text(materialsList)<<'\n'<<END_REPORT;
auto geomPtr = geometry::create(Control, proprties, geometryDict, surface, motion, materials); REPORT(1)<<"Selected wall motion components are "<<Cyan_Text(motionList)<<'\n'<<END_REPORT;
REPORT(1)<< "geometry type is "<< greenText(geomPtr().typeName())<<endREPORT;
REPORT(1)<< "Writing geometry to folder "<< geomPtr().path()<<endREPORT; REPORT(0)<< "\nCreating geometry . . ."<<END_REPORT;
geomPtr().write();*/ auto geomPtr = geometry::create(
Control,
proprties,
surface,
motion,
materials,
geometryDict);
REPORT(1)<< "geometry type is "<< Green_Text(geomPtr().typeName())<<END_REPORT;
Control.time().write(true);
REPORT(0)<< Green_Text("\nFinished successfully.\n")<<END_REPORT; REPORT(0)<< Green_Text("\nFinished successfully.\n")<<END_REPORT;