Python COM Interface#

Application#

class axisvm.com.axapp.IAxisVMApplication(*args, **kwargs)[source]#

Wrapper for the IAxisVMApplication COM interface.

property ApplicationClose: int#

Determines how AxisVM should close if other clients are connected; if it should show a message or disable AxisVM closing while COM client runs.

Read and write property.

Return type:

int

property AskCloseOnLastReleased: int#

Determines whether the COM server shutdown displays a query to close the AxisVM application as well.

Read and write property

Return type:

int

property AskSaveOnLastReleased: int#

If True, on any attempt to shutdown the COM server a dialog window pops up, to warn us to save our model.

Read and write property

Notes

The model should be saved after modification or if newer version of AxisVM is used.

property AxisVMPlatform: int#

Get AxisVM version type (32/64bit).

Returns:

  • 32 bit AxisVM -> 0

  • 64 bit AxisVM -> 1

Return type:

int

BringToFront() int[source]#

Bring AxisVM above other opened applications.

Returns:

1 if succesful, 0 otherwise.

Return type:

int

property Catalog: IAxisVMCatalog#

Get AxisVM catalog interface for standard materials and cross-sections.

ChangeUnitSystem(name: str) int[source]#

Bring AxisVM above other opened applications.

Returns:

1 if succesful, 0 otherwise.

Return type:

int

CustomFunction(customId: int, jsonIN: str, jsonOUT: str)[source]#

This function was introduced to allow for new functions and features which will be fully implemented in a future version of the COM server.

Parameters:
  • customId (str) – Custom function index.

  • jsonIN (str) – Input parameters in JSON format.

  • jsonOUT (str) – Output parameters in JSON format.

Returns:

  • jsonOUT (str) – Output parameters in JSON format.

  • int – Number of fields in JSON output if call is successful, otherwise an error code errJSONpropertyMissing or errNotImplemented.

DisableMainForm()[source]#

Disable all controls on AxisVM form including the selection toolbar.

EnableMainForm()[source]#

Enable all controls on AxisVM form.

HandleMessages()[source]#

Handles the messages in AxisVM and the COM client while the COM client is blocking the thread being executed. It is used as the body of a loop, that will continue to run till an external event sets a flag. The flag is set in the COM client usually through an event such as IAxisVMModelsEvents.SelectionProcessingChanged, when for example it is called with NewStatus = false (signalling the fact that the user has ended the selection process). While the thread being executed is blocked, the COM client will still receive events indirectly through HandleMessages, making it possible to process those events and ultimately to set the flag that will unblock the thread which was blocked through the loop.

MessageDlg(title: str, message: str, dlgtype, buttons: int) int[source]#

Shows a message dialog in AxisVM.

Parameters:
  • title (str) – Title of the dialog window.

  • message (str) – Message text of the dialog window.

  • dlgtype (EMessageDialogType) – Dialog type.

  • buttons (int) – This value can be calculated by adding up the EMessageDialogButton values of the required buttons( e.g. for showing YES and NO buttons; values is: mdbNo + mdbYes).

Returns:

The value of the button the user clicked

Return type:

int

property Models: IAxisVMModels#

Returns a pointer object to the IAxisVMModels COM interface.

Quit() None[source]#

Stops, unloads and releases memory taken by COM clients (addons, plugins and addon-plugins), releases the Python resources associated with the COM connection, then closes the application.

UnLoadCOMclients() int[source]#

Stops, unloads and releases memory taken by COM clients (addons, plugins and addon-plugins), then closes the application.

Returns:

Returns 1 if succesful.

Return type:

int

property app: object#

Returns a pointer object to the IAxisVMApplication COM interface of the embedding AxisVM instance.

property model: IAxisVMModel#

Returns a pointer object to the IAxisVMModel COM interface of the active model in AxisVM.

Notes

As of now, AxisVM only supports one active model at once, but this may change later. Nontheless, the interface is designed as if it was able to handle multiple active models.

new_model() IAxisVMModel[source]#

Creates new model and returns a pointer object to its IAxisVMModel COM interface. Optinally, it saves the model, given that a valid file path is provided.

Model#

