Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/ansys/dpf/core/property_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,29 @@ def location(self):
Returns
-------
location : str
Location string, can be found in :class:`ansys.dpf.core.locations`: ie.
Location string, can be found in :class:`ansys.dpf.core.locations`: i.e.
``dpf.locations.nodal`` or ``dpf.locations.elemental``.

Examples
--------
Create a property field and request the location.

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core.check_version import meets_version
>>> pfield = dpf.PropertyField()
>>> pfield.location = dpf.locations.nodal
>>> if meets_version(dpf.SERVER.version, "11.0"):
... pfield.location = dpf.locations.elemental
... else:
... pfield.scoping = dpf.Scoping()
... pfield.scoping.location = dpf.locations.elemental
>>> pfield.location
'Nodal'
'Elemental'

"""
if meets_version(self._server.version, "11.0"):
if self._field_definition:
return self._field_definition.location
elif self.scoping:
elif self.scoping is not None:
return self.scoping.location
else:
return None
Expand Down
Loading