v0.8.20
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 (const MOFEMuuid &uuid, 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 (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of 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 ()
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 

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

- Protected Member Functions inherited from MoFEM::UnknownInterface
boost::typeindex::type_index getClassIdx (const MOFEMuuid &uid) const
 Get type name for interface Id. More...
 
MOFEMuuid getUId (const boost::typeindex::type_index &class_idx) const
 Get interface Id for class name. 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 38 of file SeriesRecorder.hpp.

Constructor & Destructor Documentation

◆ SeriesRecorder()

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

Definition at line 35 of file SeriesRecorder.cpp.

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

◆ ~SeriesRecorder()

MoFEM::SeriesRecorder::~SeriesRecorder ( )

destructor

Definition at line 47 of file SeriesRecorder.hpp.

47 {}

Member Function Documentation

◆ clearMap()

MoFEMErrorCode MoFEM::SeriesRecorder::clearMap ( )

clear multi-index container

Returns
error code

Definition at line 50 of file SeriesRecorder.cpp.

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

◆ get_series_recorder_ptr() [1/2]

SeriesRecorder* MoFEM::SeriesRecorder::get_series_recorder_ptr ( )

return pointer to meshset manager

Definition at line 72 of file SeriesRecorder.hpp.

72 { 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 77 of file SeriesRecorder.hpp.

77 { 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 346 of file SeriesRecorder.cpp.

346  {
347  return seriesSteps.get<SeriesName_mi_tag>().lower_bound(name);
348 }
SeriesStep_multiIndex seriesSteps
recorded series steps

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

351  {
352  return seriesSteps.get<SeriesName_mi_tag>().upper_bound(name);
353 }
SeriesStep_multiIndex seriesSteps
recorded series steps

◆ get_th_SeriesName()

Tag MoFEM::SeriesRecorder::get_th_SeriesName ( )

Definition at line 55 of file SeriesRecorder.hpp.

55 { 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 38 of file SeriesRecorder.cpp.

38  {
39 
40  Interface &m_field = cOre;
41  moab::Interface &moab = m_field.get_moab();
43  const int def_val_len = 0;
44  CHKERR moab.tag_get_handle(
45  "_SeriesName", def_val_len, MB_TYPE_OPAQUE, th_SeriesName,
46  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
48 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
Tag th_SeriesName
Recorded series name.
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ initialiseDatabaseFromMesh()

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

initialize container form data on mesh

Returns
error code

Definition at line 57 of file SeriesRecorder.cpp.

57  {
58  Interface &m_field = cOre;
59  moab::Interface &moab = m_field.get_moab();
61  Range meshsets;
62  const int def_val_len = 0;
63  CHKERR moab.tag_get_handle(
64  "_SeriesName", def_val_len, MB_TYPE_OPAQUE, th_SeriesName,
65  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
66 
67  CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets, false);
68  for (Range::iterator mit = meshsets.begin(); mit != meshsets.end(); mit++) {
69  const void *tagName;
70  int tagNameSize;
71  rval = moab.tag_get_by_ptr(th_SeriesName, &*mit, 1, (const void **)&tagName,
72  &tagNameSize);
73  if (rval == MB_SUCCESS) {
74  std::pair<Series_multiIndex::iterator, bool> p =
75  sEries.insert(FieldSeries(moab, *mit));
76  if (verb > 0) {
77  std::ostringstream ss;
78  ss << "read series " << *p.first << std::endl;
79  PetscPrintf(m_field.get_comm(), ss.str().c_str());
80  }
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 > 0) {
93  std::ostringstream ss;
94  ss << "add series step " << *p.first << std::endl;
95  PetscPrintf(m_field.get_comm(), ss.str().c_str());
96  }
97  }
98  }
100 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
Tag th_SeriesName
Recorded series name.
#define CHKERR
Inline error check.
Definition: definitions.h:594
Series_multiIndex sEries
recorded series
SeriesStep_multiIndex seriesSteps
recorded series steps
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ query_interface()

MoFEMErrorCode MoFEM::SeriesRecorder::query_interface ( const MOFEMuuid uuid,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 23 of file SeriesRecorder.cpp.

24  {
26  *iface = NULL;
27  if (uuid == IDD_MOFEMSeriesRecorder) {
28  *iface = const_cast<SeriesRecorder *>(this);
30  }
31  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
33 }
static const MOFEMuuid IDD_MOFEMSeriesRecorder
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
SeriesRecorder(const MoFEM::Core &core)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

Member Data Documentation

◆ cOre

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

Definition at line 43 of file SeriesRecorder.hpp.

◆ sEries

Series_multiIndex MoFEM::SeriesRecorder::sEries
protected

recorded series

Definition at line 201 of file SeriesRecorder.hpp.

◆ seriesSteps

SeriesStep_multiIndex MoFEM::SeriesRecorder::seriesSteps
protected

recorded series steps

Definition at line 202 of file SeriesRecorder.hpp.

◆ th_SeriesName

Tag MoFEM::SeriesRecorder::th_SeriesName
protected

Recorded series name.

Definition at line 199 of file SeriesRecorder.hpp.


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