|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Base class for external device functions. More...
#include <FiDeviceFunctionBase.H>

Classes | |
| struct | AxisInfo |
| Convenience struct holding curve axis information. More... | |
Public Types | |
| enum | Endianness { LittleEndian , BigEndian } |
| Enumerator for endianness values. More... | |
| enum | FileFormat { ascii , binary } |
| Enumerator for the file formats. More... | |
| enum | FileStatus { Not_Loaded =-1 , Not_Open =0 , Read_Only =1 , Write_Only =2 } |
| Enumerator for file opening statuses. More... | |
| enum | InterpolationPolicy { Constant , Linear , Previous_Value , Next_Value } |
| Enumerator for interpolation and extrapolation policies. More... | |
Public Member Functions | |
| virtual | ~FiDeviceFunctionBase () |
| The destructor closes the device function file. More... | |
| bool | open (const char *devicename, FileStatus status=Read_Only) |
| Opens the specified device function file for reading or writing. More... | |
| bool | open (FileStatus status=Read_Only) |
| Opens the file myDatasetDevice for reading or writing. More... | |
| bool | close (bool noHeader=false) |
| Closes the device function file. More... | |
| const std::string & | getDevicename () const |
| Returns the myDatasetDevice of this device function. More... | |
| void | setExtrapolationPolicy (InterpolationPolicy policy=Constant) |
| Defines the extrapolation policy to be used. More... | |
| void | setInterpolationPolicy (InterpolationPolicy policy=Linear) |
| Defines the interpolation policy to be used. More... | |
| virtual size_t | getValueCount () const =0 |
| Returns the number of (x,y) pairs for this device. More... | |
| virtual void | getValueRange (double &mn, double &mx) const |
| Calculates the function value range for this device. More... | |
| virtual double | getXAxisOrigin () const |
| Returns the function argument origin for this device. More... | |
| virtual bool | getChannelList (Strings &) |
| Gets the list channel names for a multi-channel device. More... | |
| virtual bool | isChannelPresentInFile (int) |
| Checks if an indexed channel is present in the device. More... | |
| virtual int | isChannelPresentInFile (const std::string &) |
| Checks if a nameed channel is present in the device. More... | |
| virtual void | setTimeSpan (double) |
| Sets the maximum time span for the device function. More... | |
| virtual void | setPrecision (int) |
| Sets the precision to be used when writing the device to file. More... | |
| virtual double | getValue (double x, int channel=0, bool zeroAdjust=false, double vertShift=0.0, double scaleFac=1.0)=0 |
| Evaluates the function for a given x value. More... | |
| virtual bool | getValues (double x0, double x1, Doubles &x, Doubles &y, int channel, bool zeroAdjust=false, double shift=0.0, double scale=1.0)=0 |
| Evaluates the function at all points within specified interval. More... | |
| virtual void | getRawData (Doubles &x, Doubles &y, double minX, double maxX, int channel=0)=0 |
| Extracts all function data point values within specified interval. More... | |
| virtual void | getData (Doubles &x, Doubles &y, const std::string &, double minX=0.0, double maxX=-1.0) |
| Extracts all function data point values within specified interval. More... | |
| virtual void | setValue (double x, double y)=0 |
| Assigns a function value for a single-channel function. More... | |
| virtual bool | setData (const Doubles &x, const Doubles &y)=0 |
| Adds a complete set of x,y-pair values for a new channel. More... | |
| double | integrate (double x, int order=1, int channel=0, double vertShift=0.0, double scaleFac=1.0) |
| Computes the integral of this device over the interval [0,x]. More... | |
| int | getRefCount () const |
| Returns the current reference count for this device. More... | |
| int | ref () |
| Increments the reference count fir this device. More... | |
| int | unref () |
| Decrements the reference count for this device. More... | |
| double | getStep () const |
| returns the constant sampling time increment. More... | |
| double | getFrequency () const |
| returns the constant sampling frequency. More... | |
| void | setStep (double aStep) |
| Sets the sampling increment for devices with constant sampling. More... | |
| void | setFrequency (double aFreqency) |
| Sets the sampling frequency for devices with constant sampling. More... | |
| virtual void | setDescription (const std::string &) |
| Assigns a name to the (last) channel in the device. More... | |
| virtual void | setEmptyChannel (const std::string &) |
| Flags an empty channel for multi-channel devices. More... | |
| void | setParent (const std::string &modelfile) |
| Sets the model file name associated with this device. More... | |
| bool | isReadOnly () const |
| Returns whether this is a read-only device or not. More... | |
| FileStatus | getFileStatus () const |
| Returns the myFileStatus of this device function. More... | |
| void | getAxisUnit (int axis, char *unitText, size_t n) const |
| Gets the axis unit. More... | |
| void | getAxisTitle (int axis, char *titleText, size_t n) const |
| Gets the axis title. More... | |
| void | setAxisUnit (int axis, const char *unitText) |
| Sets the axis unit. More... | |
| void | setAxisTitle (int axis, const char *titleText) |
| Sets the axis title. More... | |
Protected Types | |
| using | Doubles = std::vector< double > |
| Convenience type alias. More... | |
| using | Strings = std::vector< std::string > |
| Convenience type alias. More... | |
Protected Member Functions | |
| FiDeviceFunctionBase (const char *devicename=NULL) | |
| The default constructor initialize the data members. More... | |
| FiDeviceFunctionBase (const FiDeviceFunctionBase &)=delete | |
| Deleted copy constructor. More... | |
| FiDeviceFunctionBase & | operator= (const FiDeviceFunctionBase &)=delete |
| Deleted assignment operator. More... | |
| double | interpolate (double x, double x0, double f0, double x1, double f1) const |
| Calculates the function value at x by interpolation. More... | |
| double | extrapolate (double x, double x0, double f0, double x1, double f1) const |
| Calculates the function value at x by extrapolation. More... | |
| bool | writeString (const char *str) |
| Convenience method for a writing text header. More... | |
| bool | writeString (const char *lab, const std::string &val) |
| Convenience method for writing text headers. More... | |
| virtual bool | initialDeviceRead ()=0 |
| Reads the file content, or at least its meta data. More... | |
| virtual bool | preliminaryDeviceWrite ()=0 |
| Writes the meta data for this device function to file. More... | |
| virtual bool | concludingDeviceWrite (bool noHeader=false)=0 |
| Writes the content of this device function to file. More... | |
Protected Attributes | |
| FT_FILE | myFile |
| File handle of this device function. More... | |
| std::string | myParent |
| Name of FEDEM model that owns this function. More... | |
| std::string | myDatasetDevice |
| Name of file associated with myFile. More... | |
| Endianness | myOutputEndian |
| Endianness assumed for binary output. More... | |
| Endianness | myInputEndian |
| Endianness assumed for binary input. More... | |
| double | myStep |
| Time series information. More... | |
| std::array< AxisInfo, 2 > | myAxisInfo |
Static Protected Attributes | |
| static Endianness | myMachineEndian |
| Endianness for the running computer. More... | |
Private Attributes | |
| FileStatus | myFileStatus |
| Current file status after opening, etc. More... | |
| std::array< InterpolationPolicy, 2 > | myInterpolationPolicy |
| Options for interpolation and extrapolation of curve data. More... | |
| Doubles | Xval |
| Function argument values, used for integration. More... | |
| Doubles | Yval |
| The function values associated with Xval. More... | |
| int | myRefCount |
| Used for reference counting. More... | |
Base class for external device functions.
|
protected |
Convenience type alias.
|
protected |
Convenience type alias.
|
explicitprotected |
The default constructor initialize the data members.
|
protecteddelete |
Deleted copy constructor.
|
inlinevirtual |
The destructor closes the device function file.
| bool FiDeviceFunctionBase::close | ( | bool | noHeader = false | ) |
Closes the device function file.
If the file is Write_Only, the content is flushed to disk first.
|
protectedpure virtual |
Writes the content of this device function to file.
Implemented in FiRPC3File, FiDACFile, FiCurveASCFile, and FiASCFile.
|
protected |
Calculates the function value at x by extrapolation.
| void FiDeviceFunctionBase::getAxisTitle | ( | int | axis, |
| char * | titleText, | ||
| size_t | n | ||
| ) | const |
Gets the axis title.
| void FiDeviceFunctionBase::getAxisUnit | ( | int | axis, |
| char * | unitText, | ||
| size_t | n | ||
| ) | const |
Gets the axis unit.
|
inlinevirtual |
Gets the list channel names for a multi-channel device.
Reimplemented in FiRPC3File, and FiASCFile.
|
inlinevirtual |
Extracts all function data point values within specified interval.
Reimplemented in FiRPC3File, and FiASCFile.
|
inline |
Returns the myDatasetDevice of this device function.
|
inline |
Returns the myFileStatus of this device function.
|
inline |
returns the constant sampling frequency.
|
pure virtual |
Extracts all function data point values within specified interval.
Implemented in FiCurveASCFile, FiDACFile, FiRPC3File, and FiASCFile.
|
inline |
Returns the current reference count for this device.
|
inline |
returns the constant sampling time increment.
|
pure virtual |
Evaluates the function for a given x value.
Implemented in FiCurveASCFile, FiDACFile, FiRPC3File, and FiASCFile.
|
pure virtual |
Returns the number of (x,y) pairs for this device.
Implemented in FiRPC3File, FiDACFile, FiCurveASCFile, and FiASCFile.
|
inlinevirtual |
Calculates the function value range for this device.
Reimplemented in FiRPC3File, and FiDACFile.
|
pure virtual |
Evaluates the function at all points within specified interval.
Implemented in FiCurveASCFile, FiRPC3File, FiDACFile, and FiASCFile.
|
inlinevirtual |
Returns the function argument origin for this device.
Reimplemented in FiDACFile.
|
protectedpure virtual |
Reads the file content, or at least its meta data.
Implemented in FiRPC3File, FiDACFile, FiCurveASCFile, and FiASCFile.
| double FiDeviceFunctionBase::integrate | ( | double | x, |
| int | order = 1, |
||
| int | channel = 0, |
||
| double | vertShift = 0.0, |
||
| double | scaleFac = 1.0 |
||
| ) |
Computes the integral of this device over the interval [0,x].
|
protected |
Calculates the function value at x by interpolation.
|
inlinevirtual |
Checks if a nameed channel is present in the device.
Reimplemented in FiRPC3File, and FiASCFile.
|
inlinevirtual |
Checks if an indexed channel is present in the device.
Reimplemented in FiRPC3File, and FiASCFile.
|
inline |
Returns whether this is a read-only device or not.
| bool FiDeviceFunctionBase::open | ( | const char * | devicename, |
| FileStatus | status = Read_Only |
||
| ) |
Opens the specified device function file for reading or writing.
|
inline |
Opens the file myDatasetDevice for reading or writing.
|
protecteddelete |
Deleted assignment operator.
|
protectedpure virtual |
Writes the meta data for this device function to file.
Implemented in FiRPC3File, FiDACFile, FiCurveASCFile, and FiASCFile.
|
inline |
Increments the reference count fir this device.
| void FiDeviceFunctionBase::setAxisTitle | ( | int | axis, |
| const char * | titleText | ||
| ) |
Sets the axis title.
| void FiDeviceFunctionBase::setAxisUnit | ( | int | axis, |
| const char * | unitText | ||
| ) |
Sets the axis unit.
Adds a complete set of x,y-pair values for a new channel.
Implemented in FiRPC3File, FiDACFile, FiCurveASCFile, and FiASCFile.
|
inlinevirtual |
Assigns a name to the (last) channel in the device.
Reimplemented in FiRPC3File, and FiASCFile.
|
inlinevirtual |
Flags an empty channel for multi-channel devices.
Reimplemented in FiASCFile.
|
inline |
Defines the extrapolation policy to be used.
|
inline |
Sets the sampling frequency for devices with constant sampling.
|
inline |
Defines the interpolation policy to be used.
|
inline |
Sets the model file name associated with this device.
|
inlinevirtual |
Sets the precision to be used when writing the device to file.
Reimplemented in FiRPC3File, FiCurveASCFile, and FiASCFile.
|
inline |
Sets the sampling increment for devices with constant sampling.
|
inlinevirtual |
Sets the maximum time span for the device function.
Reimplemented in FiRPC3File.
|
pure virtual |
Assigns a function value for a single-channel function.
Implemented in FiRPC3File, FiDACFile, FiCurveASCFile, and FiASCFile.
| int FiDeviceFunctionBase::unref | ( | ) |
Decrements the reference count for this device.
If the reference count reaches zero the device is deleted.
|
protected |
Convenience method for writing text headers.
|
protected |
Convenience method for a writing text header.
|
protected |
|
protected |
Name of file associated with myFile.
|
protected |
File handle of this device function.
|
private |
Current file status after opening, etc.
|
protected |
Endianness assumed for binary input.
|
private |
Options for interpolation and extrapolation of curve data.
|
staticprotected |
Endianness for the running computer.
|
protected |
Endianness assumed for binary output.
|
protected |
Name of FEDEM model that owns this function.
|
private |
Used for reference counting.
|
protected |
Time series information.
|
private |
Function argument values, used for integration.