]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Many changes regarding the 1D implementation. Some things didn't even compile. They...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 27 Jul 1998 22:12:51 +0000 (22:12 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 27 Jul 1998 22:12:51 +0000 (22:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@458 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe.cc
deal.II/deal.II/source/fe/fe_lib.cubic.cc
deal.II/deal.II/source/fe/fe_lib.linear.cc
deal.II/deal.II/source/fe/fe_lib.quartic.cc
deal.II/deal.II/source/fe/fe_linear_mapping.cc
deal.II/deal.II/source/grid/tria.cc

index 449de51e7c30df641709648bc1e3bdcdb59d3309..80fc0fc80d11193af4e83735d1471ce4baefd426 100644 (file)
@@ -73,7 +73,7 @@ FiniteElementBase<1>::FiniteElementBase (const unsigned int dofs_per_vertex,
                                         const unsigned int n_transform_funcs) :
                FiniteElementData<1> (dofs_per_vertex,
                                      dofs_per_line,
-                                     n_transform_functs)
+                                     n_transform_funcs)
 {
   Assert (dofs_per_quad==0, ExcInternalError());
 
@@ -181,8 +181,8 @@ void FiniteElement<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &cell,
                                       const bool         compute_ansatz_points,
                                       vector<Point<1> > &q_points,
                                       const bool         compute_q_points,
-                                      const dFMatrix      &shape_values_transform,
-                                      const vector<vector<Point<dim> > > &shape_grad_transform,
+                                      const dFMatrix      &,
+                                      const vector<vector<Point<1> > > &,
                                       const Boundary<1> &boundary) const {
   Assert (jacobians.size() == unit_points.size(),
          ExcWrongFieldDimension(jacobians.size(), unit_points.size()));
@@ -200,6 +200,9 @@ void FiniteElement<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &cell,
       if (compute_jacobians)
        jacobians[i](0,0) = 1./h;
       if (compute_q_points)
+                                        // assume a linear mapping from unit
+                                        // to real space. overload this
+                                        // function if you don't like that
        q_points[i] = cell->vertex(0) + h*unit_points[i];
     };
 
