MMA Class Reference

Update design variables using the Method of Moving Assymptotes. Can handle inequality constraints. More...

Inheritance diagram for MMA:
Collaboration diagram for MMA:

Public Member Functions

 TypeName ("MMA")
 Runtime type information. More...
 
 MMA (const fvMesh &mesh, const dictionary &dict, autoPtr< designVariables > &designVars, const label nConstraints, const word &type)
 Construct from components. More...
 
virtual ~MMA ()=default
 Destructor. More...
 
void computeCorrection ()
 Compute design variables correction. More...
 
void solveSubproblem ()
 Solve subproblem using a Newton optimiser. More...
 
void updateValuesAndApproximations ()
 Compute objective/constraint values and their approximations. More...
 
const PtrList< scalarField > & getValuesAndApproximations () const
 Get objective/constraint values and their approximations. More...
 
void updateRho ()
 Update rho value if needed. More...
 
const scalarFieldgetRho () const
 Get rho value if needed. More...
 
void setVariableRho (bool varRho=true)
 Set variable rho. More...
 
bool converged ()
 Checks convergence of GCMMA. More...
 
virtual bool writeData (Ostream &os) const
 Write useful quantities to files. More...
 
- Public Member Functions inherited from constrainedOptimisationMethod
 TypeName ("constrainedOptimisationMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, constrainedOptimisationMethod, dictionary,(const fvMesh &mesh, const dictionary &dict, autoPtr< designVariables > &designVars, const label nConstraints, const word &type),(mesh, dict, designVars, nConstraints, type))
 
 constrainedOptimisationMethod (const fvMesh &mesh, const dictionary &dict, autoPtr< designVariables > &designVars, const label nConstraints, const word &type)
 Construct from components. More...
 
virtual ~constrainedOptimisationMethod ()=default
 Destructor. More...
 
- Public Member Functions inherited from updateMethod
 TypeName ("updateMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, updateMethod, dictionary,(const fvMesh &mesh, const dictionary &dict, autoPtr< designVariables > &designVars, const label nConstraints, const word &type),(mesh, dict, designVars, nConstraints, type))
 
 updateMethod (const fvMesh &mesh, const dictionary &dict, autoPtr< designVariables > &designVars, const label nConstraints, const word &type)
 Construct from components. More...
 
virtual ~updateMethod ()=default
 Destructor. More...
 
dictionary coeffsDict (const word &type) const
 Return optional dictionary with parameters specific to each method. More...
 
void setObjectiveDeriv (const scalarField &derivs)
 Set objective derivative. More...
 
void setConstraintDeriv (const PtrList< scalarField > &derivs)
 Set constraints derivative. More...
 
void setObjectiveValue (const scalar value)
 Set objective value. More...
 
void setObjectiveValueOld (const scalar value)
 Set old objective value. More...
 
void setConstraintValues (const scalarField &values)
 Set values of constraints. More...
 
scalar getObjectiveValue () const
 Get objective value. More...
 
scalar getObjectiveValueOld () const
 Get old objective value. More...
 
const scalarFieldgetConstraintValues () const
 Get values of constraints. More...
 
label getCycle () const
 Get optimisation cycle. More...
 
void setStep (const scalar eta)
 Set step for optimisation methods. More...
 
void modifyStep (const scalar multiplier)
 Multiply step. More...
 
void setGlobalSum (const bool useGlobalSum)
 Set globalSum variable. More...
 
void setConstaintsNumber (const label nConstraints)
 Set the number of constraints. More...
 
label nConstraints () const
 Get the number of constraints. More...
 
scalarFieldreturnCorrection ()
 Return the correction of the design variables. More...
 
void writeCorrection ()
 
virtual scalar computeMeritFunction ()
 Compute merit function. Could be different than the objective in the presence of constraints. More...
 
virtual scalar meritFunctionDirectionalDerivative ()
 Directional derivative of the merit function, in the direction of the correction. Could be different than the objective directional derivative in the presence of constraints. More...
 
bool & initialEtaSet ()
 Return whether initial eta was set. More...
 
virtual void updateOldCorrection (const scalarField &oldCorrection)
 Update old correction. Useful for quasi-newton methods coupled with line search. More...
 
virtual bool writeAuxiliaryData ()
 Write non-continuation data, usually under the optimisation folder. More...
 
- Public Member Functions inherited from localIOdictionary
 localIOdictionary (const IOobject &io, const dictionary *fallback=nullptr)
 Construct given an IOobject and optional fallback dictionary content. More...
 
 localIOdictionary (const IOobject &io, const dictionary &dict)
 Construct given an IOobject and fallback dictionary content. More...
 
 localIOdictionary (const IOobject &io, const word &wantedType, const dictionary *fallback=nullptr)
 Construct given an IOobject, wanted typeName and optional fallback dictionary content. More...
 
 localIOdictionary (const IOobject &io, Istream &is)
 Construct given an IOobject and Istream. More...
 
virtual ~localIOdictionary ()=default
 Destructor. More...
 
virtual bool global () const
 Is object global. More...
 
virtual fileName filePath () const
 Return complete path + object name if the file exists. More...
 
- Public Member Functions inherited from baseIOdictionary
 TypeName ("dictionary")
 Declare type-name, virtual type (with debug switch) More...
 
 baseIOdictionary (const baseIOdictionary &)=default
 Copy construct. More...
 
 baseIOdictionary (baseIOdictionary &&)=default
 Move construct. More...
 
virtual ~baseIOdictionary ()=default
 Destructor. More...
 
 baseIOdictionary (const IOobject &io, const dictionary *fallback=nullptr)
 Construct given an IOobject and optional fallback dictionary content (ununsed) More...
 
 baseIOdictionary (const IOobject &io, const dictionary &dict)
 Construct given an IOobject and fallback dictionary content (ununsed) More...
 
 baseIOdictionary (const IOobject &io, Istream &is)
 Construct given an IOobject and Istream (ununsed) More...
 
const wordname () const
 Name function is needed to disambiguate those inherited from regIOobject and dictionary. More...
 
virtual bool readData (Istream &)
 The readData function required by regIOobject read operation. More...
 
void operator= (const baseIOdictionary &rhs)
 Copy assignment of dictionary entries (leave regIOobject untouched) More...
 
void operator= (const dictionary &rhs)
 Copy assignment of dictionary entries. More...
 
- Public Member Functions inherited from regIOobject
void operator= (const regIOobject &)=delete
 No copy assignment. More...
 
 TypeName ("regIOobject")
 Runtime type information. More...
 
 regIOobject (const IOobject &io, const bool isTimeObject=false)
 Construct from IOobject. The optional flag adds special handling if the object is the top-level regIOobject (eg, Time). More...
 
 regIOobject (const regIOobject &rio)
 Copy construct. More...
 
 regIOobject (const regIOobject &rio, bool registerCopy)
 Copy construct, transferring registry registration to the copy if registerCopy is true. More...
 
 regIOobject (const word &newName, const regIOobject &, bool registerCopy)
 Copy construct with new name, transferring registry registration to the copy if registerCopy is true. More...
 
 regIOobject (const IOobject &io, const regIOobject &rio)
 Copy construct with new IO parameters. More...
 
virtual ~regIOobject ()
 Destructor. More...
 
bool checkIn ()
 Add object to registry, if not already registered. More...
 
bool checkOut ()
 Remove all file watches and remove object from registry. More...
 
virtual void addWatch ()
 Add file watch on object (if registered and READ_IF_MODIFIED) More...
 
bool registered () const noexcept
 Query the registered state (ie, has been checked in). This is not necessarily the same as registerObject(), which is just a stated preference. More...
 
bool ownedByRegistry () const noexcept
 Is this object owned by the registry? More...
 
bool store ()
 Register object with its registry and transfer ownership to the registry. More...
 
void release (const bool unregister=false) noexcept
 Set object as not ownedByRegistry. More...
 
label eventNo () const noexcept
 Event number at last update. More...
 
label & eventNo () noexcept
 Event number at last update. More...
 
bool upToDate (const regIOobject &) const
 Return true if up-to-date with respect to given object. More...
 
bool upToDate (const regIOobject &, const regIOobject &) const
 Return true if up-to-date with respect to given objects. More...
 
bool upToDate (const regIOobject &, const regIOobject &, const regIOobject &) const
 Return true if up-to-date with respect to given objects. More...
 
bool upToDate (const regIOobject &, const regIOobject &, const regIOobject &, const regIOobject &) const
 Return true if up-to-date with respect to given objects. More...
 
void setUpToDate ()
 Set as up-to-date. More...
 
virtual void rename (const word &newName)
 Rename. More...
 
const dictionaryfindMetaData () const noexcept
 Return pointer to meta-data or nullptr. More...
 
dictionarygetMetaData () noexcept
 Get or create meta-data. More...
 
void removeMetaData ()
 Remove meta-data. More...
 
virtual void updateMetaData ()
 Update internal meta-data (eg, prior to writing) More...
 
bool headerOk ()
 Read and check header info. Does not check the headerClassName. More...
 
IstreamreadStream (const word &, const bool readOnProc=true)
 Return Istream and check object type against that given. More...
 
void close ()
 Close Istream. More...
 
virtual bool read ()
 Read object. More...
 
virtual label addWatch (const fileName &)
 Add file watch for fileName on object if not yet watched. More...
 
const labelListwatchIndices () const noexcept
 Read access to file-monitoring handles. More...
 
labelListwatchIndices () noexcept
 Write access to file-monitoring handles. More...
 
virtual bool modified () const
 Return true if the object's file (or files for objectRegistry) have been modified. (modified state is cached by Time) More...
 
virtual bool readIfModified ()
 Read object if modified (as set by call to modified) More...
 
virtual bool writeObject (IOstreamOption streamOpt, const bool writeOnProc) const
 Write using stream options. More...
 
virtual bool write (const bool writeOnProc=true) const
 Write using setting from DB. More...
 
void operator= (const IOobject &io)
 Copy assignment. More...
 
virtual bool writeObject (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp, const bool writeOnProc) const
 Write using given format, version and compression. More...
 
- Public Member Functions inherited from IOobject
 TypeName ("IOobject")
 Declare type-name, virtual type (with debug switch) More...
 
 IOobject (const IOobject &)=default
 Copy construct. More...
 
virtual ~IOobject ()=default
 Destructor. More...
 
 IOobject (const word &name, const fileName &instance, const objectRegistry &registry, IOobjectOption ioOpt=IOobjectOption())
 Construct from name, instance, registry, io options. More...
 
 IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry &registry, IOobjectOption ioOpt=IOobjectOption())
 Construct from name, instance, local, registry, io options. More...
 
 IOobject (const fileName &path, const objectRegistry &registry, IOobjectOption ioOpt=IOobjectOption())
 Construct from path, registry, io options. More...
 
 IOobject (const word &name, const fileName &instance, const objectRegistry &registry, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE, bool registerObject=true, bool globalObject=false)
 Construct from name, instance, registry, io options. More...
 
 IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry &registry, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE, bool registerObject=true, bool globalObject=false)
 Construct from name, instance, local, registry, io options. More...
 
 IOobject (const fileName &path, const objectRegistry &registry, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE, bool registerObject=true, bool globalObject=false)
 Construct from path, registry, io options. More...
 
 IOobject (const IOobject &io, const objectRegistry &registry)
 Copy construct, resetting registry. More...
 
 IOobject (const IOobject &io, const word &name)
 Copy construct, resetting name. More...
 
 IOobject (const IOobject &io, const word &name, const fileName &local)
 Copy construct, resetting name and local component. More...
 
 IOobject (const IOobject &io, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt)
 Copy construct, resetting read/write options. More...
 
 IOobject (const IOobject &io, IOobjectOption::registerOption regOpt)
 Copy construct, resetting register option. More...
 
