Point<3> v_min, v_max, v_inter;
// Use the Bubblesort algorithm to sort the points with respect to the third coordinate
- int i, j;
-
- for (i = 0; i < 2; ++i)
+ for (int i = 0; i < 2; ++i)
{
- for (j = 0; j < 2-i; ++j)
+ for (int j = 0; j < 2-i; ++j)
{
if (points[j][2] > points[j + 1][2])
{
// level, as those lines logically belong to the same
// level as the cell, at least for for isotropic
// refinement
-
- level_cell_iterator cell = begin(level),
- endcell = end(level);
- for ( ; cell != endcell ; ++cell)
+ for (level_cell_iterator cell = begin(level) ; cell != end(level) ; ++cell)
for (unsigned int line=0; line < GeometryInfo<3>::lines_per_cell; ++line)
cell->line(line)->set_user_flag();
// level, as those lines logically belong to the same
// level as the cell, at least for for isotropic
// refinement
- level_cell_iterator cell = begin(level),
- endcell = end(level);
- for ( ; cell != endcell ; ++cell)
+ for (level_cell_iterator cell = begin(level) ; cell != end(level); ++cell)
for (unsigned int quad=0; quad < GeometryInfo<3>::faces_per_cell; ++quad)
cell->face(quad)->set_user_flag();
// level, as those lines logically belong to the same
// level as the cell, at least for for isotropic
// refinement
- typename DoFHandler<2,spacedim>::level_cell_iterator cell = dof_handler.begin(level),
- endcell = dof_handler.end(level);
- for ( ; cell != endcell; ++cell)
+ for (typename DoFHandler<2,spacedim>::level_cell_iterator cell = dof_handler.begin(level);
+ cell != dof_handler.end(level); ++cell)
for (unsigned int line=0; line < GeometryInfo<2>::faces_per_cell; ++line)
cell->face(line)->set_user_flag();
tr->clear_user_flags ();
//mark all own cells for transfer
- typename DoFHandler<dim,spacedim>::active_cell_iterator
- cell, endc = dof_handler.end();
- for (cell = dof_handler.begin_active(); cell != endc; ++cell)
+ for (typename DoFHandler<dim,spacedim>::active_cell_iterator cell = dof_handler.begin_active();
+ cell != dof_handler.end(); ++cell)
if (!cell->is_artificial())
cell->set_user_flag();
//check that we are really done
{
std::vector<dealii::types::global_dof_index> local_dof_indices;
- typename DoFHandler<dim,spacedim>::active_cell_iterator
- cell, endc = dof_handler.end();
- for (cell = dof_handler.begin_active(); cell != endc; ++cell)
+ for (typename DoFHandler<dim,spacedim>::active_cell_iterator cell = dof_handler.begin_active();
+ cell != dof_handler.end(); ++cell)
if (!cell->is_artificial())
{
local_dof_indices.resize (cell->get_fe().dofs_per_cell);
tria->get_p4est_tree_to_coarse_cell_permutation() [c];
const typename DoFHandler<dim>::level_cell_iterator
- cell (tria, 0, coarse_cell_index, &dof_handler);
+ this_cell (tria, 0, coarse_cell_index, &dof_handler);
next_free = compute_hierarchical_recursive<dim> (next_free,
renumbering,
- cell,
+ this_cell,
locally_owned);
}
#else
vertex_dof_count[vg] = 0;
// Create a mapping from all vertices to the ones used here
- unsigned int i=0;
+ unsigned int n_vertex_count=0;
for (unsigned int vg=0; vg<vertex_mapping.size(); ++vg)
if (vertex_dof_count[vg] != 0)
- vertex_mapping[vg] = i++;
+ vertex_mapping[vg] = n_vertex_count++;
// Compactify dof count
for (unsigned int vg=0; vg<vertex_mapping.size(); ++vg)
// Now that we have all the data, we reduce it to the part we actually
// want
- vertex_dof_count.resize(i);
+ vertex_dof_count.resize(n_vertex_count);
// At this point, the list of patches is ready. Now we enter the dofs
// into the sparsity pattern.
local_dof_indices_col(dofs_per_cell_col);
cell_row_child->get_dof_indices (local_dof_indices_row);
cell_col->get_dof_indices (local_dof_indices_col);
- for (unsigned int i=0; i<dofs_per_cell_row; ++i)
- sparsity.add_entries (local_dof_indices_row[i],
+ for (unsigned int r=0; r<dofs_per_cell_row; ++r)
+ sparsity.add_entries (local_dof_indices_row[r],
local_dof_indices_col.begin(),
local_dof_indices_col.end());
}
local_dof_indices_col(dofs_per_cell_col);
cell_row->get_dof_indices (local_dof_indices_row);
cell_col_child->get_dof_indices (local_dof_indices_col);
- for (unsigned int i=0; i<dofs_per_cell_row; ++i)
- sparsity.add_entries (local_dof_indices_row[i],
+ for (unsigned int r=0; r<dofs_per_cell_row; ++r)
+ sparsity.add_entries (local_dof_indices_row[r],
local_dof_indices_col.begin(),
local_dof_indices_col.end());
}
if (cell->neighbor_is_coarser(face))
continue;
- typename DH::face_iterator cell_face = cell->face(face);
const unsigned int
neighbor_face = cell->neighbor_of_neighbor(face);
if (cell->neighbor_is_coarser(face))
continue;
- typename dealii::hp::DoFHandler<dim,spacedim>::face_iterator
- cell_face = cell->face(face);
const unsigned int
neighbor_face = cell->neighbor_of_neighbor(face);
element.n_blocks()));
types::global_dof_index k=0;
- unsigned int i=0;
+ unsigned int count=0;
for (unsigned int b=0; b<element.n_base_elements(); ++b)
for (unsigned int m=0; m<element.element_multiplicity(b); ++m)
{
- block_data[i++] = (return_start_indices)
+ block_data[count++] = (return_start_indices)
? k
: (element.base_element(b).n_dofs_per_cell());
k += element.base_element(b).n_dofs_per_cell();
}
- Assert (i == element.n_blocks(), ExcInternalError());
+ Assert (count == element.n_blocks(), ExcInternalError());
std::vector<types::global_dof_index> start_indices(block_data.size());
k = 0;
float x_dimension_perspective, y_dimension_perspective;
- Triangulation<2,2>::cell_iterator cell = tria.begin(), endc = tria.end();
-
// auxiliary variables for the bounding box and the range of cell levels
- double x_min = cell->vertex(0)[0];
- double x_max = cell->vertex(0)[0];
- double y_min = cell->vertex(0)[1];
- double y_max = cell->vertex(0)[1];
+ double x_min = tria.begin()->vertex(0)[0];
+ double x_max = tria.begin()->vertex(0)[0];
+ double y_min = tria.begin()->vertex(0)[1];
+ double y_max = tria.begin()->vertex(0)[1];
double x_dimension, y_dimension;
- min_level = cell->level();
- max_level = cell->level();
+ min_level = max_level = tria.begin()->level();
// auxiliary array for the materials being used (material ids 255 max.)
unsigned int materials[256];
// bounding box of the given triangulation and check
// the cells for material id, level number, subdomain id
// (, and level subdomain id).
- for (; cell != endc; ++cell)
+ for (Triangulation<2,2>::cell_iterator cell = tria.begin(); cell != tria.end(); ++cell)
{
for (unsigned int vertex_index = 0; vertex_index < 4; vertex_index++)
{
// determine the bounding box of the given triangulation on the projection plane of the camera viewing system
- cell = tria.begin();
- endc = tria.end();
-
- point[0] = cell->vertex(0)[0];
- point[1] = cell->vertex(0)[1];
+ point[0] = tria.begin()->vertex(0)[0];
+ point[1] = tria.begin()->vertex(0)[1];
point[2] = 0;
float min_level_min_vertex_distance = 0;
if (svg_flags.convert_level_number_to_height)
{
- point[2] = svg_flags.level_height_factor * ((float)cell->level() / (float)n_levels) * std::max(x_dimension, y_dimension);
+ point[2] = svg_flags.level_height_factor * ((float)tria.begin()->level() / (float)n_levels) * std::max(x_dimension, y_dimension);
}
projection_decomposition = GridOut::svg_project_point(point, camera_position, camera_direction, camera_horizontal, camera_focus);
y_max_perspective = projection_decomposition[1];
y_min_perspective = projection_decomposition[1];
- for (; cell != endc; ++cell)
+ for (Triangulation<2,2>::cell_iterator cell = tria.begin(); cell != tria.end(); ++cell)
{
point[0] = cell->vertex(0)[0];
point[1] = cell->vertex(0)[1];
for (unsigned int level_index = min_level; level_index <= max_level; level_index++)
{
- Triangulation<2,2>::cell_iterator cell = tria.begin(level_index), endc = tria.end(level_index);
+ Triangulation<2,2>::cell_iterator
+ cell = tria.begin(level_index),
+ endc = tria.end(level_index);
for (; cell != endc; ++cell)
{
for (unsigned int q=0; q<triangulation.faces->quads.cells.size(); ++q)
for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_face; ++l)
{
- const int index=triangulation.faces->quads.cells[q].face(l);
- if (index==old_index_0)
+ const int this_index=triangulation.faces->quads.cells[q].face(l);
+ if (this_index==old_index_0)
triangulation.faces->quads.cells[q].set_face(l,new_index_0);
- else if (index==old_index_1)
+ else if (this_index==old_index_1)
triangulation.faces->quads.cells[q].set_face(l,new_index_1);
}
// now we have to copy
else
// cannot just append the new range at the end, forward to the
// other function
- for (ForwardIterator it = begin; it != end; ++it)
- add (row, *it);
+ for (ForwardIterator p = begin; p != end; ++p)
+ add (row, *p);
}
}
else
- inline
void
SparseMatrix::compress (::dealii::VectorOperation::values operation)
{
if (level_boundary)
{
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- row_lengths[cell_indices[i]] += fe.dofs_per_face;
+ for (unsigned int local_dof=0; local_dof<fe.dofs_per_cell; ++local_dof)
+ row_lengths[cell_indices[local_dof]] += fe.dofs_per_face;
continue;
}
if (flux_coupling != DoFTools::none)
{
unsigned int increment = nfe.dofs_per_cell - nfe.dofs_per_face;
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- row_lengths[cell_indices[i]] += increment;
+ for (unsigned int local_dof=0; local_dof<fe.dofs_per_cell; ++local_dof)
+ row_lengths[cell_indices[local_dof]] += increment;
}
// Do this only once per
// the coarse one.
neighbor_indices.resize(nfe.dofs_per_cell);
neighbor->get_mg_dof_indices(neighbor_indices);
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- row_lengths[cell_indices[i]] += nfe.dofs_per_face;
- for (unsigned int i=0; i<nfe.dofs_per_cell; ++i)
- row_lengths[neighbor_indices[i]] += fe.dofs_per_face;
+ for (unsigned int local_dof=0; local_dof<fe.dofs_per_cell; ++local_dof)
+ row_lengths[cell_indices[local_dof]] += nfe.dofs_per_face;
+ for (unsigned int local_dof=0; local_dof<nfe.dofs_per_cell; ++local_dof)
+ row_lengths[neighbor_indices[local_dof]] += fe.dofs_per_face;
}
}
user_flags_triangulation.load_user_flags(old_flags);
if (level_boundary)
{
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- row_lengths[cell_indices[i]] += fe.dofs_per_face;
+ for (unsigned int local_dof=0; local_dof<fe.dofs_per_cell; ++local_dof)
+ row_lengths[cell_indices[local_dof]] += fe.dofs_per_face;
continue;
}
// here.
for (unsigned int base=0; base<nfe.n_base_elements(); ++base)
for (unsigned int mult=0; mult<nfe.element_multiplicity(base); ++mult)
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- if (couple_face[fe_index](fe.system_to_block_index(i).first,
+ for (unsigned int local_dof=0; local_dof<fe.dofs_per_cell; ++local_dof)
+ if (couple_face[fe_index](fe.system_to_block_index(local_dof).first,
nfe.first_block_of_base(base) + mult) != DoFTools::none)
{
- unsigned int increment = nfe.base_element(base).dofs_per_cell
- - nfe.base_element(base).dofs_per_face;
- row_lengths[cell_indices[i]] += increment;
+ const unsigned int dof_increment = nfe.base_element(base).dofs_per_cell
+ - nfe.base_element(base).dofs_per_face;
+ row_lengths[cell_indices[local_dof]] += dof_increment;
}
// Do this only once per
neighbor->get_mg_dof_indices(neighbor_indices);
for (unsigned int base=0; base<nfe.n_base_elements(); ++base)
for (unsigned int mult=0; mult<nfe.element_multiplicity(base); ++mult)
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- if (couple_cell[fe_index](fe.system_to_component_index(i).first,
+ for (unsigned int local_dof=0; local_dof<fe.dofs_per_cell; ++local_dof)
+ if (couple_cell[fe_index](fe.system_to_component_index(local_dof).first,
nfe.first_block_of_base(base) + mult) != DoFTools::none)
- row_lengths[cell_indices[i]]
+ row_lengths[cell_indices[local_dof]]
+= nfe.base_element(base).dofs_per_face;
for (unsigned int base=0; base<fe.n_base_elements(); ++base)
for (unsigned int mult=0; mult<fe.element_multiplicity(base); ++mult)
- for (unsigned int i=0; i<nfe.dofs_per_cell; ++i)
- if (couple_cell[fe_index](nfe.system_to_component_index(i).first,
+ for (unsigned int local_dof=0; local_dof<nfe.dofs_per_cell; ++local_dof)
+ if (couple_cell[fe_index](nfe.system_to_component_index(local_dof).first,
fe.first_block_of_base(base) + mult) != DoFTools::none)
- row_lengths[neighbor_indices[i]]
+ row_lengths[neighbor_indices[local_dof]]
+= fe.base_element(base).dofs_per_face;
}
}
// first fill dof_data
for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
{
- const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values
+ const FEValuesBase<DH::dimension,DH::space_dimension> &this_fe_patch_values
= data.get_present_fe_values (dataset);
const unsigned int n_components =
- fe_patch_values.get_fe().n_components();
+ this_fe_patch_values.get_fe().n_components();
const DataPostprocessor<DH::space_dimension> *postprocessor=this->dof_data[dataset]->postprocessor;
// at each point there is only one component of value,
// gradient etc.
if (update_flags & update_values)
- this->dof_data[dataset]->get_function_values (fe_patch_values,
+ this->dof_data[dataset]->get_function_values (this_fe_patch_values,
data.patch_values);
if (update_flags & update_gradients)
- this->dof_data[dataset]->get_function_gradients (fe_patch_values,
+ this->dof_data[dataset]->get_function_gradients (this_fe_patch_values,
data.patch_gradients);
if (update_flags & update_hessians)
- this->dof_data[dataset]->get_function_hessians (fe_patch_values,
+ this->dof_data[dataset]->get_function_hessians (this_fe_patch_values,
data.patch_hessians);
if (update_flags & update_quadrature_points)
- data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
+ data.patch_evaluation_points = this_fe_patch_values.get_quadrature_points();
std::vector<Point<DH::space_dimension> > dummy_normals;
// at each point there is a vector valued function and its
// derivative...
if (update_flags & update_values)
- this->dof_data[dataset]->get_function_values (fe_patch_values,
+ this->dof_data[dataset]->get_function_values (this_fe_patch_values,
data.patch_values_system);
if (update_flags & update_gradients)
- this->dof_data[dataset]->get_function_gradients (fe_patch_values,
+ this->dof_data[dataset]->get_function_gradients (this_fe_patch_values,
data.patch_gradients_system);
if (update_flags & update_hessians)
- this->dof_data[dataset]->get_function_hessians (fe_patch_values,
+ this->dof_data[dataset]->get_function_hessians (this_fe_patch_values,
data.patch_hessians_system);
if (update_flags & update_quadrature_points)
- data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
+ data.patch_evaluation_points = this_fe_patch_values.get_quadrature_points();
std::vector<Point<DH::space_dimension> > dummy_normals;
// reasons.
if (n_components == 1)
{
- this->dof_data[dataset]->get_function_values (fe_patch_values,
+ this->dof_data[dataset]->get_function_values (this_fe_patch_values,
data.patch_values);
for (unsigned int q=0; q<n_q_points; ++q)
patch.data(offset,q) = data.patch_values[q];
else
{
data.resize_system_vectors(n_components);
- this->dof_data[dataset]->get_function_values (fe_patch_values,
+ this->dof_data[dataset]->get_function_values (this_fe_patch_values,
data.patch_values_system);
for (unsigned int component=0; component<n_components;
++component)
// first fill dof_data
for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
{
- const FEValuesBase<dimension> &fe_patch_values
+ const FEValuesBase<dimension> &this_fe_patch_values
= data.get_present_fe_values (dataset);
const unsigned int n_components
- = fe_patch_values.get_fe().n_components();
+ = this_fe_patch_values.get_fe().n_components();
const DataPostprocessor<dim> *postprocessor=this->dof_data[dataset]->postprocessor;
if (postprocessor != 0)
{
// thus does not depend on the number of components of the data
// vector
if (update_flags & update_normal_vectors)
- data.patch_normals=fe_patch_values.get_normal_vectors();
+ data.patch_normals=this_fe_patch_values.get_normal_vectors();
if (n_components == 1)
{
// at each point there is only one component of value,
// gradient etc.
if (update_flags & update_values)
- this->dof_data[dataset]->get_function_values (fe_patch_values,
+ this->dof_data[dataset]->get_function_values (this_fe_patch_values,
data.patch_values);
if (update_flags & update_gradients)
- this->dof_data[dataset]->get_function_gradients (fe_patch_values,
+ this->dof_data[dataset]->get_function_gradients (this_fe_patch_values,
data.patch_gradients);
if (update_flags & update_hessians)
- this->dof_data[dataset]->get_function_hessians (fe_patch_values,
+ this->dof_data[dataset]->get_function_hessians (this_fe_patch_values,
data.patch_hessians);
if (update_flags & update_quadrature_points)
- data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
+ data.patch_evaluation_points = this_fe_patch_values.get_quadrature_points();
postprocessor->
compute_derived_quantities_scalar(data.patch_values,
// derivative...
data.resize_system_vectors(n_components);
if (update_flags & update_values)
- this->dof_data[dataset]->get_function_values (fe_patch_values,
+ this->dof_data[dataset]->get_function_values (this_fe_patch_values,
data.patch_values_system);
if (update_flags & update_gradients)
- this->dof_data[dataset]->get_function_gradients (fe_patch_values,
+ this->dof_data[dataset]->get_function_gradients (this_fe_patch_values,
data.patch_gradients_system);
if (update_flags & update_hessians)
- this->dof_data[dataset]->get_function_hessians (fe_patch_values,
+ this->dof_data[dataset]->get_function_hessians (this_fe_patch_values,
data.patch_hessians_system);
if (update_flags & update_quadrature_points)
- data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
+ data.patch_evaluation_points = this_fe_patch_values.get_quadrature_points();
postprocessor->
compute_derived_quantities_vector(data.patch_values_system,
// reasons.
if (n_components == 1)
{
- this->dof_data[dataset]->get_function_values (fe_patch_values,
+ this->dof_data[dataset]->get_function_values (this_fe_patch_values,
data.patch_values);
for (unsigned int q=0; q<n_q_points; ++q)
patch.data(offset,q) = data.patch_values[q];
else
{
data.resize_system_vectors(n_components);
- this->dof_data[dataset]->get_function_values (fe_patch_values,
+ this->dof_data[dataset]->get_function_values (this_fe_patch_values,
data.patch_values_system);
for (unsigned int component=0; component<n_components;
++component)
// reinit fe values object...
x_fe_midpoint_value.reinit (neighbor);
- const FEValues<dim> &fe_midpoint_value
+ const FEValues<dim> &neighbor_fe_midpoint_value
= x_fe_midpoint_value.get_present_fe_values();
// ...and get the value of the
// solution...
const typename DerivativeDescription::ProjectedDerivative
neighbor_midpoint_value
- = DerivativeDescription::get_projected_derivative (fe_midpoint_value,
+ = DerivativeDescription::get_projected_derivative (neighbor_fe_midpoint_value,
solution, component);
// ...and the place where it lives
const Point<dim>
- neighbor_center = fe_midpoint_value.quadrature_point(0);
+ neighbor_center = neighbor_fe_midpoint_value.quadrature_point(0);
// vector for the
// write column headings
- std::map <std::string, std::vector <std::vector <double> > >::iterator
- data_store_begin = data_store.begin ();
to_gnuplot << "# <Key> ";
if (indep_names.size() > 0)
}
}
- for (; data_store_begin != data_store.end (); data_store_begin++)
+ for (std::map <std::string, std::vector <std::vector <double> > >::iterator
+ data_store_begin = data_store.begin (); data_store_begin != data_store.end (); ++data_store_begin)
{
typename std::map <std::string, ComponentMask>::iterator mask = component_mask.find(data_store_begin->first);
unsigned int n_stored = mask->second.n_selected_components();
// write data stored for the point
for (unsigned int key = 0; key < dataset_key.size (); key++)
{
- std::map <std::string, std::vector <std::vector <double> > >::iterator
- data_store_begin = data_store.begin ();
to_gnuplot << dataset_key[key];
for (unsigned int component = 0; component < n_indep; component++)
to_gnuplot << " " << independent_values[component][key];
}
- for (; data_store_begin != data_store.end (); data_store_begin++)
+ for (std::map <std::string, std::vector <std::vector <double> > >::iterator
+ data_store_begin = data_store.begin ();
+ data_store_begin != data_store.end (); ++data_store_begin)
{
typename std::map <std::string, ComponentMask>::iterator mask = component_mask.find(data_store_begin->first);
unsigned int n_stored = mask->second.n_selected_components();