All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MassSpringNDRepresentationUtils.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_BLOCKS_MASSSPRINGNDREPRESENTATIONUTILS_H
17 #define SURGSIM_BLOCKS_MASSSPRINGNDREPRESENTATIONUTILS_H
18 
19 #include <memory>
20 
21 namespace SurgSim
22 {
23 
24 namespace Math
25 {
26 class OdeState;
27 }
28 
29 namespace Physics
30 {
31 class LinearSpring;
32 }
33 
34 namespace Blocks
35 {
36 
42 std::shared_ptr<SurgSim::Physics::LinearSpring> createLinearSpring(
43  const std::shared_ptr<SurgSim::Math::OdeState> state,
44  size_t nodeId0, size_t nodeId1,
45  double stiffness, double damping);
46 
47 }; // namespace Blocks
48 
49 }; // namespace SurgSim
50 
51 #endif // SURGSIM_BLOCKS_MASSSPRINGNDREPRESENTATIONUTILS_H
std::shared_ptr< SurgSim::Physics::LinearSpring > createLinearSpring(const std::shared_ptr< SurgSim::Math::OdeState > state, size_t nodeId0, size_t nodeId1, double stiffness, double damping)
Helper method to create a LinearSpring.
Definition: MassSpringNDRepresentationUtils.cpp:26
OdeState defines the state y of an ode of 2nd order of the form M(x,v).a = F(x, v) with boundary cond...
Definition: OdeState.h:34
Linear spring connecting 2 nodes with a viscous term.
Definition: LinearSpring.h:28