autoPtr< IOobjectclone () const
 Clone. More...
 
autoPtr< IOobjectclone (const objectRegistry &registry) const
 Clone resetting registry. More...
 
const objectRegistrydb () const noexcept
 Return the local objectRegistry. More...
 
const Timetime () const noexcept
 Return Time associated with the objectRegistry. More...
 
const wordname () const noexcept
 Return the object name. More...
 
const wordheaderClassName () const noexcept
 Return name of the class name read from header. More...
 
wordheaderClassName () noexcept
 Return non-constant access to the class name read from header. More...
 
const stringnote () const noexcept
 Return the optional note. More...
 
stringnote () noexcept
 Modifiable access to the optional note. More...
 
unsigned labelByteSize () const noexcept
 The sizeof (label) in bytes, possibly read from the header. More...
 
unsigned scalarByteSize () const noexcept
 The sizeof (scalar) in bytes, possibly read from the header. More...
 
void resetHeader (const word &newName=word::null)
 Clear various bits (headerClassName, note, sizeof...) that would be obtained when reading from a file. More...
 
bool hasHeaderClass () const noexcept
 True if headerClassName() is non-empty (after reading) More...
 
template<class Type >
bool isHeaderClass () const
 Check if headerClassName() equals Type::typeName. More...
 
template<class Type >
bool isHeaderClassName () const
 Same as isHeaderClass() More...
 
word group () const
 Return group (extension part of name) More...
 
word member () const
 Return member (name without the extension) More...
 
const fileNamerootPath () const noexcept
 Return the Time::rootPath() More...
 
const fileNamecaseName () const noexcept
 Return the Time::caseName() More...
 
const fileNameglobalCaseName () const noexcept
 Return the Time::globalCaseName() More...
 
const fileNameinstance () const noexcept
 Read access to instance path component. More...
 
fileNameinstance () noexcept
 Write access to instance path component. More...
 
const fileNamelocal () const noexcept
 Read access to local path component. More...
 
fileName path () const
 The complete path for the object (with instance, local,...). More...
 
fileName globalPath () const
 The complete global path for the object (with instance, local,...) More...
 
fileName path (const word &instance, const fileName &local=fileName::null) const
 The complete path with alternative instance and local. More...
 
fileName globalPath (const word &instance, const fileName &local=fileName::null) const
 The complete global path with alternative instance and local. More...
 
fileName objectPath () const
 The complete path + object name. More...
 
fileName globalObjectPath () const
 The complete global path + object name. More...
 
fileName objectRelPath () const
 The object path relative to the root. More...
 
fileName localFilePath (const word &typeName, const bool search=true) const
 Redirect to fileHandler filePath, searching locally. More...
 
fileName globalFilePath (const word &typeName, const bool search=true) const
 Redirect to fileHandler filePath, searching up if in parallel. More...
 
IOstreamOption parseHeader (const dictionary &headerDict)
 Parse 'FoamFile' header contents and set the IOobject characteristics and return the stream characteristics. More...
 
bool readHeader (Istream &is)
 Read header ('FoamFile' dictionary) and set the IOobject and stream characteristics. More...
 
bool readHeader (dictionary &headerDict, Istream &is)
 Read header (the 'FoamFile' dictionary) and set the IOobject and stream characteristics. More...
 
template<class Type >
bool typeHeaderOk (const bool checkType=true, const bool search=true, const bool verbose=true)
 Read header (respects is_globalIOobject trait) and check its info. More...
 
template<class Type >
fileName typeFilePath (const bool search=true) const
 Call localFilePath or globalFilePath for given type depending on its is_globalIOobject trait. More...
 
template<class Type >
void warnNoRereading () const
 Helper: warn that type does not support re-reading. More...
 
bool writeHeader (Ostream &os) const
 Write header with current type() More...
 
bool writeHeader (Ostream &os, const word &objectType) const
 Write header with override of type. More...
 
void writeHeader (dictionary &dict, IOstreamOption streamOpt) const
 Write header into a dictionary with current type() and given output format. More...
 
void writeHeader (dictionary &dict, const word &objectType, IOstreamOption streamOpt) const
 Write header into a dictionary with override of type and given output format. More...
 
bool good () const noexcept
 Did last readHeader() succeed? More...
 
bool bad () const noexcept
 Did last readHeader() fail? More...
 
InfoProxy< IOobjectinfo () const noexcept
 Return info proxy, for printing information to a stream. More...
 
void operator= (const IOobject &io)
 Copy assignment, copies all values (except the registry) More...
 
template<>
bool isHeaderClass () const
 Specialization for void always returns true (no headerClassName check). More...
 
template<class StringType >
Foam::word groupName (StringType base, const word &group)
 
template<class Type >
Foam::fileName typeFilePath (const bool search) const
 
