INMOST
A toolkit for distributed mathematical modeling
INMOST::Automatizator Class Reference

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...
 
Automatizatoroperator= (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.
 
AbstractEntryGetEntry (INMOST_DATA_ENUM_TYPE ind)
 Retrieve the block from automatizator by index.
 
const AbstractEntryGetEntry (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...
 

Detailed Description

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.

Todo:
  1. (test) UnRegisterTag.
  2. (test) Copy constructor.
  3. Rename

Definition at line 391 of file inmost_autodiff.h.

Constructor & Destructor Documentation

◆ Automatizator()

INMOST::Automatizator::Automatizator ( const Automatizator b)

Make a copy.

Warning
Calls Automatizator::EnumerateEntries after copy for indices to be valid only if original was enumerated.

Member Function Documentation

◆ ActivateEntry()

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.

Parameters
indInteger returned from Automatizator::RegisterTag.
Warning
  1. Have to call Automatizator::EnumerateEntries to recompute indices.

◆ DeactivateEntry()

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.

Parameters
indInteger returned from Automatizator::RegisterTag.
Warning
  1. Have to call Automatizator::EnumerateEntries to recompute indices.

◆ isRegisteredEntry()

__INLINE bool INMOST::Automatizator::isRegisteredEntry ( INMOST_DATA_ENUM_TYPE  ind) const
inline

Check whether the tag is still registered.

Parameters
Trueif tag is still registered.

Definition at line 458 of file inmost_autodiff.h.

◆ ListRegisteredEntries()

std::vector<INMOST_DATA_ENUM_TYPE> INMOST::Automatizator::ListRegisteredEntries ( ) const

Lists all the indices of registered tags.

Returns
An array with indices corresponding to all registered tags.

◆ operator=()

Automatizator& INMOST::Automatizator::operator= ( Automatizator const &  b)

Performs assignment.

Warning
Calls Automatizator::EnumerateEntries after copy for indices to be valid only if original was enumerated.

◆ RegisterEntry()

INMOST_DATA_ENUM_TYPE INMOST::Automatizator::RegisterEntry ( const AbstractEntry e)

Register block with the automatizator.

Note that copy of entry is stored with Automatizator.

Parameters
bEntry that represents block of indepenedent unknowns of the model.
Warning
  1. If you create your entry with intention to use it after registration, then you should use the function as entry = aut.GetEntry(aut.RegisterEntry(entry));

◆ RegisterTag()

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.

Parameters
tTag of DATA_REAL that represents independent data of the model.
typemaskElement types on which that data is independent.
domain_maskMarker that may be used to mask indepndent data on certain elements.
Warning
  1. Don't register tag twice.
  2. Have to call Automatizator::EnumerateEntries to compute indices.

◆ SynchronizeData()

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.

◆ UnregisterEntry()

void INMOST::Automatizator::UnregisterEntry ( INMOST_DATA_ENUM_TYPE  ind)

Erase a registered tag.

Parameters
indInteger returned from Automatizator::RegisterTag.
Warning
  1. Have to call Automatizator::EnumerateEntries to recompute indices.

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