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: int, pid: int, nids: List[int], c1: int = 0, c2: int = 0, comment: str = '')[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
eidint

element id

pidint

property id (PMASS)

nidsList[int, int]

node ids

c1 / c2int; default=0

DOF for nid1 / nid2

commentstr; default=’’

a comment for the card

Centroid()[source]

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

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

Gets the Property ID of an element

Returns
pidint

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
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

center_of_mass()[source]
cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

property node_ids
raw_fields()[source]
safe_cross_reference(model: BDF, xref_errors)[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

type = 'CMASS1'
uncross_reference() → None[source]

Removes cross-reference links

write_card(size: int = 8, is_double: bool = False) → str[source]

Writes the card with the specified width and precision

Parameters
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns
msgstr

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
eidint

element id

massfloat

mass

nidsList[int, int]

node ids

c1 / c2int; default=None

DOF for nid1 / nid2

commentstr; default=’’

a comment for the card

Centroid()[source]

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

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

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

Parameters
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

center_of_mass()[source]
cp_name_map = {'M': 'mass'}
cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

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

exports the masses in a vectorized way

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

Gets the fields in their simplified form

Returns
fieldsList[varies]

the fields that define the card

safe_cross_reference(model: BDF, xref_errors)[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

type = 'CMASS2'
uncross_reference() → None[source]

Removes cross-reference links

validate()[source]

card checking method that should be overwritten

write_card(size: int = 8, is_double: bool = False) → str[source]

Writes the card with the specified width and precision

Parameters
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns
msgstr

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
eidint

element id

pidint

property id (PMASS)

nidsList[int, int]

SPOINT ids

commentstr; default=’’

a comment for the card

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

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

Parameters
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

center_of_mass()[source]
cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

property node_ids
raw_fields()[source]
type = 'CMASS3'
uncross_reference() → None[source]

Removes cross-reference links

write_card(size: int = 8, is_double: bool = False) → str[source]

Writes the card with the specified width and precision

Parameters
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns
msgstr

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
eidint

element id

massfloat

SPOINT mass

nidsList[int, int]

SPOINT ids

commentstr; default=’’

a comment for the card

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

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

property node_ids
raw_fields()[source]
safe_cross_reference(model: BDF, xref_errors)[source]
type = 'CMASS4'
uncross_reference() → None[source]

Removes cross-reference links

write_card(size: int = 8, is_double: bool = False) → str[source]

Writes the card with the specified width and precision

Parameters
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns
msgstr

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
eidint

element id

nidint

the node to put the mass matrix

mass_matrix(6, 6) float ndarray

the 6x6 mass matrix, M

cidint; default=0

the coordinate system for the mass matrix

commentstr; 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()[source]
static Mass()[source]
MassMatrix()[source]
Nid()[source]
_finalize_hdf5(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
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

center_of_mass()[source]
cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

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

Gets the fields in their simplified form

Returns
fieldsList[varies]

the fields that define the card

safe_cross_reference(model: BDF, xref_errors)[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

type = 'CONM1'
uncross_reference() → None[source]

Removes cross-reference links

update_by_cp_name(name, value)[source]
write_card(size: int = 8, is_double: bool = False) → str[source]

Writes the card with the specified width and precision

Parameters
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns
msgstr

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
eidint

element id

nidint

node id

massfloat

the mass of the CONM2

cidint; 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

commentstr; default=’’

a comment for the card

Centroid()[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(model: BDF) → np.ndarray[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()[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()[source]

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

Mass()[source]
Nid()[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
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

center_of_mass() → numpy.ndarray[source]
centroid_mass_inertia() → Tuple[np.ndarray, float, np.ndarray][source]
cid = None

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

cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

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)

property node_ids
offset(xyz_nid)[source]
raw_fields()[source]
repr_fields()[source]

Gets the fields in their simplified form

Returns
fieldsList[varies]

the fields that define the card

safe_cross_reference(model: BDF, xref_errors)[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

type = 'CONM2'
uncross_reference() → None[source]

Removes cross-reference links

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

card checking method that should be overwritten

write_card(size: int = 8, is_double: bool = False) → str[source]

Writes the card with the specified width and precision

Parameters
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns
msgstr

the string representation of the card

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

Bases: pyNastran.bdf.cards.base_card.Element

dummy init

repr_fields() → List[Optional[int, float, str]][source]

Gets the fields in their simplified form

Returns
fieldsList[varies]

the fields that define the card

write_card(size: int = 8, is_double: bool = False) → str[source]

Writes the card with the specified width and precision

Parameters
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns
msgstr

the string representation of the card

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

is the 3x3 matrix positive within tolerance