MechanicalOutputCaseSetup¶
Qualified name: output_cases.mechanical_output_case.api.mechanical_output_case_api.MechanicalOutputCaseSetup
- class output_cases.mechanical_output_case.api.mechanical_output_case_api.MechanicalOutputCaseSetup(item: MechanicalOutputCase)[source]¶
Bases:
OutputCaseSetupPipeline,DataTableDependentOutputsHandlerApiMixinThe API handler for mechanical output cases
The following example shows how to create a mechanical output case using the API, it is assumed that these steps were performed in each of the examples for other methods in this class.
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> occ_setup = simulation_setup.create_output_case_container_setup().set_name(name='Example OCC') >>> output_case_setup = occ_setup.create_output_case_setup(oc_type='Mechanical output case').set_name(name='Example OC')
The next example shows how to get an API object for an already existing output case.
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> occ_setup = simulation_setup.create_output_case_container_setup().set_name(name='Example OCC')
>>> output_case_setup = occ_setup.get_output_case_setup(name='Example OC') # The output case must already exist
Methods
Creates a output of a specified type
Returns the api object for setting up the data table query for this output case
Returns the name of the output case
Gets a output setup object for an existing output
Removes the output under the specified index
Sets the data table to be used in this output case
Sets the name of the output case
Sets whether data table data should be used in the output case
Deprecated method
Deprecated method
Attributes
Returns the names of compatible data tables
Deprecated method
- property available_data_table_names: List[str]¶
Returns the names of compatible data tables
Example
>>> print("Available data tables: {}".format(output_case_setup.available_data_table_names)) # To check which data tables are available Available data tables: ...
- Returns:
available_data_tables – A list with the names of compatible data tables
- Return type:
Dict(str, str)
- property available_data_tables_dict: Dict[str, str]¶
Deprecated method
Deprecated
available_data_tables_dict will be removed in a future MORe release, it is replaced by
available_data_table_names()
- create_output_setup(output_type: str) OutputSetup[source]¶
Creates a output of a specified type
Example
>>> link_output_setup = output_case_setup.create_output_setup(output_type='Link displacement') >>> control_module_output_setup = output_case_setup.create_output_setup(output_type='Control module output')
- Parameters:
index (int) – The index of the output in the output table
- Returns:
OutputSetup
- Return type:
- Raises:
NameNotFoundError – Raised if not output with the specified type was found
NotCompatibleError – Raised if the specified output type exists, but is not compatible with this output case
- get_data_table_query_config()[source]¶
Returns the api object for setting up the data table query for this output case
Example
>>> print("Available data tables: {}".format(output_case_setup.available_data_table_names)) # To check which data tables are available Available data tables: ... >>> output_case_setup = output_case_setup \ ... .set_data_table_by_name(data_table_name='data_table_name') \ ... .set_time_dependent_data_bool(value=True) >>> query_config = output_case_setup.get_data_table_query_config()
- Returns:
An object for configuring the data table querying in the output case
- Return type:
Query config
- Raises:
NotCompatibleError – Raised if the current output case configuration is not compatible with a query config object
- get_name() str[source]¶
Returns the name of the output case
Example
>>> output_case_setup.set_name(name='new_name') <more...> >>> output_case_setup.get_name() 'new_name'
- Returns:
name – The name of the output case
- Return type:
str
- get_output_setup(index: int) OutputSetup[source]¶
Gets a output setup object for an existing output
Example
>>> output_setup = output_case_setup.get_output_setup(index=1) # Two outputs must already exist
- Parameters:
index (int) – The index of the output in the output table
- Returns:
OutputSetup
- Return type:
- Raises:
TypeError – Raised if the index is not an integer
- remove_output_setup(index: int) MechanicalOutputCaseSetup[source]¶
Removes the output under the specified index
Example
>>> output_case_setup = output_case_setup.remove_output_setup(index=1) # Two outputs must already exist
- Parameters:
index (int) – The index of the output in the output table
- Returns:
MechanicalOutputCaseSetup
- Return type:
- Raises:
TypeError – Raised if the index is not an integer
- set_data_table_by_name(data_table_name: str) MechanicalOutputCaseSetup[source]¶
Sets the data table to be used in this output case
Example
>>> print("Available data tables: {}".format(output_case_setup.available_data_table_names)) # To check which data tables are available Available data tables: ... >>> output_case_setup = output_case_setup.set_data_table_by_name(data_table_name='data_table_name')
- Parameters:
data_table_name (str) – The name of the data table to set
- Returns:
self
- Return type:
- Raises:
NameNotFoundError – Raised if the data table was not found
- set_name(name: str, resolve_duplicate_name: bool = False) MechanicalOutputCaseSetup[source]¶
Sets the name of the output case
See example at the top to see how to create a MechanicalOutputCaseSetup object
Example
>>> output_case_setup.set_name(name='new_name') <more...> >>> second_output_case_setup.set_name(name='new_name', resolve_duplicate_name=True).get_name() 'new_name 1'
- Parameters:
name (str) – The new name for the output case
resolve_duplicate_name (bool) – Whether to automatically assign a new name when the chosen one is already taken
- Returns:
self
- Return type:
- Raises:
NameNotUniqueError – Raised if the given name is not unique
TypeError – Raised if the given name is not a string
- set_time_dependent_data_bool(value: bool) MechanicalOutputCaseSetup[source]¶
Sets whether data table data should be used in the output case
Example
>>> output_case_setup = output_case_setup.set_time_dependent_data_bool(value=True)
- Parameters:
value (bool) – A boolean value specifying whether data table dependence should be used
- Returns:
MechanicalOutputCaseSetup
- Return type:
- set_time_dependent_data_column_index(index: int) MechanicalOutputCaseSetup[source]¶
Deprecated method
Deprecated
set_time_dependent_data_column_index will be removed in a future MORe release, it is replaced by the more general
get_data_table_query_config()
- set_time_dependent_data_table_by_name(data_table_name: str) MechanicalOutputCaseSetup[source]¶
Deprecated method
Deprecated
set_time_dependent_data_table_by_name will be removed in a future MORe release, it is replaced by
set_data_table_by_name()