]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Set conditions on updating mapping data
authorJonathan Robey <class4kayaker@gmail.com>
Tue, 30 Aug 2016 22:00:10 +0000 (15:00 -0700)
committerJonathan Robey <class4kayaker@gmail.com>
Wed, 14 Sep 2016 18:33:53 +0000 (11:33 -0700)
include/deal.II/fe/fe_update_flags.h
source/fe/fe_values.cc

index eaa7e27ef8270bf55f8e2cfce9231fbbbda4cd3e..54772165818d9c32337c62584ca767bd569040d9 100644 (file)
@@ -207,7 +207,31 @@ enum UpdateFlags
   /**
    * Combination of the flags needed for Piola transform of Hdiv elements.
    */
-  update_piola = update_volume_elements | update_contravariant_transformation
+  update_piola = update_volume_elements | update_contravariant_transformation,
+  /**
+   * Combination of the flags that require a mapping calculation
+   */
+  update_mapping =
+    // Direct data
+    update_quadrature_points |
+    update_JxW_values |
+    update_jacobians |
+    update_jacobian_grads |
+    update_jacobian_pushed_forward_grads |
+    update_jacobian_2nd_derivatives |
+    update_jacobian_pushed_forward_2nd_derivatives |
+    update_jacobian_3rd_derivatives |
+    update_jacobian_pushed_forward_3rd_derivatives |
+    update_inverse_jacobians |
+    update_boundary_forms |
+    update_normal_vectors |
+    // Transformation dependence
+    update_covariant_transformation |
+    update_contravariant_transformation |
+    update_transformation_values |
+    update_transformation_gradients |
+    // Volume data
+    update_volume_elements
 };
 
 
index 5274b76bf931552794c60cf3175055a42dd3d0e0..7ddb230907ef9e89d9c2890b97587552fcd34fe6 100644 (file)
@@ -3653,7 +3653,8 @@ FEValues<dim,spacedim>::initialize (const UpdateFlags update_flags)
   const UpdateFlags flags = this->compute_update_flags (update_flags);
 
   // initialize the base classes
-  this->mapping_output.initialize(this->n_quadrature_points, flags);
+  if (flags & update_mapping)
+    this->mapping_output.initialize(this->n_quadrature_points, flags);
   this->finite_element_output.initialize(this->n_quadrature_points, *this->fe, flags);
 
   // then get objects into which the FE and the Mapping can store
@@ -3666,16 +3667,19 @@ FEValues<dim,spacedim>::initialize (const UpdateFlags update_flags)
                                    quadrature,
                                    this->finite_element_output);
   Threads::Task<typename Mapping<dim,spacedim>::InternalDataBase *>
-  mapping_get_data = Threads::new_task (&Mapping<dim,spacedim>::get_data,
-                                        *this->mapping,
-                                        flags,
-                                        quadrature);
+  mapping_get_data;
+  if (flags & update_mapping)
+    mapping_get_data = Threads::new_task (&Mapping<dim,spacedim>::get_data,
+                                          *this->mapping,
+                                          flags,
+                                          quadrature);
 
   this->update_flags = flags;
 
   // then collect answers from the two task above
   this->fe_data.reset (fe_get_data.return_value());
-  this->mapping_data.reset (mapping_get_data.return_value());
+  if (flags & update_mapping)
+    this->mapping_data.reset (mapping_get_data.return_value());
 }
 
 
@@ -3772,12 +3776,15 @@ void FEValues<dim,spacedim>::do_reinit ()
   // specific to the mapping. also let it inspect the
   // cell similarity flag and, if necessary, update
   // it
-  this->cell_similarity
-    = this->get_mapping().fill_fe_values(*this->present_cell,
-                                         this->cell_similarity,
-                                         quadrature,
-                                         *this->mapping_data,
-                                         this->mapping_output);
+  if (this->update_flags & update_mapping)
+    {
+      this->cell_similarity
+        = this->get_mapping().fill_fe_values(*this->present_cell,
+                                             this->cell_similarity,
+                                             quadrature,
+                                             *this->mapping_data,
+                                             this->mapping_output);
+    }
 
   // then call the finite element and, with the data
   // already filled by the mapping, let it compute the

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.