class axisvm.com.axmodel.IAxisVMModel(*args, app=None, parent=None, **kwargs)[source]#

Wrapper for the IAxisVMModel COM interface.

property Calculation: IAxisVMCalculation#

Returns a pointer object to the IAxisVMCalculation COM interface.

property Domains: IAxisVMDomains#

Returns a pointer object to the IAxisVMDomains COM interface.

property Lines: IAxisVMLines#

Returns a pointer object to the IAxisVMLines COM interface.

property LoadCombinations: IAxisVMLoadCombinations#

Returns a pointer object to the IAxisVMLoadCombinations COM interface.

property Materials: IAxisVMMaterials#

Returns a pointer object to the IAxisVMMaterials COM interface.

property Members: IAxisVMMembers#

Returns a pointer object to the IAxisVMMembers COM interface.

property MeshSurfaceIds: ndarray#

Returns the indices of the surfaces of all domains in the model as a NumPy array.

property NodalSupports: IAxisVMNodalSupports#

Returns a pointer object to the IAxisVMNodalSupports COM interface.

property Nodes: IAxisVMNodes#

Returns a pointer object to the IAxisVMNodes COM interface.

property RCBeamDesign: IAxisVMRCBeamDesign#

Returns a pointer object to the IAxisVMRCBeamDesign COM interface.

property Results: IAxisVMResults#

Returns a pointer object to the IAxisVMResults COM interface.

property Surfaces: IAxisVMSurfaces#

Returns a pointer object to the IAxisVMSurfaces COM interface.

property Windows: IAxisVMWindows#

Returns a pointer object to the IAxisVMWindows COM interface.

property app: AxWrapper#

Returns the application.

coordinates(ids: Iterable | None = None) ndarray[source]#

Returns the coordinates of the points in the model as a NumPy array.

Parameters:

ids (Union[int, Iterable], Optional) – Indices of points, whose coordinates are to be returned. If there are no indices specified, coordinates for all points are returned. Default is None.

Return type:

numpy.ndarray

critical_xlam_data(*, combination_type: int | None = None, analysis_type: int = 0, **__)[source]#

Returns critical XLAM data.

Parameters:
  • combination_type (int, Optional) – Default is None.

  • analysis_type (int, Optional) – Default is 0.

dof_solution(*, displacement_system: str | int = 1, load_case_id: int | None = None, load_level: int | None = None, mode_shape: int | None = None, time_step: int | None = None, load_combination_id: int | None = None, case: str | None = None, combination: str | None = None, **__) ndarray[source]#

Returns degree of freedom solution for the whole model as a NumPy array.

Parameters:
  • displacement_system (Union[str, int], Optional) – 0 for local, 1 for global. Default is 1.

  • load_case_id (int, Optional) – Default is None.

  • load_level (int, Optional) – Default is None.

  • mode_shape (int, Optional) – Default is None.

  • time_step (int, Optional) – Default is None.

  • load_combination_id (int, Optional) – Default is None.

  • case (str, Optional) – The name of a loadcase. Default is None.

  • combination (str, Optional) – The name of a load combination. Default is None.

Return type:

numpy.ndarray

generalized_surface_forces(*args, **kwargs) ndarray[source]#

Returns internal forces and moments for all surfaces in the model.

points(ids: int | Iterable | None = None) PointCloud[source]#

Returns the points of the model as an instance of sigmaepsilon.mesh.space.PointCloud.

Parameters:

ids (Union[int, Iterable], Optional) – The indices of the nodes for which the coordinates should be returned. If not spefified, coordinates for all the points in the model are returned. Default is None.

surface_stresses(*args, **kwargs) ndarray[source]#

Returns stresses for all surfaces in the model.

topology() TopologyArray[source]#

Returns the topology of the model as an instance of sigmaepsilon.mesh.TopologyArray.

Calculation#

class axisvm.com.axcalculation.IAxisVMCalculation(*args, model=None, **kwargs)[source]#

Wrapper for the IAxisVMCalculation COM interface.

LinearAnalysis(*args, interact: bool = False, show: bool = False, autocorrect: bool = True)[source]#

Performs a linear analysis on the structure.

Parameters:
  • *args (tuple, Optional) – If there is a positional argument, it is considered as a valid argument to the LinearAnalysis method of the IAxisVMCalculation interface, and all other paramaters are ignored.

  • interact (bool, Optional.) – If True, the user has to interact with the program to answer questions arising during the analysis. Default is False.

  • show (bool, Optional.) – Whether the calculation window should be visible or not. Default is False.

  • autocorrect (bool, Optional.) – If True, AxisVM tries to correct problems automatically during the analysis. Default is True.

Nodes#

class axisvm.com.axnode.IAxisVMNodes(*args, model=None, **kwargs)[source]#

Wrapper for the IAxisVMNodes COM interface.

connected_surfaces(flatten: bool = False, as_dict: bool = False, **kwargs) dict | list[source]#

Returns surfaces connected by the specified nodes. For the details of specification of nodes see the documentation of get_indices(). If as_dict == True, the result is a dictionary that maps node indices to lists of surfaces.

get_indices(*args, interactive: bool = False, **kwargs) List[int][source]#

Returns a list of integers, depending on the arguments. It can be used to turn an arbitrary specification of nodes into a list of indices. Individual items can be specified, but the result is always a list. If there are no valid specifiers, the function either gets the selected nodes from AxisVM, or if there is none, a selection dialog shows up in AxisVM and the function is called again with valid specifiers emerging from any of these scenarios.

Possible keys and values

  • node : a single node record

  • nodes : a list of node records

  • ID : int, a single node index

  • IDs : [int], a sequence of node indices

  • UID : int, a single unique node index

  • UIDs : [int], a sequence of unique node indices

Note

The call accepts the trivial keys ‘ID’ and ‘IDs’ to support automatization, where demand for trivial inputs is possible.

Return type:

List[int]

Examples

To get indices of nodes from a selection in AxisVM.

>>> axvm = start_AxisVM(visible=True, daemon=True)
>>> axvm.model = examples.download_bernoulli_grid()
>>> axvm.model.Nodes.get_indices()
get_record(*args, interactive: bool = False, **kwargs) RNode | List[RNode][source]#

Returns a list of node records or a single record, which can be specified by keyword arguments. It can be used to turn an arbitrary specification of nodes in an embedded situation into a list of node recirds. For that reason it includes trivial keys. Individual elements can be specified, but the result is always a list. If there are no valid specifiers, then

  1. if argument ‘all’ is provided, all of the nodes of the model are returned

  2. if interactive == True, function either gets the selected nodes from AxisVM, or if there is none, a selection dialog shows up in AxisVM and the function is called again with valid specifiers emerging from any of these scenarios.

Parameters:

**kwargs (dict, Optional) –

Possible keyword arguments:

  • node : a single node, returns a sigle record

  • nodes : a list of nodes, returns a list of records

  • ID : int, a single nodeID

  • IDs : list of int, a sequence of nodeIDs

  • UID : int, a single nodeUID

  • UIDs : list of int, a sequence of nodeUIDs

Returns:

A single record, or a list of records, depending on the input.

Return type:

Union[axtlb.RNode, List[axtlb.RNode]]

get_selected(interactive: bool = False, msg: str | None = None) list | None[source]#

Returns a dictionary of nodes mapping node indices to node records, or None if the selection is invalid.

Parameters:
  • interactive (bool, Optional) – If nothing is selected when calling this function and this parameter is True, a selection box appears and nodes can be selected through the graphical user interface. If False, the function only returns a list of nodes if they are already selected when this function is called. Default is False.

  • msg (str, Optional) – The message to show, only if ‘interactive’ is True. Default is None, in which case a default message is shown.

get_selected_indices(interactive: bool = False) list | None[source]#

Returns a list of nodeIDs. The result is always iterable, even if it contains only one item.

select(clear: bool = True, msg: str | None = None) list | None[source]#

Shows up a selectiondialog for nodes in AxisVM and returns the selected nodes if succesful or None is nothing is selected.

Parameters:
  • clear (boolean, Optional) – Clears selection if True. Default is True.

  • msg (str, Optional) – The message to show. If not provided, a default message is shown. Default is True.

select_indices(clear=True, msg: str | None = None) list | None[source]#

