From 598832b5ef8f041ed5ea0d810d31d05be7897a7c Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Tue, 22 Jan 2019 17:45:35 +0100 Subject: [PATCH 1/4] Updated twice-differentiable Assembler function to use ADHelper class --- .../cook_membrane.cc | 246 +++++++++++++----- .../parameters.prm | 6 +- 2 files changed, 182 insertions(+), 70 deletions(-) diff --git a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc index 40528d0b..82b158a3 100644 --- a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc +++ b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc @@ -1,5 +1,5 @@ /* --------------------------------------------------------------------- - * Copyright (C) 2010 - 2015 by the deal.II authors and + * Copyright (C) 2010 - 2015, 2017, 2019 by the deal.II authors and * Jean-Paul Pelteret and Andrew McBride * * This file is part of the deal.II library. @@ -16,7 +16,7 @@ /* * Authors: Jean-Paul Pelteret, University of Erlangen-Nuremberg, - * Andrew McBride, University of Cape Town, 2015, 2017 + * Andrew McBride, University of Cape Town, 2015, 2017, 2019 */ @@ -58,15 +58,15 @@ #include #include #include -#include +#include #include #include #include -#if DEAL_II_VERSION_MAJOR >= 9 && defined(DEAL_II_WITH_TRILINOS) +#if DEAL_II_VERSION_MAJOR >= 9 && (defined(DEAL_II_WITH_ADOLC) || defined(DEAL_II_WITH_TRILINOS)) #include -#define ENABLE_SACADO_FORMULATION +#define ENABLE_AD_FORMULATION #endif // These must be included below the AD headers so that @@ -100,6 +100,7 @@ namespace Cook_Membrane struct AssemblyMethod { unsigned int automatic_differentiation_order; + std::string automatic_differentiation_library; static void declare_parameters(ParameterHandler &prm); @@ -119,6 +120,10 @@ namespace Cook_Membrane "# Order = 0: Both the residual and linearisation are computed manually.\n" "# Order = 1: The residual is computed manually but the linearisation is performed using AD.\n" "# Order = 2: Both the residual and linearisation are computed using AD."); + + prm.declare_entry("Automatic differentiation library", "None", + Patterns::Selection("None|ADOL-C|Sacado"), + "The automatic differentiation library to be used in the assembly of the linear system."); } prm.leave_subsection(); } @@ -128,6 +133,7 @@ namespace Cook_Membrane prm.enter_subsection("Assembly method"); { automatic_differentiation_order = prm.get_integer("Automatic differentiation order"); + automatic_differentiation_library = prm.get("Automatic differentiation library"); } prm.leave_subsection(); } @@ -893,10 +899,10 @@ namespace Cook_Membrane const unsigned int n_q_points_f; // Objects that store the converged solution and right-hand side vectors, - // as well as the tangent matrix. There is a ConstraintMatrix object used + // as well as the tangent matrix. There is a AffineConstraints object used // to keep track of constraints. We make use of a sparsity pattern // designed for a block system. - ConstraintMatrix constraints; + AffineConstraints constraints; BlockSparsityPattern sparsity_pattern; BlockSparseMatrix tangent_matrix; BlockVector system_rhs; @@ -1592,7 +1598,7 @@ namespace Cook_Membrane void copy_local_to_global_ASM(const PerTaskData_ASM &data) { - const ConstraintMatrix &constraints = data.solid->constraints; + const AffineConstraints &constraints = data.solid->constraints; BlockSparseMatrix &tangent_matrix = const_cast *>(data.solid)->tangent_matrix; BlockVector &system_rhs = const_cast *>(data.solid)->system_rhs; @@ -1800,13 +1806,16 @@ namespace Cook_Membrane }; -#ifdef ENABLE_SACADO_FORMULATION +#ifdef ENABLE_AD_FORMULATION + namespace AD = dealii::Differentiation::AD; template struct Assembler > : Assembler_Base > { - typedef Sacado::Fad::DFad ADNumberType; + using ADHelper = AD::ADHelperResidualLinearization; + using ADNumberType = typename ADHelper::ad_type; + using typename Assembler_Base::ScratchData_ASM; using typename Assembler_Base::PerTaskData_ASM; @@ -1913,8 +1922,10 @@ namespace Cook_Membrane template struct Assembler > > : Assembler_Base > > { - typedef Sacado::Fad::DFad ADDerivType; - typedef Sacado::Rad::ADvar ADNumberType; + using ADHelper = AD::ADHelperEnergyFunctional; + using ADNumberType = typename ADHelper::ad_type; + using ADDerivType = typename AD::ADNumberTraits::derivative_type; + using typename Assembler_Base::ScratchData_ASM; using typename Assembler_Base::PerTaskData_ASM; @@ -1925,46 +1936,84 @@ namespace Cook_Membrane ScratchData_ASM &scratch, PerTaskData_ASM &data) { - // Aliases for data referenced from the Solid class - const unsigned int &n_q_points = data.solid->n_q_points; const FEValuesExtractors::Vector &u_fe = data.solid->u_fe; + const unsigned int &n_q_points = data.solid->n_q_points; data.reset(); scratch.reset(); scratch.fe_values_ref.reinit(cell); cell->get_dof_indices(data.local_dof_indices); + const unsigned int n_independent_variables = + data.local_dof_indices.size(); const std::vector > > lqph = - data.solid->quadrature_point_history.get_data(cell); + data.solid->quadrature_point_history.get_data(cell); Assert(lqph.size() == n_q_points, ExcInternalError()); - const unsigned int n_independent_variables = data.local_dof_indices.size(); - std::vector local_dof_values(n_independent_variables); - cell->get_dof_values(scratch.solution_total, - local_dof_values.begin(), - local_dof_values.end()); - - // We now retrieve a set of degree-of-freedom values that - // have the operations that are performed with them tracked. - std::vector local_dof_values_ad (n_independent_variables); - for (unsigned int i=0; i::tape_index tape_index = 1; + // Indicate that we are about to start tracing the operations for + // function evaluation on the tape. If this tape has already been + // used (i.e. the operations are already recorded) then we + // (optionally) load the tape and reuse this data. + const bool is_recording + = ad_helper.start_recording_operations(tape_index); + + // The steps that follow in the recording phase are required for + // tapeless methods as well. + if (is_recording == true) + { + // This is the "recording" phase of the operations. + // First, we set the values for all DoFs. + ad_helper.register_dof_values(scratch.solution_total, data.local_dof_indices); + // Then we get the complete set of degree of freedom values as + // represented by auto-differentiable numbers. The operations + // performed with these variables are tracked by the AD library + // from this point until stop_recording_operations() is called. + const std::vector &dof_values_ad + = ad_helper.get_sensitive_dof_values(); + + // Then we do some problem specific tasks, the first being to + // compute all values, gradients, etc. based on sensitive AD DoF + // values. Here we are fetching the displacement gradients at each + // quadrature point. + std::vector> Grad_u( + n_q_points, Tensor<2, dim, ADNumberType>()); + scratch.fe_values_ref[u_fe].get_function_gradients_from_local_dof_values( + dof_values_ad, Grad_u); + + // This variable stores the cell total energy. + // IMPORTANT: Note that it is hand-initialized with a value of + // zero. This is a highly recommended practise, as some AD numbers + // appear not to safely initialize their internal data structures. + ADNumberType energy_ad = ADNumberType(0.0); + // Compute the cell total energy = (internal + external) energies + for (unsigned int q_point = 0; q_point < n_q_points; ++q_point) { - const Tensor<2,dim,ADNumberType> &grad_u = scratch.solution_grads_u_total[q_point]; - const Tensor<2,dim,ADNumberType> F = Physics::Elasticity::Kinematics::F(grad_u); + // Calculate the deformation gradient at this quadrature point + const Tensor<2,dim,ADNumberType> F = Physics::Elasticity::Kinematics::F(Grad_u[q_point]); + Assert(numbers::value_is_greater_than(determinant(F), 0.0), + ExcMessage("Negative determinant of the deformation " + "gradient detected!")); const ADNumberType det_F = determinant(F); const Tensor<2,dim,ADNumberType> F_bar = Physics::Elasticity::Kinematics::F_iso(F); const SymmetricTensor<2,dim,ADNumberType> b_bar = Physics::Elasticity::Kinematics::b(F_bar); @@ -1980,23 +2029,34 @@ namespace Cook_Membrane // from our QPH history objects for the current quadrature point // and integrate its contribution to increment the total // cell energy. - cell_energy_ad += Psi * JxW; + energy_ad += Psi * JxW; } - // Compute derivatives of reverse-mode AD variables - ADNumberType::Gradcomp(); + // Register the definition of the total cell energy + ad_helper.register_energy_functional(energy_ad); + // Indicate that we have completed tracing the operations onto + // the tape. + ad_helper.stop_recording_operations(false); // write_tapes_to_file + } + else + { + // This is the "tape reuse" phase of the operations. + // Here we will leverage the already traced operations that reside + // on a tape, and simply re-evaluate the tape at a different point + // to get the function values and their derivatives. + // Load the existing tape to be reused + ad_helper.activate_recorded_tape(tape_index); + // Set the new values of the independent variables where the + // recorded dependent functions are to be evaluated (and + // differentiated around). + ad_helper.set_dof_values(scratch.solution_total, data.local_dof_indices); + } - for (unsigned int I=0; I solid_3d(parameters); solid_3d.run(); } -#ifdef ENABLE_SACADO_FORMULATION +#ifdef ENABLE_AD_FORMULATION else if (parameters.automatic_differentiation_order == 1) { std::cout << "Assembly method: Residual computed manually; linearisation performed using AD." << std::endl; - // Allow multi-threading - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, - dealii::numbers::invalid_unsigned_int); +#ifdef DEAL_II_WITH_TRILINOS + if (parameters.automatic_differentiation_library == "Sacado") + { + // Allow multi-threading + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, + dealii::numbers::invalid_unsigned_int); - typedef Sacado::Fad::DFad NumberType; - Solid solid_3d(parameters); - solid_3d.run(); + typedef Sacado::Fad::DFad NumberType; + Solid solid_3d(parameters); + solid_3d.run(); + } + else +#endif +#ifdef DEAL_II_WITH_ADOLC + if (parameters.automatic_differentiation_library == "ADOL-C") + { + AssertThrow(false, ExcNotImplemented()); + // ADOL-C is not thread-safe, so disable threading. + // Parallisation using MPI would be possible though. +// Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); +// +// typedef Sacado::Fad::DFad NumberType; +// Solid solid_3d(parameters); +// solid_3d.run(); + } + else +#endif + { + AssertThrow(false, ExcMessage("The selected auto-differentiable library is not supported.")); + } } else if (parameters.automatic_differentiation_order == 2) { std::cout << "Assembly method: Residual and linearisation computed using AD." << std::endl; - // Sacado Rad-Fad is not thread-safe, so disable threading. - // Parallisation using MPI would be possible though. - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, - 1); +#ifdef DEAL_II_WITH_TRILINOS - typedef Sacado::Rad::ADvar< Sacado::Fad::DFad > NumberType; - Solid solid_3d(parameters); - solid_3d.run(); + if (parameters.automatic_differentiation_library == "Sacado") + { + // Sacado Rad-Fad is not thread-safe, so disable threading. + // Parallisation using MPI would be possible though. + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, + 1); + + typedef Sacado::Rad::ADvar< Sacado::Fad::DFad > NumberType; + Solid solid_3d(parameters); + solid_3d.run(); + } + else +#endif +#ifdef DEAL_II_WITH_ADOLC + if (parameters.automatic_differentiation_library == "ADOL-C") + { + AssertThrow(false, ExcNotImplemented()); +// // ADOL-C is not thread-safe, so disable threading. +// // Parallisation using MPI would be possible though. +// Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, +// 1); +// +// typedef Sacado::Rad::ADvar< Sacado::Fad::DFad > NumberType; +// Solid solid_3d(parameters); +// solid_3d.run(); + } + else +#endif + { + AssertThrow(false, ExcMessage("The selected auto-differentiable library is not supported.")); + } } #endif else diff --git a/Quasi_static_Finite_strain_Compressible_Elasticity/parameters.prm b/Quasi_static_Finite_strain_Compressible_Elasticity/parameters.prm index c21fe8fa..8c4dbeae 100644 --- a/Quasi_static_Finite_strain_Compressible_Elasticity/parameters.prm +++ b/Quasi_static_Finite_strain_Compressible_Elasticity/parameters.prm @@ -5,7 +5,11 @@ subsection Assembly method # Order = 0: Both the residual and linearisation are computed manually. # Order = 1: The residual is computed manually but the linearisation is performed using AD. # Order = 2: Both the residual and linearisation are computed using AD. - set Automatic differentiation order = 0 + set Automatic differentiation order = 2 + + # The automatic differentiation library to be used in the assembly of the linear system. + # Options: None ; ADOL-C ; Sacado + set Automatic differentiation library = Sacado end subsection Finite element system From 55d9d4b506aaa4af8cc753fcd93f0d12e5030c30 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Tue, 22 Jan 2019 17:58:17 +0100 Subject: [PATCH 2/4] Updated once-differentiable Assembler function to use ADHelper class --- .../cook_membrane.cc | 166 ++++++++++++------ 1 file changed, 111 insertions(+), 55 deletions(-) diff --git a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc index 82b158a3..6cad3c2a 100644 --- a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc +++ b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc @@ -1826,65 +1826,107 @@ namespace Cook_Membrane ScratchData_ASM &scratch, PerTaskData_ASM &data) { - // Aliases for data referenced from the Solid class + const FEValuesExtractors::Vector &u_fe = data.solid->u_fe; const unsigned int &n_q_points = data.solid->n_q_points; const unsigned int &dofs_per_cell = data.solid->dofs_per_cell; const FESystem &fe = data.solid->fe; const unsigned int &u_dof = data.solid->u_dof; - const FEValuesExtractors::Vector &u_fe = data.solid->u_fe; data.reset(); scratch.reset(); scratch.fe_values_ref.reinit(cell); cell->get_dof_indices(data.local_dof_indices); + const unsigned int n_independent_variables = + data.local_dof_indices.size(); + const unsigned int n_dependent_variables = dofs_per_cell; const std::vector > > lqph = - const_cast *>(data.solid)->quadrature_point_history.get_data(cell); + data.solid->quadrature_point_history.get_data(cell); Assert(lqph.size() == n_q_points, ExcInternalError()); - const unsigned int n_independent_variables = data.local_dof_indices.size(); - std::vector local_dof_values(n_independent_variables); - cell->get_dof_values(scratch.solution_total, - local_dof_values.begin(), - local_dof_values.end()); - - // We now retrieve a set of degree-of-freedom values that - // have the operations that are performed with them tracked. - std::vector local_dof_values_ad (n_independent_variables); - for (unsigned int i=0; i residual_ad (dofs_per_cell, ADNumberType(0.0)); - for (unsigned int q_point = 0; q_point < n_q_points; ++q_point) + // Create and initialize an instance of the helper class. + ADHelper ad_helper(n_independent_variables, n_dependent_variables); + // Initialize the local data structures for assembly. + // This is also taken care of by the ADHelper, so this step could + // be skipped. + Assert(data.cell_rhs.size() == n_independent_variables, ExcDimensionMismatch(data.cell_rhs.size(),n_independent_variables)); + Assert(data.cell_matrix.m() == n_independent_variables, ExcDimensionMismatch(data.cell_matrix.m(),n_independent_variables)); + Assert(data.cell_matrix.n() == n_dependent_variables, ExcDimensionMismatch(data.cell_matrix.n(),n_dependent_variables)); + + // An optional call to set the amount of memory to be allocated to + // storing taped data. + // If using a taped AD number then we would likely want to increase + // the buffer size from the default values as the expression for each + // residual component will likely be lengthy, and therefore memory + // intensive. + ad_helper.set_tape_buffer_sizes(); + // If using a taped AD number, then at this point we would initiate + // taping of the expression for the energy for this FE type and + // material combination: + // Select a tape number to record to + const typename AD::Types::tape_index tape_index = 1; + // Indicate that we are about to start tracing the operations for + // function evaluation on the tape. If this tape has already been + // used (i.e. the operations are already recorded) then we + // (optionally) load the tape and reuse this data. + const bool is_recording + = ad_helper.start_recording_operations(tape_index); + + // The steps that follow in the recording phase are required for + // tapeless methods as well. + if (is_recording == true) + { + // This is the "recording" phase of the operations. + // First, we set the values for all DoFs. + ad_helper.register_dof_values(scratch.solution_total, data.local_dof_indices); + // Then we get the complete set of degree of freedom values as + // represented by auto-differentiable numbers. The operations + // performed with these variables are tracked by the AD library + // from this point until stop_recording_operations() is called. + const std::vector &dof_values_ad + = ad_helper.get_sensitive_dof_values(); + + // Then we do some problem specific tasks, the first being to + // compute all values, gradients, etc. based on sensitive AD DoF + // values. Here we are fetching the displacement gradients at each + // quadrature point. + std::vector> Grad_u( + n_q_points, Tensor<2, dim, ADNumberType>()); + scratch.fe_values_ref[u_fe].get_function_gradients_from_local_dof_values( + dof_values_ad, Grad_u); + + // This variable stores the cell residual vector contributions. + // IMPORTANT: Note that each entry is hand-initialized with a value + // of zero. This is a highly recommended practise, as some AD + // numbers appear not to safely initialize their internal data + // structures. + std::vector residual_ad ( + n_dependent_variables, ADNumberType(0.0)); + for (unsigned int q_point = 0; q_point < n_q_points; ++q_point) { - const Tensor<2,dim,ADNumberType> &grad_u = scratch.solution_grads_u_total[q_point]; - const Tensor<2,dim,ADNumberType> F = Physics::Elasticity::Kinematics::F(grad_u); + // Calculate the deformation gradient at this quadrature point + const Tensor<2,dim,ADNumberType> F = Physics::Elasticity::Kinematics::F(Grad_u[q_point]); + Assert(numbers::value_is_greater_than(determinant(F), 0.0), + ExcMessage("Negative determinant of the deformation " + "gradient detected!")); const ADNumberType det_F = determinant(F); const Tensor<2,dim,ADNumberType> F_bar = Physics::Elasticity::Kinematics::F_iso(F); const SymmetricTensor<2,dim,ADNumberType> b_bar = Physics::Elasticity::Kinematics::b(F_bar); - const Tensor<2,dim,ADNumberType> F_inv = invert(F); Assert(det_F > ADNumberType(0.0), ExcInternalError()); + const Tensor<2,dim,ADNumberType> F_inv = invert(F); for (unsigned int k = 0; k < dofs_per_cell; ++k) - { - const unsigned int k_group = fe.system_to_base_index(k).first.first; + { + const unsigned int k_group = fe.system_to_base_index(k).first.first; - if (k_group == u_dof) - { - scratch.grad_Nx[q_point][k] = scratch.fe_values_ref[u_fe].gradient(k, q_point) * F_inv; - scratch.symm_grad_Nx[q_point][k] = symmetrize(scratch.grad_Nx[q_point][k]); - } - else - Assert(k_group <= u_dof, ExcInternalError()); + if (k_group == u_dof) + { + scratch.grad_Nx[q_point][k] = scratch.fe_values_ref[u_fe].gradient(k, q_point) * F_inv; + scratch.symm_grad_Nx[q_point][k] = symmetrize(scratch.grad_Nx[q_point][k]); } + else + Assert(k_group <= u_dof, ExcInternalError()); + } const SymmetricTensor<2,dim,ADNumberType> tau = lqph[q_point]->get_tau(det_F,b_bar); @@ -1894,26 +1936,41 @@ namespace Cook_Membrane const double JxW = scratch.fe_values_ref.JxW(q_point); for (unsigned int i = 0; i < dofs_per_cell; ++i) - { - const unsigned int i_group = fe.system_to_base_index(i).first.first; + { + const unsigned int i_group = fe.system_to_base_index(i).first.first; - if (i_group == u_dof) - residual_ad[i] += (symm_grad_Nx[i] * tau) * JxW; - else - Assert(i_group <= u_dof, ExcInternalError()); - } + if (i_group == u_dof) + residual_ad[i] += (symm_grad_Nx[i] * tau) * JxW; + else + Assert(i_group <= u_dof, ExcInternalError()); + } } - for (unsigned int I=0; I; using ADNumberType = typename ADHelper::ad_type; - using ADDerivType = typename AD::ADNumberTraits::derivative_type; using typename Assembler_Base::ScratchData_ASM; using typename Assembler_Base::PerTaskData_ASM; From fdcbff14be32a604695f2091f98ac35b2f0106fd Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Wed, 8 May 2019 19:38:42 +0200 Subject: [PATCH 3/4] Remove max_iterations_lin parameter --- .../cook_membrane.cc | 9 +-------- .../parameters.prm | 5 +---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc index 6cad3c2a..55cedf0e 100644 --- a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc +++ b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc @@ -270,7 +270,6 @@ namespace Cook_Membrane { std::string type_lin; double tol_lin; - double max_iterations_lin; std::string preconditioner_type; double preconditioner_relaxation; @@ -293,10 +292,6 @@ namespace Cook_Membrane Patterns::Double(0.0), "Linear solver residual (scaled by residual norm)"); - prm.declare_entry("Max iteration multiplier", "1", - Patterns::Double(0.0), - "Linear solver iterations (multiples of the system matrix size)"); - prm.declare_entry("Preconditioner type", "ssor", Patterns::Selection("jacobi|ssor"), "Type of preconditioner"); @@ -314,7 +309,6 @@ namespace Cook_Membrane { type_lin = prm.get("Solver type"); tol_lin = prm.get_double("Residual"); - max_iterations_lin = prm.get_double("Max iteration multiplier"); preconditioner_type = prm.get("Preconditioner type"); preconditioner_relaxation = prm.get_double("Preconditioner relaxation"); } @@ -2256,8 +2250,7 @@ namespace Cook_Membrane std::cout << " SLV " << std::flush; if (parameters.type_lin == "CG") { - const int solver_its = tangent_matrix.block(u_dof, u_dof).m() - * parameters.max_iterations_lin; + const int solver_its = tangent_matrix.block(u_dof, u_dof).m(); const double tol_sol = parameters.tol_lin * system_rhs.block(u_dof).l2_norm(); diff --git a/Quasi_static_Finite_strain_Compressible_Elasticity/parameters.prm b/Quasi_static_Finite_strain_Compressible_Elasticity/parameters.prm index 8c4dbeae..a2db6451 100644 --- a/Quasi_static_Finite_strain_Compressible_Elasticity/parameters.prm +++ b/Quasi_static_Finite_strain_Compressible_Elasticity/parameters.prm @@ -5,7 +5,7 @@ subsection Assembly method # Order = 0: Both the residual and linearisation are computed manually. # Order = 1: The residual is computed manually but the linearisation is performed using AD. # Order = 2: Both the residual and linearisation are computed using AD. - set Automatic differentiation order = 2 + set Automatic differentiation order = 1 # The automatic differentiation library to be used in the assembly of the linear system. # Options: None ; ADOL-C ; Sacado @@ -31,9 +31,6 @@ end subsection Linear solver - # Linear solver iterations (multiples of the system matrix size) - set Max iteration multiplier = 1 - # Linear solver residual (scaled by residual norm) set Residual = 1e-6 From 1cd6b33fda28141cb42cba05167610286a2d2fbe Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Wed, 8 May 2019 19:40:02 +0200 Subject: [PATCH 4/4] Fix ADHelper class names --- .../cook_membrane.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc index 55cedf0e..9cdee9f7 100644 --- a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc +++ b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc @@ -1807,7 +1807,7 @@ namespace Cook_Membrane template struct Assembler > : Assembler_Base > { - using ADHelper = AD::ADHelperResidualLinearization; + using ADHelper = AD::ResidualLinearization; using ADNumberType = typename ADHelper::ad_type; using typename Assembler_Base::ScratchData_ASM; @@ -1973,7 +1973,7 @@ namespace Cook_Membrane template struct Assembler > > : Assembler_Base > > { - using ADHelper = AD::ADHelperEnergyFunctional; + using ADHelper = AD::EnergyFunctional; using ADNumberType = typename ADHelper::ad_type; using typename Assembler_Base::ScratchData_ASM;