23 namespace bio = boost::iostreams;
25 using bio::tee_device;
27 using namespace MoFEM;
29 static char help[] =
"...\n\n";
32 int main(
int argc,
char *argv[]) {
41 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
44 PetscBool flg_mesh_file = PETSC_TRUE;
45 PetscBool flg_out_file = PETSC_TRUE;
54 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"ADD_PRISMS_LAYER",
"none");
56 CHKERR PetscOptionsString(
"-my_file",
"mesh file name",
"",
"mesh.h5m",
58 CHKERR PetscOptionsString(
"-my_out_file",
"out file name",
"",
"out.h5m",
61 CHKERR PetscOptionsInt(
"-my_dim",
"dimension (2 or 3)",
"", dim, &dim,
64 CHKERR PetscOptionsReal(
"-my_lambda",
"roughness wavelength",
"",
lambda,
66 CHKERR PetscOptionsReal(
"-my_delta",
"roughness amplitude",
"",
delta,
68 CHKERR PetscOptionsReal(
"-my_height",
"vertical dimension of the mesh",
"",
69 height, &height, PETSC_NULL);
71 int ierr = PetscOptionsEnd();
74 if (flg_mesh_file != PETSC_TRUE) {
75 SETERRQ(PETSC_COMM_SELF, 1,
"*** ERROR -my_file (MESH FILE NEEDED)");
82 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
84 pcomm =
new ParallelComm(&moab, PETSC_COMM_WORLD);
90 Range tets, tris, nodes, all_nodes;
92 if (
bit->getName().compare(0, 11,
"MAT_ELASTIC") == 0) {
93 const int id =
bit->getMeshsetId();
104 all_nodes.merge(nodes);
107 all_nodes.merge(nodes);
110 for (Range::iterator nit = all_nodes.begin(); nit != all_nodes.end();
112 CHKERR moab.get_coords(&*nit, 1, coords);
113 double x = coords[0];
114 double y = coords[1];
115 double z = coords[2];
116 double coef = (height + z) / height;
119 coords[2] -= coef *
delta * (1. - cos(2. * M_PI * x /
lambda));
124 (1. - cos(2. * M_PI * x /
lambda) * cos(2. * M_PI * y /
lambda));
128 "Wrong dimension = %d", dim);
131 CHKERR moab.set_coords(&*nit, 1, coords);
136 MOFEM_LOG_C(
"WORLD", Sev::inform,
"Write file %s\n",