OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::PiecewiseLinFunction Class Reference

This class implements a piecewise linear function. More...

#include <piecewiselinfunction.h>

+ Inheritance diagram for oofem::PiecewiseLinFunction:
+ Collaboration diagram for oofem::PiecewiseLinFunction:

Public Member Functions

 PiecewiseLinFunction (int i, Domain *d)
 
virtual ~PiecewiseLinFunction ()
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description stored in input record. More...
 
virtual void giveInputRecord (DynamicInputRecord &input)
 Setups the input record string of receiver. More...
 
virtual const char * giveClassName () const
 
virtual const char * giveInputRecordName () const
 
virtual contextIOResultType saveContext (DataStream &stream, ContextMode mode, void *obj=NULL)
 Stores receiver state to output stream. More...
 
virtual contextIOResultType restoreContext (DataStream &stream, ContextMode mode, void *obj=NULL)
 Restores the receiver state previously written in stream. More...
 
virtual double evaluateAtTime (double t)
 Returns the value of the function at given time. More...
 
virtual double evaluateVelocityAtTime (double t)
 Returns the first time derivative of the function at given time. More...
 
virtual double evaluateAccelerationAtTime (double t)
 Returns the second time derivative of the function at given time. More...
 
- Public Member Functions inherited from oofem::Function
 Function (int n, Domain *d)
 Constructor. More...
 
virtual ~Function ()
 Destructor. More...
 
double evaluate (TimeStep *tStep, ValueModeType mode)
 Returns the value of load time function at given time. More...
 
virtual void evaluate (FloatArray &answer, const std::map< std::string, FunctionArgument > &valDict, GaussPoint *gp=NULL, double param=0.)
 Returns the value of the function for given input. More...
 
virtual double evaluate (const std::map< std::string, FunctionArgument > &valDict)
 Returns the (scalar) value of the function for given input. More...
 
double giveFunctionParameter (int paramID)
 
- Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
 Regular constructor, creates component with given number and belonging to given domain. More...
 
virtual ~FEMComponent ()
 Virtual destructor. More...
 
DomaingiveDomain () const
 
virtual void setDomain (Domain *d)
 Sets associated Domain. More...
 
int giveNumber () const
 
void setNumber (int num)
 Sets number of receiver. More...
 
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
 Local renumbering support. More...
 
virtual int checkConsistency ()
 Allows programmer to test some internal data, before computation begins. More...
 
virtual void printOutputAt (FILE *file, TimeStep *tStep)
 Prints output of receiver to stream, for given time step. More...
 
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging. More...
 
virtual InterfacegiveInterface (InterfaceType t)
 Interface requesting service. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Protected Attributes

FloatArray dates
 
FloatArray values
 
- Protected Attributes inherited from oofem::FEMComponent
int number
 Component number. More...
 
Domaindomain
 Link to domain object, useful for communicating with other FEM components. More...
 

Additional Inherited Members

- Public Attributes inherited from oofem::Function
DomainfuncDomain
 
int parameterType
 

Detailed Description

This class implements a piecewise linear function.

The function is defined by 'numberOfPoints' points. 'dates' and 'values' store respectively the abscissas (t) and the values (f(t)) of the points

Definition at line 55 of file piecewiselinfunction.h.

Constructor & Destructor Documentation

oofem::PiecewiseLinFunction::PiecewiseLinFunction ( int  i,
Domain d 
)

Definition at line 48 of file piecewiselinfunction.C.

virtual oofem::PiecewiseLinFunction::~PiecewiseLinFunction ( )
inlinevirtual

Definition at line 63 of file piecewiselinfunction.h.

Member Function Documentation

virtual double oofem::PiecewiseLinFunction::evaluateAccelerationAtTime ( double  t)
inlinevirtual

Returns the second time derivative of the function at given time.

Parameters
tTime.
Returns
$ f''(t) $.

Implements oofem::Function.

Reimplemented in oofem::PeriodicPiecewiseLinFunction.

Definition at line 75 of file piecewiselinfunction.h.

double oofem::PiecewiseLinFunction::evaluateAtTime ( double  t)
virtual

Returns the value of the function at given time.

Parameters
tTime.
Returns
$ f(t) $.

Reimplemented from oofem::Function.

Reimplemented in oofem::PeriodicPiecewiseLinFunction.

Definition at line 51 of file piecewiselinfunction.C.

References oofem::FloatArray::at(), dates, oofem::FloatArray::giveSize(), OOFEM_ERROR, OOFEM_WARNING, PiecewiseLinFunction_PRECISION, and values.

Referenced by oofem::PeriodicPiecewiseLinFunction::evaluateAtTime().

double oofem::PiecewiseLinFunction::evaluateVelocityAtTime ( double  t)
virtual

Returns the first time derivative of the function at given time.

Parameters
tTime.
Returns
$ f'(t) $.

Implements oofem::Function.

Reimplemented in oofem::PeriodicPiecewiseLinFunction.

Definition at line 85 of file piecewiselinfunction.C.

References oofem::FloatArray::at(), dates, oofem::FloatArray::giveSize(), OOFEM_ERROR, PiecewiseLinFunction_PRECISION, and values.

Referenced by oofem::PeriodicPiecewiseLinFunction::evaluateVelocityAtTime().

virtual const char* oofem::PiecewiseLinFunction::giveClassName ( ) const
inlinevirtual
Returns
Class name of the receiver.

Implements oofem::FEMComponent.

Reimplemented in oofem::PeriodicPiecewiseLinFunction.

Definition at line 67 of file piecewiselinfunction.h.

void oofem::PiecewiseLinFunction::giveInputRecord ( DynamicInputRecord input)
virtual

Setups the input record string of receiver.

Parameters
inputDynamic input record to be filled by receiver.

Reimplemented from oofem::FEMComponent.

Reimplemented in oofem::PeriodicPiecewiseLinFunction.

Definition at line 172 of file piecewiselinfunction.C.

References _IFT_PiecewiseLinFunction_ft, _IFT_PiecewiseLinFunction_t, dates, oofem::FEMComponent::giveInputRecord(), oofem::DynamicInputRecord::setField(), and values.

Referenced by oofem::PeriodicPiecewiseLinFunction::giveInputRecord().

virtual const char* oofem::PiecewiseLinFunction::giveInputRecordName ( ) const
inlinevirtual
Returns
Input record name of the receiver.

Implements oofem::FEMComponent.

Reimplemented in oofem::PeriodicPiecewiseLinFunction.

Definition at line 68 of file piecewiselinfunction.h.

References _IFT_PiecewiseLinFunction_Name.

IRResultType oofem::PiecewiseLinFunction::initializeFrom ( InputRecord ir)
virtual

Initializes receiver according to object description stored in input record.

This function is called immediately after creating object using constructor. Input record can be imagined as data record in component database belonging to receiver. Receiver may use value-name extracting functions to extract particular field from record.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
Returns
IRResultType

Reimplemented from oofem::FEMComponent.

Reimplemented in oofem::PeriodicPiecewiseLinFunction.

Definition at line 122 of file piecewiselinfunction.C.

References _IFT_PiecewiseLinFunction_dataFile, _IFT_PiecewiseLinFunction_ft, _IFT_PiecewiseLinFunction_t, oofem::FloatArray::at(), dates, oofem::InputRecord::hasField(), oofem::FEMComponent::initializeFrom(), IR_GIVE_FIELD, IR_GIVE_OPTIONAL_FIELD, OOFEM_ERROR, oofem::Function::parameterType, oofem::FloatArray::resize(), and values.

Referenced by oofem::PeriodicPiecewiseLinFunction::initializeFrom().

contextIOResultType oofem::PiecewiseLinFunction::restoreContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual

Restores the receiver state previously written in stream.

See also
saveContext
Parameters
streamInput stream.
modeDetermines amount of info available in stream (state, definition, ...).
objSpecial parameter for sending extra information.
Returns
contextIOResultType.
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::FEMComponent.

Definition at line 194 of file piecewiselinfunction.C.

References oofem::CIO_OK, CM_Definition, dates, oofem::FloatArray::restoreYourself(), and values.

contextIOResultType oofem::PiecewiseLinFunction::saveContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual

Stores receiver state to output stream.

Parameters
streamOutput stream.
modeDetermines amount of info required in stream (state, definition, ...).
objSpecial parameter, used only to send particular integration point to material class version of this method.
Returns
contextIOResultType.
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::FEMComponent.

Definition at line 182 of file piecewiselinfunction.C.

References oofem::CIO_OK, CM_Definition, dates, oofem::FloatArray::storeYourself(), and values.

Member Data Documentation

FloatArray oofem::PiecewiseLinFunction::values
protected

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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:39 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011