www.cemf.ir
VectorSingleAlgorithms.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 #ifndef __VectorSingleMath_hpp__
21 #define __VectorSingleMath_hpp__
22 
23 
24 namespace pFlow
25 {
26 
27 template<typename T, typename MemorySpace>
29 size_t count(const VectorSingle<T,MemorySpace>& vec, const T& val)
30 {
31  return count( vec.deviceViewAll(), 0, vec.size(), val);
32 }
33 
34 template<class T, class MemorySpace>
36 {
37  return min(
38  vec.deviceViewAll(),
39  0, vec.size()
40  );
41 }
42 
43 template<class T, class MemorySpace>
45 {
46  return min(
47  vec.deviceViewAll(),
48  0, vec.size()
49  );
50 }
51 
52 }
53 
54 
55 #endif // __VectorSingleMath_hpp__
pFlow::max
T max(const internalField< T, MemorySpace > &iField)
Definition: internalFieldAlgorithms.hpp:79
pFlow
Definition: demGeometry.hpp:27
INLINE_FUNCTION_H
#define INLINE_FUNCTION_H
Definition: pFlowMacros.hpp:57
pFlow::count
auto count(const Vector< T, Allocator > &vec, const T &val)
Definition: VectorAlgorithm.hpp:26
pFlow::min
T min(const internalField< T, MemorySpace > &iField)
Definition: internalFieldAlgorithms.hpp:28
pFlow::VectorSingle
Definition: VectorSingle.hpp:44
pFlow::VectorSingle::deviceViewAll
INLINE_FUNCTION_H auto & deviceViewAll()
Device view range [0,capcity)
Definition: VectorSingle.cpp:249
pFlow::VectorSingle::size
INLINE_FUNCTION_H uint32 size() const
Size of the vector.
Definition: VectorSingle.cpp:297