LinkSpacerSetup#
Qualified name: loads.link_spacer.api.link_spacer_api.LinkSpacerSetup
- class loads.link_spacer.api.link_spacer_api.LinkSpacerSetup(item)[source]#
Bases:
LoadSetup
,TranslationSettableMixin
,RotationSettableMixin
The API handler for link spacers
The following example shows how to create a link spacer 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() >>> lcc_setup = simulation_setup.create_load_case_container_setup().set_name(name='Example LCC') >>> lc_setup = lcc_setup.create_load_case_setup(lc_type='Mechanical load case').set_name(name='Example LC') >>> link_spacer_setup = lc_setup.create_load_setup(load_type='Link spacer')
The next example shows how to get an API object for an already existing load.
Example
>>> from more.api import ApiGateway >>> api = ApiGateway(proj=proj) >>> simulation_setup = api.create_simulation_setup() >>> lcc_setup = simulation_setup.create_load_case_container_setup().set_name(name='Example LCC') >>> lc_setup = lcc_setup.create_load_case_setup(lc_type='Mechanical load case').set_name(name='Example LC')
>>> link_spacer_setup = lc_setup.get_load_setup(index=0) # The load under this index must already exist
Methods
Sets the value of an element of the DOF vector
Sets the values of the load vector to those given in the dictionary
Deprecated method
Sets the link for the associated link spacer
Sets the 'ru' value of the load vector
Sets the 'rv' value of the load vector
Sets the 'rw' value of the load vector
Sets the 'u' value of the load vector
Sets the 'v' value of the load vector
Sets the 'w' value of the load vector
- set_dof(dof_name, value) LinkSpacerSetup [source]#
Sets the value of an element of the DOF vector
See example at the top for how to create the setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_dof(dof_name='v', value=10)
- Returns:
self
- Return type:
- Raises:
TypeError – Raised if the supplied value is not a floating point number
NameNotFoundError – Raised if the given dof name is not supported
- set_dof_dict(dof_values_dict: Dict[str, float]) LinkSpacerSetup [source]#
Sets the values of the load vector to those given in the dictionary
See example at the top for how to create a link spacer setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_dof_dict(dof_values_dict={'u': 5, 'ru': 10, 'v': 2.0})
- Returns:
self
- Return type:
- Raises:
TypeError – Raised if the supplied value is not a floating point number
NameNotFoundError – Raised if a key in the supplied dictionary is not a recognized dof
- set_link(link) LinkSpacerSetup [source]#
Deprecated method
Deprecated
set_link will be removed in a future MORe release, it is replaced by
set_link_by_name()
- set_link_by_name(link_name: str) LinkSpacerSetup [source]#
Sets the link for the associated link spacer
See example at the top for how to create a link spacer setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_link_by_name(link_name='example link') # The link with this name must already exist
- Returns:
self
- Return type:
- Raises:
NameNotFoundError – Raised if no link has the supplied name
- set_ru(value: float) LinkSpacerSetup [source]#
Sets the ‘ru’ value of the load vector
See example at the top for how to create a link spacer setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_ru(value=10)
- Returns:
self
- Return type:
- Raises:
TypeError – Raised if the supplied value is not a floating point number
- set_rv(value: float) LinkSpacerSetup [source]#
Sets the ‘rv’ value of the load vector
See example at the top for how to create a link spacer setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_rv(value=10)
- Returns:
self
- Return type:
- Raises:
TypeError – Raised if the supplied value is not a floating point number
- set_rw(value: float) LinkSpacerSetup [source]#
Sets the ‘rw’ value of the load vector
See example at the top for how to create a link spacer setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_rw(value=10)
- Returns:
self
- Return type:
- Raises:
TypeError – Raised if the supplied value is not a floating point number
- set_u(value: float) LinkSpacerSetup [source]#
Sets the ‘u’ value of the load vector
See example at the top for how to create a link spacer setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_u(value=10)
- Returns:
self
- Return type:
- Raises:
TypeError – Raised if the supplied value is not a floating point number
- set_v(value: float) LinkSpacerSetup [source]#
Sets the ‘v’ value of the load vector
See example at the top for how to create a link spacer setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_v(value=10)
- Returns:
self
- Return type:
- Raises:
TypeError – Raised if the supplied value is not a floating point number
- set_w(value: float) LinkSpacerSetup [source]#
Sets the ‘w’ value of the load vector
See example at the top for how to create a link spacer setup object
Example
>>> link_spacer_setup = link_spacer_setup.set_w(value=10)
- Returns:
self
- Return type:
- Raises:
TypeError – Raised if the supplied value is not a floating point number