/home/runner/work/kynema-fmb/kynema-fmb/kynema-fmb/src/model/model.hpp Source File

Kynema API: /home/runner/work/kynema-fmb/kynema-fmb/kynema-fmb/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.
1#pragma once
2
3#include <array>
4#include <span>
5#include <tuple>
6
17#include "elements/elements.hpp"
22#include "mesh_connectivity.hpp"
23#include "node.hpp"
24#include "solver/solver.hpp"
25#include "state/state.hpp"
26
27namespace kynema_fmb {
28
40template <
41 typename DeviceType =
42 Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>>
43[[nodiscard]] inline Solver<DeviceType> CreateSolver(
45) {
46 dof::assemble_node_freedom_allocation_table(state, elements, constraints);
48 dof::create_element_freedom_table(elements, state);
49 dof::create_constraint_freedom_table(constraints, state);
50
51 return {
52 state.ID,
53 state.active_dofs,
55 elements.NumberOfNodesPerElement(),
56 elements.NodeStateIndices(),
57 constraints.num_dofs,
58 constraints.base_active_dofs,
59 constraints.target_active_dofs,
60 constraints.base_node_freedom_table,
61 constraints.target_node_freedom_table,
62 constraints.row_range,
63 };
64}
65
75class Model {
76public:
78 static constexpr size_t InvalidNodeID{0U};
79
81 Model() = default;
82
88 explicit Model(std::array<double, 3> gravity) : gravity_(gravity) {}
89
90 //--------------------------------------------------------------------------
91 // Miscellaneous
92 //--------------------------------------------------------------------------
93
98 void SetGravity(double x, double y, double z) {
99 this->gravity_[0] = x;
100 this->gravity_[1] = y;
101 this->gravity_[2] = z;
102 }
103
104 //--------------------------------------------------------------------------
105 // Nodes
106 //--------------------------------------------------------------------------
107
114 const auto id = this->nodes_.size();
115 this->nodes_.emplace_back(id);
116 return NodeBuilder(this->nodes_.back());
117 }
118
125 [[nodiscard]] const Node& GetNode(size_t id) const { return this->nodes_[id]; }
126
133 [[nodiscard]] Node& GetNode(size_t id) { return this->nodes_[id]; }
134
140 [[nodiscard]] size_t NumNodes() const { return this->nodes_.size(); }
141
147 [[nodiscard]] const std::vector<Node>& GetNodes() const { return this->nodes_; }
148
149 //--------------------------------------------------------------------------
150 // Beam Elements
151 //--------------------------------------------------------------------------
152
164 std::span<const size_t> node_ids, std::span<const BeamSection> sections,
165 std::span<const std::array<double, 2>> quadrature,
166 const std::array<double, 6>& mu = {0., 0., 0., 0., 0., 0.}
167 ) {
168 const auto elem_id = this->beam_elements_.size();
169 this->beam_elements_.emplace_back(elem_id, node_ids, sections, quadrature, mu);
170 this->mesh_connectivity_.AddBeamElementConnectivity(elem_id, node_ids);
171 return elem_id;
172 }
173
181 [[nodiscard]] const BeamElement& GetBeamElement(size_t id) const {
182 return this->beam_elements_[id];
183 }
184
192 [[nodiscard]] BeamElement& GetBeamElement(size_t id) { return this->beam_elements_[id]; }
193
199 [[nodiscard]] const std::vector<BeamElement>& GetBeamElements() const {
200 return this->beam_elements_;
201 }
202
208 [[nodiscard]] size_t NumBeamElements() const { return this->beam_elements_.size(); }
209
215 [[nodiscard]] BeamsInput CreateBeamsInput() const {
216 return {this->beam_elements_, this->gravity_};
217 }
218
226 template <typename DeviceType>
227 [[nodiscard]] Beams<DeviceType> CreateBeams() const {
228 return kynema_fmb::CreateBeams<DeviceType>(this->CreateBeamsInput(), this->nodes_);
229 }
230
237 void TranslateBeam(size_t beam_elem_id, std::span<const double, 3> displacement) {
238 const auto& beam_elem = this->beam_elements_[beam_elem_id];
239 for (const auto& node_id : beam_elem.node_ids) {
240 this->GetNode(node_id).Translate(displacement);
241 }
242 }
243
252 size_t beam_elem_id, std::span<const double, 4> displacement_quaternion,
253 std::span<const double, 3> point
254 ) {
255 const auto& beam_elem = this->beam_elements_[beam_elem_id];
256 for (const auto& node_id : beam_elem.node_ids) {
257 this->GetNode(node_id).RotateAboutPoint(displacement_quaternion, point);
258 }
259 }
260
269 size_t beam_elem_id, std::span<const double, 6> velocity, std::span<const double, 3> point
270 ) {
271 const auto& beam_elem = this->beam_elements_[beam_elem_id];
272 for (const auto& node_id : beam_elem.node_ids) {
273 this->GetNode(node_id).SetVelocityAboutPoint(velocity, point);
274 }
275 }
276
286 size_t beam_elem_id, std::span<const double, 6> acceleration,
287 std::span<const double, 3> omega, std::span<const double, 3> point
288 ) {
289 const auto& beam_elem = this->beam_elements_[beam_elem_id];
290 for (const auto& node_id : beam_elem.node_ids) {
291 this->GetNode(node_id).SetAccelerationAboutPoint(acceleration, omega, point);
292 }
293 }
294
295 //--------------------------------------------------------------------------
296 // Mass Elements
297 //--------------------------------------------------------------------------
298
307 size_t AddMassElement(const size_t node_id, const std::array<std::array<double, 6>, 6>& mass) {
308 const auto elem_id = this->mass_elements_.size();
309 this->mass_elements_.emplace_back(elem_id, node_id, mass);
310 this->mesh_connectivity_.AddMassElementConnectivity(elem_id, node_id);
311 return elem_id;
312 }
313
321 [[nodiscard]] const MassElement& GetMassElement(size_t id) const {
322 return this->mass_elements_[id];
323 }
324
332 [[nodiscard]] MassElement& GetMassElement(size_t id) { return this->mass_elements_[id]; }
333
339 [[nodiscard]] const std::vector<MassElement>& GetMassElements() const {
340 return this->mass_elements_;
341 }
342
348 [[nodiscard]] size_t NumMassElements() const { return this->mass_elements_.size(); }
349
357 template <typename DeviceType>
358 [[nodiscard]] Masses<DeviceType> CreateMasses() const {
359 return kynema_fmb::CreateMasses<DeviceType>(
360 MassesInput(this->mass_elements_, this->gravity_), this->nodes_
361 );
362 }
363
364 //--------------------------------------------------------------------------
365 // Spring Elements
366 //--------------------------------------------------------------------------
367
379 const size_t node1_id, const size_t node2_id, const double stiffness,
380 const double undeformed_length
381 ) {
382 const auto elem_id = this->spring_elements_.size();
383 this->spring_elements_.emplace_back(
384 elem_id, std::array{node1_id, node2_id}, stiffness, undeformed_length
385 );
386 this->mesh_connectivity_.AddSpringElementConnectivity(
387 elem_id, std::array{node1_id, node2_id}
388 );
389 return elem_id;
390 }
391
399 [[nodiscard]] const SpringElement& GetSpringElement(size_t id) const {
400 return this->spring_elements_[id];
401 }
402
410 [[nodiscard]] SpringElement& GetSpringElement(size_t id) { return this->spring_elements_[id]; }
411
417 [[nodiscard]] size_t NumSpringElements() const { return this->spring_elements_.size(); }
418
426 template <typename DeviceType>
427 [[nodiscard]] Springs<DeviceType> CreateSprings() const {
428 return kynema_fmb::CreateSprings<DeviceType>(
429 SpringsInput(this->spring_elements_), this->nodes_
430 );
431 }
432
433 //--------------------------------------------------------------------------
434 // Elements
435 //--------------------------------------------------------------------------
436
444 template <typename DeviceType>
445 [[nodiscard]] Elements<DeviceType> CreateElements() const {
446 return {
447 this->CreateBeams<DeviceType>(),
448 this->CreateMasses<DeviceType>(),
449 this->CreateSprings<DeviceType>(),
450 };
451 }
452
453 //--------------------------------------------------------------------------
454 // State
455 //--------------------------------------------------------------------------
456
464 template <typename DeviceType>
465 [[nodiscard]] State<DeviceType> CreateState() const {
466 auto state = State<DeviceType>(this->nodes_.size());
467 model::CopyNodesToState<DeviceType>(state, this->nodes_);
468 return state;
469 }
470
471 //--------------------------------------------------------------------------
472 // Constraints
473 //--------------------------------------------------------------------------
474
481 size_t AddFixedBC(const size_t node_id) {
482 const auto id = this->constraints_.size();
483 this->constraints_.emplace_back(
485 );
486 this->mesh_connectivity_.AddConstraintConnectivity(id, std::vector<size_t>{node_id});
487 return id;
488 }
489
498 const size_t node_id,
499 const std::array<double, 7>& initial_displacement = {0., 0., 0., 1., 0., 0., 0.}
500 ) {
501 const auto id = this->constraints_.size();
502 this->constraints_.emplace_back(
504 std::array{0., 0., 0.}, initial_displacement
505 );
506 this->mesh_connectivity_.AddConstraintConnectivity(id, std::vector<size_t>{node_id});
507 return id;
508 }
509
516 size_t AddRigidJointConstraint(std::span<const size_t, 2> node_ids) {
517 const auto id = this->constraints_.size();
518 this->constraints_.emplace_back(
519 id, constraints::ConstraintType::RigidJoint, std::array{node_ids[0], node_ids[1]}
520 );
521 this->mesh_connectivity_.AddConstraintConnectivity(
522 id, std::vector<size_t>{node_ids[0], node_ids[1]}
523 );
524 return id;
525 }
526
536 std::span<const size_t, 2> node_ids, std::span<const double, 3> axis, double* torque
537 ) {
538 const auto id = this->constraints_.size();
539 this->constraints_.emplace_back(
540 id, constraints::ConstraintType::RevoluteJoint, std::array{node_ids[0], node_ids[1]},
541 std::array{axis[0], axis[1], axis[2]}, std::array{0., 0., 0., 1., 0., 0., 0.}, torque
542 );
543 this->mesh_connectivity_.AddConstraintConnectivity(
544 id, std::vector<size_t>{node_ids[0], node_ids[1]}
545 );
546 return id;
547 }
548
557 std::span<const size_t, 2> node_ids, std::span<const double, 3> axis, double* control
558 ) {
559 const auto id = this->constraints_.size();
560 this->constraints_.emplace_back(
561 id, constraints::ConstraintType::RotationControl, std::array{node_ids[0], node_ids[1]},
562 std::array{axis[0], axis[1], axis[2]}, std::array{0., 0., 0., 1., 0., 0., 0.}, control
563 );
564 this->mesh_connectivity_.AddConstraintConnectivity(
565 id, std::vector<size_t>{node_ids[0], node_ids[1]}
566 );
567 return id;
568 }
569
576 size_t AddFixedBC3DOFs(const size_t node_id) {
577 const auto id = this->constraints_.size();
578 this->constraints_.emplace_back(
580 );
581 this->mesh_connectivity_.AddConstraintConnectivity(id, std::vector<size_t>{node_id});
582 return id;
583 }
584
591 size_t AddPrescribedBC3DOFs(const size_t node_id) {
592 const auto id = this->constraints_.size();
593 this->constraints_.emplace_back(
595 );
596 this->mesh_connectivity_.AddConstraintConnectivity(id, std::vector<size_t>{node_id});
597 return id;
598 }
599
605 size_t AddRigidJoint6DOFsTo3DOFs(std::span<const size_t, 2> node_ids) {
606 const auto id = this->constraints_.size();
607 this->constraints_.emplace_back(
609 std::array{node_ids[0], node_ids[1]}
610 );
611 this->mesh_connectivity_.AddConstraintConnectivity(
612 id, std::vector<size_t>{node_ids[0], node_ids[1]}
613 );
614 return id;
615 }
616
621 [[nodiscard]] size_t NumConstraints() const { return this->constraints_.size(); }
622
628 template <typename DeviceType>
630 return Constraints<DeviceType>(this->constraints_, this->nodes_);
631 }
632
638 template <
639 typename DeviceType = Kokkos::Device<
640 Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>>
641 [[nodiscard]] std::tuple<State<DeviceType>, Elements<DeviceType>, Constraints<DeviceType>>
642 CreateSystem() const {
643 return {
644 this->CreateState<DeviceType>(), this->CreateElements<DeviceType>(),
645 this->CreateConstraints<DeviceType>()
646 };
647 }
648
654 template <
655 typename DeviceType = Kokkos::Device<
656 Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>>
657 [[nodiscard]] std::tuple<
660 auto [state, elements, constraints] = this->CreateSystem<DeviceType>();
661 auto solver = CreateSolver<DeviceType>(state, elements, constraints);
662 return {state, elements, constraints, solver};
663 }
664
665 //--------------------------------------------------------------------------
666 // Mesh Connectivity
667 //--------------------------------------------------------------------------
668
673 [[nodiscard]] const model::MeshConnectivity& GetMeshConnectivity() const {
674 return this->mesh_connectivity_;
675 }
676
681 [[nodiscard]] model::MeshConnectivity& GetMeshConnectivity() { return this->mesh_connectivity_; }
682
687 void ExportMeshConnectivityToYAML(const std::string& filename = "mesh_connectivity.yaml") const {
688 this->mesh_connectivity_.ExportToYAML(filename);
689 }
690
691private:
692 std::array<double, 3> gravity_ = {0., 0., 0.}; //< Gravity components
693 std::vector<Node> nodes_; //< Nodes in the model
694 std::vector<BeamElement> beam_elements_; //< Beam elements in the model
695 std::vector<MassElement> mass_elements_; //< Mass elements in the model
696 std::vector<SpringElement> spring_elements_; //< Spring elements in the model
697 std::vector<constraints::Constraint> constraints_; //< Constraints in the model
698 model::MeshConnectivity
699 mesh_connectivity_; //< Mesh connectivity tracking element-node relationships
700};
701
702} // namespace kynema_fmb
Struct to define the connectivity structure of elements, nodes, and constraints defining an Kynema pr...
Definition model.hpp:75
BeamsInput CreateBeamsInput() const
Createsa Beams input file based on the beam elements in the model.
Definition model.hpp:215
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:591
const BeamElement & GetBeamElement(size_t id) const
Returns a beam element by ID.
Definition model.hpp:181
Constraints< DeviceType > CreateConstraints() const
Returns a Constraints object initialized from the model constraints.
Definition model.hpp:629
size_t AddRevoluteJointConstraint(std::span< const size_t, 2 > node_ids, std::span< const double, 3 > axis, double *torque)
Adds a revolute/hinge constraint to the model and returns the ID.
Definition model.hpp:535
size_t AddBeamElement(std::span< const size_t > node_ids, std::span< const BeamSection > sections, std::span< const std::array< double, 2 > > quadrature, const std::array< double, 6 > &mu={0., 0., 0., 0., 0., 0.})
Adds a beam element to the model.
Definition model.hpp:163
size_t NumMassElements() const
Returns the number of mass elements present in the model.
Definition model.hpp:348
const Node & GetNode(size_t id) const
Returns a node by ID.
Definition model.hpp:125
Beams< DeviceType > CreateBeams() const
Createsa Beams structure based on the beam elements in the model.
Definition model.hpp:227
NodeBuilder AddNode()
Adds a node to the model.
Definition model.hpp:113
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:659
void SetGravity(double x, double y, double z)
Sets the gravity components for the model.
Definition model.hpp:98
const MassElement & GetMassElement(size_t id) const
Returns a mass element by ID.
Definition model.hpp:321
std::tuple< State< DeviceType >, Elements< DeviceType >, Constraints< DeviceType > > CreateSystem() const
Returns a State, Elements, and Constraints object initialized from the model.
Definition model.hpp:642
static constexpr size_t InvalidNodeID
Represents an invalid node in constraints that only uses the target node.
Definition model.hpp:78
size_t NumNodes() const
Gets the number of nodes present in the model.
Definition model.hpp:140
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:576
const std::vector< BeamElement > & GetBeamElements() const
Returns a reference to the beam elements present in the model.
Definition model.hpp:199
const model::MeshConnectivity & GetMeshConnectivity() const
Get the mesh connectivity.
Definition model.hpp:673
Model(std::array< double, 3 > gravity)
Constructor with gravity specified.
Definition model.hpp:88
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:307
const std::vector< MassElement > & GetMassElements() const
Returns a reference to the mass elements present in the model.
Definition model.hpp:339
const std::vector< Node > & GetNodes() const
Returns constant reference to nodes vector.
Definition model.hpp:147
void ExportMeshConnectivityToYAML(const std::string &filename="mesh_connectivity.yaml") const
Export mesh connectivity to a YAML file.
Definition model.hpp:687
size_t NumSpringElements() const
Returns the number of spring elements present in the model.
Definition model.hpp:417
size_t AddFixedBC(const size_t node_id)
Adds a fixed boundary condition constraint to the model and returns the ID.
Definition model.hpp:481
BeamElement & GetBeamElement(size_t id)
Returns a beam element by ID.
Definition model.hpp:192
size_t AddRigidJointConstraint(std::span< const size_t, 2 > node_ids)
Adds a rigid constraint to the model and returns the ID.
Definition model.hpp:516
size_t AddRigidJoint6DOFsTo3DOFs(std::span< const size_t, 2 > node_ids)
Adds a rigid joint constraint (6DOFs to 3DOFs) to the model and returns the ID.
Definition model.hpp:605
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:497
Elements< DeviceType > CreateElements() const
Creates an Elements struct with Beams, Masses, and Springs.
Definition model.hpp:445
Masses< DeviceType > CreateMasses() const
Create a a masses struct based on the mass elements present in the model.
Definition model.hpp:358
SpringElement & GetSpringElement(size_t id)
Returns a spring element by ID.
Definition model.hpp:410
Model()=default
Default constructor.
Springs< DeviceType > CreateSprings() const
Creates a Springs struct based on the spring elements in the model.
Definition model.hpp:427
const SpringElement & GetSpringElement(size_t id) const
Returns a spring element by ID.
Definition model.hpp:399
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:378
void TranslateBeam(size_t beam_elem_id, std::span< const double, 3 > displacement)
Translate all beam nodes by given displacement.
Definition model.hpp:237
void RotateBeamAboutPoint(size_t beam_elem_id, std::span< const double, 4 > displacement_quaternion, std::span< const double, 3 > point)
Rotate all beam nodes by given quaternion about a given point.
Definition model.hpp:251
State< DeviceType > CreateState() const
Creates an State struct based on the nodes in this model.
Definition model.hpp:465
size_t NumConstraints() const
Returns the number of constraints present in the model.
Definition model.hpp:621
model::MeshConnectivity & GetMeshConnectivity()
Get the mesh connectivity.
Definition model.hpp:681
Node & GetNode(size_t id)
Returns a node by ID.
Definition model.hpp:133
size_t NumBeamElements() const
Returns the number of beam elements present in the model.
Definition model.hpp:208
void SetBeamAccelerationAboutPoint(size_t beam_elem_id, std::span< const double, 6 > acceleration, std::span< const double, 3 > omega, std::span< const double, 3 > point)
Set the acceleration of the beam about a given point.
Definition model.hpp:285
MassElement & GetMassElement(size_t id)
Returns a mass element by ID.
Definition model.hpp:332
size_t AddRotationControl(std::span< const size_t, 2 > node_ids, std::span< const double, 3 > axis, double *control)
Adds a rotation control constraint to the model and returns the ID.
Definition model.hpp:556
void SetBeamVelocityAboutPoint(size_t beam_elem_id, std::span< const double, 6 > velocity, std::span< const double, 3 > point)
Set the translational and rotational velocity of the beam about a given point.
Definition model.hpp:268
Builder class for constructing and configuring Node objects.
Definition node.hpp:269
Class to manage element-to-node connectivity information for a mesh.
Definition mesh_connectivity.hpp:19
void ExportToYAML(std::ostream &file) const
Export mesh connectivity inforation to a YAML file.
Definition mesh_connectivity.hpp:99
void AddBeamElementConnectivity(size_t elem_id, std::span< const size_t > node_ids)
Adds a beam element's node connectivity.
Definition mesh_connectivity.hpp:28
void AddConstraintConnectivity(size_t constraint_id, std::span< const size_t > node_ids)
Adds a constraint's node connectivity.
Definition mesh_connectivity.hpp:55
void AddMassElementConnectivity(size_t elem_id, size_t node_id)
Adds a mass element's node connectivity.
Definition mesh_connectivity.hpp:37
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:46
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 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
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
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:43
Beam element constitutes flexible beams material behavior in kynema.
Definition beam_element.hpp:18
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
size_t num_dofs
Definition constraints.hpp:36
View< size_t * > target_active_dofs
Definition constraints.hpp:49
View< size_t *[6]> target_node_freedom_table
Definition constraints.hpp:51
View< size_t * > base_active_dofs
Definition constraints.hpp:48
View< size_t *[6]> base_node_freedom_table
Definition constraints.hpp:50
View< Kokkos::pair< size_t, size_t > * > row_range
Definition constraints.hpp:45
A container providing handle to all structural elements present in the model.
Definition elements.hpp:20
Kokkos::View< size_t **, DeviceType > NodeStateIndices() const
Returns the state indices for each node of each element in the system.
Definition elements.hpp:85
Kokkos::View< size_t *, DeviceType > NumberOfNodesPerElement() const
Returns the number of nodes per element for each element in the system.
Definition elements.hpp:41
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
Represents a node in the finite element model.
Definition node.hpp:26
void SetVelocityAboutPoint(std::span< const double, 6 > velocity, std::span< const double, 3 > point)
Set node velocity based on rigid body motion about a reference point.
Definition node.hpp:191
Node & RotateAboutPoint(std::span< const double, 4 > q, std::span< const double, 3 > point)
Rotate node by a quaternion about the given point.
Definition node.hpp:98
Node & Translate(std::span< const double, 3 > displacement)
Translate node by a displacement vector.
Definition node.hpp:85
void SetAccelerationAboutPoint(std::span< const double, 6 > acceleration, std::span< const double, 3 > omega, std::span< const double, 3 > point)
Set node acceleration based on rigid body motion about a reference point.
Definition node.hpp:220
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
View< size_t * > ID
Definition state.hpp:24
View< size_t * > node_freedom_map_table
Definition state.hpp:27
View< size_t * > active_dofs
Definition state.hpp:26