QGauss4<2> quadrature;
-// HyperBallBoundary<2> boundary(Point<2>(2,3), 4);
-
cout << "Making grid..." << endl;
tria.create_hypercube ();
+// HyperBallBoundary<2> boundary(Point<2>(2,3), 4);
// tria.create_hyper_ball(Point<2>(2,3),4);
// tria.set_boundary (&boundary);
- tria.refine_global (1);
- (--tria.last_active())->set_refine_flag();
- tria.execute_refinement ();
+// tria.refine_global (1);
+// (--tria.last_active())->set_refine_flag();
+// tria.execute_refinement ();
// tria.begin_active(2)->set_refine_flag();
// tria.execute_refinement ();
- tria.refine_global (2);
+ tria.refine_global (3);
/*
const unsigned int dim=2;
tria.refine_global (1);
Triangulation<dim>::active_cell_iterator cell, endc;
- for (int i=0; i<12; ++i)
+ for (int i=0; i<8; ++i)
{
int n_levels = tria.n_levels();
cell = tria.begin_active();
cout << "Assembling matrices..." << endl;
FEValues<2>::UpdateStruct update_flags;
- update_flags.update_q_points = true;
- update_flags.update_gradients = true;
- update_flags.update_jacobians = true;
- update_flags.update_JxW_values = true;
- ProblemBase<2>::DirichletBC d;
- problem.assemble (equation, quadrature, fe, update_flags, d);
+ update_flags.q_points = true;
+ update_flags.gradients = true;
+ update_flags.jacobians = true;
+ update_flags.JxW_values = true;
+ ProblemBase<2>::DirichletBC dirichlet_bc;
+ problem.assemble (equation, quadrature, fe, update_flags, dirichlet_bc);
cout << "Solving..." << endl;
problem.solve ();
* Compute quadrature points in real
* space (not on unit cell).
*/
- bool update_q_points;
+ bool q_points;
/**
* Transform gradients on unit cell to
* gradients on real cell.
*/
- bool update_gradients;
+ bool gradients;
/**
* Compute jacobian matrices of the
* transform between unit and real cell
* in the evaluation points.
*/
- bool update_jacobians;
+ bool jacobians;
/**
* Compute the JxW values (Jacobian
* determinant at the quadrature point
* times the weight of this point).
*/
- bool update_JxW_values;
+ bool JxW_values;
/**
* Compute the points on the real cell
* on which the ansatz functions are
* located.
*/
- bool update_ansatz_points;
+ bool ansatz_points;
};
inline
const vector<vector<Point<dim> > > &
FEValues<dim>::get_shape_grads () const {
- Assert (update_flags.update_gradients, ExcAccessToUninitializedField());
+ Assert (update_flags.gradients, ExcAccessToUninitializedField());
return shape_gradients;
};
inline
const vector<Point<dim> > &
FEValues<dim>::get_quadrature_points () const {
- Assert (update_flags.update_q_points, ExcAccessToUninitializedField());
+ Assert (update_flags.q_points, ExcAccessToUninitializedField());
return quadrature_points;
};
inline
const vector<Point<dim> > &
FEValues<dim>::get_ansatz_points () const {
- Assert (update_flags.update_ansatz_points, ExcAccessToUninitializedField());
+ Assert (update_flags.ansatz_points, ExcAccessToUninitializedField());
return ansatz_points;
};
inline
const vector<double> &
FEValues<dim>::get_JxW_values () const {
- Assert (update_flags.update_JxW_values, ExcAccessToUninitializedField());
+ Assert (update_flags.JxW_values, ExcAccessToUninitializedField());
return JxW_values;
};
template <int dim>
FEValues<dim>::UpdateStruct::UpdateStruct () :
- update_q_points(false),
- update_gradients(false),
- update_jacobians(false),
- update_JxW_values(false),
- update_ansatz_points(false) {};
+ q_points(false),
+ gradients(false),
+ jacobians(false),
+ JxW_values(false),
+ ansatz_points(false) {};
const unsigned int j) const {
Assert (i<(unsigned int)shape_values.m(), ExcInvalidIndex (i, shape_values.m()));
Assert (j<(unsigned int)shape_values.n(), ExcInvalidIndex (j, shape_values.n()));
- Assert (update_flags.update_gradients, ExcAccessToUninitializedField());
+ Assert (update_flags.gradients, ExcAccessToUninitializedField());
return shape_gradients[i][j];
};
template <int dim>
const Point<dim> & FEValues<dim>::quadrature_point (const unsigned int i) const {
Assert (i<n_quadrature_points, ExcInvalidIndex(i, n_quadrature_points));
- Assert (update_flags.update_q_points, ExcAccessToUninitializedField());
+ Assert (update_flags.q_points, ExcAccessToUninitializedField());
return quadrature_points[i];
};
template <int dim>
const Point<dim> & FEValues<dim>::ansatz_point (const unsigned int i) const {
Assert (i<ansatz_points.size(), ExcInvalidIndex(i, ansatz_points.size()));
- Assert (update_flags.update_ansatz_points, ExcAccessToUninitializedField());
+ Assert (update_flags.ansatz_points, ExcAccessToUninitializedField());
return ansatz_points[i];
};
template <int dim>
double FEValues<dim>::JxW (const unsigned int i) const {
Assert (i<n_quadrature_points, ExcInvalidIndex(i, n_quadrature_points));
- Assert (update_flags.update_JxW_values, ExcAccessToUninitializedField());
+ Assert (update_flags.JxW_values, ExcAccessToUninitializedField());
return JxW_values[i];
};
const FiniteElement<dim> &fe) {
// fill jacobi matrices and real
// quadrature points
- if (update_flags.update_jacobians || update_flags.update_q_points)
+ if (update_flags.jacobians || update_flags.q_points)
fe.fill_fe_values (cell,
unit_quadrature_points,
jacobi_matrices,
- update_flags.update_jacobians,
+ update_flags.jacobians,
ansatz_points,
- update_flags.update_ansatz_points,
+ update_flags.ansatz_points,
quadrature_points,
- update_flags.update_q_points);
+ update_flags.q_points);
// compute gradients on real element if
// requested
- if (update_flags.update_gradients)
+ if (update_flags.gradients)
{
- Assert (update_flags.update_jacobians, ExcCannotInitializeField());
+ Assert (update_flags.jacobians, ExcCannotInitializeField());
for (unsigned int i=0; i<fe.total_dofs; ++i)
for (unsigned int j=0; j<n_quadrature_points; ++j)
// refer to the general doc for
// why we take the inverse of the
// determinant
- if (update_flags.update_JxW_values)
+ if (update_flags.JxW_values)
{
- Assert (update_flags.update_jacobians,
+ Assert (update_flags.jacobians,
ExcCannotInitializeField());
for (unsigned int i=0; i<n_quadrature_points; ++i)
JxW_values[i] = weights[i] / jacobi_matrices[i].determinant();
difference.reserve (tria->n_cells());
FEValues<dim>::UpdateStruct update_flags;
- update_flags.update_q_points = true;
- update_flags.update_JxW_values = true;
+ update_flags.q_points = true;
+ update_flags.JxW_values = true;
FEValues<dim> fe_values(fe, q, update_flags);
// loop over all cells
QGauss4<2> quadrature;
-// HyperBallBoundary<2> boundary(Point<2>(2,3), 4);
-
cout << "Making grid..." << endl;
tria.create_hypercube ();
+// HyperBallBoundary<2> boundary(Point<2>(2,3), 4);
// tria.create_hyper_ball(Point<2>(2,3),4);
// tria.set_boundary (&boundary);
- tria.refine_global (1);
- (--tria.last_active())->set_refine_flag();
- tria.execute_refinement ();
+// tria.refine_global (1);
+// (--tria.last_active())->set_refine_flag();
+// tria.execute_refinement ();
// tria.begin_active(2)->set_refine_flag();
// tria.execute_refinement ();
- tria.refine_global (2);
+ tria.refine_global (3);
/*
const unsigned int dim=2;
tria.refine_global (1);
Triangulation<dim>::active_cell_iterator cell, endc;
- for (int i=0; i<12; ++i)
+ for (int i=0; i<8; ++i)
{
int n_levels = tria.n_levels();
cell = tria.begin_active();
cout << "Assembling matrices..." << endl;
FEValues<2>::UpdateStruct update_flags;
- update_flags.update_q_points = true;
- update_flags.update_gradients = true;
- update_flags.update_jacobians = true;
- update_flags.update_JxW_values = true;
- ProblemBase<2>::DirichletBC d;
- problem.assemble (equation, quadrature, fe, update_flags, d);
+ update_flags.q_points = true;
+ update_flags.gradients = true;
+ update_flags.jacobians = true;
+ update_flags.JxW_values = true;
+ ProblemBase<2>::DirichletBC dirichlet_bc;
+ problem.assemble (equation, quadrature, fe, update_flags, dirichlet_bc);
cout << "Solving..." << endl;
problem.solve ();