#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
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
Deprecated interface functions.
MoFEMErrorCode createGhostVec(Vec *ghost_vec) const
MoFEMErrorCode testError(Vec ghost_vec)
Test error.
MoFEMErrorCode assembleGhostVector(Vec ghost_vec) const
Assemble error vector.
MoFEMErrorCode printError(Vec ghost_vec)
Print error.