File kernel/src/modelingTools/Relation.hpp#
Go to the source code of this file
General interface for relations.
-
class Relation
- #include <Relation.hpp>
General Non Linear Relation (Abstract Base class for Relations).
The present class is an interface to all relations and provides tools to define and describe them.
A relation is a link between global variables of the Dynamical Systems and some local ones, named y and lambda; belonging to one and only one Interaction.
All relations are specified by their type (First order or Lagrangian) accessed by getType() and their sub-type (linear, scleronomous …), returned by getSubType().
A relation provides functions to compute:
a function computeOutput() that updates y using dynamical systems global variables,
a function computeInput() that updates non-smooth dynamical systems parts (e.g. r or p) using \( \lambda \) .
Subclassed by FirstOrderR, LagrangianR, NewtonEulerR
Public Functions
-
virtual ~Relation() noexcept = default
destructor
-
void setComputehFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute output function h.
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
void setComputeJachxFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute \( \nabla_x h(..) \).
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
void setComputeJachzFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute \( \nabla_z h(..) \).
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
void setComputeJachlambdaFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute \( \nabla_{\lambda} h(..) \).
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
void setComputegFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute input function g.
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
void setComputeFFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute input function F.
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
void setComputeEFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute input function E.
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
void setComputeJacgxFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute the jacobian of \( g \) w.r.t.
x
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
void setComputeJacglambdaFunction(const std::string &pluginPath, const std::string &functionName)
To set a plug-in function to compute the jacobian of \( g \) w.r.t.
\( \lambda \)
- Parameters:
pluginPath – the complete path to the plugin
functionName – the function name to use in this plugin
-
virtual void initialize(Interaction &inter) = 0
initialize the relation (check sizes, memory allocation …)
- Parameters:
inter – the interaction using this relation
-
virtual void checkSize(Interaction &inter) = 0
check sizes of the relation specific operators.
- Parameters:
inter – an Interaction using this relation
-
virtual void computeJach(double time, Interaction &inter) = 0
compute all the H Jacobian
- Parameters:
time – the current time
inter – the interaction using this relation
-
virtual void computeJacg(double time, Interaction &inter) = 0
compute all the G Jacobian
- Parameters:
time – the current time
inter – the interaction using this relation
interProp –
-
virtual void computeOutput(double time, Interaction &inter, unsigned int derivativeNumber = 0) = 0
default function to compute y
- Parameters:
time – the current time
inter – the interaction using this relation
derivativeNumber – number of the derivative to compute (optional, default = 0)
-
virtual void computeInput(double time, Interaction &inter, unsigned int level = 0) = 0
default function to compute r
- Parameters:
time – the current time
inter – the interaction using this relation
level – the input “derivative” order of lambda used to compute input
-
inline virtual bool isLinear()
return true if the relation is linear.
- Returns:
bool
-
inline virtual bool requireResidu()
return true if the relation requires the computation of residu
- Returns:
true if residu are required, false otherwise
-
virtual void display() const
main relation members display
-
inline SP::PluggedObject getPluginh() const
Get _pluginh.
- Returns:
a shared pointer to the plugin
-
inline SP::PluggedObject getPluginJachx() const
Get _pluginJachx.
- Returns:
a shared pointer to the plugin
-
inline SP::PluggedObject getPluginJachlambda() const
Get _pluginJachlambda.
- Returns:
a shared pointer to the plugin
-
inline SP::PluggedObject getPluging() const
Get _pluging.
- Returns:
a shared pointer to the plugin
-
inline SP::PluggedObject getPluginJacLg() const
Get _pluginJacglambda.
- Returns:
a shared pointer to the plugin
-
inline SP::PluggedObject getPluginf() const
Get _pluginf.
- Returns:
a shared pointer to the plugin
-
inline SP::PluggedObject getPlugine() const
Get _plugine.
- Returns:
a shared pointer to the plugin
Protected Functions
-
virtual void _zeroPlugin()#
To initialize all the plugin functions with nullptr.
-
Relation(RELATION::TYPES type, RELATION::SUBTYPES subtype)#
basic constructor
- Parameters:
type – type of the relation
subtype – subtype of the relation
-
Relation() = default#
Protected Attributes