OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Class representing user defined load time function. More...
#include <calculatorfunction.h>
Public Member Functions | |
CalculatorFunction (int n, Domain *d) | |
Constructor. More... | |
virtual | ~CalculatorFunction () |
Destructor. More... | |
virtual IRResultType | initializeFrom (InputRecord *ir) |
Reads the fields. More... | |
virtual void | giveInputRecord (DynamicInputRecord &ir) |
Setups the input record string of receiver. More... | |
virtual void | evaluate (FloatArray &answer, const std::map< std::string, FunctionArgument > &valDict) |
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... | |
virtual const char * | giveClassName () const |
virtual const char * | giveInputRecordName () const |
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... | |
Domain * | giveDomain () 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 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 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 Interface * | giveInterface (InterfaceType t) |
Interface requesting service. More... | |
std::string | errorInfo (const char *func) const |
Returns string for prepending output (used by error reporting macros). More... | |
Private Attributes | |
std::string | fExpression |
Expression for the function value. More... | |
std::string | dfdtExpression |
Expression for first time derivative. More... | |
std::string | d2fdt2Expression |
Expression for second time derivative. More... | |
Additional Inherited Members | |
Public Attributes inherited from oofem::Function | |
Domain * | funcDomain |
int | parameterType |
Protected Attributes inherited from oofem::FEMComponent | |
int | number |
Component number. More... | |
Domain * | domain |
Link to domain object, useful for communicating with other FEM components. More... | |
Class representing user defined load time function.
User input is function expression. Uses Parser class to parse given expression. Slow but useful. Load time function typically belongs to domain and is attribute of one or more loads. Generally load time function is real function of time ( ).
Definition at line 56 of file calculatorfunction.h.
oofem::CalculatorFunction::CalculatorFunction | ( | int | n, |
Domain * | d | ||
) |
Constructor.
Creates load time function with given number, belonging to given domain.
Definition at line 46 of file calculatorfunction.C.
|
inlinevirtual |
Destructor.
Definition at line 74 of file calculatorfunction.h.
|
virtual |
Definition at line 72 of file calculatorfunction.C.
References oofem::IntArray::at(), oofem::FloatArray::at(), oofem::Parser::eval(), oofem::FunctionArgument::FAT_double, oofem::FunctionArgument::FAT_FloatArray, oofem::FunctionArgument::FAT_int, oofem::FunctionArgument::FAT_IntArray, fExpression, oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), OOFEM_ERROR, oofem::FloatArray::resize(), oofem::FunctionArgument::type, oofem::FunctionArgument::val0, oofem::FunctionArgument::val1, oofem::FunctionArgument::val2, and oofem::FunctionArgument::val3.
|
virtual |
Returns the second time derivative of the function at given time.
t | Time. |
Implements oofem::Function.
Definition at line 141 of file calculatorfunction.C.
References d2fdt2Expression, oofem::Parser::eval(), and OOFEM_ERROR.
|
virtual |
Returns the value of the function at given time.
t | Time. |
Reimplemented from oofem::Function.
Definition at line 103 of file calculatorfunction.C.
References oofem::Parser::eval(), fExpression, and OOFEM_ERROR.
|
virtual |
Returns the first time derivative of the function at given time.
t | Time. |
Implements oofem::Function.
Definition at line 119 of file calculatorfunction.C.
References dfdtExpression, oofem::Parser::eval(), and OOFEM_ERROR.
|
inlinevirtual |
Implements oofem::FEMComponent.
Definition at line 90 of file calculatorfunction.h.
|
virtual |
Setups the input record string of receiver.
input | Dynamic input record to be filled by receiver. |
Reimplemented from oofem::FEMComponent.
Definition at line 62 of file calculatorfunction.C.
References _IFT_CalculatorFunction_d2fdt2, _IFT_CalculatorFunction_dfdt, _IFT_CalculatorFunction_f, d2fdt2Expression, dfdtExpression, fExpression, oofem::FEMComponent::giveInputRecord(), and oofem::DynamicInputRecord::setField().
|
inlinevirtual |
Implements oofem::FEMComponent.
Definition at line 91 of file calculatorfunction.h.
References _IFT_CalculatorFunction_Name.
|
virtual |
Reads the fields.
Reimplemented from oofem::FEMComponent.
Definition at line 49 of file calculatorfunction.C.
References _IFT_CalculatorFunction_d2fdt2, _IFT_CalculatorFunction_dfdt, _IFT_CalculatorFunction_f, d2fdt2Expression, dfdtExpression, fExpression, oofem::FEMComponent::initializeFrom(), IR_GIVE_FIELD, and IR_GIVE_OPTIONAL_FIELD.
|
private |
Expression for second time derivative.
Definition at line 64 of file calculatorfunction.h.
Referenced by evaluateAccelerationAtTime(), giveInputRecord(), and initializeFrom().
|
private |
Expression for first time derivative.
Definition at line 62 of file calculatorfunction.h.
Referenced by evaluateVelocityAtTime(), giveInputRecord(), and initializeFrom().
|
private |
Expression for the function value.
Definition at line 60 of file calculatorfunction.h.
Referenced by evaluate(), evaluateAtTime(), giveInputRecord(), and initializeFrom().