//---------------------------- create_mass_matrix_01.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
// Copyright (C) 2000, 2001, 2003, 2004, 2007, 2008 by the deal.II authors
//
void
check ()
{
- Triangulation<dim> tr;
+ Triangulation<dim> tr;
if (dim==2)
GridGenerator::hyper_ball(tr, Point<dim>(), 1);
else
constraints.close ();
constraints.condense (sparsity);
sparsity.compress ();
-
+
SparseMatrix<double> matrix;
matrix.reinit (sparsity);
Functions::ExpFunction<dim> rhs_function;
-
+
Vector<double> rhs (dof.n_dofs());
-
+
MatrixTools::
create_mass_matrix (mapping, dof,
quadrature, matrix,
{
std::ofstream logfile ("create_mass_matrix_01/output");
deallog << std::setprecision (2);
- deallog << std::fixed;
+ deallog << std::fixed;
deallog.attach(logfile);
deallog.depth_console (0);
//----------------------------------------------------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
// Copyright (C) 2000, 2001, 2003, 2004, 2007, 2008, 2009 by the deal.II authors
//
// Define a class that fills all available entries in the info objects
-// with recognizable numbers.
+// with recognizable numbers.
template <int dim>
class Local : public Subscriptor
{
public:
typedef typename MeshWorker::IntegrationWorker<dim>::CellInfo CellInfo;
typedef typename MeshWorker::IntegrationWorker<dim>::FaceInfo FaceInfo;
-
+
void cell(CellInfo& info) const;
void bdry(FaceInfo& info) const;
void face(FaceInfo& info1, FaceInfo& info2) const;
for (unsigned int i=0;i<info.indices.size();++i)
deallog << ' ' << info.indices[i];
deallog << std::endl;
-
+
// Fill local residuals
for (unsigned int k=0;k<info.R.size();++k)
for (unsigned int b=0;b<info.R[k].n_blocks();++b)
const double x = cell + 0.1 * b + 0.001 * i;
info.R[k].block(b)(i) = x;
}
-
+
for (unsigned int k=0;k<info.M1.size();++k)
{
const unsigned int block_row = info.M1[k].row;
{
const FiniteElement<dim>& fe = dof_handler.get_fe();
MappingQ1<dim> mapping;
-
+
MeshWorker::IntegrationInfoBox<dim> info_box(dof_handler);
info_box.initialize(worker, fe, mapping);
-
+
MeshWorker::integration_loop(dof_handler.begin_active(), dof_handler.end(), info_box, worker);
}
pattern.compress();
matrix.reinit (pattern);
v.reinit (dofs.n_dofs());
-
+
Local<dim> local;
local.cells = true;
local.faces = false;
-
+
MeshWorker::AssemblingIntegrator<dim, MeshWorker::Assembler::SystemSimple<SparseMatrix<double>, Vector<double> >, Local<dim> >
integrator(local);
integrator.initialize_gauss_quadrature(1, 1, 1);
integrator.initialize(matrix, v);
integrator.boundary_fluxes = local.faces;
- integrator.interior_fluxes = local.faces;
+ integrator.interior_fluxes = local.faces;
assemble(dofs, integrator);
for (unsigned int i=0;i<v.size();++i)
for (unsigned int l=0;l<tr.n_levels();++l)
deallog << ' ' << l << ':' << tr.n_cells(l);
deallog << std::endl;
-
+
unsigned int cn = 0;
for (typename Triangulation<dim>::cell_iterator cell = tr.begin();
cell != tr.end(); ++cell, ++cn)
for (unsigned int l=0;l<tr.n_levels();++l)
deallog << ' ' << l << ':' << dofs.n_dofs(l);
deallog << std::endl;
-
+
test_simple(dofs);
}
{
std::ofstream logfile ("mesh_worker_01/output");
logfile << std::setprecision (2);
- logfile << std::fixed;
+ logfile << std::fixed;
deallog << std::setprecision (2);
- deallog << std::fixed;
+ deallog << std::fixed;
deallog.attach(logfile);
-// deallog.depth_console (0);
+ deallog.depth_console (0);
std::vector<boost::shared_ptr<FiniteElement<2> > > fe2;
fe2.push_back(boost::shared_ptr<FiniteElement<2> >(new FE_DGP<2>(1)));
fe2.push_back(boost::shared_ptr<FiniteElement<2> >(new FE_Q<2>(1)));
-
+
for (unsigned int i=0;i<fe2.size();++i)
test(*fe2[i]);
}