Model Class Reference
Kynema API
A flexible multibody structural dynamics code for wind turbines
|
Struct to define the connectivity structure of elements, nodes, and constraints defining an Kynema problem. More...
#include <model.hpp>
Public Member Functions | |
Model ()=default | |
Default constructor. | |
Model (std::array< double, 3 > gravity) | |
Constructor with gravity specified. | |
void | SetGravity (double x, double y, double z) |
Sets the gravity components for the model. | |
NodeBuilder | AddNode () |
Adds a node to the model. | |
const Node & | GetNode (size_t id) const |
Returns a node by ID. | |
Node & | GetNode (size_t id) |
Returns a node by ID. | |
size_t | NumNodes () const |
Gets the number of nodes present in the model. | |
const std::vector< Node > & | GetNodes () const |
Returns constant reference to nodes vector. | |
size_t | AddBeamElement (std::span< const size_t > node_ids, std::span< const BeamSection > sections, std::span< const std::array< double, 2 > > quadrature) |
Adds a beam element to the model. | |
const BeamElement & | GetBeamElement (size_t id) const |
Returns a beam element by ID. | |
BeamElement & | GetBeamElement (size_t id) |
Returns a beam element by ID. | |
const std::vector< BeamElement > & | GetBeamElements () const |
Returns a reference to the beam elements present in the model. | |
size_t | NumBeamElements () const |
Returns the number of beam elements present in the model. | |
BeamsInput | CreateBeamsInput () const |
Createsa Beams input file based on the beam elements in the model. | |
template<typename DeviceType > | |
Beams< DeviceType > | CreateBeams () const |
Createsa Beams structure based on the beam elements in the model. | |
void | TranslateBeam (size_t beam_elem_id, const std::array< double, 3 > &displacement) |
Translate all beam nodes by given displacement. | |
void | RotateBeamAboutPoint (size_t beam_elem_id, const std::array< double, 4 > &displacement_quaternion, const std::array< double, 3 > &point) |
Rotate all beam nodes by given quaternion about a given point. | |
void | SetBeamVelocityAboutPoint (size_t beam_elem_id, const std::array< double, 6 > &velocity, const std::array< double, 3 > &point) |
Set the translational and rotational velocity of the beam about a given point. | |
void | SetBeamAccelerationAboutPoint (size_t beam_elem_id, const std::array< double, 6 > &acceleration, const std::array< double, 3 > &omega, const std::array< double, 3 > &point) |
Set the acceleration of the beam about a given point. | |
size_t | AddMassElement (const size_t node_id, const std::array< std::array< double, 6 >, 6 > &mass) |
Adds a mass element to the model. | |
const MassElement & | GetMassElement (size_t id) const |
Returns a mass element by ID. | |
MassElement & | GetMassElement (size_t id) |
Returns a mass element by ID. | |
const std::vector< MassElement > & | GetMassElements () const |
Returns a reference to the mass elements present in the model. | |
size_t | NumMassElements () const |
Returns the number of mass elements present in the model. | |
template<typename DeviceType > | |
Masses< DeviceType > | CreateMasses () const |
Create a a masses struct based on the mass elements present in the model. | |
size_t | AddSpringElement (const size_t node1_id, const size_t node2_id, const double stiffness, const double undeformed_length) |
Adds a spring element to the model. | |
const SpringElement & | GetSpringElement (size_t id) const |
Returns a spring element by ID. | |
SpringElement & | GetSpringElement (size_t id) |
Returns a spring element by ID. | |
size_t | NumSpringElements () const |
Returns the number of spring elements present in the model. | |
template<typename DeviceType > | |
Springs< DeviceType > | CreateSprings () const |
Creates a Springs struct based on the spring elements in the model. | |
template<typename DeviceType > | |
Elements< DeviceType > | CreateElements () const |
Creates an Elements struct with Beams, Masses, and Springs. | |
template<typename DeviceType > | |
State< DeviceType > | CreateState () const |
Creates an State struct based on the nodes in this model. | |
size_t | AddFixedBC (const size_t node_id) |
Adds a fixed boundary condition constraint to the model and returns the ID. | |
size_t | AddPrescribedBC (const size_t node_id, const std::array< double, 7 > &initial_displacement={0., 0., 0., 1., 0., 0., 0.}) |
Adds a prescribed boundary condition constraint to the model and returns the ID. | |
size_t | AddRigidJointConstraint (const std::array< size_t, 2 > &node_ids) |
Adds a rigid constraint to the model and returns the ID. | |
size_t | AddRevoluteJointConstraint (const std::array< size_t, 2 > &node_ids, const std::array< double, 3 > &axis, double *torque) |
Adds a revolute/hinge constraint to the model and returns the ID. | |
size_t | AddRotationControl (const std::array< size_t, 2 > &node_ids, const std::array< double, 3 > &axis, double *control) |
Adds a rotation control constraint to the model and returns the ID. | |
size_t | AddFixedBC3DOFs (const size_t node_id) |
Adds a fixed boundary condition constraint (6DOFs to 3DOFs) to the model and returns the ID. | |
size_t | AddPrescribedBC3DOFs (const size_t node_id) |
Adds a prescribed boundary condition constraint (6DOFs to 3DOFs) to the model and returns the ID. | |
size_t | AddRigidJoint6DOFsTo3DOFs (const std::array< size_t, 2 > &node_ids) |
Adds a rigid joint constraint (6DOFs to 3DOFs) to the model and returns the ID. | |
size_t | NumConstraints () const |
Returns the number of constraints present in the model. | |
template<typename DeviceType > | |
Constraints< DeviceType > | CreateConstraints () const |
Returns a Constraints object initialized from the model constraints. | |
template<typename DeviceType = Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>> | |
std::tuple< State< DeviceType >, Elements< DeviceType >, Constraints< DeviceType > > | CreateSystem () const |
Returns a State, Elements, and Constraints object initialized from the model. | |
template<typename DeviceType = Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>> | |
std::tuple< State< DeviceType >, Elements< DeviceType >, Constraints< DeviceType >, Solver< DeviceType > > | CreateSystemWithSolver () const |
Returns a State, Elements, Constraints, and Solver object initialized from the model. | |
const model::MeshConnectivity & | GetMeshConnectivity () const |
Get the mesh connectivity. | |
model::MeshConnectivity & | GetMeshConnectivity () |
Get the mesh connectivity. | |
void | ExportMeshConnectivityToYAML (const std::string &filename="mesh_connectivity.yaml") const |
Export mesh connectivity to a YAML file. | |
Static Public Attributes | |
static constexpr size_t | InvalidNodeID {0U} |
Represents an invalid node in constraints that only uses the target node. | |
Detailed Description
Struct to define the connectivity structure of elements, nodes, and constraints defining an Kynema problem.
A model is a collection of nodes, elements, and constraints that define the geometry and relationships between components in an Kynema problem. Model also provides methods to consistantly manipulate the nodes associated with a given element (for example, rotating all nodes in a beam) to ease the process of defining problems.
Constructor & Destructor Documentation
◆ Model() [1/2]
|
default |
Default constructor.
◆ Model() [2/2]
|
inlineexplicit |
Constructor with gravity specified.
- Parameters
-
gravity The gravity vector that will be applied during the simulation
Member Function Documentation
◆ AddBeamElement()
|
inline |
Adds a beam element to the model.
- Parameters
-
node_ids A list of the node IDs to be contained in the beam sections The physical properties defined at each quadrature point quadrature The quadrature point locations and weights
- Returns
- the index of the newly added beam
◆ AddFixedBC()
|
inline |
Adds a fixed boundary condition constraint to the model and returns the ID.
- Parameters
-
node_id the ID of the node where the constraint is to be added
- Returns
- The ID of the created constraint
◆ AddFixedBC3DOFs()
|
inline |
Adds a fixed boundary condition constraint (6DOFs to 3DOFs) to the model and returns the ID.
- Parameters
-
node_id The node ID where the constraint will be applied
- Returns
- the ID of the created constraint
◆ AddMassElement()
|
inline |
Adds a mass element to the model.
- Parameters
-
node_id ID of the node where the mass element will be placed mass The inertia matrix of the element
- Returns
- The index of the newly added element
◆ AddNode()
|
inline |
Adds a node to the model.
- Returns
- NodeBuilder object wrapping the newly added node
◆ AddPrescribedBC()
|
inline |
Adds a prescribed boundary condition constraint to the model and returns the ID.
- Parameters
-
node_id the ID of the node where the constraint is to be added initial_displacement The displacement of the node to be forced on the node
- Returns
- the ID of the created constraint
◆ AddPrescribedBC3DOFs()
|
inline |
Adds a prescribed boundary condition constraint (6DOFs to 3DOFs) to the model and returns the ID.
- Parameters
-
node_id The node ID where the constraint will be applied
- Returns
- the ID of the created constraint
◆ AddRevoluteJointConstraint()
|
inline |
Adds a revolute/hinge constraint to the model and returns the ID.
- Parameters
-
node_ids the IDs of the two nodes to be linked by the constraint axis The axis about which the torque force will be applied torque A pointer to the location in memory where the torque will be set
- Returns
- the ID of the created constraint
◆ AddRigidJoint6DOFsTo3DOFs()
|
inline |
Adds a rigid joint constraint (6DOFs to 3DOFs) to the model and returns the ID.
- Parameters
-
node_ids the IDs of the nodes which will be joined by the constraint
- Returns
- the ID of the created constraint
◆ AddRigidJointConstraint()
|
inline |
Adds a rigid constraint to the model and returns the ID.
- Parameters
-
node_ids The IDs of the two nodes to be linked by the constraint
- Returns
- The ID of the created constraint
◆ AddRotationControl()
|
inline |
Adds a rotation control constraint to the model and returns the ID.
- Parameters
-
node_ids the IDs of the two nodes to be linked by the constraint axis The axis about which the torque force will be applied control A pointer to the location in memory where the control rotation will be set
- Returns
- the ID of the created constraint
◆ AddSpringElement()
|
inline |
Adds a spring element to the model.
- Parameters
-
node1_id ID of the node at one end of the spring node2_id ID of the node at the other end of the spring stiffness Stiffness of the spring undeformed_length Length of the spring at which the spring force is zero
- Returns
- the index of the newly added spring
◆ CreateBeams()
|
inline |
◆ CreateBeamsInput()
|
inline |
Createsa Beams input file based on the beam elements in the model.
- Returns
- An initialized BeamsInput struct
◆ CreateConstraints()
|
inline |
Returns a Constraints object initialized from the model constraints.
- Template Parameters
-
DeviceType the Kokkos Device where the created constraints will reside
- Returns
- The constructed Constraints object
◆ CreateElements()
|
inline |
◆ CreateMasses()
|
inline |
◆ CreateSprings()
|
inline |
◆ CreateState()
|
inline |
◆ CreateSystem()
|
inline |
Returns a State, Elements, and Constraints object initialized from the model.
- Template Parameters
-
DeviceType The Kokkos Device where the created objects will reside
- Returns
- Constructed State, Elements, and Constraints objects
◆ CreateSystemWithSolver()
|
inline |
Returns a State, Elements, Constraints, and Solver object initialized from the model.
- Template Parameters
-
DeviceType The Kokkos Device where the created objects will reside
- Returns
- Constructed State, Elements, Constraints, and Solver objects
◆ ExportMeshConnectivityToYAML()
|
inline |
Export mesh connectivity to a YAML file.
- Parameters
-
filename The name of the file to which to write the connectivity
◆ GetBeamElement() [1/2]
|
inline |
Returns a beam element by ID.
- Parameters
-
id The index of the beam element
- Returns
- The beam element itself
◆ GetBeamElement() [2/2]
|
inline |
Returns a beam element by ID.
- Parameters
-
id The index of the beam element
- Returns
- The beam element itself
◆ GetBeamElements()
|
inline |
Returns a reference to the beam elements present in the model.
- Returns
- a reference to the vector containing the beam elements
◆ GetMassElement() [1/2]
|
inline |
Returns a mass element by ID.
- Parameters
-
id ID of desired mass element
- Returns
- The Mass element
◆ GetMassElement() [2/2]
|
inline |
Returns a mass element by ID.
- Parameters
-
id ID of desired mass element
- Returns
- The Mass element
◆ GetMassElements()
|
inline |
Returns a reference to the mass elements present in the model.
- Returns
- A reference to the vector containing the mass elements
◆ GetMeshConnectivity() [1/2]
|
inline |
Get the mesh connectivity.
- Returns
- A reference to this Model's MeshConnectivity model
◆ GetMeshConnectivity() [2/2]
|
inline |
Get the mesh connectivity.
- Returns
- A reference to this Model's MeshConnectivity model
◆ GetNode() [1/2]
|
inline |
Returns a node by ID.
- Parameters
-
id Index number of node
- Returns
- The desired node
◆ GetNode() [2/2]
|
inline |
Returns a node by ID.
- Parameters
-
id Index number of node
- Returns
- The desired node
◆ GetNodes()
|
inline |
Returns constant reference to nodes vector.
- Returns
- A reference to the vector containing all of the nodes in the model
◆ GetSpringElement() [1/2]
|
inline |
Returns a spring element by ID.
- Parameters
-
id The ID of the spring
- Returns
- The requested spring element
◆ GetSpringElement() [2/2]
|
inline |
Returns a spring element by ID.
- Parameters
-
id The ID of the spring
- Returns
- The requested spring element
◆ NumBeamElements()
|
inline |
Returns the number of beam elements present in the model.
- Returns
- the number of beam elements
◆ NumConstraints()
|
inline |
Returns the number of constraints present in the model.
- Returns
- the number of constraints
◆ NumMassElements()
|
inline |
Returns the number of mass elements present in the model.
- Returns
- The number of mass elements
◆ NumNodes()
|
inline |
Gets the number of nodes present in the model.
- Returns
- The number of nodes
◆ NumSpringElements()
|
inline |
Returns the number of spring elements present in the model.
- Returns
- the number of springs in the model
◆ RotateBeamAboutPoint()
|
inline |
Rotate all beam nodes by given quaternion about a given point.
- Parameters
-
beam_elem_id The index of the beam to be rotated displacement_quaternion The displacement quaternion point The point around which the beam will be rotated
◆ SetBeamAccelerationAboutPoint()
|
inline |
Set the acceleration of the beam about a given point.
- Parameters
-
beam_elem_id The index of the beam acceleration The acceleration of the beam omega The rotational acceleration of the beam point The point about which the rotational velocity is based
◆ SetBeamVelocityAboutPoint()
|
inline |
Set the translational and rotational velocity of the beam about a given point.
- Parameters
-
beam_elem_id The index of the beam velocity The velocity of the beam point The point about which the rotational velocity is based
◆ SetGravity()
|
inline |
Sets the gravity components for the model.
- Parameters
-
x X gravity component y Y gravity component z Z gravity component
◆ TranslateBeam()
|
inline |
Translate all beam nodes by given displacement.
- Parameters
-
beam_elem_id The index of the beam to be translated displacement The displacement vector
Member Data Documentation
◆ InvalidNodeID
|
staticconstexpr |
Represents an invalid node in constraints that only uses the target node.
The documentation for this class was generated from the following file:
- /home/runner/work/kynema/kynema/kynema/src/model/model.hpp
Generated by