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_io
Commits
ebe99fd6
Commit
ebe99fd6
authored
Mar 23, 2016
by
Pietro Incardona
Browse files
Fixing color randomizer
parent
b2256f8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/VTKWriter/VTKWriter_vector_box.hpp
View file @
ebe99fd6
...
...
@@ -305,8 +305,7 @@ class VTKWriter<vector,VECTOR_BOX>
std
::
string
get_cell_data_list
()
{
// random engine
std
::
default_random_engine
generator
;
std
::
uniform_real_distribution
<
float
>
d
(
0.0
,
1.0
);
SimpleRNG
rng
;
//! vertex node output string
std
::
string
v_out
;
...
...
@@ -322,7 +321,7 @@ class VTKWriter<vector,VECTOR_BOX>
while
(
it
.
isNext
())
{
// write a color
v_out
+=
getColor
(
col_group
,
d
,
generator
).
toString
()
+
" 1.0"
+
"
\n
"
;
v_out
+=
getColor
(
col_group
,
rng
).
toString
()
+
" 1.0"
+
"
\n
"
;
++
it
;
}
...
...
src/util.hpp
View file @
ebe99fd6
...
...
@@ -7,6 +7,8 @@
#include "config.h"
#include "util/SimpleRNG.hpp"
#ifndef UTIL_HPP_
#define UTIL_HPP_
...
...
@@ -65,11 +67,11 @@ struct RGB
*
*/
static
inline
struct
RGB
getColor
(
int
group
,
std
::
uniform_real_distribution
<
float
>
&
d
,
std
::
default_random_engine
&
g
)
static
inline
struct
RGB
getColor
(
int
group
,
SimpleRNG
&
d
)
{
struct
RGB
col
;
float
s
=
d
(
g
);
float
s
=
(
float
)
d
.
GetUniform
(
);
group
=
group
%
12
;
...
...
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