From 7f8320a36d6f80c7a8c50e3c65688d4166e28cf3 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 15 Feb 2007 20:17:06 +0000 Subject: [PATCH] Only use the maximal coefficient for each |k|. git-svn-id: https://svn.dealii.org/trunk@14483 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-27/step-27.cc | 52 +++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/deal.II/examples/step-27/step-27.cc b/deal.II/examples/step-27/step-27.cc index 3f7d1cae25..75d5f751ce 100644 --- a/deal.II/examples/step-27/step-27.cc +++ b/deal.II/examples/step-27/step-27.cc @@ -269,6 +269,7 @@ estimate_smoothness (Vector &smoothness_indicators) const // problems with |k|^{-mu} and also // logarithms of |k| std::vector > k_vectors; + std::vector k_vectors_magnitude; switch (dim) { case 2: @@ -278,9 +279,12 @@ estimate_smoothness (Vector &smoothness_indicators) const if (!((i==0) && (j==0)) && (i*i + j*j < N*N)) - k_vectors.push_back (Point<2>(deal_II_numbers::PI * i, - deal_II_numbers::PI * j)); - + { + k_vectors.push_back (Point<2>(deal_II_numbers::PI * i, + deal_II_numbers::PI * j)); + k_vectors_magnitude.push_back (i*i+j*j); + } + break; } @@ -354,22 +358,44 @@ estimate_smoothness (Vector &smoothness_indicators) const * local_dof_values(i); + // enter the Fourier + // coefficients into a map with + // the k-magnitudes, to make + // sure that we get only the + // largest magnitude for each + // value of |k| + std::map k_to_max_U_map; + for (unsigned int f=0; f