Shows up a selectiondialog for nodes in AxisVM and returns the selected nodeIDs if succesful.

Parameters:
  • clear (boolean, Optional) – Clears selection state of all entities before the operation if True. Default is True.

  • msg (str, Optional) – The message to show. If not provided, a default message is shown. Default is True.

Lines and Members#

class axisvm.com.axline.IAxisVMLine(*args, parent=None, **kwargs)[source]#

Wrapper for the IAxisVMLine COM interface.

class axisvm.com.axline.IAxisVMLines(*args, model=None, **kwargs)[source]#

Wrapper for the IAxisVMLines COM interface.

class axisvm.com.axmember.IAxisVMMember(*args, parent=None, **kwargs)[source]#

Wrapper for the IAxisVMMember COM interface.

property attributes#

Returns the attributes of the member.

property frame: ndarray#

Returns the local coordinate frame of the member as a NumPy array.

get_line_id_and_line_section_id(analysis_type: int, member_section_id: int) Tuple[int][source]#
Parameters:
  • analysis_type (int) – The type of the analysis as an EAnalisysType value.

  • member_section_id (int) – The section index of the member.

Returns:

The index of the line and the line section.

Return type:

Tuple[int]

property member_attributes#

Returns the member attributes of the member.

property tr: ndarray#

Returns the transformation matrix of the member as a NumPy array.

class axisvm.com.axmember.IAxisVMMembers(*args, model=None, **kwargs)[source]#

Wrapper for the IAxisVMMembers COM interface.

get_connected_member_ids(nodeIDs: int | Iterable[int] | None = None, return_relative_indices: bool = True) Dict[int, Iterable[int] | Tuple[Iterable[int], Iterable[int]]][source]#

Returns the indices of the members connected by one or more nodes, and optionally the relative node indices of the connected members.

Parameters:
  • nodeIDs (Union[int, Iterable[int]], Optional) – The indices of the nodes for which the connected members should be returned. If not provided, connectivity information for all members are returned. Default is None.

  • return_relative_indices (bool, Optional) – If True relative indices (0 for stargin node, 1 for ending node) are also returned. Default is True.

Returns:

A dictionary where the keys are the provided node IDs, and the values are the indices, optionally as a tuple with the relative node indices of the connected members being the second item in each tuple.

Return type:

Dict[int, Union[Iterable[int], Tuple[Iterable[int], Iterable[int]]]]

get_connected_members(*args, **kwargs) Dict[int, Iterable[IAxisVMMember] | Tuple[Iterable[IAxisVMMember], Iterable[int]]][source]#

Returns the members connected by one or more nodes, and optionally the relative node indices of the connected members.

All the parameters are forwarded to get_connected_member_ids(), refer its documentation for the possible arguments.

Returns:

A dictionary where the keys are the provided node IDs, and the values are the members, optionally as a tuple with the relative node indices of the connected members being the second item in each tuple.

Return type:

Dict[int, Union[Iterable[IAxisVMMember], Tuple[Iterable[IAxisVMMember], Iterable[int]]]]

starting_and_ending_nodes(*args, i: int | None = None) ndarray[source]#

Returns indices of starting and ending nodes of the members.

Parameters:
  • *args (tuple, Optional) – Member indices. If specified, only the topology of these members are returned.

  • i (int, Optional) – The id of the member for which the topology should be returned.

Return type:

numpy.ndarray

topology(*args, i: int | None = None) TopologyArray[source]#

Returns the topology of the lines of the members of the model.

Parameters:
  • *args (tuple, Optional) – Member indices. If specified, only the topology of these members are returned.

  • i (int, Optional) – The id of the member for which the topology should be returned.

Return type:

sigmaepsilon.mesh.TopologyArray

Surfaces and Domains#

class axisvm.com.axsurface.IAxisVMSurface(*args, parent=None, **kwargs)[source]#

Wrapper for the IAxisVMSurface COM interface.

property attributes: dict#

Returns the attributes of the surface as a dictionary.

critical_xlam_efficiency(*, combination_type: int = 7, analysis_type: int = 0, component: int = 4, minmax_type: int = 1, **kwargs) Tuple[Iterable][source]#

