exact_int=1./std::pow(static_cast<double>(i+1),dim);
err = std::fabs(quadrature_int-exact_int);
}
- while (err<1e-15);
+ while (err<1e-14);
// Uncomment here for testing
// deallog << " (Int " << quadrature_int << ',' << exact_int << ")";
deallog << " is exact for polynomials of degree " << i-1 << std::endl;
#include <grid/grid_generator.h>
#include <dofs/dof_accessor.h>
#include <dofs/dof_handler.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fstream>
#include <grid/tria_iterator.h>
#include <dofs/dof_accessor.h>
#include <dofs/dof_tools.h>
+#include <dofs/dof_constraints.h>
#include <grid/grid_generator.h>
#include <fe/fe_q.h>
#include <fe/fe_dgq.h>
--- /dev/null
+//---------------------------- sparsity_pattern_05.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2000, 2001, 2003, 2004, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- sparsity_pattern_05.cc ---------------------------
+
+
+// check that generating a sparsity pattern without constraints and later
+// calling constraints.condense() on it results in the same pattern as when
+// creating the condensed pattern right away
+
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <lac/sparsity_pattern.h>
+#include <lac/block_sparsity_pattern.h>
+#include <lac/compressed_sparsity_pattern.h>
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_accessor.h>
+#include <grid/grid_generator.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_tools.h>
+#include <dofs/dof_constraints.h>
+#include <fe/fe_q.h>
+#include <fe/fe_system.h>
+
+#include <fstream>
+
+
+
+bool operator == (const SparsityPattern &sp1,
+ const SparsityPattern &sp2)
+{
+ if (sp1.n_nonzero_elements() != sp2.n_nonzero_elements())
+ return false;
+
+ for (unsigned int i=0; i<sp1.n_nonzero_elements(); ++i)
+ if (sp1.get_column_numbers()[i] !=
+ sp2.get_column_numbers()[i])
+ {
+ Assert (false, ExcInternalError());
+ return false;
+ }
+
+ for (unsigned int i=0; i<sp1.n_rows(); ++i)
+ if (sp1.get_rowstart_indices()[i] !=
+ sp2.get_rowstart_indices()[i])
+ {
+ Assert (false, ExcInternalError());
+ return false;
+ }
+
+ return true;
+}
+
+
+
+bool operator == (const BlockSparsityPattern &sp1,
+ const BlockSparsityPattern &sp2)
+{
+ if (sp1.n_block_rows() != sp2.n_block_rows())
+ return false;
+
+ if (sp1.n_block_cols() != sp2.n_block_cols())
+ return false;
+
+ for (unsigned int i=0; i<sp1.n_block_rows(); ++i)
+ for (unsigned int j=0; j<sp1.n_block_cols(); ++j)
+ if (!(sp1.block(i,j) == sp2.block(i,j)))
+ {
+ Assert (false, ExcInternalError());
+ return false;
+ }
+
+ return true;
+}
+
+
+
+
+template <int dim>
+void
+check ()
+{
+ Triangulation<dim> tr;
+ if (dim==2)
+ GridGenerator::hyper_ball(tr, Point<dim>(), 1);
+ else
+ GridGenerator::hyper_cube(tr, -1,1);
+ tr.refine_global (1);
+ tr.begin_active()->set_refine_flag ();
+ tr.execute_coarsening_and_refinement ();
+ tr.begin_active(2)->set_refine_flag ();
+ tr.execute_coarsening_and_refinement ();
+ if (dim==1)
+ tr.refine_global(2);
+
+ // create a system element composed
+ // of one Q1 and one Q2 element
+ FESystem<dim> element(FE_Q<dim>(1), 1,
+ FE_Q<dim>(2), 1);
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(element);
+
+ ConstraintMatrix constraints;
+ DoFTools::make_hanging_node_constraints (dof, constraints);
+ constraints.close ();
+
+
+//--------------- Regular sparsity pattern checks -----------------
+
+ // first way: directly
+ SparsityPattern sparsity_1 (dof.n_dofs(), dof.n_dofs());
+ DoFTools::make_sparsity_pattern (dof, sparsity_1);
+ constraints.condense (sparsity_1);
+ sparsity_1.compress ();
+
+ // second way: via direct elimination of
+ // constraints
+ SparsityPattern sparsity_2;
+ CompressedSparsityPattern csp_2 (dof.n_dofs());
+ DoFTools::make_sparsity_pattern (dof, csp_2, constraints);
+ sparsity_2.copy_from (csp_2);
+
+
+ // the exact content of sparsity
+ // patterns is checked in other
+ // tests, so only make sure that
+ // sparsity_[12] are equal
+ deallog << "Check 1:"
+ << " -- "
+ << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+ << std::endl;
+
+
+
+//--------------- Block sparsity pattern checks -----------------
+
+ const unsigned int n = dof.n_dofs();
+ const unsigned int n1 = n/3;
+ const unsigned int n2 = n - n1;
+
+ BlockSparsityPattern sparsity_3(2,2);
+ sparsity_3.block(0,0).reinit (n1,n1,n);
+ sparsity_3.block(1,0).reinit (n2,n1,n);
+ sparsity_3.block(0,1).reinit (n1,n2,n);
+ sparsity_3.block(1,1).reinit (n2,n2,n);
+ sparsity_3.collect_sizes ();
+
+ DoFTools::make_sparsity_pattern (dof, sparsity_3);
+ constraints.condense (sparsity_3);
+ sparsity_3.compress ();
+
+ BlockSparsityPattern sparsity_4;
+ CompressedBlockSparsityPattern csp_4(2,2);
+ csp_4.block(0,0).reinit (n1,n1);
+ csp_4.block(1,0).reinit (n2,n1);
+ csp_4.block(0,1).reinit (n1,n2);
+ csp_4.block(1,1).reinit (n2,n2);
+ csp_4.collect_sizes ();
+
+ DoFTools::make_sparsity_pattern (dof, csp_4, constraints);
+ csp_4.compress ();
+
+ sparsity_4.copy_from (csp_4);
+
+ deallog << "Check 2:"
+ << " -- "
+ << (sparsity_3 == sparsity_4 ? "ok" : "failed")
+ << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile ("sparsity_pattern_05/output");
+ logfile.precision (2);
+ logfile.setf(std::ios::fixed);
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+
+ deallog.push ("1d");
+ check<1> ();
+ deallog.pop ();
+ deallog.push ("2d");
+ check<2> ();
+ deallog.pop ();
+ deallog.push ("3d");
+ check<3> ();
+ deallog.pop ();
+}
--- /dev/null
+
+DEAL:1d::Check 1: -- ok
+DEAL:1d::Check 2: -- ok
+DEAL:2d::Check 1: -- ok
+DEAL:2d::Check 2: -- ok
+DEAL:3d::Check 1: -- ok
+DEAL:3d::Check 2: -- ok
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_raviart_thomas.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_tools.h>
#include <fe/fe_q.h>
#include <hp/fe_values.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <numerics/vectors.h>
#include <numerics/matrices.h>
#include <numerics/data_out.h>
#include <dofs/dof_constraints.h>
#include <fe/fe_raviart_thomas.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_raviart_thomas.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
// non_primitive_2.cc,v 1.5 2003/04/21 07:31:15 guido Exp
// Version:
//
-// Copyright (C) 2001, 2002, 2003, 2005 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2005, 2007 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <dofs/dof_handler.h>
#include <dofs/dof_accessor.h>
#include <dofs/dof_tools.h>
+#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_nedelec.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fstream>
#include <fe/fe_q_hierarchical.h>
#include <fe/fe_raviart_thomas.h>
#include <fe/fe_system.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <fstream>
#include <vector>
#include <dofs/dof_constraints.h>
#include <fe/fe_values.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <base/quadrature_lib.h>
#include <base/function.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fe/fe_dgq.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_monomial.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp_nonparametric.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgp.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_dgq.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/fe_collection.h>
+#include <hp/fe_collection.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
#include <grid/tria_iterator.h>
#include <hp/dof_handler.h>
#include <dofs/dof_accessor.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/fe_q.h>
#include <numerics/vectors.h>
#include <dofs/dof_tools.h>
#include <numerics/vectors.h>
#include <fe/fe_dgq.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <fstream>
#include <vector>
#include <dofs/dof_tools.h>
#include <numerics/vectors.h>
#include <fe/fe_dgq.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <fstream>
#include <vector>
#include <dofs/dof_tools.h>
#include <numerics/vectors.h>
#include <fe/fe_q.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <fstream>
#include <vector>
#include <dofs/dof_tools.h>
#include <numerics/vectors.h>
#include <fe/fe_q.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <fstream>
#include <vector>
#include <numerics/vectors.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <fstream>
#include <vector>
#include <numerics/vectors.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <fe/mapping_q.h>
#include <fe/mapping_q1.h>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <fe/mapping_q.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <fe/mapping_q.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <fe/mapping_q.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/matrices.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/matrices.h>
#include <fstream>
#include "../tests.h"
#include <base/logstream.h>
#include <base/quadrature_lib.h>
-#include <fe/q_collection.h>
+#include <hp/q_collection.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_raviart_thomas.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_raviart_thomas.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
#include <dofs/dof_constraints.h>
#include <fe/fe_q.h>
#include <fe/fe_system.h>
-#include <fe/fe_collection.h>
-#include <fe/q_collection.h>
+#include <hp/fe_collection.h>
+#include <hp/q_collection.h>
#include <fe/mapping_q.h>
-#include <fe/mapping_collection.h>
+#include <hp/mapping_collection.h>
#include <numerics/vectors.h>
#include <fstream>
// $Id$
// Version: $Name$
//
-// Copyright (C) 2004, 2005 by the deal.II authors
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
m.compress ();
+ // prior to and including PETSc 2.3.0,
+ // n_nonzero_elements returns the actual
+ // number of nonzeros. after that, PETSc
+ // returns the *total* number of entries of
+ // this matrix. check both (in the case
+ // post 2.3.0, output a dummy number
+#if (DEAL_II_PETSC_VERSION_MAJOR == 2) &&\
+ ((DEAL_II_PETSC_VERSION_MINOR < 3) \
+ ||
+ ((DEAL_II_PETSC_VERSION_MINOR == 3) \
+ ((DEAL_II_PETSC_VERSION_SUBMINOR == 3))))
deallog << m.n_nonzero_elements() << std::endl;
Assert (m.n_nonzero_elements() == counter,
ExcInternalError());
+#else
+ deallog << counter() << std::endl;
+ Assert (m.m() * m.m(), ExcInternalError());
+#endif
deallog << "OK" << std::endl;
}