Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_pdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_pdata
Commits
349001cd
Commit
349001cd
authored
8 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Fixing documentation
parent
0bd3857f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example/Vector/0_simple/main.cpp
+1
-0
1 addition, 0 deletions
example/Vector/0_simple/main.cpp
example/Vector/4_multiphase_celllist/main.cpp
+65
-33
65 additions, 33 deletions
example/Vector/4_multiphase_celllist/main.cpp
with
66 additions
and
33 deletions
example/Vector/0_simple/main.cpp
+
1
−
0
View file @
349001cd
...
...
@@ -7,6 +7,7 @@
* \subpage Vector_4_reo
* \subpage Vector_4_comp_reo
* \subpage Vector_4_complex_prop
* \subpage Vector_4_mp_cl
*
*/
...
...
This diff is collapsed.
Click to expand it.
example/Vector/4_multiphase_celllist/main.cpp
+
65
−
33
View file @
349001cd
...
...
@@ -28,7 +28,7 @@ int main(int argc, char* argv[])
* Here we Initialize the library, and we create a set of distributed vectors all forced to have the same
* decomposition. Each vector identify one phase
*
* \snippet Vector/
1
_celllist/main.cpp Initialization and parameters
* \snippet Vector/
4_multiphase
_celllist/main.cpp Initialization and parameters
*
*/
...
...
@@ -49,25 +49,6 @@ int main(int argc, char* argv[])
// ghost, big enough to contain the interaction radius
Ghost
<
3
,
float
>
ghost
(
1.0
/
(
128
-
2
));
//! \cond [Initialization and parameters] \endcond
/*!
* \page Vector_1_celllist Vector 1 Cell-list
*
* ## %Vector create ##
*
* Here we define a distributed vector in 3D, containing 3 properties, a
* scalar double, a vector double[3], and a tensor or rank 2 double[3][3].
* In this case the vector contain 0 particles initially
*
* \see \ref vector_inst
*
* \snippet Vector/1_celllist/main.cpp vector inst
*
*/
//! \cond [vector inst] \endcond
openfpm
::
vector
<
vector_dist
<
3
,
float
,
aggregate
<
double
,
double
>>
>
phases
;
// first phase
...
...
@@ -78,7 +59,21 @@ int main(int argc, char* argv[])
phases
.
add
(
vector_dist
<
3
,
float
,
aggregate
<
double
,
double
>>
(
phases
.
get
(
2
).
getDecomposition
(),
4096
)
);
phases
.
add
(
vector_dist
<
3
,
float
,
aggregate
<
double
,
double
>>
(
phases
.
get
(
3
).
getDecomposition
(),
4096
)
);
//! \cond [grid like part] \endcond
//! \cond [Initialization and parameters] \endcond
/*!
* \page Vector_4_mp_cl Vector 4 Multi Phase cell-list
*
* ## Initialization ##
*
* We initialize all the phases with particle randomly positioned in the space
*
* \snippet Vector/4_multiphase_celllist/main.cpp rand dist
*
*/
//! \cond [rand dist] \endcond
auto
it
=
phases
.
get
(
0
).
getDomainIterator
();
...
...
@@ -104,27 +99,64 @@ int main(int argc, char* argv[])
openfpm
::
vector
<
iterator
>
phase_it
;
for
(
size_t
i
=
0
;
i
<
phases
.
size
()
;
i
++
)
{
phases
.
get
(
i
).
map
();
phase_it
.
add
(
phases
.
get
(
i
).
getDomainIterator
());
}
// Construct one single Multi-phase cell list to use in the computation
//! \cond [rand dist] \endcond
/*!
* \page Vector_4_mp_cl Vector 4 Multi Phase cell-list
*
* ## Multi-phase cell-list construction ##
*
* In this part we construct the Multi-phase cell list. The multiphase cell list has 3 parameters
* * one is the dimensionality (3)
* * The precision of the coordinates (float),
* * How many bit to use for the phase.
* Multi-phase cell-list try to pack into a 64bit number information about the particle id and the
* the phase id.
*
* \snippet Vector/4_multiphase_celllist/main.cpp cl construction
*
*/
//! \cond [cl construction] \endcond
// Construct one single Multi-phase cell list to use in the computation
// in 3d, precision float, 2 bit dedicated to the phase for a maximum of 2^2 = 4 (Maximum number of phase)
CellListM
<
3
,
float
,
2
>
NN
;
while
(
it
.
isNext
())
// for all the phases i
for
(
size_t
i
=
0
;
i
<
phases
.
size
()
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
phases
.
size
()
;
i
++
)
// iterate across all the particle of the phase i
auto
it
=
phases
.
get
(
i
).
getDomainIterator
();
while
(
it
.
isNext
())
{
auto
key
=
it
.
get
();
// Add the particle of the phase i to the cell list
NN
.
add
(
phases
.
get
(
i
).
getPos
(
key
),
key
.
getKey
(),
i
);
++
it
;
}
}
//! \cond [cl construction] \endcond
/*!
* \page Vector_4_mp_cl Vector 4 Multi Phase cell-list
*
* ## Multi-phase cell-list usage ##
*
* After construction we show how to use the Cell-list. In this case we accumulate on the property
* 0 of the phase 0 the distance of the near particles from all the phases
*
* \snippet Vector/4_multiphase_celllist/main.cpp cl usage
*
*/
//! \cond [cl usage] \endcond
vector_dist
<
3
,
float
,
aggregate
<
double
,
double
>
>
&
current_phase
=
phases
.
get
(
0
);
// Get the iterator of the particles of phase 0
...
...
@@ -163,16 +195,16 @@ int main(int argc, char* argv[])
++
it2
;
}
//! \cond [
verletlist
] \endcond
//! \cond [
cl usage
] \endcond
/*!
* \page Vector_
1_celllist Vector 1 C
ell-list
* \page Vector_
4_mp_cl Vector 4 Multi Phase c
ell-list
*
* ## Finalize ## {#finalize}
*
* At the very end of the program we have always
to
de-initialize the library
* At the very end of the program we have always de-initialize the library
*
* \snippet Vector/
1
_celllist/main.cpp finalize
* \snippet Vector/
4_multiphase
_celllist/main.cpp finalize
*
*/
...
...
@@ -183,11 +215,11 @@ int main(int argc, char* argv[])
//! \cond [finalize] \endcond
/*!
* \page Vector_
1_celllist Vector 1 C
ell-list
* \page Vector_
4_mp_cl Vector 4 Multi Phase c
ell-list
*
* # Full code # {#code}
*
* \include Vector/
1
_celllist/main.cpp
* \include Vector/
4_multiphase
_celllist/main.cpp
*
*/
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment