OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Class representing domain transaction manager. More...
#include <domaintransactionmanager.h>
Public Types | |
enum | DomainComponentType { DCT_DofManager, DCT_Element } |
enum | DomainTransactionType { DTT_ADD, DTT_Remove } |
Public Member Functions | |
DomainTransactionManager (Domain *d) | |
~DomainTransactionManager () | |
void | initialize () |
int | addDofManTransaction (DomainTransactionType, int, DofManager *) |
int | addElementTransaction (DomainTransactionType, int, Element *) |
DofManager * | giveDofManager (int label) |
Element * | giveElement (int label) |
int | commitTransactions () |
Protected Attributes | |
Domain * | domain |
std::map< int, DofManager * > | dofmanTransactions |
std::map< int, Element * > | elementTransactions |
Friends | |
class | Domain |
Class representing domain transaction manager.
The purpose of this class is to make the domain modification in terms of adding and deleting components) possible.
The changes are recorded in transaction manager and until the are committed, no change is reflected in domain itself.
When adding a new component has to be created and send as transaction parameter. The allocated component will be further maintained (and deallocated) in transaction manager or domain itself. When adding component a reference to already existing as well as newly added (but not yet committed) component must be possible. Therefore, the concept of temporary numbering is introduced. Existing domain components are assigned with temporary numbers equal to to their local numbers (in parallel version to their global numbers) and newly added components can be assigned with arbitrary temporary number (but which should be different from those already used). Then references between components for newly added components is specified using temporary numbering. After transactions are committed, the local numbering can change.
The user is responsible for data consistency, so for example if a node is removed, but an element exist that needs such node, then (hopefully) an error will be thrown since there is no mechanism for enforcing data consistency.
Transaction manager provides an access to recorded transactions; so it is possible to modify an existing transaction instead of posting a new one. However, transaction manager does not provides access to original unmodified domain components, since this can lead to their modification and since in the current implementation the transaction manager keeps only modified records, the original records are not returned. They must be requested from original domain, so it is clear that their modification is not part of transaction but it directly changes domain data.
Definition at line 75 of file domaintransactionmanager.h.
Enumerator | |
---|---|
DCT_DofManager | |
DCT_Element |
Definition at line 78 of file domaintransactionmanager.h.
Enumerator | |
---|---|
DTT_ADD | |
DTT_Remove |
Definition at line 79 of file domaintransactionmanager.h.
oofem::DomainTransactionManager::DomainTransactionManager | ( | Domain * | d | ) |
Definition at line 42 of file domaintransactionmanager.C.
References domain.
oofem::DomainTransactionManager::~DomainTransactionManager | ( | ) |
Definition at line 47 of file domaintransactionmanager.C.
References dofmanTransactions, elementTransactions, and OOFEM_WARNING.
int oofem::DomainTransactionManager::addDofManTransaction | ( | DomainTransactionType | dtt, |
int | label, | ||
DofManager * | obj | ||
) |
Definition at line 59 of file domaintransactionmanager.C.
References dofmanTransactions, and DTT_Remove.
Referenced by oofem::LoadBalancer::deleteRemoteDofManagers(), oofem::Subdivision::exchangeRemoteElements(), oofem::LoadBalancer::unpackMigratingData(), oofem::NonlocalMaterialWTP::unpackRemoteElements(), and oofem::Subdivision::unpackRemoteElements().
int oofem::DomainTransactionManager::addElementTransaction | ( | DomainTransactionType | dtt, |
int | label, | ||
Element * | obj | ||
) |
Definition at line 80 of file domaintransactionmanager.C.
References DTT_Remove, and elementTransactions.
Referenced by oofem::LoadBalancer::deleteRemoteElements(), oofem::Subdivision::exchangeRemoteElements(), oofem::LoadBalancer::unpackMigratingData(), oofem::NonlocalMaterialWTP::unpackRemoteElements(), and oofem::Subdivision::unpackRemoteElements().
int oofem::DomainTransactionManager::commitTransactions | ( | ) |
Definition at line 126 of file domaintransactionmanager.C.
References oofem::Domain::commitTransactions(), and domain.
DofManager * oofem::DomainTransactionManager::giveDofManager | ( | int | label | ) |
Definition at line 101 of file domaintransactionmanager.C.
References dofmanTransactions.
Referenced by oofem::Subdivision::unpackRemoteElements().
Element * oofem::DomainTransactionManager::giveElement | ( | int | label | ) |
Definition at line 113 of file domaintransactionmanager.C.
References elementTransactions.
void oofem::DomainTransactionManager::initialize | ( | ) |
Definition at line 55 of file domaintransactionmanager.C.
Definition at line 110 of file domaintransactionmanager.h.
|
protected |
Definition at line 94 of file domaintransactionmanager.h.
Referenced by addDofManTransaction(), oofem::Domain::commitTransactions(), giveDofManager(), oofem::Domain::renumberDofManData(), and ~DomainTransactionManager().
|
protected |
Definition at line 93 of file domaintransactionmanager.h.
Referenced by commitTransactions(), and DomainTransactionManager().
|
protected |
Definition at line 95 of file domaintransactionmanager.h.
Referenced by addElementTransaction(), oofem::Domain::commitTransactions(), giveElement(), oofem::Domain::renumberElementData(), and ~DomainTransactionManager().