NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
bvh_contact_manager.h
Go to the documentation of this file.
1/*
2//@HEADER
3// ************************************************************************
4//
5// NimbleSM
6// Copyright 2018
7// National Technology & Engineering Solutions of Sandia, LLC (NTESS)
8//
9// Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government
10// retains certain rights in this software.
11//
12// Redistribution and use in source and binary forms, with or without
13// modification, are permitted provided that the following conditions are
14// met:
15//
16// 1. Redistributions of source code must retain the above copyright
17// notice, this list of conditions and the following disclaimer.
18//
19// 2. Redistributions in binary form must reproduce the above copyright
20// notice, this list of conditions and the following disclaimer in the
21// documentation and/or other materials provided with the distribution.
22//
23// 3. Neither the name of the Corporation nor the names of the
24// contributors may be used to endorse or promote products derived from
25// this software without specific prior written permission.
26//
27// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY EXPRESS OR IMPLIED
28// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
29// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
30// NO EVENT SHALL NTESS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
32// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact David Littlewood (djlittl@sandia.gov)
39//
40// ************************************************************************
41//@HEADER
42*/
43
44#ifndef NIMBLE_BVH_CONTACT_MANAGER_H
45#define NIMBLE_BVH_CONTACT_MANAGER_H
46
47#include <bvh/collision_world.hpp>
48#include <bvh/types.hpp>
49
50#include <memory>
51
53
54namespace bvh {
55
56class collision_object;
57
58}
59
60namespace nimble {
62{
63 std::size_t local_index;
64 double gap;
65 double contact_force[3];
66 double bary[3];
67 bool node;
68};
69
70class BvhContactManager : public ParallelContactManager
71{
72 public:
74 std::shared_ptr<ContactInterface> interface,
75 nimble::DataManager& data_manager,
76 std::size_t _overdecomposition,
77 std::string splitting_alg);
78
81
83 operator=(const BvhContactManager&) = delete;
86
87 ~BvhContactManager() = default;
88
89 protected:
90 void
91 ComputeParallelContactForce(int step, bool debug_output, nimble::Viewify<2> contact_force) override;
92
93 void
95
96 bvh::collision_world m_world;
97 bvh::collision_object* m_nodes;
98 bvh::collision_object* m_faces;
99
100 bvh::split_algorithm m_split_alg = bvh::split_algorithm::geom_axis;
101
102 std::vector<NarrowphaseResult> m_last_results;
103};
104} // namespace nimble
105
106#endif // NIMBLESM_BVH_CONTACT_MANAGER_H
BvhContactManager(BvhContactManager &&)=delete
BvhContactManager & operator=(BvhContactManager &&)=delete
void ComputeBoundingVolumes()
Definition bvh_contact_manager.cc:235
BvhContactManager(std::shared_ptr< ContactInterface > interface, nimble::DataManager &data_manager, std::size_t _overdecomposition, std::string splitting_alg)
Definition bvh_contact_manager.cc:213
BvhContactManager(const BvhContactManager &)=delete
bvh::collision_object * m_nodes
Definition bvh_contact_manager.h:97
bvh::collision_world m_world
Definition bvh_contact_manager.h:96
bvh::split_algorithm m_split_alg
Definition bvh_contact_manager.h:100
std::vector< NarrowphaseResult > m_last_results
Definition bvh_contact_manager.h:102
bvh::collision_object * m_faces
Definition bvh_contact_manager.h:98
BvhContactManager & operator=(const BvhContactManager &)=delete
void ComputeParallelContactForce(int step, bool debug_output, nimble::Viewify< 2 > contact_force) override
Definition bvh_contact_manager.cc:252
Definition nimble_data_manager.h:70
Definition nimble_view.h:72
Definition bvh_contact_manager.h:54
Definition kokkos_contact_manager.h:49
Definition bvh_contact_manager.h:62
bool node
Definition bvh_contact_manager.h:67
double gap
Definition bvh_contact_manager.h:64
double bary[3]
Definition bvh_contact_manager.h:66
std::size_t local_index
Definition bvh_contact_manager.h:63
double contact_force[3]
Definition bvh_contact_manager.h:65