# PhasicFlow: src/Particles/Insertion/shapeMixture/shapeMixture.hpp 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.

shapeMixture.hpp
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.
-----------------------------------------------------------------------------*/
#ifndef __shapeMixture_hpp__
#define __shapeMixture_hpp__
#include "Vectors.hpp"
#include "Lists.hpp"
namespace pFlow
{
class dictionary;
class shapeMixture
{
private:
wordVector names_{"shapeNames"};
uint32Vector number_{"number"};
uint32Vector numberInserted_{"numberInserted"};
uint32Vector current_{"currentInserted"};
uint32 lastPeaked_ = 0;
public:
TypeInfoNV("shapeMixture");
// - Constrcutors
shapeMixture(const dictionary & dict, const wordList& validNames);
shapeMixture(const shapeMixture&) = default;
shapeMixture(shapeMixture&&) = default;
shapeMixture& operator=(const shapeMixture&) = default;
shapeMixture& operator=(shapeMixture&&) = default;
uniquePtr<shapeMixture> clone()const
{
return makeUnique<shapeMixture>(*this);
}
~shapeMixture() = default;
// - Methods
word getNextShapeName();
void getNextShapeNameN(size_t n, wordVector& names);
auto size()const {
return names_.size();
}
auto totalInserted()const {
return sum(numberInserted_);
}
// - IO operatoins
bool read(const dictionary& dict);
bool write(dictionary& dict) const;
};
} // pFlow
#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