### 6.5.1. Model

`class compolyx.Model`(name=None, path=None, format=None, reduced_integration=True, ignored_entities=None, graph=None, parent=None, post_processing_model=True, unit_system_type=None, reference_surface_input_unit_system_type=None, cache_data=False)

Class to represent a finite element model

Access:

    >>> import compolyx
    >>> db = compolyx.DB()
    >>> model = db.import_model(name='class40.1', path='class40.cdb', format='ansys:cdb')

Get existing model:

    >>> class40_model = db.models['class40.1']

`active_scene`

  Active Scene

`add_solution`(name, id='', path=None, path2=None, format='ansys:rst', subcase=(False, 0), set=-1, load_factor=(False, 0.0), read_stresses_strains=True, use_felyx_to_compute_pp_results=True, use_solid_results=True, recompute_iss_of_solids=False, renumbering_mapping_paths=[], ext_id='', active=True)

  Load a nodal solution from file(s) and add it to the model

  Parameters

  - name : Custom name of the solution

  - path : Path to the data file

  - path2 : Optional path to second result file. Useful for ANSYS PRNSOL solution, where nodal deformations and nodal rotations can be exported to different files only.

  - format : File format string. Choose one of 'abaqus:fieldreport', 'ansys:prnsol','ansys:rst' or 'nastran:f06'

  - subcase : Optional subcase to read. Only valid for 'nastran:f06' format. (False,0) if not given in the F06 file.

  - load_factor : Optional load factor within substep of non-linear solution where the nodal solution should be taken from. Only valid for 'nastran:f06' format. (False,0) if not given in the F06 file.

  - set : Result set for ANSYS RST files, None is last result set

  - read_stresses_strains : Reads strain and stress results from the RST file (necessary to post-process non-linear solutions)

  - 'use_felyx_to_compute_pp_results': Use ACP to compute strain and stress data

  - use_solid_results : Mapps solid element solution onto 'Layered Solid Reference Surface'

  - recompute_iss_of_solids : For solids the interlaminar shear stresses are recalculated considering the laminate stacking

  - renumbering_mapping_paths : List of paths of the assembly renumbering files used to map the results of composite assemblies

  - active : Active/inactive flag

  Returns

  The new Solution instance just added to the model

`analysis_model_path`

  Analysis model file path

`analysis_ply_groups`

  Dictionary with all Analysis Ply Groups defined.

`angle_tolerance`

  Section computation angle tolerance (in degree)

`average_element_size`()

  Average element size of the model

`clear_material_fields`()

  Clear all material fields defined in the Model.

`clear_stored_update_results`()

  Function clears the eventually stored update results

`copy_combined_failure_criteria`(source)

  Copy a Combined Failure Criteria Definition

  Parameters

  - source : Source object to copy

  Returns

  New instance of Combined Failure Criteria Definition

`copy_edge_set`(source)

  Copy a edge set :Parameters: - source : Source object to copy

  Returns

  New instance of edge set

`copy_element_set`(source)

  Copy a element set

  Parameters

  - source : Source object to copy

  Returns

  New instance of element set

`copy_lookup_table`(source)

  Copy a Look-up Table

  Parameters

  - source : Source object to copy

  Returns

  New instance of a Look-Up Table

`copy_oriented_selection_set`(source)

  Copy an oriented element set

  Parameters

  - source : Source object to copy

  Returns

  New instance of oriented element set

`copy_rosette`(source)

  Copy a Rosette

  Parameters

  - source : Source object to copy

  Returns

  New instance of Rosette

`copy_sampling_point`(source)

  Copy a sampling point

  Parameters

  - source : Source object to copy

  Returns

  New instance of a sampling point

`copy_section_cut`(source)

  Copy a section cut

  Parameters

  - source : Source object to copy

  Returns

  New instance of a section cut

`copy_selection_rule`(source)

  Copy a rule

  Parameters

  - source : Source object to copy

  Returns

  New instance of rule

`copy_sensor`(source)

  Copy a sensor

  Parameters

  - source : Source object to copy

  Returns

  New instance of a sensor

`copy_solid_model`(source)

  Copy a solid model

  Parameters

  - source : Source object to copy

  Returns

  New instance of a solid model

