]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add support point fields and functions to Mapping and remove some exception classes
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 14 Nov 2007 00:18:29 +0000 (00:18 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 14 Nov 2007 00:18:29 +0000 (00:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@15495 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/mapping.h
deal.II/deal.II/include/fe/mapping_cartesian.h
deal.II/deal.II/include/fe/mapping_q1.h
deal.II/deal.II/source/fe/mapping_cartesian.cc
deal.II/deal.II/source/fe/mapping_q1.cc

index 462ea11b14034cb6f36c3856583e40a70f538dbb..5dd92c7553ba59f57109e03516e9dd798ec5df1f 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <base/config.h>
+#include <base/tensor.h>
 #include <base/vector_slice.h>
 #include <grid/tria.h>
 #include <dofs/dof_handler.h>
@@ -217,7 +218,32 @@ class Mapping : public Subscriptor
                                          * object.
                                          */
        virtual unsigned int memory_consumption () const;
-
+       
+                                        /**
+                                         * The positions of the
+                                         * mapped (generalized)
+                                         * support points.
+                                         */
+       std::vector<Point<dim> > support_point_values;
+       
+                                        /*
+                                         * The Jacobian of the
+                                         * transformation in the
+                                         * (generalized) support
+                                         * points.
+                                         */
+       std::vector<Tensor<2,dim> > support_point_gradients;
+       
+                                        /*
+                                         * The inverse of the
+                                         * Jacobian of the
+                                         * transformation in the
+                                         * (generalized) support
+                                         * points.
+                                         */
+       std::vector<Tensor<2,dim> > support_point_inverse_gradients;
+       
+       
       private:
                                          /**
                                           * The value returned by
@@ -336,7 +362,9 @@ class Mapping : public Subscriptor
                                      * The transformed (generalized)
                                      * support point.
                                      */
-    const Point<dim>& support_point_value(const unsigned int index) const;
+    const Point<dim>& support_point_value(
+      const unsigned int index,
+      const typename Mapping<dim>::InternalDataBase &internal) const;
     
                                     /**
                                      * The Jacobian
@@ -344,7 +372,9 @@ class Mapping : public Subscriptor
                                      * in the (generalized) support
                                      * point.
                                      */
-    const Tensor<2,dim>& support_point_gradient(const unsigned int index) const;
+    const Tensor<2,dim>& support_point_gradient(
+      const unsigned int index,
+      const typename Mapping<dim>::InternalDataBase &internal) const;
     
                                     /**
                                      * The inverse Jacobian
@@ -352,7 +382,9 @@ class Mapping : public Subscriptor
                                      * in the (generalized) support
                                      * point.
                                      */
-    const Tensor<2,dim>& support_point_inverse_gradients(const unsigned int index) const;
+    const Tensor<2,dim>& support_point_inverse_gradient(
+      const unsigned int index,
+      const typename Mapping<dim>::InternalDataBase &internal) const;
     
                                      /**
                                       * Return a pointer to a copy of the
@@ -564,6 +596,43 @@ Mapping<dim>::InternalDataBase::clear_first_cell ()
 }
 
 
+
+template <int dim>
+inline
+const Point<dim>&
+Mapping<dim>::support_point_value(
+  const unsigned int index,
+  const typename Mapping<dim>::InternalDataBase& internal) const
+{
+  AssertIndexRange(index, internal.support_point_values.size());
+  return internal.support_point_values[index];  
+}
+
+
+template <int dim>
+inline
+const Tensor<2,dim>&
+Mapping<dim>::support_point_gradient(
+  const unsigned int index,
+  const typename Mapping<dim>::InternalDataBase& internal) const
+{
+  AssertIndexRange(index, internal.support_point_gradients.size());
+  return internal.support_point_gradients[index];
+}
+
+
+template <int dim>
+inline
+const Tensor<2,dim>&
+Mapping<dim>::support_point_inverse_gradient(
+  const unsigned int index,
+  const typename Mapping<dim>::InternalDataBase& internal) const
+{
+  AssertIndexRange(index, internal.support_point_inverse_gradients.size());
+  return internal.support_point_inverse_gradients[index];
+}
+
+
 DEAL_II_NAMESPACE_CLOSE
 
 #endif
index 67657e8a18a07a487be0018c102830a9b497756e..826b7ee88c81efe1340b4e5440efdecb15192d8b 100644 (file)
@@ -135,16 +135,7 @@ class MappingCartesian : public Mapping<dim>
                                       */
     virtual
     Mapping<dim> * clone () const;
-
-                                    /**
-                                     * Exception
-                                     */
-    DeclException0 (ExcInvalidData);
-                                    /**
-                                     * Exception
-                                     */
-    DeclException0 (ExcAccessToUninitializedField);
-
+    
   protected:
                                     /** 
                                      * Storage for internal data of
index 503b05db91bc2006468af8dd742f22adb0ba941b..eba2576ae88f0fb8584c8711fe247247892658f0 100644 (file)
@@ -258,11 +258,6 @@ class MappingQ1 : public Mapping<dim>
                                          */
        unsigned int n_shape_functions;
     };
-    
-                                    /**
-                                     * Exception
-                                     */
-    DeclException0 (ExcAccessToUninitializedField);
 
   protected:
 
index be00a08b4436c30a4587d7585e347d49ebe57a83..2a0d0010c937b5f9cea17f94cb768f7c4af9a90d 100644 (file)
@@ -455,7 +455,7 @@ MappingCartesian<dim>::transform_covariant (
   const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
 
   Assert (data.update_flags & update_covariant_transformation,
-         ExcAccessToUninitializedField());
+         typename FEValuesBase<dim>::ExcAccessToUninitializedField());
 
   Assert (output.size() + offset <= input.size(), ExcInternalError());
   
@@ -479,7 +479,7 @@ MappingCartesian<dim>::transform_covariant (
   const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
 
   Assert (data.update_flags & update_covariant_transformation,
-         ExcAccessToUninitializedField());
+         typename FEValuesBase<dim>::ExcAccessToUninitializedField());
   
   Assert (output.size() + offset <= input.size(), ExcInternalError());
   
@@ -508,7 +508,7 @@ MappingCartesian<dim>::transform_contravariant (
   const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
 
   Assert (data.update_flags & update_contravariant_transformation,
-         ExcAccessToUninitializedField());
+         typename FEValuesBase<dim>::ExcAccessToUninitializedField());
 
   Assert (output.size() + offset <= input.size(), ExcInternalError());
   
@@ -536,7 +536,7 @@ MappingCartesian<dim>::transform_contravariant (
   const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
 
   Assert (data.update_flags & update_contravariant_transformation,
-         ExcAccessToUninitializedField());
+         typename FEValuesBase<dim>::ExcAccessToUninitializedField());
 
   Assert (output.size() + offset <= input.size(), ExcInternalError());
   
index 180a2847d0b6efb9d97cd78507dc51c7a9931160..49d1c05311fdcb57704bc03be359b4e7d314021d 100644 (file)
@@ -841,7 +841,7 @@ MappingQ1<dim>::transform_covariant (
   const InternalData &data=*data_ptr;
 
   Assert (data.update_flags & update_covariant_transformation,
-         ExcAccessToUninitializedField());
+         typename FEValuesBase<dim>::ExcAccessToUninitializedField());
 
   Assert (output.size() + offset <= input.size(), ExcInternalError());
 
@@ -864,7 +864,7 @@ MappingQ1<dim>::transform_covariant (
   const InternalData &data=*data_ptr;
 
   Assert (data.update_flags & update_covariant_transformation,
-         ExcAccessToUninitializedField());
+         typename FEValuesBase<dim>::ExcAccessToUninitializedField());
 
   Assert (output.size() + offset <= input.size(), ExcInternalError());
 
@@ -888,7 +888,7 @@ transform_contravariant (
   const InternalData &data=*data_ptr;
 
   Assert (data.update_flags & update_contravariant_transformation,
-         ExcAccessToUninitializedField());
+         typename FEValuesBase<dim>::ExcAccessToUninitializedField());
 
   Assert (output.size() + offset <= input.size(), ExcInternalError());
 
@@ -911,7 +911,7 @@ MappingQ1<dim>::transform_contravariant (
   const InternalData &data=*data_ptr;
 
   Assert (data.update_flags & update_contravariant_transformation,
-         ExcAccessToUninitializedField());
+         typename FEValuesBase<dim>::ExcAccessToUninitializedField());
 
   Assert (output.size() + offset <= input.size(), ExcInternalError());
 

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.