10 char file[PETSC_MAX_PATH_LEN], other[PETSC_MAX_PATH_LEN];
12 sizeof(file),
nullptr);
14 sizeof(other),
nullptr);
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");
45int main(
int argc,
char *argv[]) {
SmartPetscObj< Vec > values
#define CATCH_ERRORS
Catch errors.
#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.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
MoFEMErrorCode run(MoFEM::Interface &m_field)
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
MoFEMErrorCode requireDerivatives() const
static MoFEMErrorCode initialise()
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
static MoFEMErrorCode finalise()
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.