134 CHKERR FaceElementForcesAndSourcesCore::postProcess();
135 if (
petscQ != PETSC_NULL) {
136 if (
petscB == PETSC_NULL) {
138 "Matrix B should be set");
148 problemPtr->getName(),
COL, &Qv);
151 auto project_vectors_and_assemble = [
this, Qv](
auto dit) {
156 "Vector on row not found");
162 CHKERR VecGhostUpdateBegin(
168 CHKERR VecGhostUpdateBegin(
170 INSERT_VALUES, SCATTER_FORWARD);
173 INSERT_VALUES, SCATTER_FORWARD);
177 CHKERR VecGhostUpdateBegin(Qv, INSERT_VALUES, SCATTER_FORWARD);
178 CHKERR VecGhostUpdateEnd(Qv, INSERT_VALUES, SCATTER_FORWARD);
181 auto save_vec = [](std::string name,
Vec v) {
183 PetscViewerASCIIOpen(PETSC_COMM_WORLD, name.c_str(), &viewer);
184 PetscViewerPushFormat(viewer, PETSC_VIEWER_ASCII_MATLAB);
186 PetscViewerPopFormat(viewer);
187 PetscViewerDestroy(&viewer);
190 "V_" + boost::lexical_cast<std::string>(dit->get()->getEnt()) +
194 "Qv_" + boost::lexical_cast<std::string>(dit->get()->getEnt()) +
201 CHKERR VecGetArray(Qv, &array);
202 vector<int> glob_idx;
204 int row = dit->get()->getPetscGlobalDofIdx();
209 int idx = diit->get()->getPetscGlobalDofIdx();
210 double val = array[diit->get()->getPetscGlobalDofIdx()];
211 glob_idx.push_back(idx);
215 &*glob_idx.begin(), &*vals.begin(), ADD_VALUES);
216 CHKERR VecRestoreArray(Qv, &array);
224 CHKERR project_vectors_and_assemble(dit);