www.cemf.ir
stlWall.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 
22 #include "stlWall.hpp"
23 #include "stlFile.hpp"
24 
25 #include "streams.hpp"
26 
28 (
29  const dictionary& dict
30 )
31 {
32  auto fileName = dict.getVal<word>("file");
33 
34 
35  fileSystem file("./stl",fileName);
36 
37  stlFile stl(file);
38  if(!stl.read())
39  {
41  " error in reading stl file "<< file <<endl;
42  return false;
43  }
44 
45  for(uint64 i=0; i<stl.size(); i++)
46  {
47  auto it = triangles_.end();
48  triangles_.insert(it, stl.solid(i).begin(), stl.solid(i).end());
49  }
50 
51 
52 
53  return true;
54 
55 }
56 
58 {}
59 
61 (
62  const dictionary& dict
63 )
64 :
65  Wall(dict)
66 {
67  if(!readSTLWall(dict))
68  {
69  fatalExit;
70  }
71 }
stlWall.hpp
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::stlFile::solid
const realx3x3Vector & solid(size_t i) const
Definition: stlFile.cpp:355
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::stlFile
Definition: stlFile.hpp:38
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::stlWall::readSTLWall
bool readSTLWall(const dictionary &dict)
Definition: stlWall.cpp:28
pFlow::stlFile::size
size_t size() const
Definition: stlFile.cpp:349
pFlow::fileSystem
Manages file pathes, manupulate and combines them.
Definition: fileSystem.hpp:71
stlFile.hpp
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
streams.hpp
pFlow::dictionary::getVal
T getVal(const word &keyword) const
get the value of data entry
Definition: dictionary.hpp:379
pFlow::stlWall::stlWall
stlWall()
Definition: stlWall.cpp:57
pFlow::uint64
unsigned long long int uint64
Definition: builtinTypes.hpp:58
pFlow::stlFile::read
bool read()
Definition: stlFile.cpp:292
pFlow::Wall
Definition: Wall.hpp:41
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