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 const
word& redirectType,
176 const
bool mandatory = true
183 std::initializer_list<
std::pair<const
char*,
int>> compat,
185 const
word& redirectType =
word::null,
187 const
bool mandatory = true
196 const
bool mandatory = true
204 const
word& redirectType =
word::null,
220 const
bool mandatory = true
244 virtual
bool constant()
const {
return false; }
247 virtual bool good()
const {
return true; }
253 virtual Type
value(
const scalar
x)
const;
259 virtual Type
integrate(
const scalar x1,
const scalar x2)
const;
272 friend Ostream& operator<< <Type>
292 template<
class Function1Type>
299 typedef typename Function1Type::returnType
Type;
307 const word& entryName,
322 using Function1Type::value;
323 using Function1Type::integrate;
344 #define makeFunction1(Type) \ 346 defineNamedTemplateTypeNameAndDebug(Function1<Type>, 0); \ 348 defineTemplateRunTimeSelectionTable \ 356 #define makeFunction1Type(SS, Type) \ 358 defineNamedTemplateTypeNameAndDebug(Function1Types::SS<Type>, 0); \ 360 Function1<Type>::adddictionaryConstructorToTable \ 361 <FieldFunction1<Function1Types::SS<Type>>> \ 362 add##SS##Type##ConstructorToTable_; 366 #define makeConcreteFunction1(SS, Type) \ 368 defineTypeNameAndDebug(SS, 0); \ 370 Function1<Type>::adddictionaryConstructorToTable \ 371 <FieldFunction1<SS>> \ 372 add##SS##Type##ConstructorToTable_; 376 #define makeScalarFunction1(SS) \ 378 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...
static autoPtr< Function1< Type > > NewIfPresent(const word &entryName, const dictionary &dict, const word &redirectType=word::null, const objectRegistry *obrPtr=nullptr)
An optional selector.
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.
void func(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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)
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.