max_velocity = std::max (std::sqrt (u*u), max_velocity);
}
- const double max_viscosity = (parameters.stabilization_beta *
+ const double max_viscosity = (parameters.stabilization_beta *
max_velocity * cell_diameter);
if (timestep_number == 0)
return max_viscosity;
temperature_cell = temperature_dof_handler.begin_active();
for (; joint_cell!=joint_endc;
++joint_cell, ++stokes_cell, ++temperature_cell)
- if (!joint_cell->is_artificial() && !joint_cell->is_ghost())
+ if (joint_cell->is_locally_owned())
{
joint_cell->get_dof_indices (local_joint_dof_indices);
stokes_cell->get_dof_indices (local_stokes_dof_indices);
// for (typename Triangulation<dim>::active_cell_iterator
// cell = triangulation.begin_active();
// cell != triangulation.end(); ++cell)
- // if (!cell->is_ghost() && !cell->is_artificial())
+ // if (cell->is_locally_owned())
// if ((cell->center()[1] > 0)
// &&
// (cell->center()[2] > 0))
// being almost exactly what we've seen
// before. The points to watch out for are:
// - Assembly must only loop over locally
- // owned cells. We test this by comparing
+ // owned cells. There are multiple ways to
+ // test that; for example, we could
+ // compare
// a cell's subdomain_id against
// information from the triangulation
- // but an equally valid condition would
- // have been to skip all cells for which
+ // as in <code>cell->subdomain_id() ==
+ // triangulation.locally_owned_subdomain()</code>,
+ // or skip all cells for which
// the condition <code>cell->is_ghost()
// || cell->is_artificial()</code> is
- // true.
+ // true. The simplest way, however, is
+ // to simply ask the cell whether it is
+ // owned by the local processor.
// - Copying local contributions into the
// global matrix must include distributing
// constraints and boundary values. In
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell!=endc; ++cell)
- if (cell->subdomain_id() == triangulation.locally_owned_subdomain())
+ if (cell->is_locally_owned())
{
cell_matrix = 0;
cell_rhs = 0;
fe, support_quadrature, update_quadrature_points);
for (; cell!=endc; ++cell)
- if (!cell->is_artificial() && !cell->is_ghost())
+ if (cell->is_locally_owned())
{
const unsigned int fe_index = cell->active_fe_index();
// length of the vector
// back to one, just to be
// on the safe side
- Point<dim> normal_vector
+ Point<dim> normal_vector
= (cell->face(face_no)->get_boundary()
.normal_vector (cell->face(face_no),
fe_values.quadrature_point(i)));
typename DH::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (unsigned int index=0; cell != endc; ++cell, ++index)
- if (!cell->is_artificial() && !cell->is_ghost())
+ if (cell->is_locally_owned())
{
double diff=0;
// initialize for this cell
double area = 0.;
// Compute mean value
for (cell = dof.begin_active(); cell != dof.end(); ++cell)
- if (!cell->is_artificial() && !cell->is_ghost())
+ if (cell->is_locally_owned())
{
fe.reinit (cell);
fe.get_function_values(v, values);
std::vector<std::vector<unsigned int> >
component_to_dof_map (fe_collection.n_components());
for (ITERATOR cell=start; cell!=end; ++cell)
- if (!cell->is_artificial() && !cell->is_ghost())
+ if (cell->is_locally_owned())
{
// on each cell: get dof indices
// and insert them into the global
}
else
{
- if (!cell->is_artificial() && !cell->is_ghost())
+ if (cell->is_locally_owned())
{
const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
std::vector<unsigned int> local_dof_indices (dofs_per_cell);
numbers::invalid_unsigned_int)
== renumbering.end(),
ExcInternalError());
-
+
dof_handler.renumber_dofs(renumbering);
}
||
(subdomain_id == cell->subdomain_id()))
&&
- !cell->is_artificial()
- &&
- !cell->is_ghost())
+ cell->is_locally_owned())
{
const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
dofs_on_this_cell.resize (dofs_per_cell);
||
(subdomain_id == cell->subdomain_id()))
&&
- !cell->is_artificial()
- &&
- !cell->is_ghost())
+ cell->is_locally_owned())
{
const unsigned int fe_index = cell->active_fe_index();
const unsigned int dofs_per_cell =fe_collection[fe_index].dofs_per_cell;
||
(subdomain_id == cell->subdomain_id()))
&&
- !cell->is_artificial()
- &&
- !cell->is_ghost())
+ cell->is_locally_owned())
{
const unsigned int n_dofs_on_this_cell = cell->get_fe().dofs_per_cell;
dofs_on_this_cell.resize (n_dofs_on_this_cell);
typename DH::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (; cell!=endc; ++cell)
- if (!cell->is_ghost() && !cell->is_artificial())
+ if (cell->is_locally_owned())
{
cell->get_dof_indices (dofs_on_this_cell);
// make sparsity pattern for this cell
std::vector<unsigned int> indices;
for (typename DH::active_cell_iterator c=dof.begin_active();
c!=dof.end(); ++ c)
- if (!c->is_artificial() && !c->is_ghost())
+ if (c->is_locally_owned())
{
const unsigned int fe_index = c->active_fe_index();
const unsigned int dofs_per_cell = c->get_fe().dofs_per_cell;
typename DH::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell!=endc; ++cell)
- if (!cell->is_ghost() && !cell->is_artificial())
+ if (cell->is_locally_owned())
{
dof_indices.resize(cell->get_fe().dofs_per_cell);
cell->get_dof_indices(dof_indices);
#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
const unsigned int dim = DH::dimension;
const unsigned int spacedim = DH::space_dimension;
-
+
if (const parallel::distributed::Triangulation<dim,spacedim> * tria
= (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof_handler.get_tria())))
tasks.join_all ();
}
-
+
/**
* This is a helper function that
Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>(&tria)
== 0),
ExcNotImplemented());
-
+
// the algorithm used simply
// traverses all cells and picks
// out the boundary vertices. it
= (dynamic_cast<const MappingQ<dim,spacedim>*>(&mapping) != 0 ?
dynamic_cast<const MappingQ<dim,spacedim>*>(&mapping)->get_degree() :
1);
-
+
// then initialize an appropriate quadrature formula
const QGauss<dim> quadrature_formula (mapping_degree + 1);
const unsigned int n_q_points = quadrature_formula.size();
// compute the integral quantities by quadrature
for (; cell!=endc; ++cell)
- if (!cell->is_ghost() && !cell->is_artificial())
+ if (cell->is_locally_owned())
{
fe_values.reinit (cell);
for (unsigned int q=0; q<n_q_points; ++q)
global_volume = local_volume;
#endif
- return global_volume;
+ return global_volume;
}
if (!cell->active() ||
(cell->active() &&
cell->refine_flag_set() &&
- !cell->is_ghost() &&
- !cell->is_artificial()))
+ cell->is_locally_owned()))
{
// check whether all
// children are
// is a ghost or artificial cell
while ((cell != this->dofs->end()) &&
(cell->has_children() == false) &&
- (cell->is_ghost() || cell->is_artificial()))
+ !cell->is_locally_owned())
cell = next_cell(cell);
return cell;
cell = next_cell(old_cell);
while ((cell != this->dofs->end()) &&
(cell->has_children() == false) &&
- (cell->is_ghost() || cell->is_artificial()))
+ !cell->is_locally_owned())
cell = next_cell(cell);
return cell;
}
internal::DataOutFaces::ParallelData<DH::dimension, DH::dimension> &data,
DataOutBase::Patch<DH::dimension-1,DH::space_dimension> &patch)
{
- Assert (!cell_and_face->first->is_ghost() &&
- !cell_and_face->first->is_artificial(),
+ Assert (cell_and_face->first->is_locally_owned(),
ExcNotImplemented());
-
+
// we use the mapping to transform the
// vertices. However, the mapping works on
// cells, not faces, so transform the face
if (update_flags & update_hessians)
this->dof_data[dataset]->get_function_hessians (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 = fe_patch_values.get_quadrature_points();
+
postprocessor->
compute_derived_quantities_scalar(data.patch_values,
data.patch_gradients,
if (update_flags & update_hessians)
this->dof_data[dataset]->get_function_hessians (fe_patch_values,
data.patch_hessians_system);
-
+
if (update_flags & update_quadrature_points)
data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
-
+
postprocessor->
compute_derived_quantities_vector(data.patch_values_system,
data.patch_gradients_system,
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
return;
}
- Assert (!(*cell)->is_ghost() &&
- !(*cell)->is_artificial(),
+ Assert ((*cell)->is_locally_owned(),
ExcNotImplemented());
const unsigned int n_patches_per_circle = data.n_patches_per_circle;
i!=cell_data.end(); ++i)
Assert (i->data.size() == 0,
ExcDataNotCleared ());
-
+
}
template <int dim, int spacedim, class DH>
-void DataOutStack<dim,spacedim,DH>::attach_dof_handler (const DH& dof)
+void DataOutStack<dim,spacedim,DH>::attach_dof_handler (const DH& dof)
{
// Check consistency of redundant
// template parameter
Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
-
+
dof_handler = &dof;
}
for (unsigned int i=0; i<data_set->names.size(); ++i)
Assert (*name != data_set->names[i], ExcNameAlreadyUsed(*name));
};
-
+
switch (vector_type)
{
case dof_vector:
names[i].find_first_not_of("abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789_<>()")));
-
+
if (vec.size() == dof_handler->n_dofs())
{
typename std::vector<DataVector>::iterator data_vector=dof_data.begin();
template <int dim, int spacedim, class DH>
-void DataOutStack<dim,spacedim,DH>::build_patches (const unsigned int nnnn_subdivisions)
+void DataOutStack<dim,spacedim,DH>::build_patches (const unsigned int nnnn_subdivisions)
{
// this is mostly copied from the
// DataOut class
unsigned int n_subdivisions = (nnnn_subdivisions != 0)
? nnnn_subdivisions
: this->default_subdivisions;
-
+
Assert (n_subdivisions >= 1,
- ExcInvalidNumberOfSubdivisions(n_subdivisions));
+ ExcInvalidNumberOfSubdivisions(n_subdivisions));
Assert (dof_handler != 0, ExcNoDoFHandlerSelected());
-
+
const unsigned int n_components = dof_handler->get_fe().n_components();
const unsigned int n_datasets = dof_data.size() * n_components +
cell_data.size();
-
+
// first count the cells we want to
// create patches of and make sure
// there is enough memory for that
// cell to these points
QTrapez<1> q_trapez;
QIterated<dim> patch_points (q_trapez, n_subdivisions);
-
+
// create collection objects from
// single quadratures,
// and finite elements. if we have
// shallow copy instead
const hp::QCollection<dim> q_collection (patch_points);
const hp::FECollection<dim> fe_collection(dof_handler->get_fe());
-
+
hp::FEValues<dim> x_fe_patch_values (fe_collection, q_collection,
update_values);
for (typename DH::active_cell_iterator cell=dof_handler->begin_active();
cell != dof_handler->end(); ++cell, ++patch, ++cell_number)
{
- Assert (!cell->is_ghost() &&
- !cell->is_artificial(),
+ Assert (cell->is_locally_owned(),
ExcNotImplemented());
Assert (patch != patches.end(), ExcInternalError());
patch->vertices[3] = Point<dim+1>(cell->vertex(1)(0),
parameter);
break;
-
+
case 2:
patch->vertices[0] = Point<dim+1>(cell->vertex(0)(0),
cell->vertex(0)(1),
cell->vertex(3)(1),
parameter);
break;
-
+
default:
Assert (false, ExcNotImplemented());
};
x_fe_patch_values.reinit (cell);
const FEValues<dim> &fe_patch_values
= x_fe_patch_values.get_present_fe_values ();
-
+
// first fill dof_data
for (unsigned int dataset=0; dataset<dof_data.size(); ++dataset)
{
for (typename std::vector<DataVector>::iterator i=dof_data.begin();
i!=dof_data.end(); ++i)
i->data.reinit (0);
-
+
for (typename std::vector<DataVector>::iterator i=cell_data.begin();
i!=cell_data.end(); ++i)
i->data.reinit (0);
for (typename std::vector<DataVector>::const_iterator dataset=cell_data.begin();
dataset!=cell_data.end(); ++dataset)
names.insert (names.end(), dataset->names.begin(), dataset->names.end());
-
+
return names;
}