Hopsan
Hopsan Coding Style

The following coding style is the preferred in all Hopsan C++ code.

Bracket Style

  • For functions there shall be one line break before the first curly brace.
  • For if statements, loops and similar, the starting brace shall come at the same line.
  • Single line statements must always be enclosed in braces.

Example:

int MyFunction(int a, int b)
{
int returnValue;
if(a > b) {
returnValue = b-a;
}
else if (a == b) {
returnValue = a+b;
}
else {
returnValue = a-b;
}
return returnValue;
}

Note! The previous (deprecated) style is still used in most of the code. The previous style said that "There shall be one line break before all brackets." This style can still be used if it makes the code easier to read.

Example:

int MyFunctionWithOldBracketStyle(int a, int b)
{
int returnValue;
if(a > b)
{
returnValue = b-a;
}
else
{
returnValue = a-b;
}
return returnValue;
}

Exceptions can be made for short one-line code blocks, but are generally not recommended.

Example:

if(a > max) { a = max; }

Variable Names

All code shall be self commenting. This means that non-obvious abbreviations shall be avoided. The purpose of a variable shall be well described by its name. Exceptions are component equations, where the physical denotation of the variable is to be used.

Correct:

  1. currentTimeStep
  2. distanceToCenter
  3. Kc
  4. rho

Incorrect:

  1. cTimeStep
  2. cTstep
  3. distToC
  4. distC
  5. flowCoefficient
  6. oilDensity

Variables begin with small letters, while every new word in the name shall be capitalized.

Correct:

  1. someHopsanVariable

Incorrect:

  1. somehopsanvariable
  2. SomeHopsanVariable

Certain variables shall have one or more small description letters prepended:

  1. g = Global variable (can be used anywhere in program)
  2. m = Member variable (can only be used in the current class)
  3. p = Pointer

Optional:

  1. v = Vector (array)
  2. n = Number variable

More than one letter can be used at a time. When these letters are prepended, the first letter in the actual variable name shall be capitalized.

Examples:

  1. mSomeHopsanVariable (member variable)
  2. mpSomeHopsanVariable (member pointer)
  3. vpDataVariables (vector with pointers in each element)
  4. mpvDataVariables (member pointer to vector)
  5. gSomeHopsanVariable (global variable)
  6. nThreads (variable describing "number of threads")

All global variables, member variables, pointers and number variables should have these prepended letters. An exception is made for public variables used in a data struct (public class) when its main purpose is to act as a simple data container.

Example:

struct Message
{
int type;
string text;
}
Message myMessage;
  1. myMessage.type (will return the type id of the message)
hopsan::HString::setString
void setString(const char *str)
Set the string by copying const char*.
Definition: HString.cpp:119
hopsan::Node::getDataValue
double getDataValue(const size_t dataId) const
get data from node
Definition: Node.h:90
hopsan::FirstOrderTransferFunction
The FirstOrderTransferFunction class implements a first order time discrete transfer function using b...
Definition: FirstOrderTransferFunction.h:43
hopsan::MultiPort::getConnectedPorts
std::vector< Port * > getConnectedPorts(const int subPortIdx=-1) const
Get all the connected ports.
Definition: Port.cpp:1281
hopsan::ComponentSystem::getSubComponentNames
std::vector< HString > getSubComponentNames() const
Definition: ComponentSystem.cpp:879
hopsan::Port::getNodeDataVector
const std::vector< double > & getNodeDataVector() const
Returns a reference to the Node data in the port.
Definition: Port.h:119
hopsan::FirstOrderTransferFunction::updateWithBackup
double updateWithBackup(double u)
Make a backup of states and then calls update.
Definition: FirstOrderTransferFunction.cpp:193
hopsan::ClassFactory::hasKey
bool hasKey(const _Key &rIdKey) const
Check if the factory has key registered.
Definition: ClassFactory.hpp:108
hopsan::HydraulicNodeDataValueStructT
Definition: NodeRWHelpfuncs.hpp:162
hopsan::IntegratorLimited::value
double value()
Definition: IntegratorLimited.cpp:125
hopsan::Component::setSubTypeName
void setSubTypeName(const HString &rSubTypeName)
Set the SubType name of the component.
Definition: Component.cpp:420
hopsan::Component::stopSimulation
void stopSimulation(const HString &rReason="")
Terminate/stop a running initialization or simulation.
Definition: Component.cpp:430
hopsan::ComponentSystem::renameSubComponent
void renameSubComponent(const HString &rOldName, const HString &rNewName)
Rename a sub component and automatically fix unique names.
Definition: ComponentSystem.cpp:401
hopsan::ComponentSystem::addSystemPort
Port * addSystemPort(HString portName, const HString &rDescription="")
Adds a transparent SubSystemPort.
Definition: ComponentSystem.cpp:1082
hopsan::PLOParser
Definition: PLOParser.h:45
hopsan::ReadMultiPort::addSubPort
Port * addSubPort()
Adds a subport to a readmultiport.
Definition: Port.cpp:1341
hopsan::BiDirectionalSignalPort
Definition: Port.h:356
hopsan::Vec::~Vec
~Vec()
Definition: matrix.cpp:260
hopsan::HopsanEssentials::createComponentSystem
ComponentSystem * createComponentSystem()
Creates a ComponentSystem.
Definition: HopsanEssentials.cpp:267
hopsan::Port::writeNode
void writeNode(const size_t idx, const double value)
Writes a value to the connected node.
Definition: Port.h:95
hopsan::ParameterEvaluatorHandler::ParameterEvaluatorHandler
ParameterEvaluatorHandler(Component *pComponent)
Constructor.
Definition: Parameters.cpp:524
hopsan::Component::isComponentQ
virtual bool isComponentQ() const
Check if a component is a Q-Component.
Definition: Component.cpp:785
hopsan::WritePort
Definition: Port.h:423
hopsan::IntegratorWithBackup::restoreBackup
void restoreBackup(size_t nSteps=1)
Restore the backup at the given step.
Definition: Integrator.h:104
hopsan::ReadPort
Definition: Port.h:368
hopsan::ComponentSystem::getSubComponentOrThisIfSysPort
Component * getSubComponentOrThisIfSysPort(const HString &rName)
Get a Component ptr to the component with supplied name, can also return a ptr to self if no subcompo...
Definition: ComponentSystem.cpp:825
hopsan::HopsanCoreMessageHandler::addErrorMessage
void addErrorMessage(const HString &rMessage, const HString &rTag="", const int dbglevel=0)
Convenience function to add error message.
Definition: HopsanCoreMessageHandler.cpp:171
hopsan::HString::c_str
const char * c_str() const
Returns a c_str pointer to internal data.
Definition: HString.cpp:188
hopsan::Matrix::Matrix
Matrix(const Matrix &src)
copy constructor
Definition: matrix.h:102
hopsan::ParameterEvaluator::getDataPtr
void * getDataPtr()
Returns a pointer directly to the parameter data variable.
Definition: Parameters.cpp:85
hopsan::ClassFactory
Template class for automatic object instantiation by key-value.
Definition: ClassFactory.hpp:50
hopsan::ComponentSignal::isComponentSignal
bool isComponentSignal() const
Check if a component is a Signal-Component.
Definition: Component.h:321
hopsan::MultiPort::getDataVectorPtr
std::vector< double > * getDataVectorPtr(const size_t subPortIdx=0)
Definition: Port.cpp:1166
hopsan::ComponentSystem::isComponentSystem
bool isComponentSystem() const
Check if a component is a System-Component.
Definition: ComponentSystem.h:66
hopsan::NodeModelica
Definition: Nodes.h:459
hopsan::ClassFactory::createInstance
_Base * createInstance(const _Key &rIdKey)
Creates an instance based on the key using creator function (if registered)
Definition: ClassFactory.hpp:91
hopsan::NumericalIntegrationSolver::solveMidpointMethod
void solveMidpointMethod()
Solves a system using midpoint method.
Definition: EquationSystemSolver.cpp:265
hopsan::ComponentSystem::getTotalMeasuredTime
double getTotalMeasuredTime()
Returns the total sum of the measured time of the components in the system.
Definition: ComponentSystem.cpp:3200
hopsan::Component::deconfigure
virtual void deconfigure()
Deconfigure a component, use this to cleanup and memory/resource allocations you have made in configu...
Definition: Component.cpp:1725
hopsan::MultiPort
Definition: Port.h:258
hopsan::SecondOrderTransferFunction::value
double value() const
Definition: SecondOrderTransferFunction.cpp:215
hopsan::SecondOrderTransferFunctionVariable
Definition: SecondOrderTransferFunction.h:75
hopsan::ElectricNodeDataPointerStructT
Definition: NodeRWHelpfuncs.hpp:100
hopsan::Port::getNodeType
const HString & getNodeType() const
Returns the type of node that can be connected to this port.
Definition: Port.cpp:96
hopsan::FirstOrderTransferFunction::restoreBackup
void restoreBackup(size_t nSteps=1)
Restore the backup at the given step.
Definition: FirstOrderTransferFunction.cpp:102
hopsan::Component::hasParameter
bool hasParameter(const HString &rName) const
Check if a component has a specific parameter.
Definition: Component.cpp:118
hopsan::dfIfPositive
double dfIfPositive(const double x, const double, const double)
Derivative of IfPositive with respect to y1.
Definition: AuxiliarySimulationFunctions.h:199
hopsan::ComponentSignal::getTypeCQS
CQSEnumT getTypeCQS() const
Get the C, Q or S type of the component as enum.
Definition: Component.h:320
hopsan::ConnectionAssistant::ifMultiportCleanupAfterDissconnect
void ifMultiportCleanupAfterDissconnect(Port *pMaybeMultiport, Port **ppActualPort, const bool wasSucess)
Definition: ConnectionAssistant.cpp:220
hopsan::Port::readNodeSafe
virtual double readNodeSafe(const size_t idx, const size_t subPortIdx=0) const
Reads a value from the connected node.
Definition: Port.cpp:196
hopsan::HopsanEssentials
This class gives access to HopsanCore for model and externalLib loading as well as component creation...
Definition: HopsanEssentials.h:54
hopsan::Port::isConnected
virtual bool isConnected() const
Check if the port is currently connected.
Definition: Port.cpp:689
hopsan::onNegative
double onNegative(const double x)
Returns 1.0 if x is negative, else returns 0.0.
Definition: AuxiliarySimulationFunctions.h:135
hopsan::Component::isComponentC
virtual bool isComponentC() const
Check if a component is a C-Component.
Definition: Component.cpp:778
hopsan::ComponentSystem::renameSystemPort
HString renameSystemPort(const HString &rOldname, const HString &rNewname)
Rename system port.
Definition: ComponentSystem.cpp:1095
hopsan::ParameterEvaluatorHandler::hasParameter
bool hasParameter(const HString &rName) const
Check if a parameter with given name exist among the parameters.
Definition: Parameters.cpp:818
hopsan::Port::writeNode
virtual void writeNode(const size_t idx, const double value, const size_t subPortIdx)
Writes a value to the connected node.
Definition: Port.h:105
hopsan::HTextBlock
Definition: HopsanTypes.h:33
hopsan::Node::setDataCharacteristics
void setDataCharacteristics(const size_t id, const HString &rName, const HString &rShortname, const HString &rQuantityOrUnit, const NodeDataVariableTypeEnumT vartype=DefaultType)
Set data name and unit for a specified data variable.
Definition: Node.cpp:139
hopsan::SystemPort::getInternalPortType
PortTypesEnumT getInternalPortType()
Get the Internal port type (virtual, should be overloaded in systemports only)
Definition: Port.cpp:844
hopsan::Integrator::value
double value() const
Returns the integrator value.
Definition: Integrator.h:72
hopsan::ClassFactory::registerCreatorFunction
void registerCreatorFunction(const _Key &rIdKey, CreatorFunctionT classCreator)
Used to register creator functions.
Definition: ClassFactory.hpp:68
hopsan::HopsanCoreMessage
Definition: HopsanCoreMessageHandler.h:44
hopsan::Component::addFatalMessage
void addFatalMessage(const HString &rMessage, const HString &rTag="") const
Writes a Fatal message and tells the receiver of the message to close program in a controlled way....
Definition: Component.cpp:1512
hopsan::ComponentSystem::preInitialize
virtual bool preInitialize()
Definition: ComponentSystem.cpp:1949
hopsan::ComponentSystem::getNumActuallyLoggedSamples
size_t getNumActuallyLoggedSamples() const
Returns the number of actually logged data samples.
Definition: ComponentSystem.cpp:203
hopsan::dtIfPositive
double dtIfPositive(const double x, const double, const double)
Derivative of IfPositive with respect to y1.
Definition: AuxiliarySimulationFunctions.h:189
hopsan::PowerPort::PowerPort
PowerPort(const HString &rNodeType, const HString &rPortName, Component *pParentComponent, Port *pParentPort=0)
PowerPort constructor.
Definition: Port.cpp:917
hopsan::PowerMultiPort::addSubPort
Port * addSubPort()
Adds a subport to a powermultiport.
Definition: Port.cpp:1320
LookupTableNDBase::getDimDataAt
void getDimDataAt(const size_t dim, const size_t idx, std::vector< double > &rData)
Get a "slice" of data at idx at given dimension.
Definition: LookupTable.h:241
hopsan::MultiPort::isConnected
bool isConnected() const
Check if the port is currently connected.
Definition: Port.cpp:1231
hopsan::NodeMechanic::DataIndexEnumT
DataIndexEnumT
The data variable indexes, DataLength is used internally.
Definition: Nodes.h:321
hopsan::Port::getComponent
Component * getComponent() const
Returns the parent component.
Definition: Port.cpp:103
hopsan::ParameterEvaluatorHandler::getParameterDataPtr
void * getParameterDataPtr(const HString &rName)
Returns a pointer directly to the parameter data variable.
Definition: Parameters.cpp:672
hopsan::Node::setDataValue
void setDataValue(const size_t dataId, const double data)
set data in node
Definition: Node.h:97
hopsan::IntegratorWithBackup::setBackupLength
void setBackupLength(int nSteps)
Setup the number of backup steps to remember (size of the backup buffer)
Definition: Integrator.h:94
hopsan::HopsanEssentials::createComponent
Component * createComponent(const HString &rTypeName)
Creates a component with the specified key-value and returns a pointer to this component.
Definition: HopsanEssentials.cpp:223
hopsan::Component::isObsolete
virtual bool isObsolete() const
Check if component is tagged as obsolete.
Definition: Component.cpp:813
hopsan::HopsanCoreMessageHandler
Definition: HopsanCoreMessageHandler.h:69
hopsan::ComponentSystem::renameParameter
bool renameParameter(const HString &rOldName, const HString &rNewName)
Rename a system parameter.
Definition: ComponentSystem.cpp:1029
hopsan::NumericalIntegrationSolver::solveRungeKutta
void solveRungeKutta()
Solves a system using Runge-Kutta (RK4)
Definition: EquationSystemSolver.cpp:421
hopsan::Vec::apply
Vec & apply(V_FCT_PTR fct)
applys function fct element-by-element
Definition: matrix.cpp:310
hopsan::NodeHydraulic::DataIndexEnumT
DataIndexEnumT
The data variable indexes, DataLength is used internally.
Definition: Nodes.h:185
hopsan::ConditionalComponentSystem
Definition: ComponentSystem.h:272
hopsan::HVector::append
void append(const T &data)
Append data.
Definition: HVector.hpp:128
hopsan::ParameterEvaluatorHandler::getParameterValue
void getParameterValue(const HString &rName, HString &rValue)
Get the value of specified parameter.
Definition: Parameters.cpp:657
hopsan::Vec::set
Vec & set(double v)
set to constant value
Definition: matrix.h:66
hopsan::ParameterEvaluatorHandler::setParameterValue
bool setParameterValue(const HString &rName, const HString &rValue, bool force=false)
Set the parameter value for an existing parameter.
Definition: Parameters.cpp:736
hopsan::NumericalIntegrationSolver::solveForwardEuler
void solveForwardEuler()
Solves a system using forward Euler method.
Definition: EquationSystemSolver.cpp:253
hopsan::FirstOrderTransferFunctionVariable
Definition: FirstOrderTransferFunction.h:81
hopsan::DelayTemplate::clear
void clear()
Clear the delay buffer, deleting all data.
Definition: Delay.hpp:176
hopsan::Component::addInputVariable
Port * addInputVariable(const HString &rName, const HString &rDescription, const HString &rQuantityOrUnit, const double defaultValue, double **ppNodeData=0)
Add an inputVariable (Scalar signal ReadPort)
Definition: Component.cpp:1343
hopsan::ValveHysteresis
Definition: ValveHysteresis.h:61
hopsan::SimulationHandler::initializeSystem
bool initializeSystem(const double startT, const double stopT, ComponentSystem *pSystem)
Definition: SimulationHandler.cpp:45
hopsan::NodeSignal::DataIndexEnumT
DataIndexEnumT
The data variable indexes, DataLength is used internally.
Definition: Nodes.h:50
hopsan::Component::addErrorMessage
void addErrorMessage(const HString &rMessage, const HString &rTag="") const
Write an Error message.
Definition: Component.cpp:1487
hopsan::ComponentSystem::simulateMultiThreaded
virtual void simulateMultiThreaded(const double startT, const double stopT, const size_t nDesiredThreads=0, const bool noChanges=false, ParallelAlgorithmT algorithm=OfflineSchedulingAlgorithm)
Simulate function that overrides multi-threaded simulation call with a single-threaded call In case m...
Definition: ComponentSystem.cpp:3271
hopsan::Port::getNodeDataVector
virtual const std::vector< double > & getNodeDataVector(const size_t subPortIdx) const
Returns a reference to the Node data in the port.
Definition: Port.h:135
hopsan::Port::getVariableAlias
const HString & getVariableAlias(const size_t id) const
Get the alias name for a specific node variable id.
Definition: Port.cpp:383
hopsan::Node::getNodeType
const HString & getNodeType() const
returns the node type
Definition: Node.cpp:103
hopsan::LoadExternal
This class handles loading and unloading of external component and node libs.
Definition: LoadExternal.h:56
hopsan::Component::setName
void setName(HString name)
Set the desired component name.
Definition: Component.cpp:346
hopsan::Port::getComponentName
const HString & getComponentName() const
Get the name of the component that the port is attached to.
Definition: Port.cpp:784
hopsan::Vec::max
double max()
returns maximum Vec element
Definition: matrix.cpp:282
hopsan::HVector::clear
void clear()
Clear the array.
Definition: HVector.hpp:74
hopsan::CDragInd
double HOPSANCORE_DLLAPI CDragInd(const double alpha, const double AR, const double e, const double CLalpha, const double ap, const double an, const double expclp, const double expcln)
Induced drag coefficient for aircraft model.
Definition: AuxiliarySimulationFunctions.cpp:185
hopsan::ComponentSystem::runNumHopScript
bool runNumHopScript(const HString &rScript, bool printOutput, HString &rOutput)
Interprets and evaluates (runs) a numhop scripts.
Definition: ComponentSystem.cpp:2156
hopsan::MultiPort::writeNode
void writeNode(const size_t idx, const double value, const size_t subPortIdx)
Writes a value to the connected node.
Definition: Port.h:288
hopsan::HString::operator+=
HString & operator+=(const HString &rhs)
Definition: HString.cpp:437
hopsan::ParameterEvaluatorHandler::evaluateParameterExpression
bool evaluateParameterExpression(const HString &rExpression, HString &rEvaluatedParameterValue)
Definition: Parameters.cpp:800
hopsan::ComponentSystem::determineCQSType
void determineCQSType()
This function automatically determines the CQS type depending on the what has been connected to the s...
Definition: ComponentSystem.cpp:1198
hopsan::FirstOrderTransferFunctionVariable::value
double value()
Read current filter output value.
Definition: FirstOrderTransferFunction.cpp:336
hopsan::dxLowLimit2
double HOPSANCORE_DLLAPI dxLowLimit2(const double x, const double sx, const double xmin)
Sets the derivative of x to zero if x is outside of limits.
Definition: AuxiliarySimulationFunctions.cpp:316
hopsan::Port::getNodeDataVector
std::vector< double > & getNodeDataVector()
Returns a reference to the Node data in the port.
Definition: Port.h:114
hopsan::DelayTemplate::initialize
void initialize(const int delaySteps, const T initValue)
Initialize delay size based on known number of delay steps.
Definition: Delay.hpp:71
hopsan::DelayTemplate::getSize
size_t getSize() const
Get the size of the delay buffer (the number of buffer elements)
Definition: Delay.hpp:170
hopsan::NodeMechanicRotational::DataIndexEnumT
DataIndexEnumT
The data variable indexes, DataLength is used internally.
Definition: Nodes.h:353
hopsan::limit2
double limit2(const double x, const double, const double xmin, const double xmax)
Overloads double hopsan::limit() to also include sx (derivative of x) as input.
Definition: AuxiliarySimulationFunctions.h:213
hopsan::NodeSignal2D
The 2d signal node.
Definition: Nodes.h:151
hopsan::Matrix::swaprows
void swaprows(int i, int j)
swap rows
Definition: matrix.cpp:99
hopsan::DummyComponent
Definition: DummyComponent.hpp:42
hopsan::DelayTemplate::getOldest
T getOldest() const
Get the oldest value in the buffer.
Definition: Delay.hpp:125
hopsan::Component::getModelAssets
virtual std::list< HString > getModelAssets() const
Definition: Component.cpp:212
hopsan::Component::getSubTypeName
const HString & getSubTypeName() const
Get the SubType name of the component.
Definition: Component.cpp:414
hopsan::NodeDataDescription
Definition: Node.h:54
hopsan::ComponentSystem::removeSubNode
void removeSubNode(Node *pNode)
Removes a previously added node.
Definition: ComponentSystem.cpp:926
hopsan::dxArcSinL
double HOPSANCORE_DLLAPI dxArcSinL(const double x)
derivative of AsinL
Definition: AuxiliarySimulationFunctions.cpp:155
hopsan::ConditionalComponentSystem::simulate
void simulate(const double stopT)
Simulate function for single-threaded simulations.
Definition: ComponentSystem.cpp:3514
hopsan::Component::isComponentSystem
virtual bool isComponentSystem() const
Check if a component is a System-Component.
Definition: Component.cpp:792
hopsan::ComponentSystem::checkModelBeforeSimulation
bool checkModelBeforeSimulation()
Checks that everything is OK before simulation.
Definition: ComponentSystem.cpp:1784
hopsan::LoadExternal::LoadExternal
LoadExternal(ComponentFactory *pComponentFactory, NodeFactory *pNodefactory, HopsanCoreMessageHandler *pMessenger)
This function loads a library with given path.
Definition: LoadExternal.cpp:56
hopsan::ComponentSystem::simulate
void simulate(const double stopT)
Simulate function for single-threaded simulations.
Definition: ComponentSystem.cpp:3343
hopsan::Integrator
Definition: Integrator.h:44
hopsan::MultiPort::readNodeSafe
double readNodeSafe(const size_t idx, const size_t subPortIdx) const
Reads a value from the connected node.
Definition: Port.cpp:1031
hopsan::DelayTemplate::getIdx
T getIdx(const size_t i) const
Returns a specific value, 0=newest, 1=nextnewest, 2=nextnextnewest and so on, no range check is perfo...
Definition: Delay.hpp:140
hopsan::ConnectionAssistant::splitNodeConnection
bool splitNodeConnection(Port *pPort1, Port *pPort2)
Definition: ConnectionAssistant.cpp:462
hopsan::Port::getNumDataVariables
virtual size_t getNumDataVariables() const
Returns the number of data variables in the node.
Definition: Port.cpp:617
hopsan::HopsanEssentials::getCoreMessageHandler
HopsanCoreMessageHandler * getCoreMessageHandler()
Returns a pointer to the core message handler, do NOT use this function to get messages.
Definition: HopsanEssentials.cpp:324
hopsan::boolToDouble
double boolToDouble(const bool value)
Converts a boolean value to a float point number.
Definition: AuxiliarySimulationFunctions.h:107
hopsan::Atan2L
double HOPSANCORE_DLLAPI Atan2L(const double y, const double x)
Safe variant of atan2.
Definition: AuxiliarySimulationFunctions.cpp:134
hopsan::ReadMultiPort
Definition: Port.h:404
hopsan::NodeSignal::setSignalQuantity
virtual void setSignalQuantity(const HString &rQuantity, const HString &rUnit, const size_t dataId=Value)
This function can be used to set unit string and displayName for signal nodes ONLY.
Definition: Nodes.h:54
hopsan::ComponentSystem::initialize
bool initialize(const double startT, const double stopT)
Initializes a system and all its contained components before a simulation. Also allocates log data me...
Definition: ComponentSystem.cpp:2185
hopsan::Port::setDescription
void setDescription(const HString &rDescription)
Set port description.
Definition: Port.cpp:798
hopsan::NodeModelica::DataIndexEnumT
DataIndexEnumT
The data variable indexes, DataLength is used internally.
Definition: Nodes.h:463
hopsan::Component::addWarningMessage
void addWarningMessage(const HString &rMessage, const HString &rTag="") const
Write an Warning message.
Definition: Component.cpp:1474
hopsan::ComponentSystem::setDesiredTimestep
void setDesiredTimestep(const double timestep)
Sets the desired time step in a component system.
Definition: ComponentSystem.cpp:1568
hopsan::Component::getName
const HString & getName() const
Get the component name.
Definition: Component.cpp:370
hopsan::NumericalIntegrationSolver::solveDormandPrince
void solveDormandPrince()
Solves a system using Dormand-Prince.
Definition: EquationSystemSolver.cpp:480
hopsan::DelayTemplate::initialize
void initialize(const double timeDelay, const double Ts, const T initValue)
Initialize delay buffer size based on timeDelay and timestep, Td/Ts must be multiple of 1 and >= 1.
Definition: Delay.hpp:62
hopsan::lowLimit
double HOPSANCORE_DLLAPI lowLimit(const double x, const double xmin)
Limits a value to a lower limit.
Definition: AuxiliarySimulationFunctions.cpp:265
hopsan::VariameterDescription
Definition: Component.h:65
hopsan::FirstOrderTransferFunction::value
double value() const
Read current transfer function output value.
Definition: FirstOrderTransferFunction.cpp:202
hopsan::AliasHandler
Definition: AliasHandler.h:47
hopsan::ComponentSystem::setNumLogSamples
void setNumLogSamples(const size_t nLogSamples)
Set the desired number of log samples.
Definition: ComponentSystem.cpp:180
hopsan::ParameterEvaluatorHandler::addParameter
bool addParameter(const HString &rName, const HString &rValue, const HString &rDescription, const HString &rQuantity, const HString &rUnit, const HString &rType, void *pData=0, bool force=false, std::vector< HString > conditions=std::vector< HString >())
Add a new parameter.
Definition: Parameters.cpp:551
hopsan::IntegratorWithBackup::backup
void backup()
Pushes a backup of transfer function states into the backup buffer.
Definition: Integrator.h:117
hopsan::doubleToBool
bool doubleToBool(const double value)
Converts a float point number to a boolean.
Definition: AuxiliarySimulationFunctions.h:99
hopsan::NodeSignalND
The base class for n-dimensional signal nodes, (that can be dynamically sized, but size should be kep...
Definition: Nodes.h:106
hopsan::NumericalIntegrationSolver::NumericalIntegrationSolver
NumericalIntegrationSolver(Component *pParentComponent, std::vector< double > *pStateVars, double tolerance=1e-6, size_t maxIter=1000)
Constructor for solver utility using numerical integration methods.
Definition: EquationSystemSolver.cpp:191
hopsan::ConnectionAssistant::clearSysPortNodeTypeIfEmpty
void clearSysPortNodeTypeIfEmpty(Port *pPort)
Helpfunction that clears the nodetype in empty systemports, It will not clear the type if the port is...
Definition: ConnectionAssistant.cpp:306
hopsan::TempDirectoryHandle
Definition: TempDirectoryHandle.h:43
hopsan::DelayTemplate::update
T update(const T newValue)
Updates delay with a new value, "pop old", "push new". You should likely run this at the end of each ...
Definition: Delay.hpp:99
hopsan::NodeMechanic
A mechanic node.
Definition: Nodes.h:317
hopsan::HFilePath
Definition: HopsanTypes.h:34
hopsan::Port
Definition: Port.h:56
hopsan::Port::getStartValue
virtual double getStartValue(const size_t idx, const size_t subPortIdx=0)
Get the actual start value of the port.
Definition: Port.cpp:627
hopsan::ConnectionAssistant::determineWhereToStoreNodeAndStoreIt
void determineWhereToStoreNodeAndStoreIt(Node *pNode)
Find the system highest up in the model hierarchy for the ports connected to this node and store the ...
Definition: ConnectionAssistant.cpp:378
hopsan::Vec
Definition: matrix.h:53
hopsan::Vec::dot
static double dot(const Vec &a, const Vec &b)
returns dot product of a and b
Definition: matrix.h:138
LookupTable2D
Definition: LookupTable.h:544
hopsan::Component::renamePort
HString renamePort(const HString &rOldname, const HString &rNewname)
Rename a port.
Definition: Component.cpp:973
hopsan::ComponentSystem::stopSimulation
void stopSimulation()
Set the stop simulation flag to abort the initialization or simulation loops, (without messages being...
Definition: ComponentSystem.cpp:243
hopsan::dxSegare
double HOPSANCORE_DLLAPI dxSegare(const double x, const double d)
Segment area, used to calculate valve openings with circular holes.
Definition: AuxiliarySimulationFunctions.cpp:228
hopsan::MultiPort::getNodeDataDescription
const NodeDataDescription * getNodeDataDescription(const size_t dataid, const size_t subPortIdx=0) const
Get a specific node data description from a connected sub port node.
Definition: Port.cpp:1097
hopsan::CSVParserNG::copyRow
bool copyRow(const size_t rowIdx, std::vector< double > &rRow)
Definition: CSVParser.cpp:171
hopsan::MultiPort::writeNodeSafe
void writeNodeSafe(const size_t idx, const double value, const size_t subPortIdx)
Writes a value to the connected node.
Definition: Port.cpp:1047
hopsan::Node::getOwnerSystem
ComponentSystem * getOwnerSystem() const
Returns a pointer to the ComponentSystem that own this Node.
Definition: Node.cpp:405
hopsan::ComponentSystem::setKeepValuesAsStartValues
void setKeepValuesAsStartValues(bool load)
Set if node data values should be used as start values instead of the default start values or express...
Definition: ComponentSystem.cpp:1776
hopsan::Port::setSignalNodeQuantityModifyable
virtual void setSignalNodeQuantityModifyable(bool tf)
Definition: Port.cpp:526
hopsan::Vec::operator=
Vec & operator=(const Vec &src)
Definition: matrix.h:71
hopsan::MultiPort::getNodeDataDescriptions
const std::vector< NodeDataDescription > * getNodeDataDescriptions(const size_t subPortIdx=0) const
Get all node data descriptions from a connected sub port node.
Definition: Port.cpp:1084
hopsan::SecondOrderTransferFunction::initialize
void initialize(double timestep, double num[3], double den[3], double u0=0.0, double y0=0.0, double min=-1.5E+300, double max=1.5E+300, double sy0=0.0)
Constructor.
Definition: SecondOrderTransferFunction.cpp:61
hopsan::MultiPort::loadStartValues
void loadStartValues()
Load start values by copying the start values from the port to the node.
Definition: Port.cpp:1194
hopsan::PowerMultiPort
Definition: Port.h:390
hopsan::Component::configure
virtual void configure()
Configures a component by setting up ports, variables, constants and other resources.
Definition: Component.cpp:1704
hopsan::MultiPort::getNodeDataPtr
double * getNodeDataPtr(const size_t idx, const size_t subPortIdx) const
Definition: Port.cpp:1068
hopsan::ParameterEvaluatorHandler::~ParameterEvaluatorHandler
~ParameterEvaluatorHandler()
Destructor.
Definition: Parameters.cpp:530
hopsan::MultiPort::getNodePtr
const Node * getNodePtr(const size_t subPortIdx=0) const
Returns the node pointer from one of the subports in the port (const version)
Definition: Port.cpp:1062
hopsan::ComponentSystem::evaluateParametersRecursively
void evaluateParametersRecursively()
Recurse through the model system hierarchy and evaluate all parameters.
Definition: ComponentSystem.cpp:2054
hopsan::Port::getNodeDataPtr
virtual double * getNodeDataPtr(const size_t idx, const size_t subPortIdx=0) const
Get a ptr to the data variable in the node.
Definition: Port.cpp:241
hopsan::MultiPort::getPortType
virtual PortTypesEnumT getPortType() const =0
Get the port type.
hopsan::MultiPort::removeSubPort
void removeSubPort(Port *ptr)
Removes a specific subport.
Definition: Port.cpp:1243
hopsan::DoubleIntegratorWithDampingAndCoulombFriction::redoIntegrate
void redoIntegrate(double u)
Re-integrates last step Last step must have been called with integrateWithUndo() for this to work.
Definition: DoubleIntegratorWithDampingAndCoulumbFriction.cpp:154
hopsan::Port::unRegisterStartValueParameters
void unRegisterStartValueParameters()
Unregisters all startvalue parameters from the start node.
Definition: Port.cpp:153
hopsan::FirstOrderTransferFunction::setBackupLength
void setBackupLength(size_t nSteps)
Setup the number of backup steps to remember (size of the backup buffer)
Definition: FirstOrderTransferFunction.cpp:131
hopsan::ClassFactory::clearFactory
void clearFactory()
Clear the entire factory map (unregister everything)
Definition: ClassFactory.hpp:163
hopsan::ReadPort::loadStartValues
virtual void loadStartValues()
Load start values by copying the start values from the port to the node.
Definition: Port.cpp:966
hopsan::ComponentSystem::haveSubComponent
bool haveSubComponent(const HString &rName) const
Check if a system has a subcomponent with given name.
Definition: ComponentSystem.cpp:896
hopsan::HydraulicNodeDataPointerStructT
Definition: NodeRWHelpfuncs.hpp:171
hopsan::ParameterEvaluator::getType
const HString & getType() const
Returns the type of the parameter.
Definition: Parameters.cpp:165
hopsan::HVector
Definition: HVector.hpp:35
hopsan::DoubleIntegratorWithDamping::valueSecond
double valueSecond()
Returns second primitive from double integration.
Definition: DoubleIntegratorWithDamping.cpp:103
hopsan::WhiteGaussianNoise
Definition: WhiteGaussianNoise.h:43
hopsan::Port::getDataVectorPtr
virtual std::vector< double > * getDataVectorPtr(const size_t subPortIdx=0)
Definition: Port.cpp:602
hopsan::HString::isNummeric
bool isNummeric() const
Check if the string can be interpreted as a number.
Definition: HString.cpp:258
hopsan::HString::compare
bool compare(const char *other) const
Compare string to const char*.
Definition: HString.cpp:217
hopsan::NumHopHelper
Definition: NumHopHelper.h:40
hopsan::Port::getVariableIdByAlias
int getVariableIdByAlias(const HString &rAlias) const
Get the variable id for a specific alias name.
Definition: Port.cpp:399
hopsan::ComponentSystem::removeSubComponent
void removeSubComponent(const HString &rName, bool doDelete=false)
Remove a dub component from a system, can also be used to actually delete the component.
Definition: ComponentSystem.cpp:432
hopsan::Port::setDefaultStartValue
virtual void setDefaultStartValue(const size_t idx, const double value, const size_t subPortIdx=0)
Set the an actual start value of the port.
Definition: Port.cpp:647
hopsan::ComponentSystem::changeSubComponentSystemTypeCQS
bool changeSubComponentSystemTypeCQS(const HString &rName, const CQSEnumT newType)
Change the CQS type of a stored subsystem component.
Definition: ComponentSystem.cpp:1176
hopsan::Port::setVariableAlias
void setVariableAlias(const HString &rAlias, const size_t id)
Definition: Port.cpp:354
hopsan::NodePetriNet::DataIndexEnumT
DataIndexEnumT
The data variable indexes, DataLength is used internally.
Definition: Nodes.h:481
hopsan::HopsanExternalLibInfo
Definition: Component.h:49
hopsan::Port::writeNodeSafe
virtual void writeNodeSafe(const size_t idx, const double value, const size_t subPortIdx=0)
Writes a value to the connected node.
Definition: Port.cpp:215
hopsan::ComponentSystem::keepsValuesAsStartValues
bool keepsValuesAsStartValues()
Returns whether or not to keep node values instead of over writing with defaultStartValues.
Definition: ComponentSystem.cpp:1767
hopsan::HVector::resize
void resize(size_t s, const T &defaultValue)
Resize the array, initializing all values to defaultValue.
Definition: HVector.hpp:119
hopsan::ParameterEvaluator::evaluate
bool evaluate(HString &rResult)
Evaluate the parameter.
Definition: Parameters.cpp:232
hopsan::ComponentSystem::stopSimulation
void stopSimulation(const HString &rReason)
Set the stop simulation flag to abort the initialization or simulation loops.
Definition: ComponentSystem.cpp:213
hopsan::Matrix::Matrix
Matrix(int rows, int cols)
constructs a Matrix of specified size
Definition: matrix.h:101
hopsan::pi
const double pi
A const double definition of pi that you can use in your code.
Definition: AuxiliarySimulationFunctions.h:45
hopsan::PowerPort::getPortType
PortTypesEnumT getPortType() const
Get the port type.
Definition: Port.h:352
hopsan::NodeHydraulicTemperature
A hydraulic node.
Definition: Nodes.h:248
hopsan::DoubleIntegratorWithDampingAndCoulombFriction::valueFirst
double valueFirst()
Returns first primitive from double integration.
Definition: DoubleIntegratorWithDampingAndCoulumbFriction.cpp:163
hopsan::ComponentSystem::wasSimulationAborted
bool wasSimulationAborted() const
Check if the simulation was aborted.
Definition: ComponentSystem.cpp:261
hopsan::Component::addDebugMessage
void addDebugMessage(const HString &rMessage, const HString &rTag="") const
Write an Debug message, i.e. for debugging purposes.
Definition: Component.cpp:1461
hopsan::Port::createStartNode
void createStartNode(const HString &rNodeType)
Creates a start node in the port.
Definition: Port.cpp:327
hopsan::IntegratorWithBackup
Definition: Integrator.h:84
hopsan::Matrix::print
void print() const
prints Matrix (using mprint)
Definition: matrix.cpp:381
hopsan::HString::clear
void clear()
Clear the string.
Definition: HString.cpp:482
hopsan::HString::toLongInt
long int toLongInt(bool *isOK) const
Definition: HString.cpp:294
hopsan::SystemPort::getPortType
PortTypesEnumT getPortType() const
Get the port type.
Definition: Port.h:250
hopsan::ComponentC
Definition: Component.h:326
hopsan::ConnectionAssistant::ifMultiportCleanupAfterConnect
void ifMultiportCleanupAfterConnect(Port *pMaybeMultiport, Port **ppActualPort, const bool wasSucess)
Definition: ConnectionAssistant.cpp:202
hopsan::Component
Definition: Component.h:83
hopsan::ClassFactory::clearRegisterStatus
void clearRegisterStatus()
Clears the internal error status vector.
Definition: ClassFactory.hpp:157
hopsan::ComponentSystem::mWarnIfUnusedSystemParameters
bool mWarnIfUnusedSystemParameters
This bool can be toggled off in programmed subsystems to avoid annoying warnings.
Definition: ComponentSystem.h:185
hopsan::Node::isConnectedToPort
bool isConnectedToPort(const Port *pPort) const
Definition: Node.cpp:343
hopsan::Port::getConnectedPorts
virtual std::vector< Port * > getConnectedPorts(const int subPortIdx=-1) const
Get a vector of pointers to all other ports connected connected to this one.
Definition: Port.cpp:311
hopsan::Component::unRegisterParameter
virtual void unRegisterParameter(const HString &rName)
Removes a parameter from the component.
Definition: Component.cpp:737
hopsan::segare
double HOPSANCORE_DLLAPI segare(const double x, const double d)
Segment area, used to calculate valve openings with circular holes.
Definition: AuxiliarySimulationFunctions.cpp:205
hopsan::MultiPort::haveLogData
bool haveLogData(const size_t subPortIdx=0)
Check if log data exist in the ports node.
Definition: Port.cpp:1124
hopsan::ClassFactory::unRegisterCreatorFunction
void unRegisterCreatorFunction(const _Key &rIdKey)
Unregister creator functions for given key.
Definition: ClassFactory.hpp:134
hopsan::PLOParser::getErrorString
HString getErrorString() const
Definition: PLOParser.cpp:181
hopsan::NodeSignal
A signal node.
Definition: Nodes.h:46
hopsan::DoubleIntegratorWithDampingAndCoulombFriction::integrateWithUndo
void integrateWithUndo(double u)
Integrates one step, but saves previous step in case step has to be re-integrated.
Definition: DoubleIntegratorWithDampingAndCoulumbFriction.cpp:142
hopsan::ComponentSystem::evaluateNumHopScriptRecursively
bool evaluateNumHopScriptRecursively()
Recurse through the model system hierarchy and evaluate all system-level numhop scripts.
Definition: ComponentSystem.cpp:2109
hopsan::EquationSystemSolver::solve
void solve()
Solves a system of equations. Requires pre-defined pointers to jacobian, equations and state variable...
Definition: EquationSystemSolver.cpp:165
hopsan::Port::registerStartValueParameters
void registerStartValueParameters()
This function registers the startvalue parameters from the start node.
Definition: Port.cpp:136
hopsan::FirstOrderLowPassFilter::breakFrequency
double breakFrequency() const
Return the break frequency for this filter.
Definition: FirstOrderTransferFunction.cpp:365
hopsan::SimulationHandler
Definition: SimulationHandler.h:53
hopsan::MultiPort::getNodeDataVector
const std::vector< double > & getNodeDataVector(const size_t subPortIdx) const
Returns a reference to the Node data in the port.
Definition: Port.h:302
LookupTableNDBase::findIndexAlongDim
size_t findIndexAlongDim(const size_t dim, const double x) const
Definition: LookupTable.h:326
hopsan::EquationSystemSolver::EquationSystemSolver
EquationSystemSolver(Component *pParentComponent, int n)
Constructor for equation system solver utility.
Definition: EquationSystemSolver.cpp:68
hopsan::ComponentSystem::addSubNode
void addSubNode(Node *pNode)
Add a node as subnode in the system, if the node is already owned by someone else,...
Definition: ComponentSystem.cpp:914
hopsan::Port::getDescription
const HString & getDescription() const
Get port description.
Definition: Port.cpp:791
hopsan::Port::getNodeDataVector
virtual std::vector< double > & getNodeDataVector(const size_t subPortIdx)
Returns a reference to the Node data in the port.
Definition: Port.h:129
hopsan::limitValue
void HOPSANCORE_DLLAPI limitValue(double &rValue, double min, double max)
Limits a value so it is between min and max.
Definition: AuxiliarySimulationFunctions.cpp:52
hopsan::DoubleIntegratorWithDampingAndCoulombFriction::valueSecond
double valueSecond()
Returns second primitive from double integration.
Definition: DoubleIntegratorWithDampingAndCoulumbFriction.cpp:170
hopsan::Vec::operator[]
double & operator[](int n)
subscript operator (non-const object)
Definition: matrix.h:68
hopsan::dxLowLimit
double HOPSANCORE_DLLAPI dxLowLimit(const double x, const double xmin)
Sets the derivative of x to zero if x is outside of limits.
Definition: AuxiliarySimulationFunctions.cpp:305
hopsan::SecondOrderTransferFunctionVariable::value
double value()
Definition: SecondOrderTransferFunction.cpp:352
hopsan::Port::readNode
virtual double readNode(const size_t idx, const size_t subPortIdx) const
Reads a value from the connected node.
Definition: Port.h:85
hopsan::ComponentSystem::setOrAddSystemParameter
bool setOrAddSystemParameter(const HString &rName, const HString &rValue, const HString &rType, const HString &rDescription="", const HString &rUnitOrQuantity="", const bool force=false)
Set, add or change a system parameter including all meta data.
Definition: ComponentSystem.cpp:293
hopsan::Port::getNodeDataIdFromName
virtual int getNodeDataIdFromName(const HString &rName, const size_t subPortIdx=0)
Ask the node for the dataId for a particular data name such as (Pressure)
Definition: Port.cpp:486
hopsan::HVector::empty
bool empty() const
Check if the array is empty.
Definition: HVector.hpp:191
hopsan::HString::empty
bool empty() const
Check if string is empty.
Definition: HString.cpp:209
hopsan::Port::eraseConnectedPort
void eraseConnectedPort(Port *pPort, const size_t subPortIdx=0)
Removes a pointer to an other connected port from a port.
Definition: Port.cpp:288
hopsan::FirstOrderLowPassFilter::initialize
void initialize(double timestep, double wc, double u0=0.0, double y0=0.0, double min=-1.5E+300, double max=1.5E+300)
Initialize the filter utility.
Definition: FirstOrderTransferFunction.cpp:355
hopsan::Component::addInfoMessage
void addInfoMessage(const HString &rMessage, const HString &rTag="") const
Write an Info message.
Definition: Component.cpp:1500
hopsan::ComponentSystem::loadStartValuesFromSimulation
void loadStartValuesFromSimulation()
Load start values from last simulation to start value container.
Definition: ComponentSystem.cpp:2036
hopsan::ParameterEvaluatorHandler::checkParameters
bool checkParameters(HString &rErrParName)
Check all parameters that need evaluation are able to be evaluated.
Definition: Parameters.cpp:838
hopsan::WritePort::getPortType
PortTypesEnumT getPortType() const
Get the port type.
Definition: Port.h:430
hopsan::ComponentSystem
Definition: ComponentSystem.h:52
hopsan::NodePneumatic
A pneumatic node.
Definition: Nodes.h:282
hopsan::ParameterEvaluatorHandler::renameParameter
bool renameParameter(const HString &rOldName, const HString &rNewName)
Rename a parameter (only useful for system parameters)
Definition: Parameters.cpp:613
hopsan::Matrix::rows
int rows() const
Definition: matrix.h:107
hopsan::FirstOrderLowPassFilter
The FirstOrderLowpassFilter utility is derived from the FirstOrderTransferFunction and extends it wit...
Definition: FirstOrderTransferFunction.h:73
hopsan::NodePneumatic::DataIndexEnumT
DataIndexEnumT
The data variable indexes, DataLength is used internally.
Definition: Nodes.h:286
hopsan::HVector::capacity
size_t capacity() const
Returns the reserved number of element slots in the array.
Definition: HVector.hpp:184
hopsan::ComponentSystem::getTypeCQS
CQSEnumT getTypeCQS() const
Get the C, Q or S type of the component as enum.
Definition: ComponentSystem.cpp:169
hopsan::DoubleIntegratorWithDampingAndCoulombFriction
Definition: DoubleIntegratorWithDampingAndCoulumbFriction.h:43
hopsan::NodeHydraulic
A hydraulic node.
Definition: Nodes.h:181
hopsan::TurbulentFlowFunction
Definition: TurbulentFlowFunction.h:45
hopsan::ArcSinL
double HOPSANCORE_DLLAPI ArcSinL(const double x)
Safe variant of asin.
Definition: AuxiliarySimulationFunctions.cpp:148
hopsan::ParameterEvaluatorHandler::evaluateInComponent
bool evaluateInComponent(const HString &rName, HString &rEvaluatedParameterValue, const HString &rType)
Evaluate a specific parameter.
Definition: Parameters.cpp:747
hopsan::Port::getNodePtr
virtual Node * getNodePtr(const size_t subPortIdx=0)
Returns a pointer to the connected node or 0 if no node exist.
Definition: Port.cpp:114
hopsan::ConnectionAssistant
Definition: ConnectionAssistant.h:47
hopsan::ValveHysteresis::getValue
double getValue(double xs, double xh, double xd)
Definition: ValveHysteresis.h:64
hopsan::Port::getNodeDataDescription
virtual const NodeDataDescription * getNodeDataDescription(const size_t dataid, const size_t subPortIdx=0) const
Get a specific node data description.
Definition: Port.cpp:465
hopsan::DoubleIntegratorWithDamping::valueFirst
double valueFirst()
Returns first primitive from double integration.
Definition: DoubleIntegratorWithDamping.cpp:96
hopsan::ParameterEvaluator::setParameterValue
bool setParameterValue(const HString &rValue, ParameterEvaluator **ppNeedEvaluation=0, bool force=false)
Set the parameter value for an existing parameter.
Definition: Parameters.cpp:137
hopsan::ComponentQ
Definition: Component.h:333
hopsan::NumericalIntegrationSolver::solve
void solve(int solver)
Solves a system using numerical integration.
Definition: EquationSystemSolver.cpp:218
hopsan::ComponentSystem::setTypeCQS
void setTypeCQS(CQSEnumT cqs_type, bool doOnlyLocalSet=false)
Set the type C, Q, or S of the subsystem.
Definition: ComponentSystem.cpp:1116
hopsan::Matrix
Definition: matrix.h:96
hopsan::ComponentSystem::connect
bool connect(Port *pPort1, Port *pPort2)
Connect two components with specified ports to each other.
Definition: ComponentSystem.cpp:1330
hopsan::Matrix::cols
int cols() const
returns the number of columns
Definition: matrix.h:106
hopsan::FirstOrderTransferFunction::isSaturated
bool isSaturated() const
Check if the transfer function is saturated (has reached the set limits)
Definition: FirstOrderTransferFunction.cpp:219
hopsan::DelayTemplate::getNewest
T getNewest() const
Get the newest value in the buffer.
Definition: Delay.hpp:132
hopsan::Integrator::update
double update(const double u)
Updates the integrator one timestep and returns the new value.
Definition: Integrator.h:61
hopsan::Port::getPortType
virtual PortTypesEnumT getPortType() const
Get the port type.
Definition: Port.cpp:743
hopsan::ComponentSystem::configure
virtual void configure()
Configures a component by setting up ports, variables, constants and other resources.
Definition: ComponentSystem.cpp:164
hopsan::Component::mModelHierarchyDepth
size_t mModelHierarchyDepth
This variable contains the depth of the system in the model hierarchy, (used by connect to figure out...
Definition: Component.h:280
hopsan::CSVParserNG::copyRangeFromColumn
bool copyRangeFromColumn(const size_t columnIdx, const size_t startRow, const size_t numRows, std::vector< double > &rColumn)
Definition: CSVParser.cpp:211
hopsan::Port::isConnectedTo
virtual bool isConnectedTo(Port *pOtherPort)
Check if this port is connected to other port.
Definition: Port.cpp:696
hopsan::dxLimit
double HOPSANCORE_DLLAPI dxLimit(const double x, const double xmin, const double xmax)
Sets the derivative of x to zero if x is outside of limits.
Definition: AuxiliarySimulationFunctions.cpp:285
hopsan::NumericalIntegrationSolver::solveBackwardEuler
void solveBackwardEuler()
Solves a system using implicit Euler.
Definition: EquationSystemSolver.cpp:300
hopsan::DoubleIntegratorWithDamping
Definition: DoubleIntegratorWithDamping.h:43
hopsan::NumericalIntegrationSolver::getAvailableSolverTypes
static const std::vector< HString > getAvailableSolverTypes()
Returns a list of available integration methods.
Definition: EquationSystemSolver.cpp:203
hopsan::NodePetriNet
A petri net node.
Definition: Nodes.h:477
hopsan::NodeElectric::DataIndexEnumT
DataIndexEnumT
The data variable indexes, DataLength is used internally.
Definition: Nodes.h:385
hopsan::BiDirectionalSignalPort::getPortType
PortTypesEnumT getPortType() const
Get the port type.
Definition: Port.h:363
hopsan::Port::RequireConnectionEnumT
RequireConnectionEnumT
This enum specifies the RequiredConnection enums.
Definition: Port.h:65
hopsan::DummyComponent::configure
void configure()
Configures a component by setting up ports, variables, constants and other resources.
Definition: DummyComponent.hpp:51
hopsan::ConnectionAssistant::ifMultiportAddSubport
Port * ifMultiportAddSubport(Port *pMaybeMultiport)
Detects if a port is a multiport and then adds and returns a subport.
Definition: ConnectionAssistant.cpp:156
hopsan::upperLimit
double upperLimit(const double value, const double limit)
Apply a upper limit to a value.
Definition: AuxiliarySimulationFunctions.h:233
hopsan::HopsanEssentials::createConditionalComponentSystem
ConditionalComponentSystem * createConditionalComponentSystem()
Creates a ConditionalComponentSystem.
Definition: HopsanEssentials.cpp:275
hopsan::ComponentSystem::addComponent
void addComponent(Component *pComponent)
Add a component to the system.
Definition: ComponentSystem.cpp:352
hopsan::HVector::assign_from
void assign_from(const T *pData, size_t count)
Assign from C-array param [in] pData A pointer to the array param [in] count The number of elements t...
Definition: HVector.hpp:138
hopsan::Component::getTime
double getTime() const
Get the current simulation time.
Definition: Component.h:209
hopsan::ComponentSystem::disableLog
void disableLog()
Disable node data logging.
Definition: ComponentSystem.cpp:3488
hopsan::SecondOrderTransferFunction::isSaturated
bool isSaturated() const
Check if the transfer function is saturated (har reached the set limits)
Definition: SecondOrderTransferFunction.cpp:242
hopsan::sign
double sign(const double x)
Returns the sign of a double (-1.0 or +1.0)
Definition: AuxiliarySimulationFunctions.h:173
hopsan::MultiPort::setNode
void setNode(Node *pNode)
Set the node that the port is connected to.
Definition: Port.cpp:1303
hopsan::QuantityRegister
Definition: Quantities.h:42
hopsan::ComponentSystem::deleteSystemPort
void deleteSystemPort(const HString &rName)
Delete a System port from the component.
Definition: ComponentSystem.cpp:1108
hopsan::ParameterEvaluator::evaluate
bool evaluate()
Evaluate the parameter.
Definition: Parameters.cpp:177
hopsan::lowerLimit
double lowerLimit(const double value, const double limit)
Apply a lower limit to a value.
Definition: AuxiliarySimulationFunctions.h:223
hopsan::NodeMechanic2D
A 2D mechanic node.
Definition: Nodes.h:410
hopsan::ComponentSystem::logTimeAndNodes
void logTimeAndNodes(const size_t simStep)
Definition: ComponentSystem.cpp:1008
hopsan::Component::getTypeCQS
virtual CQSEnumT getTypeCQS() const
Get the C, Q or S type of the component as enum.
Definition: Component.cpp:377
hopsan::MultiPort::isMultiPort
bool isMultiPort() const
Convenience function to check if port is multiport.
Definition: Port.cpp:1019
hopsan::Vec::create
void create(int size)
creates (or resets) vector length and allocated space
Definition: matrix.cpp:263
hopsan::Component::getTypeName
const HString & getTypeName() const
Get the TypeName of the component.
Definition: Component.cpp:408
hopsan::ConditionalComponentSystem::configure
void configure()
Configures a component by setting up ports, variables, constants and other resources.
Definition: ComponentSystem.cpp:3507
hopsan::Port::addConnectedPort
void addConnectedPort(Port *pPort, const size_t subPortIdx=0)
Adds a pointer to an other connected port to a port.
Definition: Port.cpp:278
hopsan::AliasHandler::setVariableAlias
bool setVariableAlias(const HString &rAlias, const HString &rCompName, const HString &rPortName, const HString &rVarName)
Definition: AliasHandler.cpp:69
hopsan::FirstOrderTransferFunction::backup
void backup()
Pushes a backup of transfer function states into the backup buffer.
Definition: FirstOrderTransferFunction.cpp:115
hopsan::DoubleIntegratorWithDamping::integrateWithUndo
void integrateWithUndo(double u)
Integrates one step, but saves previous step in case step has to be re-integrated.
Definition: DoubleIntegratorWithDamping.cpp:74
hopsan::EquationSystemSolver
A numerical solver utility for equation systems using LU-decomposition.
Definition: EquationSystemSolver.h:47
hopsan::PetriNetNodeDataPointerStructT
Definition: NodeRWHelpfuncs.hpp:540
hopsan::LoadExternal::unLoad
bool unLoad(const HString &rLibpath)
This function unloads a library and its components and nodes.
Definition: LoadExternal.cpp:277
hopsan::NodeMechanicRotational
A rotational mechanic node.
Definition: Nodes.h:349
hopsan::ClassFactory::getRegisterStatus
RegStatusVectorT getRegisterStatus()
Get a copy of the internal error vector, it maps key values against error codes, error codes come fro...
Definition: ClassFactory.hpp:151
hopsan::LoadExternal::getLibPathByTypeName
void getLibPathByTypeName(const HString &rTypeName, HString &rLibPath)
Returns library path (to dll or so file) for a component type.
Definition: LoadExternal.cpp:332
hopsan::Component::loadParameterValues
virtual size_t loadParameterValues(const HString &rFilePath)
Loads parameters from a file.
Definition: Component.cpp:239
hopsan::limit
double HOPSANCORE_DLLAPI limit(const double x, const double xmin, const double xmax)
Overloads void hopsan::limitValue() with a return value.
Definition: AuxiliarySimulationFunctions.cpp:253
hopsan::HVector::HVector
HVector(const HVector< T > &rOther)
copy constructor
Definition: HVector.hpp:50
hopsan::Vec::length
int length() const
returns the length (number of elements) of the vector
Definition: matrix.h:62
hopsan::Component::isExperimental
virtual bool isExperimental() const
Check if component is tagged as experimental.
Definition: Component.cpp:806
hopsan::ReadPort::getPortType
PortTypesEnumT getPortType() const
Get the port type.
Definition: Port.h:375
hopsan::ComponentSystem::addComponents
void addComponents(std::vector< Component * > &rComponents)
Add multiple components to the system.
Definition: ComponentSystem.cpp:342
hopsan::createSafeComponent
Component HOPSANCORE_DLLAPI * createSafeComponent(ComponentSystem *pSystem, const HString &rType)
Help function to create components and abort safely if that fails.
Definition: HopsanPowerUser.cpp:37
hopsan::LoadExternal::getLibContents
void getLibContents(const HString &rLibpath, std::vector< HString > &rComponents, std::vector< HString > &rNodes)
Returns the components and nodes registered by specified library.
Definition: LoadExternal.cpp:351
hopsan::Port::readNode
double readNode(const size_t idx) const
Reads a value from the connected node.
Definition: Port.h:75
hopsan::HString::replace
void replace(const size_t pos, const size_t len, const char *str)
Definition: HString.cpp:492
hopsan::HVector::reserve
void reserve(size_t s)
Reserve capacity for the array.
Definition: HVector.hpp:86
hopsan::getSafeConstantDataPtr
T * getSafeConstantDataPtr(ComponentSystem *pSystem, Component *pComp, const HString &rConstantName)
Help function to safely get the internal parameter data pointer from a subcomponent,...
Definition: HopsanPowerUser.h:47
hopsan::HopsanCoreMessageHandler::addDebugMessage
void addDebugMessage(const HString &rMessage, const HString &rTag="", const int dbglevel=0)
Convenience function to add debug message.
Definition: HopsanCoreMessageHandler.cpp:180
hopsan::PowerPort
Definition: Port.h:345
hopsan::Port::isMultiPort
virtual bool isMultiPort() const
Convenience function to check if port is multiport.
Definition: Port.cpp:732
hopsan::LoadedLibInfo
Definition: LoadExternal.h:46
hopsan::Port::setSignalNodeQuantityOrUnit
virtual void setSignalNodeQuantityOrUnit(const HString &rQuantityOrUnit)
A help function that makes it possible to overwrite the unit or quantity of scalar signal node variab...
Definition: Port.cpp:501
hopsan::DummyComponent::simulateOneTimestep
void simulateOneTimestep()
Simulates one time step. This component must be overloaded en each component.
Definition: DummyComponent.hpp:63
hopsan::Port::setNode
virtual void setNode(Node *pNode)
Set the node that the port is connected to.
Definition: Port.cpp:257
hopsan::DelayTemplate
Delay template class, implementing a circular buffer containing values of specified type.
Definition: Delay.hpp:45
hopsan::HString::substr
HString substr(const size_t pos, const size_t len=npos) const
Extract substring.
Definition: HString.cpp:520
hopsan::MultiPort::getLogTimeVectorPtr
std::vector< double > * getLogTimeVectorPtr(const size_t subPortIdx=0)
Definition: Port.cpp:1133
hopsan::ComponentSystem::unReserveUniqueName
void unReserveUniqueName(const HString &rName)
unReserves a unique name in the system
Definition: ComponentSystem.cpp:506
hopsan::ComponentSystem::finalize
void finalize()
Finalizes a system component and all its contained components after a simulation.
Definition: ComponentSystem.cpp:3397
hopsan::ClassFactory::mFactoryMap
FactoryMapT mFactoryMap
Map where the construction info is stored.
Definition: ClassFactory.hpp:61
hopsan::ReadMultiPort::getPortType
PortTypesEnumT getPortType() const
Get the port type.
Definition: Port.h:411
hopsan::IntegratorLimited
The IntegratorLimited class implements a integrator using bilinear transform which integrates a varia...
Definition: IntegratorLimited.h:44
hopsan::Vec::Vec
Vec()
default no-argument constructor
Definition: matrix.cpp:257
hopsan::HVector::resize
void resize(size_t s)
Resize the array, keeping old data if any.
Definition: HVector.hpp:103
hopsan::ComponentSystem::loadParameterValues
size_t loadParameterValues(const HString &rFilePath)
Loads parameters from a file.
Definition: ComponentSystem.cpp:2100
hopsan::MultiPort::isConnectedTo
virtual bool isConnectedTo(Port *pOtherPort)
Check if this port is connected to other port.
Definition: Port.cpp:1211
hopsan::DummyComponent::initialize
void initialize()
The initialize function must be overloaded in each component, it is used to initialize the component ...
Definition: DummyComponent.hpp:57
hopsan::Component::getParameterDataPtr
void * getParameterDataPtr(const HString &rName)
Returns a pointer directly to the parameter data variable.
Definition: Component.cpp:130
hopsan::MultiPort::getNodeDataVector
std::vector< double > & getNodeDataVector(const size_t subPortIdx)
Returns a reference to the Node data in the port.
Definition: Port.h:297
hopsan::ComponentSystem::setNumHopScript
void setNumHopScript(const HString &rScript)
Set the system-level numhop script.
Definition: ComponentSystem.cpp:2170
hopsan::FirstOrderTransferFunction::update
double update(double u)
Updates the transfer function.
Definition: FirstOrderTransferFunction.cpp:141
hopsan::NodeSignal3D
The 3d signal node.
Definition: Nodes.h:166
hopsan::Component::getTypeCQSString
HString getTypeCQSString() const
Get the CQStype as string.
Definition: Component.cpp:384
hopsan::NodeElectric
An electric node.
Definition: Nodes.h:381
hopsan::ifPositive
double ifPositive(const double x, const double y1, const double y2)
Returns y1 or y2 depending on the value of x.
Definition: AuxiliarySimulationFunctions.h:90
hopsan::ClassFactory::getRegisteredKeys
const std::vector< _Key > getRegisteredKeys() const
Return a vector with all registered keys.
Definition: ClassFactory.hpp:121
hopsan::HString
Definition: HString.h:36
hopsan::ComponentSystem::disconnect
bool disconnect(const HString &compname1, const HString &portname1, const HString &compname2, const HString &portname2)
Disconnect two ports, string version.
Definition: ComponentSystem.cpp:1468
hopsan::NodeEmpty
Definition: Nodes.h:495
hopsan::Component::CQSEnumT
CQSEnumT
Enum type for all CQS types.
Definition: Component.h:91
LookupTableNDBase::reverseAlongDim
void reverseAlongDim(size_t d)
Definition: LookupTable.h:430
hopsan::dxLimit2
double HOPSANCORE_DLLAPI dxLimit2(const double x, const double sx, const double xmin, const double xmax)
Limits the derivative of x when x is outside of its limits.Returns 1.0 if x is within borders,...
Definition: AuxiliarySimulationFunctions.cpp:329
hopsan::DelayTemplate::getOldIdx
T getOldIdx(const size_t i) const
Returns a specific value, 0=oldest, 1=nextoldest, 2=nextnextoldest and so on, no range check is perfo...
Definition: Delay.hpp:156
hopsan::rad2deg
double rad2deg(const double rad)
Converts an angle in radians to degrees.
Definition: AuxiliarySimulationFunctions.h:251
hopsan::Node::getDataIdFromName
int getDataIdFromName(const HString &rName) const
This function gives you the data Id for a named data variable.
Definition: Node.cpp:206
hopsan::ComponentSystem::unRegisterParameter
void unRegisterParameter(const HString &name)
Removes a parameter from the component.
Definition: ComponentSystem.cpp:335
LookupTable3D
Definition: LookupTable.h:584
hopsan::ConnectionAssistant::mergeNodeConnection
bool mergeNodeConnection(Port *pPort1, Port *pPort2)
Definition: ConnectionAssistant.cpp:332
hopsan::HString::isBool
bool isBool() const
Check if the string can be interpreted as bool (true, false, 1, 0)
Definition: HString.cpp:273
hopsan::ParameterEvaluator::ParameterEvaluator
ParameterEvaluator(const HString &rName, const HString &rValue, const HString &rDescription, const HString &rQuantity, const HString &rUnit, const HString &rType, void *pDataPtr=0, ParameterEvaluatorHandler *pParameterEvalHandler=0)
Constructor.
Definition: Parameters.cpp:65
hopsan::MultiPort::getLogDataVectorPtr
std::vector< std::vector< double > > * getLogDataVectorPtr(const size_t subPortIdx=0)
Definition: Port.cpp:1142
hopsan::MultiPort::loadStartValuesFromSimulation
void loadStartValuesFromSimulation()
Load start values to the start value container from the node (last values from simulation)
Definition: Port.cpp:1206
hopsan::CSVParserNG
The CSV file parser utility.
Definition: CSVParser.h:52
hopsan::NumericalIntegrationSolver::solvevariableTimeStep
void solvevariableTimeStep()
Solves a system using trapezoid rule with variable step size (experimental, do not use)
Definition: EquationSystemSolver.cpp:570
hopsan::ComponentSystem::reserveUniqueName
HString reserveUniqueName(const HString &rDesiredName, const UniqeNameEnumT type=UniqueReservedNameType)
Reserves a unique name in the system.
Definition: ComponentSystem.cpp:497
hopsan::equalSignsBool
bool equalSignsBool(const double x, const double y)
Check if input variables have the same sign.
Definition: AuxiliarySimulationFunctions.h:259
hopsan::Port::disableStartValue
virtual void disableStartValue(const size_t idx)
Disables start value for specified data type.
Definition: Port.cpp:670
hopsan::Vec::operator[]
const double & operator[](int n) const
subscript operator (const object)
Definition: matrix.h:70
hopsan::ComponentSystem::simulateAndMeasureTime
bool simulateAndMeasureTime(const size_t nSteps)
Helper function that simulates all components and measure their average time requirements.
Definition: ComponentSystem.cpp:3109
hopsan::Component::initialize
virtual void initialize()
The initialize function must be overloaded in each component, it is used to initialize the component ...
Definition: Component.cpp:314
hopsan::KinsolSolver
Definition: EquationSystemSolver.h:106
hopsan::fuzzyEqual
bool HOPSANCORE_DLLAPI fuzzyEqual(const double x, const double y, const double epsilon=0.00001)
checks if two double variables are equal with a tolerance
Definition: AuxiliarySimulationFunctions.cpp:78
hopsan::IntegratorWithBackup::updateWithBackup
double updateWithBackup(double u)
Make a backup of states and then calls update.
Definition: Integrator.h:126
LookupTableNDBase
Definition: LookupTable.h:46
hopsan::ComponentSystem::sortComponentVectorsByMeasuredTime
void sortComponentVectorsByMeasuredTime()
Helper function that sorts C- and Q- component vectors by simulation time for each component.
Definition: ComponentSystem.cpp:3225
hopsan::ParameterEvaluatorHandler::evaluateParameters
bool evaluateParameters()
Evaluate all parameters.
Definition: Parameters.cpp:764
hopsan::Port::loadStartValues
virtual void loadStartValues()
Load start values by copying the start values from the port to the node.
Definition: Port.cpp:170
hopsan::HopsanCoreMessageHandler::addInfoMessage
void addInfoMessage(const HString &rMessage, const HString &rTag="", const int dbglevel=0)
Convenience function to add info message.
Definition: HopsanCoreMessageHandler.cpp:153
hopsan::ConditionalComponentSystem::simulateMultiThreaded
void simulateMultiThreaded(const double startT, const double stopT, const size_t nDesiredThreads, const bool noChanges, ParallelAlgorithmT algorithm)
Simulate function that overrides multi-threaded simulation call with a single-threaded call In case m...
Definition: ComponentSystem.cpp:3549
hopsan::Port::addSubPort
virtual Port * addSubPort()
Adds a subport to a multiport.
Definition: Port.cpp:122
hopsan::DoubleIntegratorWithDamping::redoIntegrate
void redoIntegrate(double u)
Re-integrates last step Last step must have been called with integrateWithUndo() for this to work.
Definition: DoubleIntegratorWithDamping.cpp:86
hopsan::deg2rad
double deg2rad(const double deg)
Converts an angle in degrees to radians.
Definition: AuxiliarySimulationFunctions.h:242
hopsan::SecondOrderTransferFunction
The SecondOrderTransferFunction class implements a second order transfer function using bilinear tran...
Definition: SecondOrderTransferFunction.h:43
hopsan::diffAngle
double HOPSANCORE_DLLAPI diffAngle(const double fi1, const double fi2)
difference between two angles, fi1-fi2
Definition: AuxiliarySimulationFunctions.cpp:162
hopsan::MultiPort::getStartValue
double getStartValue(const size_t idx, const size_t subPortIdx=0)
Get the an actual start value of the port.
Definition: Port.cpp:1180
hopsan::ComponentSystem::enableLog
void enableLog()
Enable node data logging.
Definition: ComponentSystem.cpp:3481
hopsan::Port::getName
const HString & getName() const
Get the port name.
Definition: Port.cpp:777
hopsan::smartConnect
bool HOPSANCORE_DLLAPI smartConnect(ComponentSystem *pSystem, Port *pPort1, Port *pPort2)
Help function that only call connect if the ports are not already connected to each other.
Definition: HopsanPowerUser.cpp:55
hopsan::Component::getTimestep
double getTimestep() const
Returns the component simulation time step.
Definition: Component.cpp:1681
hopsan::Port::removeSubPort
virtual void removeSubPort(Port *pPort)
Removes a subport from multiport.
Definition: Port.cpp:129
hopsan::Node::getNumDataVariables
size_t getNumDataVariables() const
Returns the total number of variables in a node.
Definition: Node.cpp:109
hopsan::SystemPort::getExternalPortType
PortTypesEnumT getExternalPortType()
Get the External port type (virtual, should be overloaded in systemports only)
Definition: Port.cpp:812
hopsan::Node
The Node base class.
Definition: Node.h:66
hopsan::Node::Node
Node(const size_t datalength)
Definition: Node.cpp:67
hopsan::ParameterEvaluatorHandler::deleteParameter
void deleteParameter(const HString &rName)
Deletes a parameter.
Definition: Parameters.cpp:582
hopsan::MechanicNodeDataValueStructT
Definition: NodeRWHelpfuncs.hpp:371
hopsan::smartDisconnect
bool HOPSANCORE_DLLAPI smartDisconnect(ComponentSystem *pSystem, Port *pPort1, Port *pPort2)
Help function that only call disconnect if the ports are connected to each other.
Definition: HopsanPowerUser.cpp:81
hopsan::MultiPort::getNodeDataIdFromName
int getNodeDataIdFromName(const HString &rName, const size_t subPortIdx=0)
Ask the node for the dataId for a particular data name such as (Pressure)
Definition: Port.cpp:1115
hopsan::NumericalIntegrationSolver::solveTrapezoidRule
void solveTrapezoidRule()
Solves a system using trapezoid rule of integration.
Definition: EquationSystemSolver.cpp:356
hopsan::ConnectionAssistant::ensureConnectionOK
bool ensureConnectionOK(Node *pNode, Port *pPort1, Port *pPort2)
Definition: ConnectionAssistant.cpp:44
hopsan::Component::getPort
Port * getPort(const HString &rPortname) const
Returns a pointer to the port with the given name.
Definition: Component.cpp:1278
hopsan::HVector::size
size_t size() const
Returns the number of elements in the array.
Definition: HVector.hpp:177
hopsan::ComponentSystem::getNumLogSamples
size_t getNumLogSamples() const
Returns the desired number of log samples.
Definition: ComponentSystem.cpp:196
hopsan::PowerMultiPort::getPortType
PortTypesEnumT getPortType() const
Get the port type.
Definition: Port.h:397
LookupTable1D
Definition: LookupTable.h:505
hopsan::MultiPort::readNode
double readNode(const size_t idx, const size_t subPortIdx) const
Reads a value from the connected node.
Definition: Port.h:278
hopsan::Component::deletePort
void deletePort(const HString &rName)
Removes and deletes a port from a component.
Definition: Component.cpp:998
hopsan::d2Atan2L
double d2Atan2L(const double y, const double x)
Derivative of ATAN2L with respect to x.
Definition: AuxiliarySimulationFunctions.h:164
hopsan::ClassFactory::reserveKey
bool reserveKey(const _Key &rIdKey)
Reserve keyword by inserting NULL ptr,.
Definition: ClassFactory.hpp:83
hopsan::Vec::print
void print() const
prints vector contents to stdout
Definition: matrix.cpp:401
hopsan::MechanicNodeDataPointerStructT
Definition: NodeRWHelpfuncs.hpp:381
hopsan::ComponentSignal
Definition: Component.h:318
hopsan::Component::getPortPtrVector
std::vector< Port * > getPortPtrVector() const
Definition: Component.cpp:1263
hopsan::ClassFactory::mRegStatusVector
RegStatusVectorT mRegStatusVector
Error status map.
Definition: ClassFactory.hpp:63
hopsan::onPositive
double onPositive(const double x)
Returns 1.0 if x is positive, else returns 0.0.
Definition: AuxiliarySimulationFunctions.h:119
hopsan::ParameterEvaluator
Definition: Parameters.h:47
hopsan::ComponentSystem::addSearchPath
void addSearchPath(HString searchPath)
Adds a search path that can be used by its components to look for external files, e....
Definition: ComponentSystem.cpp:268
hopsan::SystemPort
Definition: Port.h:242
hopsan::Matrix::Matrix
Matrix()
default (no argument) constructor
Definition: matrix.h:99
hopsan::CLift
double HOPSANCORE_DLLAPI CLift(const double alpha, const double CLalpha, const double ap, const double an, const double expclp, const double expcln)
Lift coefficient for aircraft model.
Definition: AuxiliarySimulationFunctions.cpp:176
hopsan::NodeSignalND::setSignalQuantity
virtual void setSignalQuantity(const HString &rQuantity, const HString &rUnit, const size_t dataId=Value)
This function can be used to set unit string and displayName for signal nodes ONLY.
Definition: Nodes.h:115
hopsan::ParameterEvaluatorHandler
Definition: Parameters.h:93
hopsan::ComponentSystem::setSystemParameter
bool setSystemParameter(const HString &rName, const HString &rValue, const HString &rType, const HString &rDescription="", const HString &rUnitOrQuantity="", const bool force=false)
Set or change a system parameter including all meta data.
Definition: ComponentSystem.cpp:325
hopsan::Vec::min
double min()
returns minimum Vec element
Definition: matrix.cpp:289
hopsan::CMoment
double HOPSANCORE_DLLAPI CMoment(double alpha, const double Cm0, const double Cmfs, const double ap, const double an, const double expclp, const double expcln)
Moment coefficient for aircraft model.
Definition: AuxiliarySimulationFunctions.cpp:195
hopsan::ComponentSystem::isEmpty
bool isEmpty() const
Checks if a system is empty (if there are no components or systemports)
Definition: ComponentSystem.cpp:902
hopsan::Component::addPort
Port * addPort(const HString &rPortName, const PortTypesEnumT portType, const HString &rNodeType, const HString &rDescription, const Port::RequireConnectionEnumT reqConnection)
Adds a port to the component, do not call this function directly unless you have to.
Definition: Component.cpp:833
hopsan::ReadPort::writeNodeSafe
void writeNodeSafe(const size_t idx, const double value, const size_t subPortIdx=0)
Writes a value to the connected node.
Definition: Port.cpp:941
hopsan::Component::setMeasuredTime
void setMeasuredTime(const double time)
Definition: Component.cpp:1444
hopsan::Component::Component
Component()
Component base class Constructor.
Definition: Component.cpp:70
hopsan::NumericalIntegrationSolver
Definition: EquationSystemSolver.h:72
hopsan::ComponentSystem::loadStartValues
void loadStartValues()
Load start values by telling each component to load their start values.
Definition: ComponentSystem.cpp:1978
hopsan::equalSigns
double equalSigns(const double x, const double y)
Check if input variables have the same sign.
Definition: AuxiliarySimulationFunctions.h:269
hopsan::Component::getMeasuredTime
double getMeasuredTime() const
Returns the measured time variable for the component. This is used to measure time requirements when ...
Definition: Component.cpp:1451