void test_cell(const FEValuesBase<dim>& fev)
{
const unsigned int n = fev.dofs_per_cell;
+ unsigned int d=fev.get_fe().n_components();
FullMatrix<double> M(n,n);
-// Vector<double> u(n), v(n);
-
cell_matrix(M,fev);
M.print(deallog,8);
+
+ Vector<double> u(n), v(n), w(n);
+ std::vector<std::vector<Tensor<1,dim> > >
+ ugrad(d,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
+
+ std::vector<unsigned int> indices(n);
+ for (unsigned int i=0;i<n;++i)
+ indices[i] = i;
+
+ deallog << "Residuals";
+ for (unsigned int i=0;i<n;++i)
+ {
+ u = 0.;
+ u(i) = 1.;
+ w = 0.;
+ fev.get_function_gradients(u, indices, ugrad, true);
+ cell_residual(w, fev, make_slice(ugrad));
+ M.vmult(v,u);
+ w.add(-1., v);
+ deallog << ' ' << w.l2_norm();
+ if (d==1)
+ {
+ cell_residual(w, fev, ugrad[0]);
+ M.vmult(v,u);
+ w.add(-1., v);
+ deallog << " e" << w.l2_norm();
+ }
+ }
+ deallog << std::endl;
}
{
const unsigned int n = fev.dofs_per_cell;
unsigned int d=fev.get_fe().n_components();
-
FullMatrix<double> M(n,n);
+ nitsche_matrix(M, fev, 17);
+ M.print(deallog,8);
Vector<double> u(n), v(n), w(n);
std::vector<std::vector<double> >
for (unsigned int i=0;i<n;++i)
indices[i] = i;
- nitsche_matrix(M, fev, 17);
- M.print(deallog,8);
-
deallog << "Residuals";
for (unsigned int i=0;i<n;++i)
{
// FE_DGQ<dim> q2(2);
// test_fe(tr, q2);
-// FE_Nedelec<dim> n1(1);
-// test_fe(tr, n1);
+ FE_Nedelec<dim> n1(1);
+ test_fe(tr, n1);
}
DEAL::-0.17 0.67 -0.33 -0.17
DEAL::-0.17 -0.33 0.67 -0.17
DEAL::-0.33 -0.17 -0.17 0.67
+DEAL::Residuals 0 e0 0 e0 0 e0 0 e0
DEAL::boundary_matrix 0
DEAL::11. 0.33 5.3 0.17
DEAL::0.33 0 0.17 0
DEAL::5.3 0.17 11. 0.33
DEAL::0.17 0 0.33 0
-DEAL::Residuals 0 0 0 0
+DEAL::Residuals 0 e0 0 e0 0 e0 0 e0
DEAL::boundary_matrix 1
DEAL::0 0.33 0 0.17
DEAL::0.33 11. 0.17 5.3
DEAL::0 0.17 0 0.33
DEAL::0.17 5.3 0.33 11.
-DEAL::Residuals 0 0 0 0
+DEAL::Residuals 0 e0 0 e0 0 e0 0 e0
DEAL::boundary_matrix 2
DEAL::11. 5.3 0.33 0.17
DEAL::5.3 11. 0.17 0.33
DEAL::0.33 0.17 0 0
DEAL::0.17 0.33 0 0
-DEAL::Residuals 0 0 0 0
+DEAL::Residuals 0 e0 0 e0 0 e0 0 e0
DEAL::boundary_matrix 3
DEAL::0 0 0.33 0.17
DEAL::0 0 0.17 0.33
DEAL::0.33 0.17 11. 5.3
DEAL::0.17 0.33 5.3 11.
-DEAL::Residuals 0 0 0 0
+DEAL::Residuals 0 e0 0 e0 0 e0 0 e0
DEAL::face_matrix 0
DEAL::M11
DEAL::0 0.17 0 0.083
DEAL::0 -0.17 0 -0.083
DEAL::-0.083 -2.7 -0.17 -5.3
DEAL::0 -0.083 0 -0.17
+DEAL::FE_Nedelec<2>(1)
+DEAL::cell matrix
+DEAL::1.0 0 -1.0 0 0 0 0 0 0 0 0 0
+DEAL::0 5.0 0 1.0 0 0 0 0 0 0 0 -1.7
+DEAL::-1.0 0 1.0 0 0 0 0 0 0 0 0 0
+DEAL::0 1.0 0 5.0 0 0 0 0 0 0 0 -1.7
+DEAL::0 0 0 0 1.0 0 -1.0 0 0 0 0 0
+DEAL::0 0 0 0 0 5.0 0 1.0 0 -1.7 0 0
+DEAL::0 0 0 0 -1.0 0 1.0 0 0 0 0 0
+DEAL::0 0 0 0 0 1.0 0 5.0 0 -1.7 0 0
+DEAL::0 0 0 0 0 0 0 0 1.0 0 0 0
+DEAL::0 0 0 0 0 -1.7 0 -1.7 0 2.2 0 0
+DEAL::0 0 0 0 0 0 0 0 0 0 1.0 0
+DEAL::0 -1.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