From: Daniel Arndt Date: Tue, 13 Mar 2018 23:48:47 +0000 (+0100) Subject: Fix Quasi_static_Finite_strain_Compressible_Elasticity X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8426610165a3a3d0390a285f9ec3a3dfc94ecfcf;p=code-gallery.git Fix Quasi_static_Finite_strain_Compressible_Elasticity --- diff --git a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc index 521f093..54a5d7a 100644 --- a/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc +++ b/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc @@ -793,7 +793,7 @@ namespace Cook_Membrane // materials are used in different regions of the domain, as well as the // inverse of the deformation gradient... private: - std_cxx11::shared_ptr< Material_Compressible_Neo_Hook_One_Field > material; + std::shared_ptr< Material_Compressible_Neo_Hook_One_Field > material; }; @@ -1518,17 +1518,17 @@ Point grid_y_transform (const Point &pt_in) // PerTaskData object stores local contributions. struct PerTaskData_ASM { - Solid &solid; - FullMatrix cell_matrix; - Vector cell_rhs; - std::vector local_dof_indices; + const Solid *solid; + FullMatrix cell_matrix; + Vector cell_rhs; + std::vector local_dof_indices; - PerTaskData_ASM(Solid &solid) + PerTaskData_ASM(const Solid *solid) : solid (solid), - cell_matrix(solid.dofs_per_cell, solid.dofs_per_cell), - cell_rhs(solid.dofs_per_cell), - local_dof_indices(solid.dofs_per_cell) + cell_matrix(solid->dofs_per_cell, solid->dofs_per_cell), + cell_rhs(solid->dofs_per_cell), + local_dof_indices(solid->dofs_per_cell) {} void reset() @@ -1629,9 +1629,9 @@ Point grid_y_transform (const Point &pt_in) void copy_local_to_global_ASM(const PerTaskData_ASM &data) { - const ConstraintMatrix &constraints = data.solid.constraints; - BlockSparseMatrix &tangent_matrix = data.solid.tangent_matrix; - BlockVector &system_rhs = data.solid.system_rhs; + const ConstraintMatrix &constraints = data.solid->constraints; + BlockSparseMatrix &tangent_matrix = const_cast *>(data.solid)->tangent_matrix; + BlockVector &system_rhs = const_cast *>(data.solid)->system_rhs; constraints.distribute_local_to_global( data.cell_matrix, data.cell_rhs, @@ -1644,9 +1644,9 @@ Point grid_y_transform (const Point &pt_in) // This function needs to exist in the base class for // Workstream to work with a reference to the base class. virtual void - assemble_system_tangent_residual_one_cell(const typename DoFHandler::active_cell_iterator &cell, - ScratchData_ASM &scratch, - PerTaskData_ASM &data) + assemble_system_tangent_residual_one_cell(const typename DoFHandler::active_cell_iterator &/*cell*/, + ScratchData_ASM &/*scratch*/, + PerTaskData_ASM &/*data*/) { AssertThrow(false, ExcPureFunctionCalled()); } @@ -1657,12 +1657,12 @@ Point grid_y_transform (const Point &pt_in) PerTaskData_ASM &data) { // Aliases for data referenced from the Solid class - const unsigned int &n_q_points_f = data.solid.n_q_points_f; - const unsigned int &dofs_per_cell = data.solid.dofs_per_cell; - const Parameters::AllParameters ¶meters = data.solid.parameters; - const Time &time = data.solid.time; - const FESystem &fe = data.solid.fe; - const unsigned int &u_dof = data.solid.u_dof; + const unsigned int &n_q_points_f = data.solid->n_q_points_f; + const unsigned int &dofs_per_cell = data.solid->dofs_per_cell; + const Parameters::AllParameters ¶meters = data.solid->parameters; + const Time &time = data.solid->time; + const FESystem &fe = data.solid->fe; + const unsigned int &u_dof = data.solid->u_dof; // Next we assemble the Neumann contribution. We first check to see it the // cell face exists on a boundary on which a traction is applied and add @@ -1732,12 +1732,11 @@ Point grid_y_transform (const Point &pt_in) PerTaskData_ASM &data) { // Aliases for data referenced from the Solid class - const unsigned int &n_q_points = data.solid.n_q_points; - const unsigned int &dofs_per_cell = data.solid.dofs_per_cell; - const Parameters::AllParameters ¶meters = data.solid.parameters; - const FESystem &fe = data.solid.fe; - const unsigned int &u_dof = data.solid.u_dof; - 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(); @@ -1745,7 +1744,7 @@ Point grid_y_transform (const Point &pt_in) cell->get_dof_indices(data.local_dof_indices); const std::vector > > lqph = - const_cast &>(data.solid).quadrature_point_history.get_data(cell); + const_cast *>(data.solid)->quadrature_point_history.get_data(cell); Assert(lqph.size() == n_q_points, ExcInternalError()); // We first need to find the solution gradients at quadrature points @@ -1856,12 +1855,11 @@ Point grid_y_transform (const Point &pt_in) PerTaskData_ASM &data) { // Aliases for data referenced from the Solid class - const unsigned int &n_q_points = data.solid.n_q_points; - const unsigned int &dofs_per_cell = data.solid.dofs_per_cell; - const Parameters::AllParameters ¶meters = data.solid.parameters; - const FESystem &fe = data.solid.fe; - const unsigned int &u_dof = data.solid.u_dof; - 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(); @@ -1869,7 +1867,7 @@ Point grid_y_transform (const Point &pt_in) cell->get_dof_indices(data.local_dof_indices); const std::vector > > lqph = - const_cast &>(data.solid).quadrature_point_history.get_data(cell); + const_cast *>(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(); @@ -1926,7 +1924,6 @@ Point grid_y_transform (const Point &pt_in) for (unsigned int i = 0; i < dofs_per_cell; ++i) { - const unsigned int component_i = fe.system_to_component_index(i).first; const unsigned int i_group = fe.system_to_base_index(i).first.first; if (i_group == u_dof) @@ -1967,12 +1964,8 @@ Point grid_y_transform (const Point &pt_in) PerTaskData_ASM &data) { // Aliases for data referenced from the Solid class - const unsigned int &n_q_points = data.solid.n_q_points; - const unsigned int &dofs_per_cell = data.solid.dofs_per_cell; - const Parameters::AllParameters ¶meters = data.solid.parameters; - const FESystem &fe = data.solid.fe; - const unsigned int &u_dof = data.solid.u_dof; - const FEValuesExtractors::Vector &u_fe = data.solid.u_fe; + const unsigned int &n_q_points = data.solid->n_q_points; + const FEValuesExtractors::Vector &u_fe = data.solid->u_fe; data.reset(); scratch.reset(); @@ -1980,7 +1973,7 @@ Point grid_y_transform (const Point &pt_in) cell->get_dof_indices(data.local_dof_indices); 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(); @@ -2070,7 +2063,7 @@ Point grid_y_transform (const Point &pt_in) update_JxW_values); const BlockVector solution_total(get_total_solution(solution_delta)); - typename Assembler_Base::PerTaskData_ASM per_task_data(*this); + typename Assembler_Base::PerTaskData_ASM per_task_data(this); typename Assembler_Base::ScratchData_ASM scratch_data(fe, qf_cell, uf_cell, qf_face, uf_face, solution_total); Assembler assembler;