Node Masses

In Multiframe4D, a joint mass attached to a node within a structure is represented by a NodeMass object.  This object encapsulates all the properties of the mass such the node to which it is attached and the mass associated with each degree of freedom.  All the nodal masses in a structural model are contained within the NodeMasses collection that can be referenced directly from the Frame object using the property of the same name.

 

 

A summary of all the properties and methods of the NodeMass object are listed in the table below.

 

Property

Type

Description

Mass

Double

Get/Set the mass associated with a specific degree of freedom.

Masses

Variant

Get/Set the masses at every degree of freedom.

Node

Node/Variant

Get/Set node to which the mass is attached.

 

The Application, Frame, Number, Label and Index properties as well as the Delete method are common to many objects and are described in Chapter 2.

Adding Mass to a Node

A new joint mass is added to a frame using the AddMass method of the NodeMasses collection.  This method has two parameters that specify the node to which the mass is attached and the mass applied to the node.  Both of these parameters are of variant type.  As such, the node is identified by any value representing a single node.  The masses applied to the node are contained within an array of six values.  Each entry in the array corresponds to the mass applied in each of the degrees of freedom at the node.  The AddMass method returns a NodeMass object referencing the new joint mass added to the frame.  A simple example of adding a mass to a frame is shown below.  It demonstrates the different ways in which the parameters may be specified.

Dim myMass As Multiframe.NodeMass
Dim mass(1 To 6) As Double

’Setup values of masses in array
mass(1)=50.0
mass(2)=50.0
mass(3)=50.0
mass(4)=0.0
mass(5)=0.0
mass(6)=0.0

’ Add mass to nodes
With myFrame.NodeMasses
  Set myMass = .AddMass(1,mass)  ‘Add mass to node 1
  Set myMass = .AddMass(myFrame.Nodes(2),mass)  ‘Add mass to node 2
  Set myMass = .AddMass(3,Array(9,9,9,0,0,0))   ‘Add mass to node 3
End With

A mass can be added to a number of nodes in a single call using the AddMasses method of the NodeMasses collection.  The first parameter to this method is the nodes to which the mass will be added.  This is a variant parameter so any value representing a single node or a list of nodes will be accepted.  The second parameter specifies the mass to be added to each of the nodes identified by the first parameter.  This parameter is the same as that passed to the AddMass method described above.  The AddMasses method returns a NodeMassList containing references to each of the new joint masses added to the frame.  Some examples of how this method may be used as shown in the code below.

Dim myMassList As New Multiframe.NodeMassList
Dim myNodeList As New Multiframe.NodeList
Dim mass(1 To 6) As Double

’Setup values of masses in array
mass(1)=25.0
mass(2)=25.0
mass(3)=25.0
mass(4)=0.0
mass(5)=0.0
mass(6)=0.0

’ Add mass to nodes
With myFrame.NodeMasses
  ‘Add mass to a single node
  Set myMassList=.AddMasses(1,mass)
  Set myMassList=.AddMasses(myFrame.Nodes(2),mass)

  ‘Add masses to several nodes
  Set myMassList=.AddMasses(“3-5”,mass)         ‘Nodes 3 to 5
  myNodeList.Add “6-8”
  Set myMassList=.AddMasses(myNodeList,mass)    ‘Nodes 6 to 8

’Delete all node masses
  myMassList.Clear
  myMassList.Add myFrame.NodeMasses
  myMassList.Delete

’ Add masses to all nodes in structure
  Set myMassList=.AddMasses(myFrame.Nodes,mass)

End With

In this example, the Delete method of the NodeMassList object is used to remove all node masses from the frame.  In general this will be much faster than deleting each of the individual node masses as only a maximum of three calls across the Multiframe automation interface are required.
Properties

The Node property of the NodeMass object identifies the node to which the mass is applied.  This property, which provides a reference to a Node object, may also be used to change the node to which the mass is attached.

 

The magnitude of the mass applied to a node can be referenced via two properties of the NodeMass object.  The Mass property accepts a single parameter identifying a nodal degree of freedom and returns the magnitude of the mass associated with the specified degree of freedom.  The Masses property returns an array of six (6) values; each entry in the array corresponds to the mass acting in each of the nodal degrees of freedom.  An example of how these properties would be used is shown in the following script.

Dim myMass As Multiframe.NodeMass
Dim mass as variant
Dim I as long

’ Scale all masses in frame by a factor of 3
For each myMass in myFrame.NodeMasses
  mass = myMass.Masses
  For i=1 to 6
    mass(i) = mass(i)*3.0
  Next
  myMass.Masses = mass
Next

’Set z component of mass to zero in every mass in frame
For each myMass in myFrame.NodeMasses
  myMass.Mass(mfDOFz) = 0.0
Next