74 #ifndef Foam_Function1_H 75 #define Foam_Function1_H 87 template<
class Type> Ostream& operator<<(Ostream&, const Function1<Type>&);
101 static autoPtr<Function1<Type>> New
106 const word& redirectType,
107 const objectRegistry*
obrPtr,
117 void operator=(
const Function1<Type>&) =
delete;
174 template<class Derived>
185 const word& redirectType,
187 const bool mandatory =
true 194 std::initializer_list<std::pair<const char*,int>> compat,
198 const bool mandatory =
true 207 const bool mandatory =
true 215 const word& redirectType,
239 const bool mandatory =
true 263 virtual bool constant()
const {
return false; }
266 virtual bool good()
const {
return true; }
272 virtual Type
value(
const scalar
x)
const;
278 virtual Type
integrate(
const scalar x1,
const scalar x2)
const;
291 friend Ostream& operator<< <Type>
311 template<
class Function1Type>
318 typedef typename Function1Type::returnType
Type;
326 const word& entryName,
344 using Function1Type::value;
345 using Function1Type::integrate;
366 #define makeFunction1(Type) \ 368 defineNamedTemplateTypeNameAndDebug(Function1<Type>, 0); \ 370 defineTemplateRunTimeSelectionTable \ 378 #define makeFunction1Type(SS, Type) \ 380 defineNamedTemplateTypeNameAndDebug(Function1Types::SS<Type>, 0); \ 382 Function1<Type>::adddictionaryConstructorToTable \ 383 <FieldFunction1<Function1Types::SS<Type>>> \ 384 add##SS##Type##ConstructorToTable_; 388 #define makeConcreteFunction1(SS, Type) \ 390 defineTypeNameAndDebug(SS, 0); \ 392 Function1<Type>::adddictionaryConstructorToTable \ 393 <FieldFunction1<SS>> \ 394 add##SS##Type##ConstructorToTable_; 398 #define makeScalarFunction1(SS) \ 400 makeConcreteFunction1(SS, scalar); virtual void writeEntries(Ostream &os) const
Write coefficient entries in dictionary format.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
virtual tmp< Field< Type > > value(const scalarField &x) const
Return value as a function of (scalar) independent variable.
const word const dictionary & dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static autoPtr< Function1< Type > > NewCompat(const word &entryName, std::initializer_list< std::pair< const char *, int >> compat, const dictionary &dict, const word &redirectType=word::null, const objectRegistry *obrPtr=nullptr, const bool mandatory=true)
Compatibility selector, with fallback redirection.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
TypeName("Function1") declareRunTimeSelectionTable(autoPtr
Runtime type information.
A class for managing references or pointers (no reference counting)
static tmp< Function1< Type > > Clone(const Derived &fun)
Clone a Function1.
virtual void writeData(Ostream &os) const
Write in dictionary format.
virtual Type value(const scalar x) const
Return value as a function of (scalar) independent variable.
Function1Type::returnType Type
FieldFunction1(const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr)
Construct from entry name and dictionary.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static const word null
An empty word.
virtual bool good() const
Can function be evaluated?
virtual bool constant() const
Is value constant (i.e. independent of x)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two (scalar) values.
OBJstream os(runTime.globalPath()/outputName)
static autoPtr< Function1< Type > > NewIfPresent(const word &entryName, const dictionary &dict, const word &redirectType, const objectRegistry *obrPtr=nullptr)
An optional selector, with fallback redirection.
Type returnType
The return type.
const word const dictionary const objectRegistry * obrPtr
virtual tmp< Field< Type > > integrate(const scalarField &x1, const scalarField &x2) const
Integrate between two (scalar) values.
virtual tmp< Function1< Type > > clone() const =0
Return a clone.
virtual tmp< Function1< Type > > clone() const
Return a clone.
void operator=(const Function1< Type > &)=delete
No copy assignment.
option
Enumeration for the data type and search/match modes (bitmask)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
A class for managing temporary objects.
Registry of regIOobjects.
virtual ~Function1()=default
Destructor.
virtual ~FieldFunction1()=default
Destructor.