Files
김경종 b7f84e1c0f
Tests / Hermetic test suite (push) Has been cancelled
Tests / Skill frontmatter validation (push) Has been cancelled
add documents
2026-05-29 15:59:56 +09:00

17 KiB
Raw Permalink Blame History

specified, but the U1 or S11 variable identifier keys cannot be specified. In addition, the MODAL variable identifier key can be specified to gather eigenvalue results records (those written to the results file with the record key 1980); in this case, no variable location data are required.

When gathering results from the output (.odb) database, each result record to be gathered is chosen by specifying one of the available output variable identifier keys appearing under the .odb column heading in “Abaqus/Standard output variable identifiers,” Section 4.2.1, or “Abaqus/Explicit output variable identifiers,” Section 4.2.2. For field output the component must not be specified, while for history output the component number is required; for example, the U or S variable identifier keys can be specified for field output, while the U1 or S11 variable identifier keys can be specified for history output. Unless the output is at the assembly level, an instance name must be provided as an argument to the gather command. An exception to this instance-name requirement is the case where the output (.odb) database is generated from a model not defined as an assembly of part instances, which is inferred from the presence in the output database of a single assembly named Assembly-1 and a single part instance named PART11. In this case you need not explicitly refer to the instance PART11.

The names of components of the result records are created automatically. For example, the command

myStudy.gather(results='e52_stress', variable='S', element=52) 

creates a result record e52_stress whose six components (in the case of a three-dimensional solid element) are named: e52_stress.1 (the S11 stress component), e52_stress.2 (the S22 stress component), e52_stress.3 (the S33 stress component), e52_stress.4 (the S12 stress component), e52_stress.5 (the S13 stress component), and e52_stress.6 (the S23 stress component).

The variable location data that must be given depend on the output variable identifier key specified. (Refer to “Gather the results of a parametric study.,” Section 20.2.5, for a description of the location data.) Enough variable location data must be given to define a unique result record.

Input File Usage: aStudy.gather (request=, results=, step=, frameValue= | inc= | mode=, variable=, additional location data)

Reporting results

Use the aStudy.report scripting command (see “Report parametric study results.,” Section 20.2.9) to report results gathered from the results files of the parametric study. Use the PRINT, FILE, or XYPLOT options to specify the kind of report to be produced:

• PRINT indicates that a table of results (with headings) is to be printed to the default output device (the screen). You may wish to limit the number of columns in a table so as to make the table readable.
• FILE indicates that a table of results (with headings) is to be written to an ASCII file.
• XYPLOT indicates that a table of results (without headings) is to be written to an ASCII file that can later be read into the Visualization module in Abaqus/CAE to display XY plots.

Each row in a table represents a design in the parametric study. A column in a table can represent values of a parameter, values of a gathered result, or design names.

One or more parameters can be specified in the report command. If no parameters are specified, the default is that all parameters in the parametric study are included in the table. The column corresponding to each parameter shows the value of that parameter in each of the designs included in the table.

A design set name can be specified to restrict the rows in the table to designs that are part of the set (refer to the combine command described earlier). If a design set is not specified, the default is that all designs are included in the table.

Use variations=ON to specify that the first column in a table must show the design names. If variations=ON is not specified or variations=OFF is included, the column of design names is not included in the table.

The names of the results to be reported must be specified as a sequence; for example, the Mises stress of element 33, the S22 stress of element 52, and the U3 displacement of node 10 are gathered in the following three separate commands:

myStudy.gather(results='e33_sinv', variable='SINV', element=33)
myStudy.gather(results='e52_s', variable='S', element=52)
myStudy.gather(results='n10_u', variable='U', node=10) 

These results can be printed in a single table using the following report command:

myStudy.report(PRINT,
results=('e33_sinv.1', 'e52_s.2', 'n10_u.3')) 

This example shows not only how gathered results of different types (element, nodal, etc.) can be collected in a single table but also how to refer to components of results records (the Mises stress is the first component of SINV, S22 is the second component of S, and U3 is the third component of U—refer to “Results file output format,” Section 5.1.2, or the Abaqus Scripting Users Guide for a description of how the results are stored in the results file and the output database, respectively).

When either the FILE token or the XYPLOT token is used, a file name must be given to specify the file to which the results are to be written. A subsequent report command issued in the same session using the same file name will append the new results to the file. However, a subsequent report command issued in a different session using the same file name overwrites the existing file.

Input File Usage: aStudy.report (token, results=, par=, designSet=, variations=, file=)

Execution of parametric studies

