Module containing the DpfPath
class.
- ansys.dpf.post.dpf_path.create_path_on_coordinates(coordinates)#
Create a DPF path object.
You can use this path object to request results on a specific path of coordinates.
- Parameters:
coordinates (list[list[int]], field, numpy.ndarray) – 3D coordinates.
Examples
>>> from ansys.dpf import post >>> from ansys.dpf.post import examples >>> coordinates = [[0.024, 0.03, 0.003]] >>> for i in range(1, 51): ... coord_copy = coordinates[-1].copy() ... coord_copy[1] = coord_copy[0] + i * 0.001 ... coordinates.append(coord_copy) >>> path_on_coord = post.create_path_on_coordinates( ... coordinates=coordinates ... ) >>> solution = post.load_solution(examples.static_rst) >>> stress = solution.stress(path=path_on_coord)
- class ansys.dpf.post.dpf_path.DpfPath(coordinates)#
Describes a set of coordinates.
Example
Create coordinates from a list.
>>> from ansys.dpf import post >>> coordinates = [[0.024, 0.03, 0.003]] >>> for i in range(1, 51): ... coord_copy = coordinates[-1].copy() ... coord_copy[1] = coord_copy[0] + i * 0.001 ... coordinates.append(coord_copy) >>> dpf_path = post.create_path_on_coordinates(coordinates=coordinates)
Create coordinates from a
numpy.ndarray
.>>> import numpy as np >>> coordinates = np.empty((50, 3) ) >>> coordinates[:] = [0.024, 0.03, 0.003] >>> coordinates[:, 1] = np.linspace(0.03, 0.74) >>> dpf_path = post.create_path_on_coordinates(coordinates=coordinates)
- property coordinates#
Coordinates of the path.