cell->face(face)->set_boundary_id(1); // -X faces
else if (std::abs(cell->face(face)->center()[0] - 48.0) < tol_boundary)
cell->face(face)->set_boundary_id(11); // +X faces
- else if (std::abs(std::abs(cell->face(face)->center()[0]) - 0.5) < tol_boundary)
+ else if (std::abs(std::abs(cell->face(face)->center()[2]) - 0.5) < tol_boundary)
cell->face(face)->set_boundary_id(2); // +Z and -Z faces
}
std::cout << "_";
std::cout << std::endl;
- Point<dim> soln_pt (48.0*parameters.scale,60.0*parameters.scale);
+ Point<dim> soln_pt{};
+ soln_pt[0] = 48.0*parameters.scale;
+ soln_pt[1] = 60.0*parameters.scale;
if (dim == 3)
soln_pt[2] = 0.5*parameters.scale;
double vertical_tip_displacement = 0.0;
const bool apply_dirichlet_bc = (it_nr == 0);
// The boundary conditions for the indentation problem are as follows: On
- // the -x, -y and -z faces (ID's 0,2,4) we set up a symmetry condition to
- // allow only planar movement while the +x and +y faces (ID's 1,3) are
- // traction free. In this contrived problem, part of the +z face (ID 5) is
- // set to have no motion in the x- and y-component. Finally, as described
- // earlier, the other part of the +z face has an the applied pressure but
- // is also constrained in the x- and y-directions.
+ // the -x face (ID = 1), we set up a zero-displacement condition, -y and +y traction
+ // free boundary condition (don't need to take care); -z and +z faces (ID = 2) are
+ // not allowed to move along z axis so that it is a plane strain problem.
+ // Finally, as described earlier, +x face (ID = 11) has an the applied
+ // distributed shear force (converted by total force per unit area) which
+ // needs to be taken care as an inhomogeneous Newmann boundary condition.
//
// In the following, we will have to tell the function interpolation
// boundary values which components of the solution vector should be
ZeroFunction<dim>(n_components),
constraints,
fe.component_mask(u_fe));
- else
- VectorTools::interpolate_boundary_values(dof_handler_ref,
- boundary_id,
- ZeroFunction<dim>(n_components),
- constraints,
- fe.component_mask(u_fe));
}
// Zero Z-displacement through thickness direction
ZeroFunction<dim>(n_components),
constraints,
fe.component_mask(z_displacement));
- else
- VectorTools::interpolate_boundary_values(dof_handler_ref,
- boundary_id,
- ZeroFunction<dim>(n_components),
- constraints,
- fe.component_mask(z_displacement));
}
constraints.close();