Dear Yves,

I think I have found a bug in accessing DOFs on regions and faces.

The setup is as follows : single segment mesh with HERMITE fem.
I create two mesh regions (for the left end node and for the right end node).

The output of the demo program (sent in attachment) is as follows:

-----------------------------------
$ ./dofs_of_region
DOFs on the left end : [0]
DOFs on the right end : [2]
DOFs on convex : 0 1 2 3
DOFs on face 0 of convex : 2
DOFs on face 1 of convex 0
-----------------------------------

DOFs on convex are listed properly as 0 1 2 3.
I would expect DOFs on left end region as well as dofs on face 1 of the convex
to be [0,1] and not just [0]. So it seems that the dofs for derivative degrees
of freedom are missing.

I have looked at code for dal::bit_vector mesh_fem::basic_dof_on_region()
but I do not see there provision for non-Lagrangian elements.

I can check if the fem of a convex is Lagrangian but what should be done
if it is not?

I am afraid that this can be a little pandora box :( but hope that this is
not) (in particular I have in mind the code for setting Dirichlet boundary
condition on Hermite elements).

In attachment there is mentioned test code to reproduce the bug.

Regards

Roman
-- 
Roman Putanowicz, PhD  < [email protected]  >
Institute for Computational Civil Engng (L-5)
Dept. of Civil Engng, Cracow Univ. of Technology
www.l5.pk.edu.pl, tel. +48 12 628 2569, fax 2034
/*
 * Author: Roman Putanowicz <[email protected]>
 * Created: Thu May 06 10:22:55 2010
 * Modified by:
 */

#include <stdlib.h> // for EXIT_SUCCESS
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include <string>

#include "getfem/getfem_model_solvers.h"
#include "getfem/getfem_models.h"
#include "getfem/getfem_export.h"
#include "getfem/getfem_regular_meshes.h"
#include "getfem/getfem_mesh_slice.h"
#include "getfem/bgeot_comma_init.h"
#include "getfem/getfem_mesh_fem_global_function.h"
#include "getfem/bgeot_geometric_trans.h"
#include "gmm/gmm.h"
#include <string>

int main_body(int argc, char** argv);

/** main function
 * 
 * This function should contain command line parsing and initialization
 * code. The real work should be done by calling main_body().
 */
int main(int argc, char **argv) {
  int result =  EXIT_SUCCESS;
  result = main_body(argc, argv);

  return result;
}

/** The function where the main work is done after configuration
 * and command line parsing.
 */
int main_body(int argc, char** argv) {
  try {  

    getfem::mesh mesh;
    std::vector<getfem::size_type> nsubdiv(1, 1);

    getfem::regular_unit_mesh(mesh, nsubdiv, 
                              bgeot::geometric_trans_descriptor("GT_PK(1,1)"));

    /* create two regions -- for the left node and for the right node */
    getfem::mesh_region leftEnd = mesh.region(1);
    getfem::mesh_region rightEnd = mesh.region(2);

    /* Find number of points in the mesh */
    getfem::size_type nnodes = mesh.nb_points();

    getfem::size_type leftNode = 0;
    getfem::size_type rightNode = nnodes-1;
 
    getfem::size_type leftConvex = mesh.first_convex_of_point(leftNode);
    getfem::size_type rightConvex = mesh.first_convex_of_point(rightNode);
    
    getfem::size_type leftFace = 1;
    getfem::size_type rightFace = 0;

    leftEnd.add(leftConvex, leftFace);
    rightEnd.add(rightConvex, rightFace);

    getfem::mesh_fem fem(mesh);
    fem.set_finite_element(getfem::fem_descriptor("FEM_HERMITE(1)"));

    std::cout << "DOFs on the left end : "
              << fem.dof_on_region(1) << "\n"; 
    std::cout << "DOFs on the right end : "
              << fem.dof_on_region(2) << "\n"; 

    getfem::mesh_fem::ind_dof_ct ct= fem.ind_basic_dof_of_element(0);
    std::cout << "DOFs on convex : " ;
      for (getfem::size_type i=0; i<ct.size(); i++) {
         std::cout << (int) ct[i] << " ";
      }
      std::cout << "\n";
  
    getfem::mesh_fem::ind_dof_face_ct ctf= fem.ind_basic_dof_of_face_of_element(0,0);
    std::cout << "DOFs on face of convex : " ;
      for (getfem::size_type i=0; i<ctf.size(); i++) {
         std::cout << (int) ctf[i] << " ";
      }
      std::cout << "\n";
    std::cout << "DOFs on face of convex " ;
    ctf= fem.ind_basic_dof_of_face_of_element(0,1);
      for (getfem::size_type i=0; i<ctf.size(); i++) {
         std::cout << (int) ctf[i] << " ";
      }
      std::cout << "\n";
    return EXIT_SUCCESS;
  } GMM_STANDARD_CATCH_ERROR;
 
  return EXIT_FAILURE;
}
_______________________________________________
Getfem-users mailing list
[email protected]
https://mail.gna.org/listinfo/getfem-users

Reply via email to