v0.14.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
MoFEM::SeriesRecorder Struct Reference

#include <src/interfaces/SeriesRecorder.hpp>

Inheritance diagram for MoFEM::SeriesRecorder:
[legend]
Collaboration diagram for MoFEM::SeriesRecorder:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 SeriesRecorder (const MoFEM::Core &core)
 
 ~SeriesRecorder ()
 destructor More...
 
MoFEMErrorCode getTags (int verb=-1)
 get tags handlers used on meshsets More...
 
Tag get_th_SeriesName ()
 
MoFEMErrorCode clearMap ()
 clear multi-index container More...
 
MoFEMErrorCode initialiseDatabaseFromMesh (int verb=0)
 
SeriesRecorderget_series_recorder_ptr ()
 return pointer to meshset manager More...
 
const SeriesRecorderget_series_recorder_ptr () const
 return pointer to meshset manager More...
 
virtual MoFEMErrorCode add_series_recorder (const std::string &series_name)
 
virtual MoFEMErrorCode delete_recorder_series (const std::string &series_name)
 
virtual MoFEMErrorCode initialize_series_recorder (const std::string &serie_name)
 
virtual MoFEMErrorCode finalize_series_recorder (const std::string &serie_name)
 
virtual MoFEMErrorCode record_begin (const std::string &serie_name)
 
virtual MoFEMErrorCode record_problem (const std::string &serie_name, const Problem *problemPtr, RowColData rc)
 
virtual MoFEMErrorCode record_problem (const std::string &serie_name, const std::string &problem_name, RowColData rc)
 
virtual MoFEMErrorCode record_field (const std::string &serie_name, const std::string &field_name, const BitRefLevel &bit, const BitRefLevel &mask)
 
virtual MoFEMErrorCode record_end (const std::string &serie_name, double time=0)
 
virtual MoFEMErrorCode load_series_data (const std::string &serie_name, const int step_number)
 
virtual MoFEMErrorCode print_series_steps ()
 
virtual bool check_series (const std::string &name) const
 check if series is in database More...
 
virtual SeriesStep_multiIndex::index< SeriesName_mi_tag >::type::iterator get_series_steps_byName_begin (const std::string &name)
 
virtual SeriesStep_multiIndex::index< SeriesName_mi_tag >::type::iterator get_series_steps_byName_end (const std::string &name)
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 

Public Attributes

MoFEM::CorecOre
 

Protected Attributes

Tag th_SeriesName
 Recorded series name. More...
 
Series_multiIndex sEries
 recorded series More...
 
SeriesStep_multiIndex seriesSteps
 recorded series steps More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version. More...
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version. More...
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version. More...
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version. More...
 

Detailed Description

Record (time) data series

Is abstraction of Core interface.

Bug:
fix names of this interface to follow naming convention
Examples
elasticity.cpp.

Definition at line 25 of file SeriesRecorder.hpp.

Constructor & Destructor Documentation

◆ SeriesRecorder()

MoFEM::SeriesRecorder::SeriesRecorder ( const MoFEM::Core core)

Definition at line 25 of file SeriesRecorder.cpp.

26  : cOre(const_cast<Core &>(core)) {}

◆ ~SeriesRecorder()

MoFEM::SeriesRecorder::~SeriesRecorder ( )
inline

destructor

Definition at line 34 of file SeriesRecorder.hpp.

34 {}

Member Function Documentation

◆ clearMap()

MoFEMErrorCode MoFEM::SeriesRecorder::clearMap ( )

clear multi-index container

Returns
error code

Definition at line 40 of file SeriesRecorder.cpp.

40  {
42  sEries.clear();
43  seriesSteps.clear();
45 }

◆ get_series_recorder_ptr() [1/2]

SeriesRecorder* MoFEM::SeriesRecorder::get_series_recorder_ptr ( )
inline

return pointer to meshset manager

Definition at line 59 of file SeriesRecorder.hpp.

59 { return this; }

◆ get_series_recorder_ptr() [2/2]

const SeriesRecorder* MoFEM::SeriesRecorder::get_series_recorder_ptr ( ) const
inline

return pointer to meshset manager

Definition at line 64 of file SeriesRecorder.hpp.

64 { return this; }

◆ get_series_steps_byName_begin()

SeriesStep_multiIndex::index< SeriesName_mi_tag >::type::iterator MoFEM::SeriesRecorder::get_series_steps_byName_begin ( const std::string &  name)
virtual

Definition at line 329 of file SeriesRecorder.cpp.

329  {
330  return seriesSteps.get<SeriesName_mi_tag>().lower_bound(name);
331 }

◆ get_series_steps_byName_end()

SeriesStep_multiIndex::index< SeriesName_mi_tag >::type::iterator MoFEM::SeriesRecorder::get_series_steps_byName_end ( const std::string &  name)
virtual

Definition at line 334 of file SeriesRecorder.cpp.

334  {
335  return seriesSteps.get<SeriesName_mi_tag>().upper_bound(name);
336 }

◆ get_th_SeriesName()

Tag MoFEM::SeriesRecorder::get_th_SeriesName ( )
inline

Definition at line 42 of file SeriesRecorder.hpp.

42 { return th_SeriesName; }

◆ getTags()

MoFEMErrorCode MoFEM::SeriesRecorder::getTags ( int  verb = -1)

get tags handlers used on meshsets

Definition at line 28 of file SeriesRecorder.cpp.

28  {
29 
30  Interface &m_field = cOre;
31  moab::Interface &moab = m_field.get_moab();
33  const int def_val_len = 0;
34  CHKERR moab.tag_get_handle(
35  "_SeriesName", def_val_len, MB_TYPE_OPAQUE, th_SeriesName,
36  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
38 }

◆ initialiseDatabaseFromMesh()

MoFEMErrorCode MoFEM::SeriesRecorder::initialiseDatabaseFromMesh ( int  verb = 0)

\brier initialize container form data on mesh

Returns
error code

Definition at line 47 of file SeriesRecorder.cpp.

47  {
48  Interface &m_field = cOre;
49  moab::Interface &moab = m_field.get_moab();
51  Range meshsets;
52  const int def_val_len = 0;
53  CHKERR moab.tag_get_handle(
54  "_SeriesName", def_val_len, MB_TYPE_OPAQUE, th_SeriesName,
55  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
56 
57  CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets, false);
58  for (Range::iterator mit = meshsets.begin(); mit != meshsets.end(); mit++) {
59  const void *tagName;
60  int tagNameSize;
61  rval = moab.tag_get_by_ptr(th_SeriesName, &*mit, 1, (const void **)&tagName,
62  &tagNameSize);
63  if (rval == MB_SUCCESS) {
64  std::pair<Series_multiIndex::iterator, bool> p =
65  sEries.insert(FieldSeries(moab, *mit));
66  if (verb > QUIET)
67  MOFEM_LOG("SYNC", Sev::inform) << "read series " << *p.first;
68  }
69  }
70  // //build series steps
71  for (Series_multiIndex::iterator sit = sEries.begin(); sit != sEries.end();
72  sit++) {
73  int nb_steps;
74  CHKERR sit->get_nb_steps(moab, nb_steps);
75  int ss = 0;
76  for (; ss < nb_steps; ss++) {
77  std::pair<SeriesStep_multiIndex::iterator, bool> p =
78  seriesSteps.insert(FieldSeriesStep(moab, &*sit, ss));
79  if (verb > QUIET)
80  MOFEM_LOG("SYNC", Sev::inform) << "add series step " << *p.first;
81  }
82  }
83  MOFEM_LOG_CHANNEL("WORLD");
84  MOFEM_LOG_CHANNEL("SYNC");
85  MOFEM_LOG_CHANNEL("SELF");
87 }

◆ query_interface()

MoFEMErrorCode MoFEM::SeriesRecorder::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 19 of file SeriesRecorder.cpp.

20  {
21  *iface = const_cast<SeriesRecorder *>(this);
22  return 0;
23 }

Member Data Documentation

◆ cOre

MoFEM::Core& MoFEM::SeriesRecorder::cOre

Definition at line 30 of file SeriesRecorder.hpp.

◆ sEries

Series_multiIndex MoFEM::SeriesRecorder::sEries
protected

recorded series

Definition at line 188 of file SeriesRecorder.hpp.

◆ seriesSteps

SeriesStep_multiIndex MoFEM::SeriesRecorder::seriesSteps
protected

recorded series steps

Definition at line 189 of file SeriesRecorder.hpp.

◆ th_SeriesName

Tag MoFEM::SeriesRecorder::th_SeriesName
protected

Recorded series name.

Definition at line 186 of file SeriesRecorder.hpp.


The documentation for this struct was generated from the following files:
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
MoFEM::SeriesRecorder::SeriesRecorder
SeriesRecorder(const MoFEM::Core &core)
Definition: SeriesRecorder.cpp:25
MoFEM::SeriesRecorder::sEries
Series_multiIndex sEries
recorded series
Definition: SeriesRecorder.hpp:188
MoFEM::SeriesRecorder::cOre
MoFEM::Core & cOre
Definition: SeriesRecorder.hpp:30
MoFEM::SeriesRecorder::seriesSteps
SeriesStep_multiIndex seriesSteps
recorded series steps
Definition: SeriesRecorder.hpp:189
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
MoFEM::SeriesRecorder::th_SeriesName
Tag th_SeriesName
Recorded series name.
Definition: SeriesRecorder.hpp:186
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
SeriesRecorderFunctionBegin
#define SeriesRecorderFunctionBegin
Definition: SeriesRecorder.cpp:6
Range
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
QUIET
@ QUIET
Definition: definitions.h:221
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359