Skip to content

Commit

Permalink
Merge pull request #16 from haiiliin/V2017-predefined-stress
Browse files Browse the repository at this point in the history
Add Stress predefined field
  • Loading branch information
haiiliin committed Aug 6, 2022
2 parents f8a58b7 + 250e344 commit e4e91d6
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 0 deletions.
63 changes: 63 additions & 0 deletions src/abaqus/PredefinedField/PredefinedFieldModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .InitialState import InitialState
from .KinematicHardening import KinematicHardening
from .MaterialAssignment import MaterialAssignment
from .Stress import Stress
from .Temperature import Temperature
from .Velocity import Velocity
from ..Assembly.PartInstanceArray import PartInstanceArray
Expand Down Expand Up @@ -441,3 +442,65 @@ def Velocity(
distributionType,
)
return predefinedField

def Stress(
self,
name: str,
region: Region,
distributionType: SymbolicConstant = UNIFORM,
sigma11: float = None,
sigma22: float = None,
sigma33: float = None,
sigma12: float = None,
sigma13: float = None,
sigma23: float = None,
):
"""This method creates a Stress predefined field object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].Stress
Parameters
----------
name
A String specifying the repository key.
region
A Region object specifying the region to which the predefined field is applied. Region
is ignored if the predefined field has *distributionType*=FROM_FILE.
distributionType
A SymbolicConstant specifying whether the load is uniform. Possible values are UNIFORM
and FROM_FILE. The default value is UNIFORM.
sigma11
A Float specifying the first principal component of the stress.
sigma22
A Float specifying the second principal component of the stress.
sigma33
A Float specifying the third principal component of the stress.
sigma12
A Float specifying the first shear component of the stress.
sigma13
A Float specifying the second shear component of the stress.
sigma23
A Float specifying the third shear component of the stress.
Returns
-------
A Stress object.
"""
self.predefinedFields[name] = predefinedField = Stress(
name,
region,
distributionType,
sigma11,
sigma22,
sigma33,
sigma12,
sigma13,
sigma23,
)
return predefinedField
107 changes: 107 additions & 0 deletions src/abaqus/PredefinedField/Stress.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
from abaqusConstants import *
from .PredefinedField import PredefinedField
from ..Region.Region import Region


class Stress(PredefinedField):
"""The Stress object stores the data for an initial stress predefined field.
The Stress object is derived from the PredefinedField object.
Notes
-----
This object can be accessed by:
.. code-block:: python
import load
mdb.models[name].predefinedFields[name]
The corresponding analysis keywords are:
- INITIAL CONDITIONS
"""

def __init__(
self,
name: str,
region: Region,
distributionType: SymbolicConstant = UNIFORM,
sigma11: float = None,
sigma22: float = None,
sigma33: float = None,
sigma12: float = None,
sigma13: float = None,
sigma23: float = None,
):
"""This method creates a Stress predefined field object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].Stress
Parameters
----------
name
A String specifying the repository key.
region
A Region object specifying the region to which the predefined field is applied. Region
is ignored if the predefined field has *distributionType*=FROM_FILE.
distributionType
A SymbolicConstant specifying whether the load is uniform. Possible values are UNIFORM
and FROM_FILE. The default value is UNIFORM.
sigma11
A Float specifying the first principal component of the stress.
sigma22
A Float specifying the second principal component of the stress.
sigma33
A Float specifying the third principal component of the stress.
sigma12
A Float specifying the first shear component of the stress.
sigma13
A Float specifying the second shear component of the stress.
sigma23
A Float specifying the third shear component of the stress.
Returns
-------
A Stress object.
"""
super().__init__()
pass

def setValues(
self,
distributionType: SymbolicConstant = UNIFORM,
sigma11: float = None,
sigma22: float = None,
sigma33: float = None,
sigma12: float = None,
sigma13: float = None,
sigma23: float = None,
):
"""This method modifies the Stress object.
Parameters
----------
distributionType
A SymbolicConstant specifying whether the load is uniform. Possible values are UNIFORM
and FROM_FILE. The default value is UNIFORM.
sigma11
A Float specifying the first principal component of the stress.
sigma22
A Float specifying the second principal component of the stress.
sigma33
A Float specifying the third principal component of the stress.
sigma12
A Float specifying the first shear component of the stress.
sigma13
A Float specifying the second shear component of the stress.
sigma23
A Float specifying the third shear component of the stress.
"""
pass

0 comments on commit e4e91d6

Please sign in to comment.