NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
|
#include <nimble_kokkos_model_data.h>
Public Member Functions | |
ModelData () | |
~ModelData () override | |
int | AllocateNodeData (nimble::Length length, std::string label, int num_objects) override |
Allocate data storage for a node-based quantity. | |
int | GetFieldId (const std::string &field_label) const override |
Returns the field ID for a specific label. | |
void | InitializeBlocks (nimble::DataManager &data_manager, const std::shared_ptr< nimble::MaterialFactoryBase > &material_factory_base) override |
Initialize the different blocks in the mesh. | |
void | UpdateStates (const nimble::DataManager &data_manager) override |
Copy time state (n+1) into time state (n) | |
nimble::Viewify< 1 > | GetScalarNodeData (int field_id) override |
Get view of scalar quantity defined on nodes. | |
nimble::Viewify< 2 > | GetVectorNodeData (int field_id) override |
Get view of vector quantity defined on nodes. | |
void | ComputeLumpedMass (nimble::DataManager &data_manager) override |
Compute the lumped mass. | |
void | InitializeExodusOutput (nimble::DataManager &data_manager) override |
void | WriteExodusOutput (nimble::DataManager &data_manager, double time_current) override |
Write output of simulation in Exodus format. | |
void | ComputeInternalForce (nimble::DataManager &data_manager, double time_previous, double time_current, bool is_output_step, const nimble::Viewify< 2 > &displacement, nimble::Viewify< 2 > &force) override |
Compute the internal force. | |
void | UpdateWithNewVelocity (nimble::DataManager &data_manager, double dt) override |
Update model with new velocity. | |
void | UpdateWithNewDisplacement (nimble::DataManager &data_manager, double dt) override |
Update model with new displacement. | |
int | AllocateElementData (int block_id, nimble::Length length, std::string label, int num_objects) |
int | AllocateIntegrationPointData (int block_id, nimble::Length length, std::string label, int num_objects, std::vector< double > initial_value=std::vector< double >()) |
std::vector< int > | GetBlockIds () const |
std::vector< std::string > | GetScalarNodeDataLabels () const |
std::vector< std::string > | GetVectorNodeDataLabels () const |
std::vector< std::string > | GetSymmetricTensorIntegrationPointDataLabels (int block_id) const |
std::vector< std::string > | GetFullTensorIntegrationPointDataLabels (int block_id) const |
HostScalarNodeView | GetHostScalarNodeData (int field_id) |
HostVectorNodeView | GetHostVectorNodeData (int field_id) |
HostSymTensorIntPtView | GetHostSymTensorIntegrationPointData (int block_id, int field_id, nimble::Step step) |
HostFullTensorIntPtView | GetHostFullTensorIntegrationPointData (int block_id, int field_id, nimble::Step step) |
HostScalarElemView | GetHostScalarElementData (int block_id, int field_id) |
HostSymTensorElemView | GetHostSymTensorElementData (int block_id, int field_id) |
HostFullTensorElemView | GetHostFullTensorElementData (int block_id, int field_id) |
DeviceScalarNodeView | GetDeviceScalarNodeData (int field_id) |
DeviceVectorNodeView | GetDeviceVectorNodeData (int field_id) |
DeviceSymTensorIntPtView | GetDeviceSymTensorIntegrationPointData (int block_id, int field_id, nimble::Step step) |
DeviceFullTensorIntPtView | GetDeviceFullTensorIntegrationPointData (int block_id, int field_id, nimble::Step step) |
DeviceScalarIntPtView | GetDeviceScalarIntegrationPointData (int block_id, int field_id, nimble::Step step) |
DeviceVectorIntPtView | GetDeviceVectorIntegrationPointData (int block_id, int field_id, nimble::Step step) |
DeviceScalarElemView | GetDeviceScalarElementData (int block_id, int field_id) |
DeviceSymTensorElemView | GetDeviceSymTensorElementData (int block_id, int field_id) |
DeviceFullTensorElemView | GetDeviceFullTensorElementData (int block_id, int field_id) |
DeviceScalarNodeGatheredView | GatherScalarNodeData (int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, DeviceScalarNodeGatheredView gathered_view_d) |
DeviceVectorNodeGatheredView | GatherVectorNodeData (int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, DeviceVectorNodeGatheredView gathered_view_d) |
void | ScatterScalarNodeData (int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, const DeviceScalarNodeGatheredView &gathered_view_d) |
void | ScatterVectorNodeData (int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, const DeviceVectorNodeGatheredView &gathered_view_d) |
void | ScatterScalarNodeDataUsingKokkosScatterView (int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, const DeviceScalarNodeGatheredView &gathered_view_d) |
![]() | |
ModelDataBase ()=default | |
Constructor. | |
virtual | ~ModelDataBase ()=default |
Destructor. | |
int | GetFieldIdChecked (const std::string &field_label) const |
virtual void | InitializeBlocks (nimble::DataManager &data_manager, const std::shared_ptr< nimble::MaterialFactoryBase > &material_factory_base)=0 |
Initialize the different blocks in the mesh. | |
nimble::Viewify< 1 > | GetScalarNodeData (const std::string &label) |
Get view of scalar quantity defined on nodes. | |
nimble::Viewify< 2 > | GetVectorNodeData (const std::string &label) |
Get view of vector quantity defined on nodes. | |
virtual void | ComputeExternalForce (nimble::DataManager &data_manager, double time_previous, double time_current, bool is_output_step) |
Compute the external force. | |
virtual void | ApplyInitialConditions (nimble::DataManager &data_manager) |
Apply initial conditions. | |
virtual void | ApplyKinematicConditions (nimble::DataManager &data_manager, double time_current, double time_previous) |
Apply kinematic conditions. | |
int | GetDimension () const |
Get the spatial dimension. | |
void | SetCriticalTimeStep (double time_step) |
Set the critical time step. | |
void | SetDimension (int dim) |
Set spatial dimension. | |
void | SetReferenceCoordinates (const nimble::GenesisMesh &mesh) |
Set reference coordinates. | |
double | GetCriticalTimeStep () const |
Get the critical time step. | |
const std::vector< std::string > & | GetNodeDataLabelsForOutput () const |
const std::map< int, std::vector< std::string > > & | GetElementDataLabels () const |
const std::map< int, std::vector< std::string > > & | GetElementDataLabelsForOutput () const |
const std::map< int, std::vector< std::string > > & | GetDerivedElementDataLabelsForOutput () const |
Protected Types | |
using | Data = std::unique_ptr<FieldBase> |
Protected Member Functions | |
void | InitializeGatheredVectors (const nimble::GenesisMesh &mesh_) |
void | InitializeBlockData (nimble::DataManager &data_manager) |
Initialize block data for material information. | |
template<FieldType ft> | |
Field< ft >::View | GetDeviceElementData (int block_id, int field_id) |
template<FieldType ft> | |
Field< ft >::View | GetDeviceIntPointData (int block_id, int field_id, nimble::Step step) |
|
protected |
nimble_kokkos::ModelData::ModelData | ( | ) |
|
override |
int nimble_kokkos::ModelData::AllocateElementData | ( | int | block_id, |
nimble::Length | length, | ||
std::string | label, | ||
int | num_objects ) |
int nimble_kokkos::ModelData::AllocateIntegrationPointData | ( | int | block_id, |
nimble::Length | length, | ||
std::string | label, | ||
int | num_objects, | ||
std::vector< double > | initial_value = std::vector<double>() ) |
|
overridevirtual |
Allocate data storage for a node-based quantity.
length | |
label | |
num_objects |
Implements nimble::ModelDataBase.
|
overridevirtual |
Compute the internal force.
[in] | data_manager | |
[in] | time_previous | |
[in] | time_current | |
[in] | is_output_step | |
[in] | displacement | |
[out] | internal_force | Output for internal force |
Reimplemented from nimble::ModelDataBase.
|
overridevirtual |
Compute the lumped mass.
data_manager | Reference to the data manager |
Implements nimble::ModelDataBase.
DeviceScalarNodeGatheredView nimble_kokkos::ModelData::GatherScalarNodeData | ( | int | field_id, |
int | num_elements, | ||
int | num_nodes_per_element, | ||
const DeviceElementConnectivityView & | elem_conn_d, | ||
DeviceScalarNodeGatheredView | gathered_view_d ) |
DeviceVectorNodeGatheredView nimble_kokkos::ModelData::GatherVectorNodeData | ( | int | field_id, |
int | num_elements, | ||
int | num_nodes_per_element, | ||
const DeviceElementConnectivityView & | elem_conn_d, | ||
DeviceVectorNodeGatheredView | gathered_view_d ) |
std::vector< int > nimble_kokkos::ModelData::GetBlockIds | ( | ) | const |
|
protected |
DeviceFullTensorElemView nimble_kokkos::ModelData::GetDeviceFullTensorElementData | ( | int | block_id, |
int | field_id ) |
DeviceFullTensorIntPtView nimble_kokkos::ModelData::GetDeviceFullTensorIntegrationPointData | ( | int | block_id, |
int | field_id, | ||
nimble::Step | step ) |
|
protected |
DeviceScalarElemView nimble_kokkos::ModelData::GetDeviceScalarElementData | ( | int | block_id, |
int | field_id ) |
DeviceScalarIntPtView nimble_kokkos::ModelData::GetDeviceScalarIntegrationPointData | ( | int | block_id, |
int | field_id, | ||
nimble::Step | step ) |
DeviceScalarNodeView nimble_kokkos::ModelData::GetDeviceScalarNodeData | ( | int | field_id | ) |
DeviceSymTensorElemView nimble_kokkos::ModelData::GetDeviceSymTensorElementData | ( | int | block_id, |
int | field_id ) |
DeviceSymTensorIntPtView nimble_kokkos::ModelData::GetDeviceSymTensorIntegrationPointData | ( | int | block_id, |
int | field_id, | ||
nimble::Step | step ) |
DeviceVectorIntPtView nimble_kokkos::ModelData::GetDeviceVectorIntegrationPointData | ( | int | block_id, |
int | field_id, | ||
nimble::Step | step ) |
DeviceVectorNodeView nimble_kokkos::ModelData::GetDeviceVectorNodeData | ( | int | field_id | ) |
|
inlineoverridevirtual |
Returns the field ID for a specific label.
field_label | Label for a stored quantity |
Implements nimble::ModelDataBase.
std::vector< std::string > nimble_kokkos::ModelData::GetFullTensorIntegrationPointDataLabels | ( | int | block_id | ) | const |
HostFullTensorElemView nimble_kokkos::ModelData::GetHostFullTensorElementData | ( | int | block_id, |
int | field_id ) |
HostFullTensorIntPtView nimble_kokkos::ModelData::GetHostFullTensorIntegrationPointData | ( | int | block_id, |
int | field_id, | ||
nimble::Step | step ) |
HostScalarElemView nimble_kokkos::ModelData::GetHostScalarElementData | ( | int | block_id, |
int | field_id ) |
HostScalarNodeView nimble_kokkos::ModelData::GetHostScalarNodeData | ( | int | field_id | ) |
HostSymTensorElemView nimble_kokkos::ModelData::GetHostSymTensorElementData | ( | int | block_id, |
int | field_id ) |
HostSymTensorIntPtView nimble_kokkos::ModelData::GetHostSymTensorIntegrationPointData | ( | int | block_id, |
int | field_id, | ||
nimble::Step | step ) |
HostVectorNodeView nimble_kokkos::ModelData::GetHostVectorNodeData | ( | int | field_id | ) |
|
overridevirtual |
Get view of scalar quantity defined on nodes.
field_id | the field id (see DataManager::GetFieldIDs()) |
Implements nimble::ModelDataBase.
std::vector< std::string > nimble_kokkos::ModelData::GetScalarNodeDataLabels | ( | ) | const |
std::vector< std::string > nimble_kokkos::ModelData::GetSymmetricTensorIntegrationPointDataLabels | ( | int | block_id | ) | const |
|
overridevirtual |
Get view of vector quantity defined on nodes.
field_id | the field id (see DataManager::GetFieldIDs()) |
Implements nimble::ModelDataBase.
std::vector< std::string > nimble_kokkos::ModelData::GetVectorNodeDataLabels | ( | ) | const |
|
protected |
Initialize block data for material information.
data_manager |
|
override |
Initialize the different blocks in the mesh.
data_manager | Reference to the data manager |
material_factory_base | Shared pointer to the material factory |
|
overridevirtual |
Reimplemented from nimble::ModelDataBase.
|
protected |
void nimble_kokkos::ModelData::ScatterScalarNodeData | ( | int | field_id, |
int | num_elements, | ||
int | num_nodes_per_element, | ||
const DeviceElementConnectivityView & | elem_conn_d, | ||
const DeviceScalarNodeGatheredView & | gathered_view_d ) |
void nimble_kokkos::ModelData::ScatterScalarNodeDataUsingKokkosScatterView | ( | int | field_id, |
int | num_elements, | ||
int | num_nodes_per_element, | ||
const DeviceElementConnectivityView & | elem_conn_d, | ||
const DeviceScalarNodeGatheredView & | gathered_view_d ) |
void nimble_kokkos::ModelData::ScatterVectorNodeData | ( | int | field_id, |
int | num_elements, | ||
int | num_nodes_per_element, | ||
const DeviceElementConnectivityView & | elem_conn_d, | ||
const DeviceVectorNodeGatheredView & | gathered_view_d ) |
|
overridevirtual |
Copy time state (n+1) into time state (n)
data_manager | Reference to the data manager |
Implements nimble::ModelDataBase.
|
overridevirtual |
Update model with new displacement.
[in] | data_manager | Reference to the data manager |
[in] | dt | Current time step |
Reimplemented from nimble::ModelDataBase.
|
overridevirtual |
Update model with new velocity.
[in] | data_manager | Reference to the data manager |
[in] | dt | Current time step |
Reimplemented from nimble::ModelDataBase.
|
overridevirtual |
Write output of simulation in Exodus format.
[in] | data_manager | Reference to data manager |
[in] | time_current | Time value |
Reimplemented from nimble::ModelDataBase.
|
protected |
|
protected |
|
protected |
|
protected |
Blocks.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |