mass Module

Inheritance diagram of pyNastran.bdf.cards.elements.mass

All mass elements are defined in this file. This includes:

  • CMASS1
  • CMASS2
  • CMASS3
  • CMASS4
  • CONM1
  • CONM2

All mass elements are PointMassElement and Element objects.

class pyNastran.bdf.cards.elements.mass.CMASS1(eid, pid, nids, c1=0, c2=0, comment='')[source]

Bases: pyNastran.bdf.cards.elements.mass.PointMassElement

Defines a scalar mass element.

1 2 3 4 5 6 7
CMASS1 EID PID G1 C1 G2 C2

Creates a CMASS1 card

Parameters:
eid : int

element id

pid : int

property id (PMASS)

nids : List[int, int]

node ids

c1 / c2 : int; default=0

DOF for nid1 / nid2

comment : str; default=’‘

a comment for the card

Centroid(self)[source]

Centroid is assumed to be c=(g1+g2)/2. If g2 is blank, then the centroid is the location of g1.

G1(self)[source]
G2(self)[source]
Mass(self)[source]
Pid(self)[source]

Gets the Property ID of an element

Returns:
pid : int

the Property ID

classmethod _init_from_empty()[source]
_properties = ['node_ids']
classmethod add_card(card, comment='')[source]

Adds a CMASS1 card from BDF.add_card(...)

Parameters:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

center_of_mass(self)[source]
cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

node_ids
raw_fields(self)[source]
safe_cross_reference(self, model, xref_errors)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

type = 'CMASS1'
uncross_reference(self)[source]

Removes cross-reference links

write_card(self, size=8, is_double=False)[source]

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.mass.CMASS2(eid, mass, nids, c1, c2, comment='')[source]

Bases: pyNastran.bdf.cards.elements.mass.PointMassElement

Defines a scalar mass element without reference to a property entry.

1 2 3 4 5 6 7
CMASS2 EID M G1 C1 G2 C2

Creates a CMASS2 card

Parameters:
eid : int

element id

mass : float

mass

nids : List[int, int]

node ids

c1 / c2 : int; default=None

DOF for nid1 / nid2

comment : str; default=’‘

a comment for the card

Centroid(self)[source]

Centroid is assumed to be c=(g1+g2)/2. If g2 is blank, then the centroid is the location of g1.

G1(self)[source]
G2(self)[source]
Mass(self)[source]
classmethod _init_from_empty()[source]
_properties = ['node_ids']
classmethod add_card(card, comment='')[source]

Adds a CMASS2 card from BDF.add_card(...)

Parameters:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

center_of_mass(self)[source]
cp_name_map = {'M': 'mass'}
cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

classmethod export_to_hdf5(h5_file, model, eids)[source]

exports the masses in a vectorized way

node_ids
raw_fields(self)[source]
repr_fields(self)[source]

Gets the fields in their simplified form

Returns:
fields : List[varies]

the fields that define the card

safe_cross_reference(self, model, xref_errors)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

type = 'CMASS2'
uncross_reference(self)[source]

Removes cross-reference links

validate(self)[source]

card checking method that should be overwritten

write_card(self, size=8, is_double=False)[source]

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.mass.CMASS3(eid, pid, nids, comment='')[source]

Bases: pyNastran.bdf.cards.elements.mass.PointMassElement

Defines a scalar mass element that is connected only to scalar points.

1 2 3 4 5
CMASS3 EID PID S1 S2

Creates a CMASS3 card

Parameters:
eid : int

element id

pid : int

property id (PMASS)

nids : List[int, int]

SPOINT ids

comment : str; default=’‘

a comment for the card

Centroid(self)[source]
Mass(self)[source]
S1(self)[source]
S2(self)[source]
classmethod _init_from_empty()[source]
_properties = ['node_ids']
classmethod add_card(card, comment='')[source]

Adds a CMASS3 card from BDF.add_card(...)

Parameters:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

center_of_mass(self)[source]
cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

node_ids
raw_fields(self)[source]
type = 'CMASS3'
uncross_reference(self)[source]

Removes cross-reference links

write_card(self, size=8, is_double=False)[source]

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.mass.CMASS4(eid, mass, nids, comment='')[source]

Bases: pyNastran.bdf.cards.elements.mass.PointMassElement

Defines a scalar mass element that is connected only to scalar points, without reference to a property entry

1 2 3 4 5
CMASS4 EID M S1 S2

Creates a CMASS4 card

Parameters:
eid : int

element id

mass : float

SPOINT mass

nids : List[int, int]

SPOINT ids

comment : str; default=’‘

a comment for the card

Centroid(self)[source]
Mass(self)[source]
S1(self)[source]
S2(self)[source]
classmethod _init_from_empty()[source]
_properties = ['node_ids']
classmethod add_card(card, icard=0, comment='')[source]
center_of_mass(self)[source]
cp_name_map = {'M': 'mass'}
cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

node_ids
raw_fields(self)[source]
safe_cross_reference(self, model, xref_errors)[source]
type = 'CMASS4'
uncross_reference(self)[source]

Removes cross-reference links

write_card(self, size=8, is_double=False)[source]

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.mass.CONM1(eid, nid, mass_matrix, cid=0, comment='')[source]

