AGX Dynamics 2.40.1.0
Loading...
Searching...
No Matches
agxHydraulics::FlowConnector Class Reference

A FlowConnector is a junction of a set of FlowUnits. More...

#include <FlowConnector.h>

+ Inheritance diagram for agxHydraulics::FlowConnector:

Public Member Functions

 FlowConnector (bool holonomic=true)
 A flow connector can either be holonomic or nonholonomic.
 
virtual bool connect (agxPowerLine::Side mySide, agxPowerLine::Side unitSide, agxPowerLine::Unit *unit) override
 Connect the given unit to this FlowConnector.
 
agx::Real getCompliance () const
 
agx::Real getDamping () const
 
virtual agx::Real getPressure () const override
 
agx::Real getStoredFluid () const
 Only valid for holonomic FlowConnectors.
 
agx::Real getVolumeExpansionPressureRatio () const
 Alias for getCompliance().
 
void setCompliance (agx::Real volumePerPressure)
 Set the compliance of the flow constraint.
 
void setDamping (agx::Real damping)
 Set the damping of the flow constraint.
 
void setVolumeExpansionPressureRatio (agx::Real ratio)
 Alias for setCompliance(agx::Real).
 
- Public Member Functions inherited from agxHydraulics::PressureConnector
virtual agx::Real getPressure () const =0
 
virtual bool restore (agxStream::StorageStream &str)
 Restores internal data from stream.
 
virtual bool store (agxStream::StorageStream &str) const
 Stores internal data into stream.
 
- Public Member Functions inherited from agxPowerLine::Connector
 Connector ()
 create a connector
 
virtual bool addNotification (agxSDK::Simulation *simulation) override
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxPowerLine::Connector)
 
virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping (const agx::Real, agx::Real &, agx::Real &)
 Calculate the compliance and damping according to the connector properties (efficiency, ratio, ..)
 
agx::Real calculateEfficiency () const
 calculate simulated efficiency
 
virtual agx::Real calculateViolation () const
 calculate violation for constraint
 
bool compareWithInputTypes (PhysicalDimensionRefVector &dimensions) const
 
bool compareWithOutputTypes (PhysicalDimensionRefVector &dimensions) const
 
bool connect (agxPowerLine::PhysicalDimension *dimension, agxPowerLine::Side connectorSide, agxPowerLine::Side dimensionSide)
 Connect on the physical dimension level only.
 
virtual bool connect (agxPowerLine::PhysicalDimension *inputDimension, agxPowerLine::Side inputSide, agxPowerLine::Side outputSide, agxPowerLine::PhysicalDimension *outputDimension)
 
virtual bool connect (agxPowerLine::Side mySide, agxPowerLine::Side unitSide, agxPowerLine::Unit *unit)
 
virtual bool connect (agxPowerLine::Unit *unit)
 Connect a unit to this Connector.
 
bool connectDimensions (Unit *unit, agxPowerLine::Side mySide, agxPowerLine::Side unitSide)
 
virtual agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementationcreateConstraint ()=0
 Create the constraint (implement this to create whatever constraint you need)
 
virtual bool disconnect ()
 
bool disconnect (agxPowerLine::PhysicalDimension *dimension, agxPowerLine::Side connectorSide, agxPowerLine::Side dimensionSide)
 
virtual bool disconnect (agxPowerLine::Unit *unit)
 Disconnect the given unit from this Connector.
 
agxPowerLine::ConnectionfindConnection (const agxPowerLine::Unit *unit, agxPowerLine::Side side)
 
const agxPowerLine::ConnectionfindConnection (const agxPowerLine::Unit *unit, agxPowerLine::Side side) const
 
agxPowerLine::ConnectionfindInputConnection (const agxPowerLine::Unit *unit)
 
const agxPowerLine::ConnectionfindInputConnection (const agxPowerLine::Unit *unit) const
 
agxPowerLine::ConnectionfindOutputConnection (const agxPowerLine::Unit *unit)
 
const agxPowerLine::ConnectionfindOutputConnection (const agxPowerLine::Unit *unit) const
 
const agxPowerLine::ConnectionRefVectorgetConnections (agxPowerLine::Side side) const
 
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementationgetConstraint () const
 
agx::Real getDamping () const
 
agxPowerLine::ElementaryPhysicalDimensionConstraintgetElementaryConstraint () const
 
bool getIgnoreForStoreRestoreStream () const
 
agxPowerLine::ConnectiongetInputConnection (size_t index)
 return a specific input connection
 
const agxPowerLine::ConnectiongetInputConnection (size_t index) const
 return a specific output connection
 
agxPowerLine::ConnectionRefVectorgetInputConnections ()
 return vector to all input connections from this connector
 
const agxPowerLine::ConnectionRefVectorgetInputConnections () const
 return vector to all input connections from this connector
 