Returns the critical efficiency of a component, and also data on the combination that yields it.

Parameters:
  • minmax_type (int, Optional) – According to EMinMaxType. 0 for min, 1 for max, 2 for minmax. Default is 1.

  • component (int, Optional) – According to EXLAMSurfaceEfficiency. Default is 4, which refers to the maximum overall efficiency.

  • combination_type (int, Optional) – According to ECombinationType. Default is 7 wich refers to the worst case of ULS combinations.

  • analysis_type (int, Optional) – According to EAnalysisType. Default is 0 which refers to linear statics.

Notes

It is the user who has to make sure that this call is only called on surfaces, that belong to an XLAM domain.

Returns:

A 2d float NumPy array of shape (nN, nX), where nN is the number of nodes of the surface and nX is the number of efficiency components, which are:

  • 0 : M - N - 0

  • 1 : M - N - 90

  • 2 : V - T

  • 3 : Vr - N

  • 4 : max

Return type:

numpy.ndarray

normal() ndarray[source]#

Returns the normal vector of the surface.

record() Any[source]#

Returns the record of the surface.

property surface_attributes: dict#

Returns the surface attributes of the surface as a dictionary.

topology() TopologyArray[source]#

Returns the node indices of the surface.

property tr: ndarray#

Returns the transformation matrix of the surface.

transformation_matrix() ndarray[source]#

Returns the transformation matrix of the surface.

xlam_stresses(case: str | Iterable | None = None, combination: str | Iterable | None = None, load_case_id: int | None = None, load_combination_id: int | None = None, displacement_system: int = 0, load_level: int | None = None, mode_shape: int | None = None, time_step: int | None = None, analysis_type: int = 0, frmt: str = 'array', factor: Iterable | None = None) dict | ndarray[source]#

Returns XLAM stresses either as a numpy.ndarray or as a dictionary.

Parameters:
  • displacement_system (int, Optional) – 0 for local, 1 for global. Default is 1.

  • load_case_id (int, Optional) – Default is None.

  • load_level (int, Optional) – Default is None.

  • mode_shape (int, Optional) – Default is None.

  • time_step (int, Optional) – Default is None.

  • load_combination_id (int, Optional) – Default is None.

  • case (Union[str, Iterable], Optional) – The name of a loadcase or an iterable of indices. Default is None.

  • combination (str, Optional) – The name of a load combination. Default is None.

  • analysis_type (int, Optional) – Default is 0.

  • frmt (str, Optional) – Controls the type of the result. With ‘array’ it is a 3d NumPy array, otherwise a dictionary. Default is ‘array’.

  • factor (Iterable, Optional) – Linear coefficients for the different load cases specified with ‘case’. If ‘case’ is an Iterable, ‘factor’ must be an Iterable of the same shape. Default is None.

Notes

1) It is the user who has to make sure that this call is only called on surfaces, that belong to an XLAM domain. 2) The returned stresses do not belong to the same position.

Returns:

If frmt is ‘array’, the result is a 2d float NumPy array of shape (nN, nX), where nN is the number of nodes of the surface and nX is the number of stress components, which are:

  • 0 : \(\sigma_{x}\) stress at the top, from bending

  • 1 : \(\sigma_{y}\) stress at the top, from bending

  • 2 : \(\tau_{xy}\) stress at the top, from bending

  • 3 : \(\sigma_{x}\) stress at the bottom, from bending

  • 4 : \(\sigma_{y}\) stress at the bottom, from bending

  • 5 : \(\tau_{xy}\) stress at the bottom, from bending

  • 6 : \(\sigma_{x, max}\) stress from stretching

  • 7 : \(\sigma_{y, max}\) stress from stretching

  • 8 : \(\tau_{xy, max}\) stress from stretching

  • 9 : \(\tau_{xz, max}\) shear stress

  • 10 : \(\tau_{yz, max}\) shear stress

  • 11 : \(\tau_{xz, r, max}\) rolling shear stress

  • 12 : \(\tau_{yz, r, max}\) rolling shear stress

If frmt is ‘dict’, the stresses are returned as a dictionary of 1d NumPy arrays, where indices from 0 to 12 are the keys of the values at the corders.

