# PhasicFlow: utilities/postprocessPhasicFlow/postprocessPhasicFlow.cpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

postprocessPhasicFlow.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 "KokkosUtilities.hpp"
#include "systemControl.hpp"
#include "timeFolder.hpp"
#include "commandLine.hpp"
#include "ranges.hpp"
#include "readControlDict.hpp"
#include "postprocess.hpp"
using pFlow::word;
using pFlow::wordVector;
using pFlow::wordList;
using pFlow::commandLine;
using pFlow::timeFolder;
using pFlow::output;
using pFlow::endl;
int main(int argc, char** argv )
{
word outFolder = (pFlow::CWD()/word("VTK/postprocess")).wordPath();
commandLine cmds(
"postprocessPhasicFlow",
"post-process fields in time folders based on the input file "
"settings/postprocessDict and convetes the results into vtk file format.");
wordVector times;
cmds.addOption("-o,--out-folder",
outFolder,
"path to output folder of VTK/postprocess",
"path");
cmds.addOption(
"-t,--time",
times.vectorField(),
"a space separated lits of time folders, or a strided range begin:stride:end, or an interval begin:end",
" ");
bool withZeroFolder = false;
cmds.addOption(
"-z, --zeroFolder",
withZeroFolder,
"Do NOT exclude zero folder from processing time folders");
bool isCoupling = false;
if(!cmds.parse(argc, argv)) return 0;
#include "initialize_Control.hpp"
// time folders in case
timeFolder folders(Control);
// time in command line
pFlow::realCombinedRange validRange;
if( cmds.count("--time") )
{
if(!validRange.addRanges(times)){
fatalExit; }
}
else
{
validRange.addIntervalRange(folders.startTime(), folders.endTime());
}
pFlow::fileSystem destFolder = pFlow::fileSystem(outFolder);
pFlow::postprocess post(Control);
do
{
if( !validRange.isMember( folders.time() ) )
{
continue;
}
if( !withZeroFolder && pFlow::equal(folders.time() , 0.0))continue;
post.processTimeFolder(folders);
if(!post.writeToVTK(destFolder, "processed"))
{
fatalExit;
}
}while (folders++);
#include "finalize.hpp"
return true;
}
initialize_Control.hpp
pFlow::timeFolder::time
real time() const
Definition: timeFolder.hpp:57
pFlow::postprocess::writeToVTK
bool writeToVTK(fileSystem path, word bName) const
Definition: postprocess.cpp:133
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::postprocess::processTimeFolder
bool processTimeFolder(real time, const word &tName, const fileSystem &localFolder)
Definition: postprocess.cpp:58
KokkosUtilities.hpp
systemControl.hpp
pFlow::commandLine::addOption
Option * addOption(word optionName, word description, word opText="")
pFlow::equal
INLINE_FUNCTION_HD bool equal(const box &b1, const box &b2, real tol=smallValue)
Definition: box.hpp:135
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::commandLine
Definition: commandLine.hpp:36
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::timeFolder::startTime
real startTime() const
Definition: timeFolder.hpp:105
pFlow::combinedRange
Definition: combinedRange.hpp:36
pFlow::fileSystem
Manages file pathes, manupulate and combines them.
Definition: fileSystem.hpp:71
pFlow::combinedRange::addIntervalRange
bool addIntervalRange(const word &strRange)
Definition: combinedRange.hpp:97
pFlow::commandLine::parse
bool parse(int argc, char **argv)
Definition: commandLine.cpp:50
main
int main(int argc, char **argv)
Definition: postprocessPhasicFlow.cpp:41
pFlow::output
Ostream output
pFlow::combinedRange::addRanges
bool addRanges(const std::vector< word > &strRanges)
Definition: combinedRange.hpp:64
ranges.hpp
pFlow::combinedRange::isMember
bool isMember(T val) const
Definition: combinedRange.hpp:131
pFlow::postprocess
Definition: postprocess.hpp:37
pFlow::wordVector
Vector< word > wordVector
Definition: Vectors.hpp:52
postprocess.hpp
pFlow::CWD
fileSystem CWD()
Free function to reture current working directory.
Definition: fileSystem.hpp:221
pFlow::timeFolder::endTime
real endTime() const
Definition: timeFolder.hpp:111
readControlDict.hpp
commandLine.hpp
Control
auto & Control
Definition: initialize_Control.hpp:47
pFlow::wordList
List< word > wordList
Definition: List.hpp:230
timeFolder.hpp
pFlow::timeFolder
Definition: timeFolder.hpp:32
finalize.hpp