]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
update step-42 to not need std::unique_ptr
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Mar 2013 20:48:12 +0000 (20:48 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Mar 2013 20:48:12 +0000 (20:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@28933 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-42/CMakeLists.txt
deal.II/examples/step-42/step-42.cc

index 32525e40dbf8dc3872651c4ac7d0e3140302a54b..dc468213e4c8ab9ce85ddcd0269028dc199a515a 100644 (file)
@@ -50,12 +50,4 @@ ENDIF()
 DEAL_II_INITIALIZE_CACHED_VARIABLES()
 PROJECT(${TARGET})
 
-#
-# Workaround: Enable -std=c++0x for Clang as std::unique_ptr is not
-# standardized in C++03
-#
-IF(CMAKE_CXX_COMPILER_ID MATCHES Clang)
-  SET(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
-ENDIF()
-
 DEAL_II_INVOKE_AUTOPILOT()
index 501dac8dd1be9eb433b1bb79db8926b7320150a3..6cbd4fadbbc4c0572ed1266b2c068916273f5e61 100644 (file)
@@ -460,9 +460,9 @@ namespace Step42
     class Obstacle : public Function<dim>
     {
     public:
-      Obstacle (std::unique_ptr<Input<dim> > const &_input) :
+      Obstacle (std_cxx1x::shared_ptr<Input<dim> > const &_input) :
         Function<dim>(dim),
-        input_obstacle_copy(std::move (_input)) {};
+        input_obstacle_copy(_input) {};
 
       virtual double value (const Point<dim>   &p,
                             const unsigned int  component = 0) const;
@@ -471,7 +471,7 @@ namespace Step42
                                  Vector<double>   &values) const;
 
     private:
-      std::unique_ptr<Input<dim> >  const &input_obstacle_copy;
+      std_cxx1x::shared_ptr<Input<dim> >  const &input_obstacle_copy;
     };
 
     template <int dim>
@@ -549,7 +549,7 @@ namespace Step42
     FESystem<dim>        fe;
     DoFHandler<dim>      dof_handler;
 
-    std::unique_ptr<parallel::distributed::SolutionTransfer<dim, TrilinosWrappers::MPI::Vector> > soltrans;
+    std_cxx1x::shared_ptr<parallel::distributed::SolutionTransfer<dim, TrilinosWrappers::MPI::Vector> > soltrans;
 
     IndexSet             locally_owned_dofs;
     IndexSet             locally_relevant_dofs;
@@ -574,8 +574,8 @@ namespace Step42
     TrilinosWrappers::PreconditionAMG::AdditionalData additional_data;
     TrilinosWrappers::PreconditionAMG preconditioner_u;
 
-    std::unique_ptr<Input<dim> >               input_obstacle;
-    std::unique_ptr<ConstitutiveLaw<dim> >     plast_lin_hard;
+    std_cxx1x::shared_ptr<Input<dim> >               input_obstacle;
+    std_cxx1x::shared_ptr<ConstitutiveLaw<dim> >     plast_lin_hard;
 
     double sigma_0;    // Yield stress
     double gamma;      // Parameter for the linear isotropic hardening

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.