1. i-SAS_AnalysisSolver-template

1.1. interface

class analysis_solver.interface.Interface(instance_name, input_names, output_names, structural_model_name=None, **kwargs)

Bases: object

interface class of analysis solver

package_name = 'analysis_solver'
structural_model_required = False
__init__(instance_name, input_names, output_names, structural_model_name=None, **kwargs)

initialization of interface class of analysis solver

Parameters
  • instance_name (str) – instance name.

  • input_names (dict) – dict whose keys are names of input quantity and values are names of input data.

  • output_names (dict) – dict whose keys are names of output quantity and values are names of output data.

  • structural_model_name (str, optional) – structural model name.

  • **kwargs – Arbitrary keyword arguments.

Example

>>> input_names = {'strain': ['rosette_strain_x', 'rosette_strain_y', 'rosette_strain_xy']}
>>> output_names = {'displacement': ['analysis_displacement_z'], 'stress':['analysis_stress_x']}
>>> interface = Interface(input_names, output_names, 'beam')
set_project(project_name)
Parameters

project_name (str) – project name.

set_model(output_metadata, sensors, structural_models, structural_model_connections, streaming=False)

set structural model

Parameters
  • output_metadata (pd.DataFrame) – output metadata.

  • sensors (dict) – sensors.

  • structural_models (dict) – structural models.

  • structural_model_connections (dict) – connections between data and structural model.

  • streaming (bool, optional) – if true, run as structural_analysis.

Returns

containing followings

dict: information on instance of this model. pandas.DataFrame: output metadata of this model. dict: connections between output data of this model and structural model.

Return type

tuple

__call__(input_data)

calculate quantity of state

Parameters

input_data (dict) – data calculated before

Returns

containing:

dict: analysis data. pandas.DataFrame: timestamp used. The length is the same as analysis data.

Return type

tuple

exit()

exit solver

1.2. model

class analysis_solver.model.Model(input_names, output_names, structural_model_name, cfg)

Bases: object

model class

coord_sys = {'new_strain': 'local'}
__init__(input_names, output_names, structural_model_name, cfg)

constructor

Parameters
  • input_names (dict) – dict whose keys are names of input quantity and values are names of input data.

  • output_names (dict) – dict whose keys are names of output quantity and values are names of output data.

  • structural_model_name (str, optional) – structural model name.

  • cfg (dict) – config.

set_model(output_metadata, sensors, structural_models, structural_model_connections, streaming)

set model and calculate intermediate values

Parameters
  • output_metadata (pd.DataFrame) – output metadata.

  • sensors (dict) – sensors.

  • structural_models (dict) – structural models.

  • structural_model_connections (dict) – connections between data and structural model.

  • streaming (bool) – if true, run as structural_analysis.

function(input_data)

example function

Parameters

input_data (dict) – input data.

Returns

output data.

Return type

dict

__call__(input_data)

calculate analysis data from input using functions

Parameters

input_data (dict) – input data.

Returns

containing followings,
dict: analysis data. the key is output_quantity_name, and the value is the list, which

has data value (the type is pandas.DataFrame) as element corresponding to its data name.

dict: used timestamp for each input data. Dict has two keys, ‘s’ as strating timestamp and

’e’ as end time stamp, and the value is 1d-array of the timestamp used to caclulate output, whose length is the same as the length of output.

Return type

tuple