44#ifndef NIMBLE_KOKKOS_MODEL_DATA_H
45#define NIMBLE_KOKKOS_MODEL_DATA_H
47#include <Kokkos_Core.hpp>
94 GetFieldId(
const std::string& field_label)
const override
106 const std::shared_ptr<nimble::MaterialFactoryBase>& material_factory_base)
override;
114 using ModelDataBase::GetScalarNodeData;
115 using ModelDataBase::GetVectorNodeData;
151 double time_previous,
188 std::vector<double> initial_value = std::vector<double>());
193 std::vector<std::string>
196 std::vector<std::string>
199 std::vector<std::string>
202 std::vector<std::string>
257 int num_nodes_per_element,
265 int num_nodes_per_element,
273 int num_nodes_per_element,
281 int num_nodes_per_element,
285#ifndef KOKKOS_ENABLE_QTHREADS
290 int num_nodes_per_element,
305 template <FieldType ft>
309 template <FieldType ft>
314 using Data = std::unique_ptr<FieldBase>;
Definition nimble_data_manager.h:70
Definition nimble_genesis_mesh.h:59
Definition nimble_material_factory_base.h:61
Definition nimble_model_data_base.h:88
Definition nimble_view.h:72
Definition nimble_kokkos_model_data.cc:60
Definition nimble_kokkos_defs.h:170
void UpdateWithNewVelocity(nimble::DataManager &data_manager, double dt) override
Update model with new velocity.
Definition nimble_kokkos_model_data.cc:1731
void UpdateStates(const nimble::DataManager &data_manager) override
Copy time state (n+1) into time state (n)
Definition nimble_kokkos_model_data.cc:964
void InitializeBlockData(nimble::DataManager &data_manager)
Initialize block data for material information.
Definition nimble_kokkos_model_data.cc:1289
DeviceFullTensorIntPtView GetDeviceFullTensorIntegrationPointData(int block_id, int field_id, nimble::Step step)
Definition nimble_kokkos_model_data.cc:1580
std::vector< std::vector< Data > > host_element_data_
Definition nimble_kokkos_model_data.h:327
int AllocateElementData(int block_id, nimble::Length length, std::string label, int num_objects)
Definition nimble_kokkos_model_data.cc:645
int AllocateIntegrationPointData(int block_id, nimble::Length length, std::string label, int num_objects, std::vector< double > initial_value=std::vector< double >())
Definition nimble_kokkos_model_data.cc:708
DeviceFullTensorElemView GetDeviceFullTensorElementData(int block_id, int field_id)
Definition nimble_kokkos_model_data.cc:1610
std::vector< std::map< int, int > > field_id_to_host_element_data_index_
Definition nimble_kokkos_model_data.h:329
HostFullTensorIntPtView GetHostFullTensorIntegrationPointData(int block_id, int field_id, nimble::Step step)
Definition nimble_kokkos_model_data.cc:1492
std::map< int, int > block_id_to_integration_point_data_index_
Definition nimble_kokkos_model_data.h:332
std::vector< std::map< int, int > > field_id_to_host_integration_point_data_index_
Definition nimble_kokkos_model_data.h:337
void ScatterScalarNodeDataUsingKokkosScatterView(int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, const DeviceScalarNodeGatheredView &gathered_view_d)
Definition nimble_kokkos_model_data.cc:1705
nimble_kokkos::DeviceVectorNodeView displacement_d_
Definition nimble_kokkos_model_data.h:350
std::map< int, int > field_id_to_host_node_data_index_
Definition nimble_kokkos_model_data.h:323
std::vector< std::string > GetVectorNodeDataLabels() const
Definition nimble_kokkos_model_data.cc:1380
void ComputeLumpedMass(nimble::DataManager &data_manager) override
Compute the lumped mass.
Definition nimble_kokkos_model_data.cc:1068
DeviceVectorNodeView GetDeviceVectorNodeData(int field_id)
Definition nimble_kokkos_model_data.cc:1565
nimble_kokkos::DeviceVectorNodeView velocity_d_
Definition nimble_kokkos_model_data.h:353
std::map< int, int > field_id_to_device_node_data_index_
Definition nimble_kokkos_model_data.h:324
HostVectorNodeView GetHostVectorNodeData(int field_id)
Definition nimble_kokkos_model_data.cc:1457
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.
Definition nimble_kokkos_model_data.cc:1155
HostScalarElemView GetHostScalarElementData(int block_id, int field_id)
Definition nimble_kokkos_model_data.cc:1466
DeviceScalarNodeView GetDeviceScalarNodeData(int field_id)
Definition nimble_kokkos_model_data.cc:1556
std::vector< Data > host_node_data_
Definition nimble_kokkos_model_data.h:321
std::vector< Data > device_node_data_
Definition nimble_kokkos_model_data.h:322
nimble::Viewify< 1 > GetScalarNodeData(int field_id) override
Get view of scalar quantity defined on nodes.
Definition nimble_kokkos_model_data.cc:1024
std::unique_ptr< nimble_kokkos::ExodusOutputManager > exodus_output_manager_
Definition nimble_kokkos_model_data.h:340
std::vector< std::vector< Data > > host_integration_point_data_step_n_
Definition nimble_kokkos_model_data.h:333
nimble_kokkos::HostVectorNodeView velocity_h_
Definition nimble_kokkos_model_data.h:352
DeviceScalarIntPtView GetDeviceScalarIntegrationPointData(int block_id, int field_id, nimble::Step step)
Definition nimble_kokkos_model_data.cc:1586
int AllocateNodeData(nimble::Length length, std::string label, int num_objects) override
Allocate data storage for a node-based quantity.
Definition nimble_kokkos_model_data.cc:597
Field< ft >::View GetDeviceIntPointData(int block_id, int field_id, nimble::Step step)
Definition nimble_kokkos_model_data.cc:1541
DeviceScalarElemView GetDeviceScalarElementData(int block_id, int field_id)
Definition nimble_kokkos_model_data.cc:1598
int GetFieldId(const std::string &field_label) const override
Returns the field ID for a specific label.
Definition nimble_kokkos_model_data.h:94
HostScalarNodeView GetHostScalarNodeData(int field_id)
Definition nimble_kokkos_model_data.cc:1448
void ScatterScalarNodeData(int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, const DeviceScalarNodeGatheredView &gathered_view_d)
Definition nimble_kokkos_model_data.cc:1661
std::vector< std::vector< Data > > host_integration_point_data_step_np1_
Definition nimble_kokkos_model_data.h:334
std::vector< nimble_kokkos::DeviceVectorNodeGatheredView > gathered_contact_force_d
Definition nimble_kokkos_model_data.h:346
void InitializeGatheredVectors(const nimble::GenesisMesh &mesh_)
Definition nimble_kokkos_model_data.cc:1044
std::vector< nimble_kokkos::DeviceVectorNodeGatheredView > gathered_reference_coordinate_d
Definition nimble_kokkos_model_data.h:343
std::vector< nimble_kokkos::DeviceVectorNodeGatheredView > gathered_internal_force_d
Definition nimble_kokkos_model_data.h:345
DeviceSymTensorElemView GetDeviceSymTensorElementData(int block_id, int field_id)
Definition nimble_kokkos_model_data.cc:1604
std::vector< std::vector< Data > > device_element_data_
Definition nimble_kokkos_model_data.h:328
HostFullTensorElemView GetHostFullTensorElementData(int block_id, int field_id)
Definition nimble_kokkos_model_data.cc:1518
std::vector< std::map< int, int > > field_id_to_device_integration_point_data_index_
Definition nimble_kokkos_model_data.h:338
nimble::Viewify< 2 > GetVectorNodeData(int field_id) override
Get view of vector quantity defined on nodes.
Definition nimble_kokkos_model_data.cc:1033
std::vector< std::string > GetFullTensorIntegrationPointDataLabels(int block_id) const
Definition nimble_kokkos_model_data.cc:1424
nimble_kokkos::HostVectorNodeView displacement_h_
Definition nimble_kokkos_model_data.h:349
std::map< int, int > block_id_to_element_data_index_
Definition nimble_kokkos_model_data.h:326
HostSymTensorElemView GetHostSymTensorElementData(int block_id, int field_id)
Definition nimble_kokkos_model_data.cc:1507
std::vector< std::vector< Data > > device_integration_point_data_step_np1_
Definition nimble_kokkos_model_data.h:336
HostSymTensorIntPtView GetHostSymTensorIntegrationPointData(int block_id, int field_id, nimble::Step step)
Definition nimble_kokkos_model_data.cc:1477
DeviceScalarNodeGatheredView GatherScalarNodeData(int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, DeviceScalarNodeGatheredView gathered_view_d)
Definition nimble_kokkos_model_data.cc:1616
std::vector< std::string > GetScalarNodeDataLabels() const
Definition nimble_kokkos_model_data.cc:1361
std::vector< int > GetBlockIds() const
Definition nimble_kokkos_model_data.cc:886
ModelData()
Definition nimble_kokkos_model_data.cc:592
std::vector< std::map< int, int > > field_id_to_device_element_data_index_
Definition nimble_kokkos_model_data.h:330
DeviceSymTensorIntPtView GetDeviceSymTensorIntegrationPointData(int block_id, int field_id, nimble::Step step)
Definition nimble_kokkos_model_data.cc:1574
std::vector< nimble_kokkos::DeviceVectorNodeGatheredView > gathered_displacement_d
Definition nimble_kokkos_model_data.h:344
void ScatterVectorNodeData(int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, const DeviceVectorNodeGatheredView &gathered_view_d)
Definition nimble_kokkos_model_data.cc:1681
Field< ft >::View GetDeviceElementData(int block_id, int field_id)
Definition nimble_kokkos_model_data.cc:1530
std::map< int, nimble_kokkos::Block > blocks_
Blocks.
Definition nimble_kokkos_model_data.h:319
void WriteExodusOutput(nimble::DataManager &data_manager, double time_current) override
Write output of simulation in Exodus format.
Definition nimble_kokkos_model_data.cc:1332
std::vector< nimble::BlockData > block_data_
Definition nimble_kokkos_model_data.h:356
std::vector< std::string > GetSymmetricTensorIntegrationPointDataLabels(int block_id) const
Definition nimble_kokkos_model_data.cc:1399
std::map< std::string, int > field_label_to_field_id_map_
Definition nimble_kokkos_model_data.h:316
void InitializeBlocks(nimble::DataManager &data_manager, const std::shared_ptr< nimble::MaterialFactoryBase > &material_factory_base) override
Initialize the different blocks in the mesh.
Definition nimble_kokkos_model_data.cc:894
std::vector< std::vector< Data > > device_integration_point_data_step_n_
Definition nimble_kokkos_model_data.h:335
void UpdateWithNewDisplacement(nimble::DataManager &data_manager, double dt) override
Update model with new displacement.
Definition nimble_kokkos_model_data.cc:1737
void InitializeExodusOutput(nimble::DataManager &data_manager) override
Definition nimble_kokkos_model_data.cc:1306
DeviceVectorNodeGatheredView GatherVectorNodeData(int field_id, int num_elements, int num_nodes_per_element, const DeviceElementConnectivityView &elem_conn_d, DeviceVectorNodeGatheredView gathered_view_d)
Definition nimble_kokkos_model_data.cc:1637
std::unique_ptr< FieldBase > Data
Definition nimble_kokkos_model_data.h:314
DeviceVectorIntPtView GetDeviceVectorIntegrationPointData(int block_id, int field_id, nimble::Step step)
Definition nimble_kokkos_model_data.cc:1592
~ModelData() override
Definition nimble_kokkos_model_data.cc:594
Definition nimble_contact_manager.h:68
Field< FieldType::HostScalarElem >::View HostScalarElemView
Definition nimble_kokkos_defs.h:574
Field< FieldType::HostFullTensorElem >::View HostFullTensorElemView
Definition nimble_kokkos_defs.h:575
Field< FieldType::DeviceScalarElem >::View DeviceScalarElemView
Definition nimble_kokkos_defs.h:600
Field< FieldType::HostScalarNode >::View HostScalarNodeView
Definition nimble_kokkos_defs.h:570
Field< FieldType::HostVectorNode >::View HostVectorNodeView
Definition nimble_kokkos_defs.h:571
Field< FieldType::DeviceVectorIntPt >::View DeviceVectorIntPtView
Definition nimble_kokkos_defs.h:597
Field< FieldType::DeviceScalarIntPt >::View DeviceScalarIntPtView
Definition nimble_kokkos_defs.h:594
Field< FieldType::DeviceVectorNode >::View DeviceVectorNodeView
Definition nimble_kokkos_defs.h:585
Field< FieldType::HostSymTensorElem >::View HostSymTensorElemView
Definition nimble_kokkos_defs.h:576
Field< FieldType::DeviceSymTensorIntPt >::View DeviceSymTensorIntPtView
Definition nimble_kokkos_defs.h:591
Field< FieldType::DeviceScalarNode >::GatheredView DeviceScalarNodeGatheredView
Definition nimble_kokkos_defs.h:583
Field< FieldType::HostFullTensorIntPt >::View HostFullTensorIntPtView
Definition nimble_kokkos_defs.h:572
Kokkos::View< int *, kokkos_device > DeviceElementConnectivityView
Definition nimble_kokkos_defs.h:607
Field< FieldType::DeviceFullTensorElem >::View DeviceFullTensorElemView
Definition nimble_kokkos_defs.h:602
Field< FieldType::DeviceScalarNode >::View DeviceScalarNodeView
Definition nimble_kokkos_defs.h:582
Field< FieldType::DeviceSymTensorElem >::View DeviceSymTensorElemView
Definition nimble_kokkos_defs.h:604
Field< FieldType::DeviceVectorNode >::GatheredView DeviceVectorNodeGatheredView
Definition nimble_kokkos_defs.h:586
Field< FieldType::DeviceFullTensorIntPt >::View DeviceFullTensorIntPtView
Definition nimble_kokkos_defs.h:588
Field< FieldType::HostSymTensorIntPt >::View HostSymTensorIntPtView
Definition nimble_kokkos_defs.h:573
Definition kokkos_contact_manager.h:49
Length
Definition nimble_data_utils.h:66
Step
Definition nimble_data_utils.h:96