template <int dim, int spacedim> class Boundary;
template <int dim, int spacedim> class StraightBoundary;
+template <int dim, int spacedim> class Manifold;
template <int, int, int> class TriaAccessor;
template <int spacedim> class TriaAccessor<0,1,spacedim>;
* @see @ref GlossManifoldIndicator "Glossary entry on manifold indicators"
*/
void set_manifold (const types::manifold_id number,
- const Boundary<dim,spacedim> &manifold_object);
+ const Manifold<dim,spacedim> &manifold_object);
/**
*
* @see @ref GlossManifoldIndicator "Glossary entry on manifold indicators"
*/
- const Boundary<dim,spacedim> &get_manifold (const types::manifold_id number) const;
+ const Manifold<dim,spacedim> &get_manifold (const types::manifold_id number) const;
/**
* Returns a vector containing all boundary indicators assigned to
* Collection of manifold objects. We store only objects, which are
* not of type FlatManifold.
*/
- std::map<types::manifold_id, SmartPointer<const Boundary<dim,spacedim> , Triangulation<dim, spacedim> > > manifold;
+ std::map<types::manifold_id, SmartPointer<const Manifold<dim,spacedim> , Triangulation<dim, spacedim> > > manifold;
/**
template <typename Accessor> class TriaActiveIterator;
template <int dim, int spacedim> class Boundary;
+template <int dim, int spacedim> class Manifold;
namespace internal
* involves querying both the manifold or boundary indicators. See there
* for more information.
*/
- const Boundary<dim,spacedim> &get_manifold () const;
+ const Manifold<dim,spacedim> &get_manifold () const;
/**
* @}
template <int structdim, int dim, int spacedim>
const Boundary<dim,spacedim> &
TriaAccessor<structdim, dim, spacedim>::get_boundary () const
-{
- return get_manifold();
+{
+ Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
+
+ // Get the default (manifold_id)
+ const types::manifold_id mi = this->objects().manifold_id[this->present_index];
+
+ // In case this is not valid, check
+ // the boundary id, after having
+ // casted it to a manifold id
+ if(mi == numbers::invalid_manifold_id)
+ return this->tria->get_boundary(structdim < dim ?
+ this->objects().boundary_or_material_id[this->present_index].boundary_id:
+ dim < spacedim ?
+ this->objects().boundary_or_material_id[this->present_index].material_id:
+ numbers::invalid_manifold_id);
+ else
+ return this->tria->get_boundary(mi);
}
template <int structdim, int dim, int spacedim>
-const Boundary<dim,spacedim> &
+const Manifold<dim,spacedim> &
TriaAccessor<structdim, dim, spacedim>::get_manifold () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_levels.h>
#include <deal.II/grid/tria_faces.h>
+#include <deal.II/grid/manifold.h>
#include <deal.II/grid/tria_boundary.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
// new vertex is placed on the surface according to
// the information stored in the boundary class
- const Boundary<dim,spacedim> &manifold = cell->get_manifold();
+ const Manifold<dim,spacedim> &manifold = cell->get_manifold();
triangulation.vertices[next_unused_vertex] =
manifold.get_new_point_on_quad (cell);
template <int dim, int spacedim>
void
Triangulation<dim, spacedim>::set_manifold (const types::manifold_id m_number,
- const Boundary<dim, spacedim> &manifold_object)
+ const Manifold<dim, spacedim> &manifold_object)
{
Assert(m_number < numbers::invalid_manifold_id,
ExcIndexRange(m_number,0,numbers::invalid_manifold_id));
const Boundary<dim,spacedim> &
Triangulation<dim, spacedim>::get_boundary (const types::manifold_id m_number) const
{
- return get_manifold(m_number);
+ const Boundary<dim, spacedim> * man =
+ dynamic_cast<const Boundary<dim, spacedim> *>(&get_manifold(m_number));
+ Assert(man != NULL,
+ ExcMessage("You tried to get a Boundary, but I only have a Manifold."));
+
+ return *man;
}
template <int dim, int spacedim>
-const Boundary<dim,spacedim> &
+const Manifold<dim,spacedim> &
Triangulation<dim, spacedim>::get_manifold (const types::manifold_id m_number) const
{
//look, if there is a manifold stored at
//manifold_id number.
- typename std::map<types::manifold_id, SmartPointer<const Boundary<dim,spacedim>, Triangulation<dim, spacedim> > >::const_iterator it
+ typename std::map<types::manifold_id, SmartPointer<const Manifold<dim,spacedim>, Triangulation<dim, spacedim> > >::const_iterator it
= manifold.find(m_number);
if (it != manifold.end())
faces = new internal::Triangulation::TriaFaces<dim>(*old_tria.faces);
typename std::map<types::manifold_id,
- SmartPointer<const Boundary<dim,spacedim> , Triangulation<dim, spacedim> > >::const_iterator
+ SmartPointer<const Manifold<dim,spacedim> , Triangulation<dim, spacedim> > >::const_iterator
bdry_iterator = old_tria.manifold.begin();
for (; bdry_iterator != old_tria.manifold.end() ; bdry_iterator++)
manifold[bdry_iterator->first] = bdry_iterator->second;