<ol>
- <li> New: There is now a function Triangulation::get_tria() that
+ <li> New: There is now a function Triangulation::get_triangulation() that
allows writing code to get at the underlying triangulation for
everything that looks like a container, i.e., both Triangulation
or DoFHandler objects.
<br>
- (Wolfgang Bangerth, 2015/12/07)
+ (Wolfgang Bangerth, 2015/12/10)
+ </li>
+
+ <li> Deprecated: The functions DoFHandler::get_tria() and
+ hp::DoFHandler::get_tria() were deprecated. UseDoFHandler::get_triangulation() and
+ hp::DoFHandler::get_triangulation() instead.
+ <br>
+ (Wolfgang Bangerth, 2015/12/10)
</li>
<li> Improved: Many more functions in namespace GridTools and class
const Vector<double> &v_cell)
{
DataOut<dim> data_out;
- data_out.attach_triangulation (dof_handler.get_tria());
+ data_out.attach_triangulation (dof_handler.get_triangulation());
data_out.add_data_vector (v_cell, "cell_data");
data_out.build_patches ();
Vector<double> v_node (dof_handler.n_dofs());
for (unsigned int i=0; i<v_node.size(); ++i) v_node(i) = i;
- Vector<double> v_cell (dof_handler.get_tria().n_active_cells());
+ Vector<double> v_cell (dof_handler.get_triangulation().n_active_cells());
for (unsigned int i=0; i<v_cell.size(); ++i) v_cell(i) = i;
// call main function in .cc files
{
std::vector<bool> dofs(dof_handler.n_dofs());
- for (unsigned int level=0; level<dof_handler.get_tria().n_levels(); ++level)
+ for (unsigned int level=0; level<dof_handler.get_triangulation().n_levels(); ++level)
{
DoFTools::extract_subdomain_dofs (dof_handler,
level,
if (dof_handler.get_fe().is_primitive() == false)
return;
- Vector<double> cell_data (dof_handler.get_tria().n_active_cells());
+ Vector<double> cell_data (dof_handler.get_triangulation().n_active_cells());
for (unsigned int i=0; i<cell_data.size(); ++i)
cell_data(i) = i;
if (dof_handler.get_fe().is_primitive() == false)
return;
- Vector<double> cell_data (dof_handler.get_tria().n_active_cells());
+ Vector<double> cell_data (dof_handler.get_triangulation().n_active_cells());
for (unsigned int i=0; i<cell_data.size(); ++i)
cell_data(i) = i;
cm.distribute (solution);
// Evaluate error
- Vector<double> cellwise_errors (dof_handler.get_tria ().n_active_cells());
+ Vector<double> cellwise_errors (dof_handler.get_triangulation ().n_active_cells());
VectorTools::integrate_difference (dof_handler, solution, test_func,
cellwise_errors, quadrature,
VectorTools::L2_norm);
<< ".eps"
<< std::ends;
- GridOut().write_eps (dof_handler.get_tria(),
+ GridOut().write_eps (dof_handler.get_triangulation(),
deallog.get_file_stream());
}
}
face_integrals[cell->face(face_no)] = -1e20;
error_indicators.reinit (dual_solver.dof_handler
- .get_tria().n_active_cells());
+ .get_triangulation().n_active_cells());
const unsigned int n_threads = MultithreadInfo::n_threads();
for (unsigned int i=0; i<n_threads; ++i)
deallog<<"Approximate measure of hyper sphere = "<<area<<std::endl;
deallog<<"Error = "<<std::fabs(dim*2*numbers::PI-area)<<std::endl;
deallog << "Average error in norms: "
- << ( normals/dof_handler.get_tria().n_active_cells()
+ << ( normals/dof_handler.get_triangulation().n_active_cells()
/fe_values.n_quadrature_points)
<< std::endl;
void test_in_dim(const DoFHandlerType &d1, const DoFHandlerType &d2)
{
typename DoFHandlerType::active_cell_iterator a = d1.begin_active();
- typename DoFHandlerType::cell_iterator l = d1.begin(d1.get_tria().n_levels()-1);
+ typename DoFHandlerType::cell_iterator l = d1.begin(d1.get_triangulation().n_levels()-1);
deallog << "a " << a << std::endl
<< "l " << l << std::endl;
void test_in_dim(const DoFHandlerType &d1, const DoFHandlerType &d2)
{
typename DoFHandlerType::active_cell_iterator a = d1.begin_active();
- typename DoFHandlerType::cell_iterator l = d1.begin(d1.get_tria().n_levels()-1);
+ typename DoFHandlerType::cell_iterator l = d1.begin(d1.get_triangulation().n_levels()-1);
deallog << "a " << a << std::endl
<< "l " << l << std::endl;
print_dofs (dof);
// Check level ordering
- for (unsigned int level=0; level<dof.get_tria().n_levels(); ++level)
+ for (unsigned int level=0; level<dof.get_triangulation().n_levels(); ++level)
{
print_dofs (mgdof, level);
DoFRenumbering::downstream(dof, direction);
print_dofs (dof);
// Check level ordering
- for (unsigned int level=0; level<dof.get_tria().n_levels(); ++level)
+ for (unsigned int level=0; level<dof.get_triangulation().n_levels(); ++level)
{
deallog << "Level " << level << std::endl;
DoFRenumbering::downstream(mgdof, level, direction);
DoFRenumbering::downstream(dof, direction, true);
print_dofs (dof);
// Check level ordering
- for (unsigned int level=0; level<dof.get_tria().n_levels(); ++level)
+ for (unsigned int level=0; level<dof.get_triangulation().n_levels(); ++level)
{
deallog << "Level " << level << std::endl;
DoFRenumbering::downstream(mgdof, level, direction, true);
deallog << element.get_name() << std::endl;
DoFRenumbering::boost::Cuthill_McKee(dof);
- for (unsigned int level=0; level<dof.get_tria().n_levels(); ++level)
+ for (unsigned int level=0; level<dof.get_triangulation().n_levels(); ++level)
DoFRenumbering::Cuthill_McKee(dof, level);
print_dofs (dof);
}
<< ".eps"
<< std::ends;
- GridOut().write_eps (dof_handler.get_tria(),
+ GridOut().write_eps (dof_handler.get_triangulation(),
deallog.get_file_stream());
}
}
face_integrals[cell->face(face_no)] = -1e20;
error_indicators.reinit (dual_solver.dof_handler
- .get_tria().n_active_cells());
+ .get_triangulation().n_active_cells());
const unsigned int n_threads = MultithreadInfo::n_threads();
Threads::ThreadGroup<> threads;
ExcInternalError());
// Evaluate error
- Vector<double> cellwise_errors (dof_handler.get_tria ().n_active_cells());
+ Vector<double> cellwise_errors (dof_handler.get_triangulation ().n_active_cells());
VectorTools::integrate_difference (dof_handler, solution, test_func,
cellwise_errors, quadrature,
VectorTools::L2_norm);
void
write_vtk (const hp::DoFHandler<dim> &dof_handler, const std::string filename)
{
- Vector<double> active_fe_index (dof_handler.get_tria().n_active_cells());
+ Vector<double> active_fe_index (dof_handler.get_triangulation().n_active_cells());
int count = 0;
typename hp::DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active(),
void
write_vtk (const hp::DoFHandler<dim> &dof_handler, const std::string filename)
{
- Vector<double> active_fe_index (dof_handler.get_tria().n_active_cells());
+ Vector<double> active_fe_index (dof_handler.get_triangulation().n_active_cells());
int count = 0;
typename hp::DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active(),
dof_handler.begin_mg(), dof_handler.end_mg(),
dof_info, info_box, matrix_integrator, assembler);
- const unsigned int nlevels = dof_handler.get_tria().n_levels();
+ const unsigned int nlevels = dof_handler.get_triangulation().n_levels();
for (unsigned int level=0; level<nlevels; ++level)
{
for (unsigned int i=0; i<dof_handler.n_dofs(level); ++i)
BlockVector<double> faces(n_functionals);
for (unsigned int i=0; i<n_functionals; ++i)
{
- cells.block(i).reinit(dofs.get_tria().n_cells());
- faces.block(i).reinit(dofs.get_tria().n_faces());
+ cells.block(i).reinit(dofs.get_triangulation().n_cells());
+ faces.block(i).reinit(dofs.get_triangulation().n_faces());
}
cells.collect_sizes();
faces.collect_sizes();
MGLevelObject<SparseMatrix<double> > mg_matrix_dg_up;
MGLevelObject<SparseMatrix<double> > mg_matrix_dg_down;
- const unsigned int n_levels = mgdofs.get_tria().n_levels();
+ const unsigned int n_levels = mgdofs.get_triangulation().n_levels();
mg_sparsity.resize(0, n_levels-1);
mg_sparsity_dg_interface.resize(0, n_levels-1);
MGLevelObject<SparseMatrix<double> > mg_matrix_dg_up;
MGLevelObject<SparseMatrix<double> > mg_matrix_dg_down;
- const unsigned int n_levels = mgdofs.get_tria().n_levels();
+ const unsigned int n_levels = mgdofs.get_triangulation().n_levels();
mg_sparsity.resize(0, n_levels-1);
mg_sparsity_dg_interface.resize(0, n_levels-1);
constraints);
constraints.close();
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells() << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
{
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
// use this for info on problem
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells()
// << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
constraints.close();
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells()
// << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
// get_functions_common, but here we have to
// manually choose another mapping
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells()
// << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
constraints.close();
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells()
// << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
// get_functions_common, but here we have to
// manually choose non-rectangular tests.
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells()
// << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
const ConstraintMatrix &constraints)
{
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells()
// << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
if (parallel_option > 0)
deallog << "Parallel option: " << parallel_option << std::endl;
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells() << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
if (parallel_option > 0)
deallog << "Parallel option: " << parallel_option << std::endl;
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells() << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
if (parallel_option > 0)
deallog << "Parallel option: " << parallel_option << std::endl;
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells() << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
sparsity.copy_from (csp);
SparseMatrix<double> system_matrix (sparsity);
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells() << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
constraints);
constraints.close ();
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells() << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
// set up MatrixFree
const ConstraintMatrix &constraints)
{
// use this for info on problem
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells()
// << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
endc = dof_handler.end(level);
for (; cell!=endc; ++cell)
{
- if (dof_handler.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id
+ if (dof_handler.get_triangulation().locally_owned_subdomain()!=numbers::invalid_subdomain_id
&& cell->level_subdomain_id()==numbers::artificial_subdomain_id)
continue;
const FiniteElement<dim> &fe = cell->get_fe();
typedef LaplaceOperator<dim,fe_degree,n_q_points_1d,number> LevelMatrixType;
MGLevelObject<LevelMatrixType> mg_matrices;
- mg_matrices.resize(0, dof.get_tria().n_levels()-1);
- for (unsigned int level = 0; level<dof.get_tria().n_levels(); ++level)
+ mg_matrices.resize(0, dof.get_triangulation().n_levels()-1);
+ for (unsigned int level = 0; level<dof.get_triangulation().n_levels(); ++level)
{
mg_matrices[level].initialize(mapping, dof, dirichlet_boundaries, level);
}
mg_smoother;
MGLevelObject<typename SMOOTHER::AdditionalData> smoother_data;
- smoother_data.resize(0, dof.get_tria().n_levels()-1);
- for (unsigned int level = 0; level<dof.get_tria().n_levels(); ++level)
+ smoother_data.resize(0, dof.get_triangulation().n_levels()-1);
+ for (unsigned int level = 0; level<dof.get_triangulation().n_levels(); ++level)
{
smoother_data[level].smoothing_range = 15.;
smoother_data[level].degree = 5;
constraints);
constraints.close();
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells() << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
constraints);
constraints.close ();
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells() << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
// use this for info on problem
- //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
+ //std::cout << "Number of cells: " << dof.get_triangulation().n_active_cells()
// << std::endl;
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
constraints.distribute(solution);
FESystem<dim> fe_sys(dof.get_fe(), dim);
- DoFHandler<dim> dofh_eulerian(dof.get_tria());
+ DoFHandler<dim> dofh_eulerian(dof.get_triangulation());
dofh_eulerian.distribute_dofs(fe_sys);
MatrixFree<dim,double> mf_data;
std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
std::vector<types::global_dof_index> face_indices(dofs_per_face);
- for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
+ for (unsigned int l=0; l<dof.get_triangulation().n_levels(); ++l)
{
for (typename DoFHandler<dim>::cell_iterator
cell = dof.begin_mg(l);
{
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
- for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
+ for (unsigned int l=0; l<dof.get_triangulation().n_levels(); ++l)
{
deallog << std::endl;
deallog << "Level " << l << std::endl;
std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
std::vector<types::global_dof_index> face_indices(dofs_per_face);
- for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
+ for (unsigned int l=0; l<dof.get_triangulation().n_levels(); ++l)
{
for (typename DoFHandler<dim>::cell_iterator
cell = dof.begin_mg(l);
{
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
- for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
+ for (unsigned int l=0; l<dof.get_triangulation().n_levels(); ++l)
{
deallog << std::endl;
deallog << "Level " << l << std::endl;
{
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
std::vector<unsigned int> dof_indices(dofs_per_cell);
- for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
+ for (unsigned int l=0; l<dof.get_triangulation().n_levels(); ++l)
{
deallog << std::endl;
deallog << "Level " << l << std::endl;
{
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
- for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
+ for (unsigned int l=0; l<dof.get_triangulation().n_levels(); ++l)
{
deallog << std::endl;
deallog << "Level " << l << std::endl;
{
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
- for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
+ for (unsigned int l=0; l<dof.get_triangulation().n_levels(); ++l)
{
deallog << std::endl;
deallog << "Level " << l << std::endl;
if (ndofs.size() == 0)
{
std::vector<std::vector<types::global_dof_index> >
- new_dofs(mg_dof.get_tria().n_levels(),
+ new_dofs(mg_dof.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(selected.size()));
std::swap(ndofs, new_dofs);
MGTools::count_dofs_per_block (mg_dof, ndofs);
for (unsigned int l=0; l<tr.n_levels(); ++l)
DoFRenumbering::component_wise(mgdof, l);
- std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_tria().n_levels(),
+ std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(fe.n_blocks()));
MGTools::count_dofs_per_block(mgdof, mg_ndofs);
if (ndofs.size() == 0)
{
std::vector<std::vector<types::global_dof_index> >
- new_dofs(mg_dof.get_tria().n_levels(),
+ new_dofs(mg_dof.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(selected.size()));
std::swap(ndofs, new_dofs);
MGTools::count_dofs_per_block (mg_dof, ndofs);
for (unsigned int l=0; l<tr.n_levels(); ++l)
DoFRenumbering::component_wise(mgdof, l);
- std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_tria().n_levels(),
+ std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(fe.n_blocks()));
MGTools::count_dofs_per_block(mgdof, mg_ndofs);
if (ndofs.size() == 0)
{
std::vector<std::vector<types::global_dof_index> >
- new_dofs(mg_dof.get_tria().n_levels(),
+ new_dofs(mg_dof.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(selected.size()));
std::swap(ndofs, new_dofs);
MGTools::count_dofs_per_block (mg_dof, ndofs);
if (ndofs.size() == 0)
{
std::vector<std::vector<types::global_dof_index> >
- new_dofs(mg_dof.get_tria().n_levels(),
+ new_dofs(mg_dof.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(selected.size()));
std::swap(ndofs, new_dofs);
MGTools::count_dofs_per_block (mg_dof, ndofs);
// Store sizes
vector<types::global_dof_index> ndofs(fe.n_blocks());
DoFTools::count_dofs_per_block(mgdof, ndofs);
- std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_tria().n_levels(),
+ std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_triangulation().n_levels(),
std::vector<types::global_dof_index>(fe.n_blocks()));
MGTools::count_dofs_per_block(mgdof, mg_ndofs);
for (unsigned int l=0; l<tr.n_levels(); ++l)
DoFRenumbering::component_wise(mgdof, l, mg_target_component);
- std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_tria().n_levels());
+ std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_triangulation().n_levels());
MGTools::count_dofs_per_component(mgdof, mg_ndofs, true, mg_target_component);
deallog << "Global dofs:";
{
const dealii::parallel::distributed::Triangulation<dim,spacedim> *tria =
(dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
- (&mg_dof.get_tria()));
+ (&mg_dof.get_triangulation()));
AssertThrow(tria!=NULL, ExcMessage("multigrid with Trilinos vectors only works with distributed Triangulation!"));
for (unsigned int level=v.min_level();