Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_pdata
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
1
Merge Requests
1
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_pdata
Commits
7857bce3
Commit
7857bce3
authored
Jun 03, 2017
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Release 0.9.0
parent
6aed688c
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
1170 additions
and
554 deletions
+1170
-554
CHANGELOG.md
CHANGELOG.md
+3
-1
example/Grid/3_gray_scott/main.cpp
example/Grid/3_gray_scott/main.cpp
+3
-3
example/Grid/3_gray_scott_3d/main.cpp
example/Grid/3_gray_scott_3d/main.cpp
+15
-7
example/Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp
...le/Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp
+3
-3
example/Vector/1_celllist/main.cpp
example/Vector/1_celllist/main.cpp
+1
-1
example/Vector/3_molecular_dynamic/main.cpp
example/Vector/3_molecular_dynamic/main.cpp
+44
-40
example/Vector/4_multiphase_celllist_verlet/main.cpp
example/Vector/4_multiphase_celllist_verlet/main.cpp
+9
-2
example/Vector/4_reorder/energy_force.hpp
example/Vector/4_reorder/energy_force.hpp
+2
-2
example/Vector/4_reorder/main_comp_ord.cpp
example/Vector/4_reorder/main_comp_ord.cpp
+2
-2
example/Vector/5_molecular_dynamic_sym_crs/main.cpp
example/Vector/5_molecular_dynamic_sym_crs/main.cpp
+2
-2
example/Vector/7_SPH_dlb_opt/main.cpp
example/Vector/7_SPH_dlb_opt/main.cpp
+2
-7
openfpm_data
openfpm_data
+1
-1
openfpm_devices
openfpm_devices
+1
-1
openfpm_io
openfpm_io
+1
-1
openfpm_vcluster
openfpm_vcluster
+1
-1
src/Decomposition/CartDecomposition.hpp
src/Decomposition/CartDecomposition.hpp
+11
-1
src/Decomposition/common.hpp
src/Decomposition/common.hpp
+1
-1
src/Decomposition/ie_ghost.hpp
src/Decomposition/ie_ghost.hpp
+1
-47
src/Decomposition/ie_loc_ghost.hpp
src/Decomposition/ie_loc_ghost.hpp
+21
-42
src/Grid/grid_dist_id.hpp
src/Grid/grid_dist_id.hpp
+67
-229
src/Grid/grid_dist_id_comm.hpp
src/Grid/grid_dist_id_comm.hpp
+551
-128
src/Grid/grid_dist_id_unit_test.cpp
src/Grid/grid_dist_id_unit_test.cpp
+131
-0
src/Grid/grid_dist_key.hpp
src/Grid/grid_dist_key.hpp
+19
-0
src/Grid/grid_dist_util.hpp
src/Grid/grid_dist_util.hpp
+8
-2
src/Makefile.am
src/Makefile.am
+1
-1
src/Vector/se_class3_vector.hpp
src/Vector/se_class3_vector.hpp
+28
-25
src/Vector/vector_dist.hpp
src/Vector/vector_dist.hpp
+125
-4
src/Vector/vector_dist_cell_list_tests.hpp
src/Vector/vector_dist_cell_list_tests.hpp
+110
-0
src/Vector/vector_dist_key.hpp
src/Vector/vector_dist_key.hpp
+6
-0
No files found.
CHANGELOG.md
View file @
7857bce3
...
...
@@ -20,8 +20,10 @@ All notable changes to this project will be documented in this file.
-
In case of miss compilation ignore system wide installation
-
Bug in VTK writer binary in case of vectors
-
Bug in VTK writer binary: long int are not supported removing output
-
Bug in the constructor with stencil bigger than one
### Changed
-
CellList types has changed
## [0.8.0] 28 February 2016
...
...
example/Grid/3_gray_scott/main.cpp
View file @
7857bce3
...
...
@@ -10,10 +10,10 @@
* This example show the usage of periodic grid with ghost part given in grid units to solve
* the following system of equations
*
* \f$\frac{\partial u}{\partial t} = D_u \nabla u -uv^2 + F(1-u)\f$
* \f$\frac{\partial u}{\partial t} = D_u \nabla u -
uv^2 + F(1-u)\f$
*
*
* \f$\frac{\partial v}{\partial t} = D_v \nabla v
-
uv^2 - (F + k)v\f$
* \f$\frac{\partial v}{\partial t} = D_v \nabla v
+
uv^2 - (F + k)v\f$
*
* ## Constants and functions ##
*
...
...
@@ -201,7 +201,7 @@ int main(int argc, char* argv[])
grid_dist_id
<
2
,
double
,
aggregate
<
double
,
double
>>
Old
(
sz
,
domain
,
g
,
bc
);
// New grid with the decomposition of the old grid
grid_dist_id
<
2
,
double
,
aggregate
<
double
,
double
>>
New
(
Old
.
getDecomposition
(),
sz
,
domain
,
g
);
grid_dist_id
<
2
,
double
,
aggregate
<
double
,
double
>>
New
(
Old
.
getDecomposition
(),
sz
,
g
);
// spacing of the grid on x and y
...
...
example/Grid/3_gray_scott_3d/main.cpp
View file @
7857bce3
...
...
@@ -46,8 +46,16 @@ void init(grid_dist_id<3,double,aggregate<double,double> > & Old, grid_dist_id<3
++
it
;
}
grid_key_dx
<
3
>
start
({(
long
int
)
std
::
floor
(
Old
.
size
(
0
)
*
1.55
f
/
domain
.
getHigh
(
0
)),(
long
int
)
std
::
floor
(
Old
.
size
(
1
)
*
1.55
f
/
domain
.
getHigh
(
1
)),(
long
int
)
std
::
floor
(
Old
.
size
(
1
)
*
1.55
f
/
domain
.
getHigh
(
2
))});
grid_key_dx
<
3
>
stop
({(
long
int
)
std
::
ceil
(
Old
.
size
(
0
)
*
1.85
f
/
domain
.
getHigh
(
0
)),(
long
int
)
std
::
ceil
(
Old
.
size
(
1
)
*
1.85
f
/
domain
.
getHigh
(
1
)),(
long
int
)
std
::
floor
(
Old
.
size
(
1
)
*
1.85
f
/
domain
.
getHigh
(
1
))});
long
int
x_start
=
Old
.
size
(
0
)
*
1.55
f
/
domain
.
getHigh
(
0
);
long
int
y_start
=
Old
.
size
(
1
)
*
1.55
f
/
domain
.
getHigh
(
1
);
long
int
z_start
=
Old
.
size
(
1
)
*
1.55
f
/
domain
.
getHigh
(
2
);
long
int
x_stop
=
Old
.
size
(
0
)
*
1.85
f
/
domain
.
getHigh
(
0
);
long
int
y_stop
=
Old
.
size
(
1
)
*
1.85
f
/
domain
.
getHigh
(
1
);
long
int
z_stop
=
Old
.
size
(
1
)
*
1.85
f
/
domain
.
getHigh
(
2
);
grid_key_dx
<
3
>
start
({
x_start
,
y_start
,
z_start
});
grid_key_dx
<
3
>
stop
({
x_stop
,
y_stop
,
z_stop
});
auto
it_init
=
Old
.
getSubDomainIterator
(
start
,
stop
);
while
(
it_init
.
isNext
())
...
...
@@ -72,7 +80,7 @@ int main(int argc, char* argv[])
Box
<
3
,
double
>
domain
({
0.0
,
0.0
},{
2.5
,
2.5
,
2.5
});
// grid size
size_t
sz
[
3
]
=
{
128
,
128
,
128
};
size_t
sz
[
3
]
=
{
128
,
128
,
128
};
// Define periodicity of the grid
periodicity
<
3
>
bc
=
{
PERIODIC
,
PERIODIC
,
PERIODIC
};
...
...
@@ -90,11 +98,11 @@ int main(int argc, char* argv[])
double
dv
=
1
*
1e-5
;
// Number of timesteps
size_t
timeSteps
=
17
000
;
size_t
timeSteps
=
5
000
;
// K and F (Physical constant in the equation)
double
K
=
0.0
65
;
double
F
=
0.0
34
;
double
K
=
0.0
14
;
double
F
=
0.0
53
;
//! \cond [init lib] \endcond
...
...
@@ -186,7 +194,7 @@ int main(int argc, char* argv[])
// visualization
if
(
i
%
60
==
0
)
{
Old
.
write
(
"output"
,
count
,
VTK_WRITER
|
FORMAT_BINARY
);
Old
.
write
_frame
(
"output"
,
count
,
VTK_WRITER
|
FORMAT_BINARY
);
count
++
;
}
}
...
...
example/Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp
View file @
7857bce3
...
...
@@ -404,7 +404,7 @@ int main(int argc, char* argv[])
*
* Once we have the solution we copy it on the grid
*
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_
eigen
.cpp copy write
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_
petsc
.cpp copy write
*
*/
...
...
@@ -424,7 +424,7 @@ int main(int argc, char* argv[])
*
* At the very end of the program we have always to de-initialize the library
*
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_
eigen
.cpp fin lib
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_
petsc
.cpp fin lib
*
*/
...
...
@@ -440,7 +440,7 @@ int main(int argc, char* argv[])
*
* # Full code # {#num_sk_inc_2D_ps_code}
*
* \include Numerics/Stoke_flow/0_2D_incompressible/main_
eigen
.cpp
* \include Numerics/Stoke_flow/0_2D_incompressible/main_
petsc
.cpp
*
*/
}
...
...
example/Vector/1_celllist/main.cpp
View file @
7857bce3
...
...
@@ -247,7 +247,7 @@ int main(int argc, char* argv[])
Point
<
3
,
float
>
xp
=
vd
.
getPos
(
p
);
// Get an iterator of all the particles neighborhood of p
auto
Np
=
NN
.
getIterator
(
NN
.
getCell
(
vd
.
getPos
(
p
)));
auto
Np
=
NN
.
get
NN
Iterator
(
NN
.
getCell
(
vd
.
getPos
(
p
)));
// For each particle near p
while
(
Np
.
isNext
())
...
...
example/Vector/3_molecular_dynamic/main.cpp
View file @
7857bce3
...
...
@@ -6,8 +6,6 @@
*/
#include "Vector/vector_dist.hpp"
#include "Decomposition/CartDecomposition.hpp"
#include "data_type/aggregate.hpp"
#include "Plot/GoogleChart.hpp"
#include "Plot/util.hpp"
#include "timer.hpp"
...
...
@@ -19,7 +17,10 @@
*
* # Molecular Dynamic with Lennard-Jones potential # {#e3_md}
*
* This example show a simple Lennard-Jones molecular dynamic simulation in a stable regime
* This example show a simple Lennard-Jones molecular dynamic simulation in a stable regime.
* Particle feel each other by the potential.
*
* \f$ V(x_p,x_q) = 4( (\frac{\sigma}{r})^{12} - (\frac{\sigma}{r})^6 ) \f$
*
* ## Constants ##
*
...
...
@@ -55,7 +56,7 @@ constexpr int force = 1;
//! \cond [calc forces] \endcond
void
calc_forces
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
<
3
,
double
,
FAST
,
shift
<
3
,
double
>
>
&
NN
,
double
sigma12
,
double
sigma6
,
double
r_cut2
)
template
<
typename
CellList
>
void
calc_forces
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
&
NN
,
double
sigma12
,
double
sigma6
,
double
r_cut2
)
{
//! \cond [calc forces] \endcond
...
...
@@ -81,12 +82,12 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
/*!
*
* \page Vector_3_md Vector 3 molecular dynamic with cell-list
* \page Vector_3_md
_dyn
Vector 3 molecular dynamic with cell-list
*
* Get an iterator over the particles and get its position. For each particle p iterate in its neighborhood q
* and calculate the force based on the Lennard-Jhones potential given by
*
* \f$ F(x_p,x_q) = 24(
\frac{2}{r^{13}} - \frac{1}{r^{7}}) r
\f$
* \f$ F(x_p,x_q) = 24(
\frac{2 \sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^{7}}) \hat{r}
\f$
*
* \see \ref e0_s_assign_pos
*
...
...
@@ -108,7 +109,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
// Get the position xp of the particle
Point
<
3
,
double
>
xp
=
vd
.
getPos
(
p
);
// Reset the for
i
ce counter
// Reset the force counter
vd
.
template
getProp
<
force
>(
p
)[
0
]
=
0.0
;
vd
.
template
getProp
<
force
>(
p
)[
1
]
=
0.0
;
vd
.
template
getProp
<
force
>(
p
)[
2
]
=
0.0
;
...
...
@@ -175,7 +176,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
//! \cond [calc energy] \endcond
double
calc_energy
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
<
3
,
double
,
FAST
,
shift
<
3
,
double
>
>
&
NN
,
double
sigma12
,
double
sigma6
,
double
r_cut2
)
template
<
typename
CellList
>
double
calc_energy
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
&
NN
,
double
sigma12
,
double
sigma6
,
double
r_cut2
)
{
double
rc
=
r_cut2
;
double
shift
=
2.0
*
(
sigma12
/
(
rc
*
rc
*
rc
*
rc
*
rc
*
rc
)
-
sigma6
/
(
rc
*
rc
*
rc
)
);
...
...
@@ -208,7 +209,7 @@ double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd,
* First we get an iterator over the particles and get its position. For each particle p iterate in its neighborhood q
* and calculate the energy based on the Lennard-Jhones potential given by
*
* \f$ V(x_p,x_q) = 4(\frac{1}{r^{12}} - \frac{1}{r^{6}})
r
\f$
* \f$ V(x_p,x_q) = 4(\frac{1}{r^{12}} - \frac{1}{r^{6}}) \f$
*
* \see \ref e0_s_assign_pos
*
...
...
@@ -284,43 +285,24 @@ int main(int argc, char* argv[])
*
* ## Initialization ## {#e3_md_init}
*
* After we defined the two main function calc forces and calc energy, we define
* important parameters of the simulation, time step integration,
* After we defined the two main function calc forces and calc energy, we Initialize
* the library, we create a Box that define our domain, boundary conditions and ghost.
* Than we define important parameters of the simulation, time step integration,
* size of the box, and cut-off radius of the interaction. We also define 2 vectors
* x and y (they are like std::vector) used for statistic
*
* \see \ref e0_s_init
*
* \snippet Vector/3_molecular_dynamic/main.cpp constants run
*
*/
//! \cond [constants run] \endcond
double
dt
=
0.0005
;
openfpm_init
(
&
argc
,
&
argv
);
double
sigma
=
0.1
;
double
r_cut
=
3.0
*
sigma
;
double
sigma12
=
pow
(
sigma
,
12
);
double
sigma6
=
pow
(
sigma
,
6
);
openfpm
::
vector
<
double
>
x
;
openfpm
::
vector
<
openfpm
::
vector
<
double
>>
y
;
//! \cond [constants run] \endcond
/*!
* \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list
*
* Here we Initialize the library, we create a Box that define our domain, boundary conditions and ghost
*
* \see \ref e0_s_init
*
* \snippet Vector/3_molecular_dynamic/main.cpp init
*
*/
//! \cond [init] \endcond
openfpm_init
(
&
argc
,
&
argv
);
Vcluster
&
v_cl
=
create_vcluster
();
// we will use it do place particles on a 10x10x10 Grid like
size_t
sz
[
3
]
=
{
10
,
10
,
10
};
...
...
@@ -334,7 +316,14 @@ int main(int argc, char* argv[])
// ghost, big enough to contain the interaction radius
Ghost
<
3
,
float
>
ghost
(
r_cut
);
//! \cond [init] \endcond
double
dt
=
0.0005
;
double
sigma12
=
pow
(
sigma
,
12
);
double
sigma6
=
pow
(
sigma
,
6
);
openfpm
::
vector
<
double
>
x
;
openfpm
::
vector
<
openfpm
::
vector
<
double
>>
y
;
//! \cond [constants run] \endcond
/*!
* \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list
...
...
@@ -370,18 +359,24 @@ int main(int argc, char* argv[])
//! \cond [vect grid] \endcond
// We create the grid iterator
auto
it
=
vd
.
getGridIterator
(
sz
);
while
(
it
.
isNext
())
{
// Create a new particle
vd
.
add
();
// key contain (i,j,k) index of the grid
auto
key
=
it
.
get
();
// The index of the grid can be accessed with key.get(0) == i, key.get(1) == j ...
// We use getLastPos to set the position of the last particle added
vd
.
getLastPos
()[
0
]
=
key
.
get
(
0
)
*
it
.
getSpacing
(
0
);
vd
.
getLastPos
()[
1
]
=
key
.
get
(
1
)
*
it
.
getSpacing
(
1
);
vd
.
getLastPos
()[
2
]
=
key
.
get
(
2
)
*
it
.
getSpacing
(
2
);
// We use getLastProp to set the property value of the last particle we added
vd
.
template
getLastProp
<
velocity
>()[
0
]
=
0.0
;
vd
.
template
getLastProp
<
velocity
>()[
1
]
=
0.0
;
vd
.
template
getLastProp
<
velocity
>()[
2
]
=
0.0
;
...
...
@@ -404,8 +399,8 @@ int main(int argc, char* argv[])
*
* The verlet integration stepping look like this
*
* \f[ \vec{v}(t_{n
+1/2}
) = \vec{v}_p(t_n) + \frac{1}{2} \delta t \vec{a}(t_n) \f]
* \f[ \vec{x}(t_{n}) = \vec{x}_p(t_n) + \delta t \vec{v}(t_n+1/2) \f]
* \f[ \vec{v}(t_{n
}+1/2
) = \vec{v}_p(t_n) + \frac{1}{2} \delta t \vec{a}(t_n) \f]
* \f[ \vec{x}(t_{n}
+1
) = \vec{x}_p(t_n) + \delta t \vec{v}(t_n+1/2) \f]
*
* calculate the forces from \f$ \vec{a} (t_{n}) \f$ finally
*
...
...
@@ -465,7 +460,7 @@ int main(int argc, char* argv[])
++
it3
;
}
// Because we mo
o
ved the particles in space we have to map them and re-sync the ghost
// Because we moved the particles in space we have to map them and re-sync the ghost
vd
.
map
();
vd
.
template
ghost_get
<
>();
...
...
@@ -488,7 +483,7 @@ int main(int argc, char* argv[])
++
it4
;
}
// After every iteration collect some statistic about the conf
o
guration
// After every iteration collect some statistic about the conf
i
guration
if
(
i
%
100
==
0
)
{
// We write the particle position for visualization (Without ghost)
...
...
@@ -554,6 +549,15 @@ int main(int argc, char* argv[])
// width of the line
options
.
lineWidth
=
1.0
;
// Resolution in x
options
.
width
=
1280
;
// Resolution in y
options
.
heigh
=
720
;
// Add zoom capability
options
.
more
=
GC_ZOOM
;
// Object that draw the X Y graph
GoogleChart
cg
;
...
...
example/Vector/4_multiphase_celllist_verlet/main.cpp
View file @
7857bce3
...
...
@@ -149,6 +149,8 @@ int main(int argc, char* argv[])
//! \cond [create multi-phase verlet] \endcond
{
// Get the cell list of the phase1
auto
CL_phase1
=
phases
.
get
(
1
).
getCellList
(
r_cut
);
...
...
@@ -204,6 +206,8 @@ int main(int argc, char* argv[])
++
it
;
}
}
//! \cond [count part from phase0 to 1] \endcond
/*!
...
...
@@ -311,13 +315,14 @@ int main(int argc, char* argv[])
*
*/
{
//! \cond [compute sym multi-phase two phase] \endcond
// Get the cell list of the phase1
CL_phase1
=
phases
.
get
(
1
).
getCellListSym
(
r_cut
);
auto
CL_phase1
=
phases
.
get
(
1
).
getCellListSym
(
r_cut
);
// This function create a Verlet-list between phases 0 and 1
NN_ver01
=
createVerletSym
(
phases
.
get
(
0
),
phases
.
get
(
1
),
CL_phase1
,
r_cut
);
auto
NN_ver01
=
createVerletSym
(
phases
.
get
(
0
),
phases
.
get
(
1
),
CL_phase1
,
r_cut
);
// Get an iterator over the real and ghost particles
it
=
phases
.
get
(
0
).
getDomainAndGhostIterator
();
...
...
@@ -371,6 +376,8 @@ int main(int argc, char* argv[])
phases
.
get
(
0
).
ghost_put
<
add_
,
0
>
();
phases
.
get
(
1
).
ghost_put
<
add_
,
0
>
();
}
//! \cond [compute sym multi-phase two phase] \endcond
/*!
...
...
example/Vector/4_reorder/energy_force.hpp
View file @
7857bce3
...
...
@@ -12,7 +12,7 @@ constexpr int velocity = 0;
constexpr
int
force
=
1
;
void
calc_forces
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
<
3
,
double
,
FAST
,
shift
<
3
,
double
>
>
&
NN
,
double
sigma12
,
double
sigma6
)
template
<
typename
CellList
>
void
calc_forces
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
&
NN
,
double
sigma12
,
double
sigma6
)
{
// update the Cell-list
vd
.
updateCellList
(
NN
);
...
...
@@ -73,7 +73,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
}
double
calc_energy
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
<
3
,
double
,
FAST
,
shift
<
3
,
double
>
>
&
NN
,
double
sigma12
,
double
sigma6
)
template
<
typename
CellList
>
double
calc_energy
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
&
NN
,
double
sigma12
,
double
sigma6
)
{
double
E
=
0.0
;
...
...
example/Vector/4_reorder/main_comp_ord.cpp
View file @
7857bce3
...
...
@@ -45,7 +45,7 @@ constexpr int force = 1;
//! \cond [calc forces] \endcond
void
calc_forces
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList_hilb
<
3
,
double
,
FAST
,
shift
<
3
,
double
>
>
&
NN
,
double
sigma12
,
double
sigma6
)
template
<
typename
CellList
>
void
calc_forces
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
&
NN
,
double
sigma12
,
double
sigma6
)
{
//! \cond [calc forces] \endcond
...
...
@@ -140,7 +140,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
//! \cond [calc energy all] \endcond
double
calc_energy
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList_hilb
<
3
,
double
,
FAST
,
shift
<
3
,
double
>
>
&
NN
,
double
sigma12
,
double
sigma6
)
template
<
typename
CellList
>
double
calc_energy
(
vector_dist
<
3
,
double
,
aggregate
<
double
[
3
],
double
[
3
]
>
>
&
vd
,
CellList
&
NN
,
double
sigma12
,
double
sigma6
)
{
double
E
=
0.0
;
...
...
example/Vector/5_molecular_dynamic_sym_crs/main.cpp
View file @
7857bce3
...
...
@@ -148,7 +148,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ve
//! \cond [real and ghost] \endcond
// Get an iterator over particles
auto
it2
=
vd
.
getParticleIteratorCRS
(
NN
.
getInternalCellList
()
);
auto
it2
=
vd
.
getParticleIteratorCRS
(
NN
);
//! \cond [real and ghost] \endcond
...
...
@@ -250,7 +250,7 @@ double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd,
double
shift
=
4.0
*
(
sigma12
/
(
rc
*
rc
*
rc
*
rc
*
rc
*
rc
)
-
sigma6
/
(
rc
*
rc
*
rc
)
);
// Get an iterator over particles
auto
it2
=
vd
.
getParticleIteratorCRS
(
NN
.
getInternalCellList
()
);
auto
it2
=
vd
.
getParticleIteratorCRS
(
NN
);
// For each particle ...
while
(
it2
.
isNext
())
...
...
example/Vector/7_SPH_dlb_opt/main.cpp
View file @
7857bce3
...
...
@@ -912,7 +912,7 @@ int main(int argc, char* argv[])
cbar
=
coeff_sound
*
sqrt
(
gravity
*
h_swl
);
// for each particle inside the fluid box ...
/*
while (fluid_it.isNext())
while
(
fluid_it
.
isNext
())
{
// ... add a particle ...
vd
.
add
();
...
...
@@ -946,8 +946,7 @@ int main(int argc, char* argv[])
// next fluid particle
++
fluid_it
;
}*/
}
// Recipient
Box
<
3
,
double
>
recipient1
({
0.0
,
0.0
,
0.0
},{
1.6
+
dp
/
2.0
,
0.67
+
dp
/
2.0
,
0.4
+
dp
/
2.0
});
...
...
@@ -1010,10 +1009,6 @@ int main(int argc, char* argv[])
vd
.
map
();
vd
.
write
(
"Recipient"
);
return
0
;
// Now that we fill the vector with particles
ModelCustom
md
;
...
...
openfpm_data
@
2c313203
Subproject commit
3a732c98d6404fd81529c25af4fbf33f8ca3de9c
Subproject commit
2c31320305af04b0621d2a10818354d064ec1bbf
openfpm_devices
@
9817279e
Subproject commit
add2acfe9623e6045da1e41adbab6dc57ef50e5f
Subproject commit
9817279ee3ac36b435d2178e994ab314a01aab30
openfpm_io
@
9b0500dd
Subproject commit
a6bd0b797704f6faba662a10f5b101c218257490
Subproject commit
9b0500dd1347d9f3d2898f2a9206220eea7907d5
openfpm_vcluster
@
7030e7f7
Subproject commit
1856e665949ecca8dbcf68e08984aace853aad8d
Subproject commit
7030e7f76e5d80a297e4cc9b2d4f3ad98beb8d0f
src/Decomposition/CartDecomposition.hpp
View file @
7857bce3
...
...
@@ -135,7 +135,7 @@ protected:
//! Structure that store the cartesian grid information
grid_sm
<
dim
,
void
>
gr_dist
;
//! Structure that decompose
your structure into cell
without creating them
//! Structure that decompose
the space into cells
without creating them
//! useful to convert positions to CellId or sub-domain id in this case
CellDecomposer_sm
<
dim
,
T
,
shift
<
dim
,
T
>>
cd
;
...
...
@@ -1724,6 +1724,16 @@ public:
return
dist
.
get_ndec
();
}
/*! \brief Get the cell decomposer of the decomposition
*
* \return the cell decomposer
*
*/
const
CellDecomposer_sm
<
dim
,
T
,
shift
<
dim
,
T
>>
&
getCellDecomposer
()
{
return
cd
;
}
//! friend classes
friend
extended_type
;
...
...
src/Decomposition/common.hpp
View file @
7857bce3
...
...
@@ -114,7 +114,7 @@ struct lBox_dom
{
//! Intersection between the local sub-domain enlarged by the ghost and the contiguous processor
//! sub-domains (External ghost)
openfpm
::
vector_std
<
Box_sub
<
dim
,
T
>
>
ebx
;
openfpm
::
vector_std
<
Box_sub
_k
<
dim
,
T
>
>
ebx
;
//! Intersection between the contiguous processor sub-domain enlarged by the ghost with the
//! local sub-domain (Internal ghost)
...
...
src/Decomposition/ie_ghost.hpp
View file @
7857bce3
...
...
@@ -991,7 +991,7 @@ public:
return
true
;
}
/*! \brief Check if the ie_
loc_
ghosts contain the same information
/*! \brief Check if the ie_ghosts contain the same information
*
* \param ig Element to check
*
...
...
@@ -1065,52 +1065,6 @@ public:
*/
bool
is_equal_ng
(
ie_ghost
<
dim
,
T
>
&
ig
)
{
Box
<
dim
,
T
>
bt
;
if
(
getNEGhostBox
()
!=
ig
.
getNEGhostBox
())
return
false
;
if
(
getNIGhostBox
()
!=
ig
.
getNIGhostBox
())
return
false
;
for
(
size_t
i
=
0
;
i
<
proc_int_box
.
size
()
;
i
++
)
{
if
(
getProcessorNIGhost
(
i
)
!=
ig
.
getProcessorNIGhost
(
i
))
return
false
;
for
(
size_t
j
=
0
;
j
<
getProcessorNIGhost
(
i
)
;
j
++
)
{
if
(
getProcessorIGhostBox
(
i
,
j
).
Intersect
(
ig
.
getProcessorIGhostBox
(
i
,
j
),
bt
)
==
false
)
return
false
;
if
(
getProcessorIGhostId
(
i
,
j
)
!=
ig
.
getProcessorIGhostId
(
i
,
j
))
return
false
;
if
(
getProcessorIGhostSub
(
i
,
j
)
!=
ig
.
getProcessorIGhostSub
(
i
,
j
))
return
false
;
}
if
(
getIGhostBox
(
i
).
Intersect
(
ig
.
getIGhostBox
(
i
),
bt
)
==
false
)
return
false
;
if
(
getIGhostBoxProcessor
(
i
)
!=
ig
.
getIGhostBoxProcessor
(
i
))
return
false
;
}
for
(
size_t
i
=
0
;
i
<
proc_int_box
.
size
()
;
i
++
)
{
if
(
getProcessorNEGhost
(
i
)
!=
ig
.
getProcessorNEGhost
(
i
))
return
false
;
for
(
size_t
j
=
0
;
j
<
getProcessorNEGhost
(
i
)
;
j
++
)
{
if
(
getProcessorEGhostBox
(
i
,
j
).
Intersect
(
ig
.
getProcessorEGhostBox
(
i
,
j
),
bt
)
==
false
)
return
false
;
if
(
getProcessorEGhostId
(
i
,
j
)
!=
ig
.
getProcessorEGhostId
(
i
,
j
))
return
false
;
if
(
getProcessorEGhostSub
(
i
,
j
)
!=
ig
.
getProcessorEGhostSub
(
i
,
j
))
return
false
;
}
if
(
getEGhostBox
(
i
).
Intersect
(
ig
.
getEGhostBox
(
i
),
bt
)
==
false
)
return
false
;
if
(
getEGhostBoxProcessor
(
i
)
!=
ig
.
getEGhostBoxProcessor
(
i
))
return
false
;
}
return
true
;
}
...
...
src/Decomposition/ie_loc_ghost.hpp
View file @
7857bce3
...
...
@@ -70,7 +70,7 @@ class ie_loc_ghost
if
(
intersect
==
true
)
{
Box_sub
<
dim
,
T
>
b
;
Box_sub
_k
<
dim
,
T
>
b
;
b
.
sub
=
rj
;
b
.
bx
=
bi
;
b
.
cmb
=
sub_domains_prc
.
get
(
j
).
cmb
;
...
...
@@ -84,6 +84,7 @@ class ie_loc_ghost
if
(
loc_ghost_box
.
get
(
rj
).
ibx
.
get
(
k
).
sub
==
i
&&
loc_ghost_box
.
get
(
rj
).
ibx
.
get
(
k
).
cmb
==
sub_domains_prc
.
get
(
j
).
cmb
.
operator
-
())
{
loc_ghost_box
.
get
(
rj
).
ibx
.
get
(
k
).
k
=
loc_ghost_box
.
get
(
i
).
ebx
.
size
()
-
1
;
loc_ghost_box
.
get
(
i
).
ebx
.
last
().
k
=
k
;
break
;
}
}
...
...
@@ -346,9 +347,11 @@ public:
return
loc_ghost_box
.
get
(
id
).
ibx
.
size
();
}
/*! \brief For the sub-domain i intersected with the sub-domain j enlarged, the associated
* external ghost box is located in getLocalEGhostBox(j,k) with
* getLocalIGhostSub(j,k) == i, this function return k
/*! \brief For the sub-domain i intersected with a surrounding sub-domain enlarged. Produce a internal ghost box from
* the prospecive of i and an associated external ghost box from the prospective of j.
* In order to retrieve the information about the external ghost box we have to use getLocalEGhostBox(x,k).
* where k is the value returned by getLocalIGhostE(i,j) and x is the value returned by
* getLocalIGhostSub(i,j)
*
* \param i
* \param j
...
...
@@ -460,10 +463,10 @@ public:
return
loc_ghost_box
.
get
(
i
).
ebx
.
get
(
j
).
cmb
;
}
/*! \brief Considering that sub-domain has N internal local ghost box identified
/*! \brief Considering that sub-domain
s
has N internal local ghost box identified
* with the 0 <= k < N that come from the intersection of 2 sub-domains i and j
* where j is enlarged, given the sub-domain i and the id k
to identify the local internal ghost
,
*
it return the id k
of the other sub-domain that produced the intersection
* where j is enlarged, given the sub-domain i and the id k
of the internal box
,
*
it return the id
of the other sub-domain that produced the intersection
*
* \param i sub-domain
* \param k id
...
...
@@ -475,7 +478,7 @@ public:
return
loc_ghost_box
.
get
(
i
).
ibx
.
get
(
k
).
sub
;
}
/*! \brief Considering that sub-domain has N external local ghost box identified
/*! \brief Considering that sub-domain
s
has N external local ghost box identified
* with the 0 <= k < N that come from the intersection of 2 sub-domains i and j
* where i is enlarged, given the sub-domain i and the id k of the external box,
* it return the id of the other sub-domain that produced the intersection
...
...
@@ -562,7 +565,16 @@ public:
{
if
(
loc_ghost_box
.
get
(
i
).
ibx
.
get
(
j
).
k
==
-
1
)