ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = boundary_values;
- assemble (equation, *quadrature, *fe, update_flags, dirichlet_bc);
+ assemble (equation, *quadrature, update_flags, dirichlet_bc);
cout << " Solving..." << endl;
solve ();
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = solution_function;
- assemble (*equation, quadrature, fe, update_flags, dirichlet_bc);
+ assemble (*equation, quadrature, update_flags, dirichlet_bc);
// if we have an old solution lying
// around, use it to preset the solution
cout << " Estimating H1 error... ";
KellyErrorEstimator<dim> ee;
QSimpson<dim-1> eq;
- ee.estimate_error (*dof, eq, fe, *boundary,
+ ee.estimate_error (*dof, eq,
KellyErrorEstimator<dim>::FunctionMap(),
solution,
estimated_error_per_cell,
*/
virtual void assemble (const Equation<dim> &equation,
const Quadrature<dim> &q,
- const FiniteElement<dim> &fe,
const UpdateFlags update_flags,
- const FunctionMap &dirichlet_bc = FunctionMap(),
- const Boundary<dim> &boundary = StraightBoundary<dim>());
+ const FunctionMap &dirichlet_bc = FunctionMap());
int run (unsigned int level);
void print_history (string filename) const;
template <int dim>
void PoissonProblem<dim>::assemble (const Equation<dim> &equation,
const Quadrature<dim> &quadrature,
- const FiniteElement<dim> &fe,
const UpdateFlags update_flags,
- const FunctionMap &dirichlet_bc,
- const Boundary<dim> &boundary) {
+ const FunctionMap &dirichlet_bc) {
Assert ((tria!=0) && (dof!=0), ExcNoTriaSelected());
system_sparsity.reinit (dof->DoFHandler<dim>::n_dofs(),
system_matrix,
right_hand_side,
quadrature,
- fe,
- update_flags,
- boundary);
+ update_flags);
active_assemble_iterator assembler (tria,
tria->begin_active()->level(),
tria->begin_active()->index(),
// apply Dirichlet bc as described
// in the docs
map<int, double> boundary_value_list;
- VectorTools<dim>::interpolate_boundary_values (*dof, dirichlet_bc, boundary,
+ VectorTools<dim>::interpolate_boundary_values (*dof, dirichlet_bc,
boundary_value_list);
MatrixTools<dim>::apply_boundary_values (boundary_value_list,
system_matrix, solution,
map<unsigned char,const Function<dim>*> dirichlet_bc;
dirichlet_bc[0] = boundary_values;
- assemble (equation, *quadrature, *fe, update_flags, dirichlet_bc);
+ assemble (equation, *quadrature, update_flags, dirichlet_bc);
cout << " Solving..." << endl;
solve ();
assemble (equation, quadrature, fe,
UpdateFlags(update_gradients | update_JxW_values |
update_q_points),
- dirichlet_bc, boundary);
+ dirichlet_bc);
cout << " Solving..." << endl;
solve ();
Vector<float> error_indicator;
KellyErrorEstimator<dim> ee;
QSimpson<dim-1> eq;
- ee.estimate_error (*dof, eq, fe, boundary,
+ ee.estimate_error (*dof, eq, fe,
KellyErrorEstimator<dim>::FunctionMap(),
solution,
error_indicator);
cout << " Assembling matrices..." << endl;
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = boundary_values;
- assemble (equation, quadrature, fe,
+ assemble (equation, quadrature,
UpdateFlags(update_gradients | update_JxW_values |
update_q_points),
- dirichlet_bc, *boundary);
+ dirichlet_bc);
cout << " Solving..." << endl;
solve ();
* This function is more or less an
* interface to the #FEValues# class and
* should not be used by users unless
- * absolutely needed. */
+ * absolutely needed.
+ */
virtual void fill_fe_values (const DoFHandler<dim>::cell_iterator &cell,
const vector<Point<dim> > &unit_points,
vector<Tensor<2,dim> > &jacobians,
vector<Point<dim> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_grads_transform,
- const Boundary<dim> &boundary) const;
+ const vector<vector<Tensor<1,dim> > > &shape_grads_transform) const;
/**
* Do the same thing that the other
vector<Point<dim> > &normal_vectors,
const bool compute_normal_vectors,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_grads_transform,
- const Boundary<dim> &boundary) const;
+ const vector<vector<Tensor<1,dim> > > &shape_grads_transform) const;
/**
* This function does almost the same as
vector<Point<dim> > &normal_vectors,
const bool compute_normal_vectors,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_grads_transform,
- const Boundary<dim> &boundary) const;
+ const vector<vector<Tensor<1,dim> > > &shape_grads_transform) const;
/**
* Return the support points of the
* equidistant off-points on the unit
* line. For all other dimensions, an
* overwritten function has to be provided.
+ *
+ * For higher order transformations than
+ * the common (bi-, tri-)linear one,
+ * information about the boundary is
+ * needed, rather than only the readily
+ * available information on the location
+ * of the vertices. If necessary, we
+ * therefore rely on the boundary object
+ * of which a pointer is stored by the
+ * triangulation.
*/
virtual void get_support_points (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* dimension would be senseless, all
* derived classes should throw an error
* when called with #dim==1#.
+ *
+ * Regarding information about the
+ * boundary, which is necessary for
+ * higher order transformations than
+ * the usual (bi-, tri-)linear ones,
+ * refer to the #get_support_points#
+ * function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const =0;
/**
* dimension would be senseless, all
* derived classes should throw an error
* when called with #dim==1#.
+ *
+ * Regarding information about the
+ * boundary, which is necessary for
+ * higher order transformations than
+ * the usual (bi-, tri-)linear ones,
+ * refer to the #get_support_points#
+ * function.
*/
virtual void get_face_jacobians (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<double> &face_jacobi_determinants) const =0;
* dimension would be senseless, all
* derived classes should throw an error
* when called with #dim==1#.
+ *
+ * Regarding information about the
+ * boundary, which is necessary for
+ * higher order transformations than
+ * the usual (bi-, tri-)linear ones,
+ * refer to the #get_support_points#
+ * function.
*/
virtual void get_normal_vectors (const DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<Point<dim> > &normal_vectors) const =0;
* classes not implementing this function
* are assumed to state this in their
* documentation.
+ *
+ * Regarding information about the
+ * boundary, which is necessary for
+ * higher order transformations than
+ * the usual (bi-, tri-)linear ones,
+ * refer to the #get_support_points#
+ * function.
*/
virtual void get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
FullMatrix<double> &local_mass_matrix) const =0;
/**
* information on this function.
*/
virtual void get_support_points (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
FullMatrix<double> &local_mass_matrix) const;
/**
* simply returns the length of the face.
*/
virtual void get_face_jacobians (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<double> &face_jacobi_determinants) const;
*/
virtual void get_normal_vectors (const DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<Point<dim> > &normal_vectors) const;
* function simply passes through to
* the one implemented in the base class.
* For higher dimensional finite elements
- * we use linear mappings and therefore
- * the boundary object is ignored since
- * the boundary is approximated using
- * piecewise multilinear boundary segments.
+ * we use multilinear mappings.
*/
virtual void fill_fe_values (const DoFHandler<dim>::cell_iterator &cell,
const vector<Point<dim> > &unit_points,
vector<Point<dim> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_grad_transform,
- const Boundary<dim> &boundary) const;
+ const vector<vector<Tensor<1,dim> > > &shape_grad_transform) const;
DeclException0 (ExcNotUseful);
};
* information on this function.
*/
virtual void get_support_points (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
FullMatrix<double> &local_mass_matrix) const;
/**
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_support_points (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
- vector<Point<dim> > &support_points) const;
+ vector<Point<dim> > &support_points) const;
/**
* Refer to the base class for detailed
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
- vector<Point<dim> > &support_points) const;
+ vector<Point<dim> > &support_points) const;
/**
* Refer to the base class for detailed
* is thrown instead.
*/
virtual void get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
FullMatrix<double> &local_mass_matrix) const;
private:
* information on this function.
*/
virtual void get_support_points (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
- vector<Point<dim> > &support_points) const;
+ vector<Point<dim> > &support_points) const;
/**
* Refer to the base class for detailed
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
- vector<Point<dim> > &support_points) const;
+ vector<Point<dim> > &support_points) const;
/**
* Refer to the base class for detailed
* is thrown instead.
*/
virtual void get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
FullMatrix<double> &local_mass_matrix) const;
private:
* information on this function.
*/
virtual void get_support_points (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
- vector<Point<dim> > &support_points) const;
+ vector<Point<dim> > &support_points) const;
/**
* Refer to the base class for detailed
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
- vector<Point<dim> > &support_points) const;
+ vector<Point<dim> > &support_points) const;
/**
* Refer to the base class for detailed
* is thrown instead.
*/
virtual void get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
FullMatrix<double> &local_mass_matrix) const;
private:
* information on this function.
*/
virtual void get_support_points (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
- vector<Point<dim> > &support_points) const;
+ vector<Point<dim> > &support_points) const;
/**
* Refer to the base class for detailed
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
- vector<Point<dim> > &support_points) const;
+ vector<Point<dim> > &support_points) const;
/**
* Refer to the base class for detailed
* is thrown instead.
*/
virtual void get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
FullMatrix<double> &local_mass_matrix) const;
private:
* simply returns the length of the face.
*/
virtual void get_face_jacobians (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<double> &face_jacobi_determinants) const;
*/
virtual void get_normal_vectors (const DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<Point<dim> > &normal_vectors) const;
* function simply passes through to
* the one implemented in the base class.
* For higher dimensional finite elements
- * we use linear mappings and therefore
- * the boundary object is ignored since
- * the boundary is approximated using
- * piecewise multilinear boundary segments.
+ * we use multilinear mappings.
*/
virtual void fill_fe_values (const DoFHandler<dim>::cell_iterator &cell,
const vector<Point<dim> > &unit_points,
vector<Point<dim> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_grad_transform,
- const Boundary<dim> &boundary) const;
+ const vector<vector<Tensor<1,dim> > > &shape_grad_transform) const;
/**
* Compute the jacobian matrices
* refer to the #shape_value# function.
*/
virtual void get_support_points (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_face_support_points (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
vector<Point<dim> > &support_points) const;
/**
* information on this function.
*/
virtual void get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary,
FullMatrix<double> &local_mass_matrix) const;
/**
* underlying object.
*/
virtual void get_face_jacobians (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<double> &face_jacobi_determinants) const;
*/
virtual void get_normal_vectors (const DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<Point<dim> > &normal_vectors) const;
vector<Point<dim> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_grad_transform,
- const Boundary<dim> &boundary) const;
+ const vector<vector<Tensor<1,dim> > > &shape_grad_transform) const;
/**
* Number of different base
#include <base/subscriptor.h>
#include <lac/fullmatrix.h>
#include <grid/dof.h>
+#include <grid/tria_boundary.h>
#include <base/point.h>
#include <grid/tria.h>
#include <fe/fe_update_flags.h>
const unsigned int n_transform_functions,
const unsigned int n_values_array,
const UpdateFlags update_flags,
- const FiniteElement<dim> &fe);
+ const FiniteElement<dim> &fe,
+ const Boundary<dim> &boundary);
/**
/**
* Store the finite element for later use.
*/
- SmartPointer<const FiniteElement<dim> > fe;
+ const SmartPointer<const FiniteElement<dim> > fe;
+
+ /**
+ * Store the boundary for later use.
+ */
+ const SmartPointer<const Boundary<dim> > boundary;
};
* gradients, true quadrature points, etc.)
* need to be initialized using the
* #reinit# function.
- */
- FEValues (const FiniteElement<dim> &,
- const Quadrature<dim> &,
- const UpdateFlags);
-
- /**
- * Reinitialize the gradients, Jacobi
- * determinants, etc for the given cell
- * and the given finite element.
*
* This function needs a boundary object
* passed, since this class needs to know
* segments, but higher order elements
* may use other ways.)
*/
- void reinit (const typename DoFHandler<dim>::cell_iterator &,
- const Boundary<dim> &);
+ FEValues (const FiniteElement<dim> &fe,
+ const Quadrature<dim> &quadrature,
+ const UpdateFlags update_flags,
+ const Boundary<dim> &boundary);
+
+ /**
+ * Reinitialize the gradients, Jacobi
+ * determinants, etc for the given cell
+ * and the given finite element.
+ */
+ void reinit (const typename DoFHandler<dim>::cell_iterator &);
private:
/**
const unsigned int n_transform_functions,
const unsigned int n_faces_or_subfaces,
const UpdateFlags update_flags,
- const FiniteElement<dim> &fe);
+ const FiniteElement<dim> &fe,
+ const Boundary<dim> &boundary);
/**
* Return the outward normal vector to
* gradients, true quadrature points, etc.)
* need to be initialized using the
* #reinit# function.
- */
- FEFaceValues (const FiniteElement<dim> &,
- const Quadrature<dim-1> &,
- const UpdateFlags);
-
- /**
- * Reinitialize the gradients, Jacobi
- * determinants, etc for the face with
- * number #face_no# of #cell#
- * and the given finite element.
*
- * The constructor needs a boundary object
+ * This function needs a boundary object
* passed, since this class needs to know
* how to handle faces which are located
* on the boundary of the domain. In that
* segments, but higher order elements
* may use other ways.)
*/
+ FEFaceValues (const FiniteElement<dim> &,
+ const Quadrature<dim-1> &,
+ const UpdateFlags,
+ const Boundary<dim> &);
+
+ /**
+ * Reinitialize the gradients, Jacobi
+ * determinants, etc for the face with
+ * number #face_no# of #cell#
+ * and the given finite element.
+ */
void reinit (const typename DoFHandler<dim>::cell_iterator &cell,
- const unsigned int face_no,
- const Boundary<dim> &boundary);
+ const unsigned int face_no);
};
* need to be initialized using the
* #reinit# function.
*/
- FESubfaceValues (const FiniteElement<dim> &,
- const Quadrature<dim-1> &,
- const UpdateFlags);
+ FESubfaceValues (const FiniteElement<dim> &fe,
+ const Quadrature<dim-1> &face_quadrature,
+ const UpdateFlags update_flags,
+ const Boundary<dim> &boundary);
/**
* Reinitialize the gradients, Jacobi
* determinants, etc for the face with
* number #face_no# of #cell#
* and the given finite element.
- *
- * The constructor needs a boundary object
- * passed, since this class needs to know
- * how to handle faces which are located
- * on the boundary of the domain. In that
- * case, faces may be curved and the
- * calculation of quadrature points,
- * gradients and the like may need
- * additional effort, depending on the
- * mapping from the unit to the real cell
- * (linear mappings use straight boundary
- * segments, but higher order elements
- * may use other ways.)
*/
void reinit (const typename DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
- const unsigned int subface_no,
- const Boundary<dim> &boundary);
+ const unsigned int subface_no);
/**
* Exception
*/
void set_boundary (const Boundary<dim> *boundary_object);
+ /**
+ * Return a constant reference to the boundary
+ * object used for this triangulation. This
+ * is necessary for a host of applications
+ * that need to use the exact shape of the
+ * boundary. Since the boundary used by all
+ * these applications, it is useful to ask
+ * the triangulation rather than asking
+ * for another parameter for each of these
+ * functions.
+ *
+ * If you need to store a pointer to the
+ * boundary somewhere, for example
+ * in the constructor of an object, for
+ * later use in the member functions,
+ * you should consider calling #subscribe#
+ * on the boundary to guarantee that the
+ * boundary object is still alive during
+ * the lifetime of your object.
+ */
+ const Boundary<dim> & get_boundary () const;
+
/**
* Copy a triangulation. This operation is
* not cheap, so you should be careful
SparseMatrix<double> &matrix,
Vector<double> &rhs_vector,
const Quadrature<dim> &quadrature,
- const FiniteElement<dim> &fe,
- const UpdateFlags &update_flags,
- const Boundary<dim> &boundary);
+ const UpdateFlags &update_flags);
/**
* Pointer to the dof handler object
*/
const Quadrature<dim> &quadrature;
- /**
- * Use this FE type for the assemblage
- * process. The FE object must match that
- * used to construct the #DoFHandler#
- * object.
- */
- const FiniteElement<dim> &fe;
-
/**
* Store which of the fields of the
* FEValues object need to be reinitialized
* on each cell.
*/
const UpdateFlags update_flags;
-
- /**
- * Store a pointer to the object describing
- * the boundary of the domain. This is
- * necessary, since we may want to use
- * curved faces of cells at the boundary
- * when using higher order elements.
- */
- const Boundary<dim> &boundary;
};
*/
Vector<double> &rhs_vector;
- /**
- * Pointer to the finite element used for
- * the assemblage process. We store a
- * pointer to the finite element, not a
- * copy, but this is not a problem, since
- * #Assembler# objects are usually created
- * and deleted by the
- * #ProblemBase::assemble# routine, which
- * itself gets passed the finite element;
- * the lifetime of the #Assembler# object
- * is thus less than the lifetime of the
- * finite element object and storing
- * a pointer is not risky.
- */
- const FiniteElement<dim> &fe;
-
/**
* The finite element evaluated at the
* quadrature points.
*/
FEValues<dim> fe_values;
-
- /**
- * Store a pointer to the object describing
- * the boundary of the domain. This is
- * necessary, since we may want to use
- * curved faces of cells at the boundary
- * when using higher order elements.
- */
- const Boundary<dim> &boundary;
};
*/
virtual void assemble (const Equation<dim> &equation,
const Quadrature<dim> &q,
- const FiniteElement<dim> &fe,
const UpdateFlags update_flags,
- const FunctionMap &dirichlet_bc = FunctionMap(),
- const Boundary<dim> &boundary = StraightBoundary<dim>());
+ const FunctionMap &dirichlet_bc = FunctionMap());
/**
* Solve the system of equations. This uses
*
* \item No other boundary conditions are considered.
* \end{itemize}
+ * The object describing the boundary conditions is obtained from the
+ * triangulation.
*
* Thanks go to Franz-Theo Suttmeier for clarifications about boundary
* conditions.
*/
static void estimate_error (const DoFHandler<dim> &dof,
const Quadrature<dim-1> &quadrature,
- const FiniteElement<dim> &fe,
- const Boundary<dim> &boundary,
const FunctionMap &neumann_bc,
const Vector<double> &solution,
Vector<float> &error,
*/
static void integrate_over_regular_face (const active_cell_iterator &cell,
const unsigned int face_no,
- const FiniteElement<dim> &fe,
- const Boundary<dim> &boundary,
const FunctionMap &neumann_bc,
const unsigned int n_q_points,
FEFaceValues<dim> &fe_face_values_cell,
*/
static void integrate_over_irregular_face (const active_cell_iterator &cell,
const unsigned int face_no,
- const FiniteElement<dim> &fe,
- const Boundary<dim> &boundary,
const unsigned int n_q_points,
FEFaceValues<dim> &fe_face_values,
FESubfaceValues<dim> &fe_subface_values,
* pattern, which can be created using the
* #DoFHandler<>::make_boundary_sparsity_pattern# function.
*
+ * The object describing the exact form of the boundary is obtained from the
+ * triangulation object.
*
* \subsection{Right hand sides}
*
*/
static void create_mass_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const Function<dim> *a = 0);
*/
static void create_mass_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const Function<dim> &rhs,
Vector<double> &rhs_vector,
* for more information.
*/
static void create_mass_matrix (const DoFHandler<dim> &dof,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix);
/**
*/
static void create_boundary_mass_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim-1> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const FunctionMap &rhs,
Vector<double> &rhs_vector,
*/
static void create_laplace_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const Function<dim> *a = 0);
*/
static void create_laplace_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const Function<dim> &rhs,
Vector<double> &rhs_vector,
* the projection.
*
* In order to get proper results, it may necessary to treat boundary
- * conditions right. Below are listed some cases wher this may be needed.
+ * conditions right. Below are listed some cases where this may be needed.
* If needed, this is done by $L_2$-projection of the trace of the
* given function onto the finite element space restricted to the boundary
* of the domain, then taking this information and using it to eliminate
* \end{itemize}
*
* All functions use the finite element given to the #DoFHandler# object the last
- * time that the degrees of freedom were distributed over the triangulation.
+ * time that the degrees of freedom were distributed over the triangulation. Also,
+ * if access to an object describing the exact form of the boundary is needed, the
+ * pointer stored within the triangulation object is accessed.
*
* @author Wolfgang Bangerth, 1998
*/
* class for further information.
*/
static void interpolate (const DoFHandler<dim> &dof,
- const Boundary<dim> &boundary,
const Function<dim> &function,
Vector<double> &vec);
*/
static void project (const DoFHandler<dim> &dof,
const ConstraintMatrix &constraints,
- const Boundary<dim> &boundary,
const Quadrature<dim> &q,
const Function<dim> &function,
Vector<double> &vec,
*/
static void create_right_hand_side (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
const Function<dim> &rhs,
Vector<double> &rhs_vector);
*/
static void interpolate_boundary_values (const DoFHandler<dim> &dof,
const FunctionMap &dirichlet_bc,
- const Boundary<dim> &boundary,
map<int,double> &boundary_values);
/**
*/
static void interpolate_boundary_values (const DoFHandler<dim> &dof,
const VectorFunctionMap &dirichlet_bc,
- const Boundary<dim> &boundary,
map<int,double> &boundary_values);
/**
static void project_boundary_values (const DoFHandler<dim> &dof,
const FunctionMap &boundary_functions,
const Quadrature<dim-1> &q,
- const Boundary<dim> &boundary,
map<int,double> &boundary_values);
/**
const Function<dim> &exact_solution,
Vector<float> &difference,
const Quadrature<dim> &q,
- const NormType &norm,
- const Boundary<dim> &boundary=StraightBoundary<dim>());
+ const NormType &norm);
/**
* Compute the error for the solution of a system.
* See the other #integrate_difference#.
*/
- static void integrate_difference (const DoFHandler<dim> &dof,
+ static void integrate_difference (const DoFHandler<dim> &dof,
const Vector<double> &fe_function,
const VectorFunction<dim>&exact_solution,
Vector<float> &difference,
const Quadrature<dim> &q,
- const FiniteElement<dim> &fe,
- const NormType &norm,
- const Boundary<dim> &boundary);
+ const NormType &norm);
/**
template <>
void FiniteElement<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &,
vector<Point<1> > &support_points) const;
vector<Point<1> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &,
- const vector<vector<Tensor<1,1> > > &,
- const Boundary<1> &boundary) const {
+ const vector<vector<Tensor<1,1> > > &) const {
Assert ((!compute_jacobians) || (jacobians.size() == unit_points.size()),
ExcWrongFieldDimension(jacobians.size(), unit_points.size()));
Assert ((!compute_jacobians_grad) || (jacobians_grad.size() == unit_points.size()),
// to vertex two, all following are
// equally spaced along the line
if (compute_support_points)
- get_support_points (cell, boundary, support_points);
+ get_support_points (cell, support_points);
};
vector<Point<1> > &,
const bool,
const FullMatrix<double> &,
- const vector<vector<Tensor<1,1> > > &,
- const Boundary<1> &) const {
+ const vector<vector<Tensor<1,1> > > &) const {
Assert (false, ExcNotImplemented());
};
vector<Point<1> > &,
const bool,
const FullMatrix<double> &,
- const vector<vector<Tensor<1,1> > > &,
- const Boundary<1> &) const {
+ const vector<vector<Tensor<1,1> > > &) const {
Assert (false, ExcNotImplemented());
};
template <>
void FiniteElement<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &,
vector<Point<1> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension(support_points.size(), total_dofs));
vector<Point<dim> > &,
const bool,
const FullMatrix<double> &,
- const vector<vector<Tensor<1,dim> > > &,
- const Boundary<dim> &) const {
+ const vector<vector<Tensor<1,dim> > > &) const {
Assert (false, ExcPureFunctionCalled());
};
vector<Point<dim> > &normal_vectors,
const bool compute_normal_vectors,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_gradients_transform,
- const Boundary<dim> &boundary) const {
+ const vector<vector<Tensor<1,dim> > > &shape_gradients_transform) const {
Assert (jacobians.size() == unit_points.size(),
ExcWrongFieldDimension(jacobians.size(), unit_points.size()));
Assert (q_points.size() == unit_points.size(),
jacobians_grad, compute_jacobians_grad,
dummy, false,
q_points, compute_q_points,
- shape_values_transform, shape_gradients_transform,
- boundary);
+ shape_values_transform, shape_gradients_transform);
if (compute_support_points)
- get_face_support_points (cell->face(face_no), boundary, support_points);
+ get_face_support_points (cell->face(face_no), support_points);
if (compute_face_jacobians)
- get_face_jacobians (cell->face(face_no), boundary,
- unit_points, face_jacobi_determinants);
+ get_face_jacobians (cell->face(face_no),
+ unit_points,
+ face_jacobi_determinants);
if (compute_normal_vectors)
- get_normal_vectors (cell, face_no, boundary,
- unit_points, normal_vectors);
+ get_normal_vectors (cell, face_no, unit_points, normal_vectors);
};
vector<Point<dim> > &normal_vectors,
const bool compute_normal_vectors,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_gradients_transform,
- const Boundary<dim> &boundary) const {
+ const vector<vector<Tensor<1,dim> > > &shape_gradients_transform) const {
Assert (jacobians.size() == unit_points.size(),
ExcWrongFieldDimension(jacobians.size(), unit_points.size()));
Assert (q_points.size() == unit_points.size(),
jacobians_grad, compute_jacobians_grad,
dummy, false,
q_points, compute_q_points,
- shape_values_transform, shape_gradients_transform,
- boundary);
+ shape_values_transform, shape_gradients_transform);
if (compute_face_jacobians)
get_subface_jacobians (cell->face(face_no), subface_no,
template <int dim>
void
FiniteElement<dim>::get_support_points (const DoFHandler<dim>::cell_iterator &,
- const Boundary<dim> &,
vector<Point<dim> > &) const
{
Assert (false, ExcPureFunctionCalled());
template <>
void FECrissCross<1>::get_support_points (const DoFHandler<1>::cell_iterator &,
- const Boundary<1> &,
vector<Point<1> > &) const {
Assert (false, ExcNotUseful());
};
template <>
void FECrissCross<1>::get_face_support_points (const DoFHandler<1>::face_iterator &,
- const Boundary<1> &,
vector<Point<1> > &) const {
Assert (false, ExcNotUseful());
};
template <>
void FECrissCross<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &,
- const Boundary<1> &,
FullMatrix<double> &) const {
Assert (false, ExcNotUseful());
};
template <>
void FECrissCross<1>::get_face_jacobians (const DoFHandler<1>::face_iterator &,
- const Boundary<1> &,
const vector<Point<0> > &,
vector<double> &) const {
Assert (false, ExcNotUseful());
template <>
void FECrissCross<1>::get_normal_vectors (const DoFHandler<1>::cell_iterator &,
const unsigned int,
- const Boundary<1> &,
const vector<Point<0> > &,
vector<Point<1> > &) const {
Assert (false, ExcNotUseful());
vector<Point<1> > &,
const bool ,
const FullMatrix<double> &,
- const vector<vector<Tensor<1,1> > > &,
- const Boundary<1> &) const {
+ const vector<vector<Tensor<1,1> > > &) const {
Assert (false, ExcNotUseful());
};
template <>
void FECrissCross<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell,
- const Boundary<2> &,
vector<Point<2> > &support_points) const {
const unsigned int dim = 2;
template <>
void FECrissCross<2>::get_face_support_points (const DoFHandler<2>::face_iterator &face,
- const Boundary<2> &,
vector<Point<2> > &support_points) const {
const unsigned int dim = 2;
template <>
void FECrissCross<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
- const Boundary<2> &,
FullMatrix<double> &mass_matrix) const {
Assert (mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(mass_matrix.n(),total_dofs));
template <>
void FECrissCross<2>::get_face_jacobians (const DoFHandler<2>::face_iterator &face,
- const Boundary<2> &,
const vector<Point<1> > &unit_points,
vector<double> &face_jacobians) const {
// more or less copied from the linear
template <>
void FECrissCross<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
const unsigned int face_no,
- const Boundary<2> &,
const vector<Point<1> > &unit_points,
vector<Point<2> > &normal_vectors) const {
// more or less copied from the linear
vector<Point<dim> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &/*shape_grad_transform*/,
- const Boundary<dim> &boundary) const {
+ const vector<vector<Tensor<1,dim> > > &/*shape_grad_transform*/) const {
Assert (jacobians.size() == unit_points.size(),
ExcWrongFieldDimension(jacobians.size(), unit_points.size()));
Assert (q_points.size() == unit_points.size(),
// we need the support points in any
// way, wanted or not by the user
if (compute_support_points)
- get_support_points (cell, boundary, support_points);
+ get_support_points (cell, support_points);
if (compute_q_points)
{
template <>
void FECubicSub<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &boundary,
- vector<Point<1> > &support_points) const {
- FiniteElement<1>::get_support_points (cell, boundary, support_points);
+ vector<Point<1> > &support_points) const {
+ FiniteElement<1>::get_support_points (cell, support_points);
};
template <>
void FECubicSub<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- const Boundary<1> &,
vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <>
void FECubicSub<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &,
- FullMatrix<double> &local_mass_matrix) const {
+ FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
Assert (local_mass_matrix.m() == total_dofs,
template <>
void FECubicSub<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
- const Boundary<2> &,
- FullMatrix<double> &local_mass_matrix) const {
+ FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
Assert (local_mass_matrix.m() == total_dofs,
template <>
void FECubicSub<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell,
- const Boundary<2>&,
- vector<Point<2> > &support_points) const {
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
void FECubicSub<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face,
- const Boundary<2> &,
- vector<Point<2> > &support_points) const {
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
template <>
-void FECubicSub<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &,
- const Boundary<3> &,
- FullMatrix<double> &local_mass_matrix) const {
+void
+FECubicSub<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &,
+ FullMatrix<double> &local_mass_matrix) const
+{
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
Assert (local_mass_matrix.m() == total_dofs,
template <>
void FECubicSub<3>::get_support_points (const typename DoFHandler<3>::cell_iterator &cell,
- const Boundary<3>&,
- vector<Point<3> > &support_points) const {
+ vector<Point<3> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
void FECubicSub<3>::get_face_support_points (const typename DoFHandler<3>::face_iterator &face,
- const Boundary<3> &,
vector<Point<3> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
template <int dim>
void
FEDGLinear<dim>::get_face_support_points (const typename DoFHandler<dim>::face_iterator &,
- const Boundary<dim> &,
vector<Point<dim> > &support_points) const {
Assert ((support_points.size() == 0),
ExcWrongFieldDimension (support_points.size(),0));
template <int dim>
void
FEDGQuadraticSub<dim>::get_face_support_points (const typename DoFHandler<dim>::face_iterator &,
- const Boundary<dim> &,
vector<Point<dim> > &support_points) const {
Assert ((support_points.size() == 0),
ExcWrongFieldDimension (support_points.size(),0));
template <int dim>
void
FEDGCubicSub<dim>::get_face_support_points (const typename DoFHandler<dim>::face_iterator &,
- const Boundary<dim> &,
vector<Point<dim> > &support_points) const {
Assert ((support_points.size() == 0),
ExcWrongFieldDimension (support_points.size(),0));
template <int dim>
void
FEDGQuarticSub<dim>::get_face_support_points (const typename DoFHandler<dim>::face_iterator &,
- const Boundary<dim> &,
vector<Point<dim> > &support_points) const {
Assert ((support_points.size() == 0),
ExcWrongFieldDimension (support_points.size(),0));
template <>
-void FEDGConstant<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- const Boundary<1> &,
+void
+FEDGConstant<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <int dim>
void FEDGConstant<dim>::get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <int dim>
void
FEDGConstant<dim>::get_support_points (const typename DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &,
vector<Point<dim> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <int dim>
void
FEDGConstant<dim>::get_face_support_points (const typename DoFHandler<dim>::face_iterator &,
- const Boundary<dim> &,
vector<Point<dim> > &support_points) const {
Assert ((support_points.size() == 0),
ExcWrongFieldDimension (support_points.size(),0));
template <>
void FELinear<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &boundary,
- vector<Point<1> > &support_points) const {
- FiniteElement<1>::get_support_points (cell, boundary, support_points);
+ vector<Point<1> > &support_points) const {
+ FiniteElement<1>::get_support_points (cell, support_points);
};
template <>
void FELinear<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- const Boundary<1> &,
vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <>
void FELinear<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <>
void FELinear<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
- const Boundary<2> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <>
void FELinear<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &,
- const Boundary<3> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <int dim>
void
FELinear<dim>::get_support_points (const typename DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &,
vector<Point<dim> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <int dim>
void
FELinear<dim>::get_face_support_points (const typename DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &,
vector<Point<dim> > &support_points) const {
Assert ((support_points.size() == dofs_per_face) &&
(support_points.size() == GeometryInfo<dim>::vertices_per_face),
template <>
void FEQuadraticSub<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &boundary,
- vector<Point<1> > &support_points) const {
- FiniteElement<1>::get_support_points (cell, boundary, support_points);
+ vector<Point<1> > &support_points) const {
+ FiniteElement<1>::get_support_points (cell, support_points);
};
template <>
void FEQuadraticSub<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- const Boundary<1> &,
- vector<Point<1> > &) const {
+ vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <>
void FEQuadraticSub<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <>
void FEQuadraticSub<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
- const Boundary<2> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <>
void FEQuadraticSub<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell,
- const Boundary<2>&,
vector<Point<2> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
void FEQuadraticSub<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face,
- const Boundary<2> &,
- vector<Point<2> > &support_points) const {
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
template <>
void FEQuadraticSub<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &,
- const Boundary<3> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <>
void FEQuadraticSub<3>::get_support_points (const typename DoFHandler<3>::cell_iterator &cell,
- const Boundary<3>&,
vector<Point<3> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
void FEQuadraticSub<3>::get_face_support_points (const typename DoFHandler<3>::face_iterator &face,
- const Boundary<3> &,
vector<Point<3> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
template <>
void FEQuarticSub<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &boundary,
- vector<Point<1> > &support_points) const {
- FiniteElement<1>::get_support_points (cell, boundary, support_points);
+ vector<Point<1> > &support_points) const {
+ FiniteElement<1>::get_support_points (cell, support_points);
};
template <>
void FEQuarticSub<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- const Boundary<1> &,
- vector<Point<1> > &) const {
+ vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <>
void FEQuarticSub<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <>
void FEQuarticSub<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
- const Boundary<2> &,
FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
template <>
void FEQuarticSub<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell,
- const Boundary<2>&,
- vector<Point<2> > &support_points) const {
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
void FEQuarticSub<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face,
- const Boundary<2> &,
- vector<Point<2> > &support_points) const {
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
#include <base/quadrature.h>
#include <grid/tria_iterator.h>
#include <grid/dof_accessor.h>
-#include <grid/tria_boundary.h>
#include <cmath>
template <>
void FELinearMapping<1>::get_face_jacobians (const DoFHandler<1>::face_iterator &,
- const Boundary<1> &,
const vector<Point<0> > &,
vector<double> &) const {
Assert (false, ExcInternalError());
template <>
void FELinearMapping<1>::get_normal_vectors (const DoFHandler<1>::cell_iterator &,
const unsigned int,
- const Boundary<1> &,
const vector<Point<0> > &,
vector<Point<1> > &) const {
Assert (false, ExcInternalError());
vector<Point<1> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,1> > > &shape_gradients_transform,
- const Boundary<1> &boundary) const {
+ const vector<vector<Tensor<1,1> > > &shape_gradients_transform) const {
// simply pass down
FiniteElement<1>::fill_fe_values (cell, unit_points,
jacobians, compute_jacobians,
jacobians_grad, compute_jacobians_grad,
support_points, compute_support_points,
q_points, compute_q_points,
- shape_values_transform, shape_gradients_transform,
- boundary);
+ shape_values_transform, shape_gradients_transform);
};
template <>
void FELinearMapping<2>::get_face_jacobians (const DoFHandler<2>::face_iterator &face,
- const Boundary<2> &,
const vector<Point<1> > &unit_points,
vector<double> &face_jacobians) const {
// more or less copied from the linear
template <>
void FELinearMapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
const unsigned int face_no,
- const Boundary<2> &,
const vector<Point<1> > &unit_points,
vector<Point<2> > &normal_vectors) const {
// more or less copied from the linear
template <>
void FELinearMapping<3>::get_face_jacobians (const DoFHandler<3>::face_iterator &face,
- const Boundary<3> &,
const vector<Point<2> > &unit_points,
vector<double> &face_jacobians) const {
Assert (unit_points.size() == face_jacobians.size(),
template <>
void FELinearMapping<3>::get_normal_vectors (const DoFHandler<3>::cell_iterator &cell,
const unsigned int face_no,
- const Boundary<3> &,
const vector<Point<2> > &unit_points,
vector<Point<3> > &normal_vectors) const {
Assert (unit_points.size() == normal_vectors.size(),
vector<Point<dim> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &/*shape_grad_transform*/,
- const Boundary<dim> &boundary) const
+ const vector<vector<Tensor<1,dim> > > &/*shape_grad_transform*/) const
{
Assert ((!compute_jacobians) || (jacobians.size() == unit_points.size()),
ExcWrongFieldDimension(jacobians.size(), unit_points.size()));
compute_jacobian_gradients (cell, unit_points, jacobians_grad);
if (compute_support_points)
- get_support_points (cell, boundary, support_points);
+ get_support_points (cell, support_points);
};
template <int dim>
void FESystem<dim>::get_support_points (const DoFHandler<dim>::cell_iterator &/*cell*/,
- const Boundary<dim> &/*boundary*/,
vector<Point<dim> > &/*support_points*/) const
{
Assert(false, ExcNotImplemented());
ExcWrongFieldDimension (support_points.size(), total_dofs));
vector<Point<dim> > base_support_points (base_element->total_dofs);
- base_element->get_support_points (cell, boundary, base_support_points);
+ base_element->get_support_points (cell, base_support_points);
for (unsigned int i=0; i<base_element->total_dofs; ++i)
for (unsigned int n=0; n<n_sub_elements; ++n)
template <int dim>
void FESystem<dim>::get_face_support_points (const DoFHandler<dim>::face_iterator & face,
- const Boundary<dim> & boundary,
vector<Point<dim> > & support_points) const
{
Assert (support_points.size() == dofs_per_face,
for (unsigned int base=0 ; base<n_base_elements(); ++base)
{
base_support_points.resize(base_element(base).dofs_per_face);
- base_element(base).get_face_support_points (face, boundary, base_support_points);
+ base_element(base).get_face_support_points (face, base_support_points);
for (unsigned int inbase = 0 ; inbase < element_multiplicity(base); ++inbase)
{
for (unsigned int i=0; i<base_element(base).dofs_per_face; ++i)
template <int dim>
void FESystem<dim>::get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &/*cell*/,
- const Boundary<dim> &/*boundary*/,
FullMatrix<double> &/*local_mass_matrix*/) const
{
Assert(false, ExcNotImplemented());
// the base object
FullMatrix<double> base_mass_matrix (base_element.total_dofs,
base_element.total_dofs);
- base_element.get_local_mass_matrix (cell, boundary, base_mass_matrix);
+ base_element.get_local_mass_matrix (cell, base_mass_matrix);
// now distribute it to the mass matrix
template <int dim>
void FESystem<dim>::get_face_jacobians (const DoFHandler<dim>::face_iterator &face,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<double> &face_jacobi_determinants) const
{
- base_elements[0].first->get_face_jacobians (face, boundary, unit_points,
- face_jacobi_determinants);
+ base_elements[0].first->get_face_jacobians (face, unit_points,
+ face_jacobi_determinants);
};
template <int dim>
void FESystem<dim>::get_normal_vectors (const DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
- const Boundary<dim> &boundary,
const vector<Point<dim-1> > &unit_points,
vector<Point<dim> > &normal_vectors) const
{
- base_elements[0].first->get_normal_vectors (cell, face_no, boundary, unit_points,
+ base_elements[0].first->get_normal_vectors (cell, face_no, unit_points,
normal_vectors);
};
vector<Point<dim> > &q_points,
const bool compute_q_points,
const FullMatrix<double> &shape_values_transform,
- const vector<vector<Tensor<1,dim> > > &shape_grad_transform,
- const Boundary<dim> &boundary) const
+ const vector<vector<Tensor<1,dim> > > &shape_grad_transform) const
{
vector<Point<dim> > supp(base_elements[0].first->total_dofs);
jacobians_grad, compute_jacobians_grad,
support_points, compute_support_points,
q_points, compute_q_points,
- shape_values_transform, shape_grad_transform, boundary);
+ shape_values_transform, shape_grad_transform);
if (compute_support_points)
{
jacobians_grad, false,
supp, true,
q_points, false,
- shape_values_transform, shape_grad_transform, boundary);
+ shape_values_transform, shape_grad_transform);
for (unsigned m=0 ; m < element_multiplicity(base) ; ++ m)
{
const unsigned int n_transform_functions,
const unsigned int n_values_arrays,
const UpdateFlags update_flags,
- const FiniteElement<dim> &fe) :
+ const FiniteElement<dim> &fe,
+ const Boundary<dim> &boundary) :
n_quadrature_points (n_q_points),
total_dofs (total_dofs),
n_transform_functions (n_transform_functions),
n_quadrature_points)),
selected_dataset (0),
update_flags (update_flags),
- fe(&fe) {};
+ fe(&fe),
+ boundary(&boundary)
+{};
template <int dim>
FEValues<dim>::FEValues (const FiniteElement<dim> &fe,
const Quadrature<dim> &quadrature,
- const UpdateFlags update_flags) :
+ const UpdateFlags update_flags,
+ const Boundary<dim> &boundary) :
FEValuesBase<dim> (quadrature.n_quadrature_points,
fe.total_dofs,
fe.total_dofs,
fe.n_transform_functions,
1,
update_flags,
- fe),
+ fe,
+ boundary),
unit_shape_gradients(fe.total_dofs,
vector<Tensor<1,dim> >(quadrature.n_quadrature_points)),
unit_shape_2nd_derivatives(fe.total_dofs,
template <int dim>
-void FEValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &cell,
- const Boundary<dim> &boundary) {
+void FEValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &cell) {
present_cell = cell;
// fill jacobi matrices and real
// quadrature points
update_flags & update_support_points,
quadrature_points,
update_flags & update_q_points,
- shape_values_transform[0], unit_shape_gradients_transform,
- boundary);
+ shape_values_transform[0], unit_shape_gradients_transform);
// compute gradients on real element if
// requested
const unsigned int n_transform_functions,
const unsigned int n_faces_or_subfaces,
const UpdateFlags update_flags,
- const FiniteElement<dim> &fe) :
+ const FiniteElement<dim> &fe,
+ const Boundary<dim> &boundary) :
FEValuesBase<dim> (n_q_points,
n_support_points,
total_dofs,
n_transform_functions,
n_faces_or_subfaces,
update_flags,
- fe),
+ fe,
+ boundary),
unit_shape_gradients (n_faces_or_subfaces,
vector<vector<Tensor<1,dim> > >(total_dofs,
vector<Tensor<1,dim> >(n_q_points))),
template <int dim>
FEFaceValues<dim>::FEFaceValues (const FiniteElement<dim> &fe,
const Quadrature<dim-1> &quadrature,
- const UpdateFlags update_flags) :
+ const UpdateFlags update_flags,
+ const Boundary<dim> &boundary) :
FEFaceValuesBase<dim> (quadrature.n_quadrature_points,
fe.dofs_per_face,
fe.total_dofs,
fe.n_transform_functions,
GeometryInfo<dim>::faces_per_cell,
update_flags,
- fe)
+ fe,
+ boundary)
{
unit_face_quadrature_points = quadrature.get_quad_points();
weights = quadrature.get_weights ();
template <int dim>
void FEFaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &cell,
- const unsigned int face_no,
- const Boundary<dim> &boundary) {
+ const unsigned int face_no) {
present_cell = cell;
selected_dataset = face_no;
// fill jacobi matrices and real
normal_vectors,
update_flags & update_normal_vectors,
shape_values_transform[face_no],
- unit_shape_gradients_transform[face_no],
- boundary);
+ unit_shape_gradients_transform[face_no]);
// compute gradients on real element if
// requested
template <int dim>
FESubfaceValues<dim>::FESubfaceValues (const FiniteElement<dim> &fe,
const Quadrature<dim-1> &quadrature,
- const UpdateFlags update_flags) :
+ const UpdateFlags update_flags,
+ const Boundary<dim> &boundary) :
FEFaceValuesBase<dim> (quadrature.n_quadrature_points,
0,
fe.total_dofs,
fe.n_transform_functions,
GeometryInfo<dim>::faces_per_cell * GeometryInfo<dim>::subfaces_per_face,
update_flags,
- fe)
+ fe,
+ boundary)
{
Assert ((update_flags & update_support_points) == false,
ExcInvalidUpdateFlag());
template <int dim>
void FESubfaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
- const unsigned int subface_no,
- const Boundary<dim> &boundary) {
+ const unsigned int subface_no) {
Assert (cell->face(face_no)->at_boundary() == false,
ExcReinitCalledWithBoundaryFace());
normal_vectors,
update_flags & update_normal_vectors,
shape_values_transform[selected_dataset],
- unit_shape_gradients_transform[selected_dataset],
- boundary);
+ unit_shape_gradients_transform[selected_dataset]);
// compute gradients on real element if
// requested
+template <int dim>
+const Boundary<dim> &
+Triangulation<dim>::get_boundary () const
+{
+ return *boundary;
+};
+
+
+
+
/*--------- Put the next functions a bit out-or-order to avoid use before
--------- explicit specialization, which is not allowed. */
SparseMatrix<double> &matrix,
Vector<double> &rhs_vector,
const Quadrature<dim> &quadrature,
- const FiniteElement<dim> &fe,
- const UpdateFlags &update_flags,
- const Boundary<dim> &boundary) :
+ const UpdateFlags &update_flags) :
dof(dof),
assemble_matrix(assemble_matrix),
assemble_rhs(assemble_rhs),
matrix(matrix),
rhs_vector(rhs_vector),
quadrature(quadrature),
- fe(fe),
- update_flags(update_flags),
- boundary(boundary) {};
+ update_flags(update_flags)
+{};
assemble_rhs (local_data->assemble_rhs),
matrix(local_data->matrix),
rhs_vector(local_data->rhs_vector),
- fe(local_data->fe),
- fe_values (local_data->fe,
+ fe_values (dof_handler->get_fe(),
local_data->quadrature,
- local_data->update_flags),
- boundary(local_data->boundary)
+ local_data->update_flags,
+ tria->get_boundary())
{
Assert (!assemble_matrix || (matrix.m() == dof_handler->n_dofs()),
ExcInvalidData());
Assert (!assemble_matrix || (matrix.n() == dof_handler->n_dofs()),
ExcInvalidData());
- Assert (((AssemblerData<dim>*)local_data)->fe == dof_handler->get_fe(),
- ExcInvalidData());
Assert (!assemble_rhs || (rhs_vector.size()==dof_handler->n_dofs()),
ExcInvalidData());
};
template <int dim>
void Assembler<dim>::assemble (const Equation<dim> &equation) {
// re-init fe values for this cell
- fe_values.reinit (DoFHandler<dim>::cell_iterator (tria,
- present_level,
- present_index,
- dof_handler),
- boundary);
+ fe_values.reinit (DoFHandler<dim>::cell_iterator (*this));
const unsigned int n_dofs = dof_handler->get_fe().total_dofs;
if (assemble_matrix)
template <int dim>
void ProblemBase<dim>::assemble (const Equation<dim> &equation,
const Quadrature<dim> &quadrature,
- const FiniteElement<dim> &fe,
const UpdateFlags update_flags,
- const FunctionMap &dirichlet_bc,
- const Boundary<dim> &boundary) {
+ const FunctionMap &dirichlet_bc) {
Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
system_sparsity.reinit (dof_handler->n_dofs(),
system_matrix,
right_hand_side,
quadrature,
- fe,
- update_flags,
- boundary);
+ update_flags);
active_assemble_iterator assembler (tria,
tria->begin_active()->level(),
tria->begin_active()->index(),
// apply Dirichlet bc as described
// in the docs
map<int, double> boundary_value_list;
- VectorTools<dim>::interpolate_boundary_values (*dof_handler,
- dirichlet_bc, boundary,
+ VectorTools<dim>::interpolate_boundary_values (*dof_handler, dirichlet_bc,
boundary_value_list);
MatrixTools<dim>::apply_boundary_values (boundary_value_list,
system_matrix, solution,
#include <grid/dof.h>
#include <grid/dof_accessor.h>
#include <grid/tria_iterator.h>
-#include <grid/tria_boundary.h>
#include <grid/tria.h>
#include <grid/geometry_info.h>
#include <base/quadrature_lib.h>
QIteratedTrapez<dim> points(accuracy);
- FEValues<dim> fe(dofs->get_fe(), points, UpdateFlags(update_q_points));
- const StraightBoundary<dim> boundary;
+ FEValues<dim> fe(dofs->get_fe(), points, UpdateFlags(update_q_points),
+ dofs->get_tria().get_boundary());
vector< vector <vector<double> > >
values (dof_data.size(),
vector< vector<double> >(points.n_quadrature_points,
unsigned int cell_index=0;
for (cell=dofs->begin_active(); cell!=endc; ++cell, ++cell_index)
{
- fe.reinit(cell, boundary);
+ fe.reinit(cell);
for (unsigned i=0; i<dof_data.size(); ++i)
fe.get_function_values(*dof_data[i].data, values[i]);
template <>
void KellyErrorEstimator<1>::estimate_error (const DoFHandler<1> &,
const Quadrature<0> &,
- const FiniteElement<1> &,
- const Boundary<1> &,
const FunctionMap &,
const Vector<double> &,
Vector<float> &,
template <int dim>
void KellyErrorEstimator<dim>::estimate_error (const DoFHandler<dim> &dof,
const Quadrature<dim-1> &quadrature,
- const FiniteElement<dim> &fe,
- const Boundary<dim> &boundary,
const FunctionMap &neumann_bc,
const Vector<double> &solution,
Vector<float> &error,
// need not compute all values on the
// neighbor cells, so using two objects
// gives us a performance gain).
- FEFaceValues<dim> fe_face_values_cell (fe, quadrature,
+ FEFaceValues<dim> fe_face_values_cell (dof.get_fe(), quadrature,
UpdateFlags(update_gradients |
update_JxW_values |
((!neumann_bc.empty() ||
(coefficient != 0)) ?
update_q_points : 0) |
- update_normal_vectors));
- FEFaceValues<dim> fe_face_values_neighbor (fe, quadrature, update_gradients);
- FESubfaceValues<dim> fe_subface_values (fe, quadrature, update_gradients);
+ update_normal_vectors),
+ dof.get_tria().get_boundary());
+ FEFaceValues<dim> fe_face_values_neighbor (dof.get_fe(), quadrature, update_gradients,
+ dof.get_tria().get_boundary());
+ FESubfaceValues<dim> fe_subface_values (dof.get_fe(), quadrature, update_gradients,
+ dof.get_tria().get_boundary());
// loop over all cells
const active_cell_iterator endc = dof.end();
// is the same as that of this side,
// then handle the integration of
// these both cases together
- integrate_over_regular_face (cell, face_no, fe,
- boundary, neumann_bc,
+ integrate_over_regular_face (cell, face_no, neumann_bc,
n_q_points,
fe_face_values_cell,
fe_face_values_neighbor,
// special computations which do
// not fit into the framework of
// the above function
- integrate_over_irregular_face (cell, face_no, fe, boundary,
+ integrate_over_irregular_face (cell, face_no,
n_q_points,
fe_face_values_cell,
fe_subface_values,
template <>
void KellyErrorEstimator<1>::integrate_over_regular_face (const active_cell_iterator &,
const unsigned int ,
- const FiniteElement<1> &,
- const Boundary<1> &,
const FunctionMap &,
const unsigned int ,
FEFaceValues<1> &,
void KellyErrorEstimator<1>::
integrate_over_irregular_face (const active_cell_iterator &,
const unsigned int ,
- const FiniteElement<1> &,
- const Boundary<1> &,
const unsigned int ,
FEFaceValues<1> &,
FESubfaceValues<1> &,
void KellyErrorEstimator<dim>::
integrate_over_regular_face (const active_cell_iterator &cell,
const unsigned int face_no,
- const FiniteElement<dim> &,
- const Boundary<dim> &boundary,
const FunctionMap &neumann_bc,
const unsigned int n_q_points,
FEFaceValues<dim> &fe_face_values_cell,
// initialize data of the restriction
// of this cell to the present face
- fe_face_values_cell.reinit (cell, face_no, boundary);
+ fe_face_values_cell.reinit (cell, face_no);
// set up a vector of the gradients
// of the finite element function
// get restriction of finite element
// function of #neighbor# to the
// common face.
- fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor, boundary);
+ fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor);
// get a list of the gradients of
// the finite element solution
void KellyErrorEstimator<dim>::
integrate_over_irregular_face (const active_cell_iterator &cell,
const unsigned int face_no,
- const FiniteElement<dim> &,
- const Boundary<dim> &boundary,
const unsigned int n_q_points,
FEFaceValues<dim> &fe_face_values,
FESubfaceValues<dim> &fe_subface_values,
// present cell to the subface and
// store the gradient of the solution
// in psi
- fe_subface_values.reinit (cell, face_no, subface_no, boundary);
+ fe_subface_values.reinit (cell, face_no, subface_no);
fe_subface_values.get_function_grads (solution, psi);
// restrict the finite element on the
// neighbor cell to the common #subface#.
// store the gradient in #neighbor_psi#
vector<Tensor<1,dim> > neighbor_psi (n_q_points);
- fe_face_values.reinit (neighbor_child, neighbor_neighbor, boundary);
+ fe_face_values.reinit (neighbor_child, neighbor_neighbor);
fe_face_values.get_function_grads (solution, neighbor_psi);
// compute the jump in the gradients
template <int dim>
void MatrixCreator<dim>::create_mass_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const Function<dim> * const a) {
- const FiniteElement<dim> &fe = dof.get_fe();
-
Vector<double> dummy; // no entries, should give an error if accessed
UpdateFlags update_flags = update_JxW_values;
if (a != 0)
const AssemblerData<dim> data (dof,
true, false, // assemble matrix but not rhs
matrix, dummy,
- q, fe, update_flags, boundary);
+ q, update_flags);
TriaActiveIterator<dim, Assembler<dim> >
assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
dof.get_tria().begin_active()->level(),
template <int dim>
void MatrixCreator<dim>::create_mass_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const Function<dim> &rhs,
Vector<double> &rhs_vector,
const Function<dim> * const a) {
- const FiniteElement<dim> &fe = dof.get_fe();
-
UpdateFlags update_flags = UpdateFlags(update_q_points |
update_JxW_values);
const AssemblerData<dim> data (dof,
true, true,
matrix, rhs_vector,
- q, fe, update_flags, boundary);
+ q, update_flags);
TriaActiveIterator<dim, Assembler<dim> >
assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
dof.get_tria().begin_active()->level(),
template <int dim>
void MatrixCreator<dim>::create_mass_matrix (const DoFHandler<dim> &dof,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix) {
const FiniteElement<dim> &fe = dof.get_fe();
for (; cell!=endc; ++cell)
{
cell->get_dof_indices (dofs_on_this_cell);
- fe.get_local_mass_matrix (cell, boundary, local_mass_matrix);
+ fe.get_local_mass_matrix (cell, local_mass_matrix);
for (unsigned int i=0; i<total_dofs; ++i)
for (unsigned int j=0; j<total_dofs; ++j)
template <>
void MatrixCreator<1>::create_boundary_mass_matrix (const DoFHandler<1> &,
const Quadrature<0> &,
- const Boundary<1> &,
SparseMatrix<double> &,
const FunctionMap &,
Vector<double> &,
template <int dim>
void MatrixCreator<dim>::create_boundary_mass_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim-1> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const FunctionMap &rhs,
Vector<double> &rhs_vector,
UpdateFlags update_flags = UpdateFlags (update_JxW_values | update_q_points);
- FEFaceValues<dim> fe_values (fe, q, update_flags);
+ FEFaceValues<dim> fe_values (fe, q, update_flags, dof.get_tria().get_boundary());
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active (),
endc = dof.end ();
cell_matrix.clear ();
cell_vector.clear ();
- fe_values.reinit (cell, face, boundary);
+ fe_values.reinit (cell, face);
const FullMatrix<double> &values = fe_values.get_shape_values ();
const vector<double> &weights = fe_values.get_JxW_values ();
template <int dim>
void MatrixCreator<dim>::create_laplace_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const Function<dim> * const a) {
- const FiniteElement<dim> &fe = dof.get_fe();
-
Vector<double> dummy; // no entries, should give an error if accessed
UpdateFlags update_flags = UpdateFlags(update_gradients |
update_JxW_values);
const AssemblerData<dim> data (dof,
true, false, // assemble matrix but not rhs
matrix, dummy,
- q, fe, update_flags, boundary);
+ q, update_flags);
TriaActiveIterator<dim, Assembler<dim> >
assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
dof.get_tria().begin_active()->level(),
template <int dim>
void MatrixCreator<dim>::create_laplace_matrix (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
SparseMatrix<double> &matrix,
const Function<dim> &rhs,
Vector<double> &rhs_vector,
const Function<dim> * const a) {
- const FiniteElement<dim> &fe = dof.get_fe();
-
UpdateFlags update_flags = UpdateFlags(update_q_points |
update_gradients |
update_JxW_values);
const AssemblerData<dim> data (dof,
true, true,
matrix, rhs_vector,
- q, fe,
- update_flags,
- boundary);
+ q, update_flags);
TriaActiveIterator<dim, Assembler<dim> >
assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
dof.get_tria().begin_active()->level(),
template <int dim>
void VectorTools<dim>::interpolate (const DoFHandler<dim> &dof,
- const Boundary<dim> &boundary,
const Function<dim> &function,
Vector<double> &vec)
{
// for each cell:
// get location of finite element
// off-points
- fe.get_support_points (cell, boundary, support_points);
+ fe.get_support_points (cell, support_points);
// get function values at these points
function.value_list (support_points, dof_values_on_cell);
// get indices of the dofs on this cell
template <>
void VectorTools<1>::project (const DoFHandler<1> &,
const ConstraintMatrix &,
- const Boundary<1> &,
const Quadrature<1> &,
const Function<1> &,
Vector<double> &,
template <int dim>
void VectorTools<dim>::project (const DoFHandler<dim> &dof,
const ConstraintMatrix &constraints,
- const Boundary<dim> &boundary,
const Quadrature<dim> &q,
const Function<dim> &function,
Vector<double> &vec,
for (unsigned char c=0; c<255; ++c)
boundary_functions[c] = &function;
project_boundary_values (dof, boundary_functions, q_boundary,
- boundary, boundary_values);
+ boundary_values);
};
SparseMatrix<double> mass_matrix (sparsity);
Vector<double> tmp (mass_matrix.n());
- MatrixCreator<dim>::create_mass_matrix (dof, boundary, mass_matrix);
- VectorTools<dim>::create_right_hand_side (dof, q, boundary,
- function, tmp);
+ MatrixCreator<dim>::create_mass_matrix (dof, mass_matrix);
+ VectorTools<dim>::create_right_hand_side (dof, q, function, tmp);
constraints.condense (mass_matrix);
constraints.condense (tmp);
template <int dim>
void VectorTools<dim>::create_right_hand_side (const DoFHandler<dim> &dof,
const Quadrature<dim> &q,
- const Boundary<dim> &boundary,
const Function<dim> &rhs,
Vector<double> &rhs_vector) {
- const FiniteElement<dim> &fe = dof.get_fe();
-
UpdateFlags update_flags = UpdateFlags(update_q_points |
update_JxW_values);
SparseMatrix<double> dummy;
const AssemblerData<dim> data (dof,
false, true,
dummy, rhs_vector,
- q, fe, update_flags, boundary);
+ q, update_flags);
TriaActiveIterator<dim, Assembler<dim> >
assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
dof.get_tria().begin_active()->level(),
void
VectorTools<1>::interpolate_boundary_values (const DoFHandler<1> &,
const FunctionMap &,
- const Boundary<1> &,
map<int,double> &)
{
Assert (false, ExcNotImplemented());
template <>
void VectorTools<1>::interpolate_boundary_values (const DoFHandler<1> &,
const VectorFunctionMap&,
- const Boundary<1>&,
map<int,double>&)
{
Assert (false, ExcNotImplemented());
void
VectorTools<dim>::interpolate_boundary_values (const DoFHandler<dim> &dof,
const FunctionMap &dirichlet_bc,
- const Boundary<dim> &boundary,
map<int,double> &boundary_values) {
Assert (dirichlet_bc.find(255) == dirichlet_bc.end(),
ExcInvalidBoundaryIndicator());
// boundary values of dofs on this
// face
face->get_dof_indices (face_dofs);
- fe.get_face_support_points (face, boundary, dof_locations);
+ fe.get_face_support_points (face, dof_locations);
function_ptr->second->value_list (dof_locations, dof_values);
// enter into list
void
VectorTools<dim>::interpolate_boundary_values (const DoFHandler<dim> &dof,
const VectorFunctionMap &dirichlet_bc,
- const Boundary<dim> &boundary,
map<int,double> &boundary_values)
{
Assert (dirichlet_bc.find(255) == dirichlet_bc.end(),
// boundary values of dofs on this
// face
face->get_dof_indices (face_dofs);
- fe.get_face_support_points (face, boundary, dof_locations);
+ fe.get_face_support_points (face, dof_locations);
function_ptr->second->value_list (dof_locations, dof_values);
// enter into list
VectorTools<dim>::project_boundary_values (const DoFHandler<dim> &dof,
const FunctionMap &boundary_functions,
const Quadrature<dim-1> &q,
- const Boundary<dim> &boundary,
map<int,double> &boundary_values) {
vector<int> dof_to_boundary_mapping;
dof.map_dof_to_boundary_indices (boundary_functions, dof_to_boundary_mapping);
Vector<double> rhs(sparsity.n_rows());
- MatrixTools<dim>::create_boundary_mass_matrix (dof, q, boundary,
+ MatrixTools<dim>::create_boundary_mass_matrix (dof, q,
mass_matrix, boundary_functions,
rhs, dof_to_boundary_mapping);
const Function<dim> &exact_solution,
Vector<float> &difference,
const Quadrature<dim> &q,
- const NormType &norm,
- const Boundary<dim> &boundary) {
+ const NormType &norm) {
const FiniteElement<dim> &fe = dof.get_fe();
difference.reinit (dof.get_tria().n_active_cells());
update_JxW_values);
if ((norm==H1_seminorm) || (norm==H1_norm))
update_flags = UpdateFlags (update_flags | update_gradients);
- FEValues<dim> fe_values(fe, q, update_flags);
+ FEValues<dim> fe_values(fe, q, update_flags, dof.get_tria().get_boundary());
// loop over all cells
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
{
double diff=0;
// initialize for this cell
- fe_values.reinit (cell, boundary);
+ fe_values.reinit (cell);
switch (norm)
{
template <int dim>
void
-VectorTools<dim>::integrate_difference (const DoFHandler<dim> &dof,
+VectorTools<dim>::integrate_difference (const DoFHandler<dim> &dof,
const Vector<double> &fe_function,
const VectorFunction<dim>&exact_solution,
Vector<float> &difference,
const Quadrature<dim> &q,
- const FiniteElement<dim> &fe,
- const NormType &norm,
- const Boundary<dim> &boundary)
+ const NormType &norm)
{
- Assert (fe == dof.get_fe(), ExcInvalidFE());
+ const FiniteElement<dim> &fe = dof.get_fe();
- difference.reinit (dof.get_tria().n_active_cells());
+ difference.reinit (dof.get_tria().n_active_cells());
- UpdateFlags update_flags = UpdateFlags (update_q_points |
+ UpdateFlags update_flags = UpdateFlags (update_q_points |
update_JxW_values);
- if ((norm==H1_seminorm) || (norm==H1_norm))
- update_flags = UpdateFlags (update_flags | update_gradients);
- FEValues<dim> fe_values(fe, q, update_flags);
+ if ((norm==H1_seminorm) || (norm==H1_norm))
+ update_flags = UpdateFlags (update_flags | update_gradients);
+ FEValues<dim> fe_values(fe, q, update_flags, dof.get_tria().get_boundary());
// loop over all cells
- DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
+ DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
- for (unsigned int index=0; cell != endc; ++cell, ++index)
- {
- double diff=0;
+ for (unsigned int index=0; cell != endc; ++cell, ++index)
+ {
+ double diff=0;
// initialize for this cell
- fe_values.reinit (cell, boundary);
-
- switch (norm)
+ fe_values.reinit (cell);
+
+ switch (norm)
{
case mean:
case L1_norm:
fe_values.get_function_values (fe_function, function_values);
/* transform (psi.begin(), psi.end(),
- function_values.begin(),
- psi.begin(),
- minus<double>());
+ function_values.begin(),
+ psi.begin(),
+ minus<double>());
*/ };
// for L1_norm and Linfty_norm:
// in praxi: first compute
// exact fe_function vector
/* exact_solution.gradient_list (fe_values.get_quadrature_points(),
- psi);
+ psi);
*/
// then subtract finite element
// fe_function
fe_values.get_function_grads (fe_function, function_grads);
/* transform (psi.begin(), psi.end(),
- function_grads.begin(),
- psi.begin(),
- minus<Tensor<1,dim> >());
+ function_grads.begin(),
+ psi.begin(),
+ minus<Tensor<1,dim> >());
*/ };
// take square of integrand
vector<double> psi_square (psi.size(), 0.0);
// add seminorm to L_2 norm or
// to zero
/* diff += inner_product (psi_square.begin(), psi_square.end(),
- fe_values.get_JxW_values().begin(),
- 0.0);
+ fe_values.get_JxW_values().begin(),
+ 0.0);
diff = sqrt(diff);
*/
break;
// append result of this cell
// to the end of the vector
- difference(index) = diff;
- };
- };
+ difference(index) = diff;
+ };
+};
template VectorTools<deal_II_dimension>;
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = boundary_values;
- assemble (equation, *quadrature, *fe, update_flags, dirichlet_bc);
+ assemble (equation, *quadrature, update_flags, dirichlet_bc);
cout << " Solving..." << endl;
solve ();
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = solution_function;
- assemble (*equation, quadrature, fe, update_flags, dirichlet_bc);
+ assemble (*equation, quadrature, update_flags, dirichlet_bc);
// if we have an old solution lying
// around, use it to preset the solution
cout << " Estimating H1 error... ";
KellyErrorEstimator<dim> ee;
QSimpson<dim-1> eq;
- ee.estimate_error (*dof, eq, fe, *boundary,
+ ee.estimate_error (*dof, eq,
KellyErrorEstimator<dim>::FunctionMap(),
solution,
estimated_error_per_cell,
*/
virtual void assemble (const Equation<dim> &equation,
const Quadrature<dim> &q,
- const FiniteElement<dim> &fe,
const UpdateFlags update_flags,
- const FunctionMap &dirichlet_bc = FunctionMap(),
- const Boundary<dim> &boundary = StraightBoundary<dim>());
+ const FunctionMap &dirichlet_bc = FunctionMap());
int run (unsigned int level);
void print_history (string filename) const;
template <int dim>
void PoissonProblem<dim>::assemble (const Equation<dim> &equation,
const Quadrature<dim> &quadrature,
- const FiniteElement<dim> &fe,
const UpdateFlags update_flags,
- const FunctionMap &dirichlet_bc,
- const Boundary<dim> &boundary) {
+ const FunctionMap &dirichlet_bc) {
Assert ((tria!=0) && (dof!=0), ExcNoTriaSelected());
system_sparsity.reinit (dof->DoFHandler<dim>::n_dofs(),
system_matrix,
right_hand_side,
quadrature,
- fe,
- update_flags,
- boundary);
+ update_flags);
active_assemble_iterator assembler (tria,
tria->begin_active()->level(),
tria->begin_active()->index(),
// apply Dirichlet bc as described
// in the docs
map<int, double> boundary_value_list;
- VectorTools<dim>::interpolate_boundary_values (*dof, dirichlet_bc, boundary,
+ VectorTools<dim>::interpolate_boundary_values (*dof, dirichlet_bc,
boundary_value_list);
MatrixTools<dim>::apply_boundary_values (boundary_value_list,
system_matrix, solution,
map<unsigned char,const Function<dim>*> dirichlet_bc;
dirichlet_bc[0] = boundary_values;
- assemble (equation, *quadrature, *fe, update_flags, dirichlet_bc);
+ assemble (equation, *quadrature, update_flags, dirichlet_bc);
cout << " Solving..." << endl;
solve ();
assemble (equation, quadrature, fe,
UpdateFlags(update_gradients | update_JxW_values |
update_q_points),
- dirichlet_bc, boundary);
+ dirichlet_bc);
cout << " Solving..." << endl;
solve ();
Vector<float> error_indicator;
KellyErrorEstimator<dim> ee;
QSimpson<dim-1> eq;
- ee.estimate_error (*dof, eq, fe, boundary,
+ ee.estimate_error (*dof, eq, fe,
KellyErrorEstimator<dim>::FunctionMap(),
solution,
error_indicator);
cout << " Assembling matrices..." << endl;
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = boundary_values;
- assemble (equation, quadrature, fe,
+ assemble (equation, quadrature,
UpdateFlags(update_gradients | update_JxW_values |
update_q_points),
- dirichlet_bc, *boundary);
+ dirichlet_bc);
cout << " Solving..." << endl;
solve ();
// fe.get_unit_support_points(unit_points);
// fe.get_support_points(cell, boundary, support_points);
- fe.get_face_support_points(face, boundary, face_support_points);
+ fe.get_face_support_points(face, face_support_points);
deallog << "total_dofs" << " " << fe.total_dofs;
deallog << ": vertex" << " " << fe.dofs_per_vertex;
DoFHandler<2> dof(&tria);
dof.distribute_dofs(fe);
- StraightBoundary<2> b;
QTrapez<2> q;
- FEValues<2> fevalues(fe,q,update_gradients);
- fevalues.reinit (dof.begin_active(),b);
+ FEValues<2> fevalues(fe,q,update_gradients,tria.get_boundary());
+ fevalues.reinit (dof.begin_active());
Vector<double> val(4);
StraightBoundary<2> b;
QTrapez<2> q;
- FEValues<2> fevalues(fe,q,update_second_derivatives);
+ FEValues<2> fevalues(fe,q,update_second_derivatives,b);
Vector<double> val(4);
// move one vertex of the only cell
if (loop==1)
tria.begin_active()->vertex(2)(0) = 2;
- fevalues.reinit (dof.begin_active(),b);
+ fevalues.reinit (dof.begin_active());
for (unsigned int vertex=0; vertex<4; ++vertex)
{