Dear Buddies,
The following code  consulted  Michael  and  Ben's article.
Uniform meshes, apply periodic boundary on x=0 and x=1.0 in x direction.
1, question about Michael's code.
 if (elem->contains_point(point2))

//elem contains the opposite point
DofMap::DofConstraintRow constraint;
``````````````````````??? Is it correct?

dof_map.dof_indices (elem, dof_indices);

std::vector<Point> point2_vec(1);

point2_vec[0] = point2;
for (int i1 = 0; i1 < phi.size(); i1++)
const std::vector<Point >& qface_point = fe->get_xyz();
```````````??? qface_point is not use, what is it for?
if ( std::abs(phi[i1][0]) > func_tol ) constraint[dof_indices[i1]] = phi[i1][0];

2, The following is my code. But I can not get the correct periodic result on u in the direction x.
void apply_periodic_bc(EquationSystems &es, const std::string &system_name){
  PerfLog perf_log("Periodic bc. Assembly",false);
  const Mesh &mesh=es.get_mesh();
  LinearImplicitSystem &system=es.get_system<LinearImplicitSystem>("stokes_flow");
  DofMap &dof_map=system.get_dof_map();

  const double min_coord[2]={0.,0.};
  const double max_coord[2]={1.,1.};

  const double pos_tol=1e-10;

  // x direction periodic for u
  for(unsigned int n=0;n<mesh.n_nodes();n++){
    const Node& node1=mesh.node(n);
    if(std::abs(node1(0)-min_coord[0])<pos_tol)>pos_tol)){ // get node on the left boundary
      for(unsigned int n1=0;n1<mesh.n_nodes();n1++){
        const Node& node2=mesh.node(n1);
        if((std::abs(node2(0)-max_coord[0])<pos_tol)&&(std::abs(node1(1)-node2(1))<pos_tol)){ // get the corresponding right node
          unsigned int dnu1=node1.dof_number(0,0,0);
          unsigned int dnu2=node2.dof_number(0,0,0);
          DofConstraintRow constraint;