297 {
299
300 auto check_result_fe_ptr = boost::make_shared<FaceEle>(
mField);
301 auto petscVec =
304
306 check_result_fe_ptr->getOpPtrVector(), {H1})),
307 "Apply transform");
308
309 check_result_fe_ptr->getRuleHook = [](int, int, int p) { return 2 * p; };
310 auto analyticalFunction = [&](double x, double y, double z) {
311 return cos(x * M_PI) * cos(y * M_PI);
312 };
313
314 auto u_ptr = boost::make_shared<VectorDouble>();
315
316 check_result_fe_ptr->getOpPtrVector().push_back(
318 auto mValFuncPtr = boost::make_shared<VectorDouble>();
319 check_result_fe_ptr->getOpPtrVector().push_back(
321 check_result_fe_ptr->getOpPtrVector().push_back(
323 CHKERR VecZeroEntries(petscVec);
326 check_result_fe_ptr);
327 CHKERR VecAssemblyBegin(petscVec);
328 CHKERR VecAssemblyEnd(petscVec);
331 const double *norms;
332 CHKERR VecGetArrayRead(petscVec, &norms);
334 <<
"NORM: " << std::sqrt(norms[
NORM]);
335 CHKERR VecRestoreArrayRead(petscVec, &norms);
336 }
338 const double *t_ptr;
339 CHKERR VecGetArrayRead(petscVec, &t_ptr);
340 double ref_norm = 1.4e-04;
341 double cal_norm;
343 case 1:
344 cal_norm = sqrt(t_ptr[0]);
345 break;
346 default:
348 "atom test %d does not exist",
atom_test);
349 }
350 if (cal_norm > ref_norm) {
352 "atom test %d failed! Calculated Norm %3.16e is greater than "
353 "reference Norm %3.16e",
355 }
356 CHKERR VecRestoreArrayRead(petscVec, &t_ptr);
357 }
359}
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ MOFEM_ATOM_TEST_INVALID
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
Get norm of input VectorDouble for Tensor0.
Get value at integration points for scalar field.
Get values from scalar function at integration points and save them to VectorDouble for Tensor0.
MoFEMErrorCode getDM(DM *dm)
Get DM.
const std::string getDomainFEName() const
Get the Domain FE Name.