Return type:

numpy.ndarray or dict

class axisvm.com.axsurface.IAxisVMSurfaces(*args, model=None, **kwargs)[source]#

Wrapper for the IAxisVMSurfaces COM interface.

property attributes: dict#

Returns the attributes of all surfaces as a dictionary.

property frames: ndarray#

Returns the transformation matrices for all surfaces.

get_attributes(*args, i: int | Iterable[int] | None = None, fields: Iterable[str] | None = None, raw: bool = False, **__) Iterable[dict][source]#

Returns the attributes of the surfaces.

get_surface_attributes(*args, **kwargs) AxisVMAttributes[source]#

Returns the surface attributes of all surfaces as a dictionary.

property n: ndarray#

Returns the normal vectors of all surfaces.

normals(*args, i=None) ndarray[source]#

Returns the normal vectors of the surfaces as a NumPy array.

records(*args, **kwargs) Iterable[dict][source]#

Returns the raw attributes of the surfaces.

property surface_attributes: AxisVMAttributes#

Returns the surface attributes of all surfaces as a dictionary.

property t: ndarray#

Returns the thicknessws of all surfaces.

topology(*args, i: int | Iterable[int] | None = None) TopologyArray[source]#

Returns the topology of the surfaces as an instance of sigmaepsilon.mesh.TopologyArray.

property tr: ndarray#

Returns the transformation matrices for all surfaces.

transformation_matrices(*args, i: int | Iterable[int] | None = None) ndarray[source]#

Returns the transformation matrices of the surfaces as a NumPy array.

class axisvm.com.axdomain.IAxisVMDomain(*args, parent=None, **kwargs)[source]#

Wrapper for the IAxisVMDomain COM interface.

ABDS(*args, compose=True, **kwargs) ndarray | List[ndarray][source]#

Returns the ABDS matrix of the domain.

Parameters:

compose (bool, Optional) – If True, the result is one matrix, otherwise 4 submatrices. Default is True.

Returns:

One or four NumPy arrays.

Return type:

Union[numpy.ndarray, List[ndarray]]

GetCustomStiffnessMatrix(to_numpy: bool = False, compose: bool = True) Iterable[source]#

Returns the custom stiffness matrix, optionally as a NumPy array.

Paramters#

to_numpy: bool, Optional

If True, the result is a NumPy array, otherwise the raw results are returned. Default is False.

compose: bool, Optional

If True, the result is one matrix, otherwise 4 submatrices. Only if ‘to_numpy’ is True. Default is True.

See also

ABDS()

property IsXLAM: bool#

Returns True if the domain is an XLAM domain, False otherwise.

property attributes: dict#

Returns the attributes.

coordinates(frame: str = 'global') PointCloud[source]#

Returns the coordinates of the points related to the domain as an instance of sigmaepsilon.mesh.space.PointCloud.

detach_mesh(triangulate: bool = False, return_indices: bool = False) Tuple[PointCloud, TopologyArray][source]#

Returns the coordinate and topology arrays of the domain, detached from the structure.

Parameters:
  • triangulate (bool, Optional) – If True the domain is first triangulated. Default is False.

  • return_indices (bool, Optional) – If True the original node indices are also returned. Default is False.

Returns:

The points and the topology as arrays.

Return type:

Tuple[PointCloud, TopologyArray]

property domain_attributes: dict#

Returns the domain attributes.

property model: AxWrapper#

Returns the model of the domain.

plot(*_, **mpl_kw) None[source]#

Plots the surface using matplotlib.

Parameters:

**mpl_kw (dict, Optional) – Parameters to pass to triplot_mpl_mesh()

plot_dof_solution(*args, component: str = 'ez', mpl_kw: dict | None = None, displacement_system: str | int = 1, **kwargs) None[source]#

Plots the degree of freedom solution of a domain using matplotlib.

