kynema Namespace Reference

Kynema API: kynema Namespace Reference
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
kynema Namespace Reference

Namespaces

namespace  beams
 
namespace  constraints
 
namespace  dof
 
namespace  dss
 
namespace  interfaces
 
namespace  masses
 
namespace  math
 
namespace  model
 
namespace  solver
 
namespace  springs
 
namespace  state
 
namespace  step
 
namespace  system
 
namespace  util
 

Classes

struct  BeamElement
 Beam element constitutes flexible beams material behavior in kynema. More...
 
struct  Beams
 Contains the field variables needed to compute the per-element contributions to the residual vector and system matrix. More...
 
struct  BeamSection
 A structure containing the position, mass matrix, and stiffness matrix to be used in defining a beam cross section at a given location. More...
 
struct  BeamsInput
 Represents the input data for creating flexible beams. More...
 
struct  Constraints
 Container class for managing multiple constraints in a simulation. More...
 
struct  Elements
 A container providing handle to all structural elements present in the model. More...
 
struct  MassElement
 Mass element constitutes rigid bodies/masses material behavior in kynema. It has a single node and a single section completely defined by a 6x6 mass matrix. More...
 
struct  Masses
 Contains field variables for mass elements (aka, rigid bodies) to compute per-element contributions to the residual vector and system/iteration matrix. More...
 
struct  MassesInput
 Represents the input data for creating mass/rigid body elements. More...
 
class  Model
 Struct to define the connectivity structure of elements, nodes, and constraints defining an Kynema problem. More...
 
struct  Node
 Represents a node in the finite element model. More...
 
class  NodeBuilder
 Builder class for constructing and configuring Node objects. More...
 
struct  Solver
 This object manages the assembly and solution of linear system arising from the generalized-alpha based time integration of the dynamic structural problem. More...
 
struct  SpringElement
 Spring element represents a constitutively linear spring connecting two nodes and defined by its scalar stiffness and undeformed length. More...
 
struct  Springs
 Contains field variables for spring elements to compute per-element contributions to the residual vector and system/iteration matrix. More...
 
struct  SpringsInput
 Represents the input data for creating spring elements. More...
 
struct  State
 Container for storing the complete system state of the simulation at a given time increment. More...
 
struct  StepParameters
 A Struct containing the paramters used to control the time stepping process. More...
 

Functions

template<typename DeviceType >
Beams< DeviceType > CreateBeams (const BeamsInput &beams_input, std::span< const Node > nodes)
 Creates a beams data structure and initializes its data.
 
template<typename DeviceType >
Masses< DeviceType > CreateMasses (const MassesInput &masses_input, std::span< const Node > nodes)
 Creates a masses data structure and initializes its data.
 
template<typename DeviceType >
Springs< DeviceType > CreateSprings (const SpringsInput &springs_input, std::span< const Node > nodes)
 Creates a springs data structure and initializes its data.
 
template<typename DeviceType = Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>>
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.
 
template<typename DeviceType >
State< DeviceType > CloneState (const State< DeviceType > &old)
 Creates a new state object and performs a deep copy of the data in the old one. This is primarily for creating an identical state for snapshotting and rollback in the event that a time step should be performed again.
 
template<typename DeviceType >
void CopyStateData (State< DeviceType > &copy, const State< DeviceType > &old)
 Performs a deep copy of the state data which might have changed in a given time step.
 
template<typename DeviceType >
void ReadStateFromFile (std::istream &input, State< DeviceType > &state)
 Reads State data from a provided restart file.
 
template<typename DeviceType >
void WriteStateToFile (std::ostream &output, const State< DeviceType > &state)
 Writes State data into a minimal restart file.
 
template<typename DeviceType >
bool Step (StepParameters &parameters, Solver< DeviceType > &solver, Elements< DeviceType > &elements, State< DeviceType > &state, Constraints< DeviceType > &constraints)
 Attempts to complete a single time step in the dynamic FEA simulation.
 

Function Documentation

◆ CloneState()

template<typename DeviceType >
State< DeviceType > kynema::CloneState ( const State< DeviceType > &  old)
inline

Creates a new state object and performs a deep copy of the data in the old one. This is primarily for creating an identical state for snapshotting and rollback in the event that a time step should be performed again.

