# Field

## Class Field()

```
Field(parent='MODEL', name='Field_n', label='Field_n', active=True,
b1=None, b2=None, k=36 * [0], c=36 * [0], f=6 * [0], length=6 * [0],
damping_type='CRATIO', cratio=0, origin=None, ornt_meth='TWOAXES')
```

Creates a field.

## Keyword Arguments

Argument | Data Type | Description | Default |
---|---|---|---|

name | String | The variable name. | Field_n, for next available integer n. |

label | String | The descriptive label. | Field_n, for next available integer n. |

parent | Object | The parent. | MODEL |

active | Boolean | Used to activate or deactivate this entity. | True |

b1 | Body | The first body constrained by the field. | None |

b2 | Body | The second body constrained by the field. | None |

k | NumericVector | Stiffness values of the 6x6 stiffness matrix. | 36*[0] |

c | NumericVector | The damping coefficients of the 6x6 damping matrix. | 36*[0] |

f | NumericVector | The force values for the six components (3 forces, 3 torques) at the corresponding lengths (length1 : length6). Zero force would mean a free length at the given lengths. | 6*[0] |

length | NumericVector | The reference lengths between the i marker and the j marker. | 6*[0] |

damping_type | Enum | Use CRATIO to apply damping as a percentage of stiffness, or use MATRIX to supply a 6x6 damping matrix. One of MATRIX or CRATIO. | CRATIO |

cratio | Double | Damping as a percentage of stiffness, applied to each stiffness. | 0 |

origin | Reference | The location. | None |

ornt_meth | Enum | The orientation method. One of TWOAXES, ONEAXIS or ANGLES. | TWOAXES |

ornt_dir1 | Enum | The direction used to orient axis 1. One of X, Y or Z. | Z |

align_meth1 | MultiRef | Alignment method for axis 1. One of Point, Vector or DxDyDz. | DxDyDz |

align_pt1 | Reference | The point when align_meth1 is Point. | None |

align_vec1 | Reference | The point reference when align_meth1 is Point. | None |

ornt_dir2 | Enum | The direction used to orient axis 2. One of X, Y or Z. | X |

align_meth2 | MultiRef | Alignment method for axis 1. One of Point, Vector or DxDyDz. | DxDyDz |

align_pt2 | Reference | The point when align_meth2 is Point. | None |

align_vec2 | Reference | The point reference when align_meth2 is Point. | None |

e1 | Double | The e1 Euler angle (z:x':z'') in radians with respect to rm. | 0 |

e2 | Double | The e2 Euler angle (z:x':z'') in radians with respect to rm. | 0 |

e3 | Double | The e3 Euler angle (z:x':z'') in radians with respect to rm. | 0 |

rm | Reference | The reference marker when ornt_meth is ANGLES. | Global_Frame |

x1 | Double | The direction cosine x1 for axis 1. | 0 |

y1 | Double | The direction cosine y1 for axis 1. | 0 |

z1 | Double | The direction cosine z1 for axis 1. | 1 |

x2 | Double | The direction cosine x2 for axis 2. | 1 |

y2 | Double | The direction cosine y2 for axis 2. | 0 |

z2 | Double | The direction cosine z2 for axis 2. | 0 |

user | Bool | Use user defined properties, if true. | False |

usr_sub | Function | The expression passed to the user dll. When using solver expressions, Templex syntax (within ``) is used and all variables are enclosed in braces {} and the rest is treated as literal. | 'USER()' |

local_funcname | String | The function/subroutine name. | 'MOTSUB' |

use_local_dll | Bool | Uses a local function instead of default if True. | False |

local_dll | File | The path of the local dll which has the local_funcname. | '' |

local_func_type | Enum | The type of the user subroutine. one of DLL, PYTHON or MATLAB. | 'DLL' |

## Instances

Instance | Type | Description |
---|---|---|

xaxis | Vector | The vector in x direction of orientation. |

yaxis | Vector | The vector in y direction of orientation. |

zaxis | Vector | The vector in z direction of orientation. |

## Examples

```
>>> # Import mview module
>>> from hw import mview
>>> #Create a field
>>> f = mview.Field()
>>> b_1 = mview.Body()
>>> b_2 = mview.Body()
>>> p1 = mview.Point()
>>> f.b1 = b_1
>>> f.b2 = b_2
>>> f.origin = p1
>>> f.b1.name
'Body_1'
>>> f.b2.name
'Body_2'
>>> f.damping_type
'CRATIO'
>>> # Change the damping value
>>> f.cratio = 0.4
>>> f.cratio
0.4
>>> # Change the force values for the six components
>>> f.f = [1,2,3,4,5,6]
>>> f.f
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
```