Fem2DRepresentation.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_FEM2DREPRESENTATION_H
17 #define SURGSIM_PHYSICS_FEM2DREPRESENTATION_H
18 
19 #include <memory>
20 #include <string>
21 
24 #include "SurgSim/Math/Matrix.h"
26 
27 namespace SurgSim
28 {
29 
30 namespace Physics
31 {
32 SURGSIM_STATIC_REGISTRATION(Fem2DRepresentation);
33 
34 class Fem2DPlyReaderDelegate;
35 
38 {
39 public:
42  explicit Fem2DRepresentation(const std::string& name);
43 
45  virtual ~Fem2DRepresentation();
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 
54  virtual RepresentationType getType() const override;
55 
56 protected:
57  virtual void transformState(std::shared_ptr<SurgSim::Math::OdeState> state,
58  const SurgSim::Math::RigidTransform3d& transform) override;
59 
60 private:
61  virtual std::shared_ptr<FemPlyReaderDelegate> getDelegate() override;
62 };
63 
64 } // namespace Physics
65 
66 } // namespace SurgSim
67 
68 #endif // SURGSIM_PHYSICS_FEM2DREPRESENTATION_H
Definition: DriveElementFromInputBehavior.cpp:27
RepresentationType
Definition: Representation.h:42
Finite Element Model 2D is a fem built with 2D FemElement.
Definition: Fem2DRepresentation.h:37
Finite Element Model (a.k.a.
Definition: FemRepresentation.h:38
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
Fem2DRepresentation(const std::string &name)
Constructor.
Definition: Fem2DRepresentation.cpp:54
virtual std::shared_ptr< FemPlyReaderDelegate > getDelegate() override
To be implemented by derived classes.
Definition: Fem2DRepresentation.cpp:128
virtual RepresentationType getType() const override
Query the representation type.
Definition: Fem2DRepresentation.cpp:123
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:67
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: Fem2DRepresentation.cpp:64
virtual ~Fem2DRepresentation()
Destructor.
Definition: Fem2DRepresentation.cpp:60
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
SURGSIM_CLASSNAME(SurgSim::Physics::Fem2DRepresentation)
SURGSIM_STATIC_REGISTRATION(DeformableCollisionRepresentation)
virtual void transformState(std::shared_ptr< SurgSim::Math::OdeState > state, const SurgSim::Math::RigidTransform3d &transform) override
Transform a state using a given transformation.
Definition: Fem2DRepresentation.cpp:136