template <int dim, int spacedim> class Boundary;
template <int dim, int spacedim> class StraightBoundary;
+template <int spacedim> class Manifold;
+template <int spacedim> class FlatManifold;
+
template <int, int, int> class TriaAccessor;
template <int spacedim> class TriaAccessor<0,1,spacedim>;
public:
/**
- * Default manifold object. This is used
- * for those objects for which no
- * boundary description has been explicitly
- * set using set_manifold().
+ * Default manifold object. This is used for those objects for which
+ * no manifold description has been explicitly set using
+ * set_manifold().
+ */
+ static const FlatManifold<spacedim> flat_manifold;
+
+ /**
+ * Default boundary object. This is used for those objects for which
+ * no boundary description has been explicitly set using
+ * set_boundary().
*/
- static const StraightBoundary<dim,spacedim> straight_boundary;
+ static const StraightBoundary<dim,spacedim> straight_boundary;
/**
* Declare some symbolic names
* @see @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
*/
void set_boundary (const types::manifold_id number,
- const Boundary<dim,spacedim> &boundary_object);
+ const Manifold<spacedim> &boundary_object);
/**
*
* @see @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
*/
- const Boundary<dim,spacedim> &get_boundary (const types::manifold_id number) const;
+ const Manifold<spacedim> &get_boundary (const types::manifold_id number) const;
/**
* Return a constant reference to a Manifold object used for this
*
* @see @ref GlossManifoldIndicator "Glossary entry on manifold indicators"
*/
- const Boundary<dim,spacedim> &get_manifold (const types::manifold_id number) const;
+ const Manifold<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<spacedim> ,
+ Triangulation<dim, spacedim> > > manifold;
/**
/**
* Return a constant reference to the manifold object used for this
* object. This function exists for backward compatibility and calls
- * get_manifold() internally.
+ * get_manifold() internally, casting the result to a
+ * Boundary<dim,spacedim>. If the object cannot be casted, it checks
+ * if the Manifold was actually a FlatManifold, in which case it
+ * returns a StraightBoundary<dim, spacedim>.
*/
- const Boundary<dim,spacedim> &get_boundary () const;
+ // const Boundary<dim,spacedim> &get_boundary () const;
+ const Manifold<spacedim> &get_boundary () const;
/**
* Return a constant reference to the manifold object used for this object.
* involves querying both the manifold or boundary indicators. See there
* for more information.
*/
- const Boundary<dim,spacedim> &get_manifold () const;
+ const Manifold<spacedim> &get_manifold () const;
/**
* @}
template <int structdim, int dim, int spacedim>
-const Boundary<dim,spacedim> &
+const Manifold<spacedim> &
TriaAccessor<structdim, dim, spacedim>::get_boundary () const
{
+// const Boundary<dim,spacedim> * ptr =
+// dynamic_cast<const Boundary<dim,spacedim> *>(&get_manifold());
+// if(ptr)
+// return *ptr;
+// else
+// {
+// // Check if the object returned was a FlatManifold...
+// if(dynamic_cast<const FlatManifold<spacedim> *>(&get_manifold()))
+// return Triangulation<dim,spacedim>::straight_boundary;
+// else
+// Assert(false,
+// ExcMessage("Requested object is not a Boundary."));
+// return Triangulation<dim,spacedim>::straight_boundary;
+// }
+// return Triangulation<dim,spacedim>::straight_boundary;
return get_manifold();
}
template <int structdim, int dim, int spacedim>
-const Boundary<dim,spacedim> &
+const Manifold<spacedim> &
TriaAccessor<structdim, dim, spacedim>::get_manifold () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
dim < spacedim ?
this->objects().boundary_or_material_id[this->present_index].material_id:
numbers::invalid_manifold_id);
- else
- return this->tria->get_manifold(mi);
+
+ return this->tria->get_manifold(mi);
}
const Boundary<Iterator::AccessorType::dimension,
Iterator::AccessorType::space_dimension>
*manifold = (respect_manifold ?
- &object->get_boundary() :
+ dynamic_cast<const Boundary<Iterator::AccessorType::dimension,
+ Iterator::AccessorType::space_dimension>* >(&object->get_boundary()) :
0);
const unsigned int structdim = Iterator::AccessorType::structure_dimension;
#include <deal.II/grid/tria_levels.h>
#include <deal.II/grid/tria_faces.h>
#include <deal.II/grid/tria_boundary.h>
+#include <deal.II/grid/manifold.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/grid_tools.h>
// to the information
// stored in the
// boundary class
- const Boundary<dim,spacedim> &manifold = cell->get_manifold();
+ const Manifold<spacedim> &manifold = cell->get_manifold();
triangulation.vertices[next_unused_vertex] =
manifold.get_new_point_on_quad (cell);
}
+template <int dim, int spacedim>
+const FlatManifold<spacedim>
+Triangulation<dim, spacedim>::flat_manifold = FlatManifold<spacedim>();
+
+
+
template <int dim, int spacedim>
const StraightBoundary<dim,spacedim>
Triangulation<dim, spacedim>::straight_boundary = StraightBoundary<dim,spacedim>();
template <int dim, int spacedim>
void
Triangulation<dim, spacedim>::set_boundary (const types::manifold_id m_number,
- const Boundary<dim, spacedim> &boundary_object)
+ const Manifold<spacedim> &boundary_object)
{
Assert(m_number < numbers::invalid_manifold_id,
ExcIndexRange(m_number,0,numbers::invalid_manifold_id));
template <int dim, int spacedim>
-const Boundary<dim,spacedim> &
+const Manifold<spacedim> &
Triangulation<dim, spacedim>::get_boundary (const types::manifold_id m_number) const
{
return get_manifold(m_number);
template <int dim, int spacedim>
-const Boundary<dim,spacedim> &
+const Manifold<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<spacedim>, Triangulation<dim, spacedim> > >::const_iterator it
= manifold.find(m_number);
if (it != manifold.end())
{
//if we have not found an entry
//connected with number, we return
- //straight_boundary
- return straight_boundary;
+ //flat_manifold
+ return flat_manifold;
}
}
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<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;