PhysicalDimensiongetInputDimension (const PhysicalDimension::Type dimensionType) const
 
const DimensionTypeVectorgetInputTypes () const
 
bool getInputUnits (UnitConstPtrSetVector &units, const bool startFromCleanUnitSet=true) const
 
bool getInputUnits (UnitPtrSetVector &units, const bool startFromCleanUnitSet=true)
 
int getNumConnections () const
 
int getNumConnections (agxPowerLine::Side side) const
 
int getNumFreeConnections () const
 
int getNumFreeConnections (agxPowerLine::Side side) const
 
int getNumFreeInputConnections () const
 
int getNumFreeOutputConnections () const
 
int getNumInputConnections () const
 
int getNumOutputConnections () const
 
int getNumPossibleInputConnections () const
 
int getNumPossibleOutputConnections () const
 
agxPowerLine::ConnectiongetOutputConnection (size_t index)
 return a specific input connection
 
const agxPowerLine::ConnectiongetOutputConnection (size_t index) const
 return a specific output connection
 
agxPowerLine::ConnectionRefVectorgetOutputConnections ()
 return vector to all output connections from this connector
 
const agxPowerLine::ConnectionRefVectorgetOutputConnections () const
 return vector to all output connections from this connector
 
PhysicalDimensiongetOutputDimension (const PhysicalDimension::Type dimensionType) const
 
const DimensionTypeVectorgetOutputTypes () const
 
bool getOutputUnits (UnitConstPtrSetVector &units, const bool startFromCleanUnitSet=true) const
 
bool getOutputUnits (UnitPtrSetVector &units, const bool startFromCleanUnitSet=true)
 
agx::Real getPowerIn () const
 
agxPowerLine::PowerLinegetPowerLine () const
 
agx::Real getPowerOut () const
 
agx::Real getRatio () const
 
virtual agx::Real getRatio (agx::Real x) const
 
agx::Real getRatioDerivative () const
 
virtual agx::Real getRatioDerivative (agx::Real x) const
 
virtual agxPowerLine::Side getSide (const agxPowerLine::Unit *unit) const
 
const DimensionTypeVectorgetTypes (agxPowerLine::Side side) const
 
bool getUnits (UnitConstPtrSetVector &units, agxPowerLine::Side side, const bool startFromCleanUnitSet=true) const
 
bool getUnits (UnitConstPtrSetVector &units, const bool startFromCleanUnitSet=true) const
 
bool getUnits (UnitPtrSetVector &units, agxPowerLine::Side side, const bool startFromCleanUnitSet=true)
 
bool getUnits (UnitPtrSetVector &units, const bool startFromCleanUnitSet=true)
 
virtual agx::Real getViolation () const
 Returns the constraint violation for connectors with holonomic constraints.
 
bool hasFreeConnection () const
 
bool hasFreeConnection (agxPowerLine::Side side) const
 
bool hasFreeInputConnection () const
 
bool hasFreeOutputConnection () const
 
bool hasInputConnection (Connection *connection)
 Find out if the connection belongs to this connector.
 
bool hasOutputConnection (Connection *connection)
 
virtual void initConstraint ()
 
bool isConstraintValid () const
 
virtual bool isInput (const agxPowerLine::PhysicalDimension *dimension) const
 Determine if the given dimension is part of any of the input connections of this Connector.
 
virtual bool isOutput (Connection *connection) const
 Find out if a connection is output from this connector.
 
virtual bool isOutput (const agxPowerLine::PhysicalDimension *dimension) const
 Find out if the given dimension is part of any of the output connections.
 
virtual bool postRestore (agxStream::StorageStream &str)
 
virtual bool postStore (agxStream::StorageStream &str) const
 Set values of constraints.
 
virtual bool removeNotification (agxUtil::ConstraintHolder *holder, agxSDK::Simulation *simulation) override
 remove connector and constraint from simulation
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual bool restore (agxStream::StorageStream &str) override
 Restores internal data from stream.
 
void setConstraint (agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation *constraint)
 set the constraint that represents this connector in the solver.
 
void setDamping (agx::Real damping)
 Set the damping of the constraint.
 
void setIgnoreForStoreRestoreStream (bool ignore)
 
void setNumPossibleInputConnections (int num)
 Define number of input dimensions the constraint should handle.
 
void setNumPossibleOutputConnections (int num)
 Define number of output dimensions the constraint should handle.
 
void setPowerLine (agxPowerLine::PowerLine *powerLine)
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual bool store (agxStream::StorageStream &str) const override
 Stores internal data for this segment into stream.
 
virtual bool vetoConnect (agxPowerLine::Unit *unit) const
 
- Public Member Functions inherited from agxPowerLine::SubGraph
 SubGraph ()
 
