v0.13.1
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
virtual MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const =0
 
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce 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 35 of file SeriesRecorder.hpp.

Constructor & Destructor Documentation

◆ SeriesRecorder()

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

Definition at line 38 of file SeriesRecorder.cpp.

39 : cOre(const_cast<Core &>(core)) {}
CoreTmp< 0 > Core
Definition: Core.hpp:1096

◆ ~SeriesRecorder()

MoFEM::SeriesRecorder::~SeriesRecorder ( )

destructor

Definition at line 44 of file SeriesRecorder.hpp.

44{}

Member Function Documentation

◆ clearMap()

MoFEMErrorCode MoFEM::SeriesRecorder::clearMap ( )

clear multi-index container

Returns
error code

Definition at line 53 of file SeriesRecorder.cpp.

53 {
55 sEries.clear();
56 seriesSteps.clear();
58}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
Series_multiIndex sEries
recorded series
SeriesStep_multiIndex seriesSteps
recorded series steps

◆ get_series_recorder_ptr() [1/2]

SeriesRecorder * MoFEM::SeriesRecorder::get_series_recorder_ptr ( )

return pointer to meshset manager

Definition at line 69 of file SeriesRecorder.hpp.

69{ return this; }

◆ get_series_recorder_ptr() [2/2]

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

return pointer to meshset manager

Definition at line 74 of file SeriesRecorder.hpp.

74{ 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 342 of file SeriesRecorder.cpp.

342 {
343 return seriesSteps.get<SeriesName_mi_tag>().lower_bound(name);
344}

◆ 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 347 of file SeriesRecorder.cpp.

347 {
348 return seriesSteps.get<SeriesName_mi_tag>().upper_bound(name);
349}

◆ get_th_SeriesName()

Tag MoFEM::SeriesRecorder::get_th_SeriesName ( )

Definition at line 52 of file SeriesRecorder.hpp.

52{ return th_SeriesName; }
Tag th_SeriesName
Recorded series name.

◆ getTags()

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

get tags handlers used on meshsets

Definition at line 41 of file SeriesRecorder.cpp.

41 {
42
43 Interface &m_field = cOre;
44 moab::Interface &moab = m_field.get_moab();
46 const int def_val_len = 0;
47 CHKERR moab.tag_get_handle(
48 "_SeriesName", def_val_len, MB_TYPE_OPAQUE, th_SeriesName,
49 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
51}
#define CHKERR
Inline error check.
Definition: definitions.h:548
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
virtual moab::Interface & get_moab()=0

◆ initialiseDatabaseFromMesh()

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

\brier initialize container form data on mesh

Returns
error code

Definition at line 60 of file SeriesRecorder.cpp.

60 {
61 Interface &m_field = cOre;
62 moab::Interface &moab = m_field.get_moab();
64 Range meshsets;
65 const int def_val_len = 0;
66 CHKERR moab.tag_get_handle(
67 "_SeriesName", def_val_len, MB_TYPE_OPAQUE, th_SeriesName,
68 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
69
70 CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets, false);
71 for (Range::iterator mit = meshsets.begin(); mit != meshsets.end(); mit++) {
72 const void *tagName;
73 int tagNameSize;
74 rval = moab.tag_get_by_ptr(th_SeriesName, &*mit, 1, (const void **)&tagName,
75 &tagNameSize);
76 if (rval == MB_SUCCESS) {
77 std::pair<Series_multiIndex::iterator, bool> p =
78 sEries.insert(FieldSeries(moab, *mit));
79 if (verb > QUIET)
80 MOFEM_LOG("SYNC", Sev::inform) << "read series " << *p.first;
81 }
82 }
83 // //build series steps
84 for (Series_multiIndex::iterator sit = sEries.begin(); sit != sEries.end();
85 sit++) {
86 int nb_steps;
87 CHKERR sit->get_nb_steps(moab, nb_steps);
88 int ss = 0;
89 for (; ss < nb_steps; ss++) {
90 std::pair<SeriesStep_multiIndex::iterator, bool> p =
91 seriesSteps.insert(FieldSeriesStep(moab, &*sit, ss));
92 if (verb > QUIET)
93 MOFEM_LOG("SYNC", Sev::inform) << "add series step " << *p.first;
94 }
95 }
96 MOFEM_LOG_CHANNEL("WORLD");
97 MOFEM_LOG_CHANNEL("SYNC");
98 MOFEM_LOG_CHANNEL("SELF");
100}
static Index< 'p', 3 > p
#define SeriesRecorderFunctionBegin
@ QUIET
Definition: definitions.h:221
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:311
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:287
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:85

◆ query_interface()

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

Implements MoFEM::UnknownInterface.

Definition at line 32 of file SeriesRecorder.cpp.

33 {
34 *iface = const_cast<SeriesRecorder *>(this);
35 return 0;
36}
SeriesRecorder(const MoFEM::Core &core)

Member Data Documentation

◆ cOre

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

Definition at line 40 of file SeriesRecorder.hpp.

◆ sEries

Series_multiIndex MoFEM::SeriesRecorder::sEries
protected

recorded series

Definition at line 198 of file SeriesRecorder.hpp.

◆ seriesSteps

SeriesStep_multiIndex MoFEM::SeriesRecorder::seriesSteps
protected

recorded series steps

Definition at line 199 of file SeriesRecorder.hpp.

◆ th_SeriesName

Tag MoFEM::SeriesRecorder::th_SeriesName
protected

Recorded series name.

Definition at line 196 of file SeriesRecorder.hpp.


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