SOL200 optimization model (structmanager.sol200.sol200)

class structmanager.sol200.sol200.SOL200[source]

Bases: object

SOL200 optimization model

This class corresponds to an optimization model.

Attribute Description
dobj DESOBJ object
dvprels dict of DVPREL1 and DVPREL2 objects
deqatns dict of DEQATN objects
dtable DTABLE that will be created based on the dtables dictionary
dtables dict that will be used to build a unique DTABLE
dtable_prefixes dict carries IDs to prevent repeated DTABLE constants.
dresps dict of DRESP1, DRESP2 or DRESP3 objects
groups set containing the externl subroutines that are used in the current optimization model
dconstrs dict of DCONSTR objects
dvars dict of DVAR objects
dvar_codes
dict classifying the DVAR objects by
their unique codes
dlinks dict of DLINK objects
newprops dict with different NASTRAN cards, see reset_newprops()
nodal_displ dict with the nodal displacements constraints as detailed in nodal_displ_from_excel()
loads_list list containing the load cases’ ids
num_cycles int indicating the number of design cycles
outputdir str path to the output directory
sol200filepath str path to SOL200’s output file
sol200file file handler to SOL200’s output file

Methods

constrain_pbar(dcid, pid, name, rtype, ...) Add constraints to all stress recovery points of a bar property.
constrain_pcomp(dcid, pid, eltype, rtype, names) Add constraints to the bottom and top faces of a pcomp property.
constrain_pshell(dcid, pid, eltype, rtype, names) Add constraints to the bottom and top faces of a shell property.
constrain_two_vars(dcid, var1, var2, maxdiff) Constrain two vars in order to keep a maximum relative difference
create_dobj() Create the design objective.
pickle_dump(path)
pickle_load(path)
print_model() Print the whole model.
reset_newprops() Reset the dictionary newprops.
set_output_file(path) Define the data related to the output file.
constrain_pbar(dcid, pid, name, rtype, eltype, allow_C, allow_T)[source]

Add constraints to all stress recovery points of a bar property.

Parameters:

dcid : int

Design constraint set identification number.

pid : int

Property id.

name : str or list

The name of the constraint.

rtype : str

The type of response. For bar elements it is usually 'STRESS'.

eltype : str

The section type: 'RECT', 'CIRCLE', etc.

allow_C : float

The allowable for compression.

allow_T : float

The allowable for tension.

constrain_pcomp(dcid, pid, eltype, rtype, names, lallow=None, uallow=None)[source]

Add constraints to the bottom and top faces of a pcomp property.

Parameters:

dcid : int

Design constraint set identification number.

pid : int

Property id.

eltype : str

Element type (‘CQUAD4’, ‘CTRIA3’, etc).

rtype : str

The type of response. For shells it is usually 'STRESS'.

names : str or list of strings

The name of the constraint, as in the quick reference guide, reproduced in module atd.sol200.output_codes.

lallow : float or None, optional

Lower bound on the response quantity.

uallow : float or None, optional

Upper bound on the response quantity.

constrain_pshell(dcid, pid, eltype, rtype, names, lallow=None, uallow=None)[source]

Add constraints to the bottom and top faces of a shell property.

Parameters:

dcid : int

Design constraint set identification number.

pid : int

Property id.

eltype : str

Element type (‘CQUAD4’, ‘CTRIA3’, etc).

rtype : str

The type of response. For shells it is usually 'STRESS'.

names : str or list of strings

The name of the constraint, as in the quick reference guide, reproduced in module atd.sol200.output_codes.

lallow : float or None, optional

Lower bound on the response quantity.

uallow : float or None, optional

Upper bound on the response quantity.

constrain_two_vars(dcid, var1, var2, maxdiff)[source]

Constrain two vars in order to keep a maximum relative difference

Parameters:

dcid : int

Design constraint set identification number.

var1, var2 : int or str

The variables id (int) or code (str).

maxdiff : float

The maximum relative difference that ‘var1’ and ‘var2’ must respect.

create_dobj()[source]

Create the design objective.

print_model()[source]

Print the whole model.

reset_newprops()[source]

Reset the dictionary newprops.

This dictionary contains NASTRAN property cards that should be created along with the optimization model.

The supported cards are those corresponding to the classes defined in cards_solver.

set_output_file(path)[source]

Define the data related to the output file.

The output directory is estimated based on path.

Parameters:

path : str

The full path of the output file.