15struct SensitivityCase {
17 std::array<double, 4> temperature;
18 std::array<double, 4> youngModulus;
19 std::array<double, 4> p1;
23const std::array<SensitivityCase, 3> cases{{
26 {11890, 22252.4, 21894.7, 21516.6},
27 {1, 1.5195, 1.57151, 1.57161},
31 {11890, 19588, 21429.4, 21475},
32 {1, 1.33448, 1.54454, 1.57156},
34 {
"S2", {20, 20, 235, 450}, {11890, 17483.2, 19802.5, 21679.3}, {},
false},
36constexpr std::array<double, 4> dose{{0.003, 7.25, 14.5, 21.75}};
37constexpr std::array<int, 4> outputStep{{1, 9, 17, 25}};
40 const std::string &tag_name,
double expected,
41 double tolerance,
const char *case_name,
int step) {
47 for (
const auto value :
values)
50 "%s step %d: %s = %.12g, Abaqus = %.12g (tolerance %.3g)",
51 case_name, step, tag_name.c_str(), value, expected,
tolerance);
56 const std::string &directory) {
58 for (
int i = 0;
i != outputStep.size(); ++
i) {
59 const int step =
i + 1;
61 directory +
"/out_vertices_" + std::to_string(outputStep[
i]) +
".h5m";
63 CHKERR mb.load_file(filename.c_str());
68 "%s has no integration-point vertices", filename.c_str());
70 test_case.name, step);
72 test_case.temperature[
i], 1e-8, test_case.name, step);
74 0.05, test_case.name, step);
75 if (test_case.checkP1)
77 test_case.name, step);
80 1e-8, test_case.
name, step);
82 test_case.name, step);
84 1e-8, test_case.name, step);
86 test_case.name, step);
88 PetscPrintf(PETSC_COMM_WORLD,
"%s one-hex step %d passed\n", test_case.name,
96int main(
int argc,
char **argv) {
98 std::fprintf(stderr,
"usage: %s {base|S1|S2} output-directory\n", argv[0]);
102 char *mofem_argv[] = {argv[0],
nullptr};
103 char **mofem_argv_ptr = mofem_argv;
106 const std::string case_name = argv[1];
107 const std::string directory = argv[2];
108 for (
const auto &test_case : cases)
109 if (case_name == test_case.name) {
110 CHKERR checkCase(test_case, directory);
std::vector< int > vertices
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.
FTensor::Index< 'i', SPACE_DIM > i
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
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.