To carry out a parametric study, you must prepare a parametrized input file (inputFile.inp). This input file is the template used for the generation of the parametric variations of the study and must contain the parameter definitions necessary to use parameters in place of input quantities. The parameters must be defined in the template file; they cannot be defined in any include files that are referred to by the template file.

In addition, you must prepare a Python scripting file, scriptFile.psf, containing instructions that script the actions of the parametric study.

Typically, you prepare the Python scripting file using an editor and then invoke execution of this file using the Abaqus execution command abaqus script=scriptFile. This command starts the Python

interpreter and executes the instructions in the scripting file. Alternatively, you simply start the Python interpreter, without giving a scripting file, with the Abaqus execution command abaqus script. In this case the Python interpreter remains active, and you can execute additional commands interactively or execute additional commands contained in a file (for example, fileName) using the Python command execfile(fileName). The Python interpreter can be terminated using [Ctrl] + d on a Linux machine or [Ctrl] + z on a Windows machine.

It is normally preferable to execute a previously prepared scripting file because it is likely that you will want to develop the script iteratively; in this case you simply have to go back and edit the scripting file and re-execute it until satisfied with the result.

You can monitor the progress of the parametric variation analyses using normal operating system commands.

Execution in more than one session

You may want to gather and report results multiple times, after the parametric variations of the study have been executed. It is possible to define, generate, and execute a parametric study in one session and gather and report results in a separate session. Only the command used to create the parametric study needs to be reissued when you start a new session.

Visualization of parametric study results

The results of the analysis of a particular parametric study variation can be visualized like any other results of a single analysis.

Visualization of results gathered across designs of a parametric study requires gathering of results. For visualization the results must be reported in ASCII files (using the XYPLOT option in the gather command), which can be read by the Visualization module in Abaqus/CAE to produce XY plots of results versus parameter values or design names.

Scripting commands

Parametric studies are scripted in files with the .psf extension using the Python language (Lutz, 1996). A parametric study object, constructed from the ParStudy class, is provided whose methods make scripting of parametric studies straightforward; these methods are described in this chapter.

Syntax of scripting commands

Scripting commands generally have the following form:

aStudy.method (token, data)

aStudy is the parametric study object to which the method applies; this object is constructed using the parametric study constructor command. method is the method to be used; for example, define, sample, or execute.

Most (but not all) commands have a token that selects an option of the command; for example, aStudy.define (CONTINUOUS, par= ) indicates that one or more continuous parameters are being defined in a parametric study. Tokens are always given in capital letters and are mutually exclusive.

For most (but not all) commands additional data must be specified.

The parametric study scripts contained in scripting files must follow the syntax and semantics of the Python language. Some important aspects of this language are described here (more general Python language rules are discussed in “Parametric input,” Section 1.4.1).

Comments

Comments must be preceded by the # symbol. The comment is understood to continue to the end of the line. For example,

#
# This parametric study ...
#
studyTempEffects.generate(template='shell') #use shell input file 

Case sensitivity

All variable and method names, tokens, and character string literals are case sensitive across all operating systems. For example,

study.execute( ) # is valid
study.Execute( ) # is not valid because of the capital E
study.sample(NUMBER, ...) # uses the valid token NUMBER
study.sample(number, ...) # lower case token is not valid
study.generate(template='aFile') # 'aFile' is different
study.generate(template='afile') # from 'afile' 

Character strings

Character strings are indicated by using paired single ( ) or double (” ”) quotation marks. Backward single quotation marks ( ) cannot be used for this purpose. For example,

"double quoted string"
'single quoted string' 

Printing

The Python print command can be used to obtain a printed representation of any Python object. For example,

print 'MY TEXT' 

will print MY TEXT on the standard output device.

Lists and tuples

The scripting methods for parametric studies accept integer, real, and character string types. These primitive types can, in many cases, optionally be contained within tuple or list structures. Although there are some differences between lists and tuples in Python, they can be used interchangeably in the parametric study scripting commands; they simply represent ordered sequences of items. Items in lists or tuples must be separated by commas and enclosed in parentheses or brackets. For example,

aStudy.define(CONTINUOUS, par=('xCoord',))# tuple contains a
# single string item
aStudy.define(CONTINUOUS, par=['xCoord']) # list contains a
# single string item
aStudy.define(CONTINUOUS, par=('xCoord', 'yCoord')) # tuple
aStudy.define(CONTINUOUS, par=['xCoord', 'yCoord']) # list 

Indentation

