OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::FieldManager Class Reference

#include <fieldmanager.h>

Public Member Functions

 FieldManager ()
 
 ~FieldManager ()
 
void registerField (FieldPtr eField, FieldType key)
 Registers the given field (the receiver is not assumed to own given field). More...
 
FieldPtr giveField (FieldType key)
 Returns the previously registered field under given key; NULL otherwise. More...
 
bool isFieldRegistered (FieldType key)
 Returns true if field is registered under key. More...
 
void unregisterField (FieldType key)
 Unregisters (deletes) the field registered under given key. More...
 
std::vector< FieldTypegiveRegisteredKeys ()
 Returns list of registered field keys, which can be obtained by calling giveField. More...
 

Protected Attributes

std::map< FieldType, std::shared_ptr< Field > > externalFields
 Field container. More...
 

Detailed Description

Definition at line 47 of file fieldmanager.h.

Constructor & Destructor Documentation

oofem::FieldManager::FieldManager ( )
inline

Definition at line 61 of file fieldmanager.h.

oofem::FieldManager::~FieldManager ( )

Definition at line 38 of file fieldmanager.C.

Member Function Documentation

std::vector< FieldType > oofem::FieldManager::giveRegisteredKeys ( )

Returns list of registered field keys, which can be obtained by calling giveField.

Definition at line 86 of file fieldmanager.C.

References externalFields.

bool oofem::FieldManager::isFieldRegistered ( FieldType  key)

Returns true if field is registered under key.

Definition at line 57 of file fieldmanager.C.

References externalFields.

void oofem::FieldManager::registerField ( FieldPtr  eField,
FieldType  key 
)

Registers the given field (the receiver is not assumed to own given field).

The field is registered under given key. Using this key, it can be later accessed.

could be replaced in future by this->externalFields.insert_or_assign({key, eField});

Definition at line 42 of file fieldmanager.C.

References externalFields.

Referenced by oofem::StationaryTransportProblem::initializeFrom(), oofem::TransientTransportProblem::initializeFrom(), oofem::SUPG::initializeFrom(), and oofem::CBS::initializeFrom().

void oofem::FieldManager::unregisterField ( FieldType  key)

Unregisters (deletes) the field registered under given key.

Definition at line 75 of file fieldmanager.C.

References externalFields.

Member Data Documentation

std :: map< FieldType, std :: shared_ptr< Field > > oofem::FieldManager::externalFields
protected

Field container.

Stores smart pointers to objects (not object themselves) to avoid copying elements and to preserve the use of polymorphic types. The use of shared_ptr is essential here, as some registered fields may be ovned (and maintained) by emodel, some may be cretead on demand and thus managed only by field manager.

Definition at line 58 of file fieldmanager.h.

Referenced by giveField(), giveRegisteredKeys(), isFieldRegistered(), registerField(), and unregisterField().


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:35 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011