Template Parameters
DeviceTypeThe Kokkos Device where the old and new states live
Parameters
oldThe State to be cloned
Returns
A new State with contents identical to the input

◆ CopyStateData()

template<typename DeviceType >
void kynema::CopyStateData ( State< DeviceType > &  copy,
const State< DeviceType > &  old 
)
inline

Performs a deep copy of the state data which might have changed in a given time step.

It is assumed that the target State object has all of its data which is unchanged (connectivity information, x0, ID) already copied over and all of its Views are properly sized. One way to ensure this is to first create it with the Clone state method.

Template Parameters
DeviceTypeThe Kokkos Device where copy and old states reside
Parameters
oldThe State from which to be copied
copyThe State to which to be copied

◆ CreateBeams()

template<typename DeviceType >
Beams< DeviceType > kynema::CreateBeams ( const BeamsInput beams_input,
std::span< const Node nodes 
)
inline

Creates a beams data structure and initializes its data.

Template Parameters
DeviceDataThe Kokkos Device where the newly created Beams structure will reside
Parameters
beams_inputA BeamsInput object defining the beam elements
nodesA vector defining all of the nodes in the problem
Returns
A fully initialized Beams data structure

◆ CreateMasses()

template<typename DeviceType >
Masses< DeviceType > kynema::CreateMasses ( const MassesInput masses_input,
std::span< const Node nodes 
)
inline

Creates a masses data structure and initializes its data.

Template Parameters
DeviceDataThe Kokkos Device where the newly created Masses structure will reside
Parameters
masses_inputA MassesInput object defining the mass elements
nodesA vector defining all of the nodes in the problem
Returns
A fully initialized Masses data structure

◆ CreateSolver()

template<typename DeviceType = Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>>
Solver< DeviceType > kynema::CreateSolver ( State< DeviceType > &  state,
Elements< DeviceType > &  elements,
Constraints< DeviceType > &  constraints 
)
inline

Compute freedom tables for state, elements, and constraints, then construct and return solver.

Template Parameters
DeviceTypeA Kokkos device or execution/memory space
Parameters
stateA fully initialized State object
elementsA fully initialized Elements object
constraintsA fully initialized Constraints object
Returns
A solver based on the system connectivity described by the inputs

◆ CreateSprings()

template<typename DeviceType >
Springs< DeviceType > kynema::CreateSprings ( const SpringsInput springs_input,
std::span< const Node nodes 
)
inline

Creates a springs data structure and initializes its data.

Template Parameters
DeviceDataThe Kokkos Device where the newly created Beams structure will reside
Parameters
springs_inputA SpringsInput object defining the spring elements
nodesA vector defining all of the nodes in the problem
Returns
A fully initialized Springs data structure

◆ ReadStateFromFile()

template<typename DeviceType >
void kynema::ReadStateFromFile ( std::istream &  input,
State< DeviceType > &  state 
)
inline

Reads State data from a provided restart file.

It is assumed that the State data structure has a properly initialized connectivity information, such as when it has been created through the Model interface.

Template Parameters
DeviceTypethe Kokkos Device where the State object resides
Parameters
inputAn input stream from a binary restart file
stateThe State object into which to write data

◆ Step()

template<typename DeviceType >
bool kynema::Step ( StepParameters parameters,
Solver< DeviceType > &  solver,
Elements< DeviceType > &  elements,
State< DeviceType > &  state,
Constraints< DeviceType > &  constraints 
)
inline

Attempts to complete a single time step in the dynamic FEA simulation.

Parameters
parametersSimulation step parameters including time step size and convergence criteria
solverSolver object containing system matrices and solution methods
elementsCollection of elements (beams, masses etc.) in the FE mesh
stateCurrent state of the system (positions, velocities, accelerations etc.)
constraintsSystem constraints and their associated data
Returns
true if the step converged within the maximum allowed iterations, otherwise false

◆ WriteStateToFile()

template<typename DeviceType >
void kynema::WriteStateToFile ( std::ostream &  output,
const State< DeviceType > &  state 
)
inline

Writes State data into a minimal restart file.

Template Parameters
DeviceTypethe Kokkos Device where the State object resides
Parameters
outputAn output stream to the binary restart file
stateThe State object from which to write out the data