MBDyn-1.7.3
|
#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | mbc_t |
Connection data structure (partially opaque) More... | |
struct | mbc_rigid_t |
Reference node (AKA "rigid") stuff (partially opaque). More... | |
struct | mbc_nodal_t |
Nodal stuff (partially opaque). More... | |
struct | mbc_modal_t |
nodal stuff (partially opaque). More... | |
Enumerations | |
enum | ESCmd { ES_UNKNOWN = -1, ES_REGULAR_DATA = 2, ES_GOTO_NEXT_STEP = 4, ES_ABORT = 5, ES_REGULAR_DATA_AND_GOTO_NEXT_STEP = 6, ES_NEGOTIATION = 7, ES_OK = 8, ES_LAST } |
Legal commands. More... | |
enum | MBCType { MBC_MODAL = 0x0001U, MBC_NODAL = 0x0002U, MBC_MODAL_NODAL_MASK = (MBC_MODAL | MBC_NODAL), MBC_REF_NODE = 0x0004U, MBC_ACCELS = 0x0008U, MBC_LABELS = 0x0010U, MBC_ROT_THETA = 0x0100U, MBC_ROT_MAT = 0x0200U, MBC_ROT_EULER_123 = 0x0400U, MBC_ROT_NONE = 0x0000U, MBC_ROT_MASK = (MBC_ROT_THETA | MBC_ROT_MAT | MBC_ROT_EULER_123), MBC_REF_NODE_ROT_THETA = (MBC_ROT_THETA << 4), MBC_REF_NODE_ROT_MAT = (MBC_ROT_MAT << 4), MBC_REF_NODE_ROT_EULER_123 = (MBC_ROT_EULER_123 << 4), MBC_REF_NODE_ROT_MASK = (MBC_ROT_MASK << 4), MBC_LAST } |
Parameters used to control the communication type and fields. More... | |
#define MBC_F_ACCELS | ( | mbc | ) | MBC_F_GET(mbc, MBC_ACCELS) |
Definition at line 242 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), and tdata_().
#define MBC_F_LABELS | ( | mbc | ) | MBC_F_GET(mbc, MBC_LABELS) |
Definition at line 241 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), and tdata_().
#define MBC_F_REF_NODE | ( | mbc | ) | MBC_F_GET(mbc, MBC_REF_NODE) |
Definition at line 240 of file mbc.h.
Referenced by mbc_py_modal_negotiate(), mbc_py_nodal_negotiate(), tdata_(), trecv_(), and tsend_().
#define MBC_F_REF_NODE_ROT | ( | mbc | ) | MBC_F_GET(mbc, MBC_REF_NODE_ROT_MASK) |
#define MBC_F_ROT | ( | mbc | ) | MBC_F_GET(mbc, MBC_ROT_MASK) |
Definition at line 243 of file mbc.h.
Referenced by main(), mbc_py_nodal_negotiate(), tdata_(), test_run(), and trecv_().
#define MBC_F_ROT_EULER_123 | ( | mbc | ) | MBC_F_GET(mbc, MBC_ROT_EULER_123) |
#define MBC_F_ROT_REF_NODE | ( | mbc | ) | MBC_U_REF_NODE_ROT_2_ROT(MBC_F_GET((mbc), MBC_REF_NODE_ROT_MASK)) |
Definition at line 249 of file mbc.h.
Referenced by mbc_py_nodal_negotiate().
#define MBC_F_SET_REF_NODE | ( | mbc | ) | MBC_F_SET(mbc, MBC_REF_NODE) |
#define MBC_F_SET_ROT_EULER_123 | ( | mbc | ) | MBC_F_SET(mbc, MBC_ROT_EULER_123) |
#define MBC_F_SET_ROT_THETA | ( | mbc | ) | MBC_F_SET(mbc, MBC_ROT_THETA) |
Definition at line 371 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), and test_run().
#define MBC_N_DYNAMICS | ( | mbc | ) | ((void *)(MBC_N_KINEMATICS(mbc) + MBC_N_KINEMATICS_SIZE(mbc))) |
Definition at line 366 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 372 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), test_run(), and tsend_().
Definition at line 362 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), and test_run().
Definition at line 373 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), test_run(), and tsend_().
Definition at line 368 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 370 of file mbc.h.
Referenced by mbc_py_nodal_negotiate().
Definition at line 365 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), test_run(), and trecv_().
#define MBC_N_SIZE | ( | mbc | ) | (MBC_N_KINEMATICS_SIZE(mbc) + MBC_N_DYNAMICS_SIZE(mbc)) |
Definition at line 364 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 363 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 367 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 369 of file mbc.h.
Referenced by mbc_py_nodal_negotiate().
Definition at line 518 of file mbc.h.
Referenced by main(), and mbc_py_modal_negotiate().
Definition at line 516 of file mbc.h.
Referenced by main(), and mbc_py_modal_negotiate().
Definition at line 517 of file mbc.h.
Referenced by main(), and mbc_py_modal_negotiate().
Definition at line 291 of file mbc.h.
Referenced by mbc_py_nodal_negotiate().
#define MBC_R_DYNAMICS | ( | mbc | ) | ((void *)(MBC_R_KINEMATICS(mbc) + MBC_R_KINEMATICS_SIZE(mbc))) |
Definition at line 286 of file mbc.h.
Referenced by main(), mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 292 of file mbc.h.
Referenced by main(), mbc_py_modal_negotiate(), mbc_py_nodal_negotiate(), test_run(), and tsend_().
Definition at line 282 of file mbc.h.
Referenced by mbc_py_nodal_negotiate(), and test_run().
Definition at line 293 of file mbc.h.
Referenced by main(), mbc_py_modal_negotiate(), mbc_py_nodal_negotiate(), test_run(), and tsend_().
Definition at line 288 of file mbc.h.
Referenced by main(), mbc_py_modal_negotiate(), mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 290 of file mbc.h.
Referenced by mbc_py_nodal_negotiate().
Definition at line 285 of file mbc.h.
Referenced by main(), mbc_py_modal_negotiate(), mbc_py_nodal_negotiate(), test_run(), and trecv_().
#define MBC_R_SIZE | ( | mbc | ) | (MBC_R_KINEMATICS_SIZE(mbc) + MBC_R_DYNAMICS_SIZE(mbc)) |
Definition at line 284 of file mbc.h.
Referenced by main(), mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 283 of file mbc.h.
Referenced by main(), mbc_py_modal_negotiate(), mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 287 of file mbc.h.
Referenced by main(), mbc_py_modal_negotiate(), mbc_py_nodal_negotiate(), test_run(), and trecv_().
Definition at line 289 of file mbc.h.
Referenced by mbc_py_nodal_negotiate().
#define MBC_U_REF_NODE_ROT_2_ROT | ( | u | ) | (((u) & MBC_REF_NODE_ROT_MASK) >> 4) |
#define MBC_U_ROT_2_REF_NODE_ROT | ( | u | ) | (((u) & MBC_ROT_MASK) << 4) |
Definition at line 248 of file mbc.h.
Referenced by StructMappingExtForce::Prepare(), and test_init().
enum ESCmd |
Legal commands.
The values of this enumeration appear as tags at the beginning of each communication.
Enumerator | |
---|---|
ES_UNKNOWN | |
ES_REGULAR_DATA | |
ES_GOTO_NEXT_STEP | |
ES_ABORT | |
ES_REGULAR_DATA_AND_GOTO_NEXT_STEP | |
ES_NEGOTIATION | |
ES_OK | |
ES_LAST |
enum MBCType |
Parameters used to control the communication type and fields.
Initialize communication using "inet" socket.
[in,out] | mbc | a pointer to a valid mbc_t structure |
[in] | host | hostname |
[in] | port | port number |
Connects to peer "inet" socket using hostname and port number; host and port must be defined. If peer is not listening, the behavior depends on mbc_t::timeout.
Referenced by main(), mbc_py_modal_initialize(), mbc_py_nodal_initialize(), and test_init().
int mbc_modal_destroy | ( | mbc_modal_t * | mbc | ) |
Destroy modal data.
[in,out] | mbc | pointer to a valid mbc_modal_t structure |
NOTE: does NOT free mbc.
Referenced by main(), and mbc_py_modal_destroy().
int mbc_modal_get_motion | ( | mbc_modal_t * | mbc | ) |
Get modal motion from peer.
[in,out] | pointer | to a valid mbc_modal_t structure |
After the call to this function succeeds:
Referenced by main(), and mbc_py_modal_recv().
int mbc_modal_init | ( | mbc_modal_t * | mbc, |
int | refnode, | ||
unsigned | modes | ||
) |
Initialize modal data.
[in,out] | mbc | pointer to a valid mbc_modal_t structure |
[in] | refnode | non-zero if reference node is defined |
[in] | modes | number of modes |
Either reference node motion must be defined (refnode != 0), or modes must be > 0, or both.
if modes > 0, this function calls malloc(3) to alloc memory that needs to be freed by calling mbc_modal_destroy()
Referenced by main(), and mbc_py_modal_initialize().
int mbc_modal_negotiate_request | ( | mbc_modal_t * | mbc | ) |
Negotiate modal data.
[in] | mbc | pointer to a valid mbc_modal_t structure |
At least reference node motion must be defined (MBC_F_REF_NODE(mbc) must be true), or modes > 0
The socket must be initialized and connected.
This function sends a negotiation request to the master.
Referenced by main(), and mbc_py_modal_negotiate().
int mbc_modal_negotiate_response | ( | mbc_modal_t * | mbc | ) |
Unused.
companion of above, provided for completeness; not used
int mbc_modal_put_forces | ( | mbc_modal_t * | mbc, |
int | last | ||
) |
Put forces to peer.
[in,out] | mbc | pointer to a valid mbc_modal_t structure |
[in] | last | true when at convergence |
if last is false, before calling this function:
if last is true and mbc_t::data_and_next is false, the output buffer is not sent; thus, there is no need to set generalized forces; otherwise, if mbc_t::data_and_next is true, the output buffer must be filled as described above.
Referenced by main(), and mbc_py_modal_send().
int mbc_nodal_destroy | ( | mbc_nodal_t * | mbc | ) |
Destroy nodal data.
[in,out] | mbc | pointer to a valid mbc_nodal_t structure |
NOTE: does NOT free mbc.
Referenced by mbc_py_nodal_destroy(), and test_run().
int mbc_nodal_get_motion | ( | mbc_nodal_t * | mbc | ) |
Get nodal motion from peer.
[in,out] | pointer | to a valid mbc_nodal_t structure |
After the call to this function succeeds:
Referenced by mbc_py_nodal_recv(), test_run(), and trecv_().
int mbc_nodal_init | ( | mbc_nodal_t * | mbc, |
unsigned | refnode, | ||
unsigned | nodes, | ||
unsigned | labels, | ||
unsigned | rot, | ||
unsigned | accels | ||
) |
Initialize nodal data.
[in,out] | mbc | pointer to a valid mbc_nodal_t structure |
[in] | refnode | non-zero if reference node is defined |
[in] | nodes | number of nodes |
[in] | labels | true to enable labels |
[in] | rot | orientation type |
[in] | accels | true to enable accelerations |
Either reference node motion must be defined (refnode != 0), or nodes must be > 0, or both.
if nodes > 0, this function calls malloc(3) to alloc memory that needs to be freed by calling mbc_nodal_destroy()
if labels != 0, labels are handled as well
rot must be one of MBCType MBC_ROT_*; if it is set to MBC_ROT_NONE, only positions and forces are handled.
if accels != 0, accelerations are handled as well.
Referenced by mbc_py_nodal_initialize(), and test_init().
int mbc_nodal_negotiate_request | ( | mbc_nodal_t * | mbc | ) |
Negotiate nodal data.
[in] | mbc | pointer to a valid mbc_nodal_t structure |
At least reference node motion must be defined (MBC_F_REF_NODE(mbc) must be true), or nodes > 0
The socket must be initialized and connected.
This function sends a negotiation request to the master.
Referenced by mbc_py_nodal_negotiate(), and test_init().
int mbc_nodal_negotiate_response | ( | mbc_nodal_t * | mbc | ) |
Unused.
int mbc_nodal_put_forces | ( | mbc_nodal_t * | mbc, |
int | last | ||
) |
Put forces to peer.
[in,out] | pointer | to a valid mbc_nodal_t structure |
[in] | last | true when at convergence |
if last is false, before calling this function:
if last is true and mbc_t::data_and_next is false, the output buffer is not sent; thus, there is no need to set forces and moments; otherwise, if mbc_t::data_and_next is true, the output buffer must be filled as described above.
Referenced by mbc_py_nodal_send(), test_run(), and tsend_().
Initialize communication using "unix" socket.
[in,out] | mbc | a pointer to a valid mbc_t structure |
[in] | path | pathname |
Connects to peer "unix" socket using pathname; path must be defined. If peer is not listening, the behavior depends on mbc::timeout.
Referenced by main(), mbc_py_modal_initialize(), mbc_py_nodal_initialize(), and test_init().