hookeai
1.0.0

Getting started

  • Overview
  • Installation

Features

  • Overview
  • Data generation
  • Material model architectures
  • Local material model updating
  • Global material model updating
  • Data analysis and visualization tools
  • Tensorial algebra and matrix operations
  • Other utilities

API

  • Code
    • hookeai.data_generation
    • hookeai.ioput
    • hookeai.material_model_finder
    • hookeai.miscellaneous
    • hookeai.model_architectures
    • hookeai.simulators
      • hookeai.simulators.fetorch
      • hookeai.simulators.links
        • hookeai.simulators.links.discretization
        • hookeai.simulators.links.links
        • hookeai.simulators.links.models
        • hookeai.simulators.links.utilities
    • hookeai.time_series_data
    • hookeai.utilities

License

  • MIT License
hookeai
  • hookeai
  • hookeai.simulators
  • hookeai.simulators.links
  • hookeai.simulators.links.links
  • hookeai.simulators.links.links.LinksSimulator

hookeai.simulators.links.links.LinksSimulator¶

class LinksSimulator(links_bin_path, strain_formulation, analysis_type)[source]¶

Bases: object

Finite element method simulator: Links.

_links_bin_path¶

Links binary absolute path.

Type:

str

_strain_formulation¶

Links strain formulation.

Type:

{‘infinitesimal’, ‘finite’}

_analysis_type¶

Links analysis type.

Type:

{‘plane_stress’, ‘plane_strain’, ‘axisymmetric’, ‘tridimensional’}

_get_n_dim(self)[source]¶

Get number of spatial dimensions from analysis type.

generate_input_data_file(self, filename, directory, patch, patch_material_data, links_input_params=None)[source]¶

Generate Links input data file.

run_links_simulation(self, links_file_path)[source]¶

Run Links simulation.

read_links_simulation_results(self, links_output_directory, results_keywords)[source]¶

Read Links simulation results.

_write_links_input_data_file(self, links_file_path, input_params, node_coords, elements, elements_mat_phase, element_type, n_gauss_points, mesh_elem_material, mat_phases_descriptors, node_displacements)[source]¶

Write Links input data file.

_get_links_default_input_params(self)[source]¶

Get Links default input data file parameters.

_get_links_mesh_data(self, patch, mesh_elem_material)[source]¶

Get Links finite element mesh data.

_get_links_elem_type_data(self, patch)[source]¶

Get Links finite element type data.

_get_links_loading_incrementation(self)[source]¶

Get Links loading incrementation.

remove_mesh_elements(cls, remove_elements_labels, node_coords, elements, elements_mat_phase, node_disps=None, boundary_nodes_labels=None)[source]¶

Remove elements from finite element mesh.

Constructor.

Parameters:
  • links_bin_path (str) – Links binary absolute path.

  • strain_formulation ({'infinitesimal', 'finite'}) – Links strain formulation.

  • analysis_type ({'plane_stress', 'plane_strain', 'axisymmetric', 'tridimensional'}) – Links analysis type.

List of Public Methods

generate_input_data_file

Generate Links input data file.

read_links_simulation_results

Read Links simulation results.

remove_mesh_elements

Remove elements from finite element mesh.

run_links_simulation

Run Links simulation.

Methods

__init__(links_bin_path, strain_formulation, analysis_type)[source]¶

Constructor.

Parameters:
  • links_bin_path (str) – Links binary absolute path.

  • strain_formulation ({'infinitesimal', 'finite'}) – Links strain formulation.

  • analysis_type ({'plane_stress', 'plane_strain', 'axisymmetric', 'tridimensional'}) – Links analysis type.

_get_links_default_input_params()[source]¶

Get Links default input data file parameters.

Returns:

default_parameters – Links input data file default parameters.

Return type:

dict

_get_links_elem_type_data(patch)[source]¶

Get Links finite element type data.

Parameters:

patch (FiniteElementPatch) – Finite element patch.

Returns:

  • element_type (str) – Finite element type.

  • n_gauss_points (int) – Number of Gauss integration points per element.

_get_links_loading_incrementation()[source]¶

Get Links loading incrementation.

Returns:

increm_input_lines – Loading incrementation formatted to Links input data file.

Return type:

list[str]

_get_links_mesh_data(patch, mesh_elem_material)[source]¶

Get Links finite element mesh data.

Parameters:
  • patch (FiniteElementPatch) – Finite element patch.

  • mesh_elem_material (numpy.ndarray(2d or 3d)) – Finite element mesh elements material matrix (numpy.ndarray[int](n_elems_per_dim) where each element corresponds to a given finite element position and whose value is the corresponding material phase (int).

Returns:

  • node_coords (dict) – Coordinates (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]).

  • elements (dict) – Nodes (item, tuple[int]) of each finite element (key, str[int]).

  • elements_mat_phase (dict) – Material phase (item, int) of each finite element (key, str).

_get_n_dim()[source]¶

Get number of spatial dimensions from analysis type.

Returns:

n_dim – Number of spatial dimensions.