virtual bool addNotification (agxSDK::Simulation *simulation)=0
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxPowerLine::SubGraph)
 
virtual void getConnectorsRecursive (ConnectorPtrVector &connectors)
 Fill the given vector with the Connectors that are held by this SubGraph.
 
ConnectorgetEnclosingConnector ()
 
const ConnectorgetEnclosingConnector () const
 
SubGraphgetEnclosingGraph ()
 
const SubGraphgetEnclosingGraph () const
 
UnitgetEnclosingUnit ()
 
const UnitgetEnclosingUnit () const
 
const agxPowerLine::ConnectorRefVectorgetInternalConnectors () const
 
const agxPowerLine::UnitRefVectorgetInternalUnits () const
 
const agx::NamegetName () const
 
SubGraphgetRootEnclosingGraph ()
 
const SubGraphgetRootEnclosingGraph () const
 
virtual void getUnitsRecursive (UnitPtrVector &units)
 Fill the given vector with the Units that are held by this SubGraph.
 
bool isEnclosedWithin (const SubGraph *component) const
 
virtual bool postUpdate (agx::Real timeStep)
 
virtual void prepareForRestore ()
 
virtual void prepareForStore ()
 
virtual bool preUpdate (agx::Real timeStep)
 
virtual bool removeNotification (agxUtil::ConstraintHolder *holder, agxSDK::Simulation *simulation)=0
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual bool restore (agxStream::StorageStream &str)
 Restores internal data from stream.
 
void setName (const agx::Name &name)
 Set the name of this power line component.
 
void spreadPowerLineToGraph ()
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual bool store (agxStream::StorageStream &str) const
 Stores internal data into stream.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static agx::Real getDefaultCompliance ()
 
static agx::Real getDefaultDamping ()
 
static void setDefaultCompliance (agx::Real compliance)
 Set the default compliance for new flow connectors.
 
static void setDefaultDamping (agx::Real damping)
 Set the default damping for new flow connectors.
 
- Static Public Member Functions inherited from agxPowerLine::Connector
static PhysicalDimensiongetDimension (const ConnectionRefVector &connections, const PhysicalDimension::Type dimensionType)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

virtual ~FlowConnector ()
 
virtual bool connect (agxPowerLine::Unit *inputUnit, agxPowerLine::Side inputUnitSide, agxPowerLine::Side outputUnitSide, agxPowerLine::Unit *outputUnit) override
 
- Protected Member Functions inherited from agxHydraulics::PressureConnector
 PressureConnector ()
 
virtual ~PressureConnector ()
 
- Protected Member Functions inherited from agxPowerLine::Connector
virtual ~Connector ()
 
virtual bool connect (agxPowerLine::Unit *inputUnit, agxPowerLine::Side inputUnitSide, agxPowerLine::Side outputUnitSide, agxPowerLine::Unit *outputUnit)
 
bool getUnits (UnitConstPtrSetVector &units, const ConnectionRefVector &connections, const bool startFromCleanUnitSet=true) const
 
bool getUnits (UnitPtrSetVector &units, ConnectionRefVector &connections, const bool startFromCleanUnitSet=true)
 
bool hasNonValidInputConnection () const
 
bool hasNonValidOutputConnection () const
 
void setRatio (agx::Real ratio)
 set/get the ratio (scaling of load through the constraint).
 
void setRatioDerivative (agx::Real ratioDerivative)
 
void uninitialize ()
 
- Protected Member Functions inherited from agxPowerLine::SubGraph
virtual ~SubGraph ()
 
void addInternalConnector (agxPowerLine::Connector *connector)
 
void addInternalUnit (agxPowerLine::Unit *unit)
 
void removeInternalConnector (agxPowerLine::Connector *connector)
 
void removeInternalUnit (agxPowerLine::Unit *unit)
 
agx::Bool replaceInternalUnit (agxPowerLine::Unit *oldUnit, agxPowerLine::Unit *newUnit)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agxPowerLine::Connector
PhysicalDimensionMultiBodyConstraintImplementationm_constraint
 
agx::Real m_damping
 
bool m_ignoreMeForStoreRestoreStream
 
ConnectionRefVector m_inputConnections
 
DimensionTypeVector m_inputTypes
 
int m_numPossibleInputs
 
int m_numPossibleOutputs
 
ConnectionRefVector m_outputConnections
 
DimensionTypeVector m_outputTypes
 
agx::Real m_ratio
 
agx::Real m_ratioDerivative
 
- Protected Attributes inherited from agxPowerLine::SubGraph
SubGraphObserver m_enclosingGraph
 
ConnectorRefVector m_internalConnectors
 
UnitRefVector m_internalUnits
 
agx::Name m_name
 
PowerLinem_powerLine
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

A FlowConnector is a junction of a set of FlowUnits.

