</p>
<ol>
-<li> None so far.
+<li> Changed: The the argument material_id of the estimate-functions of the KellyErrorEstimator class are now of type types::material_id_type with the default value types::invalid_material_id instead of type unsigned int with the default value numbers::invalid_unsigned_int. The member functions Triangulation::set_boundary and Triangulation::get_boundary now take a types::boundary_id_t instead of an unsigned int.
+<br>
+(Wolfgang Bangerth, Christian Goll 2012/02/27)
</ol>
<h3>General</h3>
<ol>
+<li> Changed: Material and Boundary indicators have been both of the type unsigned char. Throughout the library, we changed their datatype to <code>types::material_id_t</code> resp. <code>types::boundary_id_t</code>, both typedefs of unsigned char. Internal faces are now characterized by types::internal_face_boundary_id(<code>=static_cast<boundary_id_t>(-1)</code>) instead of 255,
+so we get rid of that mysterious numberin the source code.
+Material_ids are also assumed to lie in the range from 0 to types::invalid_material_id-1 (where <code>types::invalid_material_id = static_cast<material_id_t>(-1)</code>). With this change, it is now much easier to extend the range of boundary or material ids, if needed.
+
+<br>
+(Wolfgang Bangerth, Christian Goll 2012/02/27)
+
<li> New: Functions like FEValues::get_function_values have long been
able to extract values from pretty much any vector kind given to it (e.g.
of kind Vector, BlockVector, PETScWrappers::Vector, etc). The list of
* of freedom.
*/
const global_dof_index invalid_dof_index = static_cast<global_dof_index>(-1);
+
+ /**
+ * The type used to denote boundary_indicators.
+ */
+ typedef unsigned char boundary_id_t;
+
+ /**
+ * The number which we reserve for internal faces.
+ * We assume that all boundary_ids lie in the range [0, internal_face_boundary_id).
+ */
+ const boundary_id_t internal_face_boundary_id = static_cast<boundary_id_t>(-1);
+
+ /**
+ * The type used to denote boundary_indicators.
+ */
+ typedef unsigned char material_id_t;
+
+ /**
+ * Invalid material_id which we need in several places as a default value.
+ * We assume that all material_ids lie in the range [0, invalid_material_id).
+ */
+ const material_id_t invalid_material_id = static_cast<material_id_t>(-1);
+
}
* consideration.
*/
unsigned int
- n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const;
+ n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const;
/**
* Access to an object informing
template <> unsigned int DoFHandler<1>::n_boundary_dofs () const;
template <> unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const;
-template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &) const;
+template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &) const;
/* ----------------------- Inline functions ---------------------------------- */
extract_boundary_dofs (const DH &dof_handler,
const std::vector<bool> &component_select,
std::vector<bool> &selected_dofs,
- const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+ const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
/**
* This function is similar to
extract_dofs_with_support_on_boundary (const DH &dof_handler,
const std::vector<bool> &component_select,
std::vector<bool> &selected_dofs,
- const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+ const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
/**
* @name Hanging Nodes
template <class DH>
void
map_dof_to_boundary_indices (const DH &dof_handler,
- const std::set<unsigned char> &boundary_indicators,
+ const std::set<types::boundary_id_t> &boundary_indicators,
std::vector<unsigned int> &mapping);
/**
* name it in the fashion of the
* STL local typedefs.
*/
- typedef std::map<unsigned char, const Function<dim>*> type;
+ typedef std::map<types::boundary_id_t, const Function<dim>*> type;
};
DEAL_II_NAMESPACE_CLOSE
subdivided_hyper_rectangle (Triangulation<dim> &tria,
const std::vector< std::vector<double> > &spacing,
const Point<dim> &p,
- const Table<dim,unsigned char> &material_id,
+ const Table<dim,types::material_id_t> &material_id,
const bool colorize=false);
/**
* indicator not equal to zero. Only
* these faces are explicitly printed
* in the <tt>write_*</tt> functions;
- * all faces with indicator 255 are
+ * all faces with indicator
+ * types::internal_face_boundary_id are
* interior ones and an indicator with
* value zero for faces at the boundary
* are considered default.
* indicator not equal to zero. Only
* these lines are explicitly printed
* in the <tt>write_*</tt> functions;
- * all lines with indicator 255 are
+ * all lines with indicator
+ * types::internal_face_boundary_id are
* interior ones and an indicator with
* value zero for faces at the boundary
* are considered default.
typename Container<dim,spacedim>::face_iterator>
extract_boundary_mesh (const Container<dim,spacedim> &volume_mesh,
Container<dim-1,spacedim> &surface_mesh,
- const std::set<unsigned char> &boundary_ids
- = std::set<unsigned char>());
+ const std::set<types::boundary_id_t> &boundary_ids
+ = std::set<types::boundary_id_t>());
/**
* Exception
unsigned int vertices[GeometryInfo<structdim>::vertices_per_cell];
/**
- * Material indicator of this
- * cell. May be used to denote
+ * Material or boundary indicator
+ * of this cell. The material_id
+ * may be used to denote
* different coefficients, etc.
*
* Note that if this object is part of a
* SubCellData object, then it represents
- * a face or edge of a cell. Since
- * deal.II only allows material_id tags
- * on cells, this field is re-interpreted
- * to indicate the boundary_indicator of
- * a face or edge. In other words, for
- * faces, this field is a misnomer.
- */
- unsigned char material_id;
+ * a face or edge of a cell. In this case
+ * one should use the field boundary_id
+ * instead of material_id.
+ */
+ union
+ {
+ types::boundary_id_t boundary_id;
+ types::material_id_t material_id;
+ };
};
* boundary component is a list of lines which are given a common
* number describing the boundary condition to hold on this part of the
* boundary. The triangulation creation function gives lines not in this
- * list either the boundary indicator zero (if on the boundary) or 255
- * (if in the interior). Explicitely giving a line the indicator 255
- * will result in an error, as well as giving an interior line a boundary
- * indicator.
+ * list either the boundary indicator zero (if on the boundary) or
+ * types::internal_face_boundary_id (if in the interior). Explicitely giving a
+ * line the indicator types::internal_face_boundary_id will result in an error, as well as giving
+ * an interior line a boundary indicator.
*
* @ingroup grid
*/
const unsigned int version);
};
-//TODO: Replace boundary[255] by a std::vector so we can use constructor of SmartPointer
/**
* Cache class used to store the number of used and active elements
* side vector to indicate these different parts of the model (this
* use is like the material id of cells).
- * Material and boundary indicators may be in the range from zero to
- * 254. The value 255 is reserved to denote interior lines (in 2D)
+ * Boundary indicators may be in the range from zero to
+ * types::internal_face_boundary_id-1. The value
+ * types::internal_face_boundary_id is reserved to denote interior lines (in 2D)
* and interior lines and quads (in 3D), which do not have a
- * boundary or material indicator. This way, a program can easily
+ * boundary indicator. This way, a program can easily
* determine, whether such an object is at the boundary or not.
+ * Material indicators may be in the range from zero to types::invalid_material_id-1.
*
* Lines in two dimensions and quads in three dimensions inherit their
* boundary indicator to their children upon refinement. You should therefore
* boundary, for instance the material id
* in a UCD input file. They are not
* necessarily consecutive but must be in
- * the range 0-254. Material IDs on
- * boundaries are also called boundary
- * indicators and are accessed with
- * accessor functions of that name.
+ * the range 0-(types::boundary_id_t-1).
+ * Material IDs on boundaries are also
+ * called boundary indicators and are
+ * accessed with accessor functions
+ * of that name.
*
* The @p boundary_object is not copied
* and MUST persist until the
* before by a straight boundary
* approximation.
*/
- void set_boundary (const unsigned int number,
+ void set_boundary (const types::boundary_id_t number,
const Boundary<dim,spacedim> &boundary_object);
/**
* boundary object by the function of
* same name and two arguments.
*/
- void set_boundary (const unsigned int number);
+ void set_boundary (const types::boundary_id_t number);
/**
* Return a constant reference to
* the same as in
* @p set_boundary
*/
- const Boundary<dim,spacedim> & get_boundary (const unsigned int number) const;
+ const Boundary<dim,spacedim> & get_boundary (const types::boundary_id_t number) const;
/**
* Returns a vector containing
* indicators (which is greater
* or equal one).
*/
- std::vector<unsigned char> get_boundary_indicators() const;
+ std::vector<types::boundary_id_t> get_boundary_indicators() const;
/**
* Copy a triangulation. This
/**
* Collection of boundary
- * objects. We only need 255
- * objects rather than 256,
- * since the indicator 255 is
- * reserved for interior faces
- * and can thus never be
- * associated with a boundary.
+ * objects. We store only
+ * objects, which are not
+ * of type StraightBoundary.
*/
- SmartPointer<const Boundary<dim,spacedim>,Triangulation<dim,spacedim> > boundary[255];
+ std::map<types::boundary_id_t, SmartPointer<const Boundary<dim, spacedim> , Triangulation<dim, spacedim> > > boundary;
/**
* Flag indicating whether
* TriaAccessor::set_boundary_indicator)
* were not a pointer.
*/
- std::map<unsigned int, unsigned char> *vertex_to_boundary_id_map_1d;
+ std::map<unsigned int, types::boundary_id_t> *vertex_to_boundary_id_map_1d;
/**
* A map that correlates each refinement listener that has been added
* object.
*
* If the return value is the special
- * value 255, then this object is in the
+ * value types::internal_face_boundary_id,
+ * then this object is in the
* interior of the domain.
*/
- unsigned char boundary_indicator () const;
+ types::boundary_id_t boundary_indicator () const;
/**
* Set the boundary indicator.
* boundary indicator of an interior face
* (a face not at the boundary of the
* domain), or set set the boundary
- * indicator of an exterior face to 255
+ * indicator of an exterior face to
+ * types::internal_face_boundary_id
* (this value is reserved for another
* purpose). Algorithms may not work or
* produce very confusing results if
* boundary cells have a boundary
- * indicator of 255 or if interior cells
- * have boundary indicators other than
- * 255. Unfortunately, the current object
+ * indicator of types::internal_face_boundary_id
+ * or if interior cells have boundary
+ * indicators other than types::internal_face_boundary_id.
+ * Unfortunately, the current object
* has no means of finding out whether it
* really is at the boundary of the
* domain and so cannot determine whether
* the value you are trying to set makes
* sense under the current circumstances.
*/
- void set_boundary_indicator (const unsigned char) const;
+ void set_boundary_indicator (const types::boundary_id_t) const;
/**
* Do as set_boundary_indicator()
* at the same time using the
* current function.
*/
- void set_all_boundary_indicators (const unsigned char) const;
+ void set_all_boundary_indicators (const types::boundary_id_t) const;
/**
* Return whether this object is at the
* boundary indicator one.
*
* If the return value is the special
- * value 255, then this object is in the
+ * value types::internal_face_boundary_id,
+ * then this object is in the
* interior of the domain.
*/
- unsigned char boundary_indicator () const;
+ types::boundary_id_t boundary_indicator () const;
/**
* @name Orientation of sub-objects
* boundary indicator of an interior face
* (a face not at the boundary of the
* domain), or set set the boundary
- * indicator of an exterior face to 255
+ * indicator of an exterior face to
+ * types::internal_face_boundary_id
* (this value is reserved for another
* purpose). Algorithms may not work or
* produce very confusing results if
* boundary cells have a boundary
- * indicator of 255 or if interior cells
- * have boundary indicators other than
- * 255. Unfortunately, the current object
+ * indicator of types::internal_face_boundary_id
+ * or if interior cells have boundary
+ * indicators other than types::internal_face_boundary_id.
+ * Unfortunately, the current object
* has no means of finding out whether it
* really is at the boundary of the
* domain and so cannot determine whether
* sense under the current circumstances.
*/
void
- set_boundary_indicator (const unsigned char);
+ set_boundary_indicator (const types::boundary_id_t);
/**
* Since this object only represents a
* argument.
*/
void
- set_all_boundary_indicators (const unsigned char);
+ set_all_boundary_indicators (const types::boundary_id_t);
/**
* Return whether the vertex
* "glossary" for more
* information.
*/
- unsigned char material_id () const;
+ types::material_id_t material_id () const;
/**
* Set the material id of this
* "glossary" for more
* information.
*/
- void set_material_id (const unsigned char new_material_id) const;
+ void set_material_id (const types::material_id_t new_material_id) const;
/**
* Set the material id of this
* "glossary" for more
* information.
*/
- void recursively_set_material_id (const unsigned char new_material_id) const;
+ void recursively_set_material_id (const types::material_id_t new_material_id) const;
/**
* @}
*/
template <int structdim, int dim, int spacedim>
-unsigned char
+types::boundary_id_t
TriaAccessor<structdim, dim, spacedim>::boundary_indicator () const
{
Assert (structdim<dim, ExcImpossibleInDim(dim));
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- return this->objects().material_id[this->present_index];
+ return this->objects().boundary_or_material_id[this->present_index].boundary_id;
}
template <int structdim, int dim, int spacedim>
void
TriaAccessor<structdim, dim, spacedim>::
-set_boundary_indicator (const unsigned char boundary_ind) const
+set_boundary_indicator (const types::boundary_id_t boundary_ind) const
{
Assert (structdim<dim, ExcImpossibleInDim(dim));
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- this->objects().material_id[this->present_index] = boundary_ind;
+ this->objects().boundary_or_material_id[this->present_index].boundary_id = boundary_ind;
}
template <int structdim, int dim, int spacedim>
void
TriaAccessor<structdim, dim, spacedim>::
-set_all_boundary_indicators (const unsigned char boundary_ind) const
+set_all_boundary_indicators (const types::boundary_id_t boundary_ind) const
{
set_boundary_indicator (boundary_ind);
- set_boundary_indicator (boundary_ind);
switch (structdim)
{
{
// error checking is done
// in boundary_indicator()
- return (boundary_indicator() != 255);
+ return (boundary_indicator() != types::internal_face_boundary_id);
}
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
return this->tria->get_boundary(this->objects()
- .material_id[this->present_index]);
+ .boundary_or_material_id[this->present_index].boundary_id);
}
template <int spacedim>
inline
-unsigned char
+types::boundary_id_t
TriaAccessor<0, 1, spacedim>::boundary_indicator () const
{
switch (vertex_kind)
}
default:
- return 255;
+ return types::internal_face_boundary_id;
}
}
template <int spacedim>
inline
void
-TriaAccessor<0, 1, spacedim>::set_boundary_indicator (const unsigned char b)
+TriaAccessor<0, 1, spacedim>::set_boundary_indicator (const types::boundary_id_t b)
{
Assert (tria->vertex_to_boundary_id_map_1d->find (this->vertex_index())
!= tria->vertex_to_boundary_id_map_1d->end(),
template <int spacedim>
inline
-void TriaAccessor<0, 1, spacedim>::set_all_boundary_indicators (const unsigned char b)
+void TriaAccessor<0, 1, spacedim>::set_all_boundary_indicators (const types::boundary_id_t b)
{
set_boundary_indicator (b);
}
* Triangulation::clear_user_flags().
*/
std::vector<bool> user_flags;
-
+
+
+ /**
+ * We use this union to store boundary and material
+ * data. Because only one one out of these two is
+ * actually needed here, we use an union.
+ */
+ union BoundaryOrMaterialId
+ {
+ types::boundary_id_t boundary_id;
+ types::material_id_t material_id;
+
+ std::size_t memory_consumption () const
+ {
+ return std::max(sizeof(material_id),sizeof(boundary_id));
+ }
+ };
/**
* Store boundary and material data. For
* example, in one dimension, this field
* stores the material id of a line, which
- * is a number between 0 and 254. In more
+ * is a number between 0 and
+ * types::invalid_material_id-1. In more
* than one dimension, lines have no
* material id, but they may be at the
* boundary; then, we store the
* boundary this line belongs and which
* boundary conditions hold on this
* part. The boundary indicator also
- * is a number between zero and 254;
- * the id 255 is reserved for lines
+ * is a number between zero and
+ * types::internal_face_boundary_id-1;
+ * the id types::internal_face_boundary_id
+ * is reserved for lines
* in the interior and may be used
* to check whether a line is at the
* boundary or not, which otherwise
* is not possible if you don't know
* which cell it belongs to.
*/
- std::vector<unsigned char> material_id;
- /**
- * Assert that enough space
- * is allocated to
- * accomodate
- * <code>new_objs_in_pairs</code>
- * new objects, stored in
- * pairs, plus
- * <code>new_obj_single</code>
- * stored individually.
- * This function does not
- * only call
- * <code>vector::reserve()</code>,
- * but does really append
- * the needed elements.
- *
- * In 2D e.g. refined lines have to be
- * stored in pairs, whereas new lines in the
- * interior of refined cells can be stored as
- * single lines.
- */
+ std::vector<BoundaryOrMaterialId> boundary_or_material_id;
+
+ /**
+ * Assert that enough space
+ * is allocated to
+ * accomodate
+ * <code>new_objs_in_pairs</code>
+ * new objects, stored in
+ * pairs, plus
+ * <code>new_obj_single</code>
+ * stored individually.
+ * This function does not
+ * only call
+ * <code>vector::reserve()</code>,
+ * but does really append
+ * the needed elements.
+ *
+ * In 2D e.g. refined lines have to be
+ * stored in pairs, whereas new lines in the
+ * interior of refined cells can be stored as
+ * single lines.
+ */
void reserve_space (const unsigned int new_objs_in_pairs,
const unsigned int new_objs_single = 0);
ar & refinement_cases;
ar & used;
ar & user_flags;
- ar & material_id;
+ ar & boundary_or_material_id;
ar & next_free_single & next_free_pair & reverse_order_next_free_single;
ar & user_data & user_data_type;
}
* consideration.
*/
unsigned int
- n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const;
+ n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const;
/**
* Return the number of
* neighboring cells as well, even if
* they belong to a different subdomain.
*
- * The @p material_id parameter has a
- * similar meaning: if not set to its
- * default value, it means that
- * indicators will only be computed for
- * cells with this particular material
- * id.
+ * The @p material_id parameter has a similar
+ * meaning: if not set to its default value
+ * (which is types::invalid_material_id),
+ * it means that indicators will only be
+ * computed for cells with this particular
+ * material id.
*
* The @p n_threads parameter used to
* indicate the number of threads to be
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = numbers::invalid_unsigned_int,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
* Calls the @p estimate
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
* Same function as above, but
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
* Calls the @p estimate
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim>* coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
* Calls the @p estimate
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
* Same function as above, but
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
* Calls the @p estimate
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
const Function<spacedim> *coefficients = 0,
const unsigned int n_threads = multithread_info.n_default_threads,
const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
- const unsigned int material_id = numbers::invalid_unsigned_int);
+ const types::material_id_t material_id = types::invalid_material_id);
/**
* Exception
* the trace of the function to the boundary is done with the
* VectorTools::project_boundary_values() (see below) function,
* which is called with a map of boundary functions FunctioMap in
- * which all boundary indicators from zero to 254 (255 is used for
- * other purposes, see the Triangulation class documentation) point
+ * which all boundary indicators from zero to types::internal_face_boundary_id-1
+ * (types::internal_face_boundary_id is used for other purposes,
+ * see the Triangulation class documentation) point
* to the function to be projected. The projection to the boundary
* takes place using a second quadrature formula on the boundary
* given to the project() function. The first quadrature formula is
* of boundary nodes and their values. You can get such a list by interpolation
* of a boundary function using the interpolate_boundary_values() function.
* To use it, you have to
- * specify a list of pairs of boundary indicators (of type <tt>unsigned char</tt>;
+ * specify a list of pairs of boundary indicators (of type <tt>types::boundary_id_t</tt>;
* see the section in the documentation of the Triangulation class for more
* details) and the according functions denoting the dirichlet boundary values
* of the nodes on boundary faces with this boundary indicator.
* @p boundary_component
* corresponds to the number
* @p boundary_indicator of the
- * face. 255 is an illegal
- * value, since it is reserved
- * for interior faces.
+ * face. types::internal_face_boundary_id
+ * is an illegal value, since
+ * it is reserved for interior faces.
*
* The flags in the last
* parameter, @p component_mask
void
interpolate_boundary_values (const Mapping<DH::dimension,DH::space_dimension> &mapping,
const DH &dof,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
const Function<DH::space_dimension> &boundary_function,
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask = std::vector<bool>());
void
interpolate_boundary_values (const DH &dof,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
const Function<DH::space_dimension> &boundary_function,
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask = std::vector<bool>());
*
* The parameter @p boundary_component
* corresponds to the number @p
- * boundary_indicator of the face. 255
+ * boundary_indicator of the face.
+ * types::internal_face_boundary_id
* is an illegal value, since it is
* reserved for interior faces.
*
void
interpolate_boundary_values (const Mapping<DH::dimension,DH::space_dimension> &mapping,
const DH &dof,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
const Function<DH::space_dimension> &boundary_function,
ConstraintMatrix &constraints,
const std::vector<bool> &component_mask = std::vector<bool>());
void
interpolate_boundary_values (const DH &dof,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
const Function<DH::space_dimension> &boundary_function,
ConstraintMatrix &constraints,
const std::vector<bool> &component_mask = std::vector<bool>());
*
* The parameter @p boundary_component
* corresponds to the number
- * @p boundary_indicator of the face. 255
+ * @p boundary_indicator of the face.
+ * types::internal_face_boundary_id
* is an illegal value, since it is
* reserved for interior faces.
*
void project_boundary_values_curl_conforming (const DoFHandler<dim>& dof_handler,
const unsigned int first_vector_component,
const Function<dim>& boundary_function,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
ConstraintMatrix& constraints,
const Mapping<dim>& mapping = StaticMappingQ1<dim>::mapping);
void project_boundary_values_curl_conforming (const hp::DoFHandler<dim>& dof_handler,
const unsigned int first_vector_component,
const Function<dim>& boundary_function,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
ConstraintMatrix& constraints,
const hp::MappingCollection<dim, dim>& mapping_collection = hp::StaticMappingQ1<dim>::mapping_collection);
*
* The parameter @p boundary_component
* corresponds to the number
- * @p boundary_indicator of the face. 255
+ * @p boundary_indicator of the face.
+ * types::internal_face_boundary_id
* is an illegal value, since it is
* reserved for interior faces.
*
void project_boundary_values_div_conforming (const DoFHandler<dim>& dof_handler,
const unsigned int first_vector_component,
const Function<dim>& boundary_function,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
ConstraintMatrix& constraints,
const Mapping<dim>& mapping = StaticMappingQ1<dim>::mapping);
void project_boundary_values_div_conforming (const hp::DoFHandler<dim>& dof_handler,
const unsigned int first_vector_component,
const Function<dim>& boundary_function,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
ConstraintMatrix& constraints,
const hp::MappingCollection<dim, dim>& mapping_collection = hp::StaticMappingQ1<dim>::mapping_collection);
void
compute_no_normal_flux_constraints (const DH<dim,spacedim> &dof_handler,
const unsigned int first_vector_component,
- const std::set<unsigned char> &boundary_ids,
+ const std::set<types::boundary_id_t> &boundary_ids,
ConstraintMatrix &constraints,
const Mapping<dim, spacedim> &mapping = StaticMappingQ1<dim>::mapping);
const Quadrature<dim-1> &q,
const Function<spacedim> &rhs,
Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+ const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
/**
* Calls the
const Quadrature<dim-1> &q,
const Function<spacedim> &rhs,
Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+ const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
/**
* Same as the set of functions above,
const hp::QCollection<dim-1> &q,
const Function<spacedim> &rhs,
Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+ const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
/**
* Calls the
const hp::QCollection<dim-1> &q,
const Function<spacedim> &rhs,
Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+ const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
//@}
/**
// count, how often we have
// added to this dof
- Assert (touch_count[local_dof_indices[j]] < 255,
+ Assert (touch_count[local_dof_indices[j]] < types::internal_face_boundary_id,
ExcInternalError());
++touch_count[local_dof_indices[j]];
};
// function to hold on
// all parts of the boundary
typename FunctionMap<spacedim>::type boundary_functions;
- for (unsigned char c=0; c<255; ++c)
+ for (types::boundary_id_t c=0; c<types::internal_face_boundary_id; ++c)
boundary_functions[c] = &function;
project_boundary_values (dof, boundary_functions, q_boundary,
boundary_values);
const Quadrature<0> &,
const Function<1> &,
Vector<double> &,
- const std::set<unsigned char> &)
+ const std::set<types::boundary_id_t> &)
{
Assert (false, ExcImpossibleInDim(1));
}
const Quadrature<0> &,
const Function<2> &,
Vector<double> &,
- const std::set<unsigned char> &)
+ const std::set<types::boundary_id_t> &)
{
Assert (false, ExcImpossibleInDim(1));
}
const Quadrature<dim-1> &quadrature,
const Function<spacedim> &rhs_function,
Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators)
+ const std::set<types::boundary_id_t> &boundary_indicators)
{
const FiniteElement<dim> &fe = dof_handler.get_fe();
Assert (fe.n_components() == rhs_function.n_components,
const Quadrature<dim-1> &quadrature,
const Function<spacedim> &rhs_function,
Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators)
+ const std::set<types::boundary_id_t> &boundary_indicators)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
const hp::QCollection<0> &,
const Function<1> &,
Vector<double> &,
- const std::set<unsigned char> &)
+ const std::set<types::boundary_id_t> &)
{
Assert (false, ExcImpossibleInDim(1));
}
const hp::QCollection<0> &,
const Function<2> &,
Vector<double> &,
- const std::set<unsigned char> &)
+ const std::set<types::boundary_id_t> &)
{
Assert (false, ExcImpossibleInDim(1));
}
const hp::QCollection<dim-1> &quadrature,
const Function<spacedim> &rhs_function,
Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators)
+ const std::set<types::boundary_id_t> &boundary_indicators)
{
const hp::FECollection<dim> &fe = dof_handler.get_fe();
Assert (fe.n_components() == rhs_function.n_components,
const hp::QCollection<dim-1> &quadrature,
const Function<spacedim> &rhs_function,
Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators)
+ const std::set<types::boundary_id_t> &boundary_indicators)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
create_boundary_right_hand_side(hp::StaticMappingQ1<dim>::mapping_collection,
if (function_map.size() == 0)
return;
- Assert (function_map.find(255) == function_map.end(),
+ Assert (function_map.find(types::internal_face_boundary_id) == function_map.end(),
ExcInvalidBoundaryIndicator());
const unsigned int n_components = DoFTools::n_components(dof);
// cast the face iterator to a DoFHandler
// iterator so that we can access the boundary
// indicators
- const unsigned char boundary_component = face->boundary_indicator();
+ const types::boundary_id_t boundary_component = face->boundary_indicator();
if (function_map.find(boundary_component) != function_map.end())
{
// face is of the right component
void
interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &mapping,
const DH &dof,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
const Function<DH::space_dimension> &boundary_function,
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask)
template <class DH>
void
interpolate_boundary_values (const DH &dof,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
const Function<DH::space_dimension> &boundary_function,
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask)
interpolate_boundary_values
(const Mapping<DH::dimension, DH::space_dimension> &mapping,
const DH &dof,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
const Function<DH::space_dimension> &boundary_function,
ConstraintMatrix &constraints,
const std::vector<bool> &component_mask)
void
interpolate_boundary_values
(const DH &dof,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
const Function<DH::space_dimension> &boundary_function,
ConstraintMatrix &constraints,
const std::vector<bool> &component_mask)
AssertDimension (dof.get_fe().n_components(), component_mapping.size());
std::vector<unsigned int> dof_to_boundary_mapping;
- std::set<unsigned char> selected_boundary_components;
+ std::set<types::boundary_id_t> selected_boundary_components;
for (typename FunctionMap<spacedim>::type::const_iterator i=boundary_functions.begin();
i!=boundary_functions.end(); ++i)
selected_boundary_components.insert (i->first);
project_boundary_values_curl_conforming (const DoFHandler<dim>& dof_handler,
const unsigned int first_vector_component,
const Function<dim>& boundary_function,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
ConstraintMatrix& constraints,
const Mapping<dim>& mapping)
{
project_boundary_values_curl_conforming (const hp::DoFHandler<dim>& dof_handler,
const unsigned int first_vector_component,
const Function<dim>& boundary_function,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
ConstraintMatrix& constraints,
const hp::MappingCollection<dim>& mapping_collection)
{
project_boundary_values_div_conforming (const DoFHandler<dim>& dof_handler,
const unsigned int first_vector_component,
const Function<dim>& boundary_function,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
ConstraintMatrix& constraints,
const Mapping<dim>& mapping)
{
project_boundary_values_div_conforming (const hp::DoFHandler<dim>& dof_handler,
const unsigned int first_vector_component,
const Function<dim>& boundary_function,
- const unsigned char boundary_component,
+ const types::boundary_id_t boundary_component,
ConstraintMatrix& constraints,
const hp::MappingCollection<dim, dim>& mapping_collection)
{
compute_no_normal_flux_constraints (const DH<dim,spacedim> &dof_handler,
const unsigned int first_vector_component,
- const std::set<unsigned char> &boundary_ids,
+ const std::set<types::boundary_id_t> &boundary_ids,
ConstraintMatrix &constraints,
const Mapping<dim, spacedim> &mapping)
{
template <>
-unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
{
// check that only boundary
// indicators 0 and 1 are allowed
// in 1d
- for (std::set<unsigned char>::const_iterator i=boundary_indicators.begin();
+ for (std::set<types::boundary_id_t>::const_iterator i=boundary_indicators.begin();
i!=boundary_indicators.end(); ++i)
Assert ((*i == 0) || (*i == 1),
ExcInvalidBoundaryIndicator());
template <>
-unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
{
// check that only boundary
// indicators 0 and 1 are allowed
// in 1d
- for (std::set<unsigned char>::const_iterator i=boundary_indicators.begin();
+ for (std::set<types::boundary_id_t>::const_iterator i=boundary_indicators.begin();
i!=boundary_indicators.end(); ++i)
Assert ((*i == 0) || (*i == 1),
ExcInvalidBoundaryIndicator());
unsigned int
DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
{
- Assert (boundary_indicators.find(255) == boundary_indicators.end(),
+ Assert (boundary_indicators.find(types::internal_face_boundary_id) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
std::set<int> boundary_dofs;
template<int dim, int spacedim>
unsigned int
-DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
{
- Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+ Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
std::set<int> boundary_dofs;
const unsigned int n_dofs = dof.n_dofs();
AssertDimension (dof_to_boundary_mapping.size(), n_dofs);
- Assert (boundary_indicators.find(255) == boundary_indicators.end(),
+ Assert (boundary_indicators.find(types::internal_face_boundary_id) == boundary_indicators.end(),
typename DH::ExcInvalidBoundaryIndicator());
Assert (sparsity.n_rows() == dof.n_boundary_dofs (boundary_indicators),
ExcDimensionMismatch (sparsity.n_rows(), dof.n_boundary_dofs (boundary_indicators)));
extract_boundary_dofs (const DH &dof_handler,
const std::vector<bool> &component_select,
std::vector<bool> &selected_dofs,
- const std::set<unsigned char> &boundary_indicators)
+ const std::set<types::boundary_id_t> &boundary_indicators)
{
AssertDimension (component_select.size(),n_components(dof_handler));
- Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+ Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
const unsigned int dim=DH::dimension;
extract_dofs_with_support_on_boundary (const DH &dof_handler,
const std::vector<bool> &component_select,
std::vector<bool> &selected_dofs,
- const std::set<unsigned char> &boundary_indicators)
+ const std::set<types::boundary_id_t> &boundary_indicators)
{
AssertDimension (component_select.size(), n_components(dof_handler));
- Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+ Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
// let's see whether we have to
template <class DH>
void map_dof_to_boundary_indices (
const DH &dof_handler,
- const std::set<unsigned char> &boundary_indicators,
+ const std::set<types::boundary_id_t> &boundary_indicators,
std::vector<unsigned int> &mapping)
{
Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
- Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+ Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
mapping.clear ();
(const DoFHandler<deal_II_dimension> &,
const std::vector<bool> &,
std::vector<bool> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
template
void
DoFTools::extract_boundary_dofs<hp::DoFHandler<deal_II_dimension> >
(const hp::DoFHandler<deal_II_dimension> &,
const std::vector<bool> &,
std::vector<bool> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
template
void
(const DoFHandler<deal_II_dimension> &,
const std::vector<bool> &,
std::vector<bool> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
template
void
DoFTools::extract_dofs_with_support_on_boundary<hp::DoFHandler<deal_II_dimension> >
(const hp::DoFHandler<deal_II_dimension> &,
const std::vector<bool> &,
std::vector<bool> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
template
void
(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
const std::vector<bool> &,
std::vector<bool> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
template
unsigned int
DoFTools::count_dofs_with_subdomain_association<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
void
DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension> >
(const DoFHandler<deal_II_dimension> &,
- const std::set<unsigned char> &,
+ const std::set<types::boundary_id_t> &,
std::vector<unsigned int> &);
template
void
DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension> >
(const hp::DoFHandler<deal_II_dimension> &,
- const std::set<unsigned char> &,
+ const std::set<types::boundary_id_t> &,
std::vector<unsigned int> &);
template
void
DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const std::set<unsigned char> &,
+ const std::set<types::boundary_id_t> &,
std::vector<unsigned int> &);
template
(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_handler,
std::vector<bool> &selected_dofs);
-// template
-// void
-// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-// const std::set<unsigned char> &,
-// std::vector<unsigned int> &);
-
-// template
-// void
-// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-// std::vector<unsigned int> &);
+ template
+ void
+ DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
+ (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const std::set<types::boundary_id_t> &,
+ std::vector<unsigned int> &);
+
+ template
+ void
+ DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
+ (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ std::vector<unsigned int> &);
#endif
Triangulation<1>& tria,
const std::vector< std::vector<double> >& spacing,
const Point<1>& p,
- const Table<1,unsigned char>& material_id,
+ const Table<1,types::material_id_t>& material_id,
const bool colorize)
{
// contributed by Yaqi Wang 2006
// create the cells
unsigned int n_val_cells = 0;
for (unsigned int i=0; i<n_cells; i++)
- if (material_id[i]!=(unsigned char)(-1)) n_val_cells++;
+ if (material_id[i]!=types::invalid_material_id) n_val_cells++;
std::vector<CellData<1> > cells(n_val_cells);
unsigned int id = 0;
for (unsigned int x=0; x<n_cells; ++x)
- if (material_id[x] != (unsigned char)(-1))
+ if (material_id[x] != types::invalid_material_id)
{
cells[id].vertices[0] = x;
cells[id].vertices[1] = x+1;
Triangulation<2>& tria,
const std::vector< std::vector<double> >& spacing,
const Point<2>& p,
- const Table<2,unsigned char>& material_id,
+ const Table<2,types::material_id_t>& material_id,
const bool colorize)
{
// contributed by Yaqi Wang 2006
unsigned int n_val_cells = 0;
for (unsigned int i=0; i<material_id.size(0); i++)
for (unsigned int j=0; j<material_id.size(1); j++)
- if (material_id[i][j] != (unsigned char)(-1))
+ if (material_id[i][j] != types::invalid_material_id)
n_val_cells++;
std::vector<CellData<2> > cells(n_val_cells);
unsigned int id = 0;
for (unsigned int y=0; y<repetitions[1]; ++y)
for (unsigned int x=0; x<repetitions[0]; ++x)
- if (material_id[x][y]!=(unsigned char)(-1))
+ if (material_id[x][y]!=types::invalid_material_id)
{
cells[id].vertices[0] = y*(repetitions[0]+1)+x;
cells[id].vertices[1] = y*(repetitions[0]+1)+x+1;
Triangulation<3>& tria,
const std::vector< std::vector<double> >& spacing,
const Point<3>& p,
- const Table<3,unsigned char>& material_id,
+ const Table<3,types::material_id_t>& material_id,
const bool colorize)
{
// contributed by Yaqi Wang 2006
for (unsigned int i=0; i<material_id.size(0); i++)
for (unsigned int j=0; j<material_id.size(1); j++)
for (unsigned int k=0; k<material_id.size(2); k++)
- if (material_id[i][j][k]!=(unsigned char)(-1))
+ if (material_id[i][j][k]!=types::invalid_material_id)
n_val_cells++;
std::vector<CellData<dim> > cells(n_val_cells);
for (unsigned int z=0; z<repetitions[2]; ++z)
for (unsigned int y=0; y<repetitions[1]; ++y)
for (unsigned int x=0; x<repetitions[0]; ++x)
- if (material_id[x][y][z]!=(unsigned char)(-1))
+ if (material_id[x][y][z]!=types::invalid_material_id)
{
cells[id].vertices[0] = z*n_xy + y*n_x + x;
cells[id].vertices[1] = z*n_xy + y*n_x + x+1;
for (unsigned int i1=0;i1<4;++i1)
vertices[k++] = Point<2>(coords[i1], coords[i0]);
- const unsigned char materials[9] = { 5, 4, 6,
+ const types::material_id_t materials[9] = { 5, 4, 6,
1, 0, 2,
9, 8,10
};
{
for (unsigned int i=0;i<GeometryInfo<2>::faces_per_cell;++i)
{
- if (cell->face(i)->boundary_indicator() == 255)
+ if (cell->face(i)->boundary_indicator() == types::internal_face_boundary_id)
continue;
// If x is zero, then this is part of the plane
for (unsigned int x=0;x<4;++x)
vertices[k++] = Point<3>(coords[x], coords[y], coords[z]);
- const unsigned char materials[27] = {
+ const types::material_id_t materials[27] = {
21,20,22,
17,16,18,
25,24,26,
AssertThrow (in, ExcIO());
std::string cell_type;
- int material_id;
+
+ // we use an unsigned int because we
+ // fill this variable through an read-in process
+ unsigned int material_id;
in >> dummy // cell number
- >> material_id;
+ >> material_id;
in >> cell_type;
if (((cell_type == "line") && (dim == 1)) ||
cells.push_back (CellData<dim>());
for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
in >> cells.back().vertices[i];
- cells.back().material_id = material_id;
+
+ // to make sure that the cast wont fail
+ Assert(material_id<= std::numeric_limits<types::material_id_t>::max(),
+ ExcIndexRange(material_id,0,std::numeric_limits<types::material_id_t>::max()));
+ // we use only material_ids in the range from 0 to types::invalid_material_id-1
+ Assert(material_id < types::invalid_material_id,
+ ExcIndexRange(material_id,0,types::invalid_material_id));
+
+ cells.back().material_id = static_cast<types::material_id_t>(material_id);
// transform from ucd to
// consecutive numbering
subcelldata.boundary_lines.push_back (CellData<1>());
in >> subcelldata.boundary_lines.back().vertices[0]
>> subcelldata.boundary_lines.back().vertices[1];
- subcelldata.boundary_lines.back().material_id = material_id;
+
+ // to make sure that the cast wont fail
+ Assert(material_id<= std::numeric_limits<types::boundary_id_t>::max(),
+ ExcIndexRange(material_id,0,std::numeric_limits<types::boundary_id_t>::max()));
+ // we use only boundary_ids in the range from 0 to types::internal_face_boundary_id-1
+ Assert(material_id < types::internal_face_boundary_id,
+ ExcIndexRange(material_id,0,types::internal_face_boundary_id));
+
+ subcelldata.boundary_lines.back().boundary_id
+ = static_cast<types::boundary_id_t>(material_id);
// transform from ucd to
// consecutive numbering
>> subcelldata.boundary_quads.back().vertices[2]
>> subcelldata.boundary_quads.back().vertices[3];
- subcelldata.boundary_quads.back().material_id = material_id;
+ // to make sure that the cast wont fail
+ Assert(material_id<= std::numeric_limits<types::boundary_id_t>::max(),
+ ExcIndexRange(material_id,0,std::numeric_limits<types::boundary_id_t>::max()));
+ // we use only boundary_ids in the range from 0 to types::internal_face_boundary_id-1
+ Assert(material_id < types::internal_face_boundary_id,
+ ExcIndexRange(material_id,0,types::internal_face_boundary_id));
+
+ subcelldata.boundary_quads.back().boundary_id
+ = static_cast<types::boundary_id_t>(material_id);
// transform from ucd to
// consecutive numbering
cells.push_back (CellData<dim>());
for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
in >> cells.back().vertices[i];
- cells.back().material_id = material_id;
+
+ // to make sure that the cast wont fail
+ Assert(material_id<= std::numeric_limits<types::material_id_t>::max(),
+ ExcIndexRange(material_id,0,std::numeric_limits<types::material_id_t>::max()));
+ // we use only material_ids in the range from 0 to types::invalid_material_id-1
+ Assert(material_id < types::invalid_material_id,
+ ExcIndexRange(material_id,0,types::invalid_material_id));
+
+ cells.back().material_id = static_cast<types::material_id_t>(material_id);
// transform from ucd to
// consecutive numbering
subcelldata.boundary_lines.push_back (CellData<1>());
in >> subcelldata.boundary_lines.back().vertices[0]
>> subcelldata.boundary_lines.back().vertices[1];
- subcelldata.boundary_lines.back().material_id = material_id;
+
+ // to make sure that the cast wont fail
+ Assert(material_id<= std::numeric_limits<types::boundary_id_t>::max(),
+ ExcIndexRange(material_id,0,std::numeric_limits<types::boundary_id_t>::max()));
+ // we use only boundary_ids in the range from 0 to types::internal_face_boundary_id-1
+ Assert(material_id < types::internal_face_boundary_id,
+ ExcIndexRange(material_id,0,types::internal_face_boundary_id));
+
+ subcelldata.boundary_lines.back().boundary_id
+ = static_cast<types::boundary_id_t>(material_id);
// transform from ucd to
// consecutive numbering
>> subcelldata.boundary_quads.back().vertices[2]
>> subcelldata.boundary_quads.back().vertices[3];
- subcelldata.boundary_quads.back().material_id = material_id;
+ // to make sure that the cast wont fail
+ Assert(material_id<= std::numeric_limits<types::boundary_id_t>::max(),
+ ExcIndexRange(material_id,0,std::numeric_limits<types::boundary_id_t>::max()));
+ // we use only boundary_ids in the range from 0 to types::internal_face_boundary_id-1
+ Assert(material_id < types::internal_face_boundary_id,
+ ExcIndexRange(material_id,0,types::internal_face_boundary_id));
+
+ subcelldata.boundary_quads.back().boundary_id
+ = static_cast<types::boundary_id_t>(material_id);
// transform from gmsh to
// consecutive numbering
bmarker_var->get(&*bmarker.begin(), n_bquads);
// we only handle boundary
// indicators that fit into an
- // unsigned char. Also, we don't
- // take 255 as it denotes an
- // internal face
+ // types::boundary_id_t. Also, we don't
+ // take types::internal_face_boundary_id
+ // as it denotes an internal face
for (unsigned int i=0; i<bmarker.size(); ++i)
- Assert(0<=bmarker[i] && bmarker[i]<=254, ExcIO());
+ Assert(0<=bmarker[i] && bmarker[i]<types::internal_face_boundary_id, ExcIO());
// finally we setup the boundary
// information
for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
subcelldata.boundary_quads[i].vertices[v]=bvertex_indices[
i*GeometryInfo<dim>::vertices_per_face+v];
- subcelldata.boundary_quads[i].material_id=bmarker[i];
+ subcelldata.boundary_quads[i].boundary_id
+ = static_cast<types::boundary_id_t>(bmarker[i]);
}
GridTools::delete_unused_vertices(vertices, cells, subcelldata);
{
Triangulation<dim>::face_iterator
face = cell->face(face_reorder[f]);
- const unsigned char bi = face->boundary_indicator();
- if (bi != 255)
+ const types::boundary_id_t bi = face->boundary_indicator();
+ if (bi != types::internal_face_boundary_id)
{
// Code for polyline
out << "2 1 "
if (eps_flags_base.color_lines_level && (line->level > 0))
// lines colored according to
// refinement level,
- // contributed by Jörg
+ // contributed by J�rg
// R. Weimar
out << line->level
<< " l "
typename Container<dim,spacedim>::face_iterator>
extract_boundary_mesh (const Container<dim,spacedim> &volume_mesh,
Container<dim-1,spacedim> &surface_mesh,
- const std::set<unsigned char> &boundary_ids)
+ const std::set<types::boundary_id_t> &boundary_ids)
{
// Assumption:
// We are relying below on the fact that Triangulation::create_triangulation(...) will keep the order
Triangulation<deal_II_dimension>::face_iterator>
extract_boundary_mesh (const Triangulation<deal_II_dimension> &volume_mesh,
Triangulation<deal_II_dimension-1,deal_II_dimension> &surface_mesh,
- const std::set<unsigned char> &boundary_ids);
+ const std::set<types::boundary_id_t> &boundary_ids);
#endif
\}
}
Container<deal_II_dimension>::face_iterator>
extract_boundary_mesh (const Container<deal_II_dimension> &volume_mesh,
Container<deal_II_dimension-1,deal_II_dimension> &surface_mesh,
- const std::set<unsigned char> &boundary_ids);
+ const std::set<types::boundary_id_t> &boundary_ids);
#endif
\}
}
if (n_adj_cells == 1)
line->set_boundary_indicator (0);
else
- // interior line -> 255
- line->set_boundary_indicator (255);
+ // interior line -> types::internal_face_boundary_id
+ line->set_boundary_indicator (types::internal_face_boundary_id);
}
// set boundary indicators where
// assert that we only set
// boundary info once
AssertThrow (! (line->boundary_indicator() != 0 &&
- line->boundary_indicator() != 255),
+ line->boundary_indicator() != types::internal_face_boundary_id),
ExcMultiplySetLineInfoOfLine(line_vertices.first,
line_vertices.second));
// Assert that only exterior lines
// are given a boundary indicator
- AssertThrow (! (line->boundary_indicator() == 255),
+ AssertThrow (! (line->boundary_indicator() == types::internal_face_boundary_id),
ExcInteriorLineCantBeBoundary());
- line->set_boundary_indicator (boundary_line->material_id);
+ line->set_boundary_indicator (boundary_line->boundary_id);
}
if (n_adj_cells == 1)
quad->set_boundary_indicator (0);
else
- // interior quad -> 255
- quad->set_boundary_indicator (255);
+ // interior quad -> types::internal_face_boundary_id
+ quad->set_boundary_indicator (types::internal_face_boundary_id);
}
/////////////////////////////////////////
// as interior
for (typename Triangulation<dim,spacedim>::line_iterator
line=triangulation.begin_line(); line!=triangulation.end_line(); ++line)
- line->set_boundary_indicator (255);
+ line->set_boundary_indicator (types::internal_face_boundary_id);
// next reset all lines bounding
// boundary quads as on the
// boundary also. note that since
// different than the
// previously set value
if (line->boundary_indicator() != 0)
- AssertThrow (line->boundary_indicator() == boundary_line->material_id,
+ AssertThrow (line->boundary_indicator() == boundary_line->boundary_id,
ExcMessage ("Duplicate boundary lines are only allowed "
"if they carry the same boundary indicator."));
- line->set_boundary_indicator (boundary_line->material_id);
+ line->set_boundary_indicator (boundary_line->boundary_id);
}
// different than the
// previously set value
if (quad->boundary_indicator() != 0)
- AssertThrow (quad->boundary_indicator() == boundary_quad->material_id,
+ AssertThrow (quad->boundary_indicator() == boundary_quad->boundary_id,
ExcMessage ("Duplicate boundary quads are only allowed "
"if they carry the same boundary indicator."));
- quad->set_boundary_indicator (boundary_quad->material_id);
+ quad->set_boundary_indicator (boundary_quad->boundary_id);
}
switch_1->line_orientation(1),
switch_1->line_orientation(2),
switch_1->line_orientation(3)};
- const unsigned char switch_1_boundary_indicator=switch_1->boundary_indicator();
+ const types::boundary_id_t switch_1_boundary_indicator=switch_1->boundary_indicator();
const unsigned int switch_1_user_index=switch_1->user_index();
const bool switch_1_user_flag=switch_1->user_flag_set();
// set or not
cell->clear_user_flag();
+
+
+ // An assert to make sure that the
+ // static_cast in the next line has
+ // the chance to give reasonable results.
+ Assert(cell->material_id()<= std::numeric_limits<types::material_id_t>::max(),
+ ExcIndexRange(cell->material_id(),0,std::numeric_limits<types::material_id_t>::max()));
+
// new vertex is
// placed on the
// surface according
// stored in the
// boundary class
triangulation.vertices[next_unused_vertex] =
- triangulation.boundary[cell->material_id()]
- ->get_new_point_on_quad (cell);
+ triangulation.get_boundary(static_cast<types::boundary_id_t>(cell->material_id()))
+ .get_new_point_on_quad (cell);
}
}
new_lines[l]->clear_user_data();
new_lines[l]->clear_children();
// interior line
- new_lines[l]->set_boundary_indicator(255);
+ new_lines[l]->set_boundary_indicator(types::internal_face_boundary_id);
}
// Now add the four (two)
(cell->vertex(0) + cell->vertex(1)) / 2;
else
triangulation.vertices[next_unused_vertex] =
- triangulation.boundary[cell->material_id()]
- ->get_new_point_on_line(cell);
+ triangulation.get_boundary(static_cast<types::boundary_id_t>(cell->material_id()))
+ .get_new_point_on_line(cell);
triangulation.vertices_used[next_unused_vertex] = true;
// search for next two
// the two vertices:
if (line->at_boundary())
triangulation.vertices[next_unused_vertex]
- = triangulation.boundary[line->boundary_indicator()]
- ->get_new_point_on_line (line);
+ = triangulation.get_boundary(line->boundary_indicator())
+ .get_new_point_on_line (line);
else
triangulation.vertices[next_unused_vertex]
= (line->vertex(0) + line->vertex(1)) / 2;
// boundary object for its
// answer
triangulation.vertices[next_unused_vertex]
- = triangulation.boundary[line->user_index()]->get_new_point_on_line (line);
+ = triangulation.get_boundary(line->user_index()).get_new_point_on_line (line);
// now that we created
// the right point, make
if (line->at_boundary())
triangulation.vertices[next_unused_vertex]
- = triangulation.boundary[line->boundary_indicator()]->get_new_point_on_line (line);
+ = triangulation.get_boundary(line->boundary_indicator()).get_new_point_on_line (line);
else
triangulation.vertices[next_unused_vertex]
= (line->vertex(0) + line->vertex(1)) / 2;
switch_1->line_orientation(1),
switch_1->line_orientation(2),
switch_1->line_orientation(3)};
- const unsigned char switch_1_boundary_indicator=switch_1->boundary_indicator();
+ const types::boundary_id_t switch_1_boundary_indicator=switch_1->boundary_indicator();
const unsigned int switch_1_user_index=switch_1->user_index();
const bool switch_1_user_flag=switch_1->user_flag_set();
const RefinementCase<dim-1> switch_1_refinement_case=switch_1->refinement_case();
// appropriately
if (quad->at_boundary())
triangulation.vertices[next_unused_vertex]
- = triangulation.boundary[quad->boundary_indicator()]->get_new_point_on_quad (quad);
+ = triangulation.get_boundary(quad->boundary_indicator()).get_new_point_on_quad (quad);
else
// it might be that the
// quad itself is not
new_lines[i]->clear_user_data();
new_lines[i]->clear_children();
// interior line
- new_lines[i]->set_boundary_indicator(255);
+ new_lines[i]->set_boundary_indicator(types::internal_face_boundary_id);
}
// find some space for the newly to
new_quads[i]->clear_user_data();
new_quads[i]->clear_children();
// interior quad
- new_quads[i]->set_boundary_indicator (255);
+ new_quads[i]->set_boundary_indicator (types::internal_face_boundary_id);
// set all line orientation
// flags to true by default,
// change this afterwards, if
// boundary would be
// this one.
const Point<spacedim> new_bound
- = triangulation.boundary[face->boundary_indicator()]
- ->get_new_point_on_face (face);
+ = triangulation.get_boundary(face->boundary_indicator())
+ .get_new_point_on_face (face);
// to check it,
// transform to the
// unit cell with
check_for_distorted_cells(check_for_distorted_cells),
vertex_to_boundary_id_map_1d (0)
{
- // set default boundary for all
- // possible components
- for (unsigned int i=0;i<255;++i)
- boundary[i] = &straight_boundary;
+ //Set default value at types::internal_face_boundary_id.
+ //Because this value is reserved for inner faces, we
+ //will never set this one to anything else.
+ //TODO This line vanishes, if we resolve the TODO in the get_boundary function
+ boundary[types::internal_face_boundary_id] = &straight_boundary;
if (dim == 1)
vertex_to_boundary_id_map_1d
- = new std::map<unsigned int, unsigned char>();
+ = new std::map<unsigned int, types::boundary_id_t>();
// connect the any_change signal to the other signals
signals.create.connect (signals.any_change);
template <int dim, int spacedim>
void
-Triangulation<dim, spacedim>::set_boundary (const unsigned int number,
+Triangulation<dim, spacedim>::set_boundary (const types::boundary_id_t number,
const Boundary<dim, spacedim>& boundary_object)
{
- Assert(number<255, ExcIndexRange(number,0,255));
+ Assert(number < types::internal_face_boundary_id, ExcIndexRange(number,0,types::internal_face_boundary_id));
boundary[number] = &boundary_object;
}
template <int dim, int spacedim>
void
-Triangulation<dim, spacedim>::set_boundary (const unsigned int number)
+Triangulation<dim, spacedim>::set_boundary (const types::boundary_id_t number)
{
- set_boundary (number, straight_boundary);
+ Assert(number < types::internal_face_boundary_id, ExcIndexRange(number,0,types::internal_face_boundary_id));
+
+ //delete the entry located at number.
+ boundary.erase(number);
}
template <int dim, int spacedim>
const Boundary<dim, spacedim> &
-Triangulation<dim, spacedim>::get_boundary (const unsigned int number) const
+Triangulation<dim, spacedim>::get_boundary (const types::boundary_id_t number) const
{
- Assert(number<255, ExcIndexRange(number,0,255));
+ Assert(number<types::internal_face_boundary_id, ExcIndexRange(number,0,types::internal_face_boundary_id));
+
+ //look, if there is a boundary stored at
+ //boundary_id number.
+ typename std::map<types::boundary_id_t, SmartPointer<const Boundary<dim, spacedim>, Triangulation<dim, spacedim> > >::const_iterator it
+ = boundary.find(number);
- return *(boundary[number]);
+ if(it != boundary.end())
+ {
+ //if we have found an entry, return it
+ return *(it->second);
+ }
+ else
+ {
+ //if we have not found an entry
+ //connected with number, we return
+ //straight_boundary, stored at types::internal_face_boundary_id
+ it = boundary.find(types::internal_face_boundary_id);
+
+ return *(it->second);
+ // TODO: This should get returned, atm there are some errors
+ // connected to Boundary<1,3>. If this issue is resolved, the TODOs in
+ // the constructor and clear_despite_subscriptions can also get resolved.
+ //return straight_boundary;
+ }
}
template <int dim, int spacedim>
-std::vector<unsigned char>
+std::vector<types::boundary_id_t>
Triangulation<dim, spacedim>::get_boundary_indicators () const
{
// in 1d, we store a map of all used
// purposes
if (dim == 1)
{
- std::vector<unsigned char> boundary_indicators;
- for (std::map<unsigned int, unsigned char>::const_iterator
+ std::vector<types::boundary_id_t> boundary_indicators;
+ for (std::map<unsigned int, types::boundary_id_t>::const_iterator
p = vertex_to_boundary_id_map_1d->begin();
p != vertex_to_boundary_id_map_1d->end();
++p)
}
else
{
- std::vector<bool> bi_exists(255, false);
+ std::vector<bool> bi_exists(types::internal_face_boundary_id, false);
active_cell_iterator cell=begin_active();
for (; cell!=end(); ++cell)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
const unsigned int n_bi=
std::count(bi_exists.begin(), bi_exists.end(), true);
- std::vector<unsigned char> boundary_indicators(n_bi);
+ std::vector<types::boundary_id_t> boundary_indicators(n_bi);
unsigned int bi_counter=0;
for (unsigned int i=0; i<bi_exists.size(); ++i)
if (bi_exists[i]==true)
faces = new internal::Triangulation::TriaFaces<dim>(*old_tria.faces);
- for (unsigned i=0;i<255;++i)
- boundary[i] = old_tria.boundary[i];
+ typename std::map<types::boundary_id_t, SmartPointer<const Boundary<dim, spacedim> , Triangulation<dim, spacedim> > >::const_iterator
+ bdry_iterator = old_tria.boundary.begin();
+ for (; bdry_iterator != old_tria.boundary.end() ; bdry_iterator++)
+ boundary[bdry_iterator->first] = bdry_iterator->second;
+
levels.reserve (old_tria.levels.size());
for (unsigned int level=0; level<old_tria.levels.size(); ++level)
{
delete vertex_to_boundary_id_map_1d;
vertex_to_boundary_id_map_1d
- = (new std::map<unsigned int, unsigned char>
+ = (new std::map<unsigned int, types::boundary_id_t>
(*old_tria.vertex_to_boundary_id_map_1d));
}
vertices.clear ();
vertices_used.clear ();
- for (unsigned int i=0; i<255; ++i)
- boundary[i] = &straight_boundary;
+ boundary.clear();
+ //TODO: This is connected with the TODO in get_boundary and vanishes, if
+ //this TODO has been dealt with.
+ boundary[types::internal_face_boundary_id] = &straight_boundary;
number_cache = internal::Triangulation::NumberCache<dim>();
}
// functions that currently only exist for <1,1> and <1,2>
template
const Boundary<1,3> &
-Triangulation<1,3>::get_boundary (const unsigned int number) const;
+Triangulation<1,3>::get_boundary (const types::boundary_id_t number) const;
DEAL_II_NAMESPACE_CLOSE
template <int dim, int spacedim>
-unsigned char CellAccessor<dim, spacedim>::material_id () const
+types::material_id_t CellAccessor<dim, spacedim>::material_id () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- return this->tria->levels[this->present_level]->cells.material_id[this->present_index];
+ return this->tria->levels[this->present_level]->cells.boundary_or_material_id[this->present_index].material_id;
}
template <int dim, int spacedim>
-void CellAccessor<dim, spacedim>::set_material_id (const unsigned char mat_id) const
+void CellAccessor<dim, spacedim>::set_material_id (const types::material_id_t mat_id) const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- this->tria->levels[this->present_level]->cells.material_id[this->present_index] = mat_id;
+ Assert ( mat_id < types::invalid_material_id, ExcIndexRange(mat_id,0,types::invalid_material_id));
+ this->tria->levels[this->present_level]->cells.boundary_or_material_id[this->present_index].material_id = mat_id;
}
template <int dim, int spacedim>
-void CellAccessor<dim, spacedim>::recursively_set_material_id (const unsigned char mat_id) const
+void CellAccessor<dim, spacedim>::recursively_set_material_id (const types::material_id_t mat_id) const
{
set_material_id (mat_id);
new_size-children.size(),
-1);
- material_id.reserve (new_size);
- material_id.insert (material_id.end(),
- new_size-material_id.size(),
- 255);
+ boundary_or_material_id.reserve (new_size);
+ boundary_or_material_id.insert (boundary_or_material_id.end(),
+ new_size-boundary_or_material_id.size(),
+ BoundaryOrMaterialId());
user_data.reserve (new_size);
user_data.insert (user_data.end(),
RefinementCase<2>::no_refinement);
- material_id.reserve (new_size);
- material_id.insert (material_id.end(),
- new_size-material_id.size(),
- 255);
+ boundary_or_material_id.reserve (new_size);
+ boundary_or_material_id.insert (boundary_or_material_id.end(),
+ new_size-boundary_or_material_id.size(),
+ BoundaryOrMaterialId());
user_data.reserve (new_size);
user_data.insert (user_data.end(),
4*new_size-children.size(),
-1);
- material_id.reserve (new_size);
- material_id.insert (material_id.end(),
- new_size-material_id.size(),
- 255);
+ boundary_or_material_id.reserve (new_size);
+ boundary_or_material_id.insert (boundary_or_material_id.end(),
+ new_size-boundary_or_material_id.size(),
+ BoundaryOrMaterialId());
user_data.reserve (new_size);
user_data.insert (user_data.end(),
ExcMemoryInexact (cells.size(), user_flags.size()));
Assert (cells.size() == children.size(),
ExcMemoryInexact (cells.size(), children.size()));
- Assert (cells.size() == material_id.size(),
- ExcMemoryInexact (cells.size(), material_id.size()));
+ Assert (cells.size() == boundary_or_material_id.size(),
+ ExcMemoryInexact (cells.size(), boundary_or_material_id.size()));
Assert (cells.size() == user_data.size(),
ExcMemoryInexact (cells.size(), user_data.size()));
}
ExcMemoryInexact (cells.size(), children.size()));
Assert (cells.size() == refinement_cases.size(),
ExcMemoryInexact (cells.size(), refinement_cases.size()));
- Assert (cells.size() == material_id.size(),
- ExcMemoryInexact (cells.size(), material_id.size()));
+ Assert (cells.size() == boundary_or_material_id.size(),
+ ExcMemoryInexact (cells.size(), boundary_or_material_id.size()));
Assert (cells.size() == user_data.size(),
ExcMemoryInexact (cells.size(), user_data.size()));
}
ExcMemoryInexact (cells.size(), user_flags.size()));
Assert (4*cells.size() == children.size(),
ExcMemoryInexact (cells.size(), children.size()));
- Assert (cells.size() == material_id.size(),
- ExcMemoryInexact (cells.size(), material_id.size()));
+ Assert (cells.size() == boundary_or_material_id.size(),
+ ExcMemoryInexact (cells.size(), boundary_or_material_id.size()));
Assert (cells.size() == user_data.size(),
ExcMemoryInexact (cells.size(), user_data.size()));
Assert (cells.size() * GeometryInfo<3>::faces_per_cell
refinement_cases.clear();
used.clear();
user_flags.clear();
- material_id.clear();
+ boundary_or_material_id.clear();
user_data.clear();
user_data_type = data_unknown;
}
MemoryConsumption::memory_consumption (children) +
MemoryConsumption::memory_consumption (used) +
MemoryConsumption::memory_consumption (user_flags) +
- MemoryConsumption::memory_consumption (material_id) +
+ MemoryConsumption::memory_consumption (boundary_or_material_id) +
MemoryConsumption::memory_consumption (refinement_cases) +
user_data.capacity() * sizeof(UserData) + sizeof(user_data));
}
template <>
- unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+ unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
{
Assert (finite_elements != 0, ExcNoFESelected());
// check that only boundary
// indicators 0 and 1 are allowed
// in 1d
- for (std::set<unsigned char>::const_iterator i=boundary_indicators.begin();
+ for (std::set<types::boundary_id_t>::const_iterator i=boundary_indicators.begin();
i!=boundary_indicators.end(); ++i)
Assert ((*i == 0) || (*i == 1),
ExcInvalidBoundaryIndicator());
}
template <>
- unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<unsigned char> &) const
+ unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id_t> &) const
{
Assert(false,ExcNotImplemented());
return 0;
DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
{
Assert (finite_elements != 0, ExcNoFESelected());
- Assert (boundary_indicators.find(255) == boundary_indicators.end(),
+ Assert (boundary_indicators.find(types::internal_face_boundary_id) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
// same as above, but with
template<int dim, int spacedim>
unsigned int
- DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+ DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
{
Assert (finite_elements != 0, ExcNoFESelected());
- Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+ Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
// same as above, but with
template <>
- unsigned int DoFHandler<2,3>::n_boundary_dofs (const std::set<unsigned char> &) const
+ unsigned int DoFHandler<2,3>::n_boundary_dofs (const std::set<types::boundary_id_t> &) const
{
Assert(false,ExcNotImplemented());
return 0;
{
const typename MGDoFHandler<dim,spacedim>::face_iterator
face = cell->face(face_no);
- const unsigned char bi = face->boundary_indicator();
+ const types::boundary_id_t bi = face->boundary_indicator();
// Face is listed in
// boundary map
if (function_map.find(bi) != function_map.end())
}
typename MGDoFHandler<dim,spacedim>::face_iterator face = cell->face(face_no);
- const unsigned char boundary_component = face->boundary_indicator();
+ const types::boundary_id_t boundary_component = face->boundary_indicator();
if (function_map.find(boundary_component) != function_map.end())
// face is of the right component
{
* The material id we are to care
* for.
*/
- const unsigned int material_id;
+ const types::material_id_t material_id;
/**
* Some more references to input data to
const bool need_quadrature_points,
const unsigned int n_solution_vectors,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id,
+ const types::material_id_t material_id,
const typename FunctionMap<spacedim>::type *neumann_bc,
const std::vector<bool> component_mask,
const Function<spacedim> *coefficients);
const bool need_quadrature_points,
const unsigned int n_solution_vectors,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id,
+ const types::material_id_t material_id,
const typename FunctionMap<spacedim>::type *neumann_bc,
const std::vector<bool> component_mask,
const Function<spacedim> *coefficients)
// difference between normal
// derivative and boundary function
{
- const unsigned char boundary_indicator = face->boundary_indicator();
+ const types::boundary_id_t boundary_indicator = face->boundary_indicator();
Assert (parallel_data.neumann_bc->find(boundary_indicator) !=
parallel_data.neumann_bc->end(),
||
(cell->subdomain_id() == subdomain_id))
&&
- ((material_id == numbers::invalid_unsigned_int)
+ ((material_id == types::invalid_material_id)
||
(cell->material_id() == material_id))) )
{
&&
((cell->neighbor(face_no)->material_id()
== material_id) ||
- (material_id == numbers::invalid_unsigned_int));
+ (material_id == types::invalid_material_id));
else
{
for (unsigned int sf=0; sf<face->n_children(); ++sf)
->subdomain_id() == subdomain_id)
&&
(material_id ==
- numbers::invalid_unsigned_int))
+ types::invalid_material_id))
||
((cell->neighbor_child_on_subface(face_no,sf)
->material_id() == material_id)
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
// just pass on to the other function
const std::vector<const InputVector *> solutions (1, &solution);
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
estimate(StaticMappingQ1<1,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
estimate(StaticMappingQ1<1,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
// just pass on to the other function
const std::vector<const InputVector *> solutions (1, &solution);
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
estimate(StaticMappingQ1<1,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
estimate(StaticMappingQ1<1,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
const Function<spacedim> */*coefficient*/,
const unsigned int,
const types::subdomain_id_t /*subdomain_id*/,
- const unsigned int /*material_id*/)
+ const types::material_id_t /*material_id*/)
{
Assert (false, ExcInternalError());
}
const Function<spacedim> *coefficient,
const unsigned int,
const types::subdomain_id_t subdomain_id_,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
#ifdef DEAL_II_USE_P4EST
if (dynamic_cast<const parallel::distributed::Triangulation<1,spacedim>*>
const unsigned int n_solution_vectors = solutions.size();
// sanity checks
- Assert (neumann_bc.find(255) == neumann_bc.end(),
+ Assert (neumann_bc.find(types::internal_face_boundary_id) == neumann_bc.end(),
ExcInvalidBoundaryIndicator());
for (typename FunctionMap<spacedim>::type::const_iterator i=neumann_bc.begin();
||
(cell->subdomain_id() == subdomain_id))
&&
- ((material_id == numbers::invalid_unsigned_int)
+ ((material_id == types::invalid_material_id)
||
(cell->material_id() == material_id)))
{
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
// just pass on to the other function
const std::vector<const InputVector *> solutions (1, &solution);
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
estimate(StaticMappingQ1<dim,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
// just pass on to the other function
const std::vector<const InputVector *> solutions (1, &solution);
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
const Function<spacedim> *coefficients,
const unsigned int ,
const types::subdomain_id_t subdomain_id_,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
#ifdef DEAL_II_USE_P4EST
if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
||
(cell->subdomain_id() == subdomain_id))
&&
- ((material_id == numbers::invalid_unsigned_int)
+ ((material_id == types::invalid_material_id)
||
(cell->material_id() == material_id)))
{
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
// forward to the function with the QCollection
estimate (mapping, dof_handler,
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
const Function<spacedim> *coefficients,
const unsigned int n_threads,
const types::subdomain_id_t subdomain_id,
- const unsigned int material_id)
+ const types::material_id_t material_id)
{
Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
const Function<deal_II_dimension> *, \
const unsigned int , \
const unsigned int , \
- const unsigned int); \
+ const types::material_id_t); \
\
template \
void \
const Function<deal_II_dimension> *, \
const unsigned int , \
const unsigned int , \
- const unsigned int); \
+ const types::material_id_t); \
\
template \
void \
const Function<deal_II_dimension> *, \
const unsigned int , \
const unsigned int , \
- const unsigned int); \
+ const types::material_id_t); \
\
template \
void \
const Function<deal_II_dimension> *, \
const unsigned int , \
const unsigned int , \
- const unsigned int);\
+ const types::material_id_t);\
#if deal_II_dimension == 2 || deal_II_dimension == 1
const Function<deal_II_dimension+1> *, \
const unsigned int , \
const unsigned int , \
- const unsigned int); \
+ const types::material_id_t); \
\
template \
void \
const Function<deal_II_dimension+1> *, \
const unsigned int , \
const unsigned int , \
- const unsigned int); \
+ const types::material_id_t); \
\
template \
void \
const Function<deal_II_dimension+1> *, \
const unsigned int , \
const unsigned int , \
- const unsigned int); \
+ const types::material_id_t); \
\
template \
void \
const Function<deal_II_dimension+1> *, \
const unsigned int , \
const unsigned int , \
- const unsigned int);\
+ const types::material_id_t);\
#else
#define INSTANTIATE_CODIM(InputVector,DH,Q)
const Quadrature<deal_II_dimension-1> &,
const Function<deal_II_dimension> &,
Vector<double> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
#endif
template
const Quadrature<deal_II_dimension-1> &,
const Function<deal_II_dimension> &,
Vector<double> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
#if deal_II_dimension > 1
template
const hp::QCollection<deal_II_dimension-1> &,
const Function<deal_II_dimension> &,
Vector<double> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
#endif
template
const hp::QCollection<deal_II_dimension-1> &,
const Function<deal_II_dimension> &,
Vector<double> &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
template
void interpolate_boundary_values (
const DoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const hp::DoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const MGDoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const DoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension> &,
ConstraintMatrix &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const hp::DoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension> &,
ConstraintMatrix &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const MGDoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension> &,
ConstraintMatrix &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension+1> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension+1> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension+1> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension+1> &,
ConstraintMatrix &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension+1> &,
ConstraintMatrix &,
const std::vector<bool> &);
template
void interpolate_boundary_values (
const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension+1> &,
ConstraintMatrix &,
const std::vector<bool> &);
(const DoFHandler<deal_II_dimension>&,
const unsigned int,
const Function<deal_II_dimension>&,
- const unsigned char,
+ const types::boundary_id_t,
ConstraintMatrix&,
const Mapping<deal_II_dimension>&);
template
(const hp::DoFHandler<deal_II_dimension>&,
const unsigned int,
const Function<deal_II_dimension>&,
- const unsigned char,
+ const types::boundary_id_t,
ConstraintMatrix&,
const hp::MappingCollection<deal_II_dimension>&);
template
(const DoFHandler<deal_II_dimension>&,
const unsigned int,
const Function<deal_II_dimension>&,
- const unsigned char,
+ const types::boundary_id_t,
ConstraintMatrix&,
const Mapping<deal_II_dimension>&);
template
(const hp::DoFHandler<deal_II_dimension>&,
const unsigned int,
const Function<deal_II_dimension>&,
- const unsigned char,
+ const types::boundary_id_t,
ConstraintMatrix&,
const hp::MappingCollection<deal_II_dimension>&);
template
void
compute_no_normal_flux_constraints (const DoFHandler<deal_II_dimension> &dof_handler,
const unsigned int first_vector_component,
- const std::set<unsigned char> &boundary_ids,
+ const std::set<types::boundary_id_t> &boundary_ids,
ConstraintMatrix &constraints,
const Mapping<deal_II_dimension> &mapping);
template
void
compute_no_normal_flux_constraints (const hp::DoFHandler<deal_II_dimension> &dof_handler,
const unsigned int first_vector_component,
- const std::set<unsigned char> &boundary_ids,
+ const std::set<types::boundary_id_t> &boundary_ids,
ConstraintMatrix &constraints,
const Mapping<deal_II_dimension> &mapping);
#endif
void interpolate_boundary_values
(const Mapping<deal_II_dimension> &,
const DoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);
void interpolate_boundary_values
(const Mapping<deal_II_dimension> &,
const hp::DoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension> &,
ConstraintMatrix &,
const std::vector<bool> &);
void interpolate_boundary_values
(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
+ const types::boundary_id_t,
const Function<deal_II_dimension+1> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);