-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
796 changed files
with
835,604 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+6.31 KB
zh_CN/2025/_downloads/06067320cb13e05c18fa4084cb486c67/compression.zip
Binary file not shown.
98 changes: 98 additions & 0 deletions
98
zh_CN/2025/_downloads/2038bbc34935c669f96df9bc699474a2/viewerPrintContours.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
""" | ||
Print Contour Plots | ||
------------------- | ||
`viewerPrintContours.py` from `Printing a contour plot at the end of each step <https://help.3ds.com/2021/English/DSSIMULIA_Established/SIMACAECMDRefMap/simacmd-c-intexaprintcontour.htm?contextscope=all&id=01196185741b4c25ae212a9cc00dc138>`_. | ||
Print a set of contour plots to .png files. | ||
Run the following command before running this script: | ||
.. code-block:: sh | ||
abaqus fetch job=viewer_tutorial | ||
The following example script demonstrates how to produce and print a contour plot at the last frame of every step within an output database file. The example sets the appropriate contour limits so that all plots can be viewed within a fixed range. | ||
Use the following command to retrieve the example script: | ||
.. code-block:: sh | ||
abaqus fetch job=viewerPrintContours | ||
The script does the following: | ||
- Defines the contour limits function. | ||
- Determines the final frame of every step within an output database file. | ||
- Produces a contour plot at the final frame of every step. | ||
- Prints the contour plot to a file. | ||
""" | ||
|
||
import visualization | ||
from abaqus import * | ||
from abaqusConstants import * | ||
|
||
# Create a viewport for this example. | ||
|
||
myViewport = session.Viewport(name="Print contour plot after each step", origin=(10, 10), width=150, height=100) | ||
|
||
# Open the output database and associate it with the viewport. | ||
# Then set the plot state to CONTOURS_ON_DEF | ||
|
||
try: | ||
myOdb = visualization.openOdb(path="viewer_tutorial.odb") | ||
|
||
except Exception as e: | ||
print("Error:", e) | ||
|
||
myViewport.setValues(displayedObject=myOdb) | ||
|
||
|
||
myViewport.odbDisplay.display.setValues(plotState=(CONTOURS_ON_DEF,)) | ||
|
||
# Determine the number of steps in the output database. | ||
|
||
mySteps = myOdb.steps | ||
numSteps = len(mySteps) | ||
|
||
# Set the maximum and minimum limits of the contour legend. | ||
|
||
myViewport.odbDisplay.contourOptions.setValues( | ||
numIntervals=10, maxAutoCompute=OFF, maxValue=0.1, minAutoCompute=OFF, minValue=0.0 | ||
) | ||
|
||
# Establish print preferences. | ||
|
||
session.printOptions.setValues(vpBackground=OFF) | ||
session.psOptions.setValues(orientation=LANDSCAPE) | ||
myViewport.viewportAnnotationOptions.setValues(triad=OFF, title=OFF, state=OFF) | ||
myViewport.odbDisplay.basicOptions.setValues( | ||
coordSystemDisplay=OFF, | ||
) | ||
|
||
# For each step, obtain the following: | ||
# 1) The step key. | ||
# 2) The number of frames in the step. | ||
# 3) The increment number of the last frame in the step. | ||
# | ||
|
||
for i in range(numSteps): | ||
stepKey = mySteps.keys()[i] | ||
step = mySteps[stepKey] | ||
numFrames = len(step.frames) | ||
|
||
# Go to the last frame. | ||
# Display a contour plot. | ||
# Display the step description and the increment number. | ||
|
||
myViewport.odbDisplay.setFrame(step=i, frame=numFrames - 1) | ||
myViewport.odbDisplay.display.setValues(plotState=(CONTOURS_ON_DEF,)) | ||
|
||
# Remove white space from the step key and use the result | ||
# to name the file. | ||
|
||
fileName = stepKey.replace(" ", "") | ||
|
||
# Print the viewport to a file. | ||
|
||
session.printToFile(fileName, PNG, (myViewport,)) |
Binary file added
BIN
+25.2 KB
zh_CN/2025/_downloads/2410b4ec5b60a4a9094b5a7df0573900/skewExample.zip
Binary file not shown.
94 changes: 94 additions & 0 deletions
94
zh_CN/2025/_downloads/39dda3724b83976000a59f79ea7b425d/compression.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
""" | ||
Compression Model | ||
----------------- | ||
A simple example to establish a compression model. | ||
.. figure:: /images/model.png | ||
:width: 50% | ||
:align: center | ||
A simple compression model. | ||
The output script of this example can be found :doc:`here <compression-output>`. | ||
""" | ||
|
||
from abaqus import * | ||
from abaqusConstants import * | ||
from caeModules import * | ||
from driverUtils import * | ||
|
||
executeOnCaeStartup() | ||
|
||
# Model | ||
model = mdb.models["Model-1"] | ||
|
||
# Part | ||
sketch = model.ConstrainedSketch(name="sketch", sheetSize=1.0) | ||
sketch.rectangle((0, 0), (1, 1)) | ||
part = model.Part(name="part", dimensionality=THREE_D, type=DEFORMABLE_BODY) | ||
part.BaseSolidExtrude(sketch=sketch, depth=1) | ||
|
||
# Create sets | ||
part.Set(name="set-all", cells=part.cells.findAt(coordinates=((0.5, 0.5, 0.5),))) | ||
part.Set(name="set-bottom", faces=part.faces.findAt(coordinates=((0.5, 0.5, 0.0),))) | ||
part.Set(name="set-top", faces=part.faces.findAt(coordinates=((0.5, 0.5, 1.0),))) | ||
part.Surface(name="surface-top", side1Faces=part.faces.findAt(coordinates=((0.5, 0.5, 1.0),))) | ||
|
||
# Assembly | ||
model.rootAssembly.DatumCsysByDefault(CARTESIAN) | ||
model.rootAssembly.Instance(name="instance", part=part, dependent=ON) | ||
|
||
# Material | ||
material = model.Material(name="material") | ||
material.Elastic(table=((1000, 0.2),)) | ||
material.Density(table=((2500,),)) | ||
|
||
# Section | ||
model.HomogeneousSolidSection(name="section", material="material", thickness=None) | ||
part.SectionAssignment(region=part.sets["set-all"], sectionName="section") | ||
|
||
# Step | ||
step = model.StaticStep( | ||
name="Step-1", | ||
previous="Initial", | ||
description="", | ||
timePeriod=1.0, | ||
timeIncrementationMethod=AUTOMATIC, | ||
maxNumInc=100, | ||
initialInc=0.01, | ||
minInc=0.001, | ||
maxInc=0.1, | ||
) | ||
|
||
# Output request | ||
field = model.FieldOutputRequest("F-Output-1", createStepName="Step-1", variables=("S", "E", "U")) | ||
|
||
# Boundary condition | ||
bottom_instance = model.rootAssembly.instances["instance"].sets["set-bottom"] | ||
bc = model.DisplacementBC( | ||
name="BC-1", createStepName="Initial", region=bottom_instance, u1=SET, u2=SET, u3=SET, ur1=SET, ur2=SET, ur3=SET | ||
) | ||
|
||
# Load | ||
top_instance = model.rootAssembly.instances["instance"].surfaces["surface-top"] | ||
pressure = model.Pressure("pressure", createStepName="Step-1", region=top_instance, magnitude=100) | ||
|
||
# Mesh | ||
elem1 = mesh.ElemType(elemCode=C3D8R) | ||
elem2 = mesh.ElemType(elemCode=C3D6) | ||
elem3 = mesh.ElemType(elemCode=C3D4) | ||
part.setElementType(regions=(part.cells,), elemTypes=(elem1, elem2, elem3)) | ||
part.seedPart(size=0.1) | ||
part.generateMesh() | ||
|
||
# Job | ||
job = mdb.Job(name="Job-1", model="Model-1") | ||
job.writeInput() | ||
|
||
# Submit the job | ||
job.submit() | ||
job.waitForCompletion() | ||
|
||
# Save abaqus model | ||
mdb.saveAs("compression.cae") |
Binary file added
BIN
+2.55 KB
zh_CN/2025/_downloads/3d2fe869c4f4edc90b0560d7662b5ebd/compression-output.zip
Binary file not shown.
Oops, something went wrong.