INMOST
A toolkit for distributed mathematical modeling
|
The Automatizator class helps in defining primary unknowns of the model and enhances user experience in interaction with automatic differentiation functionality. More...
#include <inmost_autodiff.h>
Public Member Functions | |
Automatizator (const Automatizator &b) | |
Make a copy. More... | |
Automatizator & | operator= (Automatizator const &b) |
Performs assignment. More... | |
Automatizator (std::string name="") | |
Makes an empty Automatizator. | |
~Automatizator () | |
Destructor for the automatizator, deletes all the tags corresponding to indices from respective meshes. | |
__INLINE INMOST_DATA_ENUM_TYPE | GetFirstIndex () const |
Retrieve first index of unknowns, local to the processor. | |
__INLINE INMOST_DATA_ENUM_TYPE | GetLastIndex () const |
Retrieve last index of unknowns, local to the processor. | |
INMOST_DATA_ENUM_TYPE | RegisterTag (Tag t, ElementType typemask, MarkerType domain_mask=0, bool inverse=false) |
Set data of tag t defined on domain_mask to be dynamic data. More... | |
INMOST_DATA_ENUM_TYPE | RegisterEntry (const AbstractEntry &e) |
Register block with the automatizator. More... | |
INMOST_DATA_ENUM_TYPE | RegisterEntry (AbstractEntry &e) |
void | UnregisterEntry (INMOST_DATA_ENUM_TYPE ind) |
Erase a registered tag. More... | |
void | DeactivateEntry (INMOST_DATA_ENUM_TYPE ind) |
Swith a registered tag to be non-active, in this case it's unknowns are considered to be constant. More... | |
void | ActivateEntry (INMOST_DATA_ENUM_TYPE ind) |
Swith a registered tag to be active, in this case it's unknowns are considered to be variable. More... | |
void | EnumerateEntries (bool blocks=false) |
Set index for every data entry of dynamic tag. | |
__INLINE bool | isRegisteredEntry (INMOST_DATA_ENUM_TYPE ind) const |
Check whether the tag is still registered. More... | |
INMOST_DATA_ENUM_TYPE | GetIndex (const Storage &e, INMOST_DATA_ENUM_TYPE reg_index, INMOST_DATA_ENUM_TYPE pos=0) const |
Get index of the unknown associated with the entry on element. | |
INMOST_DATA_REAL_TYPE | GetValue (const Storage &e, INMOST_DATA_ENUM_TYPE reg_index, INMOST_DATA_ENUM_TYPE pos=0) const |
Get value of the unknown associated with the entry on element. | |
unknown | GetUnknown (const Storage &e, INMOST_DATA_ENUM_TYPE reg_index, INMOST_DATA_ENUM_TYPE pos=0) const |
Get unknown associated with the entry on element. | |
AbstractEntry & | GetEntry (INMOST_DATA_ENUM_TYPE ind) |
Retrieve the block from automatizator by index. | |
const AbstractEntry & | GetEntry (INMOST_DATA_ENUM_TYPE ind) const |
Retrieve the block from automatizator by index. | |
std::vector< INMOST_DATA_ENUM_TYPE > | ListRegisteredEntries () const |
Lists all the indices of registered tags. More... | |
void | SynchronizeData () |
Update variables contained in all block of automatizator on ghost elements of the grid. More... | |
The Automatizator class helps in defining primary unknowns of the model and enhances user experience in interaction with automatic differentiation functionality.
User may declare real-typed mesh data as primary unknowns on the mesh with the function RegisterTag. The returned integer code can be used with dynamic_variable class, that is part of automatic differentiation framework helping to assemble unknowns or expressions that could be evaluated into variable on the mesh element. In addition this class provides automatic differentiation with acceleration structures that help evaluate expressions faster.
Definition at line 391 of file inmost_autodiff.h.
INMOST::Automatizator::Automatizator | ( | const Automatizator & | b | ) |
Make a copy.
void INMOST::Automatizator::ActivateEntry | ( | INMOST_DATA_ENUM_TYPE | ind | ) |
Swith a registered tag to be active, in this case it's unknowns are considered to be variable.
ind | Integer returned from Automatizator::RegisterTag. |
void INMOST::Automatizator::DeactivateEntry | ( | INMOST_DATA_ENUM_TYPE | ind | ) |
Swith a registered tag to be non-active, in this case it's unknowns are considered to be constant.
ind | Integer returned from Automatizator::RegisterTag. |
|
inline |
Check whether the tag is still registered.
True | if tag is still registered. |
Definition at line 458 of file inmost_autodiff.h.
std::vector<INMOST_DATA_ENUM_TYPE> INMOST::Automatizator::ListRegisteredEntries | ( | ) | const |
Lists all the indices of registered tags.
Automatizator& INMOST::Automatizator::operator= | ( | Automatizator const & | b | ) |
Performs assignment.
INMOST_DATA_ENUM_TYPE INMOST::Automatizator::RegisterEntry | ( | const AbstractEntry & | e | ) |
Register block with the automatizator.
Note that copy of entry is stored with Automatizator.
b | Entry that represents block of indepenedent unknowns of the model. |
INMOST_DATA_ENUM_TYPE INMOST::Automatizator::RegisterTag | ( | Tag | t, |
ElementType | typemask, | ||
MarkerType | domain_mask = 0 , |
||
bool | inverse = false |
||
) |
Set data of tag t defined on domain_mask to be dynamic data.
t | Tag of DATA_REAL that represents independent data of the model. |
typemask | Element types on which that data is independent. |
domain_mask | Marker that may be used to mask indepndent data on certain elements. |
void INMOST::Automatizator::SynchronizeData | ( | ) |
Update variables contained in all block of automatizator on ghost elements of the grid.
For synchronization of data in individual blocks see AbstractEntry::SynchronizeData.
void INMOST::Automatizator::UnregisterEntry | ( | INMOST_DATA_ENUM_TYPE | ind | ) |
Erase a registered tag.
ind | Integer returned from Automatizator::RegisterTag. |