The FlowConnector ensures that the sum of flows through the junction is close to zero, i.e., that no fluid is created or destroyed. Regularization in the constraints causes a small amount of fluid to either be stored in the junction or lost, so output flow rate is not always exactly equal to the input flow rate.

Definition at line 39 of file FlowConnector.h.

Constructor & Destructor Documentation

◆ FlowConnector()

agxHydraulics::FlowConnector::FlowConnector ( bool  holonomic = true)

A flow connector can either be holonomic or nonholonomic.

A holonomic FlowConnector tracks the total input and output flow and flexes in order to hold any stored fluid. A nonholonomic FlowConnector does not track the differences in flow rate. A higher input flow rate than output flow rate will produce a leak.

◆ ~FlowConnector()

virtual agxHydraulics::FlowConnector::~FlowConnector ( )
inlineprotectedvirtual

Definition at line 213 of file FlowConnector.h.

Member Function Documentation

◆ connect() [1/2]

virtual bool agxHydraulics::FlowConnector::connect ( agxPowerLine::Side  mySide,
agxPowerLine::Side  unitSide,
agxPowerLine::Unit unit 
)
overridevirtual

Connect the given unit to this FlowConnector.

If the given side already has a FlowConnector then that FlowConnector will be merged into 'this'. The old FlowConnector will be empty.

Reimplemented from agxPowerLine::Connector.

Reimplemented in agxHydraulics::detail::SpoolValveConnector.

◆ connect() [2/2]

virtual bool agxHydraulics::FlowConnector::connect ( agxPowerLine::Unit inputUnit,
agxPowerLine::Side  inputUnitSide,
agxPowerLine::Side  outputUnitSide,
agxPowerLine::Unit outputUnit 
)
overrideprotectedvirtual

Reimplemented from agxPowerLine::Connector.

◆ getCompliance()

agx::Real agxHydraulics::FlowConnector::getCompliance ( ) const
Returns
The compliance of the flow constraint.
See also
setCompliance

◆ getDamping()

agx::Real agxHydraulics::FlowConnector::getDamping ( ) const
Returns
The damping of the flow constraint.

◆ getDefaultCompliance()

static agx::Real agxHydraulics::FlowConnector::getDefaultCompliance ( )
static
Returns
The compliance that new FlowConnectors get upon creation.

◆ getDefaultDamping()

static agx::Real agxHydraulics::FlowConnector::getDefaultDamping ( )
static
Returns
The damping that new FlowConnectors get upon creation.

◆ getPressure()

virtual agx::Real agxHydraulics::FlowConnector::getPressure ( ) const
overridevirtual
Returns
The current pressure in the junction.

Implements agxHydraulics::PressureConnector.

◆ getStoredFluid()

agx::Real agxHydraulics::FlowConnector::getStoredFluid ( ) const

Only valid for holonomic FlowConnectors.

Returns
The amount of fluid currently stored in the junction.

◆ getVolumeExpansionPressureRatio()

agx::Real agxHydraulics::FlowConnector::getVolumeExpansionPressureRatio ( ) const

Alias for getCompliance().

◆ setCompliance()

void agxHydraulics::FlowConnector::setCompliance ( agx::Real  volumePerPressure)

Set the compliance of the flow constraint.

For a holonomic FlowConnector this controls the flexibility of the junction. A larger compliance causes the FlowConnector to hold more fluid for a given pressure. The unit is volume/pressure. At steady state the amount of fluid held by the junction is

volume = compliance * pressure

For a nonholonimc constraint the compliance controls the amount of leakage at the junction. A larger compliance causes the FlowConnector to leak more fluid for a given pressure. The unit is volume/time / pressure. At steady state the amount of fluid leaked by the junction is

volume / time = compliance * pressure

◆ setDamping()

void agxHydraulics::FlowConnector::setDamping ( agx::Real  damping)

Set the damping of the flow constraint.

Has no effect on nonholonomic FlowConnectors.

◆ setDefaultCompliance()

static void agxHydraulics::FlowConnector::setDefaultCompliance ( agx::Real  compliance)
static

Set the default compliance for new flow connectors.

This will only change the initial compliance for flow connectors created after the call to setDefaultCompliance. Flow connectors already created remain unchanged.

See also
FlowConnector::setCompliance(agx::Real)

◆ setDefaultDamping()

static void agxHydraulics::FlowConnector::setDefaultDamping ( agx::Real  damping)
static

Set the default damping for new flow connectors.

This will only change the initial damping for flow connectors created after the call to setDefaultDamping. Flow connectors already created remain unchanged.

See also
FlowConnector::setDamping(agx::Real)

◆ setVolumeExpansionPressureRatio()

void agxHydraulics::FlowConnector::setVolumeExpansionPressureRatio ( agx::Real  ratio)

The documentation for this class was generated from the following file: