/* * Author: Roman Putanowicz * Created: Thu May 06 10:22:55 2010 * Modified by: */ #include // for EXIT_SUCCESS #include #include #include #include #include #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 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 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