@@ -356,90 +356,6 @@ be created. Any existing immersed vertex-only mesh will have been created
356
356
using the previous tolerance and will be unaffected by the change.
357
357
358
358
359
- ``Function.at ``
360
- ------------------------------
361
-
362
- .. warning ::
363
-
364
- The following API is deprecated and will be removed in a future release.
365
- Please use the primary API described above.
366
-
367
- The :meth: `~.Function.at ` method is designed for simple interrogation of a :class: `~.Function ` with
368
- a few points.
369
-
370
- .. code-block :: python3
371
-
372
- # evaluate f at a 1-dimensional point
373
- f.at(0.3)
374
-
375
- # evaluate f at two 1-dimensional points, or at one 2-dimensional point
376
- # (depending on f's geometric dimension)
377
- f.at(0.2, 0.4)
378
-
379
- # evaluate f at one 2-dimensional point
380
- f.at([0.2, 0.4])
381
-
382
- # evaluate f at two 2-dimensional points
383
- f.at([0.2, 0.4], [1.2, 0.5])
384
-
385
- # evaluate f at two 2-dimensional points (same as above)
386
- f.at([[0.2, 0.4], [1.2, 0.5]])
387
-
388
- While in these examples we have only shown lists, other *iterables *
389
- such as tuples and ``numpy `` arrays are also accepted. The following
390
- are equivalent:
391
-
392
- .. code-block :: python3
393
-
394
- f.at(0.2, 0.4)
395
- f.at((0.2, 0.4))
396
- f.at([0.2, 0.4])
397
- f.at(numpy.array([0.2, 0.4]))
398
-
399
- For a single point, the result is a ``numpy `` array, or a tuple of
400
- ``numpy `` arrays in case of *mixed * functions. When evaluating
401
- multiple points, the result is a list of values for each point.
402
- To summarise:
403
-
404
- * Single point, non-mixed: ``numpy `` array
405
- * Single point, mixed: tuple of ``numpy `` arrays
406
- * Multiple points, non-mixed: list of ``numpy `` arrays
407
- * Multiple points, mixed: list of tuples of ``numpy `` arrays
408
-
409
-
410
- Points outside the domain
411
- ~~~~~~~~~~~~~~~~~~~~~~~~~
412
-
413
- When any point is outside the domain of the function,
414
- :py:class: `.PointNotInDomainError ` exception is raised. If
415
- ``dont_raise=True `` is passed to :meth: `~.Function.at `, the result is
416
- ``None `` for those points which fall outside the domain.
417
-
418
- .. code-block :: python3
419
-
420
- mesh = UnitIntervalMesh(8)
421
- f = mesh.coordinates
422
-
423
- f.at(1.2) # raises exception
424
- f.at(1.2, dont_raise=True) # returns None
425
-
426
- f.at(0.5, 1.2) # raises exception
427
- f.at(0.5, 1.2, dont_raise=True) # returns [0.5, None]
428
-
429
-
430
- Evaluation with a distributed mesh
431
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
432
-
433
- There is limited support for :meth: `~.Function.at ` when running Firedrake
434
- in parallel. There is no special API, but there are some restrictions:
435
-
436
- * Point evaluation is a *collective * operation.
437
- * Each process must ask for the same list of points.
438
- * Each process will get the same values.
439
-
440
- If ``RuntimeError: Point evaluation gave different results across processes. ``
441
- is raised, try lowering the :ref: `mesh tolerance <tolerance >`.
442
-
443
359
UFL API
444
360
-------
445
361
0 commit comments