Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfpm_pdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
argupta
openfpm_pdata
Commits
88bfcb88
Commit
88bfcb88
authored
8 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Fixing example compilation
parent
83a98571
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
example/Vector/0_simple/main.cpp
+5
-2
5 additions, 2 deletions
example/Vector/0_simple/main.cpp
example/Vector/1_celllist/main.cpp
+15
-9
15 additions, 9 deletions
example/Vector/1_celllist/main.cpp
example/Vector/7_SPH_dlb/main.cpp
+9
-1
9 additions, 1 deletion
example/Vector/7_SPH_dlb/main.cpp
with
29 additions
and
12 deletions
example/Vector/0_simple/main.cpp
+
5
−
2
View file @
88bfcb88
...
...
@@ -330,7 +330,7 @@ int main(int argc, char* argv[])
* generate a VTK file. VTK has two format one is the ASCII that is human readable but produce
* bigger file the other is the binary that produce not-human readable files, but smaller
* and more efficent files to read for Paraview. In order to create a Binary VTK file use the
* option VTK_
* option VTK_
WRITER in combination with FORMAT_BINARY
*
* \snippet Vector/0_simple/main.cpp vtk
*
...
...
@@ -346,8 +346,11 @@ int main(int argc, char* argv[])
//! \cond [vtk] \endcond
// save vtk format (vtk is always the default)
vd
.
write
(
"particles"
);
vd
.
write
(
"particles"
,
VTK_WRITE_BINARY
);
// save in vtk binary format
vd
.
write
(
"particles_bin"
,
VTK_WRITER
|
FORMAT_BINARY
);
//! \cond [vtk] \endcond
...
...
This diff is collapsed.
Click to expand it.
example/Vector/1_celllist/main.cpp
+
15
−
9
View file @
88bfcb88
...
...
@@ -310,26 +310,28 @@ int main(int argc, char* argv[])
//! \cond [verletlist] \endcond
openfpm
::
vector
<
openfpm
::
vector
<
size_t
>>
verlet
;
vd
.
getVerletDeprecated
(
verlet
,
r_cut
);
auto
verlet
=
vd
.
getVerlet
(
r_cut
);
auto
it3
=
vd
.
getDomainIterator
();
// For each particle i verlet.size() == Number of particles
for
(
size_t
i
=
0
;
i
<
verlet
.
size
()
;
i
++
)
while
(
it3
.
isNext
()
)
{
auto
p
=
it3
.
get
();
// get the position of the particle i
Point
<
3
,
float
>
xp
=
vd
.
getPos
(
i
);
Point
<
3
,
float
>
xp
=
vd
.
getPos
(
p
);
// get the Neighborhood of
i
openfpm
::
vector
<
size_t
>
&
NN
=
verlet
.
get
(
i
);
// get the Neighborhood of
p
auto
NN
p
=
verlet
.
get
NNIterator
(
p
.
getKey
()
);
// for each neighborhood j of particle to i
for
(
size_t
j
=
0
;
j
<
NN
.
size
()
;
j
++
)
while
(
NNp
.
isNext
()
)
{
size_t
p
=
NN
.
get
(
j
);
size_t
q
=
NN
p
.
get
();
// Get the position of the particle neighborhood if i
Point
<
3
,
float
>
xq
=
vd
.
getPos
(
p
);
Point
<
3
,
float
>
xq
=
vd
.
getPos
(
q
);
// Calculate the distance vector between p and q
Point
<
3
,
float
>
f
=
(
xp
-
xq
);
...
...
@@ -352,7 +354,11 @@ int main(int argc, char* argv[])
vd
.
template
getProp
<
2
>(
p
)[
2
][
0
]
+=
(
xp
.
get
(
2
)
-
xq
.
get
(
2
))
*
(
xp
.
get
(
0
)
-
xq
.
get
(
0
));
vd
.
template
getProp
<
2
>(
p
)[
2
][
1
]
+=
(
xp
.
get
(
2
)
-
xq
.
get
(
2
))
*
(
xp
.
get
(
1
)
-
xq
.
get
(
1
));
vd
.
template
getProp
<
2
>(
p
)[
2
][
2
]
+=
(
xp
.
get
(
2
)
-
xq
.
get
(
2
))
*
(
xp
.
get
(
2
)
-
xq
.
get
(
2
));
++
NNp
;
}
++
it3
;
}
//! \cond [verletlist] \endcond
...
...
This diff is collapsed.
Click to expand it.
example/Vector/7_SPH_dlb/main.cpp
+
9
−
1
View file @
88bfcb88
...
...
@@ -204,7 +204,10 @@ typedef vector_dist<3,double,aggregate<size_t,double, double, double, do
struct
ModelCustom
{
template
<
typename
Decomposition
,
typename
vector
>
inline
void
addComputation
(
Decomposition
&
dec
,
const
vector
&
vd
,
size_t
v
,
size_t
p
)
template
<
typename
Decomposition
,
typename
vector
>
inline
void
addComputation
(
Decomposition
&
dec
,
const
vector
&
vd
,
size_t
v
,
size_t
p
)
{
if
(
vd
.
template
getProp
<
type
>(
p
)
==
FLUID
)
dec
.
addComputationCost
(
v
,
4
);
...
...
@@ -216,6 +219,11 @@ struct ModelCustom
{
dec
.
setSubSubDomainComputationCost
(
v
,
dec
.
getSubSubDomainComputationCost
(
v
)
*
dec
.
getSubSubDomainComputationCost
(
v
));
}
double
distributionTol
()
{
return
1.01
;
}
};
/*! \cond [model custom] \endcond */
...
...
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