functions module

There are several structural functions built into TACS. All of them can be found in the tacs.functions module. These functions and their gradients with respect to design variables can be evaluated by the Assembler object. These functions inherit from the Function class. Each class should only ever be passed to a single instance of TACS. If the function needs to be calculated for separate instances, this should be handled by separate instances of function. The current available function in TACS:

class tacs.functions.AverageTemperature

Bases: Function

Evaluate the spatial average of the temperature of the model.

Parameters:
  • assembler (Assembler) -- TACS Assembler object that will evaluating this function.

  • volume (float, optional) -- Normalization factor used in averaging process. Defaults to 1.0.

class tacs.functions.CenterOfMass

Bases: Function

Evaluates the center of mass of the elements along specified axis.

Warning

This function is only appropriate for static analyses and may give inconsistent results for transient problems.

Parameters:
  • assembler (Assembler) -- TACS Assembler object that will evaluating this function.

  • direction (array-like[double], optional) -- 3d vector specifying which direction to project cg position onto (keyword argument). Defaults to [0.0, 0.0, 0.0].

class tacs.functions.Compliance

Bases: Function

Evaluate the compliance of the structure.

This evaluates the compliance within the structure based on an integration of the strain energy in each element, not by the product of the load vector with the displacement.

Parameters:

assembler (Assembler) -- TACS Assembler object that will evaluating this function.

setComplianceType(compliance_type)

Set the type of compliance value to use

class tacs.functions.EnclosedVolume

Bases: Function

Evaluates the volume enclosed by the elements.

Parameters:

assembler (Assembler) -- TACS Assembler object that will evaluating this function.

class tacs.functions.KSDisplacement

Bases: Function

The following class implements the methods to calculate the Kreisselmeier–Steinhauser (KS) aggregation of the displacement in a particular direction over the domain of some finite element model. The KS aggregation gives a smooth and differentiable approximation to the maximum value.

Parameters:
  • assembler (Assembler) -- TACS Assembler object that will evaluating this function.

  • ksWeight (float, optional) -- The ks weight used in the calculation (keyword argument). Defaults to 80.0.

  • direction (array-like[double], optional) -- 3d vector specifying which direction to project displacements in for KS aggregation (keyword argument). Defaults to [0.0, 0.0, 0.0].

  • ftype (str, optional) -- The type of KS aggregation to be used (keyword argument). Accepted inputs are: 'discrete', 'continuous', 'pnorm-discrete', and 'pnorm-continuous'. Case-insensitive, defaults to 'continuous'.

class tacs.functions.KSFailure

Bases: Function

The following class implements the methods necessary to calculate the Kreisselmeier–Steinhauser (KS) aggregation of either a stress or strain failure criteria over the domain of some finite element model. The KS aggregation gives a smooth and differentiable approximation to the maximum value.

The failure load is calculated using the strain-based failure criteria from the base Constitutive class which requires linear and constant components of the strain to determine the failure load.

For most elements, unity is generally considered to be the threshold value for failure. Meaning if this function returns a value > 1.0, at least one of the elements has exceeded its strength criteria. While values < 1.0 implies all elements are within their strength criteria.

Parameters:
  • assembler (Assembler) -- TACS Assembler object that will evaluating this function.

  • ksWeight (float, optional) -- The ks weight used in the calculation (keyword argument). Defaults to 80.0.

  • safetyFactor (float, optional) -- The safety factor to apply to loads before computing the failure (keyword argument). Defaults to 1.0.

  • ftype (str, optional) -- The type of KS aggregation to be used (keyword argument). Accepted inputs are: 'discrete', 'continuous', 'pnorm-discrete', and 'pnorm-continuous'. Case-insensitive, defaults to 'continuous'.

class tacs.functions.KSTemperature

Bases: Function

The following class implements the methods necessary to calculate the Kreisselmeier–Steinhauser (KS) aggregation of temperature over the domain of some finite element model. The KS aggregation gives a smooth and differentiable approximation to the maximum value.

Parameters:
  • assembler (Assembler) -- TACS Assembler object that will evaluating this function.

  • ksWeight (float, optional) -- The ks weight used in the calculation (keyword argument). Defaults to 80.0.

  • ftype (str, optional) -- The type of KS aggregation to be used (keyword argument). Accepted inputs are: 'discrete', 'continuous', 'pnorm-discrete', and 'pnorm-continuous'. Case-insensitive, defaults to 'continuous'.

class tacs.functions.MomentOfInertia

Bases: Function

Evaluates the moment of inertia of the elements about origin or center of mass projected onto two input vectors:

I_out = vec1^T * I_tensor * vec2

Where I_tensor is the moment of inertia tensor in the global axis given below:

Ixx Ixy Ixz
Iyx Iyy Iyz
Izx Izy Izz

Note

TACS uses a negative sign convention in the product of inertia definition, for example:

Ixy = -int[x * y * dm]

The moments of inertia are always positive, as usual:

Ixx = int[(y^2 + z^2) * dm]

Warning

This function is only appropriate for static analyses and may give inconsistent results for transient problems.

Parameters:
  • assembler (Assembler) -- TACS Assembler object that will evaluating this function.

  • direction1 (array-like[double], optional) -- 3d vector specifying first direction to project moment of inertia tensor onto (keyword argument). Defaults to [0.0, 0.0, 0.0].

  • direction2 (array-like[double], optional) -- 3d vector specifying second direction to project moment of inertia tensor onto (keyword argument). Defaults to [0.0, 0.0, 0.0].

  • aboutCM (bool) -- Flag specifying whether moment of inertia should be taken about origin (False) or center of mass (True) (keyword argument). Defaults to False.

class tacs.functions.StructuralMass

Bases: Function

Evaluates the structural mass of the elements.

Parameters:

assembler (Assembler) -- TACS Assembler object that will evaluating this function.