Python uses indentation to group blocks of statements. Therefore, a Python statement should begin in the same column as the preceding statement except where grouping of statements is required by Python.

Accessing the data of a parametric study

In some cases it is desirable to have direct programmatic access to the data of a parametric study. Therefore, all of the important data of the study are stored in repositories that can be accessed as data members of the parametric study object. The repositories have a similar interface and similar behavior to that of Python dictionaries. Repository data are stored as key, value pairs; and methods are provided for accessing the repository keys and values. The syntax aValue = aRepository[aKey] is used to retrieve the value associated with a repository key. A list of the keys of the repository is obtained using the keys() method of the repository; for example, allKeys = aRepository.keys(). Similarly, a list of the values of the repository is obtained using the values() method of the repository; for example, allValues = aRepository.values(). The following parametric study script shows an example of how the parameter repository of a parametric study can be accessed and how a list of the parameter names and a list of the sample values for the parameter t1 can be obtained:

studyTempEffect = ParStudy(par=('t1', 't2'))
studyTempEffect.define(CONTINUOUS, par=('t1', 't2'))
studyTempEffect.sample(VALUES, par='t1', values=(200.,300.,400.))
studyTempEffect.sample(VALUES, par='t2', values=(250.,350.,450.))
parRepository = studyTempEffect.parameter
listOfParameters = parRepository.keys()
t1Sample = parRepository['t1'].sample 

The script results in the following assignments: listOfParameters = [t1, t2] and t1Sample = [200.0, 300.0, 400.0]. The Python print command can be used to obtain information on the contents of a repository.

Parametric study repositories

A parametric study has the following repositories and objects as data members:

• aStudy.parameter: A repository for parameter objects keyed by parameter name. Each parameter object has a name, type, domain, reference, and sample data member.
• aStudy.designSet: A repository for design sets keyed by design set name. Each design set is represented as a list of design points.
• aStudy.job: A repository for analysis job objects keyed by the name of the corresponding analysis input file name (without the .inp extension). Each job object has a design, status, root, designSet, and designName data member.
• aStudy.resultData: A repository for result records keyed by a name constructed by successively appending the result name, the underscore character (_), and the design name. For results retrieved from the result (.fil) file, each result record is in the format of the result (.fil) file record for the corresponding output variable. For field results retrieved from the output (.odb) database, each result record will be a tuple containing the components of the results. The result record for history results from the output (.odb) database, which can only be retrieved for a single component, will be a tuple containing a single value.
• aStudy.table: A table object containing a representation of the table formatted by the last use of the report command. The table object has title, variation, designs, and results data members.

Additional reference

• Lutz, M., Programming Python, OReilly & Associates, Inc., 1996.

20.2 Parametric studies: commands

• “Combine parameter samples for parametric studies.,” Section 20.2.1
• “Constrain parameter value combinations in parametric studies.,” Section 20.2.2
• “Define parameters for parametric studies.,” Section 20.2.3
• “Execute the analysis of parametric study designs.,” Section 20.2.4
• “Gather the results of a parametric study.,” Section 20.2.5
• “Generate the analysis job data for a parametric study.,” Section 20.2.6
• “Specify the source of parametric study results.,” Section 20.2.7
• “Create a parametric study.,” Section 20.2.8
• “Report parametric study results.,” Section 20.2.9
• “Sample parameters for parametric studies.,” Section 20.2.10

20.2.1 aStudy.combine(): Combine parameter samples for parametric studies.

Products: Abaqus/Standard Abaqus/Explicit

This command is used to combine the sampled parameter values in a parametric study.

Reference:

• “Scripting parametric studies,” Section 20.1.1

Command:

aStudy.combine (token, additional data)

Tokens:

CROSS

Use this token to create designs in a “cross-shaped” pattern from the sampled values of the parameters in the parametric study.

MESH

Use this token to create designs in a “mesh” pattern in which every sampled value of a parameter is combined with every sampled value of every other parameter in the parametric study.

PRINT

Use this token to print the design points created for the parametric study.

TUPLE

Use this token to create designs in a “tuple” pattern consisting of tuples of sampled values of the parameters in the parametric study.

Additional data for CROSS, MESH, and TUPLE:

Optional data:

name

Set name equal to the name of the design set being defined; this name must be enclosed by quotation marks. A default design set name is created if a name is not specified.

Additional data for PRINT:

Optional data:

name

Set name equal to the name of the design set for which information is being printed; this name must be enclosed by quotation marks. If a design set name is not specified, information is printed for all the design sets in the parametric study.