Model.equationcreate#
- Model.equationcreate(collection, independent_dofs, independent_weights, dependent, dof, weight, constant)#
Creates an equation between a dependent node and multiple independent nodes.
- Parameters:
collection (Collection) – The collection containing the entities the indepdent node entities.
independent_dofs (hwIntList) –
The list containing the degrees of freedom for which each respective independent node of the equation is active.
The DOFs use bit operations to represent the value. In order to specify multiple DOFs for a node, corresponding values for the required DOFs must be summed.
DOF1 - 1
DOF2 - 2
DOF3 - 4
DOF4 - 8
DOF5 - 16
DOF6 - 32
For example, there are 2 independent nodes with DOF1 and DOF3. The array of independent DOFs will be [5 5].
independent_weights (hwDoubleList) –
The list containing the weight for each respective independent node. The size of array is 6* dof_size.
For example, there are 2 independent nodes with DOF1 weights 1.2 and DOF3 weights 1.3.
The array of independent weights will be [1.2 1.2 1.2 1.2 1.2 1.2 1.3 1.3 1.3 1.3 1.3 1.3].
dependent (Entity) – The dependent node entity.
dof (hwBoolList) – The degree of freedom for which the dependent node of the equation is active (list of six Boolean values representing the 1-6 DoFs).
weight (double) – The dependent node weight.
constant (double) – The constant value assigned to all independent and dependent nodes.
Example#
Create an equation with dependent node with ID 100 and independent nodes with IDs 101 - 103 with all independent nodes have DOF1 , DOF3 and DOF4 , a weight of 1.23 and a constant of 5.0 , and the dependent node have DOF5#import hm import hm.entities as ent model = hm.Model() nodes = hm.Collection(model, ent.Node, list(range(101-104))) model.equationcreate( collection=nodes, independent_dofs=[13, 13, 13], independent_weights=[1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23, 1.23], dependent=ent.Node(model, 100), dof=[False, False, False, False, True, False], weight=1.23, constant=5.0 )