OOFEM 3.0
Loading...
Searching...
No Matches
oofem::Function Class Referenceabstract

#include <function.h>

Inheritance diagram for oofem::Function:
Collaboration diagram for oofem::Function:

Public Member Functions

 Function (int n, Domain *d)
virtual ~Function ()
 Destructor.
virtual double evaluate (TimeStep *tStep, ValueModeType mode)
virtual void evaluate (FloatArray &answer, const std ::map< std ::string, FunctionArgument > &valDict, GaussPoint *gp=nullptr, double param=0.)
virtual double evaluate (const std ::map< std ::string, FunctionArgument > &valDict)
virtual double evaluateAtTime (double t)
virtual double evaluateVelocityAtTime (double t)=0
virtual double evaluateAccelerationAtTime (double t)=0
double giveFunctionParameter (int paramID)
void saveContext (DataStream &stream, ContextMode mode) override
void restoreContext (DataStream &stream, ContextMode mode) override
Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
virtual ~FEMComponent ()=default
 Virtual destructor.
virtual const char * giveClassName () const =0
virtual const char * giveInputRecordName () const =0
DomaingiveDomain () const
virtual void setDomain (Domain *d)
int giveNumber () const
void setNumber (int num)
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
virtual void initializeFrom (InputRecord &ir)
virtual void initializeFrom (InputRecord &ir, int priority)
virtual void initializeFinish ()
virtual void postInitialize ()
 Performs post initialization steps. Called after all components are created and initialized.
virtual void giveInputRecord (DynamicInputRecord &input)
virtual int checkConsistency ()
virtual void printOutputAt (FILE *file, TimeStep *tStep)
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging.
virtual InterfacegiveInterface (InterfaceType t)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Public Attributes

DomainfuncDomain
int parameterType

Additional Inherited Members

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

Detailed Description

Abstract base class representing a function with vector input and output. It is useful in many scenarios, in particular describing the load/b.c. amplitude in time.

Definition at line 90 of file function.h.

Constructor & Destructor Documentation

◆ Function()

◆ ~Function()

virtual oofem::Function::~Function ( )
inlinevirtual

Destructor.

Definition at line 103 of file function.h.

Member Function Documentation

◆ evaluate() [1/3]

double oofem::Function::evaluate ( const std ::map< std ::string, FunctionArgument > & valDict)
virtual

Returns the (scalar) value of the function for given input.

Parameters
valDictMap with inputs.
Returns
Function value.

Definition at line 111 of file function.C.

References evaluate(), oofem::FloatArray::giveSize(), and OOFEM_ERROR.

◆ evaluate() [2/3]

void oofem::Function::evaluate ( FloatArray & answer,
const std ::map< std ::string, FunctionArgument > & valDict,
GaussPoint * gp = nullptr,
double param = 0. )
virtual

Returns the value of the function for given input.

Parameters
valDictMap with inputs.
answerFunction value.

Reimplemented in oofem::CalculatorFunction, oofem::ConstantFunction, oofem::InterpolatingFuction, oofem::LocalGaussianRandomFunction, and oofem::PythonExpression.

Definition at line 90 of file function.C.

References evaluateAtTime(), OOFEM_ERROR, parameterType, and oofem::Vec1().

◆ evaluate() [3/3]

double oofem::Function::evaluate ( TimeStep * tStep,
ValueModeType mode )
virtual

Returns the value of load time function at given time. Abstract service. Must be implemented by derived classes.

Parameters
tStepTime. Incremental and total mode uses intrinsic time from giveIntrinsicTime.
modeDetermines the mode of the requested value.
Returns
Load time function value.

Reimplemented in oofem::PulseFunction.

Definition at line 57 of file function.C.

References evaluateAccelerationAtTime(), evaluateAtTime(), evaluateVelocityAtTime(), oofem::TimeStep::giveIntrinsicTime(), oofem::TimeStep::giveTimeIncrement(), and OOFEM_ERROR.

Referenced by oofem::RandomMaterialExtensionInterface::_generateStatusVariables(), oofem::UsrDefBoundaryLoad::computeValueAt(), oofem::ScalarFunction::eval(), evaluate(), evaluateAtTime(), and oofem::GnuplotExportModule::outputBoundaryCondition().

◆ evaluateAccelerationAtTime()

virtual double oofem::Function::evaluateAccelerationAtTime ( double t)
pure virtual

◆ evaluateAtTime()

◆ evaluateVelocityAtTime()

virtual double oofem::Function::evaluateVelocityAtTime ( double t)
pure virtual

◆ giveFunctionParameter()

double oofem::Function::giveFunctionParameter ( int paramID)

◆ restoreContext()

void oofem::Function::restoreContext ( DataStream & stream,
ContextMode mode )
overridevirtual

Restores the receiver state previously written in stream.

See also
saveContext
Parameters
streamInput stream.
modeDetermines amount of info available in stream (state, definition, ...).
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::FEMComponent.

Reimplemented in oofem::PiecewiseLinFunction, and oofem::StepFunction.

Definition at line 135 of file function.C.

References oofem::CIO_IOERR, CM_Definition, parameterType, oofem::DataStream::read(), and THROW_CIOERR.

Referenced by evaluateAccelerationAtTime().

◆ saveContext()

void oofem::Function::saveContext ( DataStream & stream,
ContextMode mode )
overridevirtual

Stores receiver state to output stream.

Parameters
streamOutput stream.
modeDetermines amount of info required in stream (state, definition, ...).
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::FEMComponent.

Reimplemented in oofem::PiecewiseLinFunction, and oofem::StepFunction.

Definition at line 122 of file function.C.

References oofem::CIO_IOERR, CM_Definition, parameterType, THROW_CIOERR, and oofem::DataStream::write().

Referenced by evaluateAccelerationAtTime().

Member Data Documentation

◆ funcDomain

Domain* oofem::Function::funcDomain

Definition at line 93 of file function.h.

◆ parameterType

int oofem::Function::parameterType

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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011