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
8afdb1f2
Commit
8afdb1f2
authored
4 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
cleans up access to private data
parent
b6201989
No related branches found
No related tags found
No related merge requests found
Pipeline
#94857
passed
4 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cpp/particles/p2p/p2p_ghost_collisions.hpp
+40
-17
40 additions, 17 deletions
cpp/particles/p2p/p2p_ghost_collisions.hpp
with
40 additions
and
17 deletions
cpp/particles/p2p/p2p_ghost_collisions.hpp
+
40
−
17
View file @
8afdb1f2
...
...
@@ -41,16 +41,28 @@ void print_pair_vec(std::vector<partsize_t> vec)
template
<
class
real_number
,
class
partsize_t
>
class
p2p_ghost_collisions
{
pr
ivate
:
pr
otected
:
const
double
pi
=
atan
(
1.0
)
*
4
;
const
double
pi2
=
atan
(
1.0
)
*
8
;
// depending on the particle shape, we will be deciding whether particles intersect in different ways
enum
particle_shape
{
CYLINDER
,
SPHERE
,
DISK
};
private
:
bool
isActive
;
bool
synchronisation
;
// description for cylinders:
double
cylinder_width
;
double
cylinder_length
;
// description for disks:
double
disk_width
;
protected:
enum
particle
_
shape
{
CYLINDER
,
SPHERE
,
DISK
};
// depending on the
particle
shape
, we will be deciding whether particles intersect in different ways
particle_shape
current_particle_shape
;
protected
:
void
add_colliding_pair
(
partsize_t
idx_part1
,
partsize_t
idx_part2
)
{
// store colliding particle ids in order, to be able to identify pairs more easily
...
...
@@ -65,21 +77,15 @@ class p2p_ghost_collisions
this
->
collision_pairs_local
.
push_back
(
idx_part_small
);
this
->
collision_pairs_local
.
push_back
(
idx_part_big
);
}
// description for cylinders:
double
cylinder_width
;
double
cylinder_length
;
bool
isActive
;
bool
synchronisation
;
std
::
vector
<
partsize_t
>
collision_pairs_local
;
std
::
vector
<
partsize_t
>
collision_pairs_global
;
public
:
p2p_ghost_collisions
()
:
current_particle_shape
(
SPHERE
),
cylinder_width
(
1.0
),
cylinder_length
(
1.0
),
disk_width
(
1.0
),
isActive
(
true
),
synchronisation
(
false
)
{}
// Copy constructor use a counter set to zero
p2p_ghost_collisions
(
const
p2p_ghost_collisions
&
src
)
void
copy_from_
p2p_ghost_collisions
(
const
p2p_ghost_collisions
<
real_number
,
partsize_t
>
&
src
)
{
this
->
current_particle_shape
=
src
.
current_particle_shape
;
this
->
cylinder_width
=
src
.
cylinder_width
;
...
...
@@ -90,6 +96,12 @@ public:
this
->
collision_pairs_local
.
reserve
(
src
.
collision_pairs_local
.
capacity
());
}
// Copy constructor use a counter set to zero
p2p_ghost_collisions
(
const
p2p_ghost_collisions
<
real_number
,
partsize_t
>&
src
)
{
this
->
copy_from_p2p_ghost_collisions
(
src
);
}
double
rod_distance
(
double
px
,
double
py
,
double
pz
,
double
qx
,
double
qy
,
double
qz
,
double
t
,
double
s
,
double
x
,
double
y
,
double
z
){
double
x_dist
,
y_dist
,
z_dist
;
double
min_distance
;
...
...
@@ -382,12 +394,12 @@ public:
this
->
cylinder_length
=
LENGTH
;
}
double
get_cylinder_width
()
double
get_cylinder_width
()
const
{
return
this
->
cylinder_width
;
}
double
get_cylinder_length
()
double
get_cylinder_length
()
const
{
return
this
->
cylinder_length
;
}
...
...
@@ -397,12 +409,17 @@ public:
this
->
current_particle_shape
=
DISK
;
}
particle_shape
get_current_particle_shape
()
const
{
return
this
->
current_particle_shape
;
}
void
set_disk_width
(
const
double
WIDTH
)
{
this
->
disk_width
=
WIDTH
;
}
double
get_disk_width
()
double
get_disk_width
()
const
{
return
this
->
disk_width
;
}
...
...
@@ -411,9 +428,15 @@ public:
return
isActive
;
}
void
setEnable
(
const
bool
inIsActive
)
{
void
setEnable
(
const
bool
inIsActive
)
{
isActive
=
inIsActive
;
}
bool
isSynchronized
()
const
{
return
this
->
synchronisation
;
}
};
...
...
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