All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fem1DRepresentation.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_PHYSICS_FEM1DREPRESENTATION_H
17 #define SURGSIM_PHYSICS_FEM1DREPRESENTATION_H
18 
19 #include <memory>
20 #include <string>
21 
22 #include "SurgSim/Math/Matrix.h"
24 
25 namespace SurgSim
26 {
27 
28 namespace Physics
29 {
30 SURGSIM_STATIC_REGISTRATION(Fem1DRepresentation);
31 
32 class FemPlyReaderDelegate;
33 
38 {
39 public:
42  explicit Fem1DRepresentation(const std::string& name);
43 
45  virtual ~Fem1DRepresentation();
46 
48 
49  virtual void addExternalGeneralizedForce(std::shared_ptr<Localization> localization,
50  SurgSim::Math::Vector& generalizedForce,
52  const SurgSim::Math::Matrix& D = SurgSim::Math::Matrix()) override;
53 
56  virtual RepresentationType getType() const override;
57 
58 protected:
59  virtual bool doWakeUp() override;
60 
64  virtual void transformState(std::shared_ptr<SurgSim::Math::OdeState> state,
65  const SurgSim::Math::RigidTransform3d& transform) override;
66 
67 private:
68  virtual std::shared_ptr<FemPlyReaderDelegate> getDelegate() override;
69 };
70 
71 } // namespace Physics
72 
73 } // namespace SurgSim
74 
75 #endif // SURGSIM_PHYSICS_FEM1DREPRESENTATION_H
virtual void addExternalGeneralizedForce(std::shared_ptr< Localization > localization, SurgSim::Math::Vector &generalizedForce, const SurgSim::Math::Matrix &K=SurgSim::Math::Matrix(), const SurgSim::Math::Matrix &D=SurgSim::Math::Matrix()) override
Add an external generalized force applied on a specific localization.
Definition: Fem1DRepresentation.cpp:72
RepresentationType
Definition: Representation.h:42
Finite Element Model 1D is a fem built with 1D FemElement.
Definition: Fem1DRepresentation.h:37
Finite Element Model (a.k.a.
Definition: FemRepresentation.h:38
virtual std::shared_ptr< FemPlyReaderDelegate > getDelegate() override
To be implemented by derived classes.
Definition: Fem1DRepresentation.cpp:153
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
Fem1DRepresentation(const std::string &name)
Constructor.
Definition: Fem1DRepresentation.cpp:57
virtual ~Fem1DRepresentation()
Destructor.
Definition: Fem1DRepresentation.cpp:63
SURGSIM_CLASSNAME(SurgSim::Physics::Fem1DRepresentation)
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:67
virtual RepresentationType getType() const override
Query the representation type.
Definition: Fem1DRepresentation.cpp:67
Definitions of small fixed-size square matrix types.
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
virtual bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: Fem1DRepresentation.cpp:131
virtual void transformState(std::shared_ptr< SurgSim::Math::OdeState > state, const SurgSim::Math::RigidTransform3d &transform) override
Transform a state using a given transformation.
Definition: Fem1DRepresentation.cpp:146
SURGSIM_STATIC_REGISTRATION(DeformableCollisionRepresentation)