`create_cad_selection_rule`(name, id=None, use_defaults=True, in_plane_capture_tolerance=0.0, neg_capture_tolerance=0.0, pos_capture_tolerance=0.0, include_rule_type=True, geometry=None, use_projection_normal=False, projection_normal=(0.0, 0.0, 0.0))

  Create new CAD Selection Rule

  Parameters

  - name : Name of the Rule

  - use_defaults : Whether to use the offset value of the CAD geometry.

  - in_plane_capture_tolerance : In-plane extend (extend) if CAD geometry is a surface.

  - neg_capture_tolerance : Offset in the negative direction if CAD geometry is a surface.

  - pos_capture_tolerance : Offset in the positive direction if CAD geometry is a surface.

  - include_rule_type : Wheter the selection is inside or outside the CAD geometry

  - geometry : CAD geometry used to determine the selection

  - use_projection_normal : Boolean wheter to use the projection normal or not.

  - projection_normal : Normal direction used to map elements on outlines / curves

  Returns

  The created rule

`create_combined_failure_criteria`(name, set=[], id=None)

  Create Combined Failure Criteria

  Parameters

  - name : Name for the Combined Failure Criteria

  - set : set of Failure Criteria to be assigned

  - id : id to be assigned (optional)

  Returns

  - created Combined Failure Criteria

`create_cutoff_selection_rule`(name, id=None, cutoff_rule_type='geometry', offset=0.0, angle=0.0, origin=(0.0, 0.0, 0.0), direction=(1.0, 0.0, 0.0), distance_type='along_direction', ply_cutoff_type='production_ply_cutoff', ply_tapering=False, cutoff_geometry=None, edge_set=None, offset_method='laminate_stack', offset_type='out_of_plane')

  Create new Cut-off Rule

  Parameters

  - name : Name of the rule

  - cutoff_rule_type : geometry , taper , or variable_taper

  - offset : Offset of the rule (float for cutoff_rule_type=`geometry` or taper , LookUpTableColumn for cutoff_rule_type=`variable_taper`)

  - angle : Angle of the rule (ignored for cutoff_rule_type=`geometry`, float for taper , LookUpTableColumn for variable_taper )

  - origin : Origin of the offset and angle interpolation for variable_taper

  - direction : Direction of the offset and angle interpolation for variable_taper

  - distance_type : along_direction or along_edge (only relevant for variable_taper )

  - ply_cutoff_type : Determines on which ply level the cutoff is done.

  - ply_tapering : Use ply tapering

  - cutoff_geometry : CADGeometry for the rule (only relevant for cutoff_rule_type=`geometry`)

  - edge_set : Edge Set for cutoff_rule_type=`taper` or variable_taper

  - offset_method : Method to compute offset of plies laminate_stack or attached_plies

  - offset_type : Measure offset from edge set normal to element reference surface ( out_of_plane ) or in element reference surface ( in_plane )

  Returns

  The created rule

`create_cylindrical_selection_rule`(name, id=None, origin=None, direction=None, radius=None, relative_rule_type=False, include_rule_type=True)

  Create new Cylindrical Selection Rule

  Parameters

  - name : Name of the rule

  - origin : Origin of the Cylindircal Rule

  - direction : Direction of the Cylindircal Rule

  - radius : Radius of the Cylindircal Rule

  Returns

  The created Cylindircal Rule

`create_edge_set`(name, id=None, origin=(0.0, 0.0, 0.0), limit_angle=-1.0, edge_set_type='By Reference', element_set=None, node_labels=[], show=True)

  Create new Edge Set

  Parameters

  - name : Name of the Edge Set

  - edge_set_type : 'By Nodes', 'By Reference', 'Imported' (only for imported Edge Sets)

  - origin : Origin

  - limit_angle :

  - element_set : element set

  - node_labels : list of nodes defining the edge set (only if edge_set_type='By Nodes')

  Returns

  The created Edge Set

`create_element_set`(name, id=None, element_labels=None, element_sets=None, x=None, y=None, z=None, op='new', middle_offset=False, show=True)

  Create new element set

  Parameters

  - name : Name of the Element Set

  - element_labels : Indices of elements to be assigned to Element Set

  - element_sets : Select elements of these sets

  - x : X-range to select.

  - y : Y-range to select.

  - z : Z-range to select.

  - op : Select operation. Can be all, new (default), add, remove, intersect, inverse or none

  - middle_offset : Boolean to enforce that the laminate mid-plane is moved onto the reference surface.

  Returns

  The created Element Set

  If element set already exists, it is updated depending on the operation given in op .

