PatchFunction1 with the code supplied by an on-the-fly compiled C++ expression. More...
#include <CodedField.H>


Public Member Functions | |
| TypeName ("coded") | |
| Runtime type information. | |
| CodedField (const polyPatch &pp, const word &redirectType, const word &entryName, const dictionary &dict, const bool faceValues=true) | |
| Construct from entry name and dictionary. | |
| CodedField (const CodedField< Type > &rhs, const polyPatch &pp) | |
| Copy construct, setting patch. | |
| CodedField (const CodedField< Type > &rhs) | |
| Copy construct. | |
| virtual tmp< PatchFunction1< Type > > | clone () const |
| Return a clone. | |
| virtual tmp< PatchFunction1< Type > > | clone (const polyPatch &pp) const |
| Return a clone, setting the patch. | |
| virtual | ~CodedField ()=default |
| Destructor. | |
| virtual bool | uniform () const |
| Is value uniform (i.e. independent of coordinate). | |
| virtual tmp< Field< Type > > | value (const scalar x) const |
| Return CodedField value. | |
| virtual tmp< Field< Type > > | integrate (const scalar x1, const scalar x2) const |
| Integrate between two values. | |
| virtual void | autoMap (const FieldMapper &mapper) |
| Map (and resize as needed) from self given a mapping object. | |
| virtual void | rmap (const PatchFunction1< Type > &pf1, const labelList &addr) |
| Reverse map the given PatchFunction1 onto this PatchFunction1. | |
| virtual void | writeData (Ostream &os) const |
| Write in dictionary format. | |
| Public Member Functions inherited from PatchFunction1< Type > | |
| TypeName ("PatchFunction1") declareRunTimeSelectionTable(autoPtr | |
| Runtime type information. | |
| PatchFunction1 (const polyPatch &pp, const word &entryName, const bool faceValues=true) | |
| Construct from polyPatch and entry name. | |
| PatchFunction1 (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true) | |
| Construct from polyPatch, dictionary and entry name. | |
| PatchFunction1 (const PatchFunction1< Type > &rhs, const polyPatch &pp) | |
| Copy construct setting patch. | |
| PatchFunction1 (const PatchFunction1< Type > &rhs) | |
| Copy construct. | |
| virtual | ~PatchFunction1 ()=default |
| Destructor. | |
| virtual bool | constant () const |
| Is value constant (i.e. independent of x). | |
| virtual bool | good () const |
| Can function be evaluated? | |
| virtual tmp< pointField > | localPosition (const pointField &globalPos) const |
| Helper: optionally convert coordinates to local coordinates. | |
| virtual tmp< Field< Type > > | transform (const Field< Type > &fld) const |
| Apply optional transformation. | |
| virtual tmp< Field< Type > > | transform (const tmp< Field< Type > > &tfld) const |
| Apply optional transformation. | |
| Public Member Functions inherited from patchFunction1Base | |
| patchFunction1Base (const polyPatch &pp, const word &entryName, const bool faceValues=true) | |
| Construct from polyPatch and entry name. | |
| patchFunction1Base (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true) | |
| Construct from polyPatch, dictionary and entry name. | |
| patchFunction1Base (const patchFunction1Base &rhs) | |
| Copy construct. | |
| patchFunction1Base (const patchFunction1Base &rhs, const polyPatch &pp) | |
| Copy construct setting patch. | |
| virtual | ~patchFunction1Base ()=default |
| Destructor. | |
| const word & | name () const noexcept |
| The name of the entry. | |
| const polyPatch & | patch () const noexcept |
| Reference to the patch. | |
| bool | faceValues () const noexcept |
| Generate face or point values on patch? | |
| label | size () const |
| Number of faces or points on the patch. | |
| const objectRegistry * | whichDb () const |
| Return the associated registry (ie, the mesh). | |
| const objectRegistry & | obr () const |
| Return the object registry (ie, the mesh). | |
| const Time & | time () const |
| Return false: function not created with time database. | |
| virtual void | userTimeToTime (const Time &t) |
| Convert time. | |
| Public Member Functions inherited from refCount | |
| constexpr | refCount () noexcept |
| Default construct, initializing count to 0. | |
| int | use_count () const noexcept |
| Return the current reference count. | |
| bool | unique () const noexcept |
| Return true if the reference count is zero. | |
| void | operator++ () noexcept |
| Increment the reference count. | |
| void | operator++ (int) noexcept |
| Increment the reference count. | |
| void | operator-- () noexcept |
| Decrement the reference count. | |
| void | operator-- (int) noexcept |
| Decrement the reference count. | |
Static Public Attributes | |
| static constexpr const char *const | codeTemplateC = "codedPatchFunction1Template.C" |
| Name of the C code template to be used. | |
| static constexpr const char *const | codeTemplateH = "codedPatchFunction1Template.H" |
| Name of the H code template to be used. | |
Protected Member Functions | |
| virtual dlLibraryTable & | libs () const |
| Mutable access to the loaded dynamic libraries. | |
| virtual string | description () const |
| Description (type + name) for the output. | |
| virtual void | clearRedirect () const |
| Clear redirected object(s). | |
| virtual const dictionary & | codeContext () const |
| Additional 'codeContext' dictionary to pass through. | |
| virtual const dictionary & | codeDict (const dictionary &dict) const |
| virtual const dictionary & | codeDict () const |
| virtual void | prepare (dynamicCode &, const dynamicCodeContext &) const |
| Adapt the context for the current object. | |
| void | operator= (const CodedField< Type > &)=delete |
| No copy assignment. | |
| Protected Member Functions inherited from PatchFunction1< Type > | |
| void | operator= (const PatchFunction1< Type > &)=delete |
| No copy assignment. | |
| Protected Member Functions inherited from patchFunction1Base | |
| void | operator= (const patchFunction1Base &)=delete |
| No copy assignment. | |
| Protected Member Functions inherited from codedBase | |
| dynamicCodeContext & | codeContext () |
| Access to the dynamic code context. | |
| void | setCodeContext (const dictionary &dict) |
| Set code context from a dictionary. | |
| void | append (const std::string &str) |
| Add content to SHA1 hashing. | |
| void | updateLibrary (const word &name, const dynamicCodeContext &context) const |
| Update library as required, using the given context. | |
| void | updateLibrary (const word &name, const dictionary &dict) const |
| Update library as required, using the given code dictionary to use for the context. | |
| void | updateLibrary (const word &name) const |
| Update library as required, using the predefined context or use the codeDict() to generate one. | |
| ClassName ("codedBase") | |
| Runtime type information. | |
| codedBase (const codedBase &)=delete | |
| No copy construct. | |
| void | operator= (const codedBase &)=delete |
| No copy assignment. | |
| codedBase ()=default | |
| Default construct. | |
| virtual | ~codedBase ()=default |
| Destructor. | |
Additional Inherited Members | |
| Public Types inherited from PatchFunction1< Type > | |
| typedef Field< Type > | returnType |
| The return type is a field of values. | |
| Static Public Member Functions inherited from PatchFunction1< Type > | |
| template<class Derived> | |
| static tmp< PatchFunction1< Type > > | Clone (const Derived &fun) |
| Clone a PatchFunction1. | |
| template<class Derived> | |
| static tmp< PatchFunction1< Type > > | Clone (const Derived &fun, const polyPatch &pp) |
| Clone a PatchFunction1 with a patch. | |
| static autoPtr< PatchFunction1< Type > > | New (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true, const bool mandatory=true) |
| Selector. | |
| static autoPtr< PatchFunction1< Type > > | NewCompat (const polyPatch &pp, const word &entryName, std::initializer_list< std::pair< const char *, int > > compat, const dictionary &dict, const bool faceValues=true, const bool mandatory=true) |
| Compatibility selector. | |
| static autoPtr< PatchFunction1< Type > > | NewIfPresent (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true) |
| An optional selector. | |
| static refPtr< PatchFunction1< Type > > | New (HashPtrTable< PatchFunction1< Type > > &cache, const polyPatch &pp, const word &entryName, const dictionary &dict, enum keyType::option matchOpt=keyType::LITERAL, const bool faceValues=true, const bool mandatory=true) |
| Selector with external storage. This also allows wildcard matches in a dictionary. | |
| Public Attributes inherited from PatchFunction1< Type > | |
| PatchFunction1 | |
| dictionary | |
| const polyPatch & | pp |
| const polyPatch const word & | type |
| const polyPatch const word const word & | entryName |
| const polyPatch const word const word const dictionary & | dict |
| const polyPatch const word const word const dictionary const bool | faceValues |
| const polyPatch const word const word const dictionary const bool | pp |
| const polyPatch const word const word const dictionary const bool | type |
| const polyPatch const word const word const dictionary const bool | entryName |
| const polyPatch const word const word const dictionary const bool | dict |
| Static Protected Member Functions inherited from codedBase | |
| static void | writeCodeDict (Ostream &os, const dictionary &dict) |
| Write code-dictionary contents. | |
| static const dictionary & | codeDict (const objectRegistry &obr, const word &dictName="codeDict") |
| Return "codeDict" from objectRegistry or read from disk. | |
| Protected Attributes inherited from PatchFunction1< Type > | |
| coordinateScaling< Type > | coordSys_ |
| Optional local coordinate system and scaling. | |
| Protected Attributes inherited from patchFunction1Base | |
| const word | name_ |
| Name of entry. | |
| const polyPatch & | patch_ |
| Reference to the patch. | |
| const bool | faceValues_ |
| Generate face or point values on patch. | |
PatchFunction1 with the code supplied by an on-the-fly compiled C++ expression.
The code entries:
| codeInclude | : | include files |
| codeOptions | : | compiler line: added to EXE_INC (Make/options) |
| codeLibs | : | linker line: added to LIB_LIBS (Make/options) |
| localCode | : | c++; local static functions |
| code | : | c++; return the patch values at (scalar x) |
<patchName>
{
type uniformFixedValue;
uniformValue
{
type coded;
name myExpression; // Name of generated PatchFunction1
code
#{
const polyPatch& pp = this->patch();
Pout<< "** Patch size:" << pp.size() << endl;
return tmp<vectorField>::New(pp.size(), vector(1, 0, 0))
#};
//codeInclude
//#{
// #include "volFields.H"
//#};
//codeOptions
//#{
// -I$(LIB_SRC)/finiteVolume/lnInclude
//#};
}
}
Definition at line 120 of file CodedField.H.
| CodedField | ( | const polyPatch & | pp, |
| const word & | redirectType, | ||
| const word & | entryName, | ||
| const dictionary & | dict, | ||
| const bool | faceValues = true ) |
Construct from entry name and dictionary.
Definition at line 139 of file CodedField.C.
References codedBase::codedBase(), PatchFunction1< Type >::dict, PatchFunction1< Type >::dictionary, PatchFunction1< Type >::entryName, PatchFunction1< Type >::faceValues, PatchFunction1< Type >::PatchFunction1, PatchFunction1< Type >::pp, codedBase::setCodeContext(), and codedBase::updateLibrary().
Referenced by CodedField(), CodedField(), operator=(), and TypeName().


|
explicit |
Copy construct, setting patch.
Definition at line 162 of file CodedField.C.
References codedBase::codedBase(), CodedField(), PatchFunction1< Type >::PatchFunction1, PatchFunction1< Type >::pp, and Foam::rhs().

|
explicit |
Copy construct.
Definition at line 176 of file CodedField.C.
References CodedField(), patchFunction1Base::patch(), and Foam::rhs().

|
virtualdefault |
Destructor.
|
protectedvirtual |
Mutable access to the loaded dynamic libraries.
Implements codedBase.
Definition at line 29 of file CodedField.C.
References patchFunction1Base::patch_.
|
protectedvirtual |
Description (type + name) for the output.
Implements codedBase.
Definition at line 37 of file CodedField.C.
|
protectedvirtual |
|
protectedvirtual |
Additional 'codeContext' dictionary to pass through.
Definition at line 52 of file CodedField.C.
|
protectedvirtual |
Definition at line 61 of file CodedField.C.
References PatchFunction1< Type >::dict, and PatchFunction1< Type >::dictionary.
Referenced by codeDict().

|
protectedvirtual |
Implements codedBase.
Definition at line 80 of file CodedField.C.
References codeDict().

|
protectedvirtual |
Adapt the context for the current object.
Implements codedBase.
Definition at line 87 of file CodedField.C.
References dynamicCode::addCompileFile(), dynamicCode::addCopyFile(), dynamicCodeContext::code(), codeTemplateC, codeTemplateH, DetailInfo, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dynamicCodeContext::libs(), dynamicCodeContext::options(), patchFunction1Base::patch_, dynamicCode::setFieldTemplates(), dynamicCode::setFilterVariable(), dynamicCode::setMakeOptions(), and dynamicCodeContext::sha1().

|
protecteddelete |
| TypeName | ( | "coded" | ) |
Runtime type information.
References CodedField(), PatchFunction1< Type >::dict, PatchFunction1< Type >::dictionary, PatchFunction1< Type >::entryName, PatchFunction1< Type >::faceValues, PatchFunction1< Type >::pp, and Foam::rhs().

|
inlinevirtual |
Return a clone.
Implements PatchFunction1< Type >.
Definition at line 240 of file CodedField.H.
References PatchFunction1< Type >::Clone().

|
inlinevirtual |
Return a clone, setting the patch.
Implements PatchFunction1< Type >.
Definition at line 248 of file CodedField.H.
References PatchFunction1< Type >::Clone(), and PatchFunction1< Type >::pp.

|
inlinevirtual |
Is value uniform (i.e. independent of coordinate).
Implements PatchFunction1< Type >.
Definition at line 265 of file CodedField.H.
|
virtual |
Return CodedField value.
Reimplemented from PatchFunction1< Type >.
Definition at line 233 of file CodedField.C.
References codedBase::updateLibrary(), and x.

|
virtual |
Integrate between two values.
Reimplemented from PatchFunction1< Type >.
Definition at line 247 of file CodedField.C.
References codedBase::updateLibrary().

|
virtual |
Map (and resize as needed) from self given a mapping object.
Reimplemented from PatchFunction1< Type >.
Definition at line 261 of file CodedField.C.
References PatchFunction1< Type >::autoMap().

|
virtual |
Reverse map the given PatchFunction1 onto this PatchFunction1.
Reimplemented from PatchFunction1< Type >.
Definition at line 275 of file CodedField.C.
References PatchFunction1< Type >::PatchFunction1, and PatchFunction1< Type >::rmap().

|
virtual |
Write in dictionary format.
Reimplemented from PatchFunction1< Type >.
Definition at line 290 of file CodedField.C.

|
staticconstexpr |
Name of the C code template to be used.
Definition at line 193 of file CodedField.H.
Referenced by prepare().
|
staticconstexpr |
Name of the H code template to be used.
Definition at line 199 of file CodedField.H.
Referenced by prepare().