]> https://gitweb.dealii.org/ - dealii.git/commitdiff
format indentation and delete deprecated code 606/head
authorLei Qiao <qiaol618@gmail.com>
Fri, 27 Feb 2015 06:10:04 +0000 (00:10 -0600)
committerLei Qiao <qiaol618@gmail.com>
Fri, 27 Feb 2015 06:10:04 +0000 (00:10 -0600)
examples/step-33/step-33.cc

index 007196a6ef185dba280cb91907c086db77640987..c2854effd7521cc18c9cbf2560abc1de3a7e79de 100644 (file)
@@ -231,7 +231,6 @@ namespace Step33
     static
     void compute_flux_matrix (const InputVector &W,
                               std::array <std::array <Number, dim>, EulerEquations<dim>::n_components > &flux)
-//                              Number (&flux)[n_components][dim])
     {
       // First compute the pressure that appears in the flux matrix, and then
       // compute the first <code>dim</code> columns of the matrix that
@@ -269,15 +268,12 @@ namespace Step33
     // $\alpha$. It's form has also been given already in the introduction:
     template <typename InputVector, typename Number>
     static
-    void numerical_normal_flux (const Point<dim>          &normal,
-                                const InputVector         &Wplus,
-                                const InputVector         &Wminus,
-                                const double               alpha,
+    void numerical_normal_flux (const Point<dim>                   &normal,
+                                const InputVector                  &Wplus,
+                                const InputVector                  &Wminus,
+                                const double                        alpha,
                                 std::array < Number, n_components> &normal_flux)
-//                                Number (&normal_flux)[n_components])
     {
-//      Number iflux[n_components][dim];
-//      Number oflux[n_components][dim];
       std::array <std::array <Number, dim>, EulerEquations<dim>::n_components > iflux, oflux;
 
       compute_flux_matrix (Wplus, iflux);
@@ -306,8 +302,7 @@ namespace Step33
     template <typename InputVector, typename Number>
     static
     void compute_forcing_vector (const InputVector &W,
-                                   std::array < Number, n_components> &forcing)
-//                                 Number (&forcing)[n_components])
+                                 std::array < Number, n_components> &forcing)
     {
       const double gravity = -1.0;
 
@@ -1773,29 +1768,17 @@ namespace Step33
     // that we compute the flux matrices and right hand sides in terms of
     // autodifferentiation variables, so that the Jacobian contributions can
     // later easily be computed from it:
-//    typedef Sacado::Fad::DFad<double> FluxMatrix[EulerEquations<dim>::n_components][dim];
-//    FluxMatrix *flux = new FluxMatrix[n_q_points];
 
     std::vector <
-                std::array <std::array <Sacado::Fad::DFad<double>, dim>, EulerEquations<dim>::n_components >
-//                std::array <std::array <Sacado::Fad::DFad<double>, EulerEquations<dim>::n_components>, dim >
-                > flux(n_q_points);
-
-
-//    typedef double FluxMatrixOld[EulerEquations<dim>::n_components][dim];
-//    FluxMatrixOld  *flux_old = new FluxMatrixOld[n_q_points];
+    std::array <std::array <Sacado::Fad::DFad<double>, dim>, EulerEquations<dim>::n_components >
+    > flux(n_q_points);
 
     std::vector <
-                std::array <std::array <double, dim>, EulerEquations<dim>::n_components >
-                > flux_old(n_q_points);
-
-//    typedef Sacado::Fad::DFad<double> ForcingVector[EulerEquations<dim>::n_components];
-//    ForcingVector *forcing = new ForcingVector[n_q_points];
+    std::array <std::array <double, dim>, EulerEquations<dim>::n_components >
+    > flux_old(n_q_points);
 
     std::vector < std::array< Sacado::Fad::DFad<double>, EulerEquations<dim>::n_components> > forcing(n_q_points);
 
-//    typedef double ForcingVectorOld[EulerEquations<dim>::n_components];
-//    ForcingVectorOld *forcing_old = new ForcingVectorOld[n_q_points];
     std::vector < std::array< double, EulerEquations<dim>::n_components> > forcing_old(n_q_points);
 
     for (unsigned int q=0; q<n_q_points; ++q)
@@ -1895,12 +1878,6 @@ namespace Step33
         system_matrix.add(dof_indices[i], dof_indices, residual_derivatives);
         right_hand_side(dof_indices[i]) -= R_i.val();
       }
-
-//    delete[] forcing;
-//    delete[] flux;
-//    delete[] forcing_old;
-//    delete[] flux_old;
-
   }
 
 
@@ -2042,14 +2019,8 @@ namespace Step33
     // w^-, \mathbf n)$ for each quadrature point. Before calling the function
     // that does so, we also need to determine the Lax-Friedrich's stability
     // parameter:
-//    typedef Sacado::Fad::DFad<double> NormalFlux[EulerEquations<dim>::n_components];
-//    NormalFlux *normal_fluxes; = new NormalFlux[n_q_points];
 
     std::vector< std::array < Sacado::Fad::DFad<double>, EulerEquations<dim>::n_components> >  normal_fluxes(n_q_points);
-
-//    typedef double NormalFluxOld[EulerEquations<dim>::n_components];
-//    NormalFluxOld *normal_fluxes_old = new NormalFluxOld[n_q_points];
-
     std::vector< std::array < double, EulerEquations<dim>::n_components> >  normal_fluxes_old(n_q_points);
 
     double alpha;
@@ -2113,9 +2084,6 @@ namespace Step33
 
           right_hand_side(dof_indices[i]) -= R_i.val();
         }
-
-//    delete[] normal_fluxes;
-//    delete[] normal_fluxes_old;
   }
 
 

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.