5. i-SAS_NastranManager¶
5.1. interface¶
-
class
nastran_manager.interface.Interface(instance_name, input_names, output_names, structural_model_name=None, **kwargs)¶ Bases:
objectinterface class of nastran manager
-
package_name= 'nastran_manager'¶
-
structural_model_required= True¶
-
__init__(instance_name, input_names, output_names, structural_model_name=None, **kwargs)¶ initialization of interface class of nastran manager
- 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 = {'displacement': ['enforced_displacement_x', 'enforced_displacement_y', 'enforced_displacement_z'], 'pressure': ['static_pressure_x', 'static_pressure_y', 'static_pressure_z']} >>> output_names = {'displacement': ['analysis_displacement_x', 'analysis_displacement_y', 'analysis_displacement_z'], 'strain':['analysis_strain_x', 'analysis_strain_y', 'analysis_strain_xy']} >>> 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
-
5.2. model¶
-
class
nastran_manager.model.Model(input_names, output_names, structural_model_name, cfg)¶ Bases:
objectmodel class
-
package_name= 'nastran_manager'¶
-
spc_id= 1000¶
-
load_id= 2000¶
-
mat_id= 201¶
-
part_id= 100¶
-
dof_dict= {'rotation_x': 4, 'rotation_y': 5, 'rotation_z': 6, 'x': 1, 'y': 2, 'z': 3}¶
-
supported_input_key= ('displacement', 'force', 'moment', 'pressure')¶
-
coord_sys= {'displacement': 'global', 'strain': 'local', 'strain_bot': 'local', 'strain_mid': 'local', 'strain_top': 'local', 'stress': 'local', 'stress_bot': 'local', 'stress_mid': 'local', 'stress_top': 'local'}¶
-
point_id_column= {'displacement': 'fe_node_id', 'strain': 'fe_elem_id', 'stress': 'fe_elem_id'}¶
-
elem_type= {'shell': ['iMIN3', 'iQS4'], 'solid': []}¶
-
__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.
-
export_input(data)¶ export nastran input file
- Parameters
data (dict[pd.DataFrame]) – input data
-
execute_analysis()¶ execute nastran with exported input file
-
import_output(output_path=None)¶ import nastran output file
- Parameters
output_path (str) – output file path, the default, None.
- Returns
analysis result
- Return type
dict[numpy.array]
-
__call__(data)¶ calculate results from input using functions
- Parameters
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
-