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
94fe8ec9
Commit
94fe8ec9
authored
4 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
adds specific initialization for deformation tensor
parent
cce37d39
No related branches found
No related tags found
No related merge requests found
Pipeline
#88037
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/particles_input_random.hpp
+35
-8
35 additions, 8 deletions
cpp/particles/particles_input_random.hpp
with
35 additions
and
8 deletions
cpp/particles/particles_input_random.hpp
+
35
−
8
View file @
94fe8ec9
...
@@ -110,6 +110,32 @@ class particles_input_random: public abstract_particles_input<partsize_t, partic
...
@@ -110,6 +110,32 @@ class particles_input_random: public abstract_particles_input<partsize_t, partic
// generate random particle states
// generate random particle states
{
{
TIMEZONE
(
"particles_input_random::generate random numbers"
);
TIMEZONE
(
"particles_input_random::generate random numbers"
);
if
(
state_size
==
15
)
// deformation tensor
{
for
(
partsize_t
idx
=
0
;
idx
<
partsize_t
(
load_splitter
.
getMySize
());
idx
++
)
{
// positions are uniformly distributed within cube
for
(
int
cc
=
0
;
cc
<
3
;
cc
++
)
split_particle_state
[
idx
*
state_size
+
cc
]
=
udist
(
rgen
);
// Q matrix is initially identity
split_particle_state
[
idx
*
state_size
+
3
]
=
particle_rnumber
(
1.0
);
split_particle_state
[
idx
*
state_size
+
4
]
=
particle_rnumber
(
0.0
);
split_particle_state
[
idx
*
state_size
+
5
]
=
particle_rnumber
(
0.0
);
split_particle_state
[
idx
*
state_size
+
6
]
=
particle_rnumber
(
0.0
);
split_particle_state
[
idx
*
state_size
+
7
]
=
particle_rnumber
(
1.0
);
split_particle_state
[
idx
*
state_size
+
8
]
=
particle_rnumber
(
0.0
);
split_particle_state
[
idx
*
state_size
+
9
]
=
particle_rnumber
(
0.0
);
split_particle_state
[
idx
*
state_size
+
10
]
=
particle_rnumber
(
0.0
);
split_particle_state
[
idx
*
state_size
+
11
]
=
particle_rnumber
(
1.0
);
// log-stretching factors are initially 0
split_particle_state
[
idx
*
state_size
+
12
]
=
particle_rnumber
(
0.0
);
split_particle_state
[
idx
*
state_size
+
13
]
=
particle_rnumber
(
0.0
);
split_particle_state
[
idx
*
state_size
+
14
]
=
particle_rnumber
(
0.0
);
}
}
else
{
for
(
partsize_t
idx
=
0
;
idx
<
partsize_t
(
load_splitter
.
getMySize
());
idx
++
)
for
(
partsize_t
idx
=
0
;
idx
<
partsize_t
(
load_splitter
.
getMySize
());
idx
++
)
{
{
// positions are uniformly distributed within cube
// positions are uniformly distributed within cube
...
@@ -121,6 +147,7 @@ class particles_input_random: public abstract_particles_input<partsize_t, partic
...
@@ -121,6 +147,7 @@ class particles_input_random: public abstract_particles_input<partsize_t, partic
split_particle_state
[
idx
*
state_size
+
cc
]
=
gdist
(
rgen
);
split_particle_state
[
idx
*
state_size
+
cc
]
=
gdist
(
rgen
);
}
}
}
}
}
/*************************************************/
/*************************************************/
...
...
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