50 {
52 FILE *datafile;
53 PetscFOpen(PETSC_COMM_SELF,
DATAFILENAME,
"a+", &datafile);
55
56 boost::shared_ptr<NumeredDofEntity_multiIndex> numered_dofs_rows =
57 problemPtr->getNumeredRowDofsPtr();
58 auto lit = numered_dofs_rows->lower_bound(
60 auto hi_lit = numered_dofs_rows->upper_bound(
62
63 if (lit == numered_dofs_rows->end()) {
64 fclose(datafile);
66 } else if (std::distance(lit, hi_lit) != 1) {
68 "Only one DOF is expected");
69 }
70
73 NumeredDofEntityByEnt::iterator dit, hi_dit;
74 dit = numered_dofs_rows->get<
Ent_mi_tag>().lower_bound(*nit);
75 hi_dit = numered_dofs_rows->get<
Ent_mi_tag>().upper_bound(*nit);
76 double coords[3];
78 for (; dit != hi_dit; dit++) {
79 PetscPrintf(PETSC_COMM_WORLD, "%s [ %d ] %6.4e -> ",
80 lit->get()->getName().c_str(), lit->get()->getDofCoeffIdx(),
81 lit->get()->getFieldData());
82 PetscPrintf(PETSC_COMM_WORLD, "%s [ %d ] %6.4e ",
83 dit->get()->getName().c_str(), dit->get()->getDofCoeffIdx(),
84 dit->get()->getFieldData());
85 PetscPrintf(PETSC_COMM_WORLD, "-> %3.4f %3.4f %3.4f\n", coords[0],
86 coords[1], coords[2]);
87 PetscFPrintf(PETSC_COMM_WORLD, datafile, "%6.4e %6.4e ",
88 dit->get()->getFieldData(), lit->get()->getFieldData());
89 }
90 }
91 PetscFPrintf(PETSC_COMM_WORLD, datafile, "\n");
92 fclose(datafile);
94 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
static UId getLoBitNumberUId(const FieldBitNumber bit_number)