Dear Users/Developers Please suggest me about this pointer error I have almost resolved all the issues by shifting to Ubuntu system I am following error unable to remove
$ g++ -I /usr/local/include -std=c++11 -L /usr/local/lib/libgetfem.a -o result laplacian.cc laplacian.cc: In member function ‘void laplacian_problem::init()’: laplacian.cc:149:3: error: expected primary-expression before ‘getfem’ getfem::pfem pf_u = getfem::fem_descriptor(FEM_TYPE); laplacian.cc:153:48: error: ‘pf_u’ was not declared in this scope mf_u.set_finite_element(mesh.convex_index(), pf_u); this all was due to a pointer decleration pf_u which my system is not recognizing. My complier version is gcc version 5.2.1 20151028 (Ubuntu 5.2.1-23ubuntu1~15.10) as it was previously advised that i have to update my complier so i updated it to this new one and also shifted to ubuntu. I there a way to solve this issue. thanks in advance ASIM ULLAH KHAN Subject: Re: [Getfem-users] file error(compilation) To: [email protected]; [email protected] From: [email protected] Date: Mon, 30 May 2016 10:06:34 +0200 Dear Asim, the macro `GMM_STANDARD_CATCH_ERROR` has only to be used with a try instruction try { .. C++-commands ... } GMM_STANDARD_CATCH_ERROR; but this is not mandatory at all. Yves. Le 28/05/2016 21:15, asim ullah khan a écrit : Dear Expert users, thanks fro the prompt reply. I have written the following command on my command line g++ -std=c++11 -I /usr/local/include -o result.o (my include directory has following three folders 1- getfem 2-gmm 3- getfem_boost ) Now some error hs been solved but still some exist is that due to some wrong making of library Although it has passed 37 test out of 38 results. error list is as under laplacian.cc: In member function ‘void laplacian_problem::init()’: laplacian.cc:122:37: error: expected primary-expression before ‘catch’ std::vector<size_type> nsubdiv(N);GMM_STANDARD_CATCH_ERROR ^ laplacian.cc:122:37: error: expected primary-expression before ‘catch’ std::vector<size_type> nsubdiv(N);GMM_STANDARD_CATCH_ERROR ^ laplacian.cc:122:37: error: expected primary-expression before ‘catch’ std::vector<size_type> nsubdiv(N);GMM_STANDARD_CATCH_ERROR ^ laplacian.cc:122:37: error: expected primary-expression before ‘catch’ std::vector<size_type> nsubdiv(N);GMM_STANDARD_CATCH_ERROR ^ laplacian.cc:122:37: error: expected primary-expression before ‘catch’ std::vector<size_type> nsubdiv(N);GMM_STANDARD_CATCH_ERROR ^ laplacian.cc:122:37: error: expected primary-expression before ‘catch’ std::vector<size_type> nsubdiv(N);GMM_STANDARD_CATCH_ERROR ^ laplacian.cc:122:37: error: expected primary-expression before ‘catch’ std::vector<size_type> nsubdiv(N);GMM_STANDARD_CATCH_ERROR ^ laplacian.cc: In member function ‘void laplacian_problem::assembly()’: laplacian.cc:196:38: error: ‘o’ was not declared in this scope size_type nb_dof = mf_u.nb_dof();1-o=c++11 ^ laplacian.cc:196:40: error: ‘c’ was not declared in this scope size_type nb_dof = mf_u.nb_dof();1-o=c++11 ^ laplacian.cc:209:30: error: ‘nb_dof_rhs’ was not declared in this scope std::vector<scalar_type> F(nb_dof_rhs); ^ laplacian.cc: In member function ‘bool laplacian_problem::solve()’: laplacian.cc:291:54: error: ‘o’ was not declared in this scope << gmm::uclock_sec() - time << " seconds\n";1-o=c++11 ^ laplacian.cc:291:56: error: ‘c’ was not declared in this scope << gmm::uclock_sec() - time << " seconds\n";1-o=c++11 I have been stuck with this library from two weeks. so I must to produce some result to defey my claim for using this library for my PhD work. thanking in advance regards ASIM ULLAH KHAN From: [email protected] To: [email protected] Subject: Re: [Getfem-users] file error(compilation) Date: Sat, 28 May 2016 15:00:07 +0000 Dear Asim, You forgot to mention the include directory in the line you use to compile, you should add to that line -I/yourincludepath. For example in my case I compile with g++ -o output.o laplacian.cc -I/usr/local/getfem-4.3-11/include Also, when you create the executable file, you should add the linking directory with -L/yourlinkpath, which in my case is /usr/local/getfem-4.3-11/lib/libgetfem.a So to create an executable out of laplacian.cc, I would do g++ -o output laplacian.cc -I/usr/local/getfem-4.3-11/include -L/usr/local/getfem-4.3-11/lib/libgetfem.a Of course in your case the directories will be different. Best, Bianca Il giorno 28 mag 2016, alle ore 15:35, asim ullah khan <[email protected]> ha scritto: Respected Users, I have followed following steps 1- first i configure using command given on webpage 2- i make and than make test 3- i make install (my test report passed 37 out of 38 tests) after that i want to make some basic program in getfem++, so for understanding the method of writing program i picked one example from test folder and copied it to /document/test1 i picked two files laplacian.cc and laplacian.pram than i have given the following command on my terminal g++ -o output.o laplacian.cc (same command is also tried with 'make laplacian' ) follwing list of error generated as below error In file included from /usr/local/include/getfem/getfem_mesh_slice.h:40:0, from /usr/local/include/getfem/getfem_export.h:42, from laplacian.cc:35: /usr/local/include/getfem/getfem_mesh_slicers.h:450:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type std::unique_ptr<const mesh_slice_cv_dof_data_base> mfU; ^ /usr/local/include/getfem/getfem_mesh_slicers.h: In constructor ‘getfem::slicer_isovalues::slicer_isovalues(const getfem::mesh_slice_cv_dof_data_base&, bgeot::scalar_type, int)’: /usr/local/include/getfem/getfem_mesh_slicers.h:468:31: error: class ‘getfem::slicer_isovalues’ does not have any field named ‘mfU’ slicer_volume(orient_), mfU(mfU_.clone()), val(val_) { ^ In file included from /usr/local/include/gmm/gmm_ref.h:46:0, from /usr/local/include/gmm/gmm_def.h:40, from /usr/local/include/gmm/gmm_kernel.h:41, from /usr/local/include/getfem/getfem_assembling_tensors.h:40, from /usr/local/include/getfem/getfem_assembling.h:44, from laplacian.cc:34: /usr/local/include/getfem/getfem_mesh_slicers.h:469:7: error: ‘mfU’ was not declared in this scope GMM_ASSERT1(mfU->pmf->get_qdim() == 1, ^ In file included from /usr/local/include/getfem/getfem_mesh_slice.h:40:0, from /usr/local/include/getfem/getfem_export.h:42, from laplacian.cc:35: /usr/local/include/getfem/getfem_mesh_slicers.h:471:23: error: ‘mfU’ was not declared in this scope val_scaling = mfU->maxval(); ^ In file included from laplacian.cc:35:0: /usr/local/include/getfem/getfem_export.h: At global scope: /usr/local/include/getfem/getfem_export.h:73:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type std::unique_ptr<mesh_fem> pmf; ^ /usr/local/include/getfem/getfem_export.h: In member function ‘void getfem::vtk_export::write_point_data(const getfem::mesh_fem&, const VECT&, const string&)’: /usr/local/include/getfem/getfem_export.h:203:34: error: ‘pmf’ was not declared in this scope std::vector<scalar_type> V(pmf->nb_dof() * Q); ^ /usr/local/include/getfem/getfem_export.h: In member function ‘void getfem::vtk_export::write_dataset_(const VECT&, const string&, bgeot::size_type, bool)’: /usr/local/include/getfem/getfem_export.h:240:22: error: ‘pmf’ was not declared in this scope : pmf->linked_mesh().convex_index().card(); ^ /usr/local/include/getfem/getfem_export.h: At global scope: /usr/local/include/getfem/getfem_export.h:296:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type std::unique_ptr<mesh_fem> pmf; ^ /usr/local/include/getfem/getfem_export.h: In member function ‘void getfem::dx_export::write_point_data(const getfem::mesh_fem&, const VECT&, std::__cxx11::string)’: /usr/local/include/getfem/getfem_export.h:449:34: error: ‘pmf’ was not declared in this scope std::vector<scalar_type> V(pmf->nb_dof() * Q); ^ /usr/local/include/getfem/getfem_export.h: In member function ‘void getfem::dx_export::write_dataset_(const VECT&, std::__cxx11::string, bool)’: /usr/local/include/getfem/getfem_export.h:485:22: error: ‘pmf’ was not declared in this scope : pmf->linked_mesh().convex_index().card(); ^ /usr/local/include/getfem/getfem_export.h: At global scope: /usr/local/include/getfem/getfem_export.h:551:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type std::unique_ptr<mesh_fem> pmf; ^ /usr/local/include/getfem/getfem_export.h: In member function ‘void getfem::pos_export::write(const getfem::mesh_fem&, const VECT&, const string&)’: /usr/local/include/getfem/getfem_export.h:616:34: error: ‘pmf’ was not declared in this scope std::vector<scalar_type> V(pmf->nb_dof()*qdim_u); ^ laplacian.cc: At global scope: laplacian.cc:76:27: error: ‘std’ does not name a type struct laplacian_problem {std ^ laplacian.cc: In member function ‘void laplacian_problem::init()’: laplacian.cc:149:3: error: expected primary-expression before ‘getfem’ getfem::pfem pf_u = getfem::fem_descriptor(FEM_TYPE); ^ laplacian.cc:153:48: error: ‘pf_u’ was not declared in this scope mf_u.set_finite_element(mesh.convex_index(), pf_u); ^ laplacian.cc:190:19: error: ‘NEUMANN_BOUNDARY_NUM’ was not declared in this scope mesh.region(NEUMANN_BOUNDARY_NUM).add(i.cv(), i.f()); ^ laplacian.cc:192:19: error: ‘DIRICHLET_BOUNDARY_NUM’ was not declared in this scope mesh.region(DIRICHLET_BOUNDARY_NUM).add(i.cv(), i.f()); ^ laplacian.cc: In member function ‘void laplacian_problem::assembly()’: laplacian.cc:219:6: error: ‘NEUMANN_BOUNDARY_NUM’ was not declared in this scope NEUMANN_BOUNDARY_NUM); ^ laplacian.cc:226:9: error: ‘DIRICHLET_BOUNDARY_NUM’ was not declared in this scope DIRICHLET_BOUNDARY_NUM, D); ^ laplacian.cc:239:18: error: ‘DIRICHLET_BOUNDARY_NUM’ was not declared in this scope mf_rhs, F, DIRICHLET_BOUNDARY_NUM); than i also tried to build by using -std=c++11 switch but folllowing list of errors are listed laplacian.cc:76:27: error: ‘std’ does not name a type struct laplacian_problem {std ^ laplacian.cc: In member function ‘void laplacian_problem::init()’: laplacian.cc:149:3: error: expected primary-expression before ‘getfem’ getfem::pfem pf_u = getfem::fem_descriptor(FEM_TYPE); ^ laplacian.cc:153:48: error: ‘pf_u’ was not declared in this scope mf_u.set_finite_element(mesh.convex_index(), pf_u); ^ laplacian.cc:190:19: error: ‘NEUMANN_BOUNDARY_NUM’ was not declared in this scope mesh.region(NEUMANN_BOUNDARY_NUM).add(i.cv(), i.f()); ^ laplacian.cc:192:19: error: ‘DIRICHLET_BOUNDARY_NUM’ was not declared in this scope mesh.region(DIRICHLET_BOUNDARY_NUM).add(i.cv(), i.f()); ^ laplacian.cc: In member function ‘void laplacian_problem::assembly()’: laplacian.cc:219:6: error: ‘NEUMANN_BOUNDARY_NUM’ was not declared in this scope NEUMANN_BOUNDARY_NUM); ^ laplacian.cc:226:9: error: ‘DIRICHLET_BOUNDARY_NUM’ was not declared in this scope DIRICHLET_BOUNDARY_NUM, D); ^ laplacian.cc:239:18: error: ‘DIRICHLET_BOUNDARY_NUM’ was not declared in this scope mf_rhs, F, DIRICHLET_BOUNDARY_NUM); can you help me in understanding the problem. I am not so good in programming at advance level. I there any problem while reading the file from parameter file Is there also any compiled tutorials for getfem++ using C++ without any interface. thanking in advance REgards ASIM ULLAH KHAN Subject: Re: [Getfem-users] any comprehensive guide To: [email protected]; [email protected] From: [email protected] Date: Fri, 27 May 2016 08:15:07 +0200 Dear Asim Ullah Khan, It should work if you performed a "make install". Can you report the error you got ? Yves. Le 26/05/2016 17:55, asim ullah khan a écrit : Respected group memebers Is there any detailed guide for getfem with steps to follow for making a fem program. The examples given in test code i tried to compiled them using eclipse but i am not successful. I m newbe to ubuntu and has just shifted from windows. I am copying test files with parameter file in the seperate folder and than open that file in eclipse CDT for c++ and than try to understand and when i issue the command $ g++ -std=c++11 inputfilename.cc -o outputfilename.o i get compilation failed although all library files are already in the include folder (I m using ubuntu 15.10) Is there any detailed document to describe the step to follow for compiling the files and detailed tutorials set. Regards ASIM ULLAH KHAN _______________________________________________ Getfem-users mailing list [email protected] https://mail.gna.org/listinfo/getfem-users -- Yves Renard ([email protected]) tel : (33) 04.72.43.87.08 Pole de Mathematiques, INSA-Lyon fax : (33) 04.72.43.85.29 20, rue Albert Einstein 69621 Villeurbanne Cedex, FRANCE http://math.univ-lyon1.fr/~renard --------- _______________________________________________ Getfem-users mailing list [email protected] https://mail.gna.org/listinfo/getfem-users _______________________________________________ Getfem-users mailing list [email protected] https://mail.gna.org/listinfo/getfem-users -- Yves Renard ([email protected]) tel : (33) 04.72.43.87.08 Pole de Mathematiques, INSA-Lyon fax : (33) 04.72.43.85.29 20, rue Albert Einstein 69621 Villeurbanne Cedex, FRANCE http://math.univ-lyon1.fr/~renard ---------
_______________________________________________ Getfem-users mailing list [email protected] https://mail.gna.org/listinfo/getfem-users
