7 {
10 char file[PETSC_MAX_PATH_LEN], other[PETSC_MAX_PATH_LEN];
12 sizeof(file), nullptr);
14 sizeof(other), nullptr);
20 x.clear();
21 normals.clear();
22 x(1, 0) = 2;
28 grad(1, 0) != 1 || grad(1, 1) != 2 || grad(1, 2) != 3 ||
29 hess(1, 5) != 10 || second.
value({2, 0, 0}) != 102 ||
30 first.
value({2, 0, 0}) != 9)
32 "SDF values, array strides or script namespaces are incorrect");
33 CHKERR PetscPushErrorHandler(PetscReturnErrorHandler,
nullptr);
35 const auto shape = first.
evalSdf(0, 0, x, normals, 1,
values);
36 const auto exception = first.
evalSdf(0, 0, x, normals, 2,
values);
38 CHKERR PetscPopErrorHandler();
39 if (!missing_derivatives || !shape || !exception || !nan)
41 "Invalid SDF input/result was accepted");
43}
SmartPetscObj< Vec > values
#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()
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
MoFEMErrorCode requireDerivatives() const
MoFEMErrorCode evalHessSdf(double dt, double t, const MatrixDouble &coordinates, const MatrixDouble &normals, int block, MatrixDouble &values) const
MoFEMErrorCode sdfInit(const std::string &file)
double value(const std::array< double, 3 > &point, double dt=0, double t=0, int block=0) const
MoFEMErrorCode evalSdf(double dt, double t, const MatrixDouble &coordinates, const MatrixDouble &normals, int block, VectorDouble &values) const
MoFEMErrorCode evalGradSdf(double dt, double t, const MatrixDouble &coordinates, const MatrixDouble &normals, int block, MatrixDouble &values) const
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.