Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Add some missing members (backport #5903) #5952

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion src/abaqus/Odb/FieldOutput.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from __future__ import annotations

from typing import Sequence, Union, overload
from typing import List, Sequence, Union, overload

from typing_extensions import Literal

from abqpy.decorators import abaqus_class_doc, abaqus_method_doc

from ..UtilityAndView.abaqusConstants import OFF, Boolean, SymbolicConstant
from ..UtilityAndView.abaqusConstants import abaqusConstants as C
from .FieldBulkData import FieldBulkData
from .FieldLocation import FieldLocation
from .FieldLocationArray import FieldLocationArray
from .FieldValueArray import FieldValueArray
Expand Down Expand Up @@ -79,6 +80,9 @@ class FieldOutput:
#: parameter applies only to tensor field outputs. The default value is OFF.
isEngineeringTensor: Boolean = OFF

#: A sequence of FieldBulkData objects.
bulkDataBlocks: List[FieldBulkData]

@overload
@abaqus_method_doc
def __init__(
Expand Down
83 changes: 83 additions & 0 deletions src/abaqus/Session/SessionBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,89 @@ class SessionBase:
#: A repository of Drawing objects.
drawings: dict[str, Drawing] = {}

@abaqus_method_doc
def View(
self,
name: str,
nearPlane: float,
farPlane: float,
width: float,
height: float,
projection: Literal[C.PERSPECTIVE, C.PARALLEL],
cameraPosition: tuple[float, float, float],
cameraUpVector: tuple[float, float, float],
cameraTarget: tuple[float, float, float],
viewOffsetX: float,
viewOffsetY: float,
autoFit: Boolean,
movieMode: Boolean = OFF,
):
"""This method creates a View object. Note:All dimensions and coordinates are specified in the model
coordinate system. Note:This method cannot be used to create a View for a Layer object.

.. note::
This function can be accessed by::

session.View

Parameters
----------
name
A String specifying the name of the view (also used as the repository key). Possible
values are 'Front', 'Back', 'Top', 'Bottom', 'Left', 'Right', 'Iso', 'User-1', 'User-2',
'User-3', and 'User-4'. The object member associated with this argument is a
SymbolicConstant. Possible values of the **name** member are:FRONT, BACK, TOP, BOTTOM,
LEFT, RIGHT, ISO, USER1, USER2, USER3, and USER4.
nearPlane
A Float specifying the distance from the camera to the near clipping plane. Possible
values are **nearPlane** > 0.0.
farPlane
A Float specifying the distance from the camera to the far clipping plane when
**farPlaneMode** =SPECIFY. Possible values are **farPlane** > **nearPlane**.
width
A Float specifying the width of the front clipping plane. Possible values are **width** >
0.0.
height
A Float specifying the height of the front clipping plane. Possible values are **height**
> 0.0.
projection
A SymbolicConstant specifying the projection mode. Possible values are PERSPECTIVE and
PARALLEL.
cameraPosition
A sequence of three Floats specifying the camera position.
cameraUpVector
A sequence of three Floats specifying the camera's up vector (the screen's positive
**Y** axis). The initial value is (0, 0, 0).
cameraTarget
A sequence of three Floats specifying the center of the scene.
viewOffsetX
A Float specifying the amount to pan the model in the screen **X** direction as a fraction
of the viewport width. A positive value pans the model to the right. A negative value
pans the model to the left. The *viewOffsetX* and **viewOffsetY** arguments allow you to pan
the view without changing the position of the camera or the target (*cameraPosition* and
**cameraTarget** arguments to the View method). The resulting change in the view allows
you to pan a perspective display without producing an apparent rotation of the model.
viewOffsetY
A Float specifying the amount to pan the model in the screen **Y** direction as a fraction
of the viewport height. A positive value pans the model upward. A negative value pans
the model downward.
autoFit
A Boolean specifying whether the view is auto-fit when applied.
movieMode
A Boolean specifying whether or not the camera is in movie mode. The default value is
OFF.

Returns
-------
View
A View object.

Raises
------
RangeError
"""
...

@abaqus_method_doc
def setValues(self, kernelMemoryLimit: float | None = None):
"""This method modifies the Session object.
Expand Down
1 change: 1 addition & 0 deletions src/abaqus/UtilityAndView/SymbolicConstant.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,7 @@ def __repr__(self) -> str:
HARMONIC = "HARMONIC"
HEADING = "HEADING"
HEALER_TYPE = "HEALER_TYPE"
HEALER_PHASE = "HEALER_PHASE"
HEATCAP = "HEATCAP"
HEAT_FLUX = "HEAT_FLUX"
HEAT_FLUX_AREA = "HEAT_FLUX_AREA"
Expand Down
1 change: 1 addition & 0 deletions src/abaqus/UtilityAndView/abaqusConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,7 @@
HARMONIC = abaqusConstants.HARMONIC
HEADING = abaqusConstants.HEADING
HEALER_TYPE = abaqusConstants.HEALER_TYPE
HEALER_PHASE = abaqusConstants.HEALER_PHASE
HEATCAP = abaqusConstants.HEATCAP
HEAT_FLUX = abaqusConstants.HEAT_FLUX
HEAT_FLUX_AREA = abaqusConstants.HEAT_FLUX_AREA
Expand Down
3 changes: 2 additions & 1 deletion src/abaqus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import auto_all

from abqpy import run # noqa
from abqpy import run, version_info # noqa

run(cae=True)
auto_all.start_all()
Expand All @@ -24,6 +24,7 @@

session = Session()
mdb = Mdb()
version = version_info[0]

backwardCompatibility = BackwardCompatibility()

Expand Down
2 changes: 2 additions & 0 deletions src/abqpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ def _get_version():

__version__ = _get_version()
__semver__ = __version__.split("+")[0]
version_info = __semver__.split(".")

__all__ = [
"run",
"abaqus",
"AbqpyCLI",
"version_info",
"__version__",
"__semver__",
]
43 changes: 43 additions & 0 deletions src/jobMessage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import auto_all

auto_all.start_all()

from abaqus.UtilityAndView.abaqusConstants import ( # noqa
ABORTED,
ANY_JOB,
ANY_MESSAGE_TYPE,
BATCHPRE_PHASE,
CALCULATOR_PHASE,
CFD_PHASE,
CHECK_SUBMITTED,
COMPLETED,
END_STEP,
ERROR,
EXPLICIT_PHASE,
HEADING,
HEALER_JOB,
HEALER_PHASE,
HEALER_TYPE,
INTERRUPTED,
ITERATION,
JOB_ABORTED,
JOB_COMPLETED,
JOB_INTERRUPTED,
JOB_SUBMITTED,
MONITOR_DATA,
ODB_FILE,
ODB_FRAME,
PACKAGER_PHASE,
SIMULATION_ABORTED,
SIMULATION_COMPLETED,
SIMULATION_INTERRUPTED,
SIMULATION_STARTED,
STANDARD_PHASE,
STARTED,
STATUS,
STEP,
U1,
WARNING,
)

auto_all.end_all()
Loading