From: Wolfgang Bangerth Date: Tue, 14 Apr 2020 03:27:01 +0000 (-0600) Subject: Fix an indexing bug with complex output and postprocessors. X-Git-Tag: v9.2.0-rc1~237^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a431f3b50fc5e0d0e96b102f4e7901772cb2b8c;p=dealii.git Fix an indexing bug with complex output and postprocessors. --- diff --git a/source/numerics/data_out.cc b/source/numerics/data_out.cc index 676c6f45c1..39b1545239 100644 --- a/source/numerics/data_out.cc +++ b/source/numerics/data_out.cc @@ -277,11 +277,10 @@ DataOut::build_one_patch( } else { - // The solution is complex-valued. We don't currently - // know how to handle this in the most general case, - // but we can deal with it as long as there is only a - // scalar solution since then we can just collate the two - // components of the scalar solution into one vector field + // The solution is complex-valued. Let's cover the scalar + // case first (i.e., one scalar but complex-valued field, + // which we will have to split into its real and imaginar + // parts). if (n_components == 1) { scratch_data.resize_system_vectors(2); @@ -668,7 +667,7 @@ DataOut::build_one_patch( } // Now we need to copy the result of the postprocessor to - // the Patch object where it can then be further processes + // the Patch object where it can then be further processed // by the functions in DataOutBase for (unsigned int q = 0; q < n_q_points; ++q) for (unsigned int component = 0; @@ -677,6 +676,10 @@ DataOut::build_one_patch( patch.data(offset + component, q) = scratch_data.postprocessed_values[dataset_number][q]( component); + + // Move the counter for the output location forward as + // appropriate + offset += dataset->n_output_variables; } else {