Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FaVAD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
NMPP
FaVAD
Commits
d92b68db
Commit
d92b68db
authored
5 years ago
by
Michele Compostella
Browse files
Options
Downloads
Patches
Plain Diff
Fixed FaVAD for the new output names in kdtree
parent
9d31eab1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sample/FaVAD.py
+8
-8
8 additions, 8 deletions
sample/FaVAD.py
with
8 additions
and
8 deletions
sample/FaVAD.py
+
8
−
8
View file @
d92b68db
...
@@ -318,7 +318,7 @@ subprocess.call(cmd,shell=True)
...
@@ -318,7 +318,7 @@ subprocess.call(cmd,shell=True)
cmd
=
'
(echo
"
\'
'
+
str
(
param
[
'
KDTREE_PAR
'
])
+
'
\'
"
) |
'
+
str
(
param
[
'
KDTREE_PATH
'
])
cmd
=
'
(echo
"
\'
'
+
str
(
param
[
'
KDTREE_PAR
'
])
+
'
\'
"
) |
'
+
str
(
param
[
'
KDTREE_PATH
'
])
subprocess
.
call
(
cmd
,
shell
=
True
)
subprocess
.
call
(
cmd
,
shell
=
True
)
# Running kdtree to produce fort.60 output file
# Running kdtree to produce fort.60
/sample_points_in_voids.dat
output file
cmd
=
'
sed -ri
"
1s|^(.{0})(.{4})|
'
+
str
(
param
[
'
KDTREE_THR
'
])
+
'
|
"
'
+
str
(
param
[
'
KDTREE_PAR
'
])
cmd
=
'
sed -ri
"
1s|^(.{0})(.{4})|
'
+
str
(
param
[
'
KDTREE_THR
'
])
+
'
|
"
'
+
str
(
param
[
'
KDTREE_PAR
'
])
subprocess
.
call
(
cmd
,
shell
=
True
)
subprocess
.
call
(
cmd
,
shell
=
True
)
cmd
=
'
sed -ri
"
8s|^(.{0})(.{7})|1 0 0 0|
"
'
+
str
(
param
[
'
KDTREE_PAR
'
])
cmd
=
'
sed -ri
"
8s|^(.{0})(.{7})|1 0 0 0|
"
'
+
str
(
param
[
'
KDTREE_PAR
'
])
...
@@ -327,14 +327,14 @@ cmd = '(echo "\''+str(param['KDTREE_PAR'])+'\'") | '+str(param['KDTREE_PATH'])
...
@@ -327,14 +327,14 @@ cmd = '(echo "\''+str(param['KDTREE_PAR'])+'\'") | '+str(param['KDTREE_PATH'])
subprocess
.
call
(
cmd
,
shell
=
True
)
subprocess
.
call
(
cmd
,
shell
=
True
)
# Moving output files to output directory
# Moving output files to output directory
cmd
=
'
mv ./fort.
52
'
+
str
(
param
[
'
OUTPUT_PATH
'
])
cmd
=
'
mv ./fort.
*
'
+
str
(
param
[
'
OUTPUT_PATH
'
])
subprocess
.
call
(
cmd
,
shell
=
True
)
subprocess
.
call
(
cmd
,
shell
=
True
)
cmd
=
'
mv ./
fort.60
'
+
str
(
param
[
'
OUTPUT_PATH
'
])
cmd
=
'
mv ./
sample_points_in_voids.dat
'
+
str
(
param
[
'
OUTPUT_PATH
'
])
subprocess
.
call
(
cmd
,
shell
=
True
)
subprocess
.
call
(
cmd
,
shell
=
True
)
print
()
print
()
print
(
"
Results are stored in
"
+
str
(
param
[
'
OUTPUT_PATH
'
])
+
"
fort.
52
"
)
print
(
"
Results are stored in
"
+
str
(
param
[
'
OUTPUT_PATH
'
])
+
"
fort.
*
"
)
print
(
"
and
"
+
str
(
param
[
'
OUTPUT_PATH
'
])
+
"
fort.60
"
)
print
(
"
and
"
+
str
(
param
[
'
OUTPUT_PATH
'
])
+
"
sample_points_in_voids.dat
"
)
print
()
print
()
...
@@ -345,7 +345,7 @@ print()
...
@@ -345,7 +345,7 @@ print()
print
(
"
Creating mesh for the NN distance
"
)
print
(
"
Creating mesh for the NN distance
"
)
print
()
print
()
# Conversion of
fort.60
into grid VTK for visualization
# Conversion of
sample_points_in_voids.dat
into grid VTK for visualization
import
tvtk.api
as
ta
import
tvtk.api
as
ta
# Reading kdtree parameters
# Reading kdtree parameters
...
@@ -370,8 +370,8 @@ with open(param['KDTREE_PAR'],'r') as parameter:
...
@@ -370,8 +370,8 @@ with open(param['KDTREE_PAR'],'r') as parameter:
ystepi
=
int
(
p
[
1
])
ystepi
=
int
(
p
[
1
])
zstepi
=
int
(
p
[
2
])
zstepi
=
int
(
p
[
2
])
# Reading
fort.60
file
# Reading
sample_points_in_voids.dat
file
near_d
=
str
(
param
[
'
OUTPUT_PATH
'
])
+
'
/
fort.60
'
near_d
=
str
(
param
[
'
OUTPUT_PATH
'
])
+
'
/
sample_points_in_voids.dat
'
with
open
(
near_d
,
'
r
'
)
as
data
:
with
open
(
near_d
,
'
r
'
)
as
data
:
ind
=
[]
ind
=
[]
x
=
[]
x
=
[]
...
...
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