`create_envelope_solution`(name, id=None, solution_sets=[])

  Create Envelope Solution

  Parameters

  - name : Name for the Envelope Solution

  - solution_sets : list of Solution Sets that are combined

  Returns

  The new envelope solution object

`create_lookup_table1d`(name, id='', tabular_data=None, origin=None, direction=None, dimensions=[])

  Create a new 1D Look-Up Table object

  Parameters

  - name : Name

  - id : ID

  Returns

  The created Look-Up Table object

`create_lookup_table3d`(name, id='', tabular_data=None, use_default_search_radius=True, search_radius=0.0, num_min_neighbors=1, dimensions=[])

  Create a new 3D Look-Up Table object

  Parameters

  - name : Name

  - id : ID

  Returns

  The created Look-Up Table object

`create_oriented_selection_set`(name, id=None, orientation_point=(0.0, 0.0, 0.0), orientation_direction=(0.0, 0.0, 0.0), element_sets=None, geometries=None, rosettes=None, rosette_selection_method='minimum_angle', selection_rules=None, draping_material=None, draping=False, draping_seed_point=(0.0, 0.0, 0.0), auto_draping_direction=True, draping_direction=(0.0, 0.0, 1.0), draping_mesh_size=False, reference_direction_field=None)

  Create a new Oriented Selection Set

  Parameters

  - name : The name of the oriented element set

  - id : The id of the oriented element set.

  - orientation_point : Orientation Point for the Oriented Selection Set

  - orientation_direction : Orientation Direction for the Oriented Selection Set

  - element_sets : Element Sets

  - geometries : Virtual geometries

  - rosettes : Rosettes for the Oriented Selection Set

  - rosette_selection_method : Method to calculate element orientation

      ('minimum_angle', 'maximum_angle', 'minimum_distance', 'minimum_angle_superposed', 'minimum_distance_superposed', 'maximum_angle_superposed', 'ansys_classic', or 'tabular_values')

  - reference_direction_field : Table column used to compute reference directions

  - draping : Draping enabled

  - draping_material : Material for draping

  - draping_seed_point : Seed Point used to start draping

  - draping_direction : Direction for draping

  - auto_draping_direction : Generate direction for draping

  - draping_mesh_size : Mesh size for draping

  Returns

  The created Oriented Selection Set

`create_parallel_selection_rule`(name, id=None, origin=None, direction=None, pos_distance=None, neg_distance=None, relative_rule_type=False, include_rule_type=True)

  Create new Parallel Selection Rule

  Parameters

  - name : Name of the Rule

  - origin : Origin of the Parallel Selection Rule

  - direction : Direction of the Parallel Selection Rule

  - pos_distance : Positive Disance of the Parallel Selection Rule

  - neg_distance : Negative Distance of the Parallel Selection Rule

  Returns

  The created Parallel Selection Rule

`create_published_parameter`(name, source='', category='input', acp_type='float', description='', lower_limit=None, upper_limit=None, cyclic=False, float_list=[], string_list=[])

  Create published parameter

`create_rosette`(name, id=None, origin=(0.0, 0.0, 0.0), dir1=(1.0, 0.0, 0.0), dir2=(0.0, 1.0, 0.0), rosette_type='PARALLEL', edge_set=None, show=True)

  Create a new rosette

  Parameters

  - name : The name of the Rosette

  - id : ID (optional)

  - origin : The origin of the Rosette

  - dir1 : Direction 1 of the Rosette

  - dir2 : Direction 2 of the Rosette

  - rosette_type : Type of the Rosette ( 'PARALLEL', 'RADIAL', 'CYLINDRICAL', 'SPHERICAL', 'EDGE_WISE' )

  - edge_set : Edge Set to be used in Rosette

  - show : Whether the newly created rosette is shown in the scene / the 3D window or not

  Returns

  The created Rosette

  Example

      >>> rosette_1 = model.create_rosette('Rosette.1',
                                           origin=(0.,0.,0.),
                                           dir1=(1.,0.,0.),
                                           dir2=(0.,1.,0.),
                                           rosette_type='PARALLEL')

