Class Relation#
Defined in Program listing for file kernel/src/modelingTools/Relation.hpp
-
class Relation#
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
-
inline RELATION::TYPES getType() const#
- Returns:
the type of the Relation (FirstOrder or Lagrangian)
-
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 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