www.cemf.ir
createDataIO-old.hpp
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 #ifndef __createDataIO_hpp__
22 #define __createDataIO_hpp__
23 
24 #include "uniquePtr.hpp"
25 #include "dataIO.hpp"
26 #include "dataIORegular.hpp"
27 #include "dataIOMPI.hpp"
28 
29 namespace pFlow
30 {
31 
32 template<typename T>
34  const word& runType, const IOPattern& iop)
35 {
36  if(runType == "regular")
37  {
38  return makeUnique<dataIORegular<T>>(iop);
39  }
40  else if(runType == "MPI")
41  {
42  return makeUnique<dataIOMPI<T>>(iop);
43  }
44  else
45  {
46  fatalErrorInFunction<< "not dataIO pattern is specified for this "<<
47  runType<<endl;
48  fatalExit;
49  }
50  return nullptr;
51 }
52 
53 }
54 
55 #endif
dataIORegular.hpp
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow
Definition: demGeometry.hpp:27
uniquePtr.hpp
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::IOPattern
Definition: IOPattern.hpp:32
pFlow::createDataIO
uniquePtr< dataIO< T > > createDataIO(const word &runType, const IOPattern &iop)
Definition: createDataIO-old.hpp:33
dataIO.hpp
pFlow::uniquePtr
Definition: uniquePtr.hpp:42