mbsim 4.0.0 MBSim Kernel

generalized_position_excitation.h
1 /* Copyright (C) 2004-2015 MBSim Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 *
17 * Contact: martin.o.foerg@gmail.com
18 */
19
20 #ifndef _GENERALIZED_POSITION_EXCITATION_H_
21 #define _GENERALIZED_POSITION_EXCITATION_H_
22
23 #include "mbsim/links/generalized_kinematic_excitation.h"
24 #include "mbsim/functions/function.h"
25
26 namespace MBSim {
27
28 class GeneralizedPositionExcitation : public GeneralizedKinematicExcitation {
29 friend class GeneralizedPositionConstraint;
30 protected:
31 Function<fmatvec::VecV(double)> *f;
32 public:
33 GeneralizedPositionExcitation(const std::string &name="") : GeneralizedKinematicExcitation(name) { }
34 ~GeneralizedPositionExcitation();
35
36 void init(InitStage stage, const InitConfigSet &config) override;
37
38 void updateGeneralizedPositions() override;
39 void updateGeneralizedVelocities() override;
40 void updatewb() override;
41
42 void setExcitationFunction(Function<fmatvec::VecV(double)>* f_, bool takeOwnerShip = true) {
43 f = f_;
44 f->setParent(this);
45 f->setName("Excitation");
46 deletef = takeOwnerShip;
47 }
48
49 void initializeUsingXML(xercesc::DOMElement * element) override;
50
51 private:
52 bool deletef { true };
53 };
54
55 }
56
57 #endif
MBSim::GeneralizedPositionExcitation
Definition: generalized_position_excitation.h:28
MBSim::GeneralizedPositionConstraint
Definition: generalized_position_constraint.h:27
MBSim::GeneralizedKinematicExcitation
Definition: generalized_kinematic_excitation.h:30
MBSim::Element::InitStage
InitStage
The stages of the initialization.
Definition: element.h:62
MBSim::Function
Definition: contact_kinematics.h:32
MBSim::Element::name
std::string name
name of element
Definition: element.h:260
MBSim::GeneralizedPositionExcitation::init
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: generalized_position_excitation.cc:36
MBSim::Element::setName
void setName(const std::string &str)
Definition: element.h:115
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30