ABC for Auxetic Structures

class pyauxetic.classes.auxetic_structure.AuxeticStructure(model, name, loading_params)

Abstract base class for defining an auxetic structure. It defines the core behavior and must be subclassed for structures using different unit cells.

The following methods must be called in this exact order:

__init__(model, name, loading_params)

Initialize the auxetic structure.

Child classes must define the following and class variables and then call this constructor:

  • pretty_name

  • is_solid

  • is_shell

  • is_bulk

  • is_planar

  • is_tubular

  • unit_cell_class

Parameters
  • model (Model) – Abaqus Model object in which the auxetic structure will be created.

  • name (str) – Name of the structure. It will be used for all related files.

  • loading_params (LoadingParams) – Special namedtuple describing the loading and boundary conditions applied to the model. Here, loading_params.direction is used for determining positioning of loading ribbons.

abstract assemble_structure(for_3dprint=False, output_params=None, delete_all=True)

Assemble one or more unit cells according to pattern parameters to create the auxetic structure. add_pattern_params() must be called before this.

This function must be defined by each child class of AuxeticStructure

Parameters
  • for_3dprint (bool) – If True, the structure will be a 3D part suitable for export, Otherwise dimensionality will be governed by the structure. Defaults to False.

  • output_params (OutputParams) – Special namedtuple describing the parameters for outputting the results of modeling and analysis. See class for full description of options. Here, output_params.export_extrusion_depth it is used for deteriming ribbon_extrusion_depth. If for_3dprint is False, this need not be passed. Defaults to None.

  • delete_all (bool) – If True, all useless parts will be deleted. Defaults to True.

add_pattern_params(pattern_params)

Add the parameters used by assemble_structure() for assembling the structure.

Parameters

pattern_params (PatternParams) – Special namedtuple describing the parameters for patterning the unit cell(s). See class for full description of options.

add_unit_cells(unit_cell_params)

Add one or more unit cells to the auxetic structure.

Parameters

unit_cell_params – Special namedtuple describing the unit cell geometry. The namedtuple must be selected from classes.auxetic_unit_cell_params based on the type of structure. For nonuniform structures, must be a tuple where all unit cell ids used in self.structure_map are defined.

Raises
  • RuntimeError – If add_pattern_params() has already been called.

  • ValueError – If unit_cell_params is invalid.

  • ValueError – If unit_cell_params contains repeated or non-positive ids.

  • ValueError – If unit_cell_params contains more than one value for extrusion_depth or it’s non-positive (planar structures only).

get_unit_cell_by_id(id)

Return a unit cell in the structure based on its id.

Parameters

id (int) – Unique numeric ID of the unit cell.

Returns

The unit cell whose id is specified.

Raises

ValueError – If the unit cell does not exist.

assign_material(material_params)

Assign material properties to the auxetic structure.

Note that material_params.material_data is not validated. Duck-Typing is used for calling the API and some errors are caught by the API itself, but ultimately any bad values are carried to the CAE model.

Parameters

material_params (MaterialParams) – Special namedtuple describing the material used for modeling and analysis. See class for full description of options.

Raises
  • ValueError – If material_params.hyperelastic is invalid.

  • ValueError – If material_params.hyperelastic is invalid.

  • AbaqusException – Various exceptions raised by the Abaqus API.

define_step(step_params=None)

Define a single step for the analysis. Currently, only static general steps are supported. The step is named ‘Step-1’, but this name is not hard-coded elsewhere. Also, the nonlinear geometry (NLGEOM) parameter is always turned on.

Parameters

step_params (StepParams) – Special namedtuple describing the step defined for analysis. If not specified, the default values of the namedtuple are used. Also, validation of values is done by Abaqus API. See class for full description of options.

Raises

AbaqusException – Various exceptions raised by the Abaqus API.

define_bcs(loading_params)

Apply loads and boundary conditions (BCs) to the structure. This function must be called after define_step(). It then calls _perpare_for_loading() and afterwards defines the following BCs:

  • An Encastre BC (fixed in all 6 directions) is applied from the initial step on the reference point self.loading_rps[0], which is coupled to ‘LD-Edge-1’.

  • A second load/BC is applied from the single loading step of the model based on on the reference point self.loading_rps[1], which is coupled to ‘LD-Edge-2’. This load/BC is governed by loading_params and currently can be one of the following:

    • Uniaxial monotonic displacement BC.

Parameters

loading_params (LoadingParams) – Special namedtuple describing the loading and and boundary conditions applied to the model. See class for full description of options.

Raises
  • RuntimeError – If the number of steps in the model is not exactly 2.

  • ValueError – If material_params.material_type is invalid.

  • AbaqusException – Various exceptions raised by the Abaqus API.

mesh_part(mesh_params)

Mesh the model.

The following functions are used in succession:

  • seedPart(): deviationFactor and minSizeFactor are set to 0.1 and constraint is not supported.

  • setMeshControls(): The following parameters are not supported: technique, algorithm, minTransition, sizeGrowth, allowMapped.

  • setElementType(): The following constraints exist:

    • region is set to all faces/cells of the structure.

    • The elemTypes tuple is determined by mesh_params.elem_code and mesh_params.elem_library.

Parameters

mesh_params (MeshParams) – Special namedtuple describing the mesh applied to the model. See class for full description of options.

Raises
  • ValueError – If mesh_params.elem_shape is invalid.

  • ValueError – If mesh_params.elem_shape does not correspond to the structure’s dimensionality.

  • ValueError – If mesh_params.elem_library is invalid.

  • ValueError – If *mesh_params.elem_code is invalid.

  • KeyError – If mesh_params.elem_code does not correspond to a SymbolicConstant.

  • ValueError – If mesh_params.elem_code does not correspond to an element.

  • AbaqusException – Various exceptions raised by the Abaqus API.

create_job(job_params)

Define a single step for the analysis. Assigns self.job. Current limitations are:

  • numDomains is set to numCpus.

  • numGPUs is set to 0.

  • User subroutine are not supported.

Parameters

job_params (JobParams) – Special namedtuple describing the job created for analysis. See class for full description of options.

Raises

AbaqusException – Various exceptions raised by the Abaqus API.

submit_job()

Submit the job and wait for it to finish. Does not clean old files, but they should not be a problem.

Raises
  • RuntimeError – If the job has not been defined by create_job().

  • RuntimeError – If the job does not complete successfuly.

  • AbaqusException – Various exceptions raised by the Abaqus API.

output_results(output_params)

Output the results of the analysis.

Parameters

output_params (OutputParams) – Special namedtuple describing the parameters for outputting the results of modeling and analysis. See class for full description of options.

Raises
  • RuntimeError – If the job has not been completed.

  • ValueError – If output_params.export_ribbon_width has not been specified but STL or STP export is requested.

  • AbaqusException – Various exceptions raised by the Abaqus API.