dealii::RefinementPossibilities<dim>::Possibilities::cut_xy));
#if dim==3
else if (refinement_case.compare("cut_z") == 0)
- {
- AssertThrow(dim == 3,
- dealii::ExcMessage("cut_z can only be use for dim equals to 3."));
- ref_case.reset(new dealii::RefinementCase<3>(
- dealii::RefinementPossibilities<3>::Possibilities::cut_z));
- }
+ ref_case.reset(new dealii::RefinementCase<3>(
+ dealii::RefinementPossibilities<3>::Possibilities::cut_z));
else if (refinement_case.compare("cut_xz") == 0)
- {
- AssertThrow(dim == 3,
- dealii::ExcMessage("cut_xz can only be use for dim equals to 3."));
- ref_case.reset(new dealii::RefinementCase<3>(
- dealii::RefinementPossibilities<3>::Possibilities::cut_xz));
- }
+ ref_case.reset(new dealii::RefinementCase<3>(
+ dealii::RefinementPossibilities<3>::Possibilities::cut_xz));
else if (refinement_case.compare("cut_yz") == 0)
- {
- AssertThrow(dim == 3,
- dealii::ExcMessage("cut_yz can only be use for dim equals to 3."));
- ref_case.reset(new dealii::RefinementCase<3>(
- dealii::RefinementPossibilities<3>::Possibilities::cut_yz));
- }
+ ref_case.reset(new dealii::RefinementCase<3>(
+ dealii::RefinementPossibilities<3>::Possibilities::cut_yz));
else if (refinement_case.compare("cut_xyz") == 0)
- {
- AssertThrow(dim == 3,
- dealii::ExcMessage("cut_xyz can only be use for dim equals to 3."));
- ref_case.reset(new dealii::RefinementCase<3>(
- dealii::RefinementPossibilities<3>::Possibilities::cut_xyz));
- }
+ ref_case.reset(new dealii::RefinementCase<3>(
+ dealii::RefinementPossibilities<3>::Possibilities::cut_xyz));
#endif
else
AssertThrow(false,
template <int dim, int spacedim>
- std::string get_refine_flag(void *cell_accessor)
+ std::string get_refine_flag(const void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const dealii::CellAccessor<dim,spacedim> *cell =
+ static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
std::string refine_flag;
dealii::RefinementCase<dim> ref_case = cell->refine_flag_set();
template <int dim, int spacedim>
- bool get_coarsen_flag(void *cell_accessor)
+ bool get_coarsen_flag(const void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const dealii::CellAccessor<dim,spacedim> *cell =
+ static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
return cell->coarsen_flag_set();
}
template <int dim, int spacedim>
- PointWrapper get_barycenter(void *cell_accessor)
+ PointWrapper get_barycenter(const void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const dealii::CellAccessor<dim,spacedim> *cell =
+ static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
dealii::Point<spacedim> barycenter = cell->barycenter();
boost::python::list barycenter_list;
for (int i=0; i<dim; ++i)
template <int dim, int spacedim>
- int get_material_id(void *cell_accessor)
+ int get_material_id(const void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const dealii::CellAccessor<dim,spacedim> *cell =
+ static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
return cell->material_id();
}
template <int dim, int spacedim>
- PointWrapper get_vertex(const int i, void *cell_accessor)
+ PointWrapper get_vertex(const int i, const void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const dealii::CellAccessor<dim,spacedim> *cell =
+ static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
dealii::Point<spacedim> vertex = cell->vertex(i);
boost::python::list coordinates;
template <int dim, int spacedim>
- int get_manifold_id(void *cell_accessor)
+ int get_manifold_id(const void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const dealii::CellAccessor<dim,spacedim> *cell =
+ static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
cell->manifold_id();
}
}
CellAccessorWrapper::CellAccessorWrapper(const CellAccessorWrapper &other)
:
dim(other.dim),
- spacedim(other.dim)
+ spacedim(other.spacedim)
{
if ((dim == 2) && (spacedim == 2))
{
- std::string CellAccessorWrapper::get_refine_flag()
+ std::string CellAccessorWrapper::get_refine_flag() const
{
if ((dim == 2) && (spacedim == 2))
return internal::get_refine_flag<2,2>(cell_accessor);
- bool CellAccessorWrapper::get_coarsen_flag()
+ bool CellAccessorWrapper::get_coarsen_flag() const
{
if ((dim == 2) && (spacedim == 2))
return internal::get_coarsen_flag<2,2>(cell_accessor);
}
- PointWrapper CellAccessorWrapper::get_barycenter()
+ PointWrapper CellAccessorWrapper::get_barycenter() const
{
if ((dim == 2) && (spacedim == 2))
return internal::get_barycenter<2,2>(cell_accessor);
- int CellAccessorWrapper::get_material_id()
+ int CellAccessorWrapper::get_material_id() const
{
if ((dim == 2) && (spacedim == 2))
return internal::get_material_id<2,2>(cell_accessor);
PointWrapper &point_wrapper)
{
AssertThrow(i<std::pow(2,dim),
- dealii::ExcMessage("The vertex does not exist."));
+ ExcVertexDoesNotExist(i, std::pow(2,dim)));
if ((dim == 2) && (spacedim == 2))
internal::set_vertex<2,2>(i, point_wrapper, cell_accessor);
else if ((dim == 2) && (spacedim == 3))
- PointWrapper CellAccessorWrapper::get_vertex(const int i)
+ PointWrapper CellAccessorWrapper::get_vertex(const int i) const
{
AssertThrow(i<std::pow(2,dim),
- dealii::ExcMessage("The vertex does not exist."));
+ ExcVertexDoesNotExist(i, std::pow(2,dim)));
if ((dim == 2) && (spacedim == 2))
return internal::get_vertex<2,2>(i, cell_accessor);
else if ((dim == 2) && (spacedim == 3))
- int CellAccessorWrapper::get_manifold_id()
+ int CellAccessorWrapper::get_manifold_id() const
{
if ((dim == 2) && (spacedim == 2))
internal::get_manifold_id<2,2>(cell_accessor);
boost::python::init<TriangulationWrapper &, const int, const int> ())
.add_property("refine_flag", &CellAccessorWrapper::get_refine_flag,
&CellAccessorWrapper::set_refine_flag,
- "Get the refine_flag of the cell. The possibilities are in 2D: isotropic, no_refinement, cut_x, cut_y, and cut_xy and in 3D: isotropic, no_refinement, cut_x, cut_y, cut_z, cut_xy, cut_xz, cut_yz, and cut_xyz.")
+ "Get/Set the refine_flag of the cell. The possibilities are in 2D: isotropic, no_refinement, cut_x, cut_y, and cut_xy and in 3D: isotropic, no_refinement, cut_x, cut_y, cut_z, cut_xy, cut_xz, cut_yz, and cut_xyz.")
.add_property("coarsen_flag", &CellAccessorWrapper::get_coarsen_flag,
&CellAccessorWrapper::set_coarsen_flag,
- "Get the coarsen_flag of the cell.")
+ "Get/Set the coarsen_flag of the cell.")
.add_property("material_id", &CellAccessorWrapper::get_material_id,
&CellAccessorWrapper::set_material_id,
- "Get the material_id of the cell.")
+ "Get/Set the material_id of the cell.")
.add_property("manifold_id", &CellAccessorWrapper::get_manifold_id,
&CellAccessorWrapper::set_manifold_id,
- "Get the manifold_id of the cell.")
+ "Get/Set the manifold_id of the cell.")
.def("barycenter", &CellAccessorWrapper::get_barycenter,
"Return the barycenter of the current cell.",
boost::python::args("self"))