FEDEM Solver  R8.0
Source code of the dynamics solver
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
FFpCurve Class Reference

#include <FFpCurve.H>

Collaboration diagram for FFpCurve:
Collaboration graph
[legend]

Classes

struct  PointData
 

Public Types

enum  TimeOp {
  None , Min , Max , AMax ,
  Mean , RMS
}
 

Public Member Functions

 FFaEnumMapping (TimeOp)
 
 FFpCurve (size_t nSpatialPoints=1)
 
 FFpCurve (const FFpCurve &curve)
 
 ~FFpCurve ()
 
FFpCurveoperator= (const FFpCurve &)=delete
 
void clear ()
 
void resize (size_t nSpatialPoints)
 
void unref (bool clearReadOp=false)
 
bool initAxis (const FFaResultDescription &desc, const std::string &oper, int axis)
 
bool initAxes (const std::vector< FFaResultDescription > &xdesc, const std::vector< FFaResultDescription > &ydesc, const std::string &xOper, const std::string &yOper, const std::pair< double, double > &tRange, const std::string &tOper, short int end1)
 
int getSpatialXaxisObject (size_t i) const
 
const std::pair< double, double > & getTimeRange () const
 
bool notReadThisFar (double &lastStep) const
 
bool findVarRefsAndOpers (FFrExtractor *extractor, std::string &errMsg)
 
void printPosition (std::ostream &os) const
 
bool loadTemporalData (double currentTime)
 
bool loadSpatialData (double currentTime, const double epsT=0.0)
 
bool loadCurrentSpatialX ()
 
void finalizeTimeOp ()
 
bool usingInitialXaxis () const
 
bool loadFileData (const std::string &filePath, const std::string &channel, std::string &errMsg, double minX=0.0, double maxX=-1.0)
 
bool combineData (int ID, const std::string &expression, const std::vector< FFpCurve * > &compCurves, const char **compNames, bool clipXdomain, std::string &message)
 
bool replaceByScaledShifted (const DFTparams &dft)
 
bool replaceByDerivative ()
 
bool replaceByIntegral ()
 
bool replaceByDFT (const DFTparams &dft, const std::string &cId, std::string &errMsg)
 
bool replaceByRainflow (const RFprm &rf, double toMPa, bool doPVXonly, const std::string &cId, std::string &errMsg)
 
bool getCurveStatistics (bool entire, double start, double stop, bool useScaledShifted, const DFTparams &dft, double &rms, double &avg, double &stdDev, double &integral, double &min, double &max, std::string &errMsg) const
 
double getDamage (const RFprm &rf, double toMPa, const FFpSNCurve &sn)
 
bool empty () const
 
bool hasDataChanged () const
 
void onDataPlotted ()
 
void setDataChanged ()
 
std::vector< double > & operator[] (int axis)
 
const std::vector< double > & getAxisData (int ax) const
 
double getValue (double x, bool &monotonX) const
 
double getXrange () const
 
bool inDomain (double x) const
 
bool clipX (double Xmin, double Xmax)
 
bool checkAxesSize ()
 

Private Types

enum  { X = 0 , Y = 1 , N_AXES = 2 }
 

Private Member Functions

int numberOfSamples (double delta, double start, double stop) const
 
bool sample (double start, double stop, double shift, double scale, bool subMean, size_t n, std::vector< double > &yOut, std::string &errMsg) const
 
bool performRainflowCalc (const RFprm &rf, bool doPVXonly=false)
 
bool reversePoints ()
 

Private Attributes

std::vector< PointDatareader [N_AXES]
 
std::string * rdOper [N_AXES]
 
std::vector< double > points [N_AXES]
 
std::vector< FFpCycle > cycles
 
RFprm lastRF
 
double lastKey
 
double Xrange
 
size_t lastX
 
size_t timeSamples
 
std::pair< double, double > timeRange
 
TimeOp timeOper
 
bool useInitialXaxis
 
short int beamEndFlag
 
bool dataChanged
 
bool needRainflow
 

Friends

std::ostream & operator<< (std::ostream &os, const PointData &)
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
N_AXES 

◆ TimeOp

Enumerator
None 
Min 
Max 
AMax 
Mean 
RMS 

Constructor & Destructor Documentation

◆ FFpCurve() [1/2]

FFpCurve::FFpCurve ( size_t  nSpatialPoints = 1)
inline

◆ FFpCurve() [2/2]

FFpCurve::FFpCurve ( const FFpCurve curve)

The copy constructor only copies the curve data, not reader data.

◆ ~FFpCurve()

FFpCurve::~FFpCurve ( )

Member Function Documentation

◆ checkAxesSize()

bool FFpCurve::checkAxesSize ( )

◆ clear()

void FFpCurve::clear ( )

◆ clipX()

bool FFpCurve::clipX ( double  Xmin,
double  Xmax 
)

◆ combineData()

bool FFpCurve::combineData ( int  ID,
const std::string &  expression,
const std::vector< FFpCurve * > &  compCurves,
const char **  compNames,
bool  clipXdomain,
std::string &  message 
)

◆ empty()

bool FFpCurve::empty ( ) const
inline

◆ FFaEnumMapping()

FFpCurve::FFaEnumMapping ( TimeOp  )
inline

◆ finalizeTimeOp()

void FFpCurve::finalizeTimeOp ( )

◆ findVarRefsAndOpers()

bool FFpCurve::findVarRefsAndOpers ( FFrExtractor extractor,
std::string &  errMsg 
)

◆ getAxisData()

const std::vector<double>& FFpCurve::getAxisData ( int  ax) const
inline

◆ getCurveStatistics()

bool FFpCurve::getCurveStatistics ( bool  entire,
double  start,
double  stop,
bool  useScaledShifted,
const DFTparams dft,
double &  rms,
double &  avg,
double &  stdDev,
double &  integral,
double &  min,
double &  max,
std::string &  errMsg 
) const

