]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix several bugs with non-primitive and other elements.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 Sep 2002 15:02:39 +0000 (15:02 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 Sep 2002 15:02:39 +0000 (15:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@6455 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_system.cc

index 76dec94c69c7f8d3640dfc02e679f899fa9cfe23..a890debab6e3001ab22af51fd34ddfb5b644db3f 100644 (file)
@@ -267,14 +267,19 @@ FESystem<dim>::shape_value_component (const unsigned int i,
   Assert (i<this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
   Assert (component < this->n_components(),
          ExcIndexRange (component, 0, this->n_components()));
+
+                                   // if this value is supposed to be
+                                   // zero, then return right away...
+  if (nonzero_components[i][component] == false)
+    return 0;
   
-                                  // first find out to which of the
-                                  // base elements this desired
-                                  // component belongs, and which
-                                  // component within this base
+                                   // ...otherwise: first find out to
+                                  // which of the base elements this
+                                  // desired component belongs, and
+                                  // which component within this base
                                   // element it is
-  const unsigned int base              = this->component_to_base(i).first;
-  const unsigned int component_in_base = this->component_to_base(i).second;
+  const unsigned int base              = this->component_to_base(component).first;
+  const unsigned int component_in_base = this->component_to_base(component).second;
 
                                   // then get value from base
                                   // element. note that that will
@@ -315,13 +320,18 @@ FESystem<dim>::shape_grad_component (const unsigned int i,
   Assert (component < this->n_components(),
          ExcIndexRange (component, 0, this->n_components()));
   
-                                  // first find out to which of the
-                                  // base elements this desired
-                                  // component belongs, and which
-                                  // component within this base
-                                  // element it is
-  const unsigned int base              = this->component_to_base(i).first;
-  const unsigned int component_in_base = this->component_to_base(i).second;
+                                   // if this value is supposed to be
+                                   // zero, then return right away...
+  if (nonzero_components[i][component] == false)
+    return Tensor<1,dim>();
+
+                                   // ...otherwise: first find out to
+                                  // which of the base elements this
+                                  // desired component belongs, and
+                                  // which component within this base
+                                  // element it is
+  const unsigned int base              = this->component_to_base(component).first;
+  const unsigned int component_in_base = this->component_to_base(component).second;
   
                                   // then get value from base
                                   // element. note that that will
@@ -362,13 +372,18 @@ FESystem<dim>::shape_grad_grad_component (const unsigned int i,
   Assert (component < this->n_components(),
          ExcIndexRange (component, 0, this->n_components()));
   
-                                  // first find out to which of the
-                                  // base elements this desired
-                                  // component belongs, and which
-                                  // component within this base
+                                   // if this value is supposed to be
+                                   // zero, then return right away...
+  if (nonzero_components[i][component] == false)
+    return Tensor<2,dim>();
+
+                                   // ...otherwise: first find out to
+                                  // which of the base elements this
+                                  // desired component belongs, and
+                                  // which component within this base
                                   // element it is
-  const unsigned int base              = this->component_to_base(i).first;
-  const unsigned int component_in_base = this->component_to_base(i).second;
+  const unsigned int base              = this->component_to_base(component).first;
+  const unsigned int component_in_base = this->component_to_base(component).second;
   
                                   // then get value from base
                                   // element. note that that will

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.