Skip to content

Commit

Permalink
1.update em_randles_batmat,2.correct opt for rigidwall_motion,3.incre…
Browse files Browse the repository at this point in the history
…ment define_function/curve ID
  • Loading branch information
zhangzhanqun committed Sep 11, 2023
1 parent ede8982 commit 1acc868
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docker/pre/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Prerequisites
instructions from `this page <https://docs.docker.com/engine/install/>`_.

* Download the latest Linux release artifacts for the ``pre`` Docker container:
`linux-binaries.zip <https://github.com/ansys/pydyna/releases/download/v0.3.5/linux-binaries.zip>`_.
`linux-binaries.zip <https://github.com/ansys/pydyna/releases/download/v0.4.2/linux-binaries.zip>`_.

* Move this ZIP file to the ``docker/pre`` directory.

Expand Down
13 changes: 6 additions & 7 deletions src/ansys/dyna/core/pre/dynabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
from ansys.api.dyna.v0.kwprocess_pb2 import * # noqa : F403
from ansys.api.dyna.v0.kwprocess_pb2_grpc import * # noqa : F403


class Motion(Enum):
VELOCITY = 0
ACCELERATION = 1
DISPLACEMENT = 2

class RWMotion(Enum):
VELOCITY = 0
DISPLACEMENT = 1


class DOF(Enum):
X_TRANSLATIONAL = 1
Expand Down Expand Up @@ -2528,13 +2531,11 @@ def __init__(self, tail=Point(0, 0, 0), head=Point(0, 0, 0), radius=1, length=10
self.lcid = 0
self.dir = Direction(1, 0, 0)

def set_motion(self, curve, motion=Motion.VELOCITY, dir=Direction(1, 0, 0)):
def set_motion(self, curve, motion=RWMotion.VELOCITY, dir=Direction(1, 0, 0)):
"""Set the prescribed motion."""
curve.create(self.stub)
self.lcid = curve.id
self.motion = motion.value
if self.motion == Motion.DISPLACEMENT:
self.motion = 1
self.dir = dir

def create(self):
Expand Down Expand Up @@ -2589,13 +2590,11 @@ def __init__(self, center=Point(0, 0, 0), orient=Point(0, 0, 0), radius=1):
self.lcid = 0
self.dir = Direction(1, 0, 0)

def set_motion(self, curve, motion=Motion.VELOCITY, dir=Direction(1, 0, 0)):
def set_motion(self, curve, motion=RWMotion.VELOCITY, dir=Direction(1, 0, 0)):
"""Set the prescribed motion."""
curve.create(self.stub)
self.lcid = curve.id
self.motion = motion.value
if self.motion == Motion.DISPLACEMENT:
self.motion = 1
self.dir = dir

def create(self):
Expand Down
6 changes: 4 additions & 2 deletions src/ansys/dyna/core/pre/dynaem.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,11 @@ def create(self):
"""Set parameter for Randles Cell."""
if self.define_batmac:
sid = 0
soutouid = 0
if self.psid is not None:
sid = self.psid.create(self.stub)
soctou = self.soctou.create(self.stub)
if self.soctou is not None:
soutouid = self.soctou.create(self.stub)
modified_prm = []
for par in self.prm:
if type(par) == float:
Expand All @@ -826,7 +828,7 @@ def create(self):
q=self.q,
cq=self.cq,
socinit=self.socinit,
soctou=soctou,
soctou=soutouid,
chargedirparam=modified_prm,
temp=self.temp,
frther=self.frther,
Expand Down

0 comments on commit 1acc868

Please sign in to comment.