Calculates statistical properties based on current curve data.

◆ getDamage()

double FFpCurve::getDamage ( const RFprm rf,
double  toMPa,
const FFpSNCurve &  sn 
)

Calculates the total damage based on the given S-N curve.

Note
The S-N curve is assumed to be given in [MPa], whereas the gateValue and the data of the curve itself are assumed to be in the current modelling units. toMPa defines the scaling factor from the modelling units to [MPa].

◆ getSpatialXaxisObject()

int FFpCurve::getSpatialXaxisObject ( size_t  i) const

◆ getTimeRange()

const std::pair<double,double>& FFpCurve::getTimeRange ( ) const
inline

◆ getValue()

double FFpCurve::getValue ( double  x,
bool &  monotonX 
) const

◆ getXrange()

double FFpCurve::getXrange ( ) const
inline

◆ hasDataChanged()

bool FFpCurve::hasDataChanged ( ) const
inline

◆ inDomain()

bool FFpCurve::inDomain ( double  x) const

◆ initAxes()

bool FFpCurve::initAxes ( const std::vector< FFaResultDescription > &  xdesc,
const std::vector< FFaResultDescription > &  ydesc,
const std::string &  xOper,
const std::string &  yOper,
const std::pair< double, double > &  tRange,
const std::string &  tOper,
short int  end1 
)

◆ initAxis()

bool FFpCurve::initAxis ( const FFaResultDescription desc,
const std::string &  oper,
int  axis 
)

◆ loadCurrentSpatialX()

bool FFpCurve::loadCurrentSpatialX ( )

◆ loadFileData()

bool FFpCurve::loadFileData ( const std::string &  filePath,
const std::string &  channel,
std::string &  errMsg,
double  minX = 0.0,
double  maxX = -1.0 
)

◆ loadSpatialData()

bool FFpCurve::loadSpatialData ( double  currentTime,
const double  epsT = 0.0 
)

◆ loadTemporalData()

bool FFpCurve::loadTemporalData ( double  currentTime)

◆ notReadThisFar()

bool FFpCurve::notReadThisFar ( double &  lastStep) const

◆ numberOfSamples()

int FFpCurve::numberOfSamples ( double  delta,
double  start,
double  stop 
) const
private

The DFT function needs to be able to factor the number of samples cleanly so that largest factor (i.e. prime) is smaller than its set largest prime. This is why we're massaging the number of samples a bit.

◆ onDataPlotted()

void FFpCurve::onDataPlotted ( )
inline

◆ operator=()

FFpCurve& FFpCurve::operator= ( const FFpCurve )
delete

◆ operator[]()

std::vector<double>& FFpCurve::operator[] ( int  axis)
inline

◆ performRainflowCalc()

bool FFpCurve::performRainflowCalc ( const RFprm rf,
bool  doPVXonly = false 
)
private

Performs peak valley extraction and rainflow counting on the curve point data.

◆ printPosition()

void FFpCurve::printPosition ( std::ostream &  os) const

◆ replaceByDerivative()

bool FFpCurve::replaceByDerivative ( )

◆ replaceByDFT()

bool FFpCurve::replaceByDFT ( const DFTparams dft,
const std::string &  cId,
std::string &  errMsg 
)

◆ replaceByIntegral()

bool FFpCurve::replaceByIntegral ( )

◆ replaceByRainflow()

bool FFpCurve::replaceByRainflow ( const RFprm rf,
double  toMPa,
bool  doPVXonly,
const std::string &  cId,
std::string &  errMsg 
)

◆ replaceByScaledShifted()

bool FFpCurve::replaceByScaledShifted ( const DFTparams dft)

◆ resize()

void FFpCurve::resize ( size_t  nSpatialPoints)

◆ reversePoints()

bool FFpCurve::reversePoints ( )
private

◆ sample()

bool FFpCurve::sample ( double  start,
double  stop,
double  shift,
double  scale,
bool  subMean,
size_t  n,
std::vector< double > &  yOut,
std::string &  errMsg 
) const
private

Between start and stop of domain in x, sample n times from y and put results in the yOut vector. Apply the given shift and scale to the sampled values. Also subtract sample mean from all sample values if so wanted. It is assumed that start is inside the span of the vector, and that the X-values are monotonically increasing.

◆ setDataChanged()

void FFpCurve::setDataChanged ( )

◆ unref()

void FFpCurve::unref ( bool  clearReadOp = false)

◆ usingInitialXaxis()

bool FFpCurve::usingInitialXaxis ( ) const
inline

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const PointData data 
)
friend

Member Data Documentation

◆ beamEndFlag

short int FFpCurve::beamEndFlag
private

◆ cycles

std::vector<FFpCycle> FFpCurve::cycles
private

◆ dataChanged

bool FFpCurve::dataChanged
private

◆ lastKey

double FFpCurve::lastKey
private

◆ lastRF

RFprm FFpCurve::lastRF
private

◆ lastX

size_t FFpCurve::lastX
mutableprivate

◆ needRainflow

bool FFpCurve::needRainflow
private

◆ points

std::vector<double> FFpCurve::points[N_AXES]
private

◆ rdOper

std::string* FFpCurve::rdOper[N_AXES]
private

◆ reader

std::vector<PointData> FFpCurve::reader[N_AXES]
private

◆ timeOper

TimeOp FFpCurve::timeOper
private

◆ timeRange

std::pair<double,double> FFpCurve::timeRange
private

◆ timeSamples

size_t FFpCurve::timeSamples
mutableprivate

◆ useInitialXaxis

bool FFpCurve::useInitialXaxis
private

◆ Xrange

double FFpCurve::Xrange
private

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