pyTACS class

pytacs - The Python wrapper for the TACS assembler

This python interface is designed to provide a easier interface to the C++ layer of TACS. User-supplied hooks allow for nearly complete customization of any or all parts in the problem setup. There are two main parts of this module: The first deals with setting up the TACS model including reading the mesh, setting elements and design variables. The second part deals with creating problem instances that are responsible for setting loads and functions, performing analysis, and gradient computations.

Developers:
  • Dr. G.K.W. Kenway (GKK)

  • Dr. T.R Brooks

History:
    1. 1.0 pyTACS initial implementation

    1. 3.0 updated TACS 3.0 pyTACS implementation

Options

Options can be set for pyTACS at time of creation for the class or using the pyTACS.setOption. Current option values for a class instance can be printed out using the pyTACS.printOption method. The following options, their default values and descriptions are listed below:

+----------------------------------------+
|        pyTACS default options:         |
+----------------------------------------+
'printDebug': False
	 Flag for whether to print debug information while loading file.
'outputElement': None
	 Specifies which element type should be written out in the f5 file.
	 If None, the type will be inferred from the first element in the model.
	 Acceptable values are:
		 tacs.TACS.ELEMENT_NONE = 0
		 tacs.TACS.SCALAR_2D_ELEMENT = 1
		 tacs.TACS.SCALAR_3D_ELEMENT = 2
		 tacs.TACS.BEAM_OR_SHELL_ELEMENT = 4
		 tacs.TACS.PLANE_STRESS_ELEMENT = 5
		 tacs.TACS.SOLID_ELEMENT = 6
		 tacs.TACS.RIGID_ELEMENT = 7
		 tacs.TACS.MASS_ELEMENT = 8
		 tacs.TACS.SPRING_ELEMENT = 9
		 tacs.TACS.PCM_ELEMENT = 10
'writeConnectivity': True
	 Flag for whether to include element connectivity in f5 file.
'writeNodes': True
	 Flag for whether to include nodes in f5 file.
'writeDisplacements': True
	 Flag for whether to include nodal displacements in f5 file.
'writeStrains': True
	 Flag for whether to include element strains in f5 file.
'writeStresses': True
	 Flag for whether to include element stresses in f5 file.
'writeExtras': True
	 Flag for whether to include element extra variables in f5 file.
'writeLoads': True
	 Flag for whether to include external nodal loads in f5 file.
'writeCoordinateFrame': False
	 Flag for whether to include element coordinate frames in f5 file.
'familySeparator': '/'
	 Family separator character used for condensing groups in f5 file.
'printTiming': False
	 Flag for printing out timing information for class procedures.
'linearityTol': 1e-14
	 When created, pyTACS will check if the model is linear or nonlinear by checking whether (res(2*u) - res(0)) - 2 * (res(u) - res(0)) == 0 this tolerance controls how close to zero the residual must be to be considered linear.

Initializing

Before the class can be used to create problems, it must first be initialized by calling the pyTACS.initialize method. This method reads in all of the element cards from the BDF file and sets up the equivalent TACS element objects necessary for analysis. The class can be initialized through two ways: with or without elemCallBack function.

Initializing with elemCallBack

pyTACS can be initialized py passing a user-defined elemCallBack function to pyTACS.initialize, that will be used to setup the correct TACS elements at runtime.

The elemCallBack function should have the following structure:

tacs.pytacs.elemCallBack(dvNum, compID, compDescript, elemDescripts, globalDVs, **kwargs)

User-defined function used by pyTACS to setup a Element for each element type in a given component (property) group.

Parameters:
  • dvNum (int) -- The current counter which must be used when creating constitutive object with design variables.

  • compID (int) -- The ID number used by TACS to reference this property group. Use kwargs['propID'] to get the corresponding NASTRAN property ID that is read in from the BDF.

  • compDescript (str) -- The component description label read in from optional formatted comments in BDF file.

  • elemDescripts (list[str]) -- The name of the NASTRAN element cards belonging to this group (e.g. CQUAD4, CTRIA3, CTETRA, etc). This value will be a list since one component may contain multiple compatible element types. Example: ['CQUAD4', CTRIA3'].

  • globalDVs (dict) -- Dictionary containing information about any global DVs that have been added.

Returns:

List containing as many TACS element objects as there are element types in elemDescripts (one for each).

Return type:

list[Element]

Note

Some elements should not be setup through the elemCallBack function (RBE2, RBE3, CONM1, CONM2, etc.). These elements are setup automatically by pyTACS. As a general rule of thumb, if the NASTRAN element card doesn't contain a property ID, it should not show up in the elemCallBack function.

Initializing without elemCallBack

If NASTRAN material property card definitions for every element exist in the BDF file, pyTACS can be initialized without a elemCallBack() function. This can be done by calling pyTACS.initialize without any arguments.

Currently supported NASTRAN cards and their corresponding TACS-equivelant classes are listed below:

Material cards:
Property cards:
Elements cards:
Design Variable cards:
  • DESVAR

Note

Not every NASTRAN element card has one unique TACS element counterpart. For example a user may want a CQUAD4 card interpreted as Quad4Shell in the case of an elastic analysis, but might want it interpreted as a Quad4ThermalShell in the case of a thermoelastic analysis. In the case where the default TACS elements above don't match the user's desired TACS element, the user is recommended to setup that element through an elemCallBack procedure instead.

Tagging component groups in BDF

Several pyTACS methods (pyTACS.selectCompIDs, elemCallBack(), etc.) allow for the use of user-defined component labels. These labels are read in through formatted comment in the BDF file.

There are currently several supported formats for labels: ICEM-format, FEMAP-format, Patran-format, and HyperMesh-format. These are described below.

ICEM component label format

In the ICEM format, the elements are organized by property groups and the component label is appended as a string comment above the first element in every property group. The string comment should start with $       Shell element data for family followed by the component name. No spaces are allowed within the component name. An example of this format is provided below:

$       Shell element data for family    WING_SPARS/LE_SPAR/SEG.00
CQUADR         1       1    3600    3310    3797     731       1
CQUADR         2       1     731    3797    3798     732       1
CQUADR         3       1     732    3798    3799     733       1
CQUADR         4       1     733    3799    3800     734       1
CQUADR         5       1     734    3800    3801     735       1
CQUADR         6       1     735    3801    3802     736       1
$       Shell element data for family    WING_SPARS/LE_SPAR/SEG.01
CQUADR        97       2    3262    3882     782    3601       2
CQUADR        98       2     782    3882    3881     781       2
CQUADR        99       2    3875    3888    3885    3874       2
CQUADR       100       2    3885    3888    3887    3884       2
CQUADR       101       2    3892    3899    3896    3891       2
CQUADR       102       2    3896    3899    3898    3895       2

FEMAP component label format

In the FEMAP format, the component label is appended as a string comment above each property card. The string comment should start with $ Femap Property i : (where i is replaced with the property number the label is referencing) followed by the component name. No spaces are allowed within the component name. An example of this format is provided below:

$ Femap Property 1 : Plate
PSHELL         1       1      .1       1               1              0.
$ Femap Property 2 : Stiffener
PSHELL         2       1      .1       1               1              0.

Patran component label format

In the Patran format, the component label is appended as a string comment above each property card. The string comment should start with $ Elements and Element Properties for region : followed by the component name. An example of this format is provided below:

$ Elements and Element Properties for region : rod_1
PROD           1       1      .1
CROD           1       1    3600    3310
CROD           2       1    3310    3320
$ Elements and Element Properties for region : rod_2
PROD           2       1      .2
CROD           3       2    6600    6310
CROD           4       2    6310    6320

HyperMesh component label format

In the HyperMesh format, the component label is appended as a string comment above each property card. The string comment should start with $HMNAME PROP                   i (where i is replaced with the property number the label is referencing) followed by the component name in double quotes. Any other comment lines above the property card (ex. $HWCOLOR PROP...) will be ignored by the mesh loader. An example of this format is provided below:

$HMNAME PROP                   1"Rib1" 4
$HWCOLOR PROP                  1      28
PSHELL         1       0               0               0
$
$HMNAME PROP                   2"Rib2" 4
$HWCOLOR PROP                  2      29
PSHELL         2       0               0               0

API Reference

class tacs.pytacs.pyTACS(bdf, comm=None, dvNum=0, scaleList=None, options=None)[source]

The class for working with a TACS structure

Parameters:
  • bdf (str or pyNastran.bdf.bdf.BDF) -- The BDF file or a pyNastran BDF object to load.

  • comm (mpi4py.MPI.Intracomm) -- The comm object on which to create the pyTACS object.

  • dvNum (int) -- A user-supplied offset to the design variable numbering. This is typically used with tacs+tripan when geometric variables have already been added and assigned global tacs numberings.

  • scaleList (list) -- when dvNum is non-zero, the scaleList must be same size as the number of design variables already added. i.e. len(scaleList) = dvNum

  • options (dict) -- Dictionary holding model-specific option parameters (case-insensitive).

property isNonlinear

The public interface for the isNonlinear attribute. Implemented as a property so that it is read-only.

addGlobalDV(descript, value, lower=None, upper=None, scale=1.0)[source]

Add a global design variable that can affect multiple components.

This function allows adding design variables that are not cleanly associated with a particular constitutive object. One example is the pitch of the stiffeners for blade-stiffened panels. It is often the same for many different constitutive objects. By calling this function, the internal dvNum counter is incremented, and the user doesn't have to worry about it.

Parameters:
  • descript (str) -- A user-supplied string that can be used to retrieve the variable number and value elemCallBackFunction.

  • value (float) -- Initial value for variable.

  • lower (float) -- Lower bound. This may be None for unbounded

  • upper (float) -- Upper bound. This may be None for unbounded

  • scale (float) -- Scale factor for variable

getGlobalDVs()[source]

Return dict holding info about all current global DVs.

Returns:

globalDVs -- Dictionary holding global dv information.

Return type:

dict

getGlobalDVKeys()[source]

Get key names for all current global DVs.

Returns:

globalDVKeys -- List holding global dv names.

Return type:

list[str]

getGlobalDVNums()[source]

Get the dv nums corresponding to global DVs.

Returns:

globalDVNums -- List holding dv nums corresponding to global DVs.

Return type:

list[int]

getTotalNumGlobalDVs()[source]

Get the total number of global DVs across all processors.

Returns:

globalDVs -- Dictionary holding global dv information.

Return type:

dict

assignMassDV(descript, eIDs, dvName='m')[source]

Assign a global DV to a point mass element.

Parameters:
  • descript (str) -- Global DV key to assign mass design variable to. If the key is does not exist, it will automatically be created and added to global DVs.

  • eIDs (int or list[int]) -- Element IDs of concentrated mass to assign DV to (NASTRAN ordering)

  • dvName (str) -- Name of mass property to apply DV to. May be m for mass, I11, I22, I12, etc. for moment of inertia components. Defaults to m (mass).

Notes

Currently only CONM2 cards are supported.

selectCompIDs(include=None, exclude=None, includeBounds=None, nGroup=1, includeOp='or', excludeOp='or', projectVector=None, **kwargs)[source]

This is the most important function of the entire setup process. The basic idea is as follows: We have a list of nComp which are the component descriptions. What we need is a way of generating subgroups of these for the purposes of adding design variables, constitutive objects, KS domains, and mass domains. All of these operations boil down to selecting a subset of the compIDs.

This function attempts to support as many ways as possible to select parts of the structure. Easy and efficient selection of parts is critical to the end user.

Methods of selection:

1. include, integer, string, list of integers and/or strings: The simplest and most direct way of selecting a component. The user supplies the index of the componentID, a name or partial name, or a list containing a combination of both.

For example:

# Select the 11th component
selectCompIDs(include=10)

# Select the first and fifth component
selectCompIDs(include=[0, 4])

# Select any component containing 'rib.00'
selectCompIDs(include='rib.00')

# Select any components containing 'rib.00' and 'rib.10'
selectCompIDs(include=['rib.00', 'rib.10'])

# Select any component containing 'rib.00', the 11th
# component and any component containing 'spar'
# (This is probably not advisable!)
selectCompIDs(include=['rib.00', 10, 'spar'])

2. Exclude, operates similarly to 'include'. The behaviour of exclude is identical to include above, except that component ID's that are found using 'exclude' are 'subtracted' from those found using include. A special case is treated if 'include' is NOT given: if only an exclude list is given, this implies the selection of all compID's EXCEPT the those in exclude.

For example:

# This will return will [0, 1, 2, 3, 5, ..., nComp-1]
selectCompIDs(exclude = 4)

# This will return [0, 1, 4, 5, ..., nComp-1]
selectCompIDs(exclude = [2, 3]) will return

# This will return components that have 'ribs' in the
# component ID, but not those that have 'le_ribs' in the
# component id.
selectCompIDs(include='ribs', exclude='le_ribs')

3. includeBounds, list of components defining a region inside which 'include' components will be selected. This functionality uses a geometric approach to select the compIDs. All components within the project 2D convex hull are included. Therefore, it is essential to split up concave include regions into smaller convex regions. Use multiple calls to selectCompIDs to accumulate multiple regions.

For example:

# This will select upper skin components between the
# leading and trailing edge spars and between ribs 1 and 4.
selectCompIDs(include='U_SKIN', includeBound=
    ['LE_SPAR', 'TE_SPAR', 'RIB.01', 'RIB.04'])

4. nGroup: The number of groups to divide the found components into. Generally this will be 1. However, in certain cases, it is convenient to create multiple groups in one pass.

For example:

# This will 'evenly' create 10 groups on all components
# containing LE_SPAR.
Note that once the components are
# selected, they are sorted **alphabetically** and assigned
# sequentially.
selectCompIDs(include='LE_SPAR', nGroup=10)

nGroup can also be negative. If it is negative, then a single design variable group is added to each of the found components.

For example:

# will select all components and assign a design variable
# group to each one.
selectCompIDs(nGroup=-1)

includeOp, str: 'and' or 'or'. Selects the logical operation used for item in 'include' option. For example:

selectCompIDs(include=['LE_SPAR', 'TE_SPAR'], includeOpt='or') will select the LE_SPAR and TE_SPAR components (default behaviour).

selectCompIDs(include=['RIB', 'SEG.01'], includeOpt='and') will select any component with 'RIB' in the description AND 'SEG.01' in the description.

getBDFInfo()[source]

Return a pynastran bdf object. This object can be used interactively to parse information (nodes, elements, loads, etc.) included in the bdf file.

Returns:

bdfInfo -- pyNastran bdf object.

Return type:

pyNastran.bdf.bdf.BDF

getCompNames(compIDs=None)[source]

Return a list of component descriptions for the given component IDs. compIDs should come from a call to selectCompIDs

Parameters:

compIDs (int or list[int] or None) -- List of integers containing the compIDs numbers. If None, returns names for all components. Defaults to None.

Returns:

compDescript -- List of strings containing the names of the corresponding compIDs

Return type:

list[str]

getGlobalNodeIDsForComps(compIDs, nastranOrdering=False)[source]

Return the global (non-partitioned) node IDs belonging to a given list of component IDs

Parameters:
  • compIDs (int or list[int] or None) -- List of integers containing the compIDs numbers. If None, returns nodeIDs for all components. Defaults to None.

  • nastranOrdering (bool) -- Flag signaling whether nodeIDs are in TACS (default) or NASTRAN (grid IDs in bdf file) ordering Defaults to False.

Returns:

nodeIDs -- List of unique nodeIDs that belong to the given list of compIDs

Return type:

list[int]

getLocalNodeIDsForComps(compIDs)[source]

Return the local (partitioned) node IDs belonging to a given list of component IDs

Parameters:

compIDs (int or list[int] or None) -- List of integers containing the compIDs numbers. If None, returns nodeIDs for all components. Defaults to None.

Returns:

nodeIDs -- List of unique nodeIDs that belong to the given list of compIDs

Return type:

list[int]

getLocalNodeIDsFromGlobal(globalIDs, nastranOrdering=False)[source]

Given a list of node IDs in global (non-partitioned) ordering returns the local (partitioned) node IDs on each processor. If a requested node is not included on this processor, an entry of -1 will be returned.

Parameters:
  • globalIDs (int or list[int]) -- List of global node IDs.

  • nastranOrdering (bool) -- Flag signaling whether globalIDs is in TACS (default) or NASTRAN (grid IDs in bdf file) ordering Defaults to False.

Returns:

localIDs -- List of local node IDs for each entry in globalIDs. If the node is not owned by this processor, its index is filled with a value of -1.

Return type:

list[int]

initialize(elemCallBack=None)[source]

This is the 'last' method to be called during the setup. The user should have already added all the design variables, domains, etc. Before this function is called. This function finalizes the problem initialization and cannot be changed at later time. If the user does not provide an elemCallBack function, we will use pyNastran to generate one automatically from element properties provided in the BDF file.

Parameters:

elemCallBack (collections.abc.Callable or None) --

The calling sequence for elemCallBack must be as follows:

def elemCallBack(dvNum, compID, compDescript, elemDescripts,
                globalDVs, **kwargs):

The dvNum is the current counter which must be used by the user when creating a constitutive object with design variables.

compID is the ID number used by tacs to reference this property group. Use kwargs['propID'] to get the corresponding Nastran property ID that is read in from the BDF.

compDescript is the component description label read in from optional formatted comments in BDF file

elemDescripts are the name of the elements belonging to this group (e.g. CQUAD4, CTRIA3, CTETRA, etc). This value will be a list since one component may contain multiple compatible element types. Example: ['CQUAD4', CTRIA3']

globalDVs is a dictionary containing information about any global DVs that have been added.

elemCallBack must return a list containing as many TACS element objects as there are element types in elemDescripts (one for each).

getOrigDesignVars()[source]

get the original design variables that were specified with during assembler creation.

Returns:

x -- The original design variable vector set in tacs.

Return type:

numpy.ndarray

getDesignVarRange()[source]

get the lower/upper bounds for the design variables.

Returns:

  • xlb (numpy.ndarray) -- The design variable lower bound.

  • xub (numpy.ndarray) -- The design variable upper bound.

createDesignVec(asBVec=False)[source]

Create a new tacs distributed design vector. Values are initialized to zero.

Parameters:

asBVec (bool) -- Flag that determines whether to return design vector as tacs Vec (True) or numpy array (False). Defaults to False.

Returns:

x -- Distributed design variable vector

Return type:

numpy.ndarray or tacs.TACS.Vec

getNumDesignVars()[source]

Return the number of design variables on this processor.

Returns:

ndvs -- Number of design variables on this processor.

Return type:

int

getTotalNumDesignVars()[source]

Return the number of design variables across all processors.

Returns:

ndvs -- Total number of design variables across all processors.

Return type:

int

getOrigNodes()[source]

Return the original mesh coordinates read in from the meshLoader.

Returns:

coords -- Structural coordinate in array of size (N * 3) where N is the number of structural nodes on this processor.

Return type:

numpy.ndarray

createNodeVec(asBVec=False)[source]

Create a new tacs distributed node vector. Values are initialized to zero.

Parameters:

asBVec (bool) -- Flag that determines whether to return node vector as tacs Vec (True) or numpy array (False). Defaults to False.

Returns:

xpts -- Distributed node coordinate vector

Return type:

numpy.ndarray or tacs.TACS.Vec

getNumOwnedNodes()[source]

Get the number of nodes owned by this processor.

Returns:

nNodes -- Number of nodes owned by this proc.

Return type:

int

getNumOwnedMultiplierNodes()[source]

Get the number of lagrange multiplier nodes owned by this processor.

Returns:

nMultNodes -- Number of multiplier nodes owned by this proc.

Return type:

int

getLocalMultiplierNodeIDs()[source]

Get the tacs indices of multiplier nodes used to hold lagrange multipliers on this processor.

Returns:

nodeIDs -- List of multiplier node ID's owned by this proc.

Return type:

list[int]

createVec(asBVec=False)[source]

Create a new tacs distributed state variable vector. Values are initialized to zero.

Parameters:

asBVec (bool) -- Flag that determines whether to return state vector as tacs Vec (True) or numpy array (False). Defaults to False.

Returns:

vars -- Distributed state variable vector

Return type:

numpy.ndarray or tacs.TACS.Vec

getVarsPerNode()[source]

Get the number of variables per node for the model.

Returns:

vpn -- Number of variables per node.

Return type:

int

applyBCsToVec(vec)[source]

Applies zeros to boundary condition DOFs in input vector.

Parameters:

vec (numpy.ndarray or tacs.TACS.Vec) -- Vector to apply boundary conditions to.

setBCsInVec(vec)[source]

Sets dirichlet boundary condition values in the input vector.

Parameters:

vec (numpy.ndarray or tacs.TACS.Vec) -- Vector to set boundary conditions in.

createStaticProblem(name, options=None)[source]

Create a new staticProblem for modeling a static load cases. This object can be used to set loads, evalFunctions as well as perform solutions and sensitivities related to static problems

Parameters:
  • name (str) -- Name to assign problem.

  • options (dict) -- Problem-specific options to pass to StaticProblem instance (case-insensitive). Defaults to None.

Returns:

problem -- StaticProblem object used for modeling and solving static cases.

Return type:

tacs.problems.StaticProblem

createTransientProblem(name, tInit, tFinal, numSteps, options=None)[source]

Create a new TransientProblem for modeling a transient load cases. This object can be used to set loads, evalFunctions as well as perform solutions and sensitivities related to transient problems

Parameters:
  • name (str) -- Name to assign problem.

  • tInit (float) -- Starting time for transient time integration

  • tFinal (float) -- Ending time for transient time integration

  • numSteps (int) -- Number of time steps for transient time integration

  • options (dict) -- Problem-specific options to pass to TransientProblem instance (case-insensitive). Defaults to None.

Returns:

problem -- TransientProblem object used for modeling and solving transient cases.

Return type:

tacs.problems.TransientProblem

createModalProblem(name, sigma, numEigs, options=None)[source]

Create a new ModalProblem for performing modal analysis. This problem can be used to identify the natural frequencies and mode shapes of the model through eigenvalue analysis.

Parameters:
  • name (str) -- Name to assign problem.

  • sigma (float) -- Guess for the lowest eigenvalue. This corresponds to the lowest expected frequency squared. (rad^2/s^2)

  • numEigs (int) -- Number of eigenvalues to solve for.

  • options (dict) -- Problem-specific options to pass to ModalProblem instance (case-insensitive). Defaults to None.

Returns:

problem -- ModalProblem object used for performing modal eigenvalue analysis.

Return type:

tacs.problems.ModalProblem

createBucklingProblem(name, sigma, numEigs, options=None)[source]

Create a new BucklingProblem for performing linearized buckling analysis. This problem can be used to identify the buckling load factors and mode shapes of the model through eigenvalue analysis.

Parameters:
  • name (str) -- Name to assign problem.

  • sigma (float) -- Guess for the lowest eigenvalue. This corresponds to the lowest expected buckling load factor.

  • numEigs (int) -- Number of eigenvalues to solve for.

  • options (dict) -- Problem-specific options to pass to ModalProblem instance (case-insensitive). Defaults to None.

Returns:

problem -- BucklingProblem object used for performing buckling eigenvalue analysis.

Return type:

tacs.problems.BucklingProblem

createTACSProbsFromBDF()[source]

Automatically define tacs problem classes with loads using information contained in BDF file. This function assumes all loads are specified in the BDF and allows users to skip setting loads in Python.

Returns:

structProblems -- Dictionary containing a predefined TACSProblem for every loadcase found in the BDF. The dictionary keys are the loadcase IDs from the BDF.

Return type:

dict[int, tacs.problems.TACSProblem]

Notes

Currently only supports LOAD, FORCE, MOMENT, GRAV, RFORCE, PLOAD2, PLOAD4, TLOAD1, TLOAD2, and DLOAD cards. Currently only supports staticProblem (SOL 101), transientProblem (SOL 109), and modalProblems (SOL 103)

writeBDF(fileName, problems)[source]

Write NASTRAN BDF file from problem class. Assumes all supplied Problems share the same nodal and design variable values.

NOTE: Only supports writing loads from StaticProblem types.

Parameters:
  • fileName (str) -- Name of file to write BDF file to.

  • problems (tacs.problems.TACSProblem or list[tacs.problems.TACSProblem]) -- List of pytacs Problem classes to write BDF file from.

createAdjacencyConstraint(name, options=None)[source]

Create a new AdjacencyConstraint for calculating design variable differences across adjacent components. This constraint can be used to ensure that the design variables do not change too abruptly across components. The formulation is a linear constraint that takes the following form:

c = dv_i - dv_j

Where dv_i and dv_j are two design variables in adjacent components.

Parameters:
  • name (str) -- Name to assign constraint.

  • options (dict) -- Class-specific options to pass to AdjacencyConstraint instance (case-insensitive). Defaults to None.

Returns:

constraint -- AdjacencyConstraint object used for calculating constraints.

Return type:

tacs.constraints.AdjacencyConstraint

createDVConstraint(name, options=None)[source]

Create a new DVConstraint for calculating linear constraints based on design variables within the same component.

The constraints are of the form:

c = a_0 * dv_0 + a_1 * dv_1 + ... + a_n * dv_n

Where which design variables to include (dv_0, dv_1, etc.) and the corresponding weights (a_0, a_1, etc.) are defined by the user.

Parameters:
  • name (str) -- Name to assign constraint.

  • options (dict) -- Class-specific options to pass to DVConstraint instance (case-insensitive). Defaults to None.

Returns:

constraint -- DVConstraint object used for calculating constraints.

Return type:

tacs.constraints.DVConstraint

createPanelLengthConstraint(name, options=None)[source]

Create a new PanelLengthConstraint for enforcing that the panel length DV values passed to components match the actual panel lengths.

Parameters:
  • name (str) -- Name to assign constraint.

  • options (dict) -- Class-specific options to pass to DVConstraint instance (case-insensitive).

Returns:

constraint -- PanelLengthConstraint object used for calculating constraints.

Return type:

tacs.constraints.PanelLengthConstraint

createPanelWidthConstraint(name, options=None)[source]

Create a new PanelWidthConstraint for enforcing that the panel width DV values passed to components match the actual panel widths.

Parameters:
  • name (str) -- Name to assign constraint.

  • options (dict) -- Class-specific options to pass to DVConstraint instance (case-insensitive).

Returns:

constraint -- PanelWidthConstraint object used for calculating constraints.

Return type:

tacs.constraints.{PanelWidthConstraint}

createVolumeConstraint(name, options=None)[source]

Create a new VolumeConstraint for constraining the size of a closed volume. Only shell and solid elements are supported for this constraint. For shell elements, the enclosed volume MUST be manifold and water-tight (no missing/internal faces). The formulation is a nonlinear constraint based on the nodal coordinates.

A common example of this is ensuring enough volume in the wingbox for fuel:

vol_wing >= vol_fuel

Parameters:
  • name (str) -- Name to assign constraint.

  • options (dict) -- Class-specific options to pass to VolumeConstraint instance (case-insensitive). Defaults to None.

Returns:

constraint -- VolumeConstraint object used for calculating constraints.

Return type:

tacs.constraints.VolumeConstraint

getNumComponents()[source]

Return number of components (property) groups found in bdf.

Returns:

nComp -- Number of components in model

Return type:

int

dtype

alias of float64

getOption(name)

Get a solver option value. The name is not case sensitive.

Parameters:

name (str) -- Name of option to get

classmethod printDefaultOptions()

Prints a nicely formatted dictionary of all the default solver options to the stdout

printModifiedOptions()

Prints a nicely formatted table of all the options that have been modified from their defaults

printOptions()

Prints a nicely formatted dictionary of all the current solver options to the stdout on the root processor

setOption(name, value)

Set a solver option value. The name is not case sensitive.

Parameters:
  • name (str) -- Name of option to modify

  • value (depends on option) -- New option value to set

setOptions(options)

Set multiple solver options at once. The names are not case sensitive.

Parameters:

options (dict) -- Dictionary of option names and values to set