mbsim  4.0.0
MBSim Kernel
initial_condition.h
1/* Copyright (C) 2004-2024 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 _INITIAL_CONDITION_H_
21#define _INITIAL_CONDITION_H_
22
23#include "mbsim/links/link.h"
24
25namespace MBSim {
26
27 class InitialCondition : public Link {
28 protected:
29 bool active{true};
30 public:
31 InitialCondition(const std::string &name) : Link(name) { }
32 ~InitialCondition() override { }
33
34 void init(InitStage stage, const InitConfigSet &config) override;
35 void plot() override {}
36
37 void deactivate() { active = false; }
38 bool isActive() const override { return active; }
39 bool gActiveChanged() override { return false; }
40 bool isSetValued() const override { return true; }
41 bool isSingleValued() const override { return false; }
42
43 void calcgSize(int j) override;
44 void calcgdSize(int j) override;
45
46 void updatehRef(fmatvec::Vec &hParent, int j=0) override { }
47 void updaterRef(fmatvec::Vec &hParent, int j=0) override { }
48 void updateVRef(fmatvec::Mat &WParent, int j=0) override { }
49 };
50
51}
52
53#endif
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
Definition: initial_condition.h:27
bool gActiveChanged() override
Definition: initial_condition.h:39
bool isActive() const override
Definition: initial_condition.h:38
bool isSingleValued() const override
asks the link if it contains single valued force laws that contribute to the right-hand side vector h
Definition: initial_condition.h:41
void updatehRef(fmatvec::Vec &hParent, int j=0) override
references to complete and link smooth force vector of dynamic system parent
Definition: initial_condition.h:46
void updateVRef(fmatvec::Mat &WParent, int j=0) override
references to condensed contact force direction matrix of dynamic system parent
Definition: initial_condition.h:48
void updaterRef(fmatvec::Vec &hParent, int j=0) override
references to nonsmooth force vector of dynamic system parent
Definition: initial_condition.h:47
void calcgSize(int j) override
calculates size of relative distances
Definition: initial_condition.cc:31
void calcgdSize(int j) override
calculates size of gap velocities
Definition: initial_condition.cc:35
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: initial_condition.cc:39
void plot() override
plots time dependent data
Definition: initial_condition.h:35
bool isSetValued() const override
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: initial_condition.h:40
namespace MBSim
Definition: bilateral_constraint.cc:30