From f92c9a52e8ad9cfa9ecfb733522cc7e9dd24bd20 Mon Sep 17 00:00:00 2001 From: mcbride Date: Fri, 24 Feb 2012 16:26:00 +0000 Subject: [PATCH] step:44 fixed intial J projection error, updated documentation, intro and results git-svn-id: https://svn.dealii.org/trunk@25164 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-44/doc/intro.dox | 11 ++++-- deal.II/examples/step-44/doc/results.dox | 37 +++++++++---------- deal.II/examples/step-44/step-44.cc | 46 +++++++++++++++++++----- 3 files changed, 64 insertions(+), 30 deletions(-) diff --git a/deal.II/examples/step-44/doc/intro.dox b/deal.II/examples/step-44/doc/intro.dox index 26bfd35111..6c4a51a43d 100644 --- a/deal.II/examples/step-44/doc/intro.dox +++ b/deal.II/examples/step-44/doc/intro.dox @@ -274,7 +274,8 @@ The Helmholtz free energy corresponding to a compressible @image html "step-44.Normalised_runtime.png"

- Runtime on a 4-core machine, normalised against the lowest grid resolution Q1-P0 solution that utilised a SSOR preconditioner. + Runtime on a 4-core machine, normalised against the lowest grid resolution $Q_1-DGPM_0-DGPM_0$ solution that utilised a SSOR preconditioner.

diff --git a/deal.II/examples/step-44/step-44.cc b/deal.II/examples/step-44/step-44.cc index b61ff2dda3..6745bf7075 100644 --- a/deal.II/examples/step-44/step-44.cc +++ b/deal.II/examples/step-44/step-44.cc @@ -1363,14 +1363,45 @@ namespace Step44 // interchangeable. We choose to increment time linearly using a constant time // step size. // -// We start the function with preprocessing, and then output the initial grid -// before starting the simulation proper with the first time (and loading) -// increment: +// We start the function with preprocessing, setting the initial dilatation +// values, and then output the initial grid before starting the simulation +// proper with the first time (and loading) +// increment. +// +// Care must be taken (or at least some thought given) when imposing the +// constraint $\widetilde{J}=1$ on the initial solution field. The constraint +// corresponds to the determinant of the deformation gradient in the undeformed +// configuration, which is the identity tensor. +// We use FE_DGPMonomial bases to interpolate the dilatation field, thus we can't +// simply set the corresponding dof to unity as they correspond to the +// monomial coefficients. Thus we use the VectorTools::project function to do +// the work for us. The VectorTools::project function requires an argument +// indicating the hanging node constraints. We have none in this program +// So we have to create a constraint object. In its original state, constraint +// objects are unsorted, and have to be sorted (using the ConstraintMatrix::close function) +// before they can be used. Have a look at step-21 for more information. +// We only need to enforce the initial condition on the dilatation. +// In order to do this, we make use of a ComponentSelectFunction which acts +// as a mask and sets the J_component of n_components to 1. This is exactly what +// we want. Have a look at its usage in step-20 for more information. template void Solid::run() { make_grid(); system_setup(); + { + ConstraintMatrix constraints; + constraints.close(); + + const ComponentSelectFunction + J_mask (J_component, n_components); + + VectorTools::project (dof_handler_ref, + constraints, + QGauss(degree+2), + J_mask, + solution_n); + } output_results(); time.increment(); @@ -1647,6 +1678,9 @@ namespace Step44 // this operation (we could, in principle simply create a new task using // Threads::new_task for each cell) but there is not much harm done to doing // it this way anyway. +// Furthermore, should their be different material models associated with a +// quadrature point, requiring varying levels of computational expense, then +// the method used here could be advantageous. template struct Solid::PerTaskData_UQPH { @@ -1851,16 +1885,12 @@ namespace Step44 tangent_matrix.reinit(sparsity_pattern); - // We then set up storage vectors noting - // that the dilatation is unity - // (i.e. $\widetilde{J} = 1$) in the - // undeformed configuration... + // We then set up storage vectors system_rhs.reinit(dofs_per_block); system_rhs.collect_sizes(); solution_n.reinit(dofs_per_block); solution_n.collect_sizes(); - solution_n.block(J_dof) = 1.0; // ...and finally set up the quadrature // point history: -- 2.39.5