Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Parallel plotting vectorfield: added example
Browse files Browse the repository at this point in the history
  • Loading branch information
man74cio committed Dec 18, 2015
1 parent 9b87ff1 commit db99641
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
23 changes: 21 additions & 2 deletions src/sage/manifolds/differentiable/vectorfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,29 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
g = v.plot(max_range=4, nb_values=5, scale=0.5)
sphinx_plot(g)
Plot using parallel computation::
sage: Parallelism().set('tensor', nproc=2)
sage: Parallelism().get('tensor')
2
sage: v.plot(scale=0.5, nb_values=10, linestyle='--', width=1, arrowsize=6)
Graphics object consisting of 100 graphics primitives
.. PLOT::
M = Manifold(2, 'M')
X = M.chart('x y'); x, y = X[:]
v = M.vector_field(name='v'); v[:] = -y, x
g = v.plot(scale=0.5, nb_values=10, linestyle='--', width=1, arrowsize=6)
sphinx_plot(g)
::
sage: Parallelism().set('tensor', nproc=1) # switch off parallelization
Plots along a line of fixed coordinate::
sage: v.plot(fixed_coords={x: -2})
Graphics object consisting of 9 graphics primitives
Graphics object consisting of 8 graphics primitives
.. PLOT::
Expand Down Expand Up @@ -559,7 +578,7 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
or, for a 2D plot::
sage: v.plot(ambient_coords=(x, y), fixed_coords={t: 1, z: 0})
Graphics object consisting of 80 graphics primitives
Graphics object consisting of 64 graphics primitives
.. PLOT::
Expand Down
1 change: 0 additions & 1 deletion src/sage/tensor/modules/comp.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ class :class:`~sage.tensor.differential_form_element.DifferentialForm`)
from sage.parallel.decorate import parallel
from sage.parallel.parallelism import Parallelism
from operator import itemgetter
import time

class Components(SageObject):
r"""
Expand Down

0 comments on commit db99641

Please sign in to comment.