Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
TurTLE
TurTLE
Commits
1bab0435
There was a problem fetching the pipeline summary.
Commit
1bab0435
authored
7 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
add preliminary particle orientation sync
parent
99d5fe72
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!23
WIP: Feature/use cmake
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bfps/cpp/particles/p2p_computer.hpp
+48
-1
48 additions, 1 deletion
bfps/cpp/particles/p2p_computer.hpp
with
48 additions
and
1 deletion
bfps/cpp/particles/p2p_computer.hpp
+
48
−
1
View file @
1bab0435
...
@@ -3,6 +3,22 @@
...
@@ -3,6 +3,22 @@
#include
<cstring>
#include
<cstring>
/** \brief A simple distance weighting function.
*
* This function returns 1 if a distance is smaller than a cut-off length,
* i.e. particle 1 interacts with particle 2 if particle 2 is inside a
* sphere of radius `cutoff' centered on particle 1.
*/
double
dumb_distance_weight
(
double
distance
,
double
cutoff
)
{
// this function should only be called for interacting particles,
// and particles interact if they are closer than cutoff.
assert
(
distance
<
cutoff
);
return
1.0
;
}
template
<
class
real_number
,
class
partsize_t
>
template
<
class
real_number
,
class
partsize_t
>
class
p2p_computer
{
class
p2p_computer
{
public:
public:
...
@@ -27,10 +43,41 @@ public:
...
@@ -27,10 +43,41 @@ public:
const
real_number
pos_part2
[],
const
real_number
data_part2
[],
real_number
rhs_part2
[],
const
real_number
pos_part2
[],
const
real_number
data_part2
[],
real_number
rhs_part2
[],
const
real_number
dist_pow2
,
const
real_number
dist_pow2
,
const
real_number
xshift_coef
,
const
real_number
yshift_coef
,
const
real_number
zshift_coef
)
const
{
const
real_number
xshift_coef
,
const
real_number
yshift_coef
,
const
real_number
zshift_coef
)
const
{
// TODO put the kernel here
static_assert
(
size_particle_positions
==
3
,
"This kernel works only with 3 values for one position"
);
static_assert
(
size_particle_positions
==
3
,
"This kernel works only with 3 values for one position"
);
// TODO:
// Should I put 0 in the rhs corresponding to the orientations?
// Or should I just add the interaction term?
// In other words: is this method called after the vorticity and strain terms have been computed?
// The following two lines set the rhs to 0:
//std::fill_n(rhs_part1+3, 3, 0);
//std::fill_n(rhs_part2+3, 3, 0);
real_number
distance
=
sqrt
(
dist_pow2
);
double
max_distance
=
1.0
;
double
tau
=
1.0
;
if
(
distance
>=
max_distance
)
return
;
// TODO: a reasonable way of choosing between different distance_weight functions should be thought of.
// We need to ask Michael about how flexible this distance_weight needs to be.
double
ww
=
dumb_distance_weight
(
distance
,
max_distance
);
///
/// term in equation is:
///
/// \f[
/// (4 / \tau) \sum_j W_\ell ( | x^i - x^j | ) (p^i \cdot p^j)p^j
/// \f]
///
double
dot_product
=
(
data_part1
[
0
]
*
data_part2
[
0
]
+
data_part1
[
1
]
*
data_part2
[
1
]
+
data_part1
[
2
]
*
data_part2
[
2
])
rhs_part1
[
3
]
+=
data_part2
[
0
]
*
4
*
ww
*
dot_product
;
rhs_part1
[
4
]
+=
data_part2
[
1
]
*
4
*
ww
*
dot_product
;
rhs_part1
[
5
]
+=
data_part2
[
2
]
*
4
*
ww
*
dot_product
;
rhs_part2
[
3
]
+=
data_part1
[
0
]
*
4
*
ww
*
dot_product
;
rhs_part2
[
4
]
+=
data_part1
[
1
]
*
4
*
ww
*
dot_product
;
rhs_part2
[
5
]
+=
data_part1
[
2
]
*
4
*
ww
*
dot_product
;
}
}
constexpr
static
bool
isEmpty
()
{
constexpr
static
bool
isEmpty
()
{
return
false
;
return
false
;
}
}
...
...
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