41 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
44 PetscBool flg_mesh_file = PETSC_TRUE;
45 PetscBool flg_out_file = PETSC_TRUE;
53 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"ADD_PRISMS_LAYER",
"none");
55 CHKERR PetscOptionsString(
"-my_file",
"mesh file name",
"",
"mesh.h5m",
57 CHKERR PetscOptionsString(
"-my_out_file",
"out file name",
"",
"out.h5m",
60 CHKERR PetscOptionsInt(
"-my_dim",
"dimension (2 or 3)",
"", dim, &dim,
63 CHKERR PetscOptionsReal(
"-my_radius",
"roughness wavelength",
"", radius,
65 CHKERR PetscOptionsReal(
"-my_height",
"vertical dimension of the mesh",
"",
66 height, &height, PETSC_NULL);
68 int ierr = PetscOptionsEnd();
71 if (flg_mesh_file != PETSC_TRUE) {
72 SETERRQ(PETSC_COMM_SELF, 1,
"*** ERROR -my_file (MESH FILE NEEDED)");
79 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
81 pcomm =
new ParallelComm(&moab, PETSC_COMM_WORLD);
87 Range tets, tris, nodes, all_nodes;
89 if (
bit->getName().compare(0, 11,
"MAT_ELASTIC") == 0) {
90 const int id =
bit->getMeshsetId();
101 all_nodes.merge(nodes);
104 all_nodes.merge(nodes);
107 for (Range::iterator nit = all_nodes.begin(); nit != all_nodes.end();
109 CHKERR moab.get_coords(&*nit, 1, coords);
110 double x = coords[0];
111 double y = coords[1];
112 double z = coords[2];
113 double r = sqrt(x * x + y * y);
114 double coef = (height + z) / height;
117 coords[2] -= coef * 0.5 * x * x / radius;
120 coords[2] -= coef * 0.5 *
r *
r / radius;
124 "Wrong dimension = %d", dim);
127 CHKERR moab.set_coords(&*nit, 1, coords);
132 MOFEM_LOG_C(
"WORLD", Sev::inform,
"Write file %s\n",