Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_numerics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_numerics
Commits
6794c24b
Commit
6794c24b
authored
Dec 13, 2016
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing change name in VCluster
parent
6abb6a87
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
5 deletions
+82
-5
src/Makefile.am
src/Makefile.am
+1
-1
src/Matrix/SparseMatrix_Eigen.hpp
src/Matrix/SparseMatrix_Eigen.hpp
+1
-1
src/Operators/Vector/vector_dist_operators_apply_kernel.hpp
src/Operators/Vector/vector_dist_operators_apply_kernel.hpp
+51
-0
src/Operators/Vector/vector_dist_operators_functions.hpp
src/Operators/Vector/vector_dist_operators_functions.hpp
+15
-2
src/Operators/Vector/vector_dist_operators_unit_tests.hpp
src/Operators/Vector/vector_dist_operators_unit_tests.hpp
+13
-0
src/unit_test_init_cleanup.hpp
src/unit_test_init_cleanup.hpp
+1
-1
No files found.
src/Makefile.am
View file @
6794c24b
...
...
@@ -2,7 +2,7 @@
LINKLIBS
=
$(OPENMP_LDFLAGS)
$(LIBHILBERT_LIB)
$(PETSC_LIB)
$(SUITESPARSE_LIBS)
$(LAPACK_LIBS)
$(BLAS_LIBS)
$(METIS_LIB)
$(PARMETIS_LIB)
$(DEFAULT_LIB)
$(PTHREAD_LIBS)
$(OPT_LIBS)
$(BOOST_LDFLAGS)
$(BOOST_PROGRAM_OPTIONS_LIB)
$(BOOST_IOSTREAMS_LIB)
$(HDF5_LDFLAGS)
$(HDF5_LIBS)
$(LIBQUADMATH)
$(OPENMP_LDFLAGS)
$(LIBIFCORE)
noinst_PROGRAMS
=
numerics
numerics_SOURCES
=
main.cpp ../../openfpm_vcluster/src/VCluster.cpp ../../openfpm_devices/src/memory/HeapMemory.cpp ../../openfpm_devices/src/memory/PtrMemory.cpp ../../openfpm_devices/src/Memleak_check.cpp
numerics_SOURCES
=
main.cpp ../../openfpm_vcluster/src/VCluster
/VCluster
.cpp ../../openfpm_devices/src/memory/HeapMemory.cpp ../../openfpm_devices/src/memory/PtrMemory.cpp ../../openfpm_devices/src/Memleak_check.cpp
numerics_CXXFLAGS
=
$(OPENMP_CFLAGS)
$(LIBHILBERT_INCLUDE)
$(AM_CXXFLAGS)
$(HDF5_CPPFLAGS)
$(INCLUDES_PATH)
$(BOOST_CPPFLAGS)
$(SUITESPARSE_INCLUDE)
$(METIS_INCLUDE)
$(PARMETIS_INCLUDE)
$(EIGEN_INCLUDE)
$(PETSC_INCLUDE)
-Wno-deprecated-declarations
-Wno-unused-local-typedefs
numerics_CFLAGS
=
$(CUDA_CFLAGS)
numerics_LDADD
=
$(LINKLIBS)
-lparmetis
-lmetis
...
...
src/Matrix/SparseMatrix_Eigen.hpp
View file @
6794c24b
...
...
@@ -10,7 +10,7 @@
#include "Vector/map_vector.hpp"
#include <boost/mpl/int.hpp>
#include "VCluster.hpp"
#include "VCluster
/VCluster
.hpp"
#define EIGEN_TRIPLET 1
...
...
src/Operators/Vector/vector_dist_operators_apply_kernel.hpp
View file @
6794c24b
...
...
@@ -199,15 +199,27 @@ struct apply_kernel_is_number_or_expression_gen
template
<
typename
exp1
,
typename
vector_type
>
class
vector_dist_expression_op
<
exp1
,
vector_type
,
VECT_APPLYKER_IN
>
{
//! Type of neighborhood
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
0
>>::
type
NN
;
//! Type of kernel
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
1
>>::
type
Kernel
;
// Type of the vector containing the particles
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
2
>>::
type
vector_orig
;
//! expression
const
exp1
o1
;
//! neighborhood list
NN
&
cl
;
//! kernel
Kernel
&
ker
;
//! Vector of particles
const
vector_orig
&
vd
;
//! Return type of the expression
typedef
typename
apply_kernel_rtype
<
decltype
(
o1
.
value
(
vect_dist_key_dx
(
0
)))
>::
rtype
rtype
;
public:
...
...
@@ -246,14 +258,25 @@ public:
template
<
typename
exp1
,
typename
vector_type
>
class
vector_dist_expression_op
<
exp1
,
vector_type
,
VECT_APPLYKER_IN_SIM
>
{
//! Type of neighborhood list
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
0
>>::
type
NN
;
//! Type of the kernel
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
1
>>::
type
Kernel
;
//! Type that store the particles
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
2
>>::
type
vector_orig
;
//! Neighborhood list
NN
&
cl
;
//! kernel
Kernel
&
ker
;
//! vector of particles
const
vector_orig
&
vd
;
//! return type of the expression
typedef
typename
apply_kernel_rtype
<
decltype
(
std
::
declval
<
Kernel
>
().
value
(
Point
<
vector_orig
::
dims
,
typename
vector_orig
::
stype
>
(
0.0
),
Point
<
vector_orig
::
dims
,
typename
vector_orig
::
stype
>
(
0.0
)
)
)
>::
rtype
rtype
;
...
...
@@ -268,6 +291,13 @@ public:
{
}
/*! \brief Constructor
*
* \param cl neighborhood-list
* \param ker kernel to apply
* \param vd particle set to which apply the kernel
*
*/
vector_dist_expression_op
(
NN
&
cl
,
Kernel
&
ker
,
const
vector_orig
&
vd
)
:
cl
(
cl
),
ker
(
ker
),
vd
(
vd
)
{}
...
...
@@ -293,15 +323,28 @@ public:
template
<
typename
exp1
,
typename
vector_type
>
class
vector_dist_expression_op
<
exp1
,
vector_type
,
VECT_APPLYKER_IN_GEN
>
{
//! Type of nearest neighborhood
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
0
>>::
type
NN
;
//! Type of kernel
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
1
>>::
type
Kernel
;
//! Type of vector
typedef
typename
boost
::
mpl
::
at
<
vector_type
,
boost
::
mpl
::
int_
<
2
>>::
type
vector_orig
;
//! expression 1
const
exp1
o1
;
//! nearest neighborhood
NN
&
cl
;
//! kernel
Kernel
&
ker
;
//! Vector containing the particles
const
vector_orig
&
vd
;
//! Return type of the kernel
typedef
typename
apply_kernel_rtype
<
decltype
(
o1
.
value
(
vect_dist_key_dx
(
0
)))
>::
rtype
rtype
;
public:
...
...
@@ -316,6 +359,14 @@ public:
o1
.
init
();
}
/*! \brief Constructor from expression
*
* \param o1 first expression
* \param NN neighborhood
* \param kernel
* \param vd vector with particles
*
*/
vector_dist_expression_op
(
const
exp1
&
o1
,
NN
&
cl
,
Kernel
&
ker
,
const
vector_orig
&
vd
)
:
o1
(
o1
),
cl
(
cl
),
ker
(
ker
),
vd
(
vd
)
{}
...
...
src/Operators/Vector/vector_dist_operators_functions.hpp
View file @
6794c24b
...
...
@@ -208,24 +208,34 @@ CREATE_VDIST_ARG2_FUNC(pmul,pmul,VECT_PMUL)
////////// Special function reduce /////////////////////////
/*! \brief expression that encapsulate a vector reduction expression
*
* \tparam exp1 expression 1
* \tparam vector_type type of vector on which the expression is acting
*
*/
template
<
typename
exp1
,
typename
vector_type
>
class
vector_dist_expression_op
<
exp1
,
vector_type
,
VECT_SUM_REDUCE
>
{
//! expression 1
const
exp1
o1
;
//! return type comming from the expression
typedef
typename
apply_kernel_rtype
<
decltype
(
o1
.
value
(
vect_dist_key_dx
(
0
)))
>::
rtype
rtype
;
//
calculated valu
e
//
! r_type without referenc
e
mutable
typename
std
::
remove_reference
<
rtype
>::
type
val
;
const
vector_type
&
vd
;
public:
//! constructor from an epxression exp1 and a vector vd
vector_dist_expression_op
(
const
exp1
&
o1
,
const
vector_type
&
vd
)
:
o1
(
o1
),
vd
(
vd
)
{}
//! initialize the expression
inline
void
init
()
const
{
o1
.
init
();
...
...
@@ -244,19 +254,21 @@ public:
}
}
//! Get the value of the expression
inline
typename
std
::
remove_reference
<
rtype
>::
type
get
()
{
init
();
return
value
(
vect_dist_key_dx
(
0
));
}
//! Get the value of the expression
template
<
typename
r_type
=
typename
std
::
remove_reference
<
rtype
>
::
type
>
inline
r_type
value
(
const
vect_dist_key_dx
&
key
)
const
{
return
val
;
}
};
//! Reduce function (it generate an expression)
template
<
typename
exp1
,
typename
exp2_
,
unsigned
int
op1
,
typename
vector_type
>
inline
vector_dist_expression_op
<
vector_dist_expression_op
<
exp1
,
exp2_
,
op1
>
,
vector_type
,
VECT_SUM_REDUCE
>
rsum
(
const
vector_dist_expression_op
<
exp1
,
exp2_
,
op1
>
&
va
,
const
vector_type
&
vd
)
...
...
@@ -266,6 +278,7 @@ rsum(const vector_dist_expression_op<exp1,exp2_,op1> & va, const vector_type & v
return
exp_sum
;
}
//! Reduce function (It generate an expression)
template
<
unsigned
int
prp1
,
typename
v1
,
typename
vector_type
>
inline
vector_dist_expression_op
<
vector_dist_expression
<
prp1
,
v1
>
,
vector_type
,
VECT_SUM_REDUCE
>
rsum
(
const
vector_dist_expression
<
prp1
,
v1
>
&
va
,
const
vector_type
&
vd
)
...
...
src/Operators/Vector/vector_dist_operators_unit_tests.hpp
View file @
6794c24b
...
...
@@ -652,12 +652,16 @@ typedef vector_dist<3,float,aggregate<float,float,float,VectorS<3,float>,VectorS
//! Exponential kernel
struct
exp_kernel
{
//! variance of the exponential kernel
float
var
;
//! Exponential kernel giving variance
exp_kernel
(
float
var
)
:
var
(
var
)
{}
//! Calculate the value of the exponential kernel given two points p and q
// pA is the property on p pB is the property on B
inline
float
value
(
const
Point
<
3
,
float
>
&
p
,
const
Point
<
3
,
float
>
&
q
,
float
pA
,
float
pB
)
{
float
dist
=
norm
(
p
-
q
);
...
...
@@ -665,6 +669,8 @@ struct exp_kernel
return
(
pA
+
pB
)
*
exp
(
dist
*
dist
/
var
);
}
//! Calculate the value of the exponential kernel given two points p and q
// pA is the value of the property on pA and pB is the value of the property on pB
inline
Point
<
3
,
float
>
value
(
const
Point
<
3
,
float
>
&
p
,
const
Point
<
3
,
float
>
&
q
,
const
Point
<
3
,
float
>
&
pA
,
const
Point
<
3
,
float
>
&
pB
)
{
float
dist
=
norm
(
p
-
q
);
...
...
@@ -672,6 +678,9 @@ struct exp_kernel
return
(
pA
+
pB
)
*
exp
(
dist
*
dist
/
var
);
}
//! Calculate the value of the exponential kernel given two points p and q
// pA is the value of the property on pA and pB is the value of the property on pB
// vd1 is the set of particles
inline
float
value
(
size_t
p
,
size_t
q
,
float
pA
,
float
pB
,
const
vector_type
&
vd1
)
{
Point
<
3
,
float
>
pp
=
vd1
.
getPos
(
p
);
...
...
@@ -682,6 +691,9 @@ struct exp_kernel
return
(
pA
+
pB
)
*
exp
(
dist
*
dist
/
var
);
}
//! Calculate the value of the exponential kernel given two points p and q
// pA is the value of the property on pA and pB is the value of the property on pB
// vd1 is the set of particles
inline
Point
<
3
,
float
>
value
(
size_t
p
,
size_t
q
,
const
Point
<
3
,
float
>
&
pA
,
const
Point
<
3
,
float
>
&
pB
,
const
vector_type
&
vd1
)
{
Point
<
3
,
float
>
pp
=
vd1
.
getPos
(
p
);
...
...
@@ -692,6 +704,7 @@ struct exp_kernel
return
(
pA
+
pB
)
*
exp
(
dist
*
dist
/
var
);
}
//! Calculate the value of the exponential kernel given two points p and q
inline
Point
<
2
,
float
>
value
(
const
Point
<
3
,
float
>
&
p
,
const
Point
<
3
,
float
>
&
q
)
{
float
dist
=
norm
(
p
-
q
);
...
...
src/unit_test_init_cleanup.hpp
View file @
6794c24b
...
...
@@ -8,7 +8,7 @@
#ifndef UNIT_TEST_INIT_CLEANUP_HPP_
#define UNIT_TEST_INIT_CLEANUP_HPP_
#include "VCluster.hpp"
#include "VCluster
/VCluster
.hpp"
struct
ut_start
{
ut_start
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment