]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
attempt to W1infty-norm
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Jul 2004 14:58:26 +0000 (14:58 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Jul 2004 14:58:26 +0000 (14:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@9496 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/vectors.h
deal.II/deal.II/source/numerics/vectors.cc

index 2a0584c1628c0c564d31886fcf6e08a496179fe7..71673f92cb2a18c76d64214ed00f1dbd5968cafd 100644 (file)
@@ -325,6 +325,17 @@ class VectorTools
                                            * computed on each cell.
                                            */
          L2_norm,
+                                          /**
+                                           * The absolute value to
+                                           * the <i>p</i>th power is
+                                           * integrated and the pth
+                                           * root is computed on each
+                                           * cell. The exponent
+                                           * <i>p</i> is the last
+                                           * parameter of the
+                                           * function.
+                                           */
+         Lp_norm,
                                           /**
                                            * The maximum absolute
                                            * value of the function.
@@ -341,17 +352,6 @@ class VectorTools
                                            * of the #H1_seminorm.
                                            */
          H1_norm,
-                                          /**
-                                           * The absolute value to
-                                           * the <i>p</i>th power is
-                                           * integrated and the pth
-                                           * root is computed on each
-                                           * cell. The exponent
-                                           * <i>p</i> is the last
-                                           * parameter of the
-                                           * function.
-                                           */
-         Lp_norm,
                                           /**
                                            * #Lp_norm of the gradient.
                                            */
@@ -360,7 +360,17 @@ class VectorTools
                                            * same as #H1_norm for
                                            * <i>L<sup>p</sup></i>.
                                            */
-         W1p_norm
+         W1p_norm,
+                                          /**
+                                           * #Linfty_norm of the gradient.
+                                           */
+         W1infty_seminorm,
+                                          /**
+                                           * same as #H1_norm for
+                                           * <i>L<sup>infty</sup></i>.
+                                           */
+         W1infty_norm
+         
     };
     
                                     /**
index cededd77a97cad34684b7de95b7be8d66f5c51b4..73ae7cb54c35448d33c3a15956d99060e1d7f0ea 100644 (file)
@@ -1229,10 +1229,12 @@ VectorTools::integrate_difference (const Mapping<dim>    &mapping,
     {
       case H1_seminorm:
       case W1p_seminorm:
+      case W1infty_seminorm:
        update_flags |= UpdateFlags (update_gradients);
        break;
       case H1_norm:
       case W1p_norm:
+      case W1infty_norm:
        update_flags |= UpdateFlags (update_gradients);
                                         // no break!
       default:
@@ -1402,6 +1404,7 @@ VectorTools::integrate_difference (const Mapping<dim>    &mapping,
              diff=std::sqrt(diff);
            break;
          case Linfty_norm:
+         case W1infty_norm:
            std::fill_n (psi_scalar.begin(), n_q_points, 0.0);
            for (unsigned int k=0; k<n_components; ++k)
              for (unsigned int q=0; q<n_q_points; ++q)
@@ -1454,6 +1457,24 @@ VectorTools::integrate_difference (const Mapping<dim>    &mapping,
                                        0.0);
            diff = std::sqrt(diff);
            break;
+         case W1infty_seminorm:
+         case W1infty_norm:
+           Assert(false, ExcNotImplemented());
+           std::fill_n (psi_scalar.begin(), n_q_points, 0.0);
+           for (unsigned int k=0; k<n_components; ++k)
+             for (unsigned int q=0; q<n_q_points; ++q)
+               {
+                 double t = 0.;
+                 for (unsigned int d=0;d<dim;++d)
+                   t = std::max(t,std::fabs(psi_grads[q][k][d])
+                                * weight_vectors[q](k));
+                 
+                 psi_scalar[q] = std::max(psi_scalar[q],t);
+               }
+
+           for (unsigned int i=0;i<psi_scalar.size();++i)
+             diff = std::max (diff, psi_scalar[i]);
+           break;
          default:
            break;
        }

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.