/home/runner/work/kynema/kynema/kynema/src/model/model.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
|
Loading...
Searching...
No Matches
model.hpp
Go to the documentation of this file.
674 [[nodiscard]] model::MeshConnectivity& GetMeshConnectivity() { return this->mesh_connectivity_; }
680 void ExportMeshConnectivityToYAML(const std::string& filename = "mesh_connectivity.yaml") const {
Struct to define the connectivity structure of elements, nodes, and constraints defining an Kynema pr...
Definition model.hpp:74
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.
Definition model.hpp:599
State< DeviceType > CreateState() const
Creates an State struct based on the nodes in this model.
Definition model.hpp:461
Beams< DeviceType > CreateBeams() const
Createsa Beams structure based on the beam elements in the model.
Definition model.hpp:224
Masses< DeviceType > CreateMasses() const
Create a a masses struct based on the mass elements present in the model.
Definition model.hpp:356
size_t AddPrescribedBC3DOFs(const size_t node_id)
Adds a prescribed boundary condition constraint (6DOFs to 3DOFs) to the model and returns the ID.
Definition model.hpp:585
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.
Definition model.hpp:493
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.
Definition model.hpp:550
size_t AddFixedBC3DOFs(const size_t node_id)
Adds a fixed boundary condition constraint (6DOFs to 3DOFs) to the model and returns the ID.
Definition model.hpp:570
const model::MeshConnectivity & GetMeshConnectivity() const
Get the mesh connectivity.
Definition model.hpp:666
void TranslateBeam(size_t beam_elem_id, const std::array< double, 3 > &displacement)
Translate all beam nodes by given displacement.
Definition model.hpp:234
Springs< DeviceType > CreateSprings() const
Creates a Springs struct based on the spring elements in the model.
Definition model.hpp:425
void ExportMeshConnectivityToYAML(const std::string &filename="mesh_connectivity.yaml") const
Export mesh connectivity to a YAML file.
Definition model.hpp:680
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.
Definition model.hpp:283
const std::vector< MassElement > & GetMassElements() const
Returns a reference to the mass elements present in the model.
Definition model.hpp:337
const std::vector< BeamElement > & GetBeamElements() const
Returns a reference to the beam elements present in the model.
Definition model.hpp:196
BeamElement & GetBeamElement(size_t id)
Returns a beam element by ID.
Definition model.hpp:189
model::MeshConnectivity & GetMeshConnectivity()
Get the mesh connectivity.
Definition model.hpp:674
void SetGravity(double x, double y, double z)
Sets the gravity components for the model.
Definition model.hpp:97
static constexpr size_t InvalidNodeID
Represents an invalid node in constraints that only uses the target node.
Definition model.hpp:77
Constraints< DeviceType > CreateConstraints() const
Returns a Constraints object initialized from the model constraints.
Definition model.hpp:622
size_t AddFixedBC(const size_t node_id)
Adds a fixed boundary condition constraint to the model and returns the ID.
Definition model.hpp:477
Model(std::array< double, 3 > gravity)
Constructor with gravity specified.
Definition model.hpp:87
const BeamElement & GetBeamElement(size_t id) const
Returns a beam element by ID.
Definition model.hpp:178
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.
Definition model.hpp:265
const MassElement & GetMassElement(size_t id) const
Returns a mass element by ID.
Definition model.hpp:319
const std::vector< Node > & GetNodes() const
Returns constant reference to nodes vector.
Definition model.hpp:146
SpringElement & GetSpringElement(size_t id)
Returns a spring element by ID.
Definition model.hpp:408
const Node & GetNode(size_t id) const
Returns a node by ID.
Definition model.hpp:124
Elements< DeviceType > CreateElements() const
Creates an Elements struct with Beams, Masses, and Springs.
Definition model.hpp:441
size_t AddRigidJointConstraint(const std::array< size_t, 2 > &node_ids)
Adds a rigid constraint to the model and returns the ID.
Definition model.hpp:512
const SpringElement & GetSpringElement(size_t id) const
Returns a spring element by ID.
Definition model.hpp:397
size_t AddMassElement(const size_t node_id, const std::array< std::array< double, 6 >, 6 > &mass)
Adds a mass element to the model.
Definition model.hpp:305
BeamsInput CreateBeamsInput() const
Createsa Beams input file based on the beam elements in the model.
Definition model.hpp:212
MassElement & GetMassElement(size_t id)
Returns a mass element by ID.
Definition model.hpp:330
size_t NumSpringElements() const
Returns the number of spring elements present in the model.
Definition model.hpp:415
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.
Definition model.hpp:161
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.
Definition model.hpp:529
std::tuple< State< DeviceType >, Elements< DeviceType >, Constraints< DeviceType >, Solver< DeviceType > > CreateSystemWithSolver() const
Returns a State, Elements, Constraints, and Solver object initialized from the model.
Definition model.hpp:652
std::tuple< State< DeviceType >, Elements< DeviceType >, Constraints< DeviceType > > CreateSystem() const
Returns a State, Elements, and Constraints object initialized from the model.
Definition model.hpp:635
size_t NumMassElements() const
Returns the number of mass elements present in the model.
Definition model.hpp:346
size_t NumBeamElements() const
Returns the number of beam elements present in the model.
Definition model.hpp:205
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.
Definition model.hpp:376
size_t NumNodes() const
Gets the number of nodes present in the model.
Definition model.hpp:139
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.
Definition model.hpp:248
size_t NumConstraints() const
Returns the number of constraints present in the model.
Definition model.hpp:614
Builder class for constructing and configuring Node objects.
Definition node.hpp:282
Class to manage element-to-node connectivity information for a mesh.
Definition mesh_connectivity.hpp:18
void AddSpringElementConnectivity(size_t elem_id, const std::array< size_t, 2 > &node_ids)
Adds a spring element's node connectivity.
Definition mesh_connectivity.hpp:45
void AddBeamElementConnectivity(size_t elem_id, std::span< const size_t > node_ids)
Adds a beam element's node connectivity.
Definition mesh_connectivity.hpp:27
void ExportToYAML(std::ostream &file) const
Export mesh connectivity inforation to a YAML file.
Definition mesh_connectivity.hpp:98
void AddMassElementConnectivity(size_t elem_id, size_t node_id)
Adds a mass element's node connectivity.
Definition mesh_connectivity.hpp:36
void AddConstraintConnectivity(size_t constraint_id, std::span< const size_t > node_ids)
Adds a constraint's node connectivity.
Definition mesh_connectivity.hpp:54
@ PrescribedBC3DOFs
@ PrescribedBC
@ RigidJoint
@ FixedBC3DOFs
@ RigidJoint6DOFsTo3DOFs
@ RevoluteJoint
@ RotationControl
void compute_node_freedom_map_table(State< DeviceType > &state)
Compute the node freedom map table, a pointer map to the start of the degrees of freedom ofa given no...
Definition compute_node_freedom_map_table.hpp:38
void assemble_node_freedom_allocation_table(State< DeviceType > &state, const Elements< DeviceType > &elements, const Constraints< DeviceType > &constraints)
Creates the node freedom allocation table in state based on the connectivities defined in the element...
Definition assemble_node_freedom_allocation_table.hpp:140
void create_element_freedom_table(Elements< DeviceType > &elements, const State< DeviceType > &state)
Creates the element freedom tables for all of the elements in the system.
Definition create_element_freedom_table.hpp:106
void create_constraint_freedom_table(Constraints< DeviceType > &constraints, const State< DeviceType > &state)
Creates node freedom tables for each the target and base nodes in the constraints.
Definition create_constraint_freedom_table.hpp:66
Definition calculate_constraint_output.hpp:8
Solver< DeviceType > CreateSolver(State< DeviceType > &state, Elements< DeviceType > &elements, Constraints< DeviceType > &constraints)
Compute freedom tables for state, elements, and constraints, then construct and return solver.
Definition model.hpp:42
Beam element constitutes flexible beams material behavior in kynema.
Definition beam_element.hpp:17
Represents the input data for creating flexible beams.
Definition beams_input.hpp:22
Contains the field variables needed to compute the per-element contributions to the residual vector a...
Definition beams.hpp:22
Container class for managing multiple constraints in a simulation.
Definition constraints.hpp:29
View< size_t * > target_active_dofs
Definition constraints.hpp:49
View< Kokkos::pair< size_t, size_t > * > row_range
Definition constraints.hpp:45
View< size_t *[6]> base_node_freedom_table
Definition constraints.hpp:50
View< size_t *[6]> target_node_freedom_table
Definition constraints.hpp:51
A container providing handle to all structural elements present in the model.
Definition elements.hpp:20
Kokkos::View< size_t *, DeviceType > NumberOfNodesPerElement() const
Returns the number of nodes per element for each element in the system.
Definition elements.hpp:41
Kokkos::View< size_t **, DeviceType > NodeStateIndices() const
Returns the state indices for each node of each element in the system.
Definition elements.hpp:87
Mass element constitutes rigid bodies/masses material behavior in kynema. It has a single node and a ...
Definition mass_element.hpp:11
Represents the input data for creating mass/rigid body elements.
Definition masses_input.hpp:14
Contains field variables for mass elements (aka, rigid bodies) to compute per-element contributions t...
Definition masses.hpp:17
Node & Translate(const std::array< double, 3 > &displacement)
Translate node by a displacement vector.
Definition node.hpp:87
Node & RotateAboutPoint(const std::array< double, 4 > &q, const std::array< double, 3 > &point)
Rotate node by a quaternion about the given point.
Definition node.hpp:100
void SetVelocityAboutPoint(const std::array< double, 6 > &velocity, const std::array< double, 3 > &point)
Set node velocity based on rigid body motion about a reference point.
Definition node.hpp:203
void SetAccelerationAboutPoint(const std::array< double, 6 > &acceleration, const std::array< double, 3 > &omega, const std::array< double, 3 > &point)
Set node acceleration based on rigid body motion about a reference point.
Definition node.hpp:233
This object manages the assembly and solution of linear system arising from the generalized-alpha bas...
Definition solver.hpp:21
Spring element represents a constitutively linear spring connecting two nodes and defined by its scal...
Definition spring_element.hpp:12
Represents the input data for creating spring elements.
Definition springs_input.hpp:13
Contains field variables for spring elements to compute per-element contributions to the residual vec...
Definition springs.hpp:14
Container for storing the complete system state of the simulation at a given time increment.
Definition state.hpp:18
Generated by