295 {
297
298 auto check_result_fe_ptr = boost::make_shared<FaceEle>(
mField);
299 auto petscVec =
302
304 check_result_fe_ptr->getOpPtrVector(), {H1})),
305 "Apply transform");
306
307 check_result_fe_ptr->getRuleHook = [](
int,
int,
int p) {
return 2 * p; };
308 auto analyticalFunction = [&](double x, double y, double z) {
309 return cos(x * M_PI) * cos(y * M_PI);
310 };
311
312 auto u_ptr = boost::make_shared<VectorDouble>();
313
314 check_result_fe_ptr->getOpPtrVector().push_back(
316 auto mValFuncPtr = boost::make_shared<VectorDouble>();
317 check_result_fe_ptr->getOpPtrVector().push_back(
319 check_result_fe_ptr->getOpPtrVector().push_back(
321 CHKERR VecZeroEntries(petscVec);
324 check_result_fe_ptr);
325 CHKERR VecAssemblyBegin(petscVec);
326 CHKERR VecAssemblyEnd(petscVec);
329 const double *norms;
330 CHKERR VecGetArrayRead(petscVec, &norms);
332 <<
"NORM: " << std::sqrt(norms[
NORM]);
333 CHKERR VecRestoreArrayRead(petscVec, &norms);
334 }
336 const double *t_ptr;
337 CHKERR VecGetArrayRead(petscVec, &t_ptr);
338 double ref_norm = 1.4e-04;
339 double cal_norm;
341 case 1:
342 cal_norm = sqrt(t_ptr[0]);
343 break;
344 default:
346 "atom test %d does not exist",
atom_test);
347 }
348 if (cal_norm > ref_norm) {
350 "atom test %d failed! Calculated Norm %3.16e is greater than "
351 "reference Norm %3.16e",
353 }
354 CHKERR VecRestoreArrayRead(petscVec, &t_ptr);
355 }
357}
#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.
Specialization for double precision scalar field values calculation.
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.