write_abaqus module

class write_abaqus.AbaqusWriter(cfg, mesh_dir: Path, model_name: str, nodes: dict[int, list[float]], elms: dict[int, list[int]], centroids_cort: dict[int, list[float]], centroids_trab: dict[int, list[float]], m_cort_np: ndarray, m_trab_np: ndarray, RHOc: ndarray, RHOt: ndarray, PHIc: ndarray, PHIt: ndarray, mm_cort: ndarray, mm_trab: ndarray, topnodes: dict[int, int], botnodes: dict[int, int], RP_tag: int, RP_coords: list[float], NLGEOM: str, STEP_INC: int = 1000, PARAM_FLAG: int = 2, DENSIFICATOR_FLAG: int = 0, VISCOSITY_FLAG: int = 0, POSTYIELD_FLAG: int = 0)[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'write_abaqus', '__init__': <function AbaqusWriter.__init__>, '_write_header': <function AbaqusWriter._write_header>, '_write_parts': <function AbaqusWriter._write_parts>, '_write_nodes': <function AbaqusWriter._write_nodes>, '_get_depvars': <function AbaqusWriter._get_depvars>, '_write_elset': <function AbaqusWriter._write_elset>, '_set_orientation': <function AbaqusWriter._set_orientation>, '_set_orientation_new': <function AbaqusWriter._set_orientation_new>, '_write_orientation': <function AbaqusWriter._write_orientation>, '_write_section': <function AbaqusWriter._write_section>, '_write_elms': <function AbaqusWriter._write_elms>, '_write_material': <function AbaqusWriter._write_material>, '_write_boundary_conditions': <function AbaqusWriter._write_boundary_conditions>, '_write_ref_node': <function AbaqusWriter._write_ref_node>, '_write_nset': <function AbaqusWriter._write_nset>, '_write_kin_coupling': <function AbaqusWriter._write_kin_coupling>, '_write_step': <function AbaqusWriter._write_step>, '_write_output': <function AbaqusWriter._write_output>, '_write_output_history': <function AbaqusWriter._write_output_history>, '_write_boundary_conditions_rp': <function AbaqusWriter._write_boundary_conditions_rp>, 'abq_part': <function AbaqusWriter.abq_part>, 'abq_assembly': <function AbaqusWriter.abq_assembly>, 'abq_model': <function AbaqusWriter.abq_model>, 'abq_history': <function AbaqusWriter.abq_history>, 'abaqus_writer': <function timefunc.<locals>.wrapper>, 'abq_dictionary': <function AbaqusWriter.abq_dictionary>, '__dict__': <attribute '__dict__' of 'AbaqusWriter' objects>, '__weakref__': <attribute '__weakref__' of 'AbaqusWriter' objects>, '__doc__': None, '__annotations__': {}})
__init__(cfg, mesh_dir: Path, model_name: str, nodes: dict[int, list[float]], elms: dict[int, list[int]], centroids_cort: dict[int, list[float]], centroids_trab: dict[int, list[float]], m_cort_np: ndarray, m_trab_np: ndarray, RHOc: ndarray, RHOt: ndarray, PHIc: ndarray, PHIt: ndarray, mm_cort: ndarray, mm_trab: ndarray, topnodes: dict[int, int], botnodes: dict[int, int], RP_tag: int, RP_coords: list[float], NLGEOM: str, STEP_INC: int = 1000, PARAM_FLAG: int = 2, DENSIFICATOR_FLAG: int = 0, VISCOSITY_FLAG: int = 0, POSTYIELD_FLAG: int = 0)[source]

Initializes an instance of the AbaqusWriter class.

Args: - config: Dictionary containing the configuration parameters for the whole pipeline. - mesh_dir: Path to the directory containing the mesh files. - model_name: a string containing the name of the model. # ! to be substituted with the name coming from the config - nodes: a dictionary containing the node IDs and their corresponding coordinates. - elms: a dictionary containing the element IDs and their corresponding node IDs. - centroids: a dictionary containing the element IDs and their corresponding centroids. - botnodes: a dictionary containing the bottom nodes of the model. - topnodes: a dictionary containing the top nodes of the model. - RP_tag: an integer representing the tag of the reference point. - RP_coords: a list containing the coordinates of the reference point. - NLGEOM: a string indicating whether or not to use non-linear geometry. - STEP_INC: an integer representing the step increment for the simulation. - PARAM_FLAG: an integer representing the parameter selection (0: TRABECULAR BONE ISOTROPIC, 1: TRABECULAR BONE TRANSVERSELY ISOTROPIC, 2: TRABECULAR BONE FABRIC-BASED ORTHOTROPIC, 3: COMPACT BONE ISOTROPIC, 4: COMPACT BONE TRANSVERSELY ISOTROPIC) - DENSIFICATOR_FLAG: an integer activating the densificator in the UMAT (0: off, 1: on) - VISCOSITY_FLAG: an integer representing the viscosity flag (0: RATE-INDEPENDENT, 1: LINEAR VISCOSITY, 2: EXPONENTIAL VISC, 3: LOGARITHMIC VISC, 4: POLYNOMIAL VISC, 5: POWER LAW VISC) - POSTYIELD_FLAG: an integer representing the postyield behaviour (0 - PERFECT PLASTICITY, 1: EXPONENTIAL HARDENING, 2: SIMPLE SOFTENING, 3: EXPONENTIAL SOFTENING, 4: PIECEWISE SOFTENING, 5: LINEAR HARDENING)

__module__ = 'write_abaqus'
__weakref__

list of weak references to the object (if defined)

_get_depvars(nb_depvars=26)[source]

Writes the DEPVAR section of the Abaqus input file.