Parameters:
  • component (str, Optional) –

    Possible options are:

    • ’ex’ or ‘ux’ : displacement in X direction

    • ’ey’ or ‘uy’ : displacement in Y direction

    • ’ez’ or ‘uz’ : displacement in Z direction

    • ’fx’ or ‘rotx’ : rotation around X

    • ’fy’ or ‘roty’ : rotation around Y

    • ’fz’ or ‘rotz’ : rotation around Z

    Default is ‘ez’.

  • displacement_system (Union[str, int], Optional) – Sets the displacement system in which results are to be returned. Possible values are 1 (or ‘global) and 0 (or ‘local’). Default is 1, which means the global system.

  • **mpl_kw (dict, Optional) – Parameters to pass to triplot_mpl_data()

  • *args – Forwarded to :function:`~axisvm.com.axmodel.IAxisVMModel.dof_solution`.

  • **kwargs – Forwarded to :function:`~axisvm.com.axmodel.IAxisVMModel.dof_solution`.

Notes

This call does not require AxisVM to be visible.

Example

Import the necessary stuff,

>>> from axisvm.com.client import start_AxisVM
>>> from axisvm import examples
>>> import matplotlib.pyplot as plt

load a sample model,

>>> axvm = start_AxisVM(visible=False, daemon=True)
>>> axvm.model = examples.download_plate_ss()

run a linear analysis,

>>> axm = axvm.model
>>> axm.Calculation.LinearAnalysis()

and pot the results.

>>> fig, ax = plt.subplots(figsize=(20, 4))
>>> mpl_kw = dict(nlevels=15, cmap='rainbow', axis='on', offset=0., cbpad=0.5,
                  cbsize=0.3, cbpos='right', fig=fig, ax=ax)
>>> axm.Domains[1].plot_dof_solution(component='uz', mpl_kw=mpl_kw, case=1)

Finally, close the application.

>>> axvm.Quit()
plot_forces(*args, component: str = 'nx', mpl_kw: dict | None = None, smoothen: bool = False, **kwargs) None[source]#

Plots internal forces of a domain using matplotlib.

Parameters:
  • component (str, Optional) –

    Possible options are:

    • ’nx’ : \(n_x\) normal force

    • ’ny’ : \(n_y\) normal force

    • ’nxy’ : \(n_{xy}\) in plane shear force

    • ’mx’ : \(m_x\) bending moment

    • ’my’ : \(m_y\) bending moment

    • ’mxy’ : \(m_{xy}\) twisting moment

    • ’vx’ or ‘vxz’ : \(v_x\) shear force

    • ’vy’ or ‘vyz’ : \(v_y\) shear force

    Default is ‘nx’.

  • smoothen (int, Optional) – If the values should be smoothened or not. Default is False.

  • **mpl_kw (dict, Optional) – Parameters to pass to triplot_mpl_data()

plot_stresses(*args, component: str | None = None, mpl_kw: dict | None = None, source: str | None = None, z: str | None = None, **kwargs)[source]#

Plots internal forces of a domain using matplotlib.

Parameters:
  • component (str, Optional) –

    Possible options are:

    • ’sxx’ : \(\sigma_{x}\) stress

    • ’syy’ : \(\sigma_{y}\) stress

    • ’sxy’ : \(\tau_{xy}\) stress

    • ’sxz’ : \(\tau_{xz}\) stress

    • ’syz’ : \(\tau_{yz}\) stress

    • ’svm’ : \(\sigma_{VM}\) Von-Mises stress

    • ’s1’ : \(\sigma_{1}\) 1st principal stress

    • ’s2’ : \(\sigma_{2}\) 2nd principal stress

    • ’as’ : \(\alpha\) principal direction angle

    Default is ‘sxx_m_t’ for XLAM domains ‘sxx’ otherwise.

  • source (str, Optional) – Specifies the source of the possibe agents. Possible values are ‘m’ for bending and ‘n’ for normal action. Only for XLAM domains. Default is None.

  • z (str, Optional) – Specifies the location along the thickness. Possible values are ‘t’ for top, ‘b’ for bottom, ‘m’ for middle and ‘max’ for the location where the value takes its maximum (only for shear stresses). Default is None.

  • **mpl_kw (dict, Optional) – Parameters to pass to triplot_mpl_data()

  • stuff (Import the necessary) –

:param :

Examples

