www.cemf.ir
conveyorBelt.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 "conveyorBelt.hpp"
22 #include "dictionary.hpp"
23 
24 
27 {
28  if(!read(dict))
29  {
31  " error in reading conveyorBelt from dictionary "<< dict.globalName()<<endl;
32  fatalExit;
33  }
34 }
35 
38 {
39 
40  tangentVelocity_ = dict.getVal<realx3>("tangentVelocity");
41 
42  return true;
43 }
44 
47 {
48  if( !dict.add("tangentVelocity", tangentVelocity_) )
49  {
51  " error in writing tangentVelocity to dictionary "<< dict.globalName()<<endl;
52  return false;
53  }
54  return true;
55 }
56 
59 {
60 
62  return true;
63 }
64 
67 {
68  os.writeWordEntry("tangentVelocity", tangentVelocity_);
69  return true;
70 }
notImplementedFunction
#define notImplementedFunction
Report that a function is yet not implemented.
Definition: error.hpp:84
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
conveyorBelt.hpp
pFlow::dictionary::globalName
virtual word globalName() const
global name of entry, separated with dots
Definition: dictionary.cpp:356
pFlow::dictionary::add
bool add(const word &keyword, const float &v)
add a float dataEntry
Definition: dictionary.cpp:435
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:62
pFlow::conveyorBelt::write
FUNCTION_H bool write(dictionary &dict) const
Definition: conveyorBelt.cpp:46
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
dictionary.hpp
pFlow::conveyorBelt::read
FUNCTION_H bool read(const dictionary &dict)
Definition: conveyorBelt.cpp:37
pFlow::dictionary::getVal
T getVal(const word &keyword) const
get the value of data entry
Definition: dictionary.hpp:379
pFlow::triple< real >
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::conveyorBelt::conveyorBelt
FUNCTION_HD conveyorBelt()=default
pFlow::iOstream::writeWordEntry
iOstream & writeWordEntry(const word &key, const T &value)
Write a keyword/value entry.
Definition: iOstream.hpp:239
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67