]> https://gitweb.dealii.org/ - dealii.git/commitdiff
new constructor using auxiliary functions
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 29 Sep 2005 12:45:08 +0000 (12:45 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 29 Sep 2005 12:45:08 +0000 (12:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@11552 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc

index ca491a306bb5d115526559737d44591c3bfa3b7f..34d56500776e5a6d7b28b144bff5d64aeb4f3408 100644 (file)
@@ -45,18 +45,54 @@ FE_RaviartThomasNodal<dim>::FE_RaviartThomasNodal (const unsigned int deg)
                    std::vector<bool>(dim,true)))
 {
   Assert (dim >= 2, ExcImpossibleInDim(dim));
+  const unsigned int n_dofs = this->dofs_per_cell;
   
   this->mapping_type = this->independent_on_cartesian;
                                   // These must be done first, since
                                   // they change the evaluation of
                                   // basis functions
+
+                                  // Set up the generalized support
+                                  // points
   initialize_unit_support_points (deg);
-  initialize_node_matrix();
+
+                                  //Now compute the inverse node
+                                  //matrix, generating the correct
+                                  //basis functions from the raw
+                                  //ones.
+  
+                                  // We use an auxiliary matrix in
+                                  // this function. Therefore,
+                                  // inverse_node_matrix is still
+                                  // empty and shape_value_component
+                                  // returns the 'raw' shape values.
+  FullMatrix<double> M(n_dofs, n_dofs);
+  FETools::compute_node_matrix(M, *this);
+  this->inverse_node_matrix.reinit(n_dofs, n_dofs);
+  this->inverse_node_matrix.invert(M);
+                                  // From now on, the shape functions
+                                  // will be the correct ones, not
+                                  // the raw shape functions anymore.
   
   for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i)
     this->prolongation[i].reinit (this->dofs_per_cell,
                                  this->dofs_per_cell);
   FETools::compute_embedding_matrices (*this, &this->prolongation[0]);
+  
+  std::vector<FullMatrix<double> >
+    face_embeddings(1<<(dim-1), FullMatrix<double>(this->dofs_per_face,
+                                                  this->dofs_per_face));
+  FETools::compute_face_embedding_matrices(*this, &face_embeddings[0], 0, 0);
+  interface_constraints.reinit((1<<(dim-1)) * this->dofs_per_face,
+                              this->dofs_per_face);
+  unsigned int target_row=0;
+  for (unsigned int d=0;d<face_embeddings.size();++d)
+    for (unsigned int i=0;i<face_embeddings[d].m();++i)
+      {
+       for (unsigned int j=0;j<face_embeddings[d].n();++j)
+         interface_constraints(target_row,j) = face_embeddings[d](i,j);
+       ++target_row;
+      }
 }
 
 
@@ -358,16 +394,6 @@ template <int dim>
 void
 FE_RaviartThomasNodal<dim>::initialize_node_matrix ()
 {
-  const unsigned int n_dofs = this->dofs_per_cell;
-                                  // We use an auxiliary matrix in
-                                  // this function. Therefore,
-                                  // inverse_node_matrix is still
-                                  // empty and shape_value_component
-                                  // returns the 'raw' shape values.
-  FullMatrix<double> M(n_dofs, n_dofs);
-  FETools::compute_node_matrix(M, *this);
-  this->inverse_node_matrix.reinit(n_dofs, n_dofs);
-  this->inverse_node_matrix.invert(M);
 }
 
 

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.