`create_sampling_point`(name, id=None, point=(0.0, 0.0, 0.0), direction=(0.0, 0.0, 0.0), locked=False, use_default_reference_direction=True, rosette=None, offset_is_middle=True, consider_coupling_effect=True, solution_set=None)

  Create new Sampling Point

  Parameters

  - name : Name of the Sampling Point

  - point : Sampling point

  - direction : Sampling direction

  - use_default_reference_direction : whether to use the default reference direction for the evaluation

  - rosette : Rosette used for the evaluation of the reference direction

  - offset_is_middle : Specifies the offset of the reference plane used for the CLT analyses

  - consider_coupling_effect : Specifies whether the laminate properties are evaluated considering the coupling effect (B matrix) or not

  - solution_set : Specifies the solution and the set of the element-wise post-processing. Note, this must be given as a tuple.

  Returns

  The created Sampling Point

`create_scene`(name, id=None, title='', active_set=None, projection='perspective', scale_factor=1.0, show_draped_fiber_directions=False, show_draped_transverse_directions=False, show_edges=False, show_fiber_directions=False, show_global_coordinate_system=True, show_legend=True, show_normals=False, show_orientations=False, show_ref_directions=False, show_selected_mesh=False, show_section_cut_plots=False, show_solid_elements=False, show_surface=True, show_transverse_directions=False, continuous_pick_enabled=False)

  Create a new scene

  Paramter

  - name : Name of the scene

  - show_deformed_mesh : Whether to show the deformed mesh

  - show_undeformed_mesh : Whether to show the undeformed mesh

  - scale_factor : Scale factor of the deformed mesh

`create_section_cut`(name, id=None, origin=(0.0, 0.0, 0.0), normal=(0.0, 0.0, 1.0), in_plane_reference_direction1=(1.0, 0.0, 0.0), scale_factor=1.0, core_scale_factor=1.0, intersection_type='normal_to_surface', section_cut_type='modeling_ply_wise', extrusion_type='wire_frame', use_default_tolerance=True, tolerance=0.0, use_default_lut_settings=True, search_radius=0.0, number_of_interpolation_points=1, locked=False)

  Creates a new section cut

  Parameters

  - name : The name of the section cut

  - id : The ID of the section cut

  - origin : Origin of the section cut plane

  - normal : Normal of the section cut plane

  - in_plane_reference_direction1 : Local x-direction of the sectin cut

  - scale_factor : Scale factor for the thicknesses

  - core_scale_factor : Scale factor for core materials

  - intersection_type : Intersection type for the wireframe section cut

  - section_cut_type : Ply resolution

  - extrusion_type : Type of representation and extrusion

  - use_default_tolerance : Whether to use the default tolerance or not. Default is 0.1% of the averaged element size.

  - tolerance : Tolerance used to generate the surface section cut

  - use_default_lut_settings : Use default interpolation properties for the sweep based extrusion

  - search_radius : Search radius of the interpolation algorithm

  - number_of_interpolation_points : Number of points of the interpolation algorithm

`create_sensor`(name, id=None, sensor_type='SENSOR_BY_AREA', entities=None, locked=False)

  Create new Sensor

  Parameters

  - name : Name of the Rule

  - sensor_type : Type of Sensor values are: SENSOR_BY_AREA, SENSOR_BY_MATERIAL, SENSOR_BY_PLIES

  - entities : Entities of the Sensor

  Returns

  The created Sensor

