www.cemf.ir
shapeMixture.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 __shapeMixture_hpp__
22 #define __shapeMixture_hpp__
23 
24 #include "Vectors.hpp"
25 #include "Lists.hpp"
26 
27 namespace pFlow
28 {
29 
30 class dictionary;
31 
48 {
49 private:
50 
52  wordVector names_{"shapeNames"};
53 
55  uint32Vector number_{"number"};
56 
58  uint32Vector numberInserted_{"numberInserted"};
59 
61  uint32Vector current_{"currentInserted"};
62 
64 
65 public:
66 
68  TypeInfoNV("shapeMixture");
69 
70  // - Constrcutors
71 
73  shapeMixture(const dictionary & dict, const wordList& validNames);
74 
76  shapeMixture(const shapeMixture&) = default;
77 
79  shapeMixture(shapeMixture&&) = default;
80 
82  shapeMixture& operator=(const shapeMixture&) = default;
83 
85  shapeMixture& operator=(shapeMixture&&) = default;
86 
89  {
90  return makeUnique<shapeMixture>(*this);
91  }
92 
94  ~shapeMixture() = default;
95 
96  // - Methods
97 
100 
102  void getNextShapeNameN(size_t n, wordVector& names);
103 
105  auto size()const {
106  return names_.size();
107  }
108 
110  auto totalInserted()const {
111  return sum(numberInserted_);
112  }
113 
114  // - IO operatoins
115 
116  bool read(const dictionary& dict);
117 
118  bool write(dictionary& dict) const;
119 
120 };
121 
122 } // pFlow
123 
124 #endif //__shapeMixture_hpp__
pFlow::shapeMixture::names_
wordVector names_
List of shape names.
Definition: shapeMixture.hpp:52
pFlow::List< word >
pFlow::shapeMixture::totalInserted
auto totalInserted() const
Total number inserted particles.
Definition: shapeMixture.hpp:110
Lists.hpp
pFlow::shapeMixture::~shapeMixture
~shapeMixture()=default
Destructor.
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::shapeMixture::operator=
shapeMixture & operator=(const shapeMixture &)=default
Copy assignment.
pFlow::Vector::size
auto size() const
Size of the vector.
Definition: Vector.hpp:265
Vectors.hpp
pFlow::shapeMixture
Defines a mixture of particles for particle insertion.
Definition: shapeMixture.hpp:47
pFlow::shapeMixture::write
bool write(dictionary &dict) const
Definition: shapeMixture.cpp:146
pFlow
Definition: demGeometry.hpp:27
pFlow::shapeMixture::number_
uint32Vector number_
Number composition.
Definition: shapeMixture.hpp:55
pFlow::shapeMixture::current_
uint32Vector current_
Current number of inserted.
Definition: shapeMixture.hpp:61
pFlow::shapeMixture::clone
uniquePtr< shapeMixture > clone() const
Polymorphic copy.
Definition: shapeMixture.hpp:88
pFlow::sum
T sum(const Vector< T, Allocator > &v)
Definition: VectorMath.hpp:197
pFlow::shapeMixture::getNextShapeNameN
void getNextShapeNameN(size_t n, wordVector &names)
The name of the n next shapes that should be inserted.
Definition: shapeMixture.cpp:74
n
uint32 n
Definition: NBSLoop.hpp:24
pFlow::shapeMixture::read
bool read(const dictionary &dict)
Definition: shapeMixture.cpp:85
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::shapeMixture::numberInserted_
uint32Vector numberInserted_
Number of inserted particles of each shape.
Definition: shapeMixture.hpp:58
pFlow::shapeMixture::TypeInfoNV
TypeInfoNV("shapeMixture")
Type info.
pFlow::shapeMixture::getNextShapeName
word getNextShapeName()
The name of the next shape that should be inserted.
Definition: shapeMixture.cpp:57
pFlow::shapeMixture::shapeMixture
shapeMixture(const dictionary &dict, const wordList &validNames)
Construct from dictionary.
Definition: shapeMixture.cpp:24
pFlow::shapeMixture::lastPeaked_
uint32 lastPeaked_
Definition: shapeMixture.hpp:63
pFlow::Vector< word >
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
pFlow::shapeMixture::size
auto size() const
Size of mixture (names)
Definition: shapeMixture.hpp:105