Bases: pyNastran.bdf.cards.elements.mass.PointMassElement

Concentrated Mass Element Connection, General Form Defines a 6 x 6 symmetric mass matrix at a geometric grid point

1 2 3 4 5 6 7 8 9
CONM1 EID G CID M11 M21 M22 M31 M32
  M33 M41 M42 M43 M44 M51 M52 M53
  M54 M55 M61 M62 M63 M64 M65 M66

Creates a CONM1 card

Parameters:
eid : int

element id

nid : int

the node to put the mass matrix

mass_matrix : (6, 6) float ndarray

the 6x6 mass matrix, M

cid : int; default=0

the coordinate system for the mass matrix

comment : str; default=’‘

a comment for the card

::
[M] = [M11 M21 M31 M41 M51 M61]

[ M22 M32 M42 M52 M62] [ M33 M43 M53 M63] [ M44 M54 M64] [ Sym M55 M65] [ M66]

static Centroid()[source]
Cid(self)[source]
static Mass()[source]
MassMatrix(self)[source]
Nid(self)[source]
_finalize_hdf5(self, encoding)[source]

hdf5 helper function

classmethod _init_from_empty()[source]
_properties = ['node_ids']
classmethod add_card(card, comment='')[source]

Adds a CONM2 card from BDF.add_card(...)

Parameters:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

center_of_mass(self)[source]
cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

node_ids
raw_fields(self)[source]
repr_fields(self)[source]

Gets the fields in their simplified form

Returns:
fields : List[varies]

the fields that define the card

safe_cross_reference(self, model, xref_errors)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

type = 'CONM1'
uncross_reference(self)[source]

Removes cross-reference links

update_by_cp_name(self, name, value)[source]
write_card(self, size=8, is_double=False)[source]

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.mass.CONM2(eid, nid, mass, cid=0, X=None, I=None, comment='')[source]

Bases: pyNastran.bdf.cards.elements.mass.PointMassElement

1 2 3 4 5 6 7 8
CONM2 EID NID CID MASS X1 X2 X3
  I11 I21 I22 I31 I32 I33  
CONM2 501274 11064   132.274      

Creates a CONM2 card

Parameters:
eid : int

element id

nid : int

node id

mass : float

the mass of the CONM2

cid : int; default=0

coordinate frame of the offset (-1=absolute coordinates)

X : (3, ) List[float]; default=None -> [0., 0., 0.]

xyz offset vector relative to nid

I : (6, ) List[float]; default=None -> [0., 0., 0., 0., 0., 0.]

mass moment of inertia matrix about the CG I11, I21, I22, I31, I32, I33 = I

comment : str; default=’‘

a comment for the card

Centroid(self)[source]

This method seems way more complicated than it needs to be thanks to all these little caveats that don’t seem to be supported.

Centroid_no_xref(self, model)[source]

This method seems way more complicated than it needs to be thanks to all these little caveats that don’t seem to be supported.

Cid(self)[source]
I = None

Mass moments of inertia measured at the mass center of gravity in the coordinate system defined by field 4. If CID = -1, the basic coordinate system is implied. (Real) I11, I21, I22, I31, I32, I33 = I

Inertia(self)[source]

Returns the 3x3 inertia matrix .. warning:: doesnt handle offsets or coordinate systems

Mass(self)[source]
Nid(self)[source]
X = None

Offset distances from the grid point to the center of gravity of the mass in the coordinate system defined in field 4, unless CID = -1, in which case X1, X2, X3 are the coordinates, not offsets, of the center of gravity of the mass in the basic coordinate system. (Real)

classmethod add_card(card, comment='')[source]

Adds a CONM2 card from BDF.add_card(...)

Parameters:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

center_of_mass(self)[source]
cid = None

Coordinate system identification number. For CID of -1; see X1, X2, X3 below. (Integer > -1; Default = 0)

cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

eid = None

Element identification number. (0 < Integer < 100,000,000)

classmethod export_to_hdf5(h5_file, model, eids)[source]

exports the elements in a vectorized way

mass = None

Mass value. (Real)

nid = None

Grid point identification number. (Integer > 0)

node_ids
offset(self, xyz_nid)[source]
raw_fields(self)[source]
repr_fields(self)[source]

Gets the fields in their simplified form

Returns:
fields : List[varies]

the fields that define the card

safe_cross_reference(self, model, xref_errors)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

type = 'CONM2'
uncross_reference(self)[source]

Removes cross-reference links

update_by_cp_name(self, name, value)[source]
validate(self)[source]

card checking method that should be overwritten

write_card(self, size=8, is_double=False)[source]

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

write_card_16(self, is_double=False)[source]
class pyNastran.bdf.cards.elements.mass.PointMassElement[source]

Bases: pyNastran.bdf.cards.base_card.Element

repr_fields(self)[source]

Gets the fields in their simplified form

Returns:
fields : List[varies]

the fields that define the card

write_card(self, size=8, is_double=False)[source]

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

write_card_16(self, is_double=False)[source]
pyNastran.bdf.cards.elements.mass.is_positive_semi_definite(A, tol=1e-08)[source]

is the 3x3 matrix positive within tolerance