nor plane-stress conditions.
-## Requirements
-* Version 8.5 or greater of `deal.II`
-
-
## Compiling and running
Similar to the example programs, run
```
discretisation levels and ansatz for the displacement field.
A direct and, by visual inspection, favourable comparison of the following
results can be made with those found in Miehe (1994).
+Specifically, figure 5 of Miehe (1994) plots the vertical displacement at the
+midway point on the traction surface for the compressible 3d case.
Since the material is compressible, shear-locking is not exhibited by the
beam for low-order elements.
Elements per edge | Q1 | Q2
:---------------: | :-------------: | :-------------:
-1 | 24 | 81
2 | 54 | 225
4 | 150 | 729
8 | 486 | 2601
Elements per edge | Q1 | Q2
:---------------: | :-------------: | :-------------:
-1 | 5.15 | 12.19
-2 | 8.72 | 13.83
-4 | 12.02 | 14.22
-8 | 13.61 | 14.30
-16 | 14.13 | 14.32
-32 | 14.28 | 14.33
-64 | 14.32 | 14.33
+2 | 8.638 | 14.30
+4 | 12.07 | 14.65
+8 | 13.86 | 14.71
+16 | 14.49 | 14.73
+32 | 14.67 | 14.74
+64 | 14.72 | 14.74
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()[2]) - 0.5) < tol_boundary)
+ else if (dim == 3 && std::abs(std::abs(cell->face(face)->center()[2]) - 0.5) < tol_boundary)
cell->face(face)->set_boundary_id(2); // +Z and -Z faces
}
dof_handler_ref.distribute_dofs(fe);
DoFRenumbering::Cuthill_McKee(dof_handler_ref);
DoFRenumbering::component_wise(dof_handler_ref, block_component);
- DoFTools::count_dofs_per_block(dof_handler_ref, dofs_per_block,
- block_component);
+ dofs_per_block = DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
std::cout << "Triangulation:"
<< "\n\t Number of active cells: " << triangulation.n_active_cells()
std::cout << "_";
std::cout << std::endl;
- 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;
+ // The measurement point, as stated in the reference paper, is at the midway
+ // point of the surface on which the traction is applied.
+ const Point<dim> soln_pt = (dim == 3 ?
+ Point<dim>(48.0*parameters.scale, 52.0*parameters.scale, 0.5*parameters.scale) :
+ Point<dim>(48.0*parameters.scale, 52.0*parameters.scale));
double vertical_tip_displacement = 0.0;
double vertical_tip_displacement_check = 0.0;
// and we can simply skip the rebuilding step if we do not clear it.
if (it_nr > 1)
return;
- constraints.clear();
const bool apply_dirichlet_bc = (it_nr == 0);
// The boundary conditions for the indentation problem are as follows: On
// select. To this end we first set up such extractor objects and later
// use it when generating the relevant component masks:
- // Fixed left hand side of the beam
+ if (apply_dirichlet_bc)
{
- const int boundary_id = 1;
+ constraints.clear();
- if (apply_dirichlet_bc == true)
+ // Fixed left hand side of the beam
+ {
+ const int boundary_id = 1;
VectorTools::interpolate_boundary_values(dof_handler_ref,
- boundary_id,
- ZeroFunction<dim>(n_components),
- constraints,
- fe.component_mask(u_fe));
- }
+ boundary_id,
+ ZeroFunction<dim>(n_components),
+ constraints,
+ fe.component_mask(u_fe));
+ }
- // Zero Z-displacement through thickness direction
- // This corresponds to a plane strain condition being imposed on the beam
- if (dim == 3)
+ // Zero Z-displacement through thickness direction
+ // This corresponds to a plane strain condition being imposed on the beam
+ if (dim == 3)
{
const int boundary_id = 2;
const FEValuesExtractors::Scalar z_displacement(2);
-
- if (apply_dirichlet_bc == true)
- VectorTools::interpolate_boundary_values(dof_handler_ref,
- boundary_id,
- ZeroFunction<dim>(n_components),
- constraints,
- fe.component_mask(z_displacement));
+ VectorTools::interpolate_boundary_values(dof_handler_ref,
+ boundary_id,
+ ZeroFunction<dim>(n_components),
+ constraints,
+ fe.component_mask(z_displacement));
+ }
+ }
+ else
+ {
+ if (constraints.has_inhomogeneities())
+ {
+ AffineConstraints<double> homogeneous_constraints(constraints);
+ for (unsigned int dof = 0; dof != dof_handler_ref.n_dofs(); ++dof)
+ if (homogeneous_constraints.is_inhomogeneously_constrained(dof))
+ homogeneous_constraints.set_inhomogeneity(dof, 0.0);
+ constraints.clear();
+ constraints.copy_from(homogeneous_constraints);
}
+ }
constraints.close();
}
using namespace dealii;
using namespace Cook_Membrane;
- const unsigned int dim = 2;
+ const unsigned int dim = 3;
try
{
deallog.depth_console(0);