Run-time selectable general function of one variable. More...
Public Types | |
typedef Type | returnType |
Public Member Functions | |
TypeName ("Function1") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, Function1, dictionary,(const word &name, const Function1s::unitConversions &units, const dictionary &dict),(name, units, dict)) | |
declareRunTimeSelectionTable (autoPtr, Function1, Istream,(const word &name, const Function1s::unitConversions &units, Istream &is),(name, units, is)) | |
Function1 (const word &name) | |
Construct from name. More... | |
Function1 (const Function1< Type > &f1) | |
Copy constructor. More... | |
virtual tmp< Function1< Type > > | clone () const =0 |
Construct and return a clone. More... | |
virtual | ~Function1 () |
Destructor. More... | |
const word & | name () const |
Return the name of the entry. More... | |
virtual Type | value (const scalar x) const =0 |
Return value as a function of scalar x. More... | |
virtual tmp< Field< Type > > | value (const scalarField &x) const =0 |
Return value as a function of a scalar field x. More... | |
virtual Type | integral (const scalar x1, const scalar x2) const =0 |
Integrate between two scalars. More... | |
virtual tmp< Field< Type > > | integral (const scalarField &x1, const scalarField &x2) const =0 |
Integrate between two scalar fields. More... | |
virtual bool | constant () const |
Is this function guaranteed to be constant? More... | |
virtual void | write (Ostream &os, const Function1s::unitConversions &) const =0 |
Write data to dictionary stream. More... | |
void | operator= (const Function1< Type > &) |
Assignment. More... | |
Public Member Functions inherited from refCount | |
int | count () const |
Return the current reference count. More... | |
bool | unique () const |
Return true if the reference count is zero. More... | |
void | operator++ () |
Increment the reference count. More... | |
void | operator++ (int) |
Increment the reference count. More... | |
void | operator-- () |
Decrement the reference count. More... | |
void | operator-- (int) |
Decrement the reference count. More... | |
void | operator= (const refCount &)=delete |
Disallow bitwise assignment. More... | |
Static Public Member Functions | |
static autoPtr< Function1< Type > > | New (const word &name, const Function1s::unitConversions &units, const dictionary &dict) |
Select from dictionary. More... | |
static autoPtr< Function1< Type > > | New (const word &name, const unitConversion &xUnits, const unitConversion &valueUnits, const dictionary &dict) |
Select from dictionary. More... | |
static autoPtr< Function1< Type > > | New (const word &name, const Function1s::unitConversions &units, const word &Function1Type, Istream &is) |
Select from Istream. More... | |
static autoPtr< Function1< Type > > | New (const word &name, const unitConversion &xUnits, const unitConversion &valueUnits, const word &Function1Type, Istream &is) |
Select from Istream. More... | |
Protected Attributes | |
const word | name_ |
Name of entry. More... | |
Friends | |
Ostream & | operator (Ostream &os, const Function1< Type > &func) |
Ostream Operator. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from refCount | |
refCount () | |
Construct null initialising count to 0. More... | |
refCount (const refCount &)=delete | |
Disallow copy. More... | |
Run-time selectable general function of one variable.
Macros for creating standard Function1-s.
with many options provided from simple constant values to complex functions, interpolated tabulated data etc. etc.
Definition at line 122 of file Function1.H.
typedef Type returnType |
Definition at line 137 of file Function1.H.
Construct from name.
Definition at line 31 of file Function1.C.
Copy constructor.
Definition at line 38 of file Function1.C.
|
virtual |
Destructor.
Definition at line 66 of file Function1.C.
TypeName | ( | "Function1< Type >" | ) |
Runtime type information.
declareRunTimeSelectionTable | ( | autoPtr | , |
Function1< Type > | , | ||
dictionary | , | ||
(const word &name, const Function1s::unitConversions &units, const dictionary &dict) | , | ||
(name, units, dict) | |||
) |
declareRunTimeSelectionTable | ( | autoPtr | , |
Function1< Type > | , | ||
Istream | , | ||
(const word &name, const Function1s::unitConversions &units, Istream &is) | , | ||
(name, units, is) | |||
) |
Construct and return a clone.
Implemented in NSRDS7, NSRDS6, NSRDS5, NSRDS4, NSRDS3, NSRDS2, NSRDS14, NSRDS1, NSRDS0, Uniform< Type >, FieldFunction1< Type, Function1Type >, FieldFunction1< Type, Scale< Type > >, FieldFunction1< scalar, NSRDS2 >, FieldFunction1< Type, Constant< Type > >, FieldFunction1< Type, UniformTable< Type > >, FieldFunction1< scalar, NSRDS3 >, FieldFunction1< Type, Table< Type > >, FieldFunction1< Type, NonUniformTable< Type > >, FieldFunction1< scalar, NSRDS0 >, FieldFunction1< scalar, Function1Type >, FieldFunction1< Type, None< Type > >, FieldFunction1< scalar, NSRDS1 >, FieldFunction1< Type, OneConstant< Type > >, FieldFunction1< Type, Square< Type > >, FieldFunction1< scalar, laminarBL >, FieldFunction1< Type, Polynomial< Type > >, FieldFunction1< scalar, squarePulse >, FieldFunction1< scalar, NSRDS6 >, FieldFunction1< scalar, turbulentBL >, FieldFunction1< Type, ZeroConstant< Type > >, FieldFunction1< scalar, NSRDS7 >, FieldFunction1< scalar, NSRDS4 >, FieldFunction1< scalar, NSRDS14 >, FieldFunction1< Type, Sine< Type > >, FieldFunction1< scalar, NSRDS5 >, Constant< Type >, Coded< Type >, and crankConnectingRodMotion.
|
static |
Select from dictionary.
Definition at line 31 of file Function1New.C.
References dict, Foam::endl(), IOstream::eof(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, IOWarningInFunction, token::isWord(), dictionary::lookup(), Foam::name(), Foam::compressible::New(), Foam::nl, Istream::putBack(), and Foam::units().
Referenced by CrankNicolsonDdtScheme< Type >::CrankNicolsonDdtScheme(), fanPressureJumpFvPatchScalarField::fanPressureJumpFvPatchScalarField(), flowRateInletVelocityFvPatchVectorField::flowRateInletVelocityFvPatchVectorField(), flowRateOutletVelocityFvPatchVectorField::flowRateOutletVelocityFvPatchVectorField(), Function12< Type >::Function12(), pressureInletOutletVelocityFvPatchVectorField::pressureInletOutletVelocityFvPatchVectorField(), ProductFunction1s< Type, rank >::ProductFunction1s(), ProductFunction1s< Type, 0 >::ProductFunction1s(), fluidMaxDeltaT::read(), movingForces::read(), setTimeStepFunctionObject::read(), setWriteIntervalFunctionObject::read(), externalForce::read(), axialAngularSpring::read(), strainRateFunction::read(), forcing::readCoeffs(), temperatureDependent::readDict(), rigidBodyMeshMotion::rigidBodyMeshMotion(), rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver(), swirlFlowRateInletVelocityFvPatchVectorField::swirlFlowRateInletVelocityFvPatchVectorField(), timeVaryingMappedFixedValuePointPatchField< Type >::timeVaryingMappedFixedValuePointPatchField(), timeVaryingMappedFvPatchField< Type >::timeVaryingMappedFvPatchField(), and uniformJumpFvPatchField< Type >::uniformJumpFvPatchField().
|
static |
Select from dictionary.
Definition at line 121 of file Function1New.C.
References dict, Foam::name(), and Foam::compressible::New().
|
static |
Select from Istream.
Definition at line 134 of file Function1New.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::name(), Foam::nl, and Foam::units().
|
static |
Select from Istream.
Definition at line 178 of file Function1New.C.
References Foam::name(), and Foam::compressible::New().
const Foam::word & name |
Return the name of the entry.
Definition at line 78 of file Function1.C.
Referenced by NonUniformTable< Type >::NonUniformTable(), Polynomial< Type >::Polynomial(), and Foam::writeEntry().
|
pure virtual |
Return value as a function of scalar x.
Implemented in UniformTable< Type >, NonUniformTable< Type >, NonUniformTable< scalar >, NSRDS7, NSRDS6, NSRDS5, NSRDS4, NSRDS3, NSRDS2, NSRDS14, NSRDS1, NSRDS0, ZeroConstant< Type >, OneConstant< Type >, Constant< Type >, FieldFunction1< Type, Scale< Type > >, FieldFunction1< scalar, NSRDS2 >, FieldFunction1< Type, Constant< Type > >, FieldFunction1< Type, UniformTable< Type > >, FieldFunction1< scalar, NSRDS3 >, FieldFunction1< Type, Table< Type > >, FieldFunction1< Type, NonUniformTable< Type > >, FieldFunction1< scalar, NSRDS0 >, FieldFunction1< scalar, Function1Type >, FieldFunction1< Type, None< Type > >, FieldFunction1< scalar, NSRDS1 >, FieldFunction1< Type, OneConstant< Type > >, FieldFunction1< Type, Square< Type > >, FieldFunction1< scalar, laminarBL >, FieldFunction1< Type, Polynomial< Type > >, FieldFunction1< scalar, squarePulse >, FieldFunction1< scalar, NSRDS6 >, FieldFunction1< scalar, turbulentBL >, FieldFunction1< Type, ZeroConstant< Type > >, FieldFunction1< scalar, NSRDS7 >, FieldFunction1< scalar, NSRDS4 >, FieldFunction1< scalar, NSRDS14 >, FieldFunction1< Type, Sine< Type > >, FieldFunction1< scalar, NSRDS5 >, FieldFunction1< Type, Function1Type >, Table< Type >, Table< scalar >, Square< Type >, Sine< Type >, Scale< Type >, Polynomial< Type >, None< Type >, Coded< Type >, crankConnectingRodMotion, Ramp< reverseRamp >, Ramp< quarterSineRamp >, Ramp< halfCosineRamp >, Ramp< quarterCosineRamp >, Ramp< exponentialSqrRamp >, Ramp< quadraticRamp >, Ramp< linearRamp >, Ramp< Function1Type >, squarePulse, reverseRamp, quarterSineRamp, quarterCosineRamp, quadraticRamp, linearRamp, halfCosineRamp, exponentialSqrRamp, turbulentBL, and laminarBL.
|
pure virtual |
Return value as a function of a scalar field x.
Implemented in FieldFunction1< Type, Function1Type >, FieldFunction1< Type, Scale< Type > >, FieldFunction1< scalar, NSRDS2 >, FieldFunction1< Type, Constant< Type > >, FieldFunction1< Type, UniformTable< Type > >, FieldFunction1< scalar, NSRDS3 >, FieldFunction1< Type, Table< Type > >, FieldFunction1< Type, NonUniformTable< Type > >, FieldFunction1< scalar, NSRDS0 >, FieldFunction1< scalar, Function1Type >, FieldFunction1< Type, None< Type > >, FieldFunction1< scalar, NSRDS1 >, FieldFunction1< Type, OneConstant< Type > >, FieldFunction1< Type, Square< Type > >, FieldFunction1< scalar, laminarBL >, FieldFunction1< Type, Polynomial< Type > >, FieldFunction1< scalar, squarePulse >, FieldFunction1< scalar, NSRDS6 >, FieldFunction1< scalar, turbulentBL >, FieldFunction1< Type, ZeroConstant< Type > >, FieldFunction1< scalar, NSRDS7 >, FieldFunction1< scalar, NSRDS4 >, FieldFunction1< scalar, NSRDS14 >, FieldFunction1< Type, Sine< Type > >, FieldFunction1< scalar, NSRDS5 >, Coded< Type >, and crankConnectingRodMotion.
|
pure virtual |
Integrate between two scalars.
Implemented in crankConnectingRodMotion, FieldFunction1< Type, Scale< Type > >, FieldFunction1< scalar, NSRDS2 >, FieldFunction1< Type, Constant< Type > >, FieldFunction1< Type, UniformTable< Type > >, FieldFunction1< scalar, NSRDS3 >, FieldFunction1< Type, Table< Type > >, FieldFunction1< Type, NonUniformTable< Type > >, FieldFunction1< scalar, NSRDS0 >, FieldFunction1< scalar, Function1Type >, FieldFunction1< Type, None< Type > >, FieldFunction1< scalar, NSRDS1 >, FieldFunction1< Type, OneConstant< Type > >, FieldFunction1< Type, Square< Type > >, FieldFunction1< scalar, laminarBL >, FieldFunction1< Type, Polynomial< Type > >, FieldFunction1< scalar, squarePulse >, FieldFunction1< scalar, NSRDS6 >, FieldFunction1< scalar, turbulentBL >, FieldFunction1< Type, ZeroConstant< Type > >, FieldFunction1< scalar, NSRDS7 >, FieldFunction1< scalar, NSRDS4 >, FieldFunction1< scalar, NSRDS14 >, FieldFunction1< Type, Sine< Type > >, FieldFunction1< scalar, NSRDS5 >, FieldFunction1< Type, Function1Type >, NSRDS7, NSRDS6, NSRDS5, NSRDS4, NSRDS3, NSRDS2, NSRDS14, NSRDS1, NSRDS0, ZeroConstant< Type >, UniformTable< Type >, Table< Type >, Table< scalar >, Square< Type >, Sine< Type >, Scale< Type >, Polynomial< Type >, OneConstant< Type >, NonUniformTable< Type >, NonUniformTable< scalar >, None< Type >, Constant< Type >, Coded< Type >, squarePulse, reverseRamp, quarterSineRamp, quarterCosineRamp, quadraticRamp, linearRamp, halfCosineRamp, exponentialSqrRamp, turbulentBL, and laminarBL.
|
pure virtual |
Integrate between two scalar fields.
Implemented in FieldFunction1< Type, Function1Type >, FieldFunction1< Type, Scale< Type > >, FieldFunction1< scalar, NSRDS2 >, FieldFunction1< Type, Constant< Type > >, FieldFunction1< Type, UniformTable< Type > >, FieldFunction1< scalar, NSRDS3 >, FieldFunction1< Type, Table< Type > >, FieldFunction1< Type, NonUniformTable< Type > >, FieldFunction1< scalar, NSRDS0 >, FieldFunction1< scalar, Function1Type >, FieldFunction1< Type, None< Type > >, FieldFunction1< scalar, NSRDS1 >, FieldFunction1< Type, OneConstant< Type > >, FieldFunction1< Type, Square< Type > >, FieldFunction1< scalar, laminarBL >, FieldFunction1< Type, Polynomial< Type > >, FieldFunction1< scalar, squarePulse >, FieldFunction1< scalar, NSRDS6 >, FieldFunction1< scalar, turbulentBL >, FieldFunction1< Type, ZeroConstant< Type > >, FieldFunction1< scalar, NSRDS7 >, FieldFunction1< scalar, NSRDS4 >, FieldFunction1< scalar, NSRDS14 >, FieldFunction1< Type, Sine< Type > >, FieldFunction1< scalar, NSRDS5 >, Coded< Type >, and crankConnectingRodMotion.
|
virtual |
Is this function guaranteed to be constant?
Reimplemented in Scale< Type >, and Constant< Type >.
Definition at line 85 of file Function1.C.
|
pure virtual |
Write data to dictionary stream.
Implemented in NSRDS7, NSRDS6, NSRDS5, NSRDS4, NSRDS3, NSRDS2, NSRDS14, NSRDS1, NSRDS0, integratedNonUniformTable, ZeroConstant< Type >, UniformTable< Type >, Table< Type >, Table< scalar >, squarePulse, Square< Type >, Sine< Type >, Scale< Type >, reverseRamp, Ramp< Function1Type >, Ramp< reverseRamp >, Ramp< quarterSineRamp >, Ramp< halfCosineRamp >, Ramp< quarterCosineRamp >, Ramp< exponentialSqrRamp >, Ramp< quadraticRamp >, Ramp< linearRamp >, Polynomial< Type >, OneConstant< Type >, NonUniformTable< Type >, NonUniformTable< scalar >, None< Type >, Constant< Type >, Coded< Type >, crankConnectingRodMotion, turbulentBL, and laminarBL.
Referenced by Foam::writeEntry().
Assignment.
Definition at line 133 of file Function1.C.
References Foam::abort(), f(), Foam::FatalError, and FatalErrorInFunction.
|
protected |
Name of entry.
Definition at line 132 of file Function1.H.