Return type:

int

_write_links_input_data_file(links_file_path, input_params, node_coords, elements, elements_mat_phase, element_type, n_gauss_points, mesh_elem_material, mat_phases_descriptors, node_displacements, is_save_increm_file=False)[source]¶

Write Links input data file.

Parameters:
  • links_file_path (str) – Links input data file path.

  • input_params (dict) – Links input data file parameters.

  • node_coords (dict) – Coordinates (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]).

  • elements (dict) – Nodes (item, tuple[int]) of each finite element (key, str[int]).

  • elements_mat_phase (dict) – Material phase (item, int) of each finite element (key, str).

  • element_type (str) – Finite element type.

  • n_gauss_points (int) – Number of Gauss integration points per element.

  • mesh_elem_material (numpy.ndarray(2d or 3d)) – Finite element mesh elements material matrix (numpy.ndarray[int](n_elems_per_dim) where each element corresponds to a given finite element position and whose value is the corresponding material phase (int).

  • mat_phases_descriptors (dict) – Constitutive model descriptors (item, dict) for each material phase (key, str[int])).

  • node_displacements (dict) – Displacements (item, numpy.ndarray(n_dim)) prescribed on each finite element mesh node (key, str[int]). Free degrees of freedom must be set as None.

  • is_save_increm_file (bool, default=False) – If True, then save data file with Links input data file loading incrementation data.

generate_input_data_file(filename, directory, patch, patch_material_data, remove_elements_labels=None, links_input_params=None, is_overwrite_file=False, is_save_increm_file=False, is_verbose=False)[source]¶

Generate Links input data file.

Parameters:
  • filename (str) – Links input data file name.

  • directory (str) – Directory where Links input data file is stored.

  • patch (FiniteElementPatch) – Finite element patch. If is_admissible is False, then returns None.

  • patch_material_data (dict) – Finite element patch material data. Expecting ‘mesh_elem_material’: numpy.ndarray [int](n_elems_per_dim) (finite element mesh elements material matrix where each element corresponds to a given finite element position and whose value is the corresponding material phase (int)) and ‘mat_phases_descriptors’: dict (constitutive model descriptors (item, dict) for each material phase (key, str[int])).

  • remove_elements_labels (tuple[int], default=None) – Finite elements to be removed from finite element mesh.

  • links_input_params (dict, default=None) – Links input data file parameters. If None, default parameters are set.

  • is_overwrite_file (bool, default=False) – Overwrite existing Links input data file if True, otherwise generate non-existent file path by extending the original file path with an integer.

  • is_save_increm_file (bool, default=False) – If True, then save data file with Links input data file loading incrementation data.

  • is_verbose (bool, default=False) – If True, enable verbose output.

Returns:

links_file_path – Links input data file path.

Return type:

str

read_links_simulation_results(links_output_directory, results_keywords, is_verbose=False)[source]¶

Read Links simulation results.

Parameters:
  • links_output_directory (str) – Links simulation output directory.

  • results_keywords (tuple[str]) –

    A list of results to be output among:

    ’node_data’ : numpy.ndarray(3d) of shape (n_nodes, n_data_dim, n_time_steps), where the i-th node output data at the k-th time step is stored in indexes [i, :, k].

    ’global_data’ : numpy.ndarray(3d) of shape (1, n_data_dim, n_time_steps) where the global output data at the k-th time step is stored in [0, :, k].

  • is_verbose (bool, default=False) – If True, enable verbose output.

Returns:

results – Links simulation results for each requested results keyword (key, str).

Return type:

dict

classmethod remove_mesh_elements(remove_elements_labels, node_coords, elements, elements_mat_phase, node_disps=None, boundary_nodes_labels=None)[source]¶

Remove elements from finite element mesh.

Parameters:
  • remove_elements_labels (tuple[int]) – Finite elements to be removed from finite element mesh.

  • node_coords (dict) – Coordinates (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]).

  • elements (dict) – Nodes (item, tuple[int]) of each finite element (key, str[int]).

  • elements_mat_phase (dict) – Material phase (item, int) of each finite element (key, str).

  • node_disps (dict, default=None) – Displacements (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]).

  • boundary_nodes_labels (tuple[int], default=None) – Finite element mesh boundary nodes labels. If provided, then removal of elements that would lead to the removal of a boundary node raises error.

Returns:

  • node_coords (dict) – Coordinates (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]).

  • elements (dict) – Nodes (item, tuple[int]) of each finite element (key, str[int]).

  • elements_mat_phase (dict) – Material phase (item, int) of each finite element (key, str).

  • node_disps (dict) – Displacements (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]). None if displacements are not provided.

run_links_simulation(links_file_path, is_verbose=False)[source]¶

Run Links simulation.

Parameters:

links_file_path (str) – Links input data file path.

Returns:

  • is_success (bool) – True if Links simulation is successfully solved.

  • links_output_directory (str) – Links simulation output directory.

Previous Next

© Copyright 2025, Bernardo Ferreira.

Built with Sphinx using a theme provided by Read the Docs.