- Public Member Functions inherited from IOobjectOption
constexpr IOobjectOption (readOption rOpt=readOption::NO_READ, writeOption wOpt=writeOption::NO_WRITE, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept
 Default construct (NO_READ, NO_WRITE, REGISTER, non-global) or construct with specified options. More...
 
constexpr IOobjectOption (readOption rOpt, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept
 Construct NO_WRITE with specified read/register options. More...
 
constexpr IOobjectOption (writeOption wOpt, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept
 Construct NO_READ with specified write/register options. More...
 
constexpr IOobjectOption (registerOption registerObject, bool globalObject=false) noexcept
 Construct (NO_READ, NO_WRITE) with specified register option. More...
 
constexpr IOobjectOption (readOption rOpt, writeOption wOpt, bool registerObject, bool globalObject=false) noexcept
 Construct from components with specified register option as bool. More...
 
constexpr IOobjectOption (bool registerObject, bool globalObject=false) noexcept
 Construct (NO_READ, NO_WRITE) with specified register option as bool. More...
 
readOption readOpt () const noexcept
 Get the read option. More...
 
readOption readOpt (readOption opt) noexcept
 Set the read option. More...
 
writeOption writeOpt () const noexcept
 Get the write option. More...
 
writeOption writeOpt (writeOption opt) noexcept
 Set the write option. More...
 
bool registerObject () const noexcept
 Should objects created with this IOobject be registered? More...
 
bool registerObject (bool on) noexcept
 Change registration preference. More...
 
bool globalObject () const noexcept
 True if object is treated the same for all processors. More...
 
bool globalObject (bool on) noexcept
 Change global-object status. More...
 
bool isAnyRead () const noexcept
 True if any reading may be required (ie, != NO_READ) More...
 
bool isReadRequired () const noexcept
 True if (MUST_READ | READ_MODIFIED) bits are set. More...
 
bool isReadOptional () const noexcept
 True if (LAZY_READ) bits are set [same as READ_IF_PRESENT]. More...
 
readOptionreadOpt () noexcept
 Access to the read option. More...
 
writeOptionwriteOpt () noexcept
 Access to the write option. More...
 
bool & registerObject () noexcept
 Access to the register object option. More...
 
bool & globalObject () noexcept
 Access to the global object option. More...
 
- Public Member Functions inherited from dictionary
 ClassName ("dictionary")
 
 dictionary ()
 Default construct, a top-level empty dictionary. More...
 
 dictionary (const fileName &name)
 Construct top-level empty dictionary with given name. More...
 
 dictionary (const fileName &name, const dictionary &parentDict, Istream &is, bool keepHeader=false)
 Construct given the entry name, parent dictionary and Istream, reading entries until EOF, optionally keeping the header. More...
 
 dictionary (Istream &is)
 Construct top-level dictionary from Istream (discards the header). Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character. More...
 
 dictionary (Istream &is, bool keepHeader)
 Construct top-level dictionary from Istream, reading entries until EOF, optionally keeping the header. More...
 
 dictionary (const dictionary &parentDict, const dictionary &dict)
 Copy construct given the parent dictionary. More...
 
 dictionary (const dictionary &dict)
 Copy construct top-level dictionary. More...
 
 dictionary (const dictionary *dict)
 Construct top-level dictionary as copy from pointer to dictionary. More...
 
 dictionary (const dictionary &parentDict, dictionary &&dict)
 Move construct for given parent dictionary. More...
 
 dictionary (dictionary &&dict)
 Move construct top-level dictionary. More...
 
autoPtr< dictionaryclone () const
 Construct and return clone. More...
 
virtual ~dictionary ()
 Destructor. More...
 
const fileNamename () const noexcept
 The dictionary name. More...
 
fileNamename () noexcept
 The dictionary name for modification (use with caution). More...
 
word dictName () const
 The local dictionary name (final part of scoped name) More...
 
fileName relativeName (const bool caseTag=false) const
 The dictionary name relative to the case. More...
 
bool isNullDict () const noexcept
 The dictionary is actually dictionary::null (root dictionary) More...
 
const dictionaryparent () const noexcept
 Return the parent dictionary. More...
 
const dictionarytopDict () const
 Return the top of the tree. More...
 
label startLineNumber () const
 Return line number of first token in dictionary. More...
 
label endLineNumber () const
 Return line number of last token in dictionary. More...
 
SHA1Digest digest () const
 Return the SHA1 digest of the dictionary contents. More...
 
tokenList tokens () const
 Return the dictionary as a list of tokens. More...
 
const entryfindEntry (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry (const access) with the given keyword. More...
 
entryfindEntry (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Find an entry (non-const access) with the given keyword. More...
 
bool found (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry (const access) with the given keyword. More...
 
const entryfindScoped (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Search for a scoped entry (const access) with the given keyword. More...
 
const dictionaryfindDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a sub-dictionary pointer if present (and a sub-dictionary) otherwise return nullptr. More...
 
dictionaryfindDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a sub-dictionary pointer if present (and a sub-dictionary) otherwise return nullptr. More...
 
bool isDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find a sub-dictionary. More...
 
const entrylookupEntry (const word &keyword, enum keyType::option matchOpt) const
 Search for an entry (const access) with the given keyword. More...
 
ITstreamlookup (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return an entry data stream. FatalIOError if not found, or not a stream. More...
 
template<class T >
T get (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect. More...
 
template<class T >
T getOrDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T, or return the given default value. FatalIOError if it is found and the number of tokens is incorrect. More...
 
template<class T >
T getOrAdd (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a T, or return the given default value and add it to dictionary. FatalIOError if it is found and the number of tokens is incorrect. More...
 
template<class T >
bool readEntry (const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
 Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect, or it is mandatory and not found. More...
 
template<class T >
bool readIfPresent (const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens is incorrect. More...
 
template<class T , class Predicate >
T getCheck (const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T with additional checking FatalIOError if not found, or if the number of tokens is incorrect. More...
 
template<class T , class Predicate >
T getCheckOrDefault (const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T, or return the given default value. FatalIOError if it is found and the number of tokens is incorrect. More...
 
template<class T , class Predicate >
T getCheckOrAdd (const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a T, or return the given default value and add it to dictionary. FatalIOError if it is found and the number of tokens is incorrect. More...
 
template<class T , class Predicate >
bool readCheck (const word &keyword, T &val, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
 Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect, or it is mandatory and not found. More...
 
template<class T , class Predicate >
bool readCheckIfPresent (const word &keyword, T &val, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens is incorrect. More...
 
const dictionarysubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a sub-dictionary. More...
 
dictionarysubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a sub-dictionary for manipulation. More...
 
dictionarysubDictOrAdd (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a sub-dictionary for manipulation. More...
 
dictionary subOrEmptyDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
 Find and return a sub-dictionary as a copy, otherwise return an empty dictionary. More...
 
const dictionaryoptionalSubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a sub-dictionary, otherwise return this dictionary. More...
 
wordList toc () const
 Return the table of contents. More...
 
wordList sortedToc () const
 Return the sorted table of contents. More...
 
template<class Compare >
wordList sortedToc (const Compare &comp) const
 Return table of contents sorted using the specified comparator. More...
 
List< keyTypekeys (bool patterns=false) const
 Return the list of available keys or patterns. More...
 
bool substituteKeyword (const word &keyword, bool mergeEntry=false)
 Substitute the given keyword (which is prefixed by '$') More...
 
bool substituteScopedKeyword (const word &keyword, bool mergeEntry=false)
 Substitute the given scoped keyword (which is prefixed by '$') More...
 
entryadd (entry *entryPtr, bool mergeEntry=false)
 Add a new entry. More...
 
entryadd (const entry &e, bool mergeEntry=false)
 Add an entry. More...
 
entryadd (const keyType &k, const word &v, bool overwrite=false)
 Add a word entry. More...
 
entryadd (const keyType &k, const string &v, bool overwrite=false)
 Add a string entry. More...
 
entryadd (const keyType &k, const label v, bool overwrite=false)
 Add a label entry. More...
 
entryadd (const keyType &k, const scalar v, bool overwrite=false)
 Add a scalar entry. More...
 
entryadd (const keyType &k, const dictionary &d, bool mergeEntry=false)
 Add a dictionary entry. More...
 
template<class T >
entryadd (const keyType &k, const T &v, bool overwrite=false)
 Add a T entry. More...
 
entryset (entry *entryPtr)
 Assign a new entry, overwriting any existing entry. More...
 
entryset (const entry &e)
 Assign a new entry, overwriting any existing entry. More...
 
entryset (const keyType &k, const dictionary &v)
 Assign a dictionary entry, overwriting any existing entry. More...
 
template<class T >
entryset (const keyType &k, const T &v)
 Assign a T entry, overwriting any existing entry. More...
 
bool remove (const word &keyword)
 Remove an entry specified by keyword. More...
 
bool changeKeyword (const keyType &oldKeyword, const keyType &newKeyword, bool overwrite=false)
 Change the keyword for an entry,. More...
 
bool merge (const dictionary &dict)
 Merge entries from the given dictionary. More...
 
void clear ()
 Clear the dictionary. More...
 
void transfer (dictionary &dict)
 Transfer the contents of the argument and annul the argument. More...
 
void checkITstream (const ITstream &is, const word &keyword) const
 Check after reading if the input token stream has unconsumed tokens remaining or if there were no tokens in the first place. More...
 
bool read (Istream &is)
 Read dictionary from Istream (discards the header). Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character. More...
 
bool read (Istream &is, bool keepHeader)
 Read dictionary from Istream (optionally keeping the header) Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character. More...
 
void writeEntry (Ostream &os) const
 Write sub-dictionary with its dictName as its header. More...
 
void writeEntry (const keyType &keyword, Ostream &os) const
 Write sub-dictionary with the keyword as its header. More...
 
void writeEntries (Ostream &os, const bool extraNewLine=false) const
 Write dictionary entries. More...
 
void write (Ostream &os, const bool subDict=true) const
 Write dictionary, normally with sub-dictionary formatting. More...
 
const_searcher csearch (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Search dictionary for given keyword. More...
 
const_searcher search (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Search dictionary for given keyword. More...
 
searcher search (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Search dictionary for given keyword. More...
 
const_searcher csearchScoped (const word &keyword, enum keyType::option matchOpt) const
 Search using scoping. More...
 
const_searcher searchScoped (const word &keyword, enum keyType::option matchOpt) const
 Search using dot or slash scoping. More...
 
searcher searchScoped (const word &keyword, enum keyType::option matchOpt)
 Search using dot or slash scoping. More...
 
const dictionarycfindScopedDict (const fileName &dictPath) const
 Locate a sub-dictionary using slash-scoping. More...
 
const dictionaryfindScopedDict (const fileName &dictPath) const
 Locate a sub-dictionary using slash-scoping. More...
 
dictionaryfindScopedDict (const fileName &dictPath)
 Locate a sub-dictionary using slash-scoping. More...
 
dictionarymakeScopedDict (const fileName &dictPath)
 Locate existing or create sub-dictionary using slash-scoping. More...
 
const_searcher csearchCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option matchOpt=keyType::REGEX) const
 Search dictionary for given keyword and any compatibility names. More...
 
const entryfindCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option matchOpt) const
 Find and return an entry pointer if present, or return a nullptr, using any compatibility names if needed. More...
 
bool foundCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option matchOpt=keyType::REGEX) const
 Search dictionary for given keyword and any compatibility names. More...
 
const entrylookupEntryCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option matchOpt) const
 Find and return an entry if present, otherwise FatalIOError, using any compatibility names if needed. More...
 
ITstreamlookupCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return an entry data stream, using any compatibility names if needed. More...
 
template<class T >
T getCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T using any compatibility names if needed. FatalIOError if not found, or if there are excess tokens. More...
 
template<class T >
T getOrDefaultCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T, or return the given default value using any compatibility names if needed. More...
 
template<class T >
bool readCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
 Find entry and assign to T val using any compatibility names if needed. FatalIOError if there are excess tokens. More...
 
template<class T >
bool readIfPresentCompat (const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry if present, and assign to T val using any compatibility names if needed. FatalIOError if it is found and there are excess tokens. More...
 
void operator= (const dictionary &rhs)
 Copy assignment. More...
 
void operator+= (const dictionary &rhs)
 Include entries from the given dictionary. More...
 
void operator|= (const dictionary &rhs)
 Conditionally include entries from the given dictionary. More...
 
void operator<<= (const dictionary &rhs)
 Unconditionally include entries from the given dictionary. More...
 
bool getBool (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get< bool >(const word&, keyType::option) More...
 
label getLabel (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get< label >(const word&, keyType::option) More...
 
scalar getScalar (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get< scalar >(const word&, keyType::option) More...
 
string getString (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get< string >(const word&, keyType::option) More...
 
word getWord (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get< word >(const word&, keyType::option) More...
 
fileName getFileName (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get< fileName >(const word&, keyType::option) More...
 
template<class T >
T lookupOrDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
 Same as getOrDefault() More...
 
template<class T >
T lookupOrAddDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX)
 Same as getOrAdd() More...
 
ITstreamoperator[] (const word &keyword) const
 Deprecated(2018-07) - use lookup() method. More...
 
bool found (const word &keyword, bool recursive, bool patternMatch=true) const
 Deprecated(2018-10) More...
 
entrylookupEntryPtr (const word &keyword, bool recursive, bool patternMatch)
 Deprecated(2018-10) More...
 
const entrylookupEntryPtr (const word &keyword, bool recursive, bool patternMatch) const
 Deprecated(2018-10) More...
 
const entrylookupScopedEntryPtr (const word &keyword, bool recursive, bool patternMatch) const
 Deprecated(2018-10) More...
 
const dictionarysubDictPtr (const word &keyword) const
 Deprecated(2018-10) More...
 
dictionarysubDictPtr (const word &keyword)
 Deprecated(2018-10) Find and return a sub-dictionary pointer if present. More...
 
const entrylookupEntry (const word &keyword, bool recursive, bool patternMatch) const
 Deprecated(2018-10) More...
 
ITstreamlookup (const word &keyword, bool recursive, bool patternMatch=true) const
 Deprecated(2018-10) More...
 
template<class T >
T lookupOrDefault (const word &keyword, const T &deflt, bool recursive, bool patternMatch=true) const
 Deprecated(2018-10) More...
 
template<class T >
T lookupOrAddDefault (const word &keyword, const T &deflt, bool recursive, bool patternMatch=true)
 Deprecated(2018-10) More...
 
template<class T >
bool readIfPresent (const word &keyword, T &val, bool recursive, bool patternMatch=true) const
 Deprecated(2018-10) More...
 
template<class T >
T lookupType (const word &keyword, bool recursive=false, bool patternMatch=true) const
 Deprecated(2018-10) find and return a T. More...
 
template<class Compare >
Foam::wordList sortedToc (const Compare &comp) const
 
template<class T >
Foam::entryadd (const keyType &k, const T &v, bool overwrite)
 
template<class T >
Foam::entryset (const keyType &k, const T &v)
 
- Public Member Functions inherited from ILList< LListBase, T >
 ILList ()=default
 Default construct. More...
 
 ILList (T *item)
 Construct and add initial item pointer. More...
 
 ILList (Istream &is)
 Construct from Istream. More...
 
 ILList (const ILList< LListBase, T > &lst)
 Copy construct using the 'clone()' method for each element. More...
 
 ILList (ILList< LListBase, T > &&lst)
 Move construct. More...
 
template<class CloneArg >
 ILList (const ILList< LListBase, T > &lst, const CloneArg &cloneArg)
 Copy constructor with additional argument for clone 'clone()'. More...
 
template<class INew >
 ILList (Istream &is, const INew &inew)
 Construct from Istream using given Istream constructor class. More...
 
 ~ILList ()
 Destructor. Calls clear() More...
 
void clear ()
 Clear the contents of the list. More...
 
void pop_front (label n=1)
 Remove first element(s) from the list (deletes pointers) More...
 
bool erase (T *item)
 Remove the specified element from the list and delete it. More...
 
void transfer (ILList< LListBase, T > &lst)
 Transfer the contents of the argument into this List and annul the argument list. More...
 
void operator= (const ILList< LListBase, T > &lst)
 Copy assignment using the 'clone()' method for each element. More...
 
void operator= (ILList< LListBase, T > &&lst)
 Move assignment. More...
 
- Public Member Functions inherited from UILList< LListBase, T >
 UILList ()=default
 Default construct. More...
 
 UILList (T *item)
 Construct and add initial item pointer. More...
 
 UILList (const UILList< LListBase, T > &list)
 Construct as copy. More...
 
Tfront ()
 The first entry in the list. More...
 
const Tfront () const
 The first entry in the list (const access) More...
 
Tback ()
 The last entry in the list. More...
 
const Tback () const
 The last entry in the list (const access) More...
 
TremoveHead ()
 Remove and return head. More...
 
Tremove (T *item)
 Remove and return element. More...
 
Tremove (iterator &iter)
 Remove and return item specified by iterator. More...
 
void operator= (const UILList< LListBase, T > &lst)
 Copy assignment. More...
 
bool operator== (const UILList< LListBase, T > &lst) const
 Equality. True both lists are element-wise equal. More...
 
bool operator!= (const UILList< LListBase, T > &lst) const
 The opposite of the equality operation. Takes linear time. More...
 
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write UILList with line-breaks when length exceeds shortLen. More...
 
iterator begin ()
 Iterator to first item in list with non-const access. More...
 
const_iterator cbegin () const
 Iterator to first item in list with const access. More...
 
reverse_iterator rbegin ()
 Iterator to last item in list with non-const access. More...
 
const_reverse_iterator crbegin () const
 Iterator to last item in list with const access. More...
 
const_iterator begin () const
 Iterator to first item in list with const access. More...
 
const_reverse_iterator rbegin () const
 Iterator to last item in list with const access. More...
 
const iteratorend ()
 End of list for forward iterators. More...
 
const const_iteratorcend () const
 End of list for forward iterators. More...
 
const reverse_iteratorrend ()
 End of list for reverse iterators. More...
 
const const_reverse_iteratorcrend () const
 End of list for reverse iterators. More...
 
const const_iteratorend () const
 End of list for forward iterators. More...
 
const const_reverse_iteratorrend () const
 End of list for reverse iterators. More...
 
Tfirst ()
 The first entry in the list. More...
 
const Tfirst () const
 The first entry in the list (const access) More...
 
Tlast ()
 The last entry in the list. More...
 
const Tlast () const
 The last entry in the list (const access) More...
 

Protected Member Functions

void updateSizes ()
 Update sizes of fields related to the active design variables. More...
 
void initializeRho ()
 Initialize rho constants in the (p, q) functions. More...
 
void updateBounds ()
 Update the bounds associated with the design variables. More...
 
void initialize ()
 Allocate fields related to constraints. More...
 
void storeOldValues ()
 Store old objcective and constraint values. More...
 
tmp< scalarFieldp (const scalarField &derivs, const scalar r, const scalarField &x)
 p and q functions, used to approximate the objective and contraints More...
 
tmp< scalarFieldp (const scalarField &derivs, const scalar r)
 
tmp< scalarFieldq (const scalarField &derivs, const scalar r, const scalarField &x)
 
tmp< scalarFieldq (const scalarField &derivs, const scalar r)
 
tmp< scalarFieldgConstr (const scalarField &vars)
 g of all constraint functions More...
 
tmp< scalarFieldb ()
 The rhs of the contraint approximations. More...
 
tmp< scalarFieldpLamda ()
 p and q functions, using the dual lamda More...
 
tmp< scalarFieldqLamda ()
 
void zeroUpdates ()
 Zero the updates computed in the previous optimisation cycle. More...
 
scalar fTilda (const scalarField &xInit, const scalarField &x, const scalar f, const scalarField &dfdx, const scalar rho)
 Computation of the approximate function. More...
 
tmp< scalarFieldgetOrDefaultScalarField (const word &name, const label size, const scalar value=Zero)
 Read in scalarField from self (potentially in binary), or allocate field with the size of the active design variables and given value. More...
 
void setOrDefaultScalarField (scalarField &field, const word &name, const label size, const scalarField &defaultField)
 Read in scalarField from self (potentially in binary), or allocate field with the size of the active design variables and given value. More...
 
void computeNewtonDirection ()
 Compute direction for the Newton problem. More...
 
scalar lineSearch ()
 Perform line search and return max residual corresponding to the updated solution. More...
 
void updateSolution (const scalar step)
 Update the current solution using the known direction and the given step length. More...
 
void adjustStep (scalar &step, const scalar value, const scalar update)
 Adjust step to satisfy cireteria. More...
 
tmp< scalarFieldcomputeResiduals ()
 Compute and return residuals based on the current solution. More...
 
void normalise ()
 Normalise the objective and constraints if necessary. More...
 
- Protected Member Functions inherited from updateMethod
const scalarField leftMult (const scalarField &, const SquareMatrix< scalar > &)
 
const scalarField rightMult (const SquareMatrix< scalar > &, const scalarField &)
 
SquareMatrix< scalar > outerProd (const scalarField &, const scalarField &)
 
SquareMatrix< scalar > inv (SquareMatrix< scalar > A)
 
scalar globalSum (const scalarField &field)
 Compute either global or local sum, based on globalSum flag. More...
 
scalar globalSum (tmp< scalarField > &tfield)
 Compute either global or local sum, based on globalSum flag. More...
 
label globalSum (const label)
 Compute either global or local sum, based on globalSum flag. More...
 
tmp< scalarFieldreadOrZeroField (const word &name, const label size)
 Helper function to either read a scalarField of certain size from a dictionary, or construct a zero field. More...
 
- Protected Member Functions inherited from regIOobject
bool readHeaderOk (const IOstreamOption::streamFormat fmt, const word &typeName)
 Helper: check readOpt flags and read if necessary. More...
 
- Protected Member Functions inherited from IOobject
void setBad (const string &s)
 Set the object state to bad. More...
 

Protected Attributes

scalarField x0_
 The previous design variables. Used to compute new bounds. More...
 
scalarField x00_
 The twice previous design variables. Used to compute new bounds. More...
 
scalarField xNew_
 The set of design variables being updated during the subproblem. More...
 
scalar oldObjectiveValue_
 Old objective value. More...
 
scalarField oldCValues_
 Old constraint values. More...
 
PtrList< scalarFieldvalsAndApproxs_
 Objective/Constraint values and approximations in the new point. More...
 
scalar z_
 Second term in the approximation function. More...
 
scalar alpha0_
 Term multiplying z in the objective function. More...
 
scalarField alpha_
 Terms multyplying z in the constraint functions. More...
 
scalarField y_
 y in the constraints functions More...
 
scalarField c_
 y multipliers in the objective function More...
 
scalarField d_
 y^2 multipliers in the objective function More...
 
scalarField lower_
 Lower design variables asymptotes. More...
 
scalarField upper_
 Upper design variables asymptotes. More...
 
scalarField a_
 Lower design variables constraints. More...
 
scalarField b_
 Upper design variables constraints. More...
 
scalarField rho_
 Constants in the (p,q) functions. More...
 
bool boundRho_
 Bound the rho value with an upper value? More...
 
bool correctDVs_
 Correct the design variables. More...
 
scalarField lamda_
 Constraint Lagrange multipliers. More...
 
scalarField ksi_
 Lagrange multipliers for the lower limits constraints. More...
 
scalarField Eta_
 Lagrange multipliers for the upper limits constraints. More...
 
scalarField mu_
 Lagrange multipliers for the y constraints. More...
 
scalar zeta_
 Lagrange multiplier for the z constraint. More...
 
scalarField s_
 Slack variables for the inequality constraints. More...
 
scalarField deltaLamda_
 
scalar deltaZ_
 
scalarField deltaX_
 
scalarField deltaY_
 
scalarField deltaS_
 
scalar deltaZeta_
 
scalarField deltaMu_
 
scalarField deltaEta_
 
scalarField deltaKsi_
 
scalar eps_
 Infinitesimal quantity. More...
 
label maxNewtonIters_
 Maxmimum number of Newton iterations for the subproblem. More...
 
label maxLineSearchIters_
 Maxmimum number of line search iterations for each iteration of the subproblem. More...
 
bool initializeEverySubproblem_
 Initialize every subproblem with x = 0.5*(a + b) and reset Lagrange multipliers. More...
 
scalar asymDecr_
 Lower assymprote reduction rate. More...
 
scalar asymIncr_
 Upper assymprote increase rate. More...
 
scalar sInit_
 Used to update the assymptotes in the first optimisation cycle. More...
 
scalar move_
 Movement of the unatainable upper and lower bounds. More...
 
scalar raa0_
 Constant in p, q functions. More...
 
scalar maxInitRhoMult_
 Multiplier of the mean derivative used for the initialisation of rho. More...
 
scalar maxRhoMult_
 Multiplier for the max. rho value during its update. More...
 
bool variableRho_
 Change rho constants in each iteration? More...
 
bool dynamicRhoInitialisation_
 Change rho constants in each iteration? More...
 
scalar dynamicRhoMult_
 The rho values obtained by the dynamic rho initialisation might be too conservative. Multiply with this number to relax them. More...
 
bool normalise_
 Perform the normalisation. More...
 
bool continuousNormalisation_
 Perform the normalisation in each optimisation cycle. More...
 
autoPtr< scalar > Jnorm_
 Normalisation factor for the objective. More...
 
tmp< scalarFieldCnorm_
 Normalisation factors for the constraints. More...
 
scalar cw_
 Constaint weight after the normalisation. More...
 
label lastNormalisationStep_
 Constaint weight after the normalisation. More...
 
- Protected Attributes inherited from updateMethod
const fvMeshmesh_
 
const dictionary dict_
 
autoPtr< designVariables > & designVars_
 Design variables. More...
 
label nConstraints_
 Number of constraints. More...
 
const labelListactiveDesignVars_
 Map to active design variables. More...
 
scalarField objectiveDerivatives_
 Derivatives of the objective functions. More...
 
PtrList< scalarFieldconstraintDerivatives_
 Derivatives of the constraints. More...
 
scalar objectiveValue_
 Objective value. More...
 
scalar objectiveValueOld_
 Old objective value. More...
 
scalarField cValues_
 Constraint values. More...
 
scalarField correction_
 Design variables correction. More...
 
scalarField cumulativeCorrection_
 Cumulative design variables correction throughout the optimisation loop. More...
 
scalar eta_
 Step multiplying the correction. More...
 
label counter_
 Optimisation cycle count. More...
 
bool initialEtaSet_
 Is initially set? More...
 
word correctionFolder_
 Folder storing the corrections to file. More...
 
bool globalSum_
 Whether to use gSum or sum in the inner products. More...
 

Additional Inherited Members

- Public Types inherited from IOobject
enum  objectState : char { GOOD, BAD }
 Enumeration defining the valid states of an IOobject. More...
 
enum  fileCheckTypes : char { timeStamp, timeStampMaster, inotify, inotifyMaster }
 Enumeration defining the file checking options. More...
 
- Public Types inherited from IOobjectOption
enum  readOption : unsigned char {
  NO_READ = 0, MUST_READ = 0x1, READ_MODIFIED = 0x3, MUST_READ_IF_MODIFIED = 0x3,
  LAZY_READ = 0x4, READ_IF_PRESENT = 0x4
}
 Enumeration defining read preferences. More...
 
enum  writeOption : unsigned char { NO_WRITE = 0, AUTO_WRITE = 0x10 }
 Enumeration defining write preferences. More...
 
enum  registerOption : unsigned char { NO_REGISTER = 0, REGISTER = 1, LEGACY_REGISTER = 2 }
 Enumeration for use with registerObject(). Values map to bool (false/true) More...
 
- Public Types inherited from dictionary
typedef Searcher< true > const_searcher
 Searcher with const access. More...
 
typedef Searcher< false > searcher
 Searcher with non-const access. More...
 
- Public Types inherited from UILList< LListBase, T >
typedef T value_type
 Type of values stored. More...
 
typedef Tpointer
 Pointer for value_type. More...
 
typedef const Tconst_pointer
 Const pointer for value_type. More...
 
typedef Treference
 Reference for value_type. More...
 
typedef const Tconst_reference
 Const reference for value_type. More...
 
typedef label size_type
 The type that can represent the container size. More...
 
typedef label difference_type
 The difference between iterator objects. More...
 
using base_iterator = typename LListBase::iterator
 
using const_base_iterator = typename LListBase::const_iterator
 
- Static Public Member Functions inherited from updateMethod
static autoPtr< updateMethodNew (const fvMesh &mesh, const dictionary &dict, autoPtr< designVariables > &designVars, const label nConstraints)
 Return a reference to the selected turbulence model. More...
 
- Static Public Member Functions inherited from localIOdictionary
static dictionary readContents (const IOobject &io)
 Read and return contents. The IOobject will not be registered. More...
 
- Static Public Member Functions inherited from regIOobject
template<class Type >
static Type & store (Type *p)
 Transfer pointer ownership to its registry. More...
 
template<class Type >
static Type & store (autoPtr< Type > &ptr)
 Transfer pointer ownership to its registry. More...
 
template<class Type >
static Type & store (autoPtr< Type > &&ptr)
 Transfer pointer ownership to its registry. More...
 
template<class Type >
static Type & store (refPtr< Type > &ptr)
 Transfer pointer ownership to its registry. More...
 
template<class Type >
static Type & store (refPtr< Type > &&ptr)
 Transfer pointer ownership to its registry. More...
 
template<class Type >
static Type & store (tmp< Type > &ptr)
 Transfer pointer ownership to its registry. More...
 
template<class Type >
static Type & store (tmp< Type > &&ptr)
 Transfer pointer ownership to its registry. More...
 
- Static Public Member Functions inherited from IOobject
static bool bannerEnabled () noexcept
 Status of output file banner. More...
 
static bool bannerEnabled (bool on) noexcept
 Enable/disable output file banner. More...
 
static bool fileNameComponents (const fileName &path, fileName &instance, fileName &local, word &name)
 Split path into instance, local, name components. More...
 
template<class StringType >
static word groupName (StringType base, const word &group)
 Create dot-delimited name.group string. More...
 
static word group (const word &name)
 Return group (extension part of name) More...
 
static word member (const word &name)
 Return member (name without the extension) More...
 
static word scopedName (const std::string &scope, const word &name)
 Create scope:name or scope_name string. More...
 
static word scopedName (const std::string &scope, const word &name1, const word &name2)
 Create scope:name1:name2 or scope_name1_name2 string. More...
 
static IOobject selectIO (const IOobject &io, const fileName &altFile, const word &ioName="")
 Return the IOobject, but also consider an alternative file name. More...
 
static OstreamwriteBanner (Ostream &os, const bool noSyntaxHint=false)
 Write the standard OpenFOAM file/dictionary banner. More...
 
static OstreamwriteDivider (Ostream &os)
 Write the standard file section divider. More...
 
static OstreamwriteEndDivider (Ostream &os)
 Write the standard end file divider. More...
 
- Static Public Member Functions inherited from IOobjectOption
static bool isAnyRead (readOption opt) noexcept
 True if any reading may be required (ie, != NO_READ) More...
 
static bool isReadRequired (readOption opt) noexcept
 True if (MUST_READ | READ_MODIFIED) bits are set. More...
 
static bool isReadOptional (readOption opt) noexcept
 True if (LAZY_READ) bits are set [same as READ_IF_PRESENT]. More...
 
static readOption lazierRead (readOption opt) noexcept
 Downgrade readOption optional (LAZY_READ), leaves NO_READ intact. More...
 
- Static Public Member Functions inherited from dictionary
static int reportOptional () noexcept
 Return the state of reporting optional (default) entries. More...
 
static int reportOptional (const int level) noexcept
 Change the state of reporting optional (default) entries. More...
 
static autoPtr< dictionaryNew (Istream &is)
 Construct top-level dictionary on freestore from Istream. More...
 
- Public Attributes inherited from dictionary
friend const_searcher
 Declare friendship with the searcher classes. More...
 
friend searcher
 
- Static Public Attributes inherited from IOobject
static const Enum< fileCheckTypesfileCheckTypesNames
 Names for the fileCheckTypes. More...
 
static char scopeSeparator
 Character for scoping object names (':' or '_') More...
 
static fileCheckTypes fileModificationChecking
 Type of file modification checking. More...
 
static float fileModificationSkew
 Time skew (seconds) for file modification checks. More...
 
static int maxFileModificationPolls
 Max number of times to poll for file modification changes. More...
 
- Static Public Attributes inherited from dictionary
static int writeOptionalEntries
 Report optional keywords and values if not present in dictionary. More...
 
static const dictionary null
 An empty dictionary, which is also the parent for all dictionaries. More...
 
static refPtr< OSstreamreportingOutput
 Output location when reporting default values. More...
 
- Static Protected Member Functions inherited from IOobject
static void writeHeaderContent (Ostream &os, const IOobject &io, const word &objectType, const dictionary *metaDataDict=nullptr)
 Helper: write content for FoamFile IOobject header with optional meta information. More...
 
static void writeHeaderContent (dictionary &dict, const IOobject &io, const word &objectType, IOstreamOption streamOpt, const dictionary *metaDataDict=nullptr)
 Helper: write dictionary content for FoamFile header with optional meta information. More...
 
- Static Protected Attributes inherited from regIOobject
static bool masterOnlyReading = false
 To flag master-only reading of objects. More...
 

Detailed Description

Update design variables using the Method of Moving Assymptotes. Can handle inequality constraints.

Reference:

    Svanberg, K. (1987)
    The method of moving asymptotes—a new method for structural
    optimization
    International Journal for Numerical Methods in Engineering, 24(2),
    359-373.
    https://doi.org/10.1002/nme.1620240207
Source files

Definition at line 61 of file MMA.H.

Constructor & Destructor Documentation

◆ MMA()

MMA ( const fvMesh mesh,
const dictionary dict,
autoPtr< designVariables > &  designVars,
const label  nConstraints,
const word type 
)

Construct from components.

Definition at line 864 of file MMA.C.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ ~MMA()

virtual ~MMA ( )
virtualdefault

Destructor.

Member Function Documentation

◆ updateSizes()

void updateSizes ( )
protected

Update sizes of fields related to the active design variables.

Definition at line 48 of file MMA.C.

References MMA::a_, updateMethod::activeDesignVars_, MMA::b_, MMA::deltaEta_, MMA::deltaKsi_, MMA::deltaX_, MMA::Eta_, MMA::ksi_, MMA::lower_, n, List< T >::setSize(), UList< T >::size(), MMA::upper_, MMA::x00_, MMA::x0_, MMA::xNew_, and Foam::Zero.

Here is the call graph for this function:

◆ initializeRho()

void initializeRho ( )
protected

Initialize rho constants in the (p, q) functions.

These control how aggressive or conservative the method will be

Definition at line 69 of file MMA.C.

References DebugInfo, Foam::constant::electromagnetic::e, Foam::endl(), forAll, Foam::Info, Foam::mag(), Field< Type >::map(), Foam::max(), Foam::nl, x, xMax, and xMin.

Here is the call graph for this function:

◆ updateBounds()

void updateBounds ( )
protected

Update the bounds associated with the design variables.

Definition at line 176 of file MMA.C.

References forAll, gamma, Foam::max(), Foam::min(), x, xMax, and xMin.

Here is the call graph for this function:

◆ initialize()

void initialize ( )
protected

Allocate fields related to constraints.

Definition at line 215 of file MMA.C.

References Foam::max(), and Foam::Zero.

Here is the call graph for this function:

◆ storeOldValues()

void storeOldValues ( )
protected

Store old objcective and constraint values.

Needed by GCMMA

Definition at line 249 of file MMA.C.

◆ p() [1/2]

Foam::tmp< Foam::scalarField > p ( const scalarField derivs,
const scalar  r,
const scalarField x 
)
protected

p and q functions, used to approximate the objective and contraints

Computed based on the current set of design variables, not updated during the iterations of the subproblem

Definition at line 261 of file MMA.C.

References Foam::max(), tmp< T >::ref(), Foam::sqr(), x, and Foam::Zero.

Here is the call graph for this function:

◆ p() [2/2]

Foam::tmp< Foam::scalarField > p ( const scalarField derivs,
const scalar  r 
)
protected

Definition at line 290 of file MMA.C.

References p.

◆ q() [1/2]

Foam::tmp< Foam::scalarField > q ( const scalarField derivs,
const scalar  r,
const scalarField x 
)
protected

Definition at line 301 of file MMA.C.

References Foam::max(), tmp< T >::ref(), Foam::sqr(), x, and Foam::Zero.

Here is the call graph for this function:

◆ q() [2/2]

Foam::tmp< Foam::scalarField > q ( const scalarField derivs,
const scalar  r 
)
protected

Definition at line 330 of file MMA.C.

◆ gConstr()

Foam::tmp< Foam::scalarField > gConstr ( const scalarField vars)
protected

g of all constraint functions

Computed using the current set of design variables, updated during the solution of the subproblem

Definition at line 341 of file MMA.C.

References forAll, p, tmp< T >::ref(), and Foam::Zero.

Here is the call graph for this function:

◆ b()

Foam::tmp< Foam::scalarField > b ( )
protected

The rhs of the contraint approximations.

Always computed using the current (frozen) set of design variables

Definition at line 362 of file MMA.C.

◆ pLamda()

Foam::tmp< Foam::scalarField > pLamda ( )
protected

p and q functions, using the dual lamda

Definition at line 371 of file MMA.C.

References forAll, p, and tmp< T >::ref().

Here is the call graph for this function:

◆ qLamda()

Foam::tmp< Foam::scalarField > qLamda ( )
protected

Definition at line 389 of file MMA.C.

References forAll, and tmp< T >::ref().

Here is the call graph for this function:

◆ zeroUpdates()

void zeroUpdates ( )
protected

Zero the updates computed in the previous optimisation cycle.

Definition at line 407 of file MMA.C.

References Foam::Zero.

◆ fTilda()

Foam::scalar fTilda ( const scalarField xInit,
const scalarField x,
const scalar  f,
const scalarField dfdx,
const scalar  rho 
)
protected

Computation of the approximate function.

Definition at line 422 of file MMA.C.

References f(), p, rho, and x.

Here is the call graph for this function:

◆ getOrDefaultScalarField()

Foam::tmp< Foam::scalarField > getOrDefaultScalarField ( const word name,
const label  size,
const scalar  value = Zero 
)
protected

Read in scalarField from self (potentially in binary), or allocate field with the size of the active design variables and given value.

Definition at line 443 of file MMA.C.

References field(), found, Foam::name(), and tmp< T >::ref().

Here is the call graph for this function:

◆ setOrDefaultScalarField()

void setOrDefaultScalarField ( scalarField field,
const word name,
const label  size,
const scalarField defaultField 
)
protected

Read in scalarField from self (potentially in binary), or allocate field with the size of the active design variables and given value.

Definition at line 460 of file MMA.C.

References field(), found, and Foam::name().

Here is the call graph for this function:

◆ computeNewtonDirection()

void computeNewtonDirection ( )
protected

Compute direction for the Newton problem.

Definition at line 478 of file MMA.C.

References Foam::constant::physicoChemical::b, forAll, Foam::constant::universal::G, Pstream::listCombineAllGather(), n, p, Foam::pow3(), Foam::reduce(), Foam::solve(), Foam::sqr(), Foam::sum(), x, and Foam::Zero.

Here is the call graph for this function:

◆ lineSearch()

Foam::scalar lineSearch ( )
protected

Perform line search and return max residual corresponding to the updated solution.

Definition at line 626 of file MMA.C.

References Foam::ensightOutput::debug, DebugInfo, Foam::endl(), Foam::gMax(), Foam::Info, Foam::mag(), Foam::magSqr(), n, Foam::nl, Foam::reduce(), and Foam::sqrt().

Here is the call graph for this function:

◆ updateSolution()

void updateSolution ( const scalar  step)
protected

Update the current solution using the known direction and the given step length.

Definition at line 743 of file MMA.C.

◆ adjustStep()

void adjustStep ( scalar &  step,
const scalar  value,
const scalar  update 
)
protected

Adjust step to satisfy cireteria.

Definition at line 730 of file MMA.C.

References update().

Here is the call graph for this function:

◆ computeResiduals()

Foam::tmp< Foam::scalarField > computeResiduals ( )
protected

Compute and return residuals based on the current solution.

Definition at line 757 of file MMA.C.

References Foam::constant::physicoChemical::b, n, Foam::sqr(), Foam::sum(), and Foam::Zero.

Here is the call graph for this function:

◆ normalise()

void normalise ( )
protected

Normalise the objective and constraints if necessary.

Definition at line 821 of file MMA.C.

References Foam::endl(), forAll, Foam::Info, Foam::nl, Foam::sqr(), Foam::sqrt(), and Foam::Zero.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "MMA"  )

Runtime type information.

◆ computeCorrection()

void computeCorrection ( )
virtual

Compute design variables correction.

Implements updateMethod.

Definition at line 967 of file MMA.C.

◆ solveSubproblem()

void solveSubproblem ( )

Solve subproblem using a Newton optimiser.

Definition at line 999 of file MMA.C.

References DebugInfo, Foam::constant::electromagnetic::e, Foam::endl(), forAll, Foam::gMax(), Foam::Info, Foam::mag(), and Foam::nl.

Here is the call graph for this function:

◆ updateValuesAndApproximations()

void updateValuesAndApproximations ( )

Compute objective/constraint values and their approximations.

Needed to check convergence and update rho, if necessary

Definition at line 1047 of file MMA.C.

References forAll, and Foam::Zero.

◆ getValuesAndApproximations()

const Foam::PtrList< Foam::scalarField > & getValuesAndApproximations ( ) const

Get objective/constraint values and their approximations.

Definition at line 1077 of file MMA.C.

Referenced by GCMMA::writeToFiles().

Here is the caller graph for this function:

◆ updateRho()

void updateRho ( )

Update rho value if needed.

Definition at line 1083 of file MMA.C.

References DebugInfo, delta, Foam::endl(), forAll, Foam::min(), Foam::sqr(), xMax, and xMin.

Here is the call graph for this function:

◆ getRho()

const Foam::scalarField & getRho ( ) const

Get rho value if needed.

Definition at line 1112 of file MMA.C.

Referenced by GCMMA::writeToFiles().

Here is the caller graph for this function:

◆ setVariableRho()

void setVariableRho ( bool  varRho = true)

Set variable rho.

Definition at line 1118 of file MMA.C.

◆ converged()

bool converged ( )

Checks convergence of GCMMA.

Definition at line 1124 of file MMA.C.

References DebugInfo, Foam::endl(), forAll, and Foam::nl.

Here is the call graph for this function:

◆ writeData()

bool writeData ( Ostream os) const
virtual

Write useful quantities to files.

Reimplemented from updateMethod.

Definition at line 1144 of file MMA.C.

References os(), updateMethod::writeData(), and Ostream::writeEntry().

Here is the call graph for this function:

Member Data Documentation

◆ x0_

scalarField x0_
protected

The previous design variables. Used to compute new bounds.

Definition at line 73 of file MMA.H.

Referenced by MMA::updateSizes().

◆ x00_

scalarField x00_
protected

The twice previous design variables. Used to compute new bounds.

Definition at line 78 of file MMA.H.

Referenced by MMA::updateSizes().

◆ xNew_

scalarField xNew_
protected

The set of design variables being updated during the subproblem.

Correction will end up being the difference of this and the old values of the design variables

Definition at line 86 of file MMA.H.

Referenced by MMA::updateSizes().

◆ oldObjectiveValue_

scalar oldObjectiveValue_
protected

Old objective value.

Needed by GCMMA

Definition at line 93 of file MMA.H.

◆ oldCValues_

scalarField oldCValues_
protected

Old constraint values.

Needed by GCMMA

Definition at line 100 of file MMA.H.

◆ valsAndApproxs_

PtrList<scalarField> valsAndApproxs_
protected

Objective/Constraint values and approximations in the new point.

Needed by GCMMA

Definition at line 107 of file MMA.H.

◆ z_

scalar z_
protected

Second term in the approximation function.

Definition at line 112 of file MMA.H.

◆ alpha0_

scalar alpha0_
protected

Term multiplying z in the objective function.

Definition at line 117 of file MMA.H.

◆ alpha_

scalarField alpha_
protected

Terms multyplying z in the constraint functions.

Definition at line 122 of file MMA.H.

◆ y_

scalarField y_
protected

y in the constraints functions

Definition at line 127 of file MMA.H.

◆ c_

scalarField c_
protected

y multipliers in the objective function

Definition at line 132 of file MMA.H.

◆ d_

scalarField d_
protected

y^2 multipliers in the objective function

Definition at line 137 of file MMA.H.

◆ lower_

scalarField lower_
protected

Lower design variables asymptotes.

Definition at line 142 of file MMA.H.

Referenced by MMA::updateSizes().

◆ upper_

scalarField upper_
protected

Upper design variables asymptotes.

Definition at line 147 of file MMA.H.

Referenced by MMA::updateSizes().

◆ a_

scalarField a_
protected

Lower design variables constraints.

Definition at line 152 of file MMA.H.

Referenced by MMA::updateSizes().

◆ b_

scalarField b_
protected

Upper design variables constraints.

Definition at line 157 of file MMA.H.

Referenced by MMA::updateSizes().

◆ rho_

scalarField rho_
protected

Constants in the (p,q) functions.

Size is cValues_.size() + 1 (the objective)

Definition at line 164 of file MMA.H.

◆ boundRho_

bool boundRho_
protected

Bound the rho value with an upper value?

Definition at line 169 of file MMA.H.

◆ correctDVs_

bool correctDVs_
protected

Correct the design variables.

Definition at line 174 of file MMA.H.

◆ lamda_

scalarField lamda_
protected

Constraint Lagrange multipliers.

Definition at line 181 of file MMA.H.

◆ ksi_

scalarField ksi_
protected

Lagrange multipliers for the lower limits constraints.

Definition at line 186 of file MMA.H.

Referenced by MMA::updateSizes().

◆ Eta_

scalarField Eta_
protected

Lagrange multipliers for the upper limits constraints.

Definition at line 191 of file MMA.H.

Referenced by MMA::updateSizes().

◆ mu_

scalarField mu_
protected

Lagrange multipliers for the y constraints.

Definition at line 196 of file MMA.H.

◆ zeta_

scalar zeta_
protected

Lagrange multiplier for the z constraint.

Definition at line 201 of file MMA.H.

◆ s_

scalarField s_
protected

Slack variables for the inequality constraints.

Definition at line 206 of file MMA.H.

◆ deltaLamda_

scalarField deltaLamda_
protected

Definition at line 211 of file MMA.H.

◆ deltaZ_

scalar deltaZ_
protected

Definition at line 212 of file MMA.H.

◆ deltaX_

scalarField deltaX_
protected

Definition at line 213 of file MMA.H.

Referenced by MMA::updateSizes().

◆ deltaY_

scalarField deltaY_
protected

Definition at line 214 of file MMA.H.

◆ deltaS_

scalarField deltaS_
protected

Definition at line 215 of file MMA.H.

◆ deltaZeta_

scalar deltaZeta_
protected

Definition at line 216 of file MMA.H.

◆ deltaMu_

scalarField deltaMu_
protected

Definition at line 217 of file MMA.H.

◆ deltaEta_

scalarField deltaEta_
protected

Definition at line 218 of file MMA.H.

Referenced by MMA::updateSizes().

◆ deltaKsi_

scalarField deltaKsi_
protected

Definition at line 219 of file MMA.H.

Referenced by MMA::updateSizes().

◆ eps_

scalar eps_
protected

Infinitesimal quantity.

Updated during the inner iterations of the subproblem

Definition at line 227 of file MMA.H.

◆ maxNewtonIters_

label maxNewtonIters_
protected

Maxmimum number of Newton iterations for the subproblem.

Definition at line 232 of file MMA.H.

◆ maxLineSearchIters_

label maxLineSearchIters_
protected

Maxmimum number of line search iterations for each iteration of the subproblem.

Definition at line 238 of file MMA.H.

◆ initializeEverySubproblem_

bool initializeEverySubproblem_
protected

Initialize every subproblem with x = 0.5*(a + b) and reset Lagrange multipliers.

The solution of the subproblem can become relatively expensive in some cases, hence the GCMMA subproblems are usually initialized with the solution of the previous inner iteration, to save up some time. Occassionally, this can cause the solution of the subproblem to be trapped in a non-feasible point. In such cases, the solution of each subproblem could be initialized from scratch

Definition at line 252 of file MMA.H.

◆ asymDecr_

scalar asymDecr_
protected

Lower assymprote reduction rate.

Definition at line 260 of file MMA.H.

◆ asymIncr_

scalar asymIncr_
protected

Upper assymprote increase rate.

Definition at line 265 of file MMA.H.

◆ sInit_

scalar sInit_
protected

Used to update the assymptotes in the first optimisation cycle.

Definition at line 270 of file MMA.H.

◆ move_

scalar move_
protected

Movement of the unatainable upper and lower bounds.

Definition at line 275 of file MMA.H.

◆ raa0_

scalar raa0_
protected

Constant in p, q functions.

Definition at line 280 of file MMA.H.

◆ maxInitRhoMult_

scalar maxInitRhoMult_
protected

Multiplier of the mean derivative used for the initialisation of rho.

Definition at line 289 of file MMA.H.

◆ maxRhoMult_

scalar maxRhoMult_
protected

Multiplier for the max. rho value during its update.

Definition at line 294 of file MMA.H.

◆ variableRho_

bool variableRho_
protected

Change rho constants in each iteration?

Definition at line 299 of file MMA.H.

◆ dynamicRhoInitialisation_

bool dynamicRhoInitialisation_
protected

Change rho constants in each iteration?

Definition at line 304 of file MMA.H.

◆ dynamicRhoMult_

scalar dynamicRhoMult_
protected

The rho values obtained by the dynamic rho initialisation might be too conservative. Multiply with this number to relax them.

Definition at line 311 of file MMA.H.

◆ normalise_

bool normalise_
protected

Perform the normalisation.

Definition at line 319 of file MMA.H.

◆ continuousNormalisation_

bool continuousNormalisation_
protected

Perform the normalisation in each optimisation cycle.

Definition at line 324 of file MMA.H.

◆ Jnorm_

autoPtr<scalar> Jnorm_
protected

Normalisation factor for the objective.

Definition at line 329 of file MMA.H.

◆ Cnorm_

tmp<scalarField> Cnorm_
protected

Normalisation factors for the constraints.

Definition at line 334 of file MMA.H.

◆ cw_

scalar cw_
protected

Constaint weight after the normalisation.

Definition at line 339 of file MMA.H.

◆ lastNormalisationStep_

label lastNormalisationStep_
protected

Constaint weight after the normalisation.

Definition at line 344 of file MMA.H.


The documentation for this class was generated from the following files: