### 6.7.1. Solution

`class compolyx.Solution`(obj, parent=None)

Class to compute postprocessings of a finite element solution.

Access:

    >>> import compolyx
    >>> db = compolyx.DB()
    >>> model = db.models['class40.1']
    >>> sol = db.models['class40.1'].add_solution(name='class40.1', path='class40.rst', format='ansys:rst')

`ID`

  Id to be displayed in Envelope solution

`active`

  Activate or deactivate solution

`clear`()

  Clear all result data

`clear_element_results`()

  Resets the post-processing results for each layered element

`clear_failure_criteria_results`()

  Resets the failure criteria results for each layered element

`enabled`

  Whether this object is currently enabled or not. Mainly defined through the current application mode pre or post.

`export_results_to_csv`(definition=None, entities=[], file_path=None, solution_set=-1, solids=False, spot='all')

  Exports the shell results of the selected entities to a csv file.

  Parameters

  - definitions : Selected definition - CombinedFailure Criteria object or as string 'deformations', 'strains' or 'stresses'

  - entities : Defines the selection for the export. Can be a list of ElementSets, AnalysisPlies or SolidModels

  - file_path : File name

  - solution_set : Solution Set for which data is requested

  - solids : Boolean whether to take the results of the solid elements or not. Default is False (results of shells).

  - spots : Layer positions for which the results are exported. Allowed are 'bot', 'mid', 'top', 'bot/top', and 'all'.

  Export results of solid models: Select the element set which is selected in the extrusion settings.

  Usage

      >>> model = db.active_model
      >>> model.solutions['Solution.1'].export_results_to_csv( definition='stresses', entities=[model.element_sets['BULKHEAD_ALL']], file_path=r'C:     mp\stresses.csv', solution_set=1, solids=False, spot='bot-top')

`ext_id`

  Id of corresponding Solution in external solution (ComponentID).

`format`

  File format string. Choose one of 'abaqus:inp','ansys:cdb' or 'nastran:f06'

`has_element_temperatures`

  Boolean flag if element nodal temperatures are read from the rst file.

`has_progressive_damage`

  Boolean flag if progressive_damage data are read from the rst file.

`load`()

  Load result data from 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. Becomes (False,0) if not defined.

`path`

  Path to the data file

`path2`

  Path to the data file

`plots`

  Container with PostProcessin Plots

`query`(definition, options={'eval_ins': False}, position='centroid', selection='all', entity=None, entities=None, spot=None, component=None, rosette=None, simulate=False, solution_set=-1)

  Query results from the solution

  Parameters

  - definition

      The postproc definition defines what results are evaluated. Can be given as

      CombinedFailureCriteria object or as string such as 'strains', 'stresses', 'laminate_forces', 'deformations', 'temperatures' or 'progressive_damage'.

  - options

      Dict with the additional options used to fully configure the definition.

      - stresses: options={"eval_ins":True} to enable the interlaminar normal stress evaluation for shells

  - position

      Position where data is queried:

      - nodal, centroid, element_nodal, integration_point or element_results

  - 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

      Entity for which results are evaluated.

      Currently supported: Analysis ply or analysis ply vertex

  - 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.

  - spot : Used to identify bot, mid or top when querying layered shells

  - component : Components to query. Valid components for

      LAMINATE FORCES - all -> (nx8) PROGRESSIVE DAMAGE - status (damage status) ->(nx1)

      - ft, fc (fiber tensile/compressive damage variable) ->(nx1)

      - mt, mc (matrix tensile/compressive damage variable) ->(nx1)

      - s (shear damage variable) ->(nx1)

      - sed (energy dissipated per unit volume) ->(nx1)

      - sedv (energy per unit volume due to viscous damping) ->(nx1)

  - rosette : If a rosette is given, the results are evaluated with respect to this coordinate system (not recommended for non-linear results)

  - simulate

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

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

  - solution_set : Identifier of the queried solution. -1 identifies the last available Set.

  Usage

      >>> solution.query(definition='laminate_forces',position='centroid',selection='sel0',component='all',rosette=model.rosetttes['Rosette.1'],solution_set=-1)
      >>> solution.query(definition=model.defintions['FailureCriteria'], position='centroid', selection='sel0', component='irf',solution_set=-1)
      >>> solution.query(definition='stresses', position='element_results', selection='sel0', component='s3',solution_set=-1)

`read_stresses_strains`

  True if the stresses and strains are to be read from rst file. Only valid for 'ansys:rst' format.

`recompute_iss_of_solids`

  Use laminate-based computation method to recalculate the interlaminar shear stress distribution.

`renumbering_mapping_paths`

  Path of the assembly renumbering files.

`serialize`()

  Serialize to Python string

`set`

  Result set to be read. Only valid for 'ansys:rst' format.

`solution_dict`

  The time or frequency dictionary used in the solution plots GUI.

`subcase`

  Optional subcase to read. Only valid for 'nastran:f06' format. Becomes (False,0) if not defined.

`time_or_frequency`

  The time or frequency associated with the active set.

`use_felyx_to_compute_pp_results`

  True if the stresses and strains are to be computed by felyx. If the stresses and strains are read from rst file, nothing is computed.

`use_solid_results`

  Allows to visualize the post-processing results of layered solid models on the 'Layered Solid Reference Surface'.

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