]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix component_to_base_table for non-tensor product case 2614/head
authorDenis Davydov <davydden@gmail.com>
Thu, 19 May 2016 12:38:27 +0000 (14:38 +0200)
committerDenis Davydov <davydden@gmail.com>
Thu, 19 May 2016 14:56:08 +0000 (16:56 +0200)
source/fe/fe_tools.cc

index b0a6e7e2a68314a10a2535bdca7e85c91f497f72..7f87499c2b76f96382d261475e0c458a4784a27f 100644 (file)
@@ -568,15 +568,26 @@ namespace FETools
   {
     unsigned int total_index = 0;
 
-    for (unsigned int base=0; base < fe.n_base_elements(); ++base)
-      for (unsigned int m = 0; m < fe.element_multiplicity(base); ++m)
-        {
-          for (unsigned int k=0; k<fe.base_element(base).n_components(); ++k)
-            component_to_base_table[total_index++]
-              = std::make_pair(std::make_pair(base,k), m);
-        }
-    Assert (total_index == component_to_base_table.size(),
-            ExcInternalError());
+    if (do_tensor_product)
+      {
+        for (unsigned int base=0; base < fe.n_base_elements(); ++base)
+          for (unsigned int m = 0; m < fe.element_multiplicity(base); ++m)
+            {
+              for (unsigned int k=0; k<fe.base_element(base).n_components(); ++k)
+                component_to_base_table[total_index++]
+                  = std::make_pair(std::make_pair(base,k), m);
+            }
+        Assert (total_index == component_to_base_table.size(),
+                ExcInternalError());
+      }
+    else
+      {
+        // The base element establishing a component does not make sense in this case.
+        // Set up to something meaningless:
+        for (unsigned int i = 0; i < component_to_base_table.size(); i++)
+          component_to_base_table[i] = std::make_pair(std::make_pair(numbers::invalid_unsigned_int,numbers::invalid_unsigned_int), numbers::invalid_unsigned_int);
+
+      }
 
 
     // Initialize index tables.  Multi-component base elements have to be

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.