Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfpm_pdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
argupta
openfpm_pdata
Commits
08427010
Commit
08427010
authored
8 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Adding additional images
parent
dba9da29
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
images/Makefile.am
+1
-0
1 addition, 0 deletions
images/Makefile.am
images/vector.cpp
+3
-0
3 additions, 0 deletions
images/vector.cpp
images/vector_scal_vect.py
+240
-0
240 additions, 0 deletions
images/vector_scal_vect.py
with
244 additions
and
0 deletions
images/Makefile.am
+
1
−
0
View file @
08427010
...
...
@@ -45,5 +45,6 @@ images : cart_dec metis_dec dom_box
pvbatch Vector_dist.py
pvbatch mooving_particles.py
pvbatch mooving_particles_prc.py
pvbatch vector_scal_vect.py
dot
-Tsvg
openfpm.dot
-o
generated/openfpm.svg
This diff is collapsed.
Click to expand it.
images/vector.cpp
+
3
−
0
View file @
08427010
...
...
@@ -49,6 +49,9 @@ int main(int argc, char* argv[])
vd
.
template
getPos
<
s
::
x
>(
key
)[
0
]
=
ud
(
eg
);
vd
.
template
getPos
<
s
::
x
>(
key
)[
1
]
=
ud
(
eg
);
vd
.
template
getProp
<
1
>(
key
)[
0
]
=
sin
(
10.0
*
vd
.
template
getPos
<
s
::
x
>(
key
)[
0
]);
vd
.
template
getProp
<
1
>(
key
)[
1
]
=
sin
(
10.0
*
vd
.
template
getPos
<
s
::
x
>(
key
)[
1
]);
++
it
;
}
...
...
This diff is collapsed.
Click to expand it.
images/vector_scal_vect.py
0 → 100644
+
240
−
0
View file @
08427010
#### import the simple module from the paraview
from
paraview.simple
import
*
#### disable automatic camera reset on 'Show'
paraview
.
simple
.
_DisableFirstRenderCameraReset
()
# create a new 'CSV Reader'
vector_before_map0csv
=
CSVReader
(
FileName
=
[
'
Vector/vector_before_map0.csv
'
])
# get active view
renderView1
=
GetActiveViewOrCreate
(
'
RenderView
'
)
# uncomment following to set a specific view size
renderView1
.
ViewSize
=
[
982
,
495
]
# get layout
viewLayout1
=
GetLayout
()
# set active view
SetActiveView
(
renderView1
)
# create a new 'Table To Points'
tableToPoints1
=
TableToPoints
(
Input
=
vector_before_map0csv
)
# Properties modified on tableToPoints1
tableToPoints1
.
XColumn
=
'
x[0]
'
tableToPoints1
.
YColumn
=
'
x[1]
'
tableToPoints1
.
ZColumn
=
'
column_2_[0][1]
'
tableToPoints1
.
a2DPoints
=
1
# show data in view
tableToPoints1Display
=
Show
(
tableToPoints1
,
renderView1
)
# reset view to fit data
renderView1
.
ResetCamera
()
#changing interaction mode based on data extents
renderView1
.
InteractionMode
=
'
2D
'
renderView1
.
CameraPosition
=
[
0.50000391295
,
0.499549132735
,
10000.0
]
renderView1
.
CameraFocalPoint
=
[
0.50000391295
,
0.499549132735
,
0.0
]
# create a new 'Calculator'
calculator1
=
Calculator
(
Input
=
tableToPoints1
)
# Properties modified on calculator1
calculator1
.
Function
=
'
iHat*column_1_[0]+jHat*column_1_[1]
'
# show data in view
calculator1Display
=
Show
(
calculator1
,
renderView1
)
# hide data in view
Hide
(
tableToPoints1
,
renderView1
)
# set active source
SetActiveSource
(
tableToPoints1
)
# change representation type
tableToPoints1Display
.
SetRepresentationType
(
'
Points
'
)
# set active source
SetActiveSource
(
calculator1
)
# create a new 'Glyph'
glyph1
=
Glyph
(
Input
=
calculator1
,
GlyphType
=
'
Arrow
'
)
# Properties modified on glyph1
glyph1
.
ScaleFactor
=
0.03
glyph1
.
MaximumNumberOfSamplePoints
=
7000
# show data in view
glyph1Display
=
Show
(
glyph1
,
renderView1
)
# show color bar/color legend
glyph1Display
.
SetScalarBarVisibility
(
renderView1
,
True
)
# get color transfer function/color map for 'column0'
column0LUT
=
GetColorTransferFunction
(
'
column0
'
)
# get opacity transfer function/opacity map for 'column0'
column0PWF
=
GetOpacityTransferFunction
(
'
column0
'
)
# Properties modified on glyph1
glyph1
.
Scalars
=
[
'
POINTS
'
,
'
column_1_[0]
'
]
# set scalar coloring
ColorBy
(
glyph1Display
,
(
'
POINTS
'
,
'
column_1_[0]
'
))
# rescale color and/or opacity maps used to include current data range
glyph1Display
.
RescaleTransferFunctionToDataRange
(
True
)
# show color bar/color legend
glyph1Display
.
SetScalarBarVisibility
(
renderView1
,
False
)
# get color transfer function/color map for 'column10'
column10LUT
=
GetColorTransferFunction
(
'
column10
'
)
# get opacity transfer function/opacity map for 'column10'
column10PWF
=
GetOpacityTransferFunction
(
'
column10
'
)
# current camera placement for renderView1
renderView1
.
InteractionMode
=
'
2D
'
renderView1
.
CameraPosition
=
[
0.50000391295
,
0.499549132735
,
9999.999999999998
]
renderView1
.
CameraFocalPoint
=
[
0.50000391295
,
0.499549132735
,
0.0
]
renderView1
.
CameraViewUp
=
[
0.024239745600625473
,
0.9997061741998082
,
0.0
]
renderView1
.
CameraParallelScale
=
0.18611748651565127
# save screenshot
#SaveScreenshot('Vector/vector_vectors.jpg', magnification=1, quality=100, view=renderView1)
WriteImage
(
"
generated/vector_vectors.jpg
"
);
#### disable automatic camera reset on 'Show'
paraview
.
simple
.
_DisableFirstRenderCameraReset
()
# find source
tableToPoints1
=
FindSource
(
'
TableToPoints1
'
)
# set active source
SetActiveSource
(
tableToPoints1
)
# get active view
renderView1
=
GetActiveViewOrCreate
(
'
RenderView
'
)
# uncomment following to set a specific view size
# renderView1.ViewSize = [982, 495]
# show data in view
tableToPoints1Display
=
Show
(
tableToPoints1
,
renderView1
)
# find source
glyph1
=
FindSource
(
'
Glyph1
'
)
# set active source
SetActiveSource
(
glyph1
)
# get color transfer function/color map for 'column10'
column10LUT
=
GetColorTransferFunction
(
'
column10
'
)
# get opacity transfer function/opacity map for 'column10'
column10PWF
=
GetOpacityTransferFunction
(
'
column10
'
)
# find source
calculator1
=
FindSource
(
'
Calculator1
'
)
# set active source
SetActiveSource
(
calculator1
)
# hide data in view
Hide
(
glyph1
,
renderView1
)
# show data in view
calculator1Display
=
Show
(
calculator1
,
renderView1
)
# destroy glyph1
Delete
(
glyph1
)
del
glyph1
# set active source
SetActiveSource
(
tableToPoints1
)
# hide data in view
Hide
(
calculator1
,
renderView1
)
# show data in view
tableToPoints1Display
=
Show
(
tableToPoints1
,
renderView1
)
# destroy calculator1
Delete
(
calculator1
)
del
calculator1
# find source
cSVReader1
=
FindSource
(
'
CSVReader1
'
)
# set active source
SetActiveSource
(
cSVReader1
)
# reset view to fit data
renderView1
.
ResetCamera
()
# set active source
SetActiveSource
(
tableToPoints1
)
# set active source
SetActiveSource
(
cSVReader1
)
# hide data in view
Hide
(
tableToPoints1
,
renderView1
)
# destroy tableToPoints1
Delete
(
tableToPoints1
)
del
tableToPoints1
# create a new 'Table To Points'
tableToPoints1
=
TableToPoints
(
Input
=
cSVReader1
)
# Properties modified on tableToPoints1
tableToPoints1
.
XColumn
=
'
x[0]
'
tableToPoints1
.
YColumn
=
'
x[1]
'
tableToPoints1
.
a2DPoints
=
1
# show data in view
tableToPoints1Display
=
Show
(
tableToPoints1
,
renderView1
)
# reset view to fit data
renderView1
.
ResetCamera
()
#changing interaction mode based on data extents
renderView1
.
CameraPosition
=
[
0.50000391295
,
0.499549132735
,
10000.0
]
renderView1
.
CameraViewUp
=
[
0.0
,
1.0
,
0.0
]
# set scalar coloring
ColorBy
(
tableToPoints1Display
,
(
'
POINTS
'
,
'
column_1_[0]
'
))
# rescale color and/or opacity maps used to include current data range
tableToPoints1Display
.
RescaleTransferFunctionToDataRange
(
True
)
# show color bar/color legend
tableToPoints1Display
.
SetScalarBarVisibility
(
renderView1
,
True
)
# change representation type
tableToPoints1Display
.
SetRepresentationType
(
'
Points
'
)
# Properties modified on tableToPoints1Display
tableToPoints1Display
.
PointSize
=
5.0
#### saving camera placements for all active views
# current camera placement for renderView1
renderView1
.
InteractionMode
=
'
2D
'
renderView1
.
CameraPosition
=
[
0.50000391295
,
0.499549132735
,
10000.0
]
renderView1
.
CameraFocalPoint
=
[
0.50000391295
,
0.499549132735
,
0.0
]
renderView1
.
CameraParallelScale
=
0.15381610455838945
# hide color bar/color legend
tableToPoints1Display
.
SetScalarBarVisibility
(
renderView1
,
False
)
# save screenshot
#SaveScreenshot('Vector/vector_vectors.jpg', magnification=1, quality=100, view=renderView1)
WriteImage
(
"
generated/vector_scalar.jpg
"
);
#### uncomment the following to render all views
# RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).
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