Hi dealii users I need to constrain all the support points on a Q2 element instead of only vertices. The constrained values (inhomogeneity) are obtained from (conceptually) a function, say f(\bold{x}). I already know how to query the coordinates of the support points, I also know how to query their global dof numbers, but I do not know *how the dof numbers are ordered*: for example, what is the global dof number of the ith component of velocity at support point v? Especially my finite element consists of a 2nd order vector field (velocity) and a 1st order scalar field (pressure). Here is the code snippet:
Quadrature<dim> q(fe.base_element(0).get_unit_support_points()); // constraints will only be applied to the velocity dofs MappingQGeneric<dim> mapping(1); FEValues<dim> fe_values(mapping, fe.base_element(0), q, update_quadrature_points); std::vector<types::global_dof_index> dof_indices(fe.base_element(0).dofs_per_cell); for (auto cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell) { fe_values.reinit(cell); const vector<Point<dim>>& unit_points = fe.base_element(0).get_unit_support_points(); *cell->get_dof_indices(dof_indices, 0);* // query the global dof numbers on base element 0 for (unsigned int v = 0; v < unit_points.size(); ++v) { Point<dim> mapped_point = mapping.transform_unit_to_real_cell(cell, unit_points[i]); Vector<double> value = f(mapped_point); // Calculate the constrained value based on the real coordinates of a support point // set the inhomogeneity constraints on the velocity for (unsigned int i = 0; i < dim; ++i) { // Now that I have dof_indices as a vector, but which component correspond to the ith component of velocity at support point v? *auto line = dof_indices[?]* constraints.add_line(line); constraints.set_inhomogeneity(line, value[i]); } } } Another related question is that, my computational results are written in vtu format as Q1 elements, which makes the resolution very coarse. Is there a way to write the results as 2nd order elements (ParaView supports it)? I suppose the pressure component then needs to be interpolated as it is 1st order? Thank you very much! Jie -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.