Skip to content

Commit

Permalink
[feature] Support Abaqus 2025 (#5842)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
haiiliin and pre-commit-ci[bot] authored Dec 7, 2024
1 parent 13f87e7 commit bc7de77
Show file tree
Hide file tree
Showing 17 changed files with 813 additions and 63 deletions.
6 changes: 3 additions & 3 deletions README-zh-cn.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# abqpy 2024
# abqpy 2025

[![tests](https://github.com/haiiliin/abqpy/actions/workflows/tests.yml/badge.svg)](https://github.com/haiiliin/abqpy/actions/workflows/tests.yml)
[![rtd](https://readthedocs.org/projects/abqpy/badge/?version=latest)](https://readthedocs.org/projects/abqpy/)
[![coveralls](https://coveralls.io/repos/github/haiiliin/abqpy/badge.svg?branch=2024)](https://coveralls.io/github/haiiliin/abqpy?branch=2024)
[![coveralls](https://coveralls.io/repos/github/haiiliin/abqpy/badge.svg?branch=2025)](https://coveralls.io/github/haiiliin/abqpy?branch=2025)
[![python](https://img.shields.io/badge/Python-3.8%2B-brightgreen)](https://www.python.org/downloads/)
[![abaqus](https://img.shields.io/badge/Abaqus-2016%2B-brightgreen)](https://www.3ds.com/products-services/simulia/products/abaqus/)
[![Crowdin](https://badges.crowdin.net/abqpy-locale/localized.svg)](https://crowdin.com/project/abqpy-locale)
Expand All @@ -26,7 +26,7 @@ Abaqus/Python 脚本的类型提示
已经安装成功,然后打开 `cmd` 或者 `terminal`,输入:

```
pip install -U abqpy==2024.* # 将主版本号替换为你的 Abaqus 版本号
pip install -U abqpy==2025.* # 将主版本号替换为你的 Abaqus 版本号
```

然后,在你喜欢的开发环境中使用 Python 3.8+ 运行你的 Abaqus/Python 脚本,看看奇迹如何发生。
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# abqpy 2024
# abqpy 2025

[![tests](https://github.com/haiiliin/abqpy/actions/workflows/tests.yml/badge.svg)](https://github.com/haiiliin/abqpy/actions/workflows/tests.yml)
[![rtd](https://readthedocs.org/projects/abqpy/badge/?version=latest)](https://readthedocs.org/projects/abqpy/)
[![coveralls](https://coveralls.io/repos/github/haiiliin/abqpy/badge.svg?branch=2024)](https://coveralls.io/github/haiiliin/abqpy?branch=2024)
[![coveralls](https://coveralls.io/repos/github/haiiliin/abqpy/badge.svg?branch=2025)](https://coveralls.io/github/haiiliin/abqpy?branch=2025)
[![python](https://img.shields.io/badge/Python-3.8%2B-brightgreen)](https://www.python.org/downloads/)
[![abaqus](https://img.shields.io/badge/Abaqus-2016%2B-brightgreen)](https://www.3ds.com/products-services/simulia/products/abaqus/)
[![Crowdin](https://badges.crowdin.net/abqpy-locale/localized.svg)](https://crowdin.com/project/abqpy-locale)
Expand All @@ -29,7 +29,7 @@ are installed on your computer,
open `cmd` or `terminal`, type:

```
pip install -U abqpy==2024.* # change the major version to match your Abaqus version
pip install -U abqpy==2025.* # change the major version to match your Abaqus version
```

Then, open your Abaqus/Python script in your favorite IDE with Python language support,
Expand Down
12 changes: 6 additions & 6 deletions docs/source/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ You can install `abqpy` with the following commands.

````{tab} pip
```{code-block} shell
pip install -U abqpy==2024.*
pip install -U abqpy==2025.*
```
````

````{tab} pip (wrapper)
```{code-block} shell
pip install -U abqpy2024
pip install -U abqpy2025
```
````

````{tab} Source
```{code-block} shell
pip install git+https://github.com/haiiliin/abqpy@2024
pip install git+https://github.com/haiiliin/abqpy@2025
```
````

````{tab} Jupyter
```{code-block} shell
pip install -U abqpy[jupyter]==2024.*
pip install -U abqpy2024[jupyter]
pip install -U abqpy[jupyter]==2025.*
pip install -U abqpy2025[jupyter]
pip install ipynbname nbconvert
```
````
Expand Down Expand Up @@ -147,7 +147,7 @@ Now you can run your Abaqus/Python script with the following methods:
```sh
abaqus cae script=script.py
```
See [here](https://help.3ds.com/2024/English/DSSIMULIA_Established/SIMACAEEXCRefMap/simaexc-c-caeproc.htm?contextscope=all)
See [here](https://help.3ds.com/2025/English/DSSIMULIA_Established/SIMACAEEXCRefMap/simaexc-c-caeproc.htm?contextscope=all)
for more information about the `abaqus` command.
- Use the `abqpy` command in the command line:
```sh
Expand Down
128 changes: 128 additions & 0 deletions src/abaqus/Interaction/FluidExchangeActivation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
from __future__ import annotations

from typing_extensions import List

from abqpy.decorators import abaqus_class_doc, abaqus_method_doc

from ..UtilityAndView.abaqusConstants import OFF, Boolean
from .FluidExchange import FluidExchange
from .Interaction import Interaction


@abaqus_class_doc
class FluidExchangeActivation(Interaction):
"""The FluidExchnageActivation object is used to define the activation of fluid exchanges within the fluid cavity.
The FluidExchangeActivation object is derived from the Interaction object.
.. note::
This object can be accessed by::
import interaction
mdb.models[name].interactions[name]
The corresponding analysis keywords are:
- FLUID EXCHANGE ACTIVATION
.. versionadded:: 2025
The ``FluidExchangeActivation`` class was added.
"""

#: A String specifying the repository key.
name: str

#: A String specifying the name of the step in which the FluidExchange object is created.
createStepName: str

#: A List specifying fluid exchanges to be activated.
exchanges: List[FluidExchange]

#: A String specifying the name of the amplitude curve defining a mapping between the inflation time and the actual
#: time.
amplitude: str

#: A Boolean specifying the vent and leakage area obstruction by contacted surfaces.
isBlockage: Boolean

#: A Boolean specifying if the flow of fluid is only from the first fluid cavity to the second fluid cavity defined
#: in the FluidExchange object.
isOnlyOutflow: Boolean

#: A Float specifying the ratio of the actual surface area over the initial surface area at which you want the fluid
#: to leak.
deltaLeakageArea: float

@abaqus_method_doc
def __init__(
self,
name: str,
createStepName: str,
exchanges: List[FluidExchange],
amplitude: str,
isBlockage: Boolean = OFF,
isOnlyOutflow: Boolean = OFF,
deltaLeakageArea: float = 0.0,
):
"""This method creates an FluidExchangeActivation object.
.. note::
This function can be accessed by::
mdb.models[name].FluidExchangeActivation
Parameters
----------
name
A String specifying the repository key.
createStepName
A String specifying the name of the step in which the FluidExchangeActivation object is created.
exchanges
A List specifying fluid exchanges to be activated.
amplitude
A String specifying the name of the amplitude curve defining a mapping between the inflation time and the actual
time.
isBlockage
A Boolean specifying the vent and leakage area obstruction by contacted surfaces.
isOnlyOutflow
A Boolean specifying if the flow of fluid is only from the first fluid cavity to the second fluid cavity defined
in the FluidExchange object.
deltaLeakageArea
A Float specifying the ratio of the actual surface area over the initial surface area at which you want the fluid
to leak.
Returns
-------
FluidExchangeActivation
A FluidExchangeActivation object.
"""
super().__init__()

@abaqus_method_doc
def setValues(
self,
exchanges: List[FluidExchange],
amplitude: str,
isBlockage: Boolean = OFF,
isOnlyOutflow: Boolean = OFF,
deltaLeakageArea: float = 0.0,
):
"""This method modifies the FluidExchangeActivation object.
Parameters
----------
Parameters
----------
exchanges
A List specifying fluid exchanges to be activated.
amplitude
A String specifying the name of the amplitude curve defining a mapping between the inflation time and the actual time.
isBlockage
A Boolean specifying the vent and leakage area obstruction by contacted surfaces.
isOnlyOutflow
A Boolean specifying if the flow of fluid is only from the first fluid cavity to the second fluid cavity defined in the FluidExchange object.
deltaLeakageArea
A Float specifying the ratio of the actual surface area over the initial surface area at which you want the fluid to leak.
"""
...
83 changes: 83 additions & 0 deletions src/abaqus/Interaction/FluidExchangeActivationState.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from __future__ import annotations

from typing_extensions import Literal

from abqpy.decorators import abaqus_class_doc

from ..UtilityAndView.abaqusConstants import Boolean
from ..UtilityAndView.abaqusConstants import abaqusConstants as C
from .InteractionState import InteractionState


@abaqus_class_doc
class FluidExchangeActivationState(InteractionState):
"""The FluidExchangeActivationState object stores the propagating data for a FluidExchangeActivation object. One
instance of this object is created internally by the FluidExchangeActivation object for each step. The instance
is also deleted internally by the FluidExchangeActivation object.
The FluidExchangeActivationState object has no constructor or methods.
The FluidExchangeActivationState object is derived from the InteractionState object.
.. note::
This object can be accessed by::
import interaction
mdb.models[name].steps[name].interactionStates[name]
.. versionadded:: 2025
The ``FluidExchangeActivationState`` class was added.
"""

#: A SymbolicConstant specifying the propagation state of the exchanges member. Possible values are UNSET, SET, UNCHANGED, and FREED.
exchangesState: Literal[C.UNSET, C.SET, C.UNCHANGED, C.FREED]

#: A String specifying the name of the FluidExchange object associated with this interaction.
exchanges: str

#: A SymbolicConstant specifying the propagation state of the amplitude member. Possible values are UNSET, SET, UNCHANGED, and FREED.
amplitudeState: Literal[C.UNSET, C.SET, C.UNCHANGED, C.FREED]

#: A String specifying the name of the Amplitude object associated with this interaction.
amplitude: str

#: A SymbolicConstant specifying the propagation state of the isBlockage member. Possible values are UNSET, SET, UNCHANGED, and FREED.
isBlockageState: Literal[C.UNSET, C.SET, C.UNCHANGED, C.FREED]

#: A Boolean specifying whether to consider vent and leakage area obstruction by contacted surfaces.
isBlockage: Boolean

#: A SymbolicConstant specifying the propagation state of the isOnlyOutflow member. Possible values are UNSET, SET, UNCHANGED, and FREED.
isOnlyOutflowState: Literal[C.UNSET, C.SET, C.UNCHANGED, C.FREED]

#: A Boolean specifying whether the flow of fluid is allowed only from the first fluid cavity to the second fluid cavity defined in the FluidExchange object.
isOnlyOutflow: Boolean

#: A SymbolicConstant specifying the propagation state of the deltaLeakageArea member. Possible values are UNSET, SET, UNCHANGED, and FREED.
deltaLeakageAreaState: Literal[C.UNSET, C.SET, C.UNCHANGED, C.FREED]

#: A Float specifying the ratio of the actual surface area over the initial surface area at which you want the fluid to leak.
deltaLeakageArea: float

#: A SymbolicConstant specifying the propagation state of the InteractionState object. Possible values are:
#:
#: - NOT_YET_ACTIVE
#: - CREATED
#: - PROPAGATED
#: - MODIFIED
#: - DEACTIVATED
#: - NO_LONGER_ACTIVE
#: - TYPE_NOT_APPLICABLE
#: - INSTANCE_NOT_APPLICABLE
#: - BUILT_INTO_BASE_STATE
status: Literal[
C.NOT_YET_ACTIVE,
C.CREATED,
C.PROPAGATED,
C.MODIFIED,
C.DEACTIVATED,
C.NO_LONGER_ACTIVE,
C.TYPE_NOT_APPLICABLE,
C.INSTANCE_NOT_APPLICABLE,
C.BUILT_INTO_BASE_STATE,
]
22 changes: 2 additions & 20 deletions src/abaqus/Interaction/FluidInflator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def __init__(
createStepName: str,
cavity: str,
interactionProperty: str,
inflationTimeAmplitude: str = "",
massFlowAmplitude: str = "",
):
"""This method creates a FluidInflator object.
Expand All @@ -51,12 +49,6 @@ def __init__(
A String specifying the first FluidCavity object associated with this interaction.
interactionProperty
A String specifying the FluidInflatorProperty object associated with this interaction.
inflationTimeAmplitude
A string specifying the name of the amplitude curve defining a mapping between the
inflation time and the actual time.
massFlowAmplitude
A string specifying the name of the amplitude curve by which to modify the mass flow
rate.
Returns
-------
Expand All @@ -65,16 +57,6 @@ def __init__(
super().__init__()

@abaqus_method_doc
def setValues(self, inflationTimeAmplitude: str = "", massFlowAmplitude: str = ""):
"""This method modifies the FluidInflator object.
Parameters
----------
inflationTimeAmplitude
A string specifying the name of the amplitude curve defining a mapping between the
inflation time and the actual time.
massFlowAmplitude
A string specifying the name of the amplitude curve by which to modify the mass flow
rate.
"""
def setValues(self):
"""This method modifies the FluidInflator object."""
...
Loading

0 comments on commit bc7de77

Please sign in to comment.