Args: - nb_depvars: an integer representing the number of dependent variables.

Returns: - A string containing the DEPVAR section of the Abaqus input file.

_set_orientation(orientation: ndarray, centroids: list[float])[source]

Sets the orientation of the element based on the given orientation and centroids. Orientation offset sets the coordinate system at the centroid of the element.

Args: orientation (np.ndarray): The orientation of the element as a 3x3 matrix. centroids (list[float]): The centroids of the element as a list of three floats.

Returns: np.ndarray: The orientation of the element with the centroids added to it.

_set_orientation_new(orientation: ndarray)[source]

Sets the orientation of the element based on the given orientation and centroids. Orientation offset sets the coordinate system at the centroid of the element.

Args: orientation (np.ndarray): The orientation of the element as a 3x3 matrix.

Returns: np.ndarray: The orientation of the element.

_write_boundary_conditions(BC_DEF: list[int], BOTNODES: str)[source]

Returns the Abaqus input file for boundary conditions.

Parameters:
  • BC_DEF (list[int]) – A list containing the boundary condition values.

  • BOTNODES (str) – The name of the bottom nodes.

Returns:

The Abaqus input file for boundary conditions.

Return type:

str

_write_boundary_conditions_rp(RP_TAG: str)[source]

Returns the Abaqus input file for the boundary conditions of a Reference Point.

Parameters:

RP_TAG (str) – The reference point tag.

Returns:

The Abaqus input file for the boundary conditions of a Reference Point.

Return type:

str

_write_elms(elms: dict[int, list[int]]) str[source]

Returns the Abaqus input file for the elements.

Parameters:

elms (dict[int, list[int]]) – A dictionary containing the element IDs and their corresponding node IDs.

Returns:

The Abaqus input file for the elements.

Return type:

str

_write_elset(elms: dict[int, list[int]])[source]

Writes the ELSET section of the Abaqus input file.

Args: - elms: a dictionary containing the element IDs and their corresponding node IDs.

Returns: - A string containing the ELSET section of the Abaqus input file.

_write_header()[source]

Writes the header section of the Abaqus input file.

Returns: - A string containing the header section of the Abaqus input file.

_write_kin_coupling(NSET: str, NODES: str)[source]

Returns the Abaqus input file for a kinematic coupling constraint.

Parameters:
  • NSET (str) – The name of the reference node set.

  • NODES (str) – The name of the nodes set.

Returns:

The Abaqus input file for a kinematic coupling constraint.

Return type:

str

_write_material(abq_dict: dict)[source]

Returns the Abaqus input file for the material properties.

Parameters:

elms (dict[int, list[int]]) – A dictionary containing the element IDs and their corresponding node IDs.

Returns:

The Abaqus input file for the material properties.

Return type:

str

_write_nodes(nodes)[source]

Writes the nodes section of the Abaqus input file.

Args: - nodes: a dictionary containing the node IDs and their corresponding coordinates.

Returns: - A string containing the nodes section of the Abaqus input file.

_write_nset(NSET: str, NSET_DICT: dict[int, int])[source]

Returns the Abaqus input file for a node set.

Parameters:
  • NSET (str) – The name of the node set.

  • NSET_DICT (dict[int, int]) – A dictionary containing the node IDs and their values.

Returns:

A tuple containing the header and values lines of the Abaqus input file for a node set.

Return type:

tuple

_write_orientation(abq_dict: dict[int, list[int]]) str[source]

Writes the orientation definition for each element set in the input dictionary.

Args: - elms (dict[int, list[int]]): A dictionary containing the element sets for each element.

Returns: - orientation (str): A string containing the orientation definition for each element set.

_write_output()[source]

Returns the Abaqus input file for output requests.

Returns:

The Abaqus input file for output requests.

Return type:

str

_write_output_history(REF_NODE: str)[source]

Returns the Abaqus input file for output history of a reference node.

Parameters:

REF_NODE (str) – The reference node.

Returns:

The Abaqus input file for output history of a reference node.

Return type:

str

_write_parts()[source]

Writes the parts section of the Abaqus input file.

Returns: - A string containing the parts section of the Abaqus input file.

_write_ref_node(RP_TAG: int, RP: list[float])[source]

Returns the Abaqus input file for a reference node.

Parameters:
  • RP_TAG (int) – The tag of the reference point.

  • RP (list[float]) – The coordinates of the reference point.

Returns:

The Abaqus input file for a reference node.

Return type:

str

_write_section(elms: dict[int, list[int]]) str[source]

Writes the section definition for each element set in the input dictionary.

Args: - elms (dict[int, list[int]]): A dictionary containing the element sets for each element.

Returns: - section (str): A string containing the section definition for each element set.

_write_step(STEP_INC: int, NLGEOM: str, step_name: str)[source]

Returns the Abaqus input file for a step.

Parameters:
  • STEP_INC (int) – The increment for the step.

  • NLGEOM (str) – The type of geometry for the step.

  • step_name (str) – The name of the step.

Returns:

The Abaqus input file for a step.

Return type:

str

abaqus_writer(**kwargs)[source]
abq_assembly()[source]

Returns information at the assembly level (Assembly + Model Instance).

Returns:

The Abaqus input file for the assembly.

Return type:

str

abq_dictionary(umat_name: str)[source]
abq_history()[source]

Writes the Abaqus input file for the output history.

Returns:

The Abaqus input file for the output history.

Return type:

str

abq_model()[source]

Writes the Abaqus input file for the model.

Returns:

The Abaqus input file for the model.

Return type:

str

abq_part()[source]

Returns information at the part level (Part + Instance).

Returns:

The Abaqus input file for the part.

Return type:

str

write_abaqus.timefunc(func)[source]