#include <deal.II/python/triangulation_wrapper.h>
#include <deal.II/python/cell_accessor_wrapper.h>
-namespace PyDealII
+DEAL_II_NAMESPACE_OPEN
+
+namespace python
{
namespace internal
{
void set_refine_flag(const std::string &refinement_case,
void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ CellAccessor<dim,spacedim> *cell =
+ static_cast<CellAccessor<dim,spacedim>*>(cell_accessor);
- std::unique_ptr<dealii::RefinementCase<dim>> ref_case;
+ std::unique_ptr<RefinementCase<dim>> ref_case;
if (refinement_case.compare("isotropic") == 0)
- ref_case.reset(new dealii::RefinementCase<dim>(
- dealii::RefinementPossibilities<dim>::Possibilities::isotropic_refinement));
+ ref_case.reset(new RefinementCase<dim>(
+ RefinementPossibilities<dim>::Possibilities::isotropic_refinement));
else if (refinement_case.compare("no_refinement") == 0)
- ref_case.reset(new dealii::RefinementCase<dim>(
- dealii::RefinementPossibilities<dim>::Possibilities::no_refinement));
+ ref_case.reset(new RefinementCase<dim>(
+ RefinementPossibilities<dim>::Possibilities::no_refinement));
else if (refinement_case.compare("cut_x") == 0)
- ref_case.reset(new dealii::RefinementCase<dim>(
- dealii::RefinementPossibilities<dim>::Possibilities::cut_x));
+ ref_case.reset(new RefinementCase<dim>(
+ RefinementPossibilities<dim>::Possibilities::cut_x));
else if (refinement_case.compare("cut_y") == 0)
- ref_case.reset(new dealii::RefinementCase<dim>(
- dealii::RefinementPossibilities<dim>::Possibilities::cut_y));
+ ref_case.reset(new RefinementCase<dim>(
+ RefinementPossibilities<dim>::Possibilities::cut_y));
else if (refinement_case.compare("cut_xy") == 0)
- ref_case.reset(new dealii::RefinementCase<dim>(
- dealii::RefinementPossibilities<dim>::Possibilities::cut_xy));
+ ref_case.reset(new RefinementCase<dim>(
+ RefinementPossibilities<dim>::Possibilities::cut_xy));
#if dim==3
else if (refinement_case.compare("cut_z") == 0)
- ref_case.reset(new dealii::RefinementCase<3>(
- dealii::RefinementPossibilities<3>::Possibilities::cut_z));
+ ref_case.reset(new RefinementCase<3>(
+ RefinementPossibilities<3>::Possibilities::cut_z));
else if (refinement_case.compare("cut_xz") == 0)
- ref_case.reset(new dealii::RefinementCase<3>(
- dealii::RefinementPossibilities<3>::Possibilities::cut_xz));
+ ref_case.reset(new RefinementCase<3>(
+ RefinementPossibilities<3>::Possibilities::cut_xz));
else if (refinement_case.compare("cut_yz") == 0)
- ref_case.reset(new dealii::RefinementCase<3>(
- dealii::RefinementPossibilities<3>::Possibilities::cut_yz));
+ ref_case.reset(new RefinementCase<3>(
+ RefinementPossibilities<3>::Possibilities::cut_yz));
else if (refinement_case.compare("cut_xyz") == 0)
- ref_case.reset(new dealii::RefinementCase<3>(
- dealii::RefinementPossibilities<3>::Possibilities::cut_xyz));
+ ref_case.reset(new RefinementCase<3>(
+ RefinementPossibilities<3>::Possibilities::cut_xyz));
#endif
else
AssertThrow(false,
- dealii::ExcMessage("Unknown refinement possibility."));
+ ExcMessage("Unknown refinement possibility."));
cell->set_refine_flag(*ref_case);
}
template <int dim, int spacedim>
std::string get_refine_flag(const void *cell_accessor)
{
- const dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const CellAccessor<dim,spacedim> *cell =
+ static_cast<const CellAccessor<dim,spacedim>*>(cell_accessor);
std::string refine_flag;
- dealii::RefinementCase<dim> ref_case = cell->refine_flag_set();
+ RefinementCase<dim> ref_case = cell->refine_flag_set();
switch (static_cast<int>(ref_case))
{
case (0) :
}
default :
{
- AssertThrow(false, dealii::ExcMessage("Internal error."));
+ AssertThrow(false, ExcMessage("Internal error."));
}
}
template <int dim, int spacedim>
void set_coarsen_flag(const bool coarsen_flag, void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ CellAccessor<dim,spacedim> *cell =
+ static_cast<CellAccessor<dim,spacedim>*>(cell_accessor);
if (coarsen_flag == true)
cell->set_coarsen_flag();
else
template <int dim, int spacedim>
bool get_coarsen_flag(const void *cell_accessor)
{
- const dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const CellAccessor<dim,spacedim> *cell =
+ static_cast<const CellAccessor<dim,spacedim>*>(cell_accessor);
return cell->coarsen_flag_set();
}
template <int dim, int spacedim>
PointWrapper get_barycenter(const void *cell_accessor)
{
- const dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
- dealii::Point<spacedim> barycenter = cell->barycenter();
+ const CellAccessor<dim,spacedim> *cell =
+ static_cast<const CellAccessor<dim,spacedim>*>(cell_accessor);
+ Point<spacedim> barycenter = cell->barycenter();
boost::python::list barycenter_list;
for (int i=0; i<dim; ++i)
barycenter_list.append(barycenter[i]);
template <int dim, int spacedim>
void set_material_id(const int material_id, void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ CellAccessor<dim,spacedim> *cell =
+ static_cast<CellAccessor<dim,spacedim>*>(cell_accessor);
cell->set_material_id(material_id);
}
template <int dim, int spacedim>
int get_material_id(const void *cell_accessor)
{
- const dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const CellAccessor<dim,spacedim> *cell =
+ static_cast<const CellAccessor<dim,spacedim>*>(cell_accessor);
return cell->material_id();
}
PointWrapper &point_wrapper,
void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
- dealii::Point<spacedim> *point =
- static_cast<dealii::Point<spacedim>*>(point_wrapper.get_point());
+ CellAccessor<dim,spacedim> *cell =
+ static_cast<CellAccessor<dim,spacedim>*>(cell_accessor);
+ Point<spacedim> *point =
+ static_cast<Point<spacedim>*>(point_wrapper.get_point());
cell->vertex(i) = *point;
}
template <int dim, int spacedim>
PointWrapper get_vertex(const int i, const void *cell_accessor)
{
- const dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
- dealii::Point<spacedim> vertex = cell->vertex(i);
+ const CellAccessor<dim,spacedim> *cell =
+ static_cast<const CellAccessor<dim,spacedim>*>(cell_accessor);
+ Point<spacedim> vertex = cell->vertex(i);
boost::python::list coordinates;
for (int i=0; i<spacedim; ++i)
template <int dim, int spacedim>
void set_manifold_id(const int manifold_id, void *cell_accessor)
{
- dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ CellAccessor<dim,spacedim> *cell =
+ static_cast<CellAccessor<dim,spacedim>*>(cell_accessor);
cell->set_manifold_id(manifold_id);
}
template <int dim, int spacedim>
int get_manifold_id(const void *cell_accessor)
{
- const dealii::CellAccessor<dim,spacedim> *cell =
- static_cast<const dealii::CellAccessor<dim,spacedim>*>(cell_accessor);
+ const CellAccessor<dim,spacedim> *cell =
+ static_cast<const CellAccessor<dim,spacedim>*>(cell_accessor);
cell->manifold_id();
}
}
{
if ((dim == 2) && (spacedim == 2))
{
- dealii::CellAccessor<2,2> *other_cell =
- static_cast<dealii::CellAccessor<2,2>*>(other.cell_accessor);
- cell_accessor = new dealii::CellAccessor<2,2>(*other_cell);
+ CellAccessor<2,2> *other_cell =
+ static_cast<CellAccessor<2,2>*>(other.cell_accessor);
+ cell_accessor = new CellAccessor<2,2>(*other_cell);
}
else if ((dim == 2) && (spacedim == 3))
{
- dealii::CellAccessor<2,3> *other_cell =
- static_cast<dealii::CellAccessor<2,3>*>(other.cell_accessor);
- cell_accessor = new dealii::CellAccessor<2,3>(*other_cell);
+ CellAccessor<2,3> *other_cell =
+ static_cast<CellAccessor<2,3>*>(other.cell_accessor);
+ cell_accessor = new CellAccessor<2,3>(*other_cell);
}
else if ((dim == 3) && (spacedim == 3))
{
- dealii::CellAccessor<3,3> *other_cell =
- static_cast<dealii::CellAccessor<3,3>*>(other.cell_accessor);
- cell_accessor = new dealii::CellAccessor<3,3>(*other_cell);
+ CellAccessor<3,3> *other_cell =
+ static_cast<CellAccessor<3,3>*>(other.cell_accessor);
+ cell_accessor = new CellAccessor<3,3>(*other_cell);
}
else
- AssertThrow(false, dealii::ExcMessage("Wrong dim-spacedim combination."));
+ AssertThrow(false, ExcMessage("Wrong dim-spacedim combination."));
}
spacedim = triangulation_wrapper.get_spacedim();
if ((dim == 2) && (spacedim == 2))
{
- dealii::Triangulation<2,2> *tmp = static_cast<dealii::Triangulation<2,2>*> (
- triangulation_wrapper.get_triangulation());
- cell_accessor = new dealii::CellAccessor<2,2>(tmp ,level, index);
+ Triangulation<2,2> *tmp = static_cast<Triangulation<2,2>*> (
+ triangulation_wrapper.get_triangulation());
+ cell_accessor = new CellAccessor<2,2>(tmp ,level, index);
}
else if ((dim == 2) && (spacedim == 3))
{
- dealii::Triangulation<2,3> *tmp = static_cast<dealii::Triangulation<2,3>*> (
- triangulation_wrapper.get_triangulation());
- cell_accessor = new dealii::CellAccessor<2,3>(tmp, level, index);
+ Triangulation<2,3> *tmp = static_cast<Triangulation<2,3>*> (
+ triangulation_wrapper.get_triangulation());
+ cell_accessor = new CellAccessor<2,3>(tmp, level, index);
}
else if ((dim == 3) && (spacedim == 3))
{
- dealii::Triangulation<3,3> *tmp = static_cast<dealii::Triangulation<3,3>*> (
- triangulation_wrapper.get_triangulation());
- cell_accessor = new dealii::CellAccessor<3,3>(tmp, level, index);
+ Triangulation<3,3> *tmp = static_cast<Triangulation<3,3>*> (
+ triangulation_wrapper.get_triangulation());
+ cell_accessor = new CellAccessor<3,3>(tmp, level, index);
}
else
- AssertThrow(false, dealii::ExcMessage("Wrong dim-spacedim combination."));
+ AssertThrow(false, ExcMessage("Wrong dim-spacedim combination."));
}
{
// We cannot call delete on a void pointer so cast the void pointer back
// first.
- dealii::CellAccessor<2,2> *tmp =
- static_cast<dealii::CellAccessor<2,2>*>(cell_accessor);
+ CellAccessor<2,2> *tmp =
+ static_cast<CellAccessor<2,2>*>(cell_accessor);
delete tmp;
}
else if ((dim == 2) && (spacedim == 3))
{
- dealii::CellAccessor<3,3> *tmp =
- static_cast<dealii::CellAccessor<3,3>*>(cell_accessor);
+ CellAccessor<3,3> *tmp =
+ static_cast<CellAccessor<3,3>*>(cell_accessor);
delete tmp;
}
else
{
- dealii::CellAccessor<3,3> *tmp =
- static_cast<dealii::CellAccessor<3,3>*>(cell_accessor);
+ CellAccessor<3,3> *tmp =
+ static_cast<CellAccessor<3,3>*>(cell_accessor);
delete tmp;
}
void CellAccessorWrapper::set_material_id(const int material_id)
{
- AssertThrow(material_id < dealii::numbers::invalid_material_id,
- dealii::ExcMessage("material_id is too large."));
+ AssertThrow(material_id < numbers::invalid_material_id,
+ ExcMessage("material_id is too large."));
if ((dim == 2) && (spacedim == 2))
return internal::set_material_id<2,2>(material_id, cell_accessor);
else if ((dim == 2) && (spacedim == 3))
internal::get_manifold_id<3,3>(cell_accessor);
}
}
+
+DEAL_II_NAMESPACE_CLOSE
#include <boost/archive/text_iarchive.hpp>
#include <fstream>
-namespace PyDealII
+DEAL_II_NAMESPACE_OPEN
+
+namespace python
{
namespace internal
{
const bool colorize,
void *triangulation)
{
- dealii::Triangulation<dim,spacedim> *tria =
- static_cast<dealii::Triangulation<dim,spacedim>*>(triangulation);
+ Triangulation<dim,spacedim> *tria =
+ static_cast<Triangulation<dim,spacedim>*>(triangulation);
tria->clear();
- dealii::GridGenerator::hyper_cube(*tria, left, right, colorize);
+ GridGenerator::hyper_cube(*tria, left, right, colorize);
}
void *triangulation)
{
// Cast the PointWrapper objects to Point<dim>
- std::vector<dealii::Point<dim>> points(dim+1);
+ std::vector<Point<dim>> points(dim+1);
for (int i=0; i<dim+1; ++i)
- points[i] = *(static_cast<dealii::Point<dim>*>((wrapped_points[i]).get_point()));
+ points[i] = *(static_cast<Point<dim>*>((wrapped_points[i]).get_point()));
- dealii::Triangulation<dim> *tria =
- static_cast<dealii::Triangulation<dim>*>(triangulation);
+ Triangulation<dim> *tria =
+ static_cast<Triangulation<dim>*>(triangulation);
tria->clear();
- dealii::GridGenerator::simplex(*tria, points);
+ GridGenerator::simplex(*tria, points);
}
const double right,
void *triangulation)
{
- dealii::Triangulation<dim,spacedim> *tria =
- static_cast<dealii::Triangulation<dim,spacedim>*>(triangulation);
+ Triangulation<dim,spacedim> *tria =
+ static_cast<Triangulation<dim,spacedim>*>(triangulation);
tria->clear();
- dealii::GridGenerator::subdivided_hyper_cube(*tria, repetitions, left, right);
+ GridGenerator::subdivided_hyper_cube(*tria, repetitions, left, right);
}
void *triangulation)
{
AssertThrow(p1.get_dim() == dim,
- dealii::ExcMessage("Dimension of p1 is not the same as the dimension of the Triangulation."));
+ ExcMessage("Dimension of p1 is not the same as the dimension of the Triangulation."));
AssertThrow(p2.get_dim() == dim,
- dealii::ExcMessage("Dimension of p2 is not the same as the dimension of the Triangulation."));
+ ExcMessage("Dimension of p2 is not the same as the dimension of the Triangulation."));
// Cast the PointWrapper object to Point<dim>
- dealii::Point<dim> point_1 = *(static_cast<dealii::Point<dim>*>(p1.get_point()));
- dealii::Point<dim> point_2 = *(static_cast<dealii::Point<dim>*>(p2.get_point()));
+ Point<dim> point_1 = *(static_cast<Point<dim>*>(p1.get_point()));
+ Point<dim> point_2 = *(static_cast<Point<dim>*>(p2.get_point()));
- dealii::Triangulation<dim,spacedim> *tria =
- static_cast<dealii::Triangulation<dim,spacedim>*>(triangulation);
+ Triangulation<dim,spacedim> *tria =
+ static_cast<Triangulation<dim,spacedim>*>(triangulation);
tria->clear();
- dealii::GridGenerator::hyper_rectangle(*tria, point_1, point_2, colorize);
+ GridGenerator::hyper_rectangle(*tria, point_1, point_2, colorize);
}
void *triangulation)
{
AssertThrow(p1.get_dim() == dim,
- dealii::ExcMessage("Dimension of p1 is not the same as the dimension of the Triangulation."));
+ ExcMessage("Dimension of p1 is not the same as the dimension of the Triangulation."));
AssertThrow(p2.get_dim() == dim,
- dealii::ExcMessage("Dimension of p2 is not the same as the dimension of the Triangulation."));
+ ExcMessage("Dimension of p2 is not the same as the dimension of the Triangulation."));
// Cast the PointWrapper object to Point<dim>
- dealii::Point<dim> point_1 = *(static_cast<dealii::Point<dim>*>(p1.get_point()));
- dealii::Point<dim> point_2 = *(static_cast<dealii::Point<dim>*>(p2.get_point()));
+ Point<dim> point_1 = *(static_cast<Point<dim>*>(p1.get_point()));
+ Point<dim> point_2 = *(static_cast<Point<dim>*>(p2.get_point()));
- dealii::Triangulation<dim,spacedim> *tria =
- static_cast<dealii::Triangulation<dim,spacedim>*>(triangulation);
+ Triangulation<dim,spacedim> *tria =
+ static_cast<Triangulation<dim,spacedim>*>(triangulation);
tria->clear();
- dealii::GridGenerator::subdivided_hyper_rectangle(*tria, repetitions, point_1,
- point_2, colorize);
+ GridGenerator::subdivided_hyper_rectangle(*tria, repetitions, point_1,
+ point_2, colorize);
}
void *triangulation)
{
// Cast the PointWrapper object to Point<dim>
- dealii::Point<dim> center_point = *(static_cast<dealii::Point<dim>*>(
- center.get_point()));
+ Point<dim> center_point = *(static_cast<Point<dim>*>(
+ center.get_point()));
- dealii::Triangulation<dim> *tria =
- static_cast<dealii::Triangulation<dim>*>(triangulation);
+ Triangulation<dim> *tria =
+ static_cast<Triangulation<dim>*>(triangulation);
tria->clear();
- dealii::GridGenerator::hyper_ball(*tria, center_point, radius);
+ GridGenerator::hyper_ball(*tria, center_point, radius);
}
void *triangulation)
{
// Extract the shift vector from the python list
- dealii::Tensor<1,spacedim> shift_vector;
+ Tensor<1,spacedim> shift_vector;
for (int i=0; i<spacedim; ++i)
shift_vector[i] = boost::python::extract<double>(shift_list[i]);
- dealii::Triangulation<dim,spacedim> *tria =
- static_cast<dealii::Triangulation<dim,spacedim>*>(triangulation);
- dealii::GridTools::shift(shift_vector, *tria);
+ Triangulation<dim,spacedim> *tria =
+ static_cast<Triangulation<dim,spacedim>*>(triangulation);
+ GridTools::shift(shift_vector, *tria);
}
TriangulationWrapper &triangulation_2,
void *triangulation)
{
- dealii::Triangulation<dim,spacedim> *tria =
- static_cast<dealii::Triangulation<dim,spacedim>*>(triangulation);
+ Triangulation<dim,spacedim> *tria =
+ static_cast<Triangulation<dim,spacedim>*>(triangulation);
tria->clear();
- dealii::Triangulation<dim,spacedim> *tria_1 =
- static_cast<dealii::Triangulation<dim,spacedim>*>(triangulation_1.get_triangulation());
- dealii::Triangulation<dim,spacedim> *tria_2 =
- static_cast<dealii::Triangulation<dim,spacedim>*>(triangulation_2.get_triangulation());
- dealii::GridGenerator::merge_triangulations(*tria_1, *tria_2, *tria);
+ Triangulation<dim,spacedim> *tria_1 =
+ static_cast<Triangulation<dim,spacedim>*>(triangulation_1.get_triangulation());
+ Triangulation<dim,spacedim> *tria_2 =
+ static_cast<Triangulation<dim,spacedim>*>(triangulation_2.get_triangulation());
+ GridGenerator::merge_triangulations(*tria_1, *tria_2, *tria);
// We need to reassign tria to triangulation because tria was cleared
// inside merge_triangulations.
triangulation = tria;
template <int dim, int spacedim>
boost::python::list active_cells(TriangulationWrapper &triangulation_wrapper)
{
- dealii::Triangulation<dim,spacedim> *tria =
- static_cast<dealii::Triangulation<dim,spacedim>*>(
+ Triangulation<dim,spacedim> *tria =
+ static_cast<Triangulation<dim,spacedim>*>(
triangulation_wrapper.get_triangulation());
boost::python::list cells;
for (auto cell : tria->active_cell_iterators())
const std::string &format,
const void *triangulation)
{
- const dealii::Triangulation<dim,spacedim> *tria =
- static_cast<const dealii::Triangulation<dim,spacedim>*>(triangulation);
+ const Triangulation<dim,spacedim> *tria =
+ static_cast<const Triangulation<dim,spacedim>*>(triangulation);
- dealii::GridOut::OutputFormat output_format;
+ GridOut::OutputFormat output_format;
if (format.compare("dx") == 0)
- output_format = dealii::GridOut::OutputFormat::dx;
+ output_format = GridOut::OutputFormat::dx;
else if (format.compare("gnuplot") == 0)
- output_format = dealii::GridOut::OutputFormat::gnuplot;
+ output_format = GridOut::OutputFormat::gnuplot;
else if (format.compare("eps") == 0)
- output_format = dealii::GridOut::OutputFormat::eps;
+ output_format = GridOut::OutputFormat::eps;
else if (format.compare("ucd") == 0)
- output_format = dealii::GridOut::OutputFormat::ucd;
+ output_format = GridOut::OutputFormat::ucd;
else if (format.compare("xfig") == 0)
- output_format = dealii::GridOut::OutputFormat::xfig;
+ output_format = GridOut::OutputFormat::xfig;
else if (format.compare("msh") == 0)
- output_format = dealii::GridOut::OutputFormat::msh;
+ output_format = GridOut::OutputFormat::msh;
else if (format.compare("svg") == 0)
- output_format = dealii::GridOut::OutputFormat::svg;
+ output_format = GridOut::OutputFormat::svg;
else if (format.compare("mathgl") == 0)
- output_format = dealii::GridOut::OutputFormat::mathgl;
+ output_format = GridOut::OutputFormat::mathgl;
else if (format.compare("vtk") == 0)
- output_format = dealii::GridOut::OutputFormat::vtk;
+ output_format = GridOut::OutputFormat::vtk;
else if (format.compare("vtu") == 0)
- output_format = dealii::GridOut::OutputFormat::vtu;
+ output_format = GridOut::OutputFormat::vtu;
else
- output_format = dealii::GridOut::OutputFormat::none;
+ output_format = GridOut::OutputFormat::none;
- dealii::GridOut mesh_writer;
+ GridOut mesh_writer;
std::ofstream ofs(filename);
mesh_writer.write(*tria, ofs, output_format);
ofs.close();
else if ((dimension.compare("3D")==0) || (dimension.compare("3d")==0))
setup("3D", "3D");
else
- AssertThrow(false, dealii::ExcMessage("Dimension needs to be 2D or 3D"));
+ AssertThrow(false, ExcMessage("Dimension needs to be 2D or 3D"));
}
{
// We cannot call delete on a void pointer so cast the void pointer back
// first.
- dealii::Triangulation<2,2> *tmp =
- static_cast<dealii::Triangulation<2,2>*>(triangulation);
+ Triangulation<2,2> *tmp =
+ static_cast<Triangulation<2,2>*>(triangulation);
delete tmp;
}
else
{
- dealii::Triangulation<2,3> *tmp =
- static_cast<dealii::Triangulation<2,3>*>(triangulation);
+ Triangulation<2,3> *tmp =
+ static_cast<Triangulation<2,3>*>(triangulation);
delete tmp;
}
}
else
{
- dealii::Triangulation<3,3> *tmp = static_cast<dealii::Triangulation<3,3>*>(triangulation);
+ Triangulation<3,3> *tmp = static_cast<Triangulation<3,3>*>(triangulation);
delete tmp;
}
triangulation = nullptr;
unsigned int TriangulationWrapper::n_active_cells() const
{
if ((dim == 2) && (spacedim == 2))
- return (*static_cast<dealii::Triangulation<2,2>*>(triangulation)).n_active_cells();
+ return (*static_cast<Triangulation<2,2>*>(triangulation)).n_active_cells();
else if ((dim == 2) && (spacedim == 3))
- return (*static_cast<dealii::Triangulation<2,3>*>(triangulation)).n_active_cells();
+ return (*static_cast<Triangulation<2,3>*>(triangulation)).n_active_cells();
else
- return (*static_cast<dealii::Triangulation<3,3>*>(triangulation)).n_active_cells();
+ return (*static_cast<Triangulation<3,3>*>(triangulation)).n_active_cells();
}
void TriangulationWrapper::generate_simplex(boost::python::list &vertices)
{
AssertThrow(boost::python::len(vertices) == dim+1,
- dealii::ExcMessage("The number of vertices should be equal to dim+1."));
+ ExcMessage("The number of vertices should be equal to dim+1."));
AssertThrow(dim == spacedim,
- dealii::ExcMessage("This function is only implemented for dim equal to spacedim."));
+ ExcMessage("This function is only implemented for dim equal to spacedim."));
// Extract the PointWrapper object from the python list
std::vector<PointWrapper> wrapped_points(dim+1);
for (int i=0; i<dim+1; ++i)
{
wrapped_points[i] = boost::python::extract<PointWrapper>(vertices[i]);
AssertThrow(wrapped_points[i].get_dim() == dim,
- dealii::ExcMessage("Point of wrong dimension."));
+ ExcMessage("Point of wrong dimension."));
}
if (dim == 2)
const bool colorize)
{
AssertThrow(boost::python::len(repetition_list) == dim,
- dealii::ExcMessage("The list of repetitions must have the same length as the number of dimension."));
+ ExcMessage("The list of repetitions must have the same length as the number of dimension."));
// Extract the repetitions from the python list
std::vector<unsigned int> repetitions(dim);
const double radius)
{
AssertThrow(dim == spacedim,
- dealii::ExcMessage("This function is only implemented for dim equal to spacedim."));
+ ExcMessage("This function is only implemented for dim equal to spacedim."));
if (dim == 2)
internal::generate_hyper_ball<2>(center, radius, triangulation);
else
void TriangulationWrapper::shift(boost::python::list &shift_list)
{
AssertThrow(boost::python::len(shift_list) == spacedim,
- dealii::ExcMessage("Size of the shift vector is not equal to spacedim."));
+ ExcMessage("Size of the shift vector is not equal to spacedim."));
if ((dim == 2) && (spacedim == 2))
internal::shift<2,2>(shift_list, triangulation);
else if ((dim ==2) && (spacedim == 3))
TriangulationWrapper &triangulation_2)
{
AssertThrow(triangulation_1.get_dim() == triangulation_2.get_dim(),
- dealii::ExcMessage("Triangulation_1 and Triangulation_2 should have the same dimension."));
+ ExcMessage("Triangulation_1 and Triangulation_2 should have the same dimension."));
AssertThrow(dim == triangulation_2.get_dim(),
- dealii::ExcMessage("Triangulation and Triangulation_2 should have the same dimension."));
+ ExcMessage("Triangulation and Triangulation_2 should have the same dimension."));
AssertThrow(triangulation_1.get_spacedim() == triangulation_2.get_spacedim(),
- dealii::ExcMessage("Triangulation_1 and Triangulation_2 should have the same space dimension."));
+ ExcMessage("Triangulation_1 and Triangulation_2 should have the same space dimension."));
AssertThrow(spacedim == triangulation_2.get_spacedim(),
- dealii::ExcMessage("Triangulation and Triangulation_2 should have the same space dimension."));
+ ExcMessage("Triangulation and Triangulation_2 should have the same space dimension."));
if ((triangulation_1.get_dim() == 2) && (triangulation_1.get_spacedim() == 2))
internal::merge_triangulations<2,2>(triangulation_1, triangulation_2, triangulation);
{
if ((dim == 2) && (spacedim == 2))
{
- dealii::Triangulation<2,2> *tria =
- static_cast<dealii::Triangulation<2,2>*>(triangulation);
+ Triangulation<2,2> *tria =
+ static_cast<Triangulation<2,2>*>(triangulation);
tria->refine_global(n);
}
else if ((dim == 2) && (spacedim == 3))
{
- dealii::Triangulation<2,3> *tria =
- static_cast<dealii::Triangulation<2,3>*>(triangulation);
+ Triangulation<2,3> *tria =
+ static_cast<Triangulation<2,3>*>(triangulation);
tria->refine_global(n);
}
else
{
- dealii::Triangulation<3,3> *tria =
- static_cast<dealii::Triangulation<3,3>*>(triangulation);
+ Triangulation<3,3> *tria =
+ static_cast<Triangulation<3,3>*>(triangulation);
tria->refine_global(n);
}
}
{
if ((dim == 2) && (spacedim == 2))
{
- dealii::Triangulation<2,2> *tria =
- static_cast<dealii::Triangulation<2,2>*>(triangulation);
+ Triangulation<2,2> *tria =
+ static_cast<Triangulation<2,2>*>(triangulation);
tria->execute_coarsening_and_refinement();
}
else if ((dim == 2) && (spacedim == 3))
{
- dealii::Triangulation<2,3> *tria =
- static_cast<dealii::Triangulation<2,3>*>(triangulation);
+ Triangulation<2,3> *tria =
+ static_cast<Triangulation<2,3>*>(triangulation);
tria->execute_coarsening_and_refinement();
}
else
{
- dealii::Triangulation<3,3> *tria =
- static_cast<dealii::Triangulation<3,3>*>(triangulation);
+ Triangulation<3,3> *tria =
+ static_cast<Triangulation<3,3>*>(triangulation);
tria->execute_coarsening_and_refinement();
}
}
if ((dim == 2) && (spacedim == 2))
{
- dealii::Triangulation<2,2> *tria =
- static_cast<dealii::Triangulation<2,2>*>(triangulation);
+ Triangulation<2,2> *tria =
+ static_cast<Triangulation<2,2>*>(triangulation);
oa << *tria;
}
else if ((dim == 2) && (spacedim == 3))
{
{
- dealii::Triangulation<2,3> *tria =
- static_cast<dealii::Triangulation<2,3>*>(triangulation);
+ Triangulation<2,3> *tria =
+ static_cast<Triangulation<2,3>*>(triangulation);
oa << *tria;
}
}
else
{
- dealii::Triangulation<3,3> *tria =
- static_cast<dealii::Triangulation<3,3>*>(triangulation);
+ Triangulation<3,3> *tria =
+ static_cast<Triangulation<3,3>*>(triangulation);
oa << *tria;
}
if ((dim == 2) && (spacedim == 2))
{
- dealii::Triangulation<2,2> *tria =
- static_cast<dealii::Triangulation<2,2>*>(triangulation);
+ Triangulation<2,2> *tria =
+ static_cast<Triangulation<2,2>*>(triangulation);
ia >> *tria;
}
else if ((dim == 2) && (spacedim == 3))
{
- dealii::Triangulation<2,3> *tria =
- static_cast<dealii::Triangulation<2,3>*>(triangulation);
+ Triangulation<2,3> *tria =
+ static_cast<Triangulation<2,3>*>(triangulation);
ia >> *tria;
}
else
{
- dealii::Triangulation<3> *tria =
- static_cast<dealii::Triangulation<3,3>*>(triangulation);
+ Triangulation<3> *tria =
+ static_cast<Triangulation<3,3>*>(triangulation);
ia >> *tria;
}
(spacedimension.compare("2d") == 0))
{
spacedim = 2;
- triangulation = new dealii::Triangulation<2,2>();
+ triangulation = new Triangulation<2,2>();
}
else if ((spacedimension.compare("3D") == 0) ||
(spacedimension.compare("3d") == 0))
{
spacedim = 3;
- triangulation = new dealii::Triangulation<2,3>();
+ triangulation = new Triangulation<2,3>();
}
else
- AssertThrow(false, dealii::ExcMessage("Spacedimension needs to be 2D or 3D."));
+ AssertThrow(false, ExcMessage("Spacedimension needs to be 2D or 3D."));
}
else if ((dimension.compare("3D") == 0) || (dimension.compare("3d") == 0))
{
if ((spacedimension.compare("3D") != 0) &&
(spacedimension.compare("3d") != 0))
- AssertThrow(false, dealii::ExcMessage("Spacedimension needs to be 3D."));
+ AssertThrow(false, ExcMessage("Spacedimension needs to be 3D."));
dim = 3;
spacedim = 3;
- triangulation = new dealii::Triangulation<3,3>();
+ triangulation = new Triangulation<3,3>();
}
else
- AssertThrow(false, dealii::ExcMessage("Dimension needs to be 2D or 3D."));
+ AssertThrow(false, ExcMessage("Dimension needs to be 2D or 3D."));
}
}
+
+DEAL_II_NAMESPACE_CLOSE