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
6b1f3487
There was a problem fetching the pipeline summary.
Commit
6b1f3487
authored
7 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
add some more debug messages
parent
548d9941
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!23
WIP: Feature/use cmake
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bfps/cpp/full_code/test_interpolation.cpp
+20
-0
20 additions, 0 deletions
bfps/cpp/full_code/test_interpolation.cpp
bfps/test/test_interpolation.py
+6
-1
6 additions, 1 deletion
bfps/test/test_interpolation.py
with
26 additions
and
1 deletion
bfps/cpp/full_code/test_interpolation.cpp
+
20
−
0
View file @
6b1f3487
...
@@ -116,6 +116,23 @@ int test_interpolation<rnumber>::do_work()
...
@@ -116,6 +116,23 @@ int test_interpolation<rnumber>::do_work()
this
->
velocity
->
ift
();
this
->
velocity
->
ift
();
this
->
nabla_u
->
ift
();
this
->
nabla_u
->
ift
();
*
this
->
vorticity
=
1.0
;
*
this
->
velocity
=
2.0
;
*
this
->
nabla_u
=
3.0
;
DEBUG_MSG
(
"changed values
\n
"
);
DEBUG_MSG
(
"some velocity values: %g %g %g
\n
"
,
this
->
velocity
->
rval
(
20
,
1
),
this
->
velocity
->
rval
(
200
,
2
),
this
->
velocity
->
rval
(
741
,
0
));
DEBUG_MSG
(
"some vorticity values: %g %g %g
\n
"
,
this
->
vorticity
->
rval
(
20
,
1
),
this
->
vorticity
->
rval
(
200
,
2
),
this
->
vorticity
->
rval
(
741
,
0
));
DEBUG_MSG
(
"some velocity gradient values: %g %g %g
\n
"
,
this
->
nabla_u
->
rval
(
20
,
1
,
0
),
this
->
nabla_u
->
rval
(
200
,
2
,
1
),
this
->
nabla_u
->
rval
(
741
,
0
,
1
));
// allocate interpolation arrays
// allocate interpolation arrays
std
::
unique_ptr
<
double
[]
>
p3data
(
new
double
[
3
*
this
->
ps
->
getLocalNbParticles
()]);
std
::
unique_ptr
<
double
[]
>
p3data
(
new
double
[
3
*
this
->
ps
->
getLocalNbParticles
()]);
std
::
unique_ptr
<
double
[]
>
p9data
(
new
double
[
9
*
this
->
ps
->
getLocalNbParticles
()]);
std
::
unique_ptr
<
double
[]
>
p9data
(
new
double
[
9
*
this
->
ps
->
getLocalNbParticles
()]);
...
@@ -135,6 +152,7 @@ int test_interpolation<rnumber>::do_work()
...
@@ -135,6 +152,7 @@ int test_interpolation<rnumber>::do_work()
/// sample velocity at particles' position
/// sample velocity at particles' position
this
->
ps
->
sample_compute_field
(
*
this
->
velocity
,
p3data
.
get
());
this
->
ps
->
sample_compute_field
(
*
this
->
velocity
,
p3data
.
get
());
DEBUG_MSG
(
"first vel value is %g
\n
"
,
p3data
.
get
()[
0
]);
this
->
particles_sample_writer_mpi
->
template
save_dataset
<
3
>(
this
->
particles_sample_writer_mpi
->
template
save_dataset
<
3
>(
"tracers0"
,
"tracers0"
,
"velocity"
,
"velocity"
,
...
@@ -145,6 +163,7 @@ int test_interpolation<rnumber>::do_work()
...
@@ -145,6 +163,7 @@ int test_interpolation<rnumber>::do_work()
this
->
ps
->
get_step_idx
()
-
1
);
this
->
ps
->
get_step_idx
()
-
1
);
/// sample vorticity at particles' position
/// sample vorticity at particles' position
this
->
ps
->
sample_compute_field
(
*
this
->
vorticity
,
p3data
.
get
());
this
->
ps
->
sample_compute_field
(
*
this
->
vorticity
,
p3data
.
get
());
DEBUG_MSG
(
"first vort value is %g
\n
"
,
p3data
.
get
()[
0
]);
this
->
particles_sample_writer_mpi
->
template
save_dataset
<
3
>(
this
->
particles_sample_writer_mpi
->
template
save_dataset
<
3
>(
"tracers0"
,
"tracers0"
,
"vorticity"
,
"vorticity"
,
...
@@ -155,6 +174,7 @@ int test_interpolation<rnumber>::do_work()
...
@@ -155,6 +174,7 @@ int test_interpolation<rnumber>::do_work()
this
->
ps
->
get_step_idx
()
-
1
);
this
->
ps
->
get_step_idx
()
-
1
);
/// sample velocity gradient at particles' position
/// sample velocity gradient at particles' position
this
->
ps
->
sample_compute_field
(
*
this
->
nabla_u
,
p9data
.
get
());
this
->
ps
->
sample_compute_field
(
*
this
->
nabla_u
,
p9data
.
get
());
DEBUG_MSG
(
"first vel gradient value is %g
\n
"
,
p9data
.
get
()[
0
]);
this
->
particles_sample_writer_mpi
->
template
save_dataset
<
9
>(
this
->
particles_sample_writer_mpi
->
template
save_dataset
<
9
>(
"tracers0"
,
"tracers0"
,
"velocity_gradient"
,
"velocity_gradient"
,
...
...
This diff is collapsed.
Click to expand it.
bfps/test/test_interpolation.py
+
6
−
1
View file @
6b1f3487
...
@@ -16,7 +16,7 @@ except ImportError:
...
@@ -16,7 +16,7 @@ except ImportError:
def
main
():
def
main
():
nparticles
=
10
nparticles
=
10
0
c
=
TEST
()
c
=
TEST
()
c
.
launch
(
c
.
launch
(
[
'
test_interpolation
'
,
[
'
test_interpolation
'
,
...
@@ -32,8 +32,13 @@ def main():
...
@@ -32,8 +32,13 @@ def main():
ofile
=
h5py
.
File
(
ofile
=
h5py
.
File
(
'
test_output.h5
'
,
'
test_output.h5
'
,
'
r
'
)
'
r
'
)
pos0
=
ifile
[
'
tracers0/state/0
'
].
value
pos1
=
ofile
[
'
tracers0/position/0
'
].
value
print
(
'
maximum position error is
'
,
np
.
max
(
np
.
abs
(
pos0
-
pos1
)
/
np
.
abs
(
pos0
)))
vort0
=
ofile
[
'
tracers0/vorticity/0
'
].
value
vort0
=
ofile
[
'
tracers0/vorticity/0
'
].
value
print
(
vort0
)
vel_gradient
=
ofile
[
'
tracers0/velocity_gradient/0
'
].
value
vel_gradient
=
ofile
[
'
tracers0/velocity_gradient/0
'
].
value
print
(
vel_gradient
)
vort1
=
vort0
.
copy
()
vort1
=
vort0
.
copy
()
vort1
[:,
0
]
=
vel_gradient
[:,
7
]
-
vel_gradient
[:,
5
]
vort1
[:,
0
]
=
vel_gradient
[:,
7
]
-
vel_gradient
[:,
5
]
vort1
[:,
1
]
=
vel_gradient
[:,
2
]
-
vel_gradient
[:,
6
]
vort1
[:,
1
]
=
vel_gradient
[:,
2
]
-
vel_gradient
[:,
6
]
...
...
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