Optimization cards (structmanager.sol200.cards_opt
)¶
Many input cards related to the optimization problem are wrapped in this
module. The input cards more related to the solver are contained in module
structmanager.sol200.cards_solver
.
Classes
structmanager.sol200.cards_opt.DCONSTR (dcid, ...) |
Design constraint |
structmanager.sol200.cards_opt.DEQATN (eq) |
Equation to calculate customized responses |
structmanager.sol200.cards_opt.DESVAR (label, ...) |
Design Variable |
structmanager.sol200.cards_opt.DLINK (ddvid, ...) |
Link between design variables |
structmanager.sol200.cards_opt.DRESP1 (label, ...) |
Design response DRESP1 |
structmanager.sol200.cards_opt.DRESP2 (label, ...) |
Design response DRESP2 |
structmanager.sol200.cards_opt.DRESP3 (label, ...) |
Design response DRESP3 |
structmanager.sol200.cards_opt.DTABLE ([...]) |
Design Table used to define many constants |
structmanager.sol200.cards_opt.DVPREL1 (type, ...) |
Design Variable-to-Property relation |
-
class
structmanager.sol200.cards_opt.
BASEDV2
[source]¶ Bases:
structmanager.sol200.cards_opt.PRINTAUX
Base class for DVPREL2, DVCREL2 and DVMREL2
Methods
add_dtable
add_dvar
print_aux
-
class
structmanager.sol200.cards_opt.
DCONSTR
(dcid, rid, lallow, uallow)[source]¶ Bases:
object
Design constraint
Parameters: dcid : int
Design constraint set identification number.
rid : int
The corresponding design response id.
lallow : float
Lower bound on the response quantity.
uallow : float
Upper bound on the response quantity.
Methods
print_card
-
class
structmanager.sol200.cards_opt.
DEQATN
(eq)[source]¶ Bases:
object
Equation to calculate customized responses
Parameters: eq : str
A string containing the equation. For example, the following equation:
\[T(x_1, x_2, x_3) = \sqrt{x_1^2 + x_2^2 + x_3^2}\]can be written as:
eq = 'T(x1,x2,x3)=SQRT(x1**2+x2**2+x3**2)'
Notes
Note
The
DEQATN.print_card()
method will split the equation, when necessary, in order to keep the limit length up to 56 characters in the first line, and 64 characters for the subsequent lines.Methods
print_card
-
class
structmanager.sol200.cards_opt.
DESVAR
(label, xinit, xlb, xub, dvprel1=None, code=None)[source]¶ Bases:
object
Design Variable
Parameters: label : str
User-supplied name for printing purposes.
xinit : float
Initial value.
xlb : float
Lower bound.
xub : float
Upper bound.
dvprel1 :
DVPREL1
or None, optionalThe corresponding design variable-to-property relation.
code : str or None, optional
An additional code to identify the design varible.
Methods
defaults
print_card
show_card
-
class
structmanager.sol200.cards_opt.
DLINK
(ddvid, idvs, cs, c0=0.0, cmult=1.0)[source]¶ Bases:
object
Link between design variables
DLINK creates links among variables using the form:
\[dvar_{dependent} = c_0 + c_{mult} \times (c_1 \times {dvar}_1 + c_2 \times {dvar}_2)\]where:
dvar_{dependent}
is the dependent variable{dvar}_i
thei^{th}
design variablec_0
is a constantc_{mult}
is a common multiplierc_i
is an individual multiplier for{dvar}_i
Parameters: ddvid : int
Dependent design variable identification number.
c0 : float
Constant term.
cmult : float
Constant multiplier.
idvs : list
The independent variables.
cs : list
The multipliers for each variable.
Notes
Be sure that no dependent variables are being used as independent variables.
By default
c0 = 0
andcmult = 1
.The values of
dvi
andci
are inputed as follows:indep_dv_c = [dv1, c1, dv2, c2, ...] indep_dv_c = [1000000, 1., 1000001, 1., ...]
Methods
print_card
-
class
structmanager.sol200.cards_opt.
DRESP
[source]¶ Bases:
object
Base class to guarantee an unique id among all DRESPs
-
class
structmanager.sol200.cards_opt.
DRESP1
(label, rtype, ptype, region=None, atta=None, attb=None, atti=None)[source]¶ Bases:
structmanager.sol200.cards_opt.DRESP
Design response DRESP1
Parameters: label : str
User-defined label.
rtype : str
Response type.
ptype : str
Element flag (‘ELEM’) or property entry name (‘PBAR’, PSHELL’ etc).
region : int or None, optional
Region identifier for constraint screening.
atta, attb: int or float or None :
Response attributes.
atti : int or float or None or list, optional
Response attributes.
Methods
print_card
-
class
structmanager.sol200.cards_opt.
DRESP2
(label, eqid, region=None)[source]¶ Bases:
structmanager.sol200.cards_opt.DRESP23
Design response DRESP2
Define equation responses that are used in the design, either as an objective function or as constraints.
Parameters: label : str
User-defined label.
eqid : int or str
DEQATN
entry identification number, or string informing a pre-programmed function.region : int or None, optional
Region used for constraint screening.
Notes
To add variables, table entries or other
DRESP1
responses use the methods:add_dvar()
,add_dtable()
andadd_dresp1()
.Methods
add_dresp1
add_dresp2
add_dtable
add_dvar
print_aux
print_card
-
class
structmanager.sol200.cards_opt.
DRESP23
[source]¶ Bases:
structmanager.sol200.cards_opt.PRINTAUX
Base class for DVPREL2, DVCREL2, DVMREL2, DRESP2, DRESP3 etc
Methods
add_dresp1
add_dresp2
add_dtable
add_dvar
print_aux
-
class
structmanager.sol200.cards_opt.
DRESP3
(label, group, type, region='')[source]¶ Bases:
structmanager.sol200.cards_opt.DRESP23
Design response DRESP3
Define use-subroutine or built-in responses that can be used in the design either as constraint or as an objective.
Parameters: label : str
User-defined label.
group : str
Group name the external response type belongs to.
type : str
External response type.
region : int, optional
DEQATN
entry identification number.Notes
To add variables, table entries or other
DRESP1
responses use the methods:add_dvar()
,add_dtable()
andadd_dresp1()
.Methods
add_dresp1
add_dresp2
add_dtable
add_dvar
print_aux
print_card
-
class
structmanager.sol200.cards_opt.
DTABLE
(input_dict={})[source]¶ Bases:
object
Design Table used to define many constants
Hints:
- There can be any number of DTABLE entries in the bulk data.
- The user must avoid repeated labels for constants
- The constant label must be <= 8 characters.
All values for the constants must be of the ‘Real’ type. Ex:
input_dict={'c1':1. , 'c2':2., 'max8char':999.}
Methods
print_card
-
class
structmanager.sol200.cards_opt.
DVPREL
[source]¶ Bases:
object
Base class to guarantee an unique id among all DVPRELs
-
class
structmanager.sol200.cards_opt.
DVPREL1
(type, pid, pname, dvids, coeffs, c0=0.0)[source]¶ Bases:
object
Design Variable-to-Property relation
This is a wrapper for the DVPREL1 card in NASTRAN.
Parameters: type : str
Name of a property entry, such as “PBAR”, “PBEAM”, etc.
pid : int
Property entry identification number.
pname : str
Parameter name such as “T”, “A”, “DIM1”, or a field position of the property entry.
dvids : list
Ids of the design variables that will be related to this property parameter.
coeffs : list
Multipliers to each corresponding design variable.
c0 : float, optional
Constant term of relation.
Methods
print_card
-
class
structmanager.sol200.cards_opt.
DVPREL2
(type, pid, pname, eqid)[source]¶ Bases:
structmanager.sol200.cards_opt.BASEDV2
Design Variable-to-Property relation
This is a wrapper for the DVPREL1 card in NASTRAN.
Parameters: type : str
Name of a property entry, such as “PBAR”, “PBEAM”, etc.
pid : int
Property entry identification number.
pname : str
Parameter name such as “T”, “A”, “DIM1”, or a field position of the property entry.
eqid : int or str
DEQATN
entry identification number, or string informing a pre-programmed function.Methods
add_dtable
add_dvar
print_aux
print_card