n_dofs.push_back (dof->n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
- update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_values | update_q_points |
+ update_gradients | update_JxW_values);
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = boundary_values;
n_dofs.push_back (dof->n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
- update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_values | update_q_points |
+ update_gradients | update_JxW_values);
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = solution_function;
n_dofs.push_back (dof->DoFHandler<dim>::n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
- update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_values | update_q_points |
+ update_gradients | update_JxW_values);
map<unsigned char,const Function<dim>*> dirichlet_bc;
dirichlet_bc[0] = boundary_values;
cout << " Nonlinear step " << nonlinear_step << endl;
cout << " Assembling matrices..." << endl;
assemble (equation, quadrature, fe,
- UpdateFlags(update_gradients | update_JxW_values |
- update_q_points),
+ UpdateFlags(update_values | update_gradients |
+ update_JxW_values | update_q_points),
dirichlet_bc);
cout << " Solving..." << endl;
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = boundary_values;
assemble (equation, quadrature,
- UpdateFlags(update_gradients | update_JxW_values |
- update_q_points),
+ UpdateFlags(update_values | update_gradients |
+ update_JxW_values | update_q_points),
dirichlet_bc);
cout << " Solving..." << endl;
// transformations from the unit
// cell to the real cells. The
// values of the shape functions
- // are always computed, so we don't
- // have to list them. The
+ // computed by specifying
+ // update_values; the gradients are
+ // done alike, using
+ // update_gradients. The
// determinants of the Jacobians
// and the weights are always used
// together, so only the products
// we also need them, we have to
// list them as well:
FEValues<2> fe_values (fe, quadrature_formula,
- UpdateFlags(update_gradients |
+ UpdateFlags(update_values |
+ update_gradients |
update_JxW_values));
// For use further down below, we
* Default: update nothing.
*/
update_default = 0,
+ /**
+ * Compute the values of the
+ * shape functions at the
+ * quadrature points on the
+ * real space cell. For the
+ * usual Lagrange elements,
+ * these values are equal to
+ * the values of the shape
+ * functions at the quadrature
+ * points on the unit cell, but
+ * they are different for more
+ * complicated elements, such
+ * as BDM or Raviart-Thomas
+ * elements.
+ */
+ update_values = 1,
/**
* Compute quadrature points in real
* space (not on unit cell).
*/
- update_q_points = 1,
+ update_q_points = 2,
/**
* Transform gradients on unit cell to
* gradients on real cell.
*/
- update_gradients = 2,
+ update_gradients = 4,
/**
* Compute jacobian matrices of the
* transform between unit and real cell
* in the evaluation points.
*/
- update_jacobians = 4,
+ update_jacobians = 8,
/**
* Compute the JxW values (Jacobian
* determinant at the quadrature point
* times the weight of this point).
*/
- update_JxW_values = 8,
+ update_JxW_values = 16,
/**
* Compute the points on the real cell
* on which the trial functions are
* in an error, since support points are
* not useful in that case.
*/
- update_support_points = 16,
+ update_support_points = 32,
/**
* Update the outward normal vectors
* to the face relative to this cell.
* an error, since normal vectors are
* not useful in that case.
*/
- update_normal_vectors = 32,
+ update_normal_vectors = 64,
/**
* Update the second derivatives of the
* shape functions on the real cell.
*/
- update_second_derivatives = 64
+ update_second_derivatives = 128
};
inline
const FullMatrix<double> & FEValuesBase<dim>::get_shape_values () const
{
+ Assert (update_flags & update_values, ExcAccessToUninitializedField());
Assert (selected_dataset<shape_values.size(),
ExcIndexRange (selected_dataset, 0, shape_values.size()));
return shape_values[selected_dataset];
template <int dim>
double FEValuesBase<dim>::shape_value (const unsigned int i,
const unsigned int j) const {
+ Assert (update_flags & update_values, ExcAccessToUninitializedField());
Assert (selected_dataset<shape_values.size(),
ExcIndexRange (selected_dataset, 0, shape_values.size()));
Assert (i<shape_values[selected_dataset].m(),
QTrapez<1> q_trapez;
QIterated<dim> points (q_trapez, accuracy);
- FEValues<dim> fe(dofs->get_fe(), points, UpdateFlags(update_q_points));
+ FEValues<dim> fe(dofs->get_fe(), points,
+ UpdateFlags(update_values | update_q_points));
vector< vector <Vector<double> > >
values (dof_data.size(),
vector< Vector<double> >(points.n_quadrature_points,
QIterated<dim> patch_points (q_trapez, n_subdivisions);
FEValues<dim> fe_patch_values (dof_handler->get_fe(),
patch_points,
- update_default);
+ update_values);
const unsigned int n_q_points = patch_points.n_quadrature_points;
vector<double> patch_values (n_q_points);
vector<Vector<double> > patch_values_system (n_q_points,
SparseMatrix<double> &matrix,
const Function<dim> * const a) {
Vector<double> dummy; // no entries, should give an error if accessed
- UpdateFlags update_flags = update_JxW_values;
+ UpdateFlags update_flags = UpdateFlags(update_values | update_JxW_values);
if (a != 0)
update_flags = UpdateFlags (update_flags | update_q_points);
const Assembler<dim>::AssemblerData data (dof,
const Function<dim> &rhs,
Vector<double> &rhs_vector,
const Function<dim> * const a) {
- UpdateFlags update_flags = UpdateFlags(update_q_points |
+ UpdateFlags update_flags = UpdateFlags(update_values |
+ update_q_points |
update_JxW_values);
const Assembler<dim>::AssemblerData data (dof,
true, true,
Vector<double> cell_vector(dofs_per_cell);
- UpdateFlags update_flags = UpdateFlags (update_JxW_values | update_q_points);
+ UpdateFlags update_flags = UpdateFlags (update_values |
+ update_JxW_values |
+ update_q_points);
FEFaceValues<dim> fe_values (fe, q, update_flags);
// two variables for the coefficient,
Assert (dof.get_fe().n_components() == rhs.n_components,
ExcComponentMismatch());
- UpdateFlags update_flags = UpdateFlags(update_q_points |
+ UpdateFlags update_flags = UpdateFlags(update_values |
+ update_q_points |
update_JxW_values);
SparseMatrix<double> dummy;
const Assembler<dim>::AssemblerData data (dof,
UpdateFlags update_flags = UpdateFlags (update_q_points |
update_JxW_values);
+ if (norm != H1_seminorm)
+ update_flags != update_values;
+
if ((norm==H1_seminorm) || (norm==H1_norm))
update_flags = UpdateFlags (update_flags | update_gradients);
+
FEValues<dim> fe_values(fe, q, update_flags);
vector< Vector<double> > function_values (n_q_points,
<code>
// Initialize the trial functions on the cell faces.
FEValues<2> fe_values(fe, quadrature,
- UpdateFlags(update_gradients | update_JxW_values));
+ UpdateFlags(update_values |
+ update_gradients |
+ update_JxW_values));
FEFaceValues<2> fe_face_values (fe, face_quadrature,
- UpdateFlags(update_JxW_values | update_q_points));
+ UpdateFlags(update_values |
+ update_JxW_values |
+ update_q_points));
</code>
</pre>
// transformations from the unit
// cell to the real cells. The
// values of the shape functions
- // are always computed, so we don't
- // have to list them. The
+ // computed by specifying
+ // update_values; the gradients are
+ // done alike, using
+ // update_gradients. The
// determinants of the Jacobians
// and the weights are always used
// together, so only the products
// we also need them, we have to
// list them as well:
FEValues<2> fe_values (fe, quadrature_formula,
- UpdateFlags(update_gradients |
+ UpdateFlags(update_values |
+ update_gradients |
update_JxW_values));
// For use further down below, we
n_dofs.push_back (dof->n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
- update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_values | update_q_points |
+ update_gradients | update_JxW_values);
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = boundary_values;
n_dofs.push_back (dof->n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
- update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_values | update_q_points |
+ update_gradients | update_JxW_values);
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = solution_function;
n_dofs.push_back (dof->DoFHandler<dim>::n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
- update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_values | update_q_points |
+ update_gradients | update_JxW_values);
map<unsigned char,const Function<dim>*> dirichlet_bc;
dirichlet_bc[0] = boundary_values;
cout << " Nonlinear step " << nonlinear_step << endl;
cout << " Assembling matrices..." << endl;
assemble (equation, quadrature, fe,
- UpdateFlags(update_gradients | update_JxW_values |
- update_q_points),
+ UpdateFlags(update_values | update_gradients |
+ update_JxW_values | update_q_points),
dirichlet_bc);
cout << " Solving..." << endl;
ProblemBase<dim>::FunctionMap dirichlet_bc;
dirichlet_bc[0] = boundary_values;
assemble (equation, quadrature,
- UpdateFlags(update_gradients | update_JxW_values |
- update_q_points),
+ UpdateFlags(update_values | update_gradients |
+ update_JxW_values | update_q_points),
dirichlet_bc);
cout << " Solving..." << endl;
primal_cell = primal_dof->begin_active();
FEValues<dim> fe_values (*fe, *quadrature,
- UpdateFlags(update_gradients |
+ UpdateFlags(update_values |
+ update_gradients |
update_JxW_values |
update_q_points));
FEValues<dim> fe_values_primal (*primal_fe, *quadrature,
- update_gradients);
+ UpdateFlags(update_values | update_gradients));
FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
vector<int> cell_dof_indices (dofs_per_cell);
FEFaceValues<dim> fe_face_values (*fe, *quadrature_face,
- UpdateFlags(update_JxW_values |
+ UpdateFlags(update_values |
+ update_JxW_values |
update_q_points));
for (; cell!=endc; ++cell)
endc = dof->end();
vector<int> dof_indices (fe->dofs_per_cell);
- FEFaceValues<dim> fe_face_values (*fe, *quadrature_face, update_JxW_values);
+ FEFaceValues<dim> fe_face_values (*fe, *quadrature_face, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell;
DoFHandler<dim>::active_cell_iterator cell = dof->begin_active (),
endc = dof->end ();
- FEValues<dim> fe_values (*fe, *quadrature, update_JxW_values);
+ FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
vector<int> cell_dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell)
endc = dof->end();
vector<int> dof_indices (fe->dofs_per_cell);
- FEValues<dim> fe_values (*fe, *quadrature, update_JxW_values);
+ FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
if ((cell->center()(0) > -0.6) &&
endc = dof->end();
vector<int> dof_indices (fe->dofs_per_cell);
- FEValues<dim> fe_values (*fe, *quadrature, update_JxW_values);
+ FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
if ((cell->center()(0) > -0.03) &&
endc = dof->end ();
FEValues<dim> fe_values (*fe, *quadrature,
- UpdateFlags(update_gradients |
+ UpdateFlags(update_values |
+ update_gradients |
update_JxW_values |
update_q_points));
FullMatrix<double> cell_matrix (fe->dofs_per_cell, fe->dofs_per_cell);
endc = dof->end();
double u_integrated=0;
FEFaceValues<dim> face_values (*fe, *quadrature_face,
- UpdateFlags(update_JxW_values|update_q_points));
+ UpdateFlags(update_values |
+ update_JxW_values |
+ update_q_points));
vector<double> face_u (fe->dofs_per_face);
for (; cell!=endc; ++cell)
DoFHandler<dim>::active_cell_iterator cell = dof->begin_active(),
endc = dof->end();
double u_integrated=0;
- FEFaceValues<dim> face_values (*fe, *quadrature_face, update_JxW_values);
+ FEFaceValues<dim> face_values (*fe, *quadrature_face, UpdateFlags(update_values | update_JxW_values));
vector<double> face_u (fe->dofs_per_face);
for (; cell!=endc; ++cell)
DoFHandler<1>::active_cell_iterator cell = dof->begin_active(),
endc = dof->end();
double u_integrated=0;
- FEValues<1> fe_values (*fe, *quadrature, update_JxW_values);
+ FEValues<1> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
vector<double> cell_u (fe->dofs_per_cell);
for (; cell!=endc; ++cell)
DoFHandler<1>::active_cell_iterator cell = dof->begin_active(),
endc = dof->end();
double u_integrated=0;
- FEValues<1> fe_values (*fe, *quadrature, UpdateFlags(update_JxW_values | update_q_points));
+ FEValues<1> fe_values (*fe, *quadrature,
+ UpdateFlags(update_values | update_JxW_values | update_q_points));
vector<double> cell_u (fe->dofs_per_cell);
for (; cell!=endc; ++cell)
FEValues<dim> fe_values (fe, quadrature,
- UpdateFlags(update_gradients |
+ UpdateFlags(update_values |
+ update_gradients |
update_JxW_values |
(!density_constant || !stiffness_constant ?
update_q_points :
// is expensive to create it for
// every cell
FEValues<dim> fe_values (fe, quadrature,
- UpdateFlags(update_gradients |
+ UpdateFlags(update_values |
+ update_gradients |
update_JxW_values |
update_q_points));
{
FEValues<dim> fe_values (dual_problem.fe,
dual_problem.quadrature,
- UpdateFlags(update_gradients |
+ UpdateFlags(update_values |
+ update_gradients |
update_second_derivatives |
update_JxW_values |
update_q_points));
// is expensive to create it for
// every cell
FEValues<dim> fe_values (fe, quadrature,
- UpdateFlags(update_gradients |
+ UpdateFlags(update_values |
+ update_gradients |
update_JxW_values |
update_q_points));
QTrapez<1> q_trapez;
QIterated<dim> q(q_trapez, div);
- FEValues<dim> fe(finel, q, UpdateFlags(update_default));
+ FEValues<dim> fe(finel, q, UpdateFlags(update_values));
sprintf(fname, "%s.dat", name);
ofstream gnuplot(fname);
QTrapez<1> q_trapez;
QIterated<dim> q(q_trapez, div);
FEValues<dim> fe(finel, q,
- UpdateFlags(update_q_points | update_JxW_values));
+ UpdateFlags(update_values | update_q_points | update_JxW_values));
fe.reinit(c);