>>> from axisvm.com.client import start_AxisVM
>>> from axisvm import examples
>>> import matplotlib.pyplot as plt

load a sample model,

>>> axvm = start_AxisVM(visible=False, daemon=True)
>>> axvm.model = examples.download_plate_ss()

run a linear analysis,

>>> axm = axvm.model
>>> axm.Calculation.LinearAnalysis()

and pot the results.

>>> fig, ax = plt.subplots(figsize=(20, 4))
>>> mpl_kw = dict(cmap='rainbow', axis='on', offset=0., cbpad=0.5,
                  cbsize=0.3, cbpos='right', fig=fig, ax=ax)
>>> axm.Domains[1].plot_stresses(component='svm', mpl_kw=mpl_kw, case=1, z='t')

Finally, close the application.

>>> axvm.Quit()
record() Iterable[source]#

Returns the record of the domain.

surface_coordinates() Array[source]#

Returns the coordinates for each surface of the domain as an awkward.Array instance.

topology() TopologyArray[source]#

Returns the topology of the domain as a sigmaepsilon.mesh.TopologyArray.

property tr: ndarray#

Returns the transformation matrix of the domain.

transformation_matrix() ndarray[source]#

Returns the transformation matrix of the domain.

xlam_surface_stresses(case: str | int | None = None, combination: str | int | None = None, load_case_id: int | None = None, load_combination_id: int | None = None, load_level: int | None = None, mode_shape: int | None = None, time_step: int | None = None, displacement_system: str | int = 0, analysis_type: int = 0, frmt='array', factor=None) Array | dict[source]#

Returns XLAM stresses either as a numpy.ndarray or as a dictionary.

Parameters:
  • displacement_system (int, Optional) – 0 or ‘local’ for local, 1 or ‘global’ for global. Default is 1.

  • load_case_id (int, Optional) – Default is None.

  • load_level (int, Optional) – Default is None.

  • mode_shape (int, Optional) – Default is None.

  • time_step (int, Optional) – Default is None.

  • load_combination_id (int, Optional) – Default is None.

  • case (Union[str, Iterable], Optional) – The name of a loadcase or an iterable of indices. Default is None.

  • combination (str, Optional) – The name of a load combination. Default is None.

  • analysis_type (int, Optional) – Default is 0.

  • frmt (str, Optional) – Controls the type of the result. With ‘array’ it is a 3d Awkward array, otherwise a dictionary. Default is ‘array’.

  • factor (Iterable, Optional) – Linear coefficients for the different load cases specified with ‘case’. If ‘case’ is an Iterable, ‘factor’ must be an Iterable of the same shape. Default is None.

Notes

1) It is the user who has to make sure that this call is only called on surfaces, that belong to an XLAM domain. 2) The returned stresses do not belong to the same position.

Returns:

If frmt is ‘array’, the result is a 2d float Awkward array of shape (nN, nX), where nN is the number of nodes of the surface and nX is the number of stress components, which are:

  • 0 : \(\sigma_{x}\) stress at the top, from bending

  • 1 : \(\sigma_{y}\) stress at the top, from bending

  • 2 : \(\tau_{xy}\) stress at the top, from bending

  • 3 : \(\sigma_{x}\) stress at the bottom, from bending

  • 4 : \(\sigma_{y}\) stress at the bottom, from bending

  • 5 : \(\tau_{xy}\) stress at the bottom, from bending

  • 6 : max \(\sigma_{x}\) stress from stretching

  • 7 : max \(\sigma_{y}\) stress from stretching

  • 8 : max \(\tau_{xy}\) stress from stretching

  • 9 : max \(\tau_{xz}\) shear stress

  • 10 : max \(\tau_{yz}\) shear stress

  • 11 : max \(\tau_{xz,r}\) rolling shear stress

  • 12 : max \(\tau_{yz,r}\) rolling shear stress

If frmt is ‘dict’, the stresses are returned as a dictionary of 1d NumPy arrays, where indices from 0 to 12 are the keys of the values at the corders.

Return type:

awkward.Array or dict

class axisvm.com.axdomain.IAxisVMDomains(*args, model=None, **kwargs)[source]#

Wrapper for the IAxisVMDomains COM interface.