www.cemf.ir
geometryPhasicFlow.cpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 #include "vocabs.hpp"
22 #include "systemControl.hpp"
23 #include "Wall.hpp"
24 #include "geometry.hpp"
25 #include "commandLine.hpp"
26 //#include "readControlDict.hpp"
27 
28 
29 int main( int argc, char* argv[] )
30 {
31 
32  pFlow::commandLine cmds(
33  "geometryPhasicFlow",
34  "Converts the supplied informaiton for sufraces in"
35  " geometryDict into PhasicFlow geometry data structure");
36 
37 
38  bool isCoupling = false;
39  cmds.add_flag(
40  "-c,--coupling",
41  isCoupling,
42  "Is this a fluid-particle coupling simulation?");
43 
44  if(!cmds.parse(argc, argv)) return 0;
45 
46 // this should be palced in each main
47 #include "initialize_Control.hpp"
48 
49  #include "setProperty.hpp"
50 
51  REPORT(0)<<"\nReading "<<"geometryDict"<<" . . ."<<END_REPORT;
52  auto geometryDict = pFlow::fileDictionary(
54  (
55  "geometryDict",
56  Control.settings().path(),
59  ),
60  nullptr
61  );
62 
63  auto& surfacesDict = geometryDict.subDict("surfaces");
64 
65  auto wallsDictName = surfacesDict.dictionaryKeywords();
66 
67 
68  auto mSurfaceName = pFlow::word("geometryPhasicFlow_")+pFlow::word(pFlow::triSurfaceFile__);
70  (
72  (
73  mSurfaceName,
74  "",
77  ),
78  nullptr
79  );
80 
81  pFlow::wordVector materials;
82  pFlow::wordList materialsList;
83 
84  pFlow::wordVector motion;
85  pFlow::wordList motionList;
86 
87  for(auto& name:wallsDictName)
88  {
89  REPORT(1)<<"Creating wall "<<Green_Text(name)<<" from dictionary "<<surfacesDict.globalName() <<END_REPORT;
90  auto wallPtr = pFlow::Wall::create( surfacesDict.subDict(name));
91  auto& wall = wallPtr();
92  REPORT(1)<<"wall type is "<<Green_Text(wall.typeName())<<'\n'<<END_REPORT;
93 
94  pFlow::realx3x3Vector trinalges(wall.name(), wall.triangles());
95 
96  surface.appendSurface(wall.name(), trinalges);
97  materials.push_back(wall.materialName());
98  materialsList.push_back(wall.materialName());
99 
100  motion.push_back(wall.motionName());
101  motionList.push_back(wall.motionName());
102  }
103 
104 
105  REPORT(1)<<"Selected wall materials are "<<Cyan_Text(materialsList)<<'\n'<<END_REPORT;
106  REPORT(1)<<"Selected wall motion components are "<<Cyan_Text(motionList)<<'\n'<<END_REPORT;
107 
108  REPORT(0)<< "\nCreating geometry . . ."<<END_REPORT;
109  auto geomPtr = pFlow::geometry::create(
110  Control,
111  proprties,
112  surface,
113  motion,
114  materials,
115  geometryDict);
116 
117  REPORT(1)<< "geometry type is "<< Green_Text(geomPtr().typeName())<<END_REPORT;
118 
119  Control.time().write(true);
120 
121  REPORT(0)<< Green_Text("\nFinished successfully.\n")<<END_REPORT;
122 
123 // this should be palced in each main
124 #include "finalize.hpp"
125 
126  return 0;
127 }
initialize_Control.hpp
Green_Text
#define Green_Text(text)
Definition: iOstream.hpp:42
pFlow::List< word >
setProperty.hpp
Cyan_Text
#define Cyan_Text(text)
Definition: iOstream.hpp:44
Wall.hpp
REPORT
#define REPORT(n)
Definition: streams.hpp:39
systemControl.hpp
pFlow::geometry::create
static uniquePtr< geometry > create(systemControl &control, const property &prop)
Definition: geometry.cpp:336
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::commandLine
Definition: commandLine.hpp:36
pFlow::objectFile::WRITE_ALWAYS
@ WRITE_ALWAYS
Definition: objectFile.hpp:43
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:32
pFlow::objectFile::WRITE_NEVER
@ WRITE_NEVER
Definition: objectFile.hpp:44
main
int main(int argc, char *argv[])
Definition: geometryPhasicFlow.cpp:29
pFlow::commandLine::parse
bool parse(int argc, char **argv)
Definition: commandLine.cpp:50
pFlow::Wall::create
static uniquePtr< Wall > create(const dictionary &dict)
Definition: Wall.cpp:61
pFlow::objectFile::READ_ALWAYS
@ READ_ALWAYS
Definition: objectFile.hpp:36
geometry.hpp
proprties
auto proprties
Definition: setProperty.hpp:26
END_REPORT
#define END_REPORT
Definition: streams.hpp:40
pFlow::objectFile
Definition: objectFile.hpp:30
pFlow::triSurfaceFile__
const char *const triSurfaceFile__
Definition: vocabs.hpp:43
pFlow::objectFile::READ_NEVER
@ READ_NEVER
Definition: objectFile.hpp:37
pFlow::fileDictionary
Definition: fileDictionary.hpp:29
vocabs.hpp
pFlow::Vector< word >
commandLine.hpp
Control
auto & Control
Definition: initialize_Control.hpp:47
pFlow::triangle::surface
INLINE_FUNCTION_HD real surface(const realx3 &p1, const realx3 &p2, const realx3 &p3)
Definition: triangleFunctions.hpp:30
finalize.hpp