44#ifndef NIMBLE_CONTACT_H
45#define NIMBLE_CONTACT_H
51#include <unordered_map>
62#ifdef NIMBLE_HAVE_KOKKOS
77class VectorCommunicator;
82getContactForce(
const double penalty,
const double gap,
const double normal[3],
double contact_force[3])
84 const double scale = penalty * gap;
85 for (
int i = 0; i < 3; ++i) contact_force[i] = scale * normal[i];
94 template <
typename VecType>
100 const double normal[3],
101 const double barycentric_coordinates[3],
102 VecType& full_contact_force)
const
104 constexpr int dim_vec = 3;
105 double contact_force[dim_vec]{};
126 tmp_node.SetNodalContactForces(contact_force);
127 tmp_node.ScatterForceToContactManagerForceVector<VecType>(full_contact_force);
183 std::vector<int>
const& primary_block_ids,
184 std::vector<int>
const& secondary_block_ids);
241 const std::unordered_map<std::string, double>&
251 std::vector<int>
const& block_ids,
252 int entity_id_offset,
253 std::vector<std::vector<int>>& skin_faces,
254 std::vector<int>& entity_ids);
278 double tolerance = 1.e-8);
296 double* barycentric_coordinates,
297 double tolerance = 1.e-8);
321 template <
typename ArgT>
324 std::vector<std::vector<int>>
const& primary_skin_faces,
325 std::vector<int>
const& primary_skin_entity_ids,
326 std::vector<int>
const& secondary_node_ids,
327 std::vector<int>
const& secondary_node_entity_ids,
328 std::map<int, double>
const& secondary_node_char_lens,
330 ArgT& contact_faces)
const;
333 BoundingBox(
double& x_min,
double& x_max,
double& y_min,
double& y_max,
double& z_min,
double& z_max)
const;
342 throw std::invalid_argument(
"\nError in ComputeContactForce(), invalid penalty_parameter.\n");
345#ifdef NIMBLE_HAVE_KOKKOS
364 std::size_t num_elements);
400 template <
typename VecType>
406 const double direction[3],
407 const double facet_coordinates[3],
408 VecType& full_contact_force)
const
410 enforcement.EnforceContact<VecType>(node, face, gap, direction, facet_coordinates, full_contact_force);
417#ifdef NIMBLE_TIME_CONTACT
418 watch_.Start(str_val);
426#ifdef NIMBLE_TIME_CONTACT
427 watch_.Stop(str_val);
470 std::unordered_map<std::string, double>
timers_;
471#ifdef NIMBLE_TIME_CONTACT
478std::shared_ptr<nimble::ContactManager>
Definition nimble_data_manager.h:70
Definition nimble_exodus_output.h:59
Definition nimble_genesis_mesh.h:59
Definition nimble_timer.h:54
Definition nimble_timer.h:97
Definition nimble_vector_communicator.h:74
Definition nimble_view.h:72
Definition nimble_kokkos_model_data.h:72
void getContactForce(const double penalty, const double gap, const double normal[3], double contact_force[3])
Definition nimble_contact_manager.h:82
Definition nimble_contact_manager.h:68
Field< FieldType::DeviceVectorNode >::View DeviceVectorNodeView
Definition nimble_kokkos_defs.h:585
Kokkos::View< nimble::ContactEntity *, nimble_kokkos::kokkos_layout, nimble_kokkos::kokkos_host > HostContactEntityArrayView
Definition nimble_kokkos_contact_defs.h:17
Kokkos::View< nimble::ContactEntity *, nimble_kokkos::kokkos_layout, nimble_kokkos::kokkos_device > DeviceContactEntityArrayView
Definition nimble_kokkos_contact_defs.h:15
Field< FieldType::DeviceScalarNode >::View DeviceScalarNodeView
Definition nimble_kokkos_defs.h:582
Kokkos::View< int *, kokkos_device > DeviceIntegerArrayView
Definition nimble_kokkos_defs.h:606
Definition kokkos_contact_manager.h:49
std::shared_ptr< nimble::ContactManager > GetContactManager(std::shared_ptr< ContactInterface > interface, nimble::DataManager &data_manager)
Definition nimble_contact_manager.cc:152
#define NIMBLE_INLINE_FUNCTION
Definition nimble_defs.h:50