|
| v0.14.0
|
Recorder for time steps and solution sequences.
More...
Recorder for time steps and solution sequences.
◆ _IT_SERIES_STEPS_BY_NAME_FOR_LOOP_
#define _IT_SERIES_STEPS_BY_NAME_FOR_LOOP_ |
( |
|
RECORDER, |
|
|
|
NAME, |
|
|
|
IT |
|
) |
| |
Value: SeriesStep_multiIndex::index<SeriesName_mi_tag>::type::iterator
IT = \
(RECORDER)->get_series_steps_byName_begin(NAME); \
IT != (RECORDER)->get_series_steps_byName_end(NAME); \
IT++
loop over recorded series step
- Parameters
-
NAME | series name \parma IT iterator variable |
Example:
ierr = mField.load_series_data(
"TEST_SERIES1",sit->get_step_number());
}
- Examples
- elasticity.cpp.
Definition at line 205 of file SeriesRecorder.hpp.
◆ add_series_recorder()
MoFEMErrorCode MoFEM::SeriesRecorder::add_series_recorder |
( |
const std::string & |
series_name | ) |
|
|
virtual |
Add series recorder
- Parameters
-
Definition at line 90 of file SeriesRecorder.cpp.
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 =
102 sEries.insert(FieldSeries(moab, meshset));
104 SETERRQ1(PETSC_COMM_SELF, 1,
"series recorder <%s> is already there",
105 series_name.c_str());
◆ check_series()
bool MoFEM::SeriesRecorder::check_series |
( |
const std::string & |
name | ) |
const |
|
virtual |
check if series is in database
- Parameters
-
- Returns
- true if field exist
- Examples
- elasticity.cpp.
Definition at line 301 of file SeriesRecorder.cpp.
302 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
303 sEries.get<SeriesName_mi_tag>().find(name);
304 if (sit !=
sEries.get<SeriesName_mi_tag>().end())
◆ delete_recorder_series()
MoFEMErrorCode MoFEM::SeriesRecorder::delete_recorder_series |
( |
const std::string & |
series_name | ) |
|
|
virtual |
delete recorded series
- Parameters
-
Definition at line 111 of file SeriesRecorder.cpp.
116 SeriesStep_multiIndex::index<SeriesName_mi_tag>::type::iterator ssit, hi_ssit;
117 ssit =
seriesSteps.get<SeriesName_mi_tag>().lower_bound(series_name);
118 hi_ssit =
seriesSteps.get<SeriesName_mi_tag>().upper_bound(series_name);
119 seriesSteps.get<SeriesName_mi_tag>().erase(ssit, hi_ssit);
120 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit;
121 sit =
sEries.get<SeriesName_mi_tag>().find(series_name);
122 if (sit ==
sEries.get<SeriesName_mi_tag>().end()) {
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);
132 sEries.get<SeriesName_mi_tag>().erase(sit);
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);
◆ finalize_series_recorder()
MoFEMErrorCode MoFEM::SeriesRecorder::finalize_series_recorder |
( |
const std::string & |
serie_name | ) |
|
|
virtual |
finalize series for recording, recorded data are not accessible until finalize
- Parameters
-
Definition at line 264 of file SeriesRecorder.cpp.
269 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
270 sEries.get<SeriesName_mi_tag>().find(serie_name);
271 if (sit ==
sEries.get<SeriesName_mi_tag>().end()) {
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++) {
281 FieldSeriesStep(moab, &*sit, ss));
◆ initialize_series_recorder()
MoFEMErrorCode MoFEM::SeriesRecorder::initialize_series_recorder |
( |
const std::string & |
serie_name | ) |
|
|
virtual |
initialize sries for recording
- Parameters
-
Definition at line 246 of file SeriesRecorder.cpp.
251 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
252 sEries.get<SeriesName_mi_tag>().find(serie_name);
253 if (sit ==
sEries.get<SeriesName_mi_tag>().end()) {
254 SETERRQ1(PETSC_COMM_SELF, 1,
"serie recorder <%s> not exist",
257 CHKERR const_cast<FieldSeries *
>(&*sit)->read(moab);
259 const_cast<FieldSeries *
>(&*sit)->
record_end =
false;
◆ load_series_data()
MoFEMErrorCode MoFEM::SeriesRecorder::load_series_data |
( |
const std::string & |
serie_name, |
|
|
const int |
step_number |
|
) |
| |
|
virtual |
load data from series into dofs database
- Parameters
-
- Examples
- elasticity.cpp.
Definition at line 309 of file SeriesRecorder.cpp.
314 auto dofs_ptr = m_field.get_dofs();
316 SeriesStep_multiIndex::index<
317 Composite_SeriesName_And_Step_mi_tag>::type::iterator sit;
318 sit =
seriesSteps.get<Composite_SeriesName_And_Step_mi_tag>().find(
319 boost::make_tuple(serie_name, step_number));
320 if (sit ==
seriesSteps.get<Composite_SeriesName_And_Step_mi_tag>().end()) {
321 SETERRQ2(PETSC_COMM_SELF, 1,
"series <%s> and step %d not found",
322 serie_name.c_str(), step_number);
◆ print_series_steps()
print series
Definition at line 286 of file SeriesRecorder.cpp.
289 for (
auto &sit :
sEries.get<SeriesName_mi_tag>())
290 MOFEM_LOG(
"SYNC", Sev::inform) <<
"series " << sit;
292 for (
auto &ssit :
seriesSteps.get<SeriesName_mi_tag>())
293 MOFEM_LOG(
"SYNC", Sev::inform) <<
"series steps " << ssit;
◆ record_begin()
MoFEMErrorCode MoFEM::SeriesRecorder::record_begin |
( |
const std::string & |
serie_name | ) |
|
|
virtual |
begin series recording
- Parameters
-
Definition at line 218 of file SeriesRecorder.cpp.
221 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
222 sEries.get<SeriesName_mi_tag>().find(serie_name);
223 if (sit ==
sEries.get<SeriesName_mi_tag>().end()) {
224 SETERRQ1(PETSC_COMM_SELF, 1,
"serie recorder <%s> not exist",
227 CHKERR const_cast<FieldSeries *
>(&*sit)->begin();
◆ record_end()
MoFEMErrorCode MoFEM::SeriesRecorder::record_end |
( |
const std::string & |
serie_name, |
|
|
double |
time = 0 |
|
) |
| |
|
virtual |
end series recording
- Parameters
-
Definition at line 231 of file SeriesRecorder.cpp.
235 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
236 sEries.get<SeriesName_mi_tag>().find(serie_name);
237 if (sit ==
sEries.get<SeriesName_mi_tag>().end()) {
238 SETERRQ1(PETSC_COMM_SELF, 1,
"serie recorder <%s> not exist",
241 CHKERR const_cast<FieldSeries *
>(&*sit)->end(time);
◆ record_field()
record field
- Parameters
-
field | name |
bit | ref level |
mask | for bit ref level |
Definition at line 181 of file SeriesRecorder.cpp.
188 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
189 sEries.get<SeriesName_mi_tag>().find(serie_name);
190 if (sit ==
sEries.get<SeriesName_mi_tag>().end()) {
191 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"serie recorder <%s> not exist",
195 const auto bit_number = m_field.get_field_bit_number(
field_name);
197 auto dit = dofs_ptr->get<Unique_mi_tag>().lower_bound(
199 if (dit == dofs_ptr->get<Unique_mi_tag>().end())
201 auto hi_dit = dofs_ptr->get<Unique_mi_tag>().upper_bound(
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();
212 CHKERR const_cast<FieldSeries *
>(&*sit)->push_dofs(ent, uid, val);
◆ record_problem() [1/2]
record problem
- Parameters
-
series | name |
problem | pointer |
rc | could be Row or Col |
Definition at line 141 of file SeriesRecorder.cpp.
146 Series_multiIndex::index<SeriesName_mi_tag>::type::iterator sit =
147 sEries.get<SeriesName_mi_tag>().find(serie_name);
148 if (sit ==
sEries.get<SeriesName_mi_tag>().end()) {
150 "series recorder <%s> not exist", serie_name.c_str());
154 CHKERR const_cast<FieldSeries *
>(&*sit)->push_dofs(
155 problemPtr->numeredRowDofsPtr->begin(),
156 problemPtr->numeredRowDofsPtr->end());
159 CHKERR const_cast<FieldSeries *
>(&*sit)->push_dofs(
160 problemPtr->numeredColDofsPtr->begin(),
161 problemPtr->numeredColDofsPtr->end());
◆ record_problem() [2/2]
MoFEMErrorCode MoFEM::SeriesRecorder::record_problem |
( |
const std::string & |
serie_name, |
|
|
const std::string & |
problem_name, |
|
|
RowColData |
rc |
|
) |
| |
|
virtual |
record problem
- Parameters
-
series | name |
problem | name |
rc | could be Row or Col |
Definition at line 169 of file SeriesRecorder.cpp.
175 const Problem *problem_ptr;
176 CHKERR m_field.get_problem(problem_name, &problem_ptr);
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Series_multiIndex sEries
recorded series
SeriesStep_multiIndex seriesSteps
recorded series steps
DeprecatedCoreInterface Interface
Tag th_SeriesName
Recorded series name.
#define CHKERR
Inline error check.
virtual moab::Interface & get_moab()=0
virtual MoFEMErrorCode record_begin(const std::string &serie_name)
int ShortId
Unique Id in the field.
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
#define _IT_SERIES_STEPS_BY_NAME_FOR_LOOP_(RECORDER, NAME, IT)
loop over recorded series step
#define SeriesRecorderFunctionBegin
constexpr auto field_name
MoFEMErrorCode get_dofs(const DofEntity_multiIndex **dofs_ptr) const
Get dofs multi index.
#define MOFEM_LOG(channel, severity)
Log.
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
constexpr IntegrationType IT
double FieldData
Field data type.
@ MOFEM_DATA_INCONSISTENCY
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
virtual MoFEMErrorCode record_problem(const std::string &serie_name, const Problem *problemPtr, RowColData rc)
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
multi_index_container< boost::shared_ptr< DofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< DofEntity, UId, &DofEntity::getLocalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< DofEntity, EntityHandle, &DofEntity::getEnt > > > > DofEntity_multiIndex
MultiIndex container keeps DofEntity.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
virtual MoFEMErrorCode record_end(const std::string &serie_name, double time=0)