IGA-based shape optimization

class yeti_iga.IgaOptimization(iga_model, nb_var, update_function, refinement, d_update_function=None)

An object to handle shape opyimization of an IGA model

__init__(iga_model, nb_var, update_function, refinement, d_update_function=None)
Parameters:
  • iga_model (IgaModel) – IGA model on which optimization is made

  • nb_var (int) – Number of design variables

  • update_function (function) – Function updating IGA model, based on initial CP coordinates and design variables

  • refinement (Refinement) – Refinement from design model to analysis model

  • d_update_function (function) – Function comuting the derivative of the shape update function with respect to the design variables (default=None)

__weakref__

list of weak references to the object

compliance(x)

Compute compliance for a given set of design variables

Parameters:

x (np.array(dtype=float)) – Array containing the design variables

Returns:

compliance – Discrete compliance of the model

Return type:

float

displacement(x, xi, ipatch=0)

Compute displacement at a point of a patch for a given set of design variables

Parameters:
  • x (np.array(dtype=float)) – Array continaing the design variables

  • xi (np.array(dtype=float)) – Array containing the paralmetric coordinates of the point

  • ipatch (int) – Index of the considered patch (default=0)

Returns:

displacement – Displacement at point

Return type:

np.array(dtype=float)

grad_compliance_analytic(x)

Compute gradient of the compliance with respect to a set of design variables using analytic method

Parameters:

x (numpy.array(dtype=float)) – Array containing the design variables

Returns:

grad_compliance – Gradient of the compliance

Return type:

numpy.array(dtype=float)

grad_compliance_finite_differences(x, eps=1e-06, centered=False)

Compute gradient of the compliance with respect to a set of design variables using finite differences

Parameters:
  • x (numpy.array(dtype=float)) – Array containing the design variables

  • eps (float) – epsilon value for finite difference computation Default = 1.e-6

  • centered (bool) – Boolean indicating if centered finite differences must be used Default = False

Returns:

grad_compliance – Gradient of the compliance

Return type:

numpy.array(dtype=float)

grad_displacement_analytic(x, xi, ipatch=0)

Compute gradient of the displacement at a points with respect to a set of design variables using analytic method

Parameters:
  • x (np.array(dtype=float)) – Array continaing the design variables

  • xi (np.array(dtype=float)) – Array containing the paralmetric coordinates of the point

  • ipatch (int) – Index of the considered patch (default = 0) Not taken into account, computation is for patch 0

Returns:

grad_displacement – Gradient of the displacement

Return type:

np.array(dtype=float)

grad_displacement_finite_differences(x, xi, ipatch=0, eps=1e-06, centered=False)

Compute gradient of the displacement at a points with respect to a set of design variables using finite differences

Parameters:
  • x (np.array(dtype=float)) – Array continaing the design variables

  • xi (np.array(dtype=float)) – Array containing the paralmetric coordinates of the point

  • ipatch (int) – Index of the considered patch (default=0) Not taken into account, computation is for patch 0

  • eps (float) – epsilon value for finite difference computation Default = 1.e-6

  • centered (bool) – Boolean indicating if centered finite differences must be used Default = False

Returns:

grad_displacement – Gradient of the displacement

Return type:

np.array(dtype=float)

grad_volume_analytic(x, listpatch=None)

Compute gradient of the volume with respect to a set of deign variables using analytic method

Parameters:
  • x (numpy.array(dtype=float)) – Array containing the design variables

  • listpatch (numpy.array(dtype=int)) – An array of 0 ro 1 indicating which patch must be taken into account for volume computation Default = None

Returns:

grad_volume – gradient of the volume

Return type:

numpy.array(dtype=float)

grad_volume_finite_differences(x, eps=1e-06, centered=False, listpatch=None)

Compute gradient of the volume with respect to a set of design variables using finite differences

Parameters:
  • x (numpy.array(dtype=float)) – Array containing the design variables

  • eps (float) – epsilon value for finite difference computation Default = 1.e-6

  • centered (bool) – Boolean indicating if centered finite differences must be used Default = False

  • listpatch (numpy.array(dtype=int)) – An array of 0 ro 1 indicating which patch must be taken into account for volume computation Default = None

Returns:

grad_volume – gradient of the volume

Return type:

numpy.array(dtype=float)

volume(x, listpatch=None)

Compute volume for a given set of design variables

Parameters:
  • x (np.array(dtype=float)) – Array containing the design variables

  • listpatch (numpy.array(dtype=int)) – An array of 0 ro 1 indocating which patch must be taken into account for volume computation Default = None

Returns:

volume – Volume of the model

Return type:

float

write_analysis_solution_vtu(filename, x=None, per_patch=False, refinement=array([3, 3, 3]), data_flag=array([True, False, False]))

Write analysis result of the model for a set of design variables x TODO: make BSpline output when possible

Parameters:
  • filename (string) – Path to the file to write

  • x (numpy.array(dtype=float)) – Array containing the design variables default=None

  • per_patch (bool (default=False)) – If set to true, a separate file is generated for each patch. Non-embedded patchs are generated using Bezier extraction feature of VTK format. Produced files will have a _pxxx suffix.

  • refinement (numpy.array(shape=(3,), dtype=int) (default=[3, 3, 3])) – Refinement applied when files are egenerated using a classical FE data structure

  • data_flag (numpy.array(shape=(3,), dtype=bool))

  • (default=[True – Boolean array indicating generated fields : [0] : displacement, [1] : stress, [2] : strain

  • False – Boolean array indicating generated fields : [0] : displacement, [1] : stress, [2] : strain

  • False]) – Boolean array indicating generated fields : [0] : displacement, [1] : stress, [2] : strain

write_design_model_control_mesh(filename, ipatch=0, x=None)

Write control mesh of the design model for a set of design variables x

Parameters:
  • filename (string) – Path to the file to write

  • ipatch (int) – Index of patch top write, default=0

  • x (numpy.array(dtype=float)) – Array containing the design variables default=None

class yeti_iga.Refinement(nb_patch)

An object defining an IGA refinement (degree elevation and subdivision) on a set of patchs

__init__(nb_patch)
Parameters:

nb_patch (int) – Number of patch on which refinement will operate

__weakref__

list of weak references to the object

property degrees_legacy

Degree elevation for each patch of an IGA paramatrization in legacy format

set_refinement(ipatch, degree_elevation, subdivision)

Set refinement (degree levation and subdivision for a given patch)

Parameters:
  • ipatch (int) – Index of patch to refine

  • degree_elevation (np.array(dtype=int)) – Number of degree elevation for each parametric direction

  • subdivision (np.array(dtype=int)) – Number subdivision for each parametric direction

property subdivision_legacy

Subdivision number for each patch of an IGA paramatrization in legacy format”