`create_solid_model`(name, id='', active=True, element_sets=None, ex_type=None, drop_off_type=None, offset_type=None, max_thickness=None, ply_group_pointers=None, element_set=None, use_default_element_index=True, element_index=0, use_default_node_index=True, node_index=0, use_default_section_index=True, section_index=0, use_default_material_index=True, material_index=0, use_default_coordinate_system_index=True, coordinate_system_index=0, connect_butt_joined_plies=True, write_degenerated_elements=True, use_solsh_elements=False, use_solid_model_prefix=True, global_drop_off_material=None, global_cut_off_material=None, transfer_all_sets=True, transferred_element_sets=[], transferred_edge_sets=[], delete_bad_elements=True, disable_dropoffs_on_top=False, disable_dropoffs_on_bottom=False, disable_dropoff_sets_on_top='all', disable_dropoff_sets_on_bottom='all', warping_limit=0.4, drop_hanging_nodes=True, locked=False)

  Create a new Solid Model

  Parameters

  - name : The name of the Solid Model

  - id : The id of the Solid Model

  - active : bool of active or inactive switch

  - element_sets : Active status fo the Solid Model

  - element_sets : a list of Element Sets

  - ex_type : monolithic (1 element through the thickness),

      analysis_ply_wise (1 element per layer), modeling_ply_wise (1 element for each modeling ply), production_ply_wise (1 element for each production ply) specify_thickness (1 element per layer, layers thicker than max_thickness are split to several solids of at most max_thickness) user_defined (groups plies by global ply numbers to groups material_wise (groups subsequent plies with equal material)

  - drop_off_type : inside ply (one element inside the ply boundary), outside ply (one element outside the ply boundary)

  - offset_type

      shell normal (offset to the shell normal), surface normal (update normal direction by normal of layered solids),

      distortion controlled (surface normal with local corrections)

  - max_thickness : maximum thickness for one solid, splits the layer into more solids, if a single layer is thicker than this value (only for ex_type=`specify thickness`)

  - ply_group_pointers : step used to make user-defined ply groups

  - element_set : (deprecated, use element_sets instead) a single element set

  - use_default_element_index : consecutive element numbering if set to true

  - element_index : start index for first element (only relevant if use_default_element_index)

  - use_default_node_index : consecutive node numbering if set to true

  - node_index : start index for first node (only relevant if use_default_node_index)

  - use_default_section_index : consecutive section numbering if set to true

  - section_index : start index for first element (only relevant if use_default_section_index)

  - use_default_material_index : consecutive material numbering if set to true

  - material_index : start index for first element (only relevant if use_default_material_index)

  - use_default_coordinate_system_index : consecutive coordinate system numbering if set to true

  - coordinate_system_index : start index for first coordinate system (only relevant if use_default_coordinate_system_index)

  - connect_butt_joined_plies : connect adjacent plies without intermediate drop-offs

  - write_degenerated_elements : degenerated drop-off and cut-off elements are written to the *cdb file

  - use_solsh_elements : the solid model is created out of solsh elements

  - use_solid_model_prefix : the name of the solid model is used as a prefix for all components written to the *cdb file

  - global_drop_off_material : defines the global drop-off material

  - global_cut_off_material : defines the global cut-off material

  - transfer_all_sets : defines whether all edge and element sets should be transferred to the solid model.

  - transferred_element_sets : element sets to transfer to the solid model if transfer_all_sets is set to false.

  - transferred_edge_sets : edge sets to transfer to the solid model if transfer_all_sets is set to false.

  - delete_bad_elements : Boolean whether to delete the erroneous elements or not

  - disable_dropoffs_on_top : Boolean whether to disalbe the drop-off elements on the top surface of the laminate.

  - disable_dropoffs_on_bottom : Boolean whether to disalbe the drop-off elements on the bottom surface of the laminate.

  - ` disable_dropoff_sets_on_top: List of element or oriented selection sets defining the region where the drop-offs are disabled on the top skin of the laminate. Default is 'all'

  - ` disable_dropoff_sets_on_bottom: List of element or oriented selection sets defining the region where the drop-offs are disabled on the bottom skin of the laminate. Default is 'all'

  - warping_limit : Warping limit factor used to detect erroneous elements

  - drop_hanging_nodes : Hanging nodes are dropped (not exported) if set to true

  Returns

  The created Solid Model

`create_spherical_selection_rule`(name, id=None, origin=None, radius=None, relative_rule_type=False, include_rule_type=True)

  Create new Spherical Selection Rule

  Parameters

  - name : Name of the rule

  - origin : Origin of the Spherical Selection Rule

  - radius : Radius of the Spherical Selection Rule

  - include_rule_type : Include or Exclude area in rule

  - relative_rule_type : Flag for relative rule

  Returns

  The created Spherical Selection Rule

`create_tube_selection_rule`(name, id=None, outer_radius=1.0, inner_radius=0.0, include_rule_type=True, edge_set=None)

  Create new Tube Selection Rule

  Parameters

  - name : Name of the rule

  - radius : Radius of the rule

  - include_rule_type : Include or Exclude area in rule

  - edge_set : Edge Set for the rule

  Returns

  The created rule

`create_variable_offset_selection_rule`(name, id=None, radius_origin=None, radius_direction=None, edge_set=None, offsets=None, angles=None, element_set=None, relative_rule_type=False, include_rule_type=True, use_offset_correction=False, distance_along_edge=False)

  Create new Slab Offset Rule

  Parameters

  - name : Name of the Rule

  - id : The unique ID of the rule

  - radius_origin : Reference point of the 1D lookup table used for the offsets

  - radius_direction : Normal of the cutting plane.

  - edge_set : Guide/axis of variable tube

  - offsets : 1D lookup table including the radii of the variable tube

  - angles : Optional taber edge angles

  - element_set : Preselection of elements in the form of an element set where the rule is applied on

  - include_rule_type : Boolean whether to select the element inside or outside the variable tube.

  - use_offset_correction : Boolean whether to evaluate the evaluat the radius/offset along the surface or not.

  - distance_along_edge : Boolean wheter to evaluate the distance along the edge or direction of the rule. Default is false.

  Returns

  The created rule

`definitions`

  Definitions

`deformation_scale_factor`

  Factor with which the deformed shape plot is scaled.

`edge_sets`

  Dictionary with all Edge Sets defined.

`element_normal`(globalID)

  Returns the element normal (direction)

  Parameters

  - globalID : Element label

`element_sets`

  Dictionary with all Element Sets defined.

`export`(path)

  Exports all ACP composite defintions.

  Parameters

  - path : File path

`export_ply_geometries`(filename, plies=[], boundary=True, surface=True, offset_type='middle_offset', direction_arrows=False, first_direction=True, second_direction=False, arrow_length=1.0, arrow_type='no_arrow')

  Exports the surface, boundary and/or fiber directions of modeling, production and analysis ply to igs or step file.

  Parameters

  - filename : File path (allowed extensions are iges, igs, step and stp).

  - plies : List of plies (allowed are modeling, production and analysis plies).

  - boundary : Boolean whether to export the boundary. Default is True.

  - surface : Boolean whether to export the ply surface. Default is True.

  - offset_type : Offset type (can be 'no_offset', 'middle_offset', 'top_offset' or 'bottom_offset'). Default is 'middle_offset'

  - direction_arrows : Boolean whether to export the direction arrows. Default is False.

  - first_direction : Boolean whether to export the first (main) material direction. Default is True.

  - second_direction : Boolean whether to export the second material direction. Default is False.

  - arrow_length : Length of the arrows. Default is 1.

  - arrow_type : Defines the arrow type (can be 'standard_arrow', 'no_arrow', 'half_arrow'). Default is 'no_arrow'.

`find_materials`(**properties)

  Find materials with the given properties or property ranges

  Parameters

  - properties : Arbitrary material properties which must be matched. Note that a single property value can be given as string, number or min-max range

  Returns

  A list with materials which match the given properties. If nothing matches an empty list is returned.

  Examples:

`format`

  File format string. Choose one of 'abaqus:inp','ansys:cdb', 'ansys:dat', 'nastran:bdf', 'matwind:mdr' or 'layup'

`geometry`

  Geometry node

`get_definitions_dict`(objects=None)

  Returning definitions of ACP as dictionary Supported objects are: modeling_groups

  Parameters

`get_element_by_point`(point)

  Returns the element label of the closest element with respect to the given point.

  Parameters

  - point : Tuple of the global coordinates

`get_layup`(path, format=None, objects=None, mode='update_layup')

  Load layup from excel or csv file

  Parameters

  - mode : can be: update_properties_only : Definitions are updated with properties given

      update_layup : Definitions are update, additional plies are generated and deleted recreate : Existing layup is deleted generated from scratch

`get_layup_from_csv_file`(path, objects=None, mode='update_layup', modeling_group=None)

  Function that reads the layup data from a csv file and adds the data to the graph

  Parameters

  - objects : List of objects to be synced

  - path : the path to the file

  - mode : can be: update_properties_only : Definitions are updated with properties given

      update_layup : Definitions are update, additional plies are generated and deleted recreate : Existing layup is deleted generated from scratch

  - modeling_group : key of the mpg_collection dict = the id of the mpg. Only plies of this modeling_group will be imported from the file if none is specified all mpgs are read

`get_layup_from_excel_file`(path, objects=None, mode='update_layup')

  Load layup from Excel File

  Parameters

  - path : Path to file to load

  - objects : Objects to be loaded and overwritten

  - mode : can be: update_properties_only : Definitions are updated with properties given

      update_layup : Definitions are update, additional plies are generated and deleted recreate : Existing layup is deleted generated from scratch

`import_composite_definitions_from_acp_file`(path=None, import_mode='keep_both')

  This functions loads the ACP file definitions from an other ACP Model. In the Workbench mode everything but the ANSYS input file and the materials is loaded. In the stand-alone mode everything but the ANSYS input file is loaded

  Parameters

  - path : *.acp file path

  - import_mode : Defines how to solve conflicts of objects of equal name.

  Global Resolution Actions

  - keep_both : Keep target and source. Default.

  - keep_existing : Imported entities are ignored

  - overwrite : Overwrite target with source

`layup_plots`

  Plots

`lookup_tables`

  Dictionary with all Look-Up Tables

`material_data`

  Dictionary with all Material Data defined.

`material_fields`

  Material field selection.

`mesh`

  Mesh of this model

`mesh_query`(name, position, selection='all', entity=None, entities=None, simulate=False)

  Query arbitrary data from the mesh of the model

  Parameters

  - name

      Data type to query:

      - labels, indices

      - etypes

      - coordinates

      - angles

      - thickness

      - normals

      - orientations, ref_directions, fiber_directions, transverse_directions

      - draped_fiber_directions, draped_transverse_directions

      - ply_offsets (coordinates including the offsets)

      - area, volume, weight, price

      - cog (centre of gravity)

      - offset (offset in the thickness direction)

  - position

      Position where data is queried:

      - nodal

      - centroid

      - element_nodal

  - selection

      The selection set determines the selected nodes and elements.

      Can be given as string 'sel0' - 'sel5' or 'all' or can be given as ObjectSelection object such as - model.selection - scene.active_set

  - entity

      Specialized queries require the specification of an additional associated entity,

      e.g. an oriented element set is needed to compute orientations. Entity can be given as NamedGraphObjects or vertex descriptor.

  - entities : If a list of entities is given, the query will also compute and return a list of results, with one array for each entity.

  - simulate

      Whether the query is only simulated to test if it will return data.

      If this flag is set the mesh_query(...) function will only return 0 or 1.

`minimum_analysis_ply_thickness`

  Section computation minimum analysis ply thickness (in length unit of model)

`modeling_groups`

  Dictionary with all Modeling Groups defined.

`oriented_selection_sets`

  Dictionary with all oriented element sets defined.

`parameters`

  List of parameters visible to the workbench

`path`

  Path to the data file

`plot_dependencies`(path=None, parent=None, levels=3)

  Generates a graph with all dependencies. The output is a dot, png and pdf file

  Parameters

  - path : file path without file extension

  - parent : Parent object

  - levels : Depth levels to look for children

  Output

  A dot file which can be opend with Graphviz

  Usage

      >>> model.plot_dependencies(r'C:  mp\hull_dependencies', model.element_sets['HULL'], 3)

`plybook`

  PlyBook

`post_processing_model`

  Post-processing model

`pre_path`

  Save path of pre database linked to currently loaded post database

`push_definitions_from_dict`(d, objects=None, mode='update_layup')

  Update/Generate Definitions from dictionary Dictionary can be generated by get_definitions_dict

  Parameters

  - objects : objects to read and write if not set averything is synced

  - mode : can be: update_properties_only : Definitions are updated with properties given

      update_layup : Definitions are update, additional plies are generated and deleted recreate : Existing layup is deleted generated from scratch

  Format

      >>> d = {'modeling_groups':
      >>>       [ { 'name': 'ModelingGroup.1', 'id': ....
      >>>           'plies': [ {'name': 'Ply.1', 'id': ..., 'ply_material': 'fabrics/Fabric.1' } ],
      >>>           ...
      >>>          }
      >>>       ],
      >>>     }

`reduced_integration`

  Reduced integration

`reference_surface_bounding_box`

  Tuple with corners of bounding box of reference surface mesh.

`reference_surface_input_unit_system_locked`

  If the unit system of the reference surface is not defined in the mesh input, the unit system can be changed.

`reference_surface_input_unit_system_type`

  Unit System of the Reference Surface (set by user)

`relative_thickness_tolerance`

  Section computation relative thickness tolerance

`reload_mesh`(path=None, format=None)

  Reloads the mesh (nodes, elements and named selections) Ignored imported entities are the materials and rosettes.

  Parameters:

    - path : New mesh path. Default is the current model path.

    - format : New format. Default is the current format

`rosettes`

  Dictionary with all Rosettes defined.

`sampling_points`

  Sampling Point Container

`save`(path=None, cache_data=False)

  Save ACP model to .acp or .acph5 file :Parameters: - path : Path to file - cache_data : Whether to cache current state of model or not.

`save_analysis_model`(path)

  Save actual analysis model to disc

  parameters

  - path Save path of the cdb file

`save_apdl_commands`(path)

  Save APDL commands for composite definitions of actual model

  parameters

  - path Save path of the cdb file

`save_h5_model`(path)

  Save actual model to HDF5 file. Function is mainly used to exchange composite definitions with ANSYS Workbench

  parameters

  - path Save path of the h5 file

`save_layup`(path, format=None, objects=None)

  Function that saves the layup data to a csv file

  Parameters

  - path : the path to the file

  - format : format can be csv and excel (on windows only)

  - objects : optional parameter if left the entire layup is written to the file, else only the layup defined within modeling_groups

`save_layup_to_csv_file`(path, objects=None)

  Function that saves the layup data to a csv file

  Parameters

  - path : the path to the file

  - modeling_groups : optional parameter if left the entire layup is written to the file, else only the layup defined within modeling_groups

`save_layup_to_excel_file`(path, objects=None)

  Function that saves the layup data to an excel file. Windows only!

  Parameters

  - path : the path to the file

  - objects : optional parameter if left the entire layup is written to the file, else only the layup defined within modeling_groups

`save_solid_models`(directory=None, prefix='ACPSolidModel_', delete_existing=True, formats=['cdb', 'h5'])

  Save solid models to files. Function is used within Workbench updates

  Parameters

  - directory : Directory to save the models.

  - prefix : Prefix of the model. Default ACPSolidModel_

  - delete_existing : Flag if existing models should be deleted. Default True

  - formats : Available file formats are 'cdb' or h5. Default ['cdb', 'h5'].

`scenes`

  Scenes

`section_cuts`

  Section Cuts

`select_elements`(selection='sel0', op='new', labels=None, indices=None, attached_to=None, x=None, y=None, z=None, element_type='all')

  Selects element within active model. (Marks the given selection as SELECTED)

  Parameters

  - selection

      The selection to update

      Can be given as string 'sel0' - 'sel5' or 'all' or can be given as ObjectSelection object such as - model.selection - scene.active_set

  - op : Select operation. Can be all, new (default), add, remove, intersect, inverse or none

  - labels : List with element labels to select.

  - indices : List with element indices to select.

  - attached_to : Elements attached to entities / vertices in this list will be selected.

  - x : X-range to select.

  - y : Y-range to select.

  - z : Z-range to select.

  - element_type : Element type: solid, shell

`select_nodes`(selection='sel0', op='new', labels=None, attached_to=None, x=None, y=None, z=None)

  Function selects nodes in graph and marks the given selection as SELECTED.

  Parameters

  - selection

      The selection to update

      Can be given as string 'sel0' - 'sel5' or 'all' or can be given as ObjectSelection object such as - model.selection - scene.active_set

  - op : Select operation. Can be all, new (default), add, remove, intersect, inverse, none

  - labels : List with node labels to select.

  - attached_to : Nodes attached to the given list of entities or vertices will be selected.

      If attached_to="elements" all nodes attached to selected elements are selected

  - x : X-range to select.

  - y : Y-range to select.

  - z : Z-range to select.

`select_solid_elements_from_shells`(selection='sel0')

  Selects the solid element within given selection and deselects the shell elements.

  Parameters

  - selection : The selection to update. Can be given as string 'sel0' - 'sel5'

  Return

  Number of selected solid elements

`selection`

  Selected objects of this model

`selection_rules`

  Dictionary with all Selection Rules defined.

`sensors`

  Dictionary with all Sensors.

`serialize`()

  Serialize to Python string

`show_deformed`

  Whether to show result plots in the deformed and scaled configuration.

`show_solver_elements`

  Whether mesh selections and plot should consider solver elements in solid models or not.

`solid_models`

  SolidModel

`solutions`

  Solutions

`solve`(wait=False)

  Convenience function to directly solve the current model

  Parameters

  - wait : Wait until solver process finishes computation

`solver`

  Solver instance

`unit_system`

  Create a unit system and assign it to the model. Unit system types are: si,mks,cgs,umks,mpa,bft,bin,undefined

`update`(objects='all', relations_only=False)

  Main update function

  Parameters

  - objects : List of objects to update.

  - relations_only : Set this option to true to only update and propagate the status of all objects.

`update_results_path`

  Optional path to file storing update results.

`use_default_section_tolerances`

  Boolean whether to uses angle and thickness tolerances of the application preferences for section computation. Otherwise model specific values are used.

`use_nodal_thicknesses`

  Define whether to use nodal thicknesses or element thicknesses.

`views`

  Views

Release 18.2 - © ANSYS, Inc. All rights reserved.