Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sbalzarini Lab
S
Software
P
Parallel Computing
OpenFPM
openfpm_pdata
Commits
9034c2b1
Commit
9034c2b1
authored
Jan 31, 2017
by
incardon
Browse files
Adding missing files
parent
bc68ad93
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/DLB/LB_Model.hpp
0 → 100644
View file @
9034c2b1
/*
* LB_Model.hpp
*
* Created on: Jan 18, 2017
* Author: i-bird
*/
#ifndef SRC_DLB_LB_MODEL_HPP_
#define SRC_DLB_LB_MODEL_HPP_
/*! \brief Linear model
*
* The linear model count each particle as weight one
*
*/
struct
ModelLin
{
size_t
factor
=
1
;
ModelLin
(
size_t
factor
)
:
factor
(
factor
)
{}
ModelLin
()
{}
template
<
typename
Decomposition
,
typename
vector
>
inline
void
addComputation
(
Decomposition
&
dec
,
const
vector
&
vd
,
size_t
v
,
size_t
p
)
{
dec
.
addComputationCost
(
v
,
1
);
}
template
<
typename
Decomposition
>
inline
void
applyModel
(
Decomposition
&
dec
,
size_t
v
)
{
dec
.
setSubSubDomainComputationCost
(
v
,
dec
.
getSubSubDomainComputationCost
(
v
));
}
};
/*! \brief Linear model
*
* The linear model count each particle as weight one
*
*/
struct
ModelSquare
{
size_t
factor
=
1
;
template
<
typename
Decomposition
,
typename
vector
>
inline
void
addComputation
(
Decomposition
&
dec
,
const
vector
&
vd
,
size_t
v
,
size_t
p
)
{
dec
.
addComputationCost
(
v
,
1
);
}
template
<
typename
Decomposition
>
inline
void
applyModel
(
Decomposition
&
dec
,
size_t
v
)
{
dec
.
setSubSubDomainComputationCost
(
v
,
dec
.
getSubSubDomainComputationCost
(
v
)
*
dec
.
getSubSubDomainComputationCost
(
v
));
}
};
#endif
/* SRC_DLB_LB_MODEL_HPP_ */
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