SimulationSetup#
Qualified name: api.simulation.simulation\_setup.SimulationSetup
- class api.simulation.simulation_setup.SimulationSetup(proj)[source]#
Bases:
object
Entry point for simulation API
- Parameters:
proj (Project) – The project instance
Methods
Creates a data table and returns a corresponding
DataTableSetup
objectCreates a load case container and returns a corresponding
LoadCaseContainerSetup
objectCreates a study and returns a corresponding
StudiesSetup
objectGets the names of the installed data table types
Gets the names of existing data tables
Gets the names of existing load case containers
Gets the names of existing studies
Creates and returns a
DataTableSetup
for an already existing data table, if plugins are installed it automatically finds the correct data table setup objectCreates a
LoadCaseContainerSetup
for an already existing load case containerCreates and returns a
StudiesSetup
for an already existing studyRemoves a data table
Removes a load case container
Removes a study
- create_data_table_setup(data_table_type_name: str = 'Transient data table') DataTableSetup [source]#
Creates a data table and returns a corresponding
DataTableSetup
objectExample
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> # print(simulation_setup.get_available_data_table_types_names()) # Optionally Check which data table types are available >>> data_table_setup = simulation_setup.create_data_table_setup(data_table_type_name='Transient data table')
- Parameters:
data_table_type_name (: str, default='Transient data table') – The name of the type of data table to add, if no name is given then a ‘Transient data table’ is created by default
- Returns:
A
DataTableSetup
object for the created data table- Return type:
- Raises:
KeyError – Raised if no data table type with the given name exists
- create_load_case_container_setup() LoadCaseContainerSetup [source]#
Creates a load case container and returns a corresponding
LoadCaseContainerSetup
objectExample
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> load_case_container_setup = simulation_setup.create_load_case_container_setup() \ ... .set_name(name='load_case_container_name')
- Returns:
A
LoadCaseContainerSetup
object for the created load case container- Return type:
- create_study_setup() StudiesSetup [source]#
Creates a study and returns a corresponding
StudiesSetup
objectExample
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> study_setup = simulation_setup.create_study_setup()
- Returns:
A
StudiesSetup
object for the created study- Return type:
- get_available_data_table_types_names() List[str] [source]#
Gets the names of the installed data table types
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> simulation_setup.get_available_data_table_types_names() # Will return all names of available data table types ... [...'Transient data table'...]
- Returns:
Names of installed data table type names
- Return type:
list of strings
- get_available_data_tables_names() List[str] [source]#
Gets the names of existing data tables
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> simulation_setup \ ... .create_data_table_setup(data_table_type_name='Transient data table') \ ... .set_name('first_data_table') <more.transient_data_table.scripting_api.transient_data_table_setup.TransientDataTableSetup object at 0x...> >>> simulation_setup \ ... .create_data_table_setup(data_table_type_name='Transient data table') \ ... .set_name('second_data_table') <more.transient_data_table.scripting_api.transient_data_table_setup.TransientDataTableSetup object at 0x...> >>> simulation_setup.get_available_data_tables_names() ['first_data_table', 'second_data_table']
- Returns:
Names of existing data tables
- Return type:
list of strings
- get_available_load_case_containers_names() List[str] [source]#
Gets the names of existing load case containers
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> simulation_setup.create_load_case_container_setup().set_name(name='first_lcc') <more.api.simulation.load_cases.load_case_container_setup.LoadCaseContainerSetup object at 0x...> >>> simulation_setup.create_load_case_container_setup().set_name(name='second_lcc') <more.api.simulation.load_cases.load_case_container_setup.LoadCaseContainerSetup object at 0x...> >>> simulation_setup.get_available_load_case_containers_names() ['first_lcc', 'second_lcc']
- Returns:
Names of existing load case containers
- Return type:
list of strings
- get_available_studies_names() List[str] [source]#
Gets the names of existing studies
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> simulation_setup \ ... .create_study_setup() \ ... .set_name('first_study') <more.api.simulation.studies.studies_setup.StudiesSetup object at 0x...> >>> simulation_setup \ ... .create_study_setup() \ ... .set_name('second_study') <more.api.simulation.studies.studies_setup.StudiesSetup object at 0x...> >>> simulation_setup.get_available_studies_names() ['first_study', 'second_study']
- Returns:
Names of existing studies
- Return type:
list of strings
- get_data_table_setup(name: str) DataTableSetup [source]#
Creates and returns a
DataTableSetup
for an already existing data table, if plugins are installed it automatically finds the correct data table setup objectExample
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup()
>>> data_table_setup = simulation_setup.get_data_table_setup(name='data_table_name')
- Parameters:
name (str) – The name of the existing data table for which to return a
DataTableSetup
- Returns:
A
DataTableSetup
object for the found data table- Return type:
- Raises:
NotImplementedError – Raised if no
DataTableSetup
was implemented for the given data table, may happen when using pluginsKeyError – Raised if no data table with the given name was found
- get_load_case_container_setup(name: str) LoadCaseContainerSetup [source]#
Creates a
LoadCaseContainerSetup
for an already existing load case containerExample
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup()
>>> load_case_container_setup = simulation_setup.get_load_case_container_setup(name='load_case_container_name')
- Parameters:
name (str) – The name of the existing load case container for which to return a
LoadCaseContainerSetup
- Returns:
A
LoadCaseContainerSetup
object for the found load case container- Return type:
- Raises:
KeyError – Raised if no load case container with the given name was found
- get_study_setup(name: str) StudiesSetup [source]#
Creates and returns a
StudiesSetup
for an already existing studyExample
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup()
>>> study_setup = simulation_setup.get_study_setup(name='study_name')
- Parameters:
name (str) – The name of the existing study for which to return a
StudiesSetup
- Returns:
A
StudiesSetup
object for the found study- Return type:
- Raises:
KeyError – Raised if no study with the given name was found
- remove_data_table_setup(name: str) SimulationSetup [source]#
Removes a data table
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> simulation_setup.create_data_table_setup().set_name(name='data_table_name') # Creates a transient data table so that there is something to remove <more.transient_data_table.scripting_api.transient_data_table_setup.TransientDataTableSetup object at 0x...> >>> simulation_setup.remove_data_table_setup(name='data_table_name') # Assumes this data table exists <more.api.simulation.simulation_setup.SimulationSetup object at 0x...>
- Parameters:
name (str) – The name of the data table to remove
- Returns:
self
- Return type:
- Raises:
KeyError – Raised if no data table with the given name exists
- remove_load_case_container_setup(name: str) SimulationSetup [source]#
Removes a load case container
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup()
>>> simulation_setup.create_load_case_container_setup().set_name(name='load_case_container_name') # Creates a load case container so there is something to remove <more.api.simulation.load_cases.load_case_container_setup.LoadCaseContainerSetup object at 0x...> >>> simulation_setup.remove_load_case_container_setup(name='load_case_container_name') <more.api.simulation.simulation_setup.SimulationSetup object at 0x...>
- Parameters:
name (str) – The name of the load case container to remove
- Returns:
self
- Return type:
- Raises:
KeyError – Raised if no load case container with the given name exists
- remove_study_setup(name: str) SimulationSetup [source]#
Removes a study
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> simulation_setup.create_study_setup().set_name(name='study_name') <more.api.simulation.studies.studies_setup.StudiesSetup object at 0x...> >>> simulation_setup.remove_study_setup(name='study_name') <more.api.simulation.simulation_setup.SimulationSetup object at 0x...>
- Parameters:
name (str) – The name of the study to remove
- Returns:
self
- Return type:
- Raises:
KeyError – Raised if no study with the given name exists