You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/concepts.rst
+62-4Lines changed: 62 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,13 +203,71 @@ A number of quantities are implemented in :obj:`simsopt.geo.curveobjectives` and
203
203
204
204
The value of the quantity and its derivative with respect to the curve dofs can be obtained by calling e.g., ``CurveLength.J()`` and ``CurveLength.dJ()``.
205
205
206
+
.. _surfaces:
207
+
206
208
Surfaces
207
209
~~~~~~~~
208
210
209
-
The second large class of geometric objects are surfaces.
210
-
A :obj:`simsopt.geo.surface.Surface` is modelled as a function :math:`\Gamma:[0, 1] \times [0, 1] \to\mathbb{R}^3` and is evaluated at quadrature points :math:`\{\phi_1, \ldots, \phi_{n_\phi}\}\times\{\theta_1, \ldots, \theta_{n_\theta}\}`.
211
-
212
-
The usage is similar to that of the :obj:`~simsopt.geo.curve.Curve` class:
211
+
The second large class of geometric objects are surfaces. A
212
+
:obj:`simsopt.geo.surface.Surface` is modelled as a function
213
+
:math:`\Gamma:[0, 1] \times [0, 1] \to\mathbb{R}^3` and is evaluated
In many cases you can convert a surface from one type to another by going through
231
+
:obj:`~simsopt.geo.surfacerzfourier.SurfaceRZFourier`, as most surface types have
232
+
``to_RZFourier()`` and ``from_RZFourier()`` methods.
233
+
Note that :obj:`~simsopt.geo.surfacerzfourier.SurfaceRZFourier`
234
+
corresponds to the surface parameterization used internally in the VMEC and SPEC codes.
235
+
However when using these codes in simsopt, any of the available surface subclasses
236
+
can be used to represent the surfaces, and simsopt will automatically handle the conversion
237
+
to :obj:`~simsopt.geo.surfacerzfourier.SurfaceRZFourier` when running the code.
238
+
239
+
The points :math:`\phi_j` and :math:`\theta_j` are used for evaluating
240
+
the position vector and its derivatives, for computing integrals, and
241
+
for plotting, and there are several available methods to specify these
242
+
points. For :math:`\theta_j`, you typically specify a keyword
243
+
argument ``ntheta`` to the constructor when instantiating a surface
244
+
class. This results in a grid of ``ntheta`` uniformly spaced points
245
+
between 0 and 1, with no endpoint at 1. Alternatively, you can specify
246
+
a list or array of points to the ``quadpoints_theta`` keyword argument
247
+
when instantiating a surface class, specifying the :math:`\theta_j`
248
+
directly. If both ``ntheta`` and ``quadpoints_theta`` are specified,
249
+
an exception will be raised. For the :math:`\phi` coordinate, you
250
+
sometimes want points up to 1 (the full torus), sometimes up to
251
+
:math:`1/n_{fp}` (one field period), and sometimes up to :math:`1/(2
252
+
n_{fp})` (half a field period). These three cases can be selected by
253
+
setting the ``range`` keyword argument of the surface subclasses to
254
+
``"full torus"``, ``"field period"``, or ``"half period"``.
255
+
Equivalently, you can set ``range`` to the constants
256
+
``S.RANGE_FULL_TORUS``, ``S.RANGE_FIELD_PERIOD``, or
257
+
``S.RANGE_HALF_PERIOD``, where ``S`` can be
258
+
:obj:`simsopt.geo.surface.Surface` or any of its subclasses. For all
259
+
of these cases, the ``nphi`` keyword argument can be set to the
260
+
desired number of :math:`\phi` grid points. Alternatively, you can
261
+
pass a list or array to the ``quadpoints_phi`` keyword argument of the
262
+
constructor for any Surface subclass to specify the :math:`\phi_j`
263
+
points directly. An exception will be raised if both ``nphi`` and
264
+
``quadpoints_phi`` are specified. For more information about these
265
+
arguments, see the
266
+
:obj:`~simsopt.geo.surfacerzfourier.SurfaceRZFourier` API
267
+
documentation.
268
+
269
+
The methods available to each surface class are similar to those of
270
+
the :obj:`~simsopt.geo.curve.Curve` class:
213
271
214
272
- ``Surface.gamma()``: returns a ``(n_phi, n_theta, 3)`` array containing :math:`\Gamma(\phi_i, \theta_j)` for :math:`i\in\{1, \ldots, n_\phi\}, j\in\{1, \ldots, n_\theta\}`, i.e. returns a list of XYZ coordinates on the surface.
215
273
- ``Surface.gammadash1()``: returns a ``(n_phi, n_theta, 3)`` array containing :math:`\partial_\phi\Gamma(\phi_i, \theta_j)` for :math:`i\in\{1, \ldots, n_\phi\}, j\in\{1, \ldots, n_\theta\}`.
0 commit comments