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;
178 const
word& redirectType,
180 const
bool mandatory = true
187 std::initializer_list<
std::pair<const
char*,
int>> compat,
189 const
word& redirectType =
word::null,
191 const
bool mandatory = true
200 const
bool mandatory = true
208 const
word& redirectType,
232 const
bool mandatory = true
256 virtual
bool constant()
const {
return false; }
259 virtual bool good()
const {
return true; }
265 virtual Type
value(
const scalar
x)
const;
271 virtual Type
integrate(
const scalar x1,
const scalar x2)
const;
284 friend Ostream& operator<< <Type>
304 template<
class Function1Type>
311 typedef typename Function1Type::returnType
Type;
319 const word& entryName,
334 using Function1Type::value;
335 using Function1Type::integrate;
356 #define makeFunction1(Type) \ 358 defineNamedTemplateTypeNameAndDebug(Function1<Type>, 0); \ 360 defineTemplateRunTimeSelectionTable \ 368 #define makeFunction1Type(SS, Type) \ 370 defineNamedTemplateTypeNameAndDebug(Function1Types::SS<Type>, 0); \ 372 Function1<Type>::adddictionaryConstructorToTable \ 373 <FieldFunction1<Function1Types::SS<Type>>> \ 374 add##SS##Type##ConstructorToTable_; 378 #define makeConcreteFunction1(SS, Type) \ 380 defineTypeNameAndDebug(SS, 0); \ 382 Function1<Type>::adddictionaryConstructorToTable \ 383 <FieldFunction1<SS>> \ 384 add##SS##Type##ConstructorToTable_; 388 #define makeScalarFunction1(SS) \ 390 makeConcreteFunction1(SS, scalar); virtual void writeEntries(Ostream &os) const
Write coefficient entries in dictionary format.
A class for handling keywords in dictionaries.
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.
virtual tmp< Function1< Type > > clone() const
Construct and return a clone.
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)
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.
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
Construct and return a clone.
void operator=(const Function1< Type > &)=delete
No copy assignment.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
A class for managing temporary objects.
Registry of regIOobjects.
virtual ~FieldFunction1()=default
Destructor.