opensurgsim
MlcpPhysicsProblem.h
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_PHYSICS_MLCPPHYSICSPROBLEM_H
17 #define SURGSIM_PHYSICS_MLCPPHYSICSPROBLEM_H
18 
19 #include "SurgSim/Math/MlcpProblem.h"
21 
22 namespace SurgSim
23 {
24 namespace Physics
25 {
26 
29 
44 {
46  ~MlcpPhysicsProblem() override;
47 
56  Eigen::SparseMatrix<double, Eigen::RowMajor, ptrdiff_t> H;
57 
60  Matrix CHt;
61 
67  void updateConstraint(
68  const Eigen::SparseVector<double, Eigen::RowMajor, ptrdiff_t>& newSubH,
69  const Vector& newCHt,
70  size_t indexSubC,
71  size_t indexNewSubH);
72 
77  void setZero(size_t numDof, size_t numConstraintDof, size_t numConstraints) override;
78 
84  static MlcpPhysicsProblem Zero(size_t numDof, size_t numConstraintDof, size_t numConstraints);
85 };
86 
87 }; // namespace Physics
88 }; // namespace SurgSim
89 
90 #endif // SURGSIM_PHYSICS_MLCPPHYSICSPROBLEM_H
~MlcpPhysicsProblem() override
Destructor.
Definition: MlcpPhysicsProblem.cpp:26
Eigen::SparseMatrix< double, Eigen::RowMajor, ptrdiff_t > H
The matrix , which is a matrix of size that converts from the degrees of freedom in the system (i...
Definition: MlcpPhysicsProblem.h:56
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Matrix CHt
The matrix , which is a matrix of size that is used to convert the vector of constraint forces to t...
Definition: MlcpPhysicsProblem.h:60
A description of a physical mixed LCP system to be solved.
Definition: MlcpPhysicsProblem.h:43
void setZero(size_t numDof, size_t numConstraintDof, size_t numConstraints) override
Resize an MlcpPhysicsProblem and set to zero.
Definition: MlcpPhysicsProblem.cpp:30
Definitions of useful sparse matrix functions.
static MlcpPhysicsProblem Zero(size_t numDof, size_t numConstraintDof, size_t numConstraints)
Initialize an MlcpPhysicsProblem with zero values.
Definition: MlcpPhysicsProblem.cpp:38
A description of an MLCP (mixed linear complementarity problem, or mixed LCP) system to be solved...
Definition: MlcpProblem.h:57
void updateConstraint(const Eigen::SparseVector< double, Eigen::RowMajor, ptrdiff_t > &newSubH, const Vector &newCHt, size_t indexSubC, size_t indexNewSubH)
Applies a new constraint to a specific Representation.
Definition: MlcpPhysicsProblem.cpp:46