#include <grid/tria_boundary.h>
-class PointDefinedSurface : public StraightBoundary<3>
+class PointCloudSurface : public StraightBoundary<3>
{
public:
- PointDefinedSurface (const std::string &filename);
-
- Point<3> closest_point (const Point<3> &p) const;
+ /**
+ * Constructor.
+ */
+ PointCloudSurface (const std::string &filename);
/**
* Let the new point be the
virtual void
get_intermediate_points_on_quad (const Triangulation<3>::quad_iterator &quad,
std::vector<Point<3> > &points) const;
+
+ /**
+ * A function that, given a point @p p,
+ * returns the closest point on the
+ * surface defined by the input file. For
+ * the time being, we simply return the
+ * closest point in the point cloud,
+ * rather than doing any sort of
+ * interpolation.
+ */
+ Point<3> closest_point (const Point<3> &p) const;
private:
std::vector<Point<3> > point_list;
};
-PointDefinedSurface::PointDefinedSurface (const std::string &filename)
+PointCloudSurface::PointCloudSurface (const std::string &filename)
{
// first read in all the points
{
Point<3>
-PointDefinedSurface::closest_point (const Point<3> &p) const
+PointCloudSurface::closest_point (const Point<3> &p) const
{
double distance = p.distance (point_list[0]);
Point<3> point = point_list[0];
Point<3>
-PointDefinedSurface::
+PointCloudSurface::
get_new_point_on_line (const Triangulation<3>::line_iterator &line) const
{
return closest_point (StraightBoundary<3>::get_new_point_on_line (line));
Point<3>
-PointDefinedSurface::
+PointCloudSurface::
get_new_point_on_quad (const Triangulation<3>::quad_iterator &quad) const
{
return closest_point (StraightBoundary<3>::get_new_point_on_quad (quad));
void
-PointDefinedSurface::
+PointCloudSurface::
get_intermediate_points_on_line (const Triangulation<3>::line_iterator &line,
std::vector<Point<3> > &points) const
{
void
-PointDefinedSurface::
+PointCloudSurface::
get_intermediate_points_on_quad (const Triangulation<3>::quad_iterator &quad,
std::vector<Point<3> > &points) const
{
-PointDefinedSurface pds("surface-points");
+PointCloudSurface pds("surface-points");
triangulation.begin()->vertex(v)[1],
0));
- for (unsigned int i=0; i<7; ++i)
+ for (unsigned int i=0; i<4; ++i)
{
for (typename Triangulation<dim>::active_cell_iterator
cell = triangulation.begin_active();
template <int dim>
void LaplaceProblem<dim>::solve ()
{
- SolverControl solver_control (1000, 1e-12);
+ // NEW
+ SolverControl solver_control (dof_handler.n_dofs(),
+ 1e-12*system_rhs.l2_norm());
SolverCG<> cg (solver_control);
PreconditionSSOR<> preconditioner;