pyva.data.dof.DOF

class pyva.data.dof.DOF(ID, dof, doftype, repetition=False)

Bases: object

Class for degrees of freedom

The attributes are organise as vectors, so that a list of DOFs is represented by the node ID, the local orientation and physical unit.

ID

ID for nodes, elements, etc.

Type:

ndarray of int

dof

local degree of freedom e.g. 0 for sclaer 1,2,3 for x,y,z and 4,5,6 for RX,RY,RZ

Type:

ndarray of int

doftype

DOFtype

Type:

list

__init__(ID, dof, doftype, repetition=False)

Costructor of DOF objects

Parameters:
  • ID (ndarray, list, tuple of integer or integer) – ID for nodes, elements, etc.

  • dof (ndarray, list, tuple of integer or integer (of same dimension as ID)) – degree of freedom e.g. 0 for sclaer 1,2,3 for x,y,z and 4,5,6 for RX,RY,RZ

  • doftype (list of DOFtype, string or typeID) – type for DOF, e.g. pressure, displacent delivers unit information

  • repetition (bool, optional) – switch for repetition, when True doftype is used as pattern, every dof is repeted for every ID

Raises:

ValueError – For incorrect input values and value combinations.

Return type:

DOF object

Methods

__init__(ID, dof, doftype[, repetition])

Costructor of DOF objects

find(ID[, dof, repetition])

index method for finding index from ID and dof, ignoring doftype

hashtupel(**kwargs)

Returns a list of hash for fast sorting

index(other, **kwargs)

Get index of other into DOF of self

intersect(other, **kwargs)

Intersects DOF and provides indices into subparts

isuniform()

checks if all DOFs are of the same doftype

label()

Creates label

tupel()

Is this really used

union(other)

Unites DOF and provides indices into subparts

Attributes

ID

property method for ID

dBref

Provides reference value for dB values

dof

property method for dof

fulltype

Provides the full list of type IDs for indexing purposes

shape

size of DOF object

size

size of DOF object

type

property method for DOF(types)

typeID

unique_type

Provides unique type if all DOfs are of same type

property ID

property method for ID

Returns:

DESCRIPTION.

Return type:

tuple of IDs

property dBref

Provides reference value for dB values

For example the dBref of pressure is p0 = 20e-6 Pa

Raises:

ValueError – DESCRIPTION.

Returns:

reference value.

Return type:

float

property dof

property method for dof

Returns:

DESCRIPTION.

Return type:

TYPE

find(ID, dof=- 1, repetition=True)

index method for finding index from ID and dof, ignoring doftype

Parameters:
  • ID (list, tuple or ndarray) – node identifiers.

  • dof (degree of freedom, optional) – DESCRIPTION. The default is -1.

  • repetition (bool, optional) – When true every ID and dof is repeated. The default is True.

Raises:

ValueError – For repetition == False ID and dof must have same dimentions.

Returns:

index of found DOFs.

Return type:

ndarray of int

property fulltype

Provides the full list of type IDs for indexing purposes

Extends the list if repetitive type descriptions are used

Returns:

of typeIDs.

Return type:

np.ndarray

hashtupel(**kwargs)

Returns a list of hash for fast sorting

Parameters:

**kwargs (dict) – Arbitrarty keyword arguments.

Raises:

ValueError – For wrong keyword argument.

Returns:

of hashes.

Return type:

list

index(other, **kwargs)

Get index of other into DOF of self

Searches th positions of other in self and provides the index of these positions

ix = index(A,B)

A[ix] == B

Parameters:
  • other (DOF) – DOFs that are searched in self.

  • **kwargs (dict) – Arbitrary keyword arguments.

Returns:

Indexes.

Return type:

ndarray

intersect(other, **kwargs)

Intersects DOF and provides indices into subparts

Parameters:
  • other (TYPE) – DESCRIPTION.

  • **kwargs (TYPE) – DESCRIPTION.

Returns:

  • TYPE – DESCRIPTION.

  • idx1 (TYPE) – DESCRIPTION.

  • idx2 (TYPE) – DESCRIPTION.

isuniform()

checks if all DOFs are of the same doftype

Returns:

DESCRIPTION.

Return type:

bool

label()

Creates label

Label can be used for plotting or in log files

Returns:

label for all dofs.

Return type:

str

property shape

size of DOF object

Returns:

shape of DOF object.

Return type:

int

property size

size of DOF object

TODO size and shape are different things, should be corrected

Returns:

size.

Return type:

int

tupel()

Is this really used

Returns:

DESCRIPTION.

Return type:

list

property type

property method for DOF(types)

Returns:

of DOFtypes.

Return type:

list

union(other)

Unites DOF and provides indices into subparts

Parameters:

other (TYPE) – DESCRIPTION.

Returns:

  • TYPE – DESCRIPTION.

  • idx1 (TYPE) – DESCRIPTION.

  • idx2 (TYPE) – DESCRIPTION.

property unique_type

Provides unique type if all DOfs are of same type

Raises:

ValueError – When DOFtype is not unique.

Returns:

unique DOFtype.

Return type:

DOFtype