]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Properly initialize array.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 12 May 2008 21:38:47 +0000 (21:38 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 12 May 2008 21:38:47 +0000 (21:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@16086 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-33/step-33.cc

index 75167f12b911493b49af17b3d1e313a3932fdb11..e02d932901be713c00353d412398ed43b78b7da5 100644 (file)
@@ -1817,12 +1817,13 @@ void ConsLaw<dim>::load_parameters(const char *infile){
                                   // Initial conditions.
   prm.enter_subsection("initial condition");
   {
-    std::vector<std::string> expressions;
+    std::vector<std::string> expressions (EulerEquations<dim>::n_components,
+                                         "0.0");
     for (unsigned int di = 0; di < EulerEquations<dim>::n_components; di++)
       {
        char var[512];
        std::sprintf(var, "w_%d value", di);
-       expressions.push_back (prm.get(var));
+       expressions[di] = prm.get(var);
       }
     initial_conditions.initialize (FunctionParser<dim>::default_variable_names(),
                                   expressions,

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.