@@ -258,9 +261,9 @@ void FiniteElement<1>::fill_fe_subface_values (const DoFHandler<1>::cell_iterato
 
 
 template <>
-void FiniteElement<1>::get_unit_ansatz_points (vector<Point<1> > &unit_points) const {
-  Assert (unit_points.size() == total_dofs,
-         ExcWrongFieldDimension(unit_points.size(), total_dofs));
+void FiniteElement<1>::get_unit_ansatz_points (vector<Point<1> > &ansatz_points) const {
+  Assert (ansatz_points.size() == total_dofs,
+         ExcWrongFieldDimension(ansatz_points.size(), total_dofs));
                                   // compute ansatz points. The first ones
                                   // belong to vertex one, the second ones
                                   // to vertex two, all following are
index b9179eaa76c414ac77f64fc6f8350e64d001fd19..95bf9904daa073c5bebf113eff6c01d6cc629490 100644 (file)
@@ -87,7 +87,7 @@
   perl -pi -e 's/grad_phi_polynom\[(\d)\] = (.*);/case $1: return Point<1>($2);/g;' shape_grad_1d
   perl -pi -e 's/\[(\d+)\]\[(\d)\]/($1,$2)/g;' massmatrix_1d
   perl -pi -e 's/\[(\d+)\]\[(\d)\]\[(\d)\]/[$1]($2,$3)/g;' prolongation_1d
-  perl -pi -e 's/(t\d+) =/const double $1/g;' massmatrix_1d
+  perl -pi -e 's/(t\d+) =/const double $1 =/g;' massmatrix_1d
 */
 
 
@@ -415,12 +415,12 @@ void FECubicSub<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &c
   const double h = cell->vertex(1)(0) - cell->vertex(0)(0);
   Assert (h>0, ExcJacobiDeterminantHasWrongSign());
 
-  const double t1 8.0/105.0*h;
-  const double t2 19.0/1680.0*h;
-  const double t3 33.0/560.0*h;
-  const double t4 3.0/140.0*h;
-  const double t5 27.0/70.0*h;
-  const double t6 27.0/560.0*h;
+  const double t1 8.0/105.0*h;
+  const double t2 19.0/1680.0*h;
+  const double t3 33.0/560.0*h;
+  const double t4 3.0/140.0*h;
+  const double t5 27.0/70.0*h;
+  const double t6 27.0/560.0*h;
   local_mass_matrix(0,0) = t1;
   local_mass_matrix(0,1) = t2;
   local_mass_matrix(0,2) = t3;
index 3eb0afa921834c79fa3b9299d77816ff0bf38213..7311fc16a01dfaabf2cdfef37c34d3d723083a82 100644 (file)
@@ -1,3 +1,4 @@
+
 /* $Id$ */
 
 #include <fe/fe_lib.h>
@@ -226,10 +227,10 @@ FELinear<2>::shape_value (const unsigned int i,
   Assert((i<total_dofs), ExcInvalidIndex(i));
   switch (i)
     {
-    case 0: return (1.-p(0)) * (1.-p(1));
-    case 1: return p(0) * (1.-p(1));
-    case 2: return p(0) * p(1);
-    case 3: return (1.-p(0)) * p(1);
+      case 0: return (1.-p(0)) * (1.-p(1));
+      case 1: return p(0) * (1.-p(1));
+      case 2: return p(0) * p(1);
+      case 3: return (1.-p(0)) * p(1);
     }
   return 0.;
 };
@@ -245,10 +246,10 @@ FELinear<2>::shape_grad (const unsigned int i,
   Assert((i<total_dofs), ExcInvalidIndex(i));
   switch (i)
     {
-    case 0: return Point<2> (p(1)-1., p(0)-1.);
-    case 1: return Point<2> (1.-p(1), -p(0));
-    case 2: return Point<2> (p(1), p(0));
-    case 3: return Point<2> (-p(1), 1.-p(0));
+      case 0: return Point<2> (p(1)-1., p(0)-1.);
+      case 1: return Point<2> (1.-p(1), -p(0));
+      case 2: return Point<2> (p(1), p(0));
+      case 3: return Point<2> (-p(1), 1.-p(0));
     }
   return Point<2> ();
 };
@@ -344,17 +345,20 @@ void FELinear<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cel
   local_mass_matrix(0,2) = t15;
   local_mass_matrix(0,3) = t16;
   local_mass_matrix(1,0) = t14;
-  local_mass_matrix(1,1) = t2/12-t3/12-t4/36-t12/18+t5/12+t6/36+t7/36-t8/12-t9/36+t13/18;
+  local_mass_matrix(1,1) = t2/12-t3/12-t4/36-t12/18+t5/12+t6/36+
+                          t7/36-t8/12-t9/36+t13/18;
   local_mass_matrix(1,2) = t18;
   local_mass_matrix(1,3) = t15;
   local_mass_matrix(2,0) = t15;
   local_mass_matrix(2,1) = t18;
-  local_mass_matrix(2,2) = -t1/18+t2/12+t5/36-t3/36+t6/12-t9/12+t10/18-t4/36+t7/36-t8/12;
+  local_mass_matrix(2,2) = -t1/18+t2/12+t5/36-t3/36+t6/12-t9/12+
+                          t10/18-t4/36+t7/36-t8/12;
   local_mass_matrix(2,3) = t20;
   local_mass_matrix(3,0) = t16;
   local_mass_matrix(3,1) = t15;
   local_mass_matrix(3,2) = t20;
-  local_mass_matrix(3,3) = t12/18+t2/36+t5/36-t3/36+t6/12-t9/12-t13/18-t4/12+t7/12-t8/36;
+  local_mass_matrix(3,3) = t12/18+t2/36+t5/36-t3/36+t6/12-t9/12-
+                          t13/18-t4/12+t7/12-t8/36;
 };
 
 
index 9c55c2f8e742ba2a09d5f5adfe9ae7489b9d1f9b..14ee872bbf9992684c22200e80223cb403a9481d 100644 (file)
@@ -91,7 +91,7 @@
   perl -pi -e 's/\[(\d+)\]\[(\d)\]/($1,$2)/g;' massmatrix_1d
   perl -pi -e 's/\[(\d+)\]\[(\d)\]\[(\d)\]/[$1]($2,$3)/g;' prolongation_1d
   perl -pi -e 's/.*= 0.0;\n//g;' prolongation_1d
-  perl -pi -e 's/(t\d+) =/const double $1/g;' massmatrix_1d
+  perl -pi -e 's/(t\d+) =/const double $1 =/g;' massmatrix_1d
 */
 
 
@@ -428,14 +428,14 @@ void FEQuarticSub<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator
   const double h = cell->vertex(1)(0) - cell->vertex(0)(0);
   Assert (h>0, ExcJacobiDeterminantHasWrongSign());
 
-  const double t1 146.0/2835.0*h;
-  const double t2 29.0/5670.0*h;
-  const double t3 148.0/2835.0*h;
-  const double t4 29.0/945.0*h;
-  const double t5 4.0/405.0*h;
-  const double t6 128.0/405.0*h;
-  const double t7 64.0/945.0*h;
-  const double t8 128.0/2835.0*h;
+  const double t1 146.0/2835.0*h;
+  const double t2 29.0/5670.0*h;
+  const double t3 148.0/2835.0*h;
+  const double t4 29.0/945.0*h;
+  const double t5 4.0/405.0*h;
+  const double t6 128.0/405.0*h;
+  const double t7 64.0/945.0*h;
+  const double t8 128.0/2835.0*h;
   local_mass_matrix(0,0) = t1;
   local_mass_matrix(0,1) = -t2;
   local_mass_matrix(0,2) = t3;
index 4f86319dc61e289949029d2973429201b247d4d7..2c0c986b43ec78c388ab31bc2b55b8fe364f7d80 100644 (file)
@@ -100,7 +100,7 @@ void FELinearMapping<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &cel
                                         vector<Point<1> > &q_points,
                                         const bool         compute_q_points,
                                         const dFMatrix      &shape_values_transform,
-                                        const vector<vector<Point<dim> > > &shape_gradients_transform,
+                                        const vector<vector<Point<1> > > &shape_gradients_transform,
                                         const Boundary<1> &boundary) const {
                                   // simply pass down
   FiniteElement<1>::fill_fe_values (cell, unit_points,
@@ -205,10 +205,10 @@ void FELinearMapping<2>::get_subface_jacobians (const DoFHandler<2>::face_iterat
 
 template <>
 void FELinearMapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
-                                          const unsigned int       face_no,
-                                          const Boundary<2>       &,
-                                          const vector<Point<1> > &unit_points,
-                                          vector<Point<2> > &normal_vectors) const {
+                                            const unsigned int       face_no,
+                                            const Boundary<2>       &,
+                                            const vector<Point<1> > &unit_points,
+                                            vector<Point<2> > &normal_vectors) const {
                                   // more or less copied from the linear
                                   // finite element
   Assert (unit_points.size() == normal_vectors.size(),
@@ -237,10 +237,10 @@ void FELinearMapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator
 
 template <>
 void FELinearMapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
-                                          const unsigned int       face_no,
-                                          const unsigned int,
-                                          const vector<Point<1> > &unit_points,
-                                          vector<Point<2> > &normal_vectors) const {
+                                            const unsigned int       face_no,
+                                            const unsigned int,
+                                            const vector<Point<1> > &unit_points,
+                                            vector<Point<2> > &normal_vectors) const {
                                   // more or less copied from the linear
                                   // finite element
                                   // note, that in 2D the normal vectors to the
index 3f2c8887edc53d08a9e923e19441d613e4241540..8137c2c9ed22d63f4b6d0c3ea6cc82ce05d9af64 100644 (file)
@@ -122,10 +122,12 @@ void Triangulation<dim>::copy_triangulation (const Triangulation<dim> &old_tria)
 template <>
 void Triangulation<1>::create_triangulation (const vector<Point<1> >    &v,
                                             const vector<CellData<1> > &cells,
-                                            const SubCellData          &) {
+                                            const SubCellData &subcelldata) {
                                   // note: since no boundary information
                                   // can be given in one dimension, the
-                                  // #subcelldata# field is ignored.
+                                  // #subcelldata# field is ignored. (only
+                                  // used for error checking, which is a
+                                  // good idea in any case)
   
   const unsigned int dim=1;
   

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.