6 #define SeriesRecorderFunctionBegin \
8 MOFEM_LOG_CHANNEL("WORLD"); \
9 MOFEM_LOG_CHANNEL("SYNC"); \
10 MOFEM_LOG_FUNCTION(); \
11 MOFEM_LOG_TAG("SYNC", "SeriesRecorder"); \
12 MOFEM_LOG_TAG("WORLD", "SeriesRecorder")
26 : cOre(const_cast<
Core &>(core)) {}
33 const int def_val_len = 0;
34 CHKERR moab.tag_get_handle(
36 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
52 const int def_val_len = 0;
53 CHKERR moab.tag_get_handle(
55 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
57 CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets,
false);
58 for (Range::iterator mit = meshsets.begin(); mit != meshsets.end(); mit++) {
63 if (
rval == MB_SUCCESS) {
64 std::pair<Series_multiIndex::iterator, bool> p =
67 MOFEM_LOG(
"SYNC", Sev::inform) <<
"read series " << *p.first;
71 for (Series_multiIndex::iterator sit =
sEries.begin(); sit !=
sEries.end();
74 CHKERR sit->get_nb_steps(moab, nb_steps);
76 for (; ss < nb_steps; ss++) {
77 std::pair<SeriesStep_multiIndex::iterator, bool> p =
80 MOFEM_LOG(
"SYNC", Sev::inform) <<
"add series step " << *p.first;
96 CHKERR moab.create_meshset(MESHSET_SET, meshset);
97 void const *tag_data[] = {series_name.c_str()};
99 tag_sizes[0] = series_name.size();
101 std::pair<Series_multiIndex::iterator, bool> p =
104 SETERRQ1(PETSC_COMM_SELF, 1,
"series recorder <%s> is already there",
105 series_name.c_str());
116 SeriesStep_multiIndex::index<SeriesName_mi_tag>::type::iterator ssit, hi_ssit;
120 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit;
124 "series recorder <%s> not exist and can be deleted",
125 series_name.c_str());
128 CHKERR moab.tag_delete(sit->th_SeriesTime);
129 CHKERR moab.tag_delete(sit->th_SeriesDataHandles);
130 CHKERR moab.tag_delete(sit->th_SeriesDataUIDs);
131 CHKERR moab.tag_delete(sit->th_SeriesData);
133 std::vector<EntityHandle> contained;
134 CHKERR moab.get_contained_meshsets(series_meshset, contained);
135 CHKERR moab.remove_entities(series_meshset, &contained[0], contained.size());
136 CHKERR moab.delete_entities(&contained[0], contained.size());
137 CHKERR moab.delete_entities(&series_meshset, 1);
146 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
150 "series recorder <%s> not exist", serie_name.c_str());
170 const std::string &problem_name,
188 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
191 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"serie recorder <%s> not exist",
204 for (; dit != hi_dit; dit++) {
205 const BitRefLevel &dof_bit = (*dit)->getBitRefLevel();
206 if ((dof_bit & mask) != dof_bit)
208 if ((dof_bit &
bit).any()) {
210 ShortId uid = (*dit)->getNonNonuniqueShortId();
221 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
224 SETERRQ1(PETSC_COMM_SELF, 1,
"serie recorder <%s> not exist",
235 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
238 SETERRQ1(PETSC_COMM_SELF, 1,
"serie recorder <%s> not exist",
251 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
254 SETERRQ1(PETSC_COMM_SELF, 1,
"serie recorder <%s> not exist",
269 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
272 SETERRQ1(PETSC_COMM_SELF, 1,
"serie recorder <%s> not exist",
277 CHKERR sit->get_nb_steps(moab, nb_steps);
279 for (; ss < nb_steps; ss++) {
290 MOFEM_LOG(
"SYNC", Sev::inform) <<
"series " << sit;
293 MOFEM_LOG(
"SYNC", Sev::inform) <<
"series steps " << ssit;
302 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
310 const int step_number) {
316 SeriesStep_multiIndex::index<
319 boost::make_tuple(serie_name, step_number));
321 SETERRQ2(PETSC_COMM_SELF, 1,
"series <%s> and step %d not found",
322 serie_name.c_str(), step_number);
328 SeriesStep_multiIndex::index<SeriesName_mi_tag>::type::iterator
333 SeriesStep_multiIndex::index<SeriesName_mi_tag>::type::iterator