# PhasicFlow: utilities/geometryPhasicFlow/geometryPhasicFlow.cpp Source File

geometryPhasicFlow.cpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#include "systemControl.hpp"
#include "Wall.hpp"
#include "Vectors.hpp"
#include "multiTriSurface.hpp"
#include "geometryMotion.hpp"
#include "commandLine.hpp"
#include "readControlDict.hpp"
using pFlow::output;
using pFlow::endl;
using pFlow::IOobject;
using pFlow::dictionary;
using pFlow::objectFile;
using pFlow::wordVector;
using pFlow::Wall;
using pFlow::geometry;
using pFlow::realx3x3Vector;
using pFlow::multiTriSurface;
using pFlow::commandLine;
int main( int argc, char* argv[] )
{
commandLine cmds(
"geometryPhasicFlow",
"Converts the supplied informaiton for sufraces in"
" geometryDict into PhasicFlow geometry data structure");
bool isCoupling = false;
cmds.add_flag(
"-c,--coupling",
isCoupling,
"Is this a fluid-particle coupling simulation?");
if(!cmds.parse(argc, argv)) return 0;
// this should be palced in each main
#include "initialize_Control.hpp"
#include "setProperty.hpp"
REPORT(0)<<"\nReading "<<"createGeometryDict"<<" . . ."<<endREPORT;
auto objDict = IOobject::make<dictionary>
(
objectFile
(
"geometryDict",
Control.settings().path(),
objectFile::READ_ALWAYS,
objectFile::WRITE_NEVER
),
"geometryDict",
true
);
auto& geometryDict = objDict().getObject<dictionary>();
auto& surfacesDict = geometryDict.subDict("surfaces");
auto wallsDictName = surfacesDict.dictionaryKeywords();
multiTriSurface surface;
wordVector materials;
wordVector motion;
for(auto& name:wallsDictName)
{
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;
realx3x3Vector trinalges(wall.name());
trinalges = wall.triangles();
surface.addTriSurface(wall.name(), trinalges);
materials.push_back(wall.materialName());
motion.push_back(wall.motionName());
}
REPORT(1)<<"Selected wall materials are "<<cyanText(materials)<<'\n'<<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)<< "Writing geometry to folder "<< geomPtr().path()<<endREPORT;
geomPtr().write();
REPORT(0)<< greenText("\nFinished successfully.\n");
// this should be palced in each main
#include "finalize.hpp"
return 0;
}
initialize_Control.hpp
endREPORT
#define endREPORT
Definition: streams.hpp:41
setProperty.hpp
Wall.hpp
REPORT
#define REPORT(n)
Definition: streams.hpp:40
cyanText
#define cyanText(text)
Definition: streams.hpp:34
systemControl.hpp
pFlow::commandLine
Definition: commandLine.hpp:36
Vectors.hpp
geometryMotion.hpp
pFlow::endl
iOstream & endl(iOstream &os)
Definition: iOstream.hpp:312
greenText
#define greenText(text)
Definition: streams.hpp:32
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:33
pFlow::IOobject
Definition: IOobject.hpp:35
pFlow::dictionary::dictionaryKeywords
wordList dictionaryKeywords() const
Definition: dictionary.cpp:721
main
int main(int argc, char *argv[])
Definition: geometryPhasicFlow.cpp:42
pFlow::commandLine::parse
bool parse(int argc, char **argv)
Definition: commandLine.cpp:50
multiTriSurface.hpp
pFlow::output
Ostream output
pFlow::realx3x3Vector
Vector< realx3x3 > realx3x3Vector
Definition: Vectors.hpp:62
proprties
auto proprties
Definition: setProperty.hpp:27
pFlow::objectFile
Definition: objectFile.hpp:33
pFlow::dictionary::subDict
dictionary & subDict(const word &keyword)
Definition: dictionary.cpp:547
pFlow::wordVector
Vector< word > wordVector
Definition: Vectors.hpp:64
pFlow::geometry
Definition: geometry.hpp:37
pFlow::multiTriSurface::addTriSurface
bool addTriSurface(const word &name, const triSurface &tSurf)
Definition: multiTriSurface.cpp:96
readControlDict.hpp
commandLine.hpp
pFlow::Wall
Definition: Wall.hpp:41
pFlow::dictionary
Definition: dictionary.hpp:38
Control
auto & Control
Definition: initialize_Control.hpp:47
finalize.hpp