]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix interface constraints in 2D and disable in 3D
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 24 Oct 2010 18:27:59 +0000 (18:27 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 24 Oct 2010 18:27:59 +0000 (18:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@22460 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_nedelec.h
deal.II/deal.II/source/fe/fe_nedelec.cc

index ffcf7adbf9790ed0d2a33113130677b0003b679c..db49d30724dc8c4cada1784aa5f44cfe1f557e54 100644 (file)
@@ -33,6 +33,11 @@ template <int dim, int spacedim> class MappingQ;
 /*@{*/
 
 /**
+ * @warning Several aspects of the implementation are
+ * experimental. For the moment, it is safe to use the element on
+ * globally refined meshes with consistent orientation of faces. See
+ * the todo entries below for more detailed caveats.
+ *
  * Implementation of N&eacute;d&eacute;lec elements, conforming with the
  * space H<sup>curl</sup>. These elements generate vector fields with
  * tangential components continuous between mesh cells.
@@ -59,6 +64,11 @@ template <int dim, int spacedim> class MappingQ;
  * This class is not implemented for the codimension one case
  * (<tt>spacedim != dim</tt>).
  *
+ * @todo The constraint matrices for hanging nodes are only
+ * implemented in 2D. Currently, the 3D version will run without an
+ * exception being triggered, but results at refinement edges will be
+ * wrong.
+ *
  * @todo Even if this element is implemented for two and three space
  * dimensions, the definition of the node values relies on
  * consistently oriented faces in 3D. Therefore, care should be taken
index 802dc6a05fa4cfef07062a48447844a86a44c176..0b58fd2d8af912ae09f3f65de96dd1f42091a1cc 100644 (file)
@@ -62,28 +62,48 @@ deg (p)
                                   // Fill prolongation matrices with embedding operators
   FETools::compute_embedding_matrices (*this, this->prolongation);
   initialize_restriction ();
+  
+  switch (dim)
+    {
+      case 2:
+           this->interface_constraints.reinit (
+             GeometryInfo<dim>::max_children_per_face * this->dofs_per_face,
+             this->dofs_per_face);
+           break;
+      case 3:
+           this->interface_constraints.reinit (
+             GeometryInfo<dim>::max_children_per_face * this->dofs_per_face
+             - 4 * this->dofs_per_line,
+             this->dofs_per_face);
+           break;
+      default:
+           Assert(false, ExcNotImplemented());
+           break;
+    }
 
-  FullMatrix<double> face_embeddings[GeometryInfo<dim>::max_children_per_face];
-
-  for (unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face; ++i)
-     face_embeddings[i].reinit (this->dofs_per_face, this->dofs_per_face);
-
-  FETools::compute_face_embedding_matrices<dim,double>
-    (*this, face_embeddings, 0, 0);
-  this->interface_constraints.reinit ((1 << (dim - 1)) * this->dofs_per_face,
-                                      this->dofs_per_face);
-
-  unsigned int target_row = 0;
-
-  for (unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face; ++i)
-    for (unsigned int j = 0; j < face_embeddings[i].m (); ++j)
-      {
-        for (unsigned int k = 0; k < face_embeddings[i].n (); ++k)
-          this->interface_constraints (target_row, k)
-            = face_embeddings[i] (j, k);
-
-        ++target_row;
-      }
+  if (dim==2)
+    {
+      FullMatrix<double> face_embeddings[GeometryInfo<dim>::max_children_per_face];
+      
+      for (unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face; ++i)
+       face_embeddings[i].reinit (this->dofs_per_face, this->dofs_per_face);
+      
+      FETools::compute_face_embedding_matrices<dim,double>
+       (*this, face_embeddings, 0, 0);
+      unsigned int target_row = 0;
+      
+      for (unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face; ++i)
+       for (unsigned int j = 0; j < face_embeddings[i].m (); ++j)
+         {
+           for (unsigned int k = 0; k < face_embeddings[i].n (); ++k)
+             this->interface_constraints (target_row, k)
+               = face_embeddings[i] (j, k);
+           
+           ++target_row;
+         }
+    }
+  else
+    this->interface_constraints.reinit(0,0);
 }
 
 
@@ -100,7 +120,7 @@ FE_Nedelec<dim>::get_name () const
                                   // have to be kept in synch
 
   std::ostringstream namebuf;
-  namebuf << "FE_Nedelec<" << dim << ">(" << deg << ")";
+  namebuf << "FE_Nedelec<" << dim << ">(" << this->tensor_degree()-1 << ")";
 
   return namebuf.str();
 }
@@ -1304,7 +1324,7 @@ template <int dim>
 bool
 FE_Nedelec<dim>::hp_constraints_are_implemented () const
 {
-  return true;
+  return dim != 2;
 }
 
 template <int dim>

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.