#ifndef ___AUX_FUNCTIONS_HPP__
#define ___AUX_FUNCTIONS_HPP__
struct AuxFunctions {
int ghosts[] = {0};
int nb_locals =
rAnk == 0 ? 1 : 0;
int nb_ghosts =
rAnk > 0 ? 1 : 0;
CHKERR VecCreateGhost(
cOmm, nb_locals, 1, nb_ghosts, ghosts, ghost_vec);
}
CHKERR VecAssemblyBegin(ghost_vec);
CHKERR VecAssemblyEnd(ghost_vec);
CHKERR VecGhostUpdateBegin(ghost_vec, ADD_VALUES, SCATTER_REVERSE);
CHKERR VecGhostUpdateEnd(ghost_vec, ADD_VALUES, SCATTER_REVERSE);
CHKERR VecGhostUpdateBegin(ghost_vec, INSERT_VALUES, SCATTER_FORWARD);
CHKERR VecGhostUpdateEnd(ghost_vec, INSERT_VALUES, SCATTER_FORWARD);
}
double *e;
CHKERR VecGetArray(ghost_vec, &e);
CHKERR PetscPrintf(
cOmm,
"Approximation error %4.3e\n", sqrt(e[0]));
CHKERR VecRestoreArray(ghost_vec, &e);
}
double *e;
CHKERR VecGetArray(ghost_vec, &e);
if ((sqrt(e[0]) >
eps) || (!boost::math::isnormal(e[0]))) {
"Test failed, error too big");
}
CHKERR VecRestoreArray(ghost_vec, &e);
}
private:
};
}
#endif //___AUX_FUNCTIONS_HPP__