A number of odd errors for executing the simulation code with libmesh!
I am starting to execute simulations with libmesh-1.3.0 on ubuntu 16.04, in the step of making I have got a number of errors that I could not understand why they appear and how to debug them. These simulation codes were executed with the old version of libmesh on ubuntu 12! May I ask your suggestion? You can find the error messages as below:
Compiling C++ (in optimized mode) petsc_shell_solver.C... mpicxx -DNDEBUG -std=gnu++11 -O2 -felide-constructors -funroll-loops -fstrict-aliasing -Wdisabled-optimization -Wno-variadic-macros -fopenmp -I/home/niloufar/simulation/libmesh-1.3.0/CONF/include -I/usr/include/vtk-5.10 -I/home/niloufar/simulation/petsc-3.8.4/include -I/home/niloufar/simulation/petsc-3.8.4/linux-gnu-c-debug/include -I/usr/include -c petsc_shell_solver.C -o petsc_shell_solver.x86_64-unknown-linux-gnu.opt.o In file included from shellelement.h:21:0, from shellsystem.h:23, from steady_shellsystem.h:19, from petsc_shell_solver.C:30: BoundingBox.h:19:34: error: ‘RealVectorValue’ does not name a type void update_from_triangle(const RealVectorValue& V1, const RealVectorValue& V2, const RealVectorValue& V3, const double thickness) ^ BoundingBox.h:19:61: error: ‘RealVectorValue’ does not name a type void update_from_triangle(const RealVectorValue& V1, const RealVectorValue& V2, const RealVectorValue& V3, const double thickness) ^ BoundingBox.h:19:88: error: ‘RealVectorValue’ does not name a type void update_from_triangle(const RealVectorValue& V1, const RealVectorValue& V2, const RealVectorValue& V3, const double thickness) ^ In file included from shellelement.h:21:0, from shellsystem.h:23, from steady_shellsystem.h:19, from petsc_shell_solver.C:30: BoundingBox.h:29:32: error: ‘RealVectorValue’ does not name a type void update_from_sphere(const RealVectorValue& P, double radius) ^ BoundingBox.h: In member function ‘void BoundingBox::update_from_triangle(const int&, const int&, const int&, double)’: BoundingBox.h:21:26: error: expression cannot be used as a function mmin[0] = std::min(V1(0),std::min(V2(0),V3(0))) - thickness; ^ BoundingBox.h:21:41: error: expression cannot be used as a function mmin[0] = std::min(V1(0),std::min(V2(0),V3(0))) - thickness; ^ BoundingBox.h:21:47: error: expression cannot be used as a function mmin[0] = std::min(V1(0),std::min(V2(0),V3(0))) - thickness; ^ BoundingBox.h:22:26: error: expression cannot be used as a function mmin[1] = std::min(V1(1),std::min(V2(1),V3(1))) - thickness; ^ BoundingBox.h:22:41: error: expression cannot be used as a function mmin[1] = std::min(V1(1),std::min(V2(1),V3(1))) - thickness; ^ BoundingBox.h:22:47: error: expression cannot be used as a function mmin[1] = std::min(V1(1),std::min(V2(1),V3(1))) - thickness; ^ BoundingBox.h:23:26: error: expression cannot be used as a function mmin[2] = std::min(V1(2),std::min(V2(2),V3(2))) - thickness; ^ BoundingBox.h:23:41: error: expression cannot be used as a function mmin[2] = std::min(V1(2),std::min(V2(2),V3(2))) - thickness; ^ BoundingBox.h:23:47: error: expression cannot be used as a function mmin[2] = std::min(V1(2),std::min(V2(2),V3(2))) - thickness; ^ BoundingBox.h:25:26: error: expression cannot be used as a function mmax[0] = std::max(V1(0),std::max(V2(0),V3(0))) + thickness; ^ BoundingBox.h:25:41: error: expression cannot be used as a function mmax[0] = std::max(V1(0),std::max(V2(0),V3(0))) + thickness; ^ BoundingBox.h:25:47: error: expression cannot be used as a function mmax[0] = std::max(V1(0),std::max(V2(0),V3(0))) + thickness; ^ BoundingBox.h:26:26: error: expression cannot be used as a function mmax[1] = std::max(V1(1),std::max(V2(1),V3(1))) + thickness; ^ BoundingBox.h:26:41: error: expression cannot be used as a function mmax[1] = std::max(V1(1),std::max(V2(1),V3(1))) + thickness; ^ BoundingBox.h:26:47: error: expression cannot be used as a function mmax[1] = std::max(V1(1),std::max(V2(1),V3(1))) + thickness; ^ BoundingBox.h:27:26: error: expression cannot be used as a function mmax[2] = std::max(V1(2),std::max(V2(2),V3(2))) + thickness; ^ BoundingBox.h:27:41: error: expression cannot be used as a function mmax[2] = std::max(V1(2),std::max(V2(2),V3(2))) + thickness; ^ BoundingBox.h:27:47: error: expression cannot be used as a function mmax[2] = std::max(V1(2),std::max(V2(2),V3(2))) + thickness; ^ BoundingBox.h: In member function ‘void BoundingBox::update_from_sphere(const int&, double)’: BoundingBox.h:31:16: error: expression cannot be used as a function mmin[0] = P(0)-radius; ^ BoundingBox.h:32:16: error: expression cannot be used as a function mmin[1] = P(1)-radius; ^ BoundingBox.h:33:16: error: expression cannot be used as a function mmin[2] = P(2)-radius; ^ BoundingBox.h:35:16: error: expression cannot be used as a function mmax[0] = P(0)+radius; ^ BoundingBox.h:36:16: error: expression cannot be used as a function mmax[1] = P(1)+radius; ^ BoundingBox.h:37:16: error: expression cannot be used as a function mmax[2] = P(2)+radius; ^ In file included from shellsystem.h:23:0, from steady_shellsystem.h:19, from petsc_shell_solver.C:30: shellelement.h: At global scope: shellelement.h:34:8: error: ‘Elem’ does not name a type const Elem* elem; ^ shellelement.h:35:2: error: ‘FEBase’ does not name a type FEBase* element_fe; ^ shellelement.h:40:2: error: ‘RealVectorValue’ does not name a type RealVectorValue current_position[3]; ^ shellelement.h:41:2: error: ‘RealVectorValue’ does not name a type RealVectorValue current_velocity[3]; ^ shellelement.h:44:2: error: ‘RealVectorValue’ does not name a type RealVectorValue load; ^ shellelement.h:45:2: error: ‘RealVectorValue’ does not name a type RealVectorValue normal; ^ shellelement.h:49:14: error: ‘Node’ was not declared in this scope std::vector<Node*> node_patch; ^ shellelement.h:49:14: note: suggested alternatives: In file included from /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/elem.h:29:0, from shellelement.h:19, from shellsystem.h:23, from steady_shellsystem.h:19, from petsc_shell_solver.C:30: /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/node.h:52:7: note: ‘libMesh::Node’ class Node : public Point, ^ /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/node.h:52:7: note: ‘libMesh::Node’ In file included from shellsystem.h:23:0, from steady_shellsystem.h:19, from petsc_shell_solver.C:30: shellelement.h:49:19: error: template argument 1 is invalid std::vector<Node*> node_patch; ^ shellelement.h:49:19: error: template argument 2 is invalid shellelement.h: In constructor ‘ShellCacheObj::ShellCacheObj()’: shellelement.h:32:41: error: ‘element_fe’ was not declared in this scope ShellCacheObj() {initialized = false; element_fe=NULL; load.zero(); exclude=false;} ^ shellelement.h:32:58: error: ‘load’ was not declared in this scope ShellCacheObj() {initialized = false; element_fe=NULL; load.zero(); exclude=false;} ^ shellelement.h: In destructor ‘ShellCacheObj::~ShellCacheObj()’: shellelement.h:33:48: error: ‘element_fe’ was not declared in this scope ~ShellCacheObj() { if (initialized) { delete element_fe; element_fe = NULL; initialized=false; }} ^ shellelement.h: At global scope: shellelement.h:80:2: error: ‘RealVectorValue’ does not name a type RealVectorValue acov[3]; ^ shellelement.h:81:2: error: ‘RealVectorValue’ does not name a type RealVectorValue acon[3]; ^ shellelement.h:82:2: error: ‘RealVectorValue’ does not name a type RealVectorValue acov2[2][2]; ^ shellelement.h:83:2: error: ‘RealVectorValue’ does not name a type RealVectorValue amixed2[2][2]; ^ shellelement.h:85:2: error: ‘DenseMatrix’ does not name a type DenseMatrix<Real> amcon; ^ shellelement.h:86:2: error: ‘DenseMatrix’ does not name a type DenseMatrix<Real> amcov; ^ shellelement.h:87:2: error: ‘DenseMatrix’ does not name a type DenseMatrix<Real> bcov; ^ shellelement.h:88:2: error: ‘DenseMatrix’ does not name a type DenseMatrix<Real> bmixed; ^ shellelement.h:91:2: error: ‘Point’ does not name a type Point xyz; ^ shellelement.h: In member function ‘void SurfaceMetric::print()’: shellelement.h:61:3: error: ‘acov’ was not declared in this scope acov[0].print(std::cout); ^ shellelement.h:65:3: error: ‘acov2’ was not declared in this scope acov2[0][0].print(std::cout); ^ shellelement.h:70:3: error: ‘amcov’ was not declared in this scope amcov.print(std::cout); ^ shellelement.h:71:3: error: ‘amcon’ was not declared in this scope amcon.print(std::cout); ^ shellelement.h: In constructor ‘SurfaceMetric::SurfaceMetric()’: shellelement.h:75:3: error: ‘amcon’ was not declared in this scope amcon.resize(2,2); ^ shellelement.h:76:3: error: ‘amcov’ was not declared in this scope amcov.resize(2,2); ^ shellelement.h:77:3: error: ‘bcov’ was not declared in this scope bcov.resize(2,2); ^ shellelement.h:78:3: error: ‘bmixed’ was not declared in this scope bmixed.resize(2,2); ^ In file included from shellsystem.h:23:0, from steady_shellsystem.h:19, from petsc_shell_solver.C:30: shellelement.h: At global scope: shellelement.h:187:20: error: ‘Elem’ does not name a type void reinit(const Elem e); ^ shellelement.h:207:2: error: ‘DenseVector’ does not name a type DenseVector<Number> mass; ^ shellelement.h:208:2: error: ‘DenseVector’ does not name a type DenseVector<Number> residual; ^ shellelement.h:209:2: error: ‘DenseMatrix’ does not name a type DenseMatrix<Number> jacobian; ^ shellelement.h:211:2: error: ‘DenseSubVector’ does not name a type DenseSubVector<Number> * subresidual_u; ^ shellelement.h:212:2: error: ‘DenseSubVector’ does not name a type DenseSubVector<Number> * subresidual_v; ^ shellelement.h:213:2: error: ‘DenseSubVector’ does not name a type DenseSubVector<Number> * subresidual_w; ^ shellelement.h:219:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_uu; ^ shellelement.h:220:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_uv; ^ shellelement.h:221:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_uw; ^ shellelement.h:222:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_vu; ^ shellelement.h:223:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_vv; ^ shellelement.h:224:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_vw; ^ shellelement.h:225:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_wu; ^ shellelement.h:226:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_wv; ^ shellelement.h:227:2: error: ‘DenseSubMatrix’ does not name a type DenseSubMatrix<Number> * subjacobian_ww; ^ shellelement.h:239:2: error: ‘RealVectorValue’ does not name a type RealVectorValue chris(int u, int d); ^ shellelement.h:242:39: error: ‘Point’ has not been declared void calculate_growth_transformation(Point p); ^ shellelement.h:244:17: error: ‘RealTensorValue’ has not been declared void setupHmat(RealTensorValue& H); ^ shellelement.h:255:17: error: ‘RealTensorValue’ has not been declared void cross_mat(RealTensorValue& M, RealVectorValue& v); ^ shellelement.h:255:37: error: ‘RealVectorValue’ has not been declared void cross_mat(RealTensorValue& M, RealVectorValue& v); ^ shellelement.h:256:2: error: ‘RealTensorValue’ does not name a type RealTensorValue cross_mat(RealVectorValue& v); ^ shellelement.h:257:17: error: ‘RealTensorValue’ has not been declared void dyad_prod(RealTensorValue& w, RealVectorValue& u, RealVectorValue& v); ^ shellelement.h:257:37: error: ‘RealVectorValue’ has not been declared void dyad_prod(RealTensorValue& w, RealVectorValue& u, RealVectorValue& v); ^ shellelement.h:257:57: error: ‘RealVectorValue’ has not been declared void dyad_prod(RealTensorValue& w, RealVectorValue& u, RealVectorValue& v); ^ shellelement.h:258:2: error: ‘RealTensorValue’ does not name a type RealTensorValue dyad_prod(RealVectorValue& u, RealVectorValue& v); ^ shellelement.h:261:2: error: ‘FEBase’ does not name a type FEBase element_fe; ^ shellelement.h:263:8: error: ‘Elem’ does not name a type const Elem elem; ^ shellelement.h:271:2: error: ‘DenseMatrix’ does not name a type DenseMatrix<Real> GI, GIT; ^ shellelement.h:272:2: error: ‘RealTensorValue’ does not name a type RealTensorValue GV; ^ shellelement.h:290:2: error: ‘FEType’ does not name a type FEType fe_type; ^ In file included from shellsystem.h:32:0, from steady_shellsystem.h:19, from petsc_shell_solver.C:30: shellmeasurementsystem.h:33:1: error: expected class-name before ‘{’ token { ^ shellmeasurementsystem.h:36:41: error: expected ‘)’ before ‘&’ token ShellMeasurementSystem (EquationSystems& es, const std::string& name, const unsigned int number); ^ shellmeasurementsystem.h:40:10: error: ‘ExplicitSystem’ does not name a type typedef ExplicitSystem Parent; ^ shellmeasurementsystem.h:42:2: error: ‘DenseVector’ does not name a type DenseVector<Real> avg_weights; ^ shellmeasurementsystem.h:47:31: error: ‘Elem’ does not name a type void add_element_value(const Elem el, int var, double value); ^ shellmeasurementsystem.h:48:29: error: ‘Node’ does not name a type void add_nodal_value(const Node node, int var, double value); ^ In file included from steady_shellsystem.h:19:0, from petsc_shell_solver.C:30: shellsystem.h:40:1: error: expected class-name before ‘{’ token { ^ shellsystem.h:61:30: error: expected ‘)’ before ‘&’ token ShellSystem (EquationSystems& es, const std::string& name, const unsigned int number); ^ shellsystem.h:65:10: error: ‘ImplicitSystem’ does not name a type typedef ImplicitSystem Parent; ^ In file included from steady_shellsystem.h:19:0, from petsc_shell_solver.C:30: shellsystem.h:85:2: error: ‘AutoPtr’ does not name a type AutoPtr<ShellElement> shellelement; ^ shellsystem.h:89:37: error: ‘Elem’ does not name a type ShellCacheObj get_cache_obj(const Elem elem) const; ^ shellsystem.h:90:27: error: ‘Elem’ does not name a type bool has_cache_obj(const Elem elem) const; ^ shellsystem.h:91:27: error: ‘Elem’ does not name a type void add_cache_obj(const Elem elem, ShellCacheObj obj); ^ shellsystem.h:104:2: error: ‘Real’ does not name a type Real time; ^ shellsystem.h:109:2: error: ‘Real’ does not name a type Real deltat; ^ shellsystem.h:119:2: error: ‘Parameters’ does not name a type Parameters& parameters(){ ^ shellsystem.h:123:2: error: ‘Parameters’ does not name a type Parameters& parameters() const { ^ shellsystem.h:127:2: error: ‘Parameters’ does not name a type Parameters& parameters(Parameters& param){ ^ shellsystem.h:162:2: error: ‘Parameters’ does not name a type Parameters param_; ^ In file included from steady_shellsystem.h:19:0, from petsc_shell_solver.C:30: shellsystem.h:82:104: error: ‘EquationSystems’ has not been declared void write(const std::string &name, const libMeshEnums::XdrMODE mode, const unsigned int write_flags=(EquationSystems::WRITE_DATA)) const; ^ In file included from steady_shellsystem.h:19:0, from petsc_shell_solver.C:30: shellsystem.h:83:102: error: ‘EquationSystems’ has not been declared void read(const std::string &name, const libMeshEnums::XdrMODE mode, const unsigned int read_flags=(EquationSystems::READ_HEADER | EquationSystems::READ_DATA)); ^ shellsystem.h:83:133: error: ‘EquationSystems’ has not been declared void read(const std::string &name, const libMeshEnums::XdrMODE mode, const unsigned int read_flags=(EquationSystems::READ_HEADER | EquationSystems::READ_DATA)); ^ In file included from steady_shellsystem.h:25:0, from petsc_shell_solver.C:30: petsc_shell_solver.h:45:55: error: expected template-name before ‘<’ token class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T> > ^ petsc_shell_solver.h:45:55: error: expected ‘{’ before ‘<’ token petsc_shell_solver.h:45:55: error: expected unqualified-id before ‘<’ token petsc_shell_solver.h:143:40: error: ISO C++ forbids declaration of ‘PetscShellSolver’ with no type [-fpermissive] PetscShellSolver<T>::PetscShellSolver (sys_type& system) : ^ petsc_shell_solver.h:143:40: error: ‘PetscShellSolver<T>::PetscShellSolver’ declared as an ‘inline’ variable petsc_shell_solver.h:143:40: error: template definition of non-template ‘int PetscShellSolver<T>::PetscShellSolver’ petsc_shell_solver.h:143:40: error: ‘sys_type’ was not declared in this scope petsc_shell_solver.h:162:41: error: invalid use of incomplete type ‘class PetscShellSolver<T>’ PetscShellSolver<T>::~PetscShellSolver () ^ petsc_shell_solver.h:45:7: note: declaration of ‘class PetscShellSolver<T>’ class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T> > ^ In file included from petsc_shell_solver.C:30:0: steady_shellsystem.h:36:36: error: expected ‘)’ before ‘&’ token SteadyShellSystem (EquationSystems& es, const std::string& name, const unsigned int number); ^ steady_shellsystem.h:95:2: error: ‘AutoPtr’ does not name a type AutoPtr<PetscShellSolver<Number> > shell_solver; ^ steady_shellsystem.h:106:2: error: ‘Real’ does not name a type Real final_nonlinear_residual() const { return _final_nonlinear_residual; } ^ steady_shellsystem.h: In member function ‘void SteadyShellSystem::compute_residual()’: steady_shellsystem.h:70:4: error: ‘rhs’ was not declared in this scope rhs->print(ofile); ^ steady_shellsystem.h: In member function ‘void SteadyShellSystem::compute_jacobian()’: steady_shellsystem.h:78:3: error: ‘matrix’ was not declared in this scope matrix->close(); ^ petsc_shell_solver.C: At global scope: petsc_shell_solver.C:38:23: error: ‘AutoPtr’ does not name a type template <typename T> AutoPtr<PetscShellSolver<T> > ^ petsc_shell_solver.C: In function ‘PetscErrorCode __shell_petsc_snes_residual(SNES, Vec, Vec, void)’: petsc_shell_solver.C:93:22: error: ‘Number’ was not declared in this scope PetscShellSolver<Number> solver = ^ petsc_shell_solver.C:93:22: note: suggested alternatives: In file included from petsc_shell_solver.C:28:0: /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:191:14: note: ‘libMesh::Number’ typedef Real Number; ^ /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:191:14: note: ‘libMesh::Number’ petsc_shell_solver.C:93:28: error: template argument 1 is invalid PetscShellSolver<Number> solver = ^ petsc_shell_solver.C:94:36: error: the value of ‘Number’ is not usable in a constant expression static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:93:22: note: ‘Number’ was not declared ‘constexpr’ PetscShellSolver<Number> solver = ^ petsc_shell_solver.C:94:42: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class PetscShellSolver’ static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:94:42: note: expected a type, got ‘Number’ petsc_shell_solver.C:94:43: error: expected ‘>’ before ‘’ token static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:94:43: error: expected ‘(’ before ‘’ token petsc_shell_solver.C:94:44: error: expected primary-expression before ‘>’ token static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:94:51: error: expected ‘)’ before ‘;’ token static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:96:35: error: request for member ‘system’ in ‘* solver’, which is of non-class type ‘int’ SteadyShellSystem &sys = solver->system(); ^ petsc_shell_solver.C:98:2: error: ‘PetscVector’ was not declared in this scope PetscVector<Number> X_input(x), R_input(r); ^ petsc_shell_solver.C:98:2: note: suggested alternatives: In file included from petsc_shell_solver.C:28:0: /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:601:23: note: ‘libMesh::PetscVector’ #define libmesh_final final ^ /home/niloufar/simulation/libmesh-1.3.0/include/numerics/petsc_vector.h:64:19: note: in expansion of macro ‘libmesh_final’ class PetscVector libmesh_final : public NumericVector<T> ^ /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:601:23: note: ‘libMesh::PetscVector’ #define libmesh_final final ^ /home/niloufar/simulation/libmesh-1.3.0/include/numerics/petsc_vector.h:64:19: note: in expansion of macro ‘libmesh_final’ class PetscVector libmesh_final : public NumericVector<T> ^ petsc_shell_solver.C:98:31: error: ‘X_input’ was not declared in this scope PetscVector<Number> X_input(x), R_input(r); ^ petsc_shell_solver.C:98:43: error: ‘R_input’ was not declared in this scope PetscVector<Number> X_input(x), R_input(r); ^ petsc_shell_solver.C:100:23: error: ‘X_system’ was not declared in this scope PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:100:48: error: ‘PetscVector’ does not name a type PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:100:59: error: expected ‘>’ before ‘<’ token PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:100:59: error: expected ‘(’ before ‘<’ token petsc_shell_solver.C:100:59: error: expected primary-expression before ‘<’ token petsc_shell_solver.C:100:68: error: expected primary-expression before ‘>’ token PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:100:74: error: ‘class SteadyShellSystem’ has no member named ‘solution’ PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:100:89: error: expected ‘)’ before ‘;’ token PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:101:23: error: ‘R_system’ was not declared in this scope PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs); ^ petsc_shell_solver.C:101:48: error: ‘PetscVector’ does not name a type PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs); ^ petsc_shell_solver.C:101:59: error: expected ‘>’ before ‘<’ token PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs); ^ petsc_shell_solver.C:101:59: error: expected ‘(’ before ‘<’ token petsc_shell_solver.C:101:59: error: expected primary-expression before ‘<’ token petsc_shell_solver.C:101:68: error: expected primary-expression before ‘>’ token PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs); ^ petsc_shell_solver.C:101:74: error: ‘class SteadyShellSystem’ has no member named ‘rhs’ PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs); ^ petsc_shell_solver.C:101:78: error: expected ‘)’ before ‘;’ token PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs); ^ petsc_shell_solver.C:106:9: error: ‘class SteadyShellSystem’ has no member named ‘get_dof_map’ sys.get_dof_map().enforce_constraints_exactly(sys); ^ petsc_shell_solver.C:108:9: error: ‘class SteadyShellSystem’ has no member named ‘update’ sys.update(); ^ petsc_shell_solver.C: In function ‘PetscErrorCode __shell_petsc_snes_jacobian(SNES, Vec, _p_Mat**, _p_Mat**, MatStructure*, void*)’: petsc_shell_solver.C:132:22: error: ‘Number’ was not declared in this scope PetscShellSolver<Number>* solver = ^ petsc_shell_solver.C:132:22: note: suggested alternatives: In file included from petsc_shell_solver.C:28:0: /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:191:14: note: ‘libMesh::Number’ typedef Real Number; ^ /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:191:14: note: ‘libMesh::Number’ petsc_shell_solver.C:132:28: error: template argument 1 is invalid PetscShellSolver<Number>* solver = ^ petsc_shell_solver.C:133:36: error: the value of ‘Number’ is not usable in a constant expression static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:132:22: note: ‘Number’ was not declared ‘constexpr’ PetscShellSolver<Number> solver = ^ petsc_shell_solver.C:133:42: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class PetscShellSolver’ static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:133:42: note: expected a type, got ‘Number’ petsc_shell_solver.C:133:43: error: expected ‘>’ before ‘’ token static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:133:43: error: expected ‘(’ before ‘’ token petsc_shell_solver.C:133:44: error: expected primary-expression before ‘>’ token static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:133:51: error: expected ‘)’ before ‘;’ token static_cast<PetscShellSolver<Number>> (ctx); ^ petsc_shell_solver.C:135:35: error: request for member ‘system’ in ‘* solver’, which is of non-class type ‘int’ SteadyShellSystem &sys = solver->system(); ^ petsc_shell_solver.C:138:2: error: ‘PetscVector’ was not declared in this scope PetscVector<Number> X_input(x); ^ petsc_shell_solver.C:138:2: note: suggested alternatives: In file included from petsc_shell_solver.C:28:0: /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:601:23: note: ‘libMesh::PetscVector’ #define libmesh_final final ^ /home/niloufar/simulation/libmesh-1.3.0/include/numerics/petsc_vector.h:64:19: note: in expansion of macro ‘libmesh_final’ class PetscVector libmesh_final : public NumericVector<T> ^ /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:601:23: note: ‘libMesh::PetscVector’ #define libmesh_final final ^ /home/niloufar/simulation/libmesh-1.3.0/include/numerics/petsc_vector.h:64:19: note: in expansion of macro ‘libmesh_final’ class PetscVector libmesh_final : public NumericVector<T> ^ petsc_shell_solver.C:138:31: error: ‘X_input’ was not declared in this scope PetscVector<Number> X_input(x); ^ petsc_shell_solver.C:139:23: error: ‘X_system’ was not declared in this scope PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:139:48: error: ‘PetscVector’ does not name a type PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:139:59: error: expected ‘>’ before ‘<’ token PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:139:59: error: expected ‘(’ before ‘<’ token petsc_shell_solver.C:139:59: error: expected primary-expression before ‘<’ token petsc_shell_solver.C:139:68: error: expected primary-expression before ‘>’ token PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:139:74: error: ‘class SteadyShellSystem’ has no member named ‘solution’ PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:139:89: error: expected ‘)’ before ‘;’ token PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get()); ^ petsc_shell_solver.C:141:2: error: ‘PetscMatrix’ was not declared in this scope PetscMatrix<Number> J_input(*pc); ^ petsc_shell_solver.C:141:2: note: suggested alternatives: In file included from petsc_shell_solver.C:28:0: /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:601:23: note: ‘libMesh::PetscMatrix’ #define libmesh_final final ^ /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/petsc_matrix.h:74:19: note: in expansion of macro ‘libmesh_final’ class PetscMatrix libmesh_final : public SparseMatrix<T> ^ /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:601:23: note: ‘libMesh::PetscMatrix’ #define libmesh_final final ^ /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/petsc_matrix.h:74:19: note: in expansion of macro ‘libmesh_final’ class PetscMatrix libmesh_final : public SparseMatrix<T> ^ petsc_shell_solver.C:141:33: error: ‘J_input’ was not declared in this scope PetscMatrix<Number> J_input(*pc); ^ petsc_shell_solver.C:142:23: error: ‘J_system’ was not declared in this scope PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix); ^ petsc_shell_solver.C:142:48: error: ‘PetscMatrix’ does not name a type PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix); ^ petsc_shell_solver.C:142:59: error: expected ‘>’ before ‘<’ token PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix); ^ petsc_shell_solver.C:142:59: error: expected ‘(’ before ‘<’ token petsc_shell_solver.C:142:59: error: expected primary-expression before ‘<’ token petsc_shell_solver.C:142:68: error: expected primary-expression before ‘>’ token PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix); ^ petsc_shell_solver.C:142:74: error: ‘class SteadyShellSystem’ has no member named ‘matrix’ PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix); ^ petsc_shell_solver.C:142:81: error: expected ‘)’ before ‘;’ token PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix); ^ petsc_shell_solver.C:148:9: error: ‘class SteadyShellSystem’ has no member named ‘get_dof_map’ sys.get_dof_map().enforce_constraints_exactly(sys); ^ petsc_shell_solver.C:149:9: error: ‘class SteadyShellSystem’ has no member named ‘update’ sys.update(); ^ petsc_shell_solver.C: At global scope: petsc_shell_solver.C:170:34: error: invalid use of incomplete type ‘class PetscShellSolver<T>’ void PetscShellSolver<T>::clear () ^ In file included from steady_shellsystem.h:25:0, from petsc_shell_solver.C:30: petsc_shell_solver.h:45:7: note: declaration of ‘class PetscShellSolver<T>’ class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T> > ^ petsc_shell_solver.C:186:33: error: invalid use of incomplete type ‘class PetscShellSolver<T>’ void PetscShellSolver<T>::init () ^ In file included from steady_shellsystem.h:25:0, from petsc_shell_solver.C:30: petsc_shell_solver.h:45:7: note: declaration of ‘class PetscShellSolver<T>’ class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T> > ^ petsc_shell_solver.C:227:25: error: ‘Real’ was not declared in this scope std::pair<unsigned int, Real> ^ petsc_shell_solver.C:227:25: note: suggested alternatives: In file included from petsc_shell_solver.C:28:0: /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:131:37: note: ‘libMesh::Real’ typedef LIBMESH_DEFAULT_SCALAR_TYPE Real; ^ /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:131:37: note: ‘libMesh::Real’ petsc_shell_solver.C:227:29: error: template argument 2 is invalid std::pair<unsigned int, Real> ^ petsc_shell_solver.C:228:29: error: template definition of non-template ‘int PetscShellSolver<T>::solve’ PetscShellSolver<T>::solve (SparseMatrix<T>& jac_in, // System Jacobian Matrix ^ petsc_shell_solver.C:228:29: error: ‘SparseMatrix’ was not declared in this scope petsc_shell_solver.C:228:29: note: suggested alternatives: In file included from /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/explicit_system.h:24:0, from /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/implicit_system.h:24, from shellsystem.h:20, from steady_shellsystem.h:19, from petsc_shell_solver.C:30: /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/system.h:59:29: note: ‘libMesh::SparseMatrix’ template <typename T> class SparseMatrix; ^ /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/system.h:59:29: note: ‘libMesh::SparseMatrix’ petsc_shell_solver.C:228:43: error: expected primary-expression before ‘>’ token PetscShellSolver<T>::solve (SparseMatrix<T>& jac_in, // System Jacobian Matrix ^ petsc_shell_solver.C:228:47: error: ‘jac_in’ was not declared in this scope PetscShellSolver<T>::solve (SparseMatrix<T>& jac_in, // System Jacobian Matrix ^ petsc_shell_solver.C:229:21: error: expected primary-expression before ‘&’ token NumericVector<T>& x_in, // Solution vector ^ petsc_shell_solver.C:229:23: error: ‘x_in’ was not declared in this scope NumericVector<T>& x_in, // Solution vector ^ petsc_shell_solver.C:230:21: error: expected primary-expression before ‘&’ token NumericVector<T>& r_in, // Residual vector ^ petsc_shell_solver.C:230:23: error: ‘r_in’ was not declared in this scope NumericVector<T>& r_in, // Residual vector ^ petsc_shell_solver.C:231:5: error: expected primary-expression before ‘const’ const double, // Stopping tolerance ^ petsc_shell_solver.C:232:5: error: expected primary-expression before ‘const’ const unsigned int) ^ petsc_shell_solver.C:311:33: error: ‘Number’ was not declared in this scope template class PetscShellSolver<Number>; ^ petsc_shell_solver.C:311:33: note: suggested alternatives: In file included from petsc_shell_solver.C:28:0: /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:191:14: note: ‘libMesh::Number’ typedef Real Number; ^ /home/niloufar/simulation/libmesh-1.3.0/include/base/libmesh_common.h:191:14: note: ‘libMesh::Number’ petsc_shell_solver.C:311:39: error: template argument 1 is invalid template class PetscShellSolver<Number>; ^ /home/niloufar/simulation/libmesh-1.3.0/CONF/Make.common:145: recipe for target 'petsc_shell_solver.x86_64-unknown-linux-gnu.opt.o' failed make: *** [petsc_shell_solver.x86_64-unknown-linux-gnu.opt.o] Error 1
I assume that BoundingBox.h is one of your app's files.
BoundingBox.h:19:34: error: ‘RealVectorValue’ does not name a type
void update_from_triangle(const RealVectorValue& V1, const RealVectorValue& V2, const RealVectorValue& V3, const double thickness)
The compiler is trying to tell you that you are missing some libmesh header files that need to be included. In this case, at least #include "libmesh/vector_value.h" is missing. Since you are using an old code, it may pre-date the change from #include "foo.h" to #include "libmesh/foo.h" that occurred in bcb87c212 (Sep 2012).
On Tue, 10 Jul 2018, John W. Peterson wrote:
I assume that BoundingBox.h is one of your app's files.
BoundingBox.h:19:34: error: ‘RealVectorValue’ does not name a type void update_from_triangle(const RealVectorValue& V1, const RealVectorValue& V2, const RealVectorValue& V3, const double thickness)
The compiler is trying to tell you that you are missing some libmesh header files that need to be included. In this case, at least #include "libmesh/vector_value.h" is missing. Since you are using an old code, it may pre-date the change from #include "foo.h" to #include "libmesh/foo.h" that occurred in bcb87c2 (Sep 2012).
Good guesses. I had a third: at some point back then we started defaulting to mandatory namespace use. Usually modern compilers will give a more informative warning when a namespace qualification is missing, but someone using a pre-2012 libMesh might be using a pre-2012 compiler too. ;-)
If the namespace strictness is a problem, the solution is to either:
-
configure with --enable-legacy-using-namespace (bad long-term solution but a good quick workaround)
-
Add "using namespace libMesh;" to your own code. (slightly bad idea in .C files, worse idea in headers)
-
Add "using libMesh::RealVectorValue;" to your own code, and likewise for every other member of the libMesh namespace you use, in the scopes where you use them. (IMHO great solution for every use case except middleware headers)
-
Change uses of "RealVectorValue" to "libMesh::RealVectorValue" in your own code. (very annoying, but the only perfectly robust solution for headers you want to be used by third parties too)
Thank you very much I have implemented both of the suggestions, to minimize the errors. I have not got any errors related to BoundingBox.h, but still a number of errors left!
May I ask about "dof_map_subdiv.h", I could not find it?!!
May I ask about "dof_map_subdiv.h", I could not find it?!!
Neither can Google and neither can my memory. Is it possible that the version of libMesh you were previously using wasn't just old, but was also forked and modified? "subdiv" sounds like it might have something to do with subdivision surfaces support like what Norbert Stoop and Roman Vetter added several years ago, but at least in their final implementation there was no special dof_map_subdiv.h header needed, just a couple special cases in dof_map.C and dof_map_constraints.C
Yes, modified code was written by them!
I have adapted the files for the installation with the 4th suggestion, Change uses of "RealVectorValue" to "libMesh::RealVectorValue" in your own code. Unfurthunetly, still I have errors as below:
Compiling C++ (in optimized mode) petsc_shell_solver.C...
mpicxx -DNDEBUG -std=gnu++11 -O2 -felide-constructors -funroll-loops -fstrict-aliasing -Wdisabled-optimization -Wno-variadic-macros -fopenmp -I/home/niloufar/simulation/libmesh-1.3.0/CONF/include -I/usr/include/vtk-5.10 -I/home/niloufar/simulation/petsc-3.8.4/include -I/home/niloufar/simulation/petsc-3.8.4/linux-gnu-c-debug/include -I/usr/include -c petsc_shell_solver.C -o petsc_shell_solver.x86_64-unknown-linux-gnu.opt.o
In file included from steady_shellsystem.h:19:0,
from petsc_shell_solver.C:30:
shellsystem.h:85:2: error: ‘AutoPtr’ does not name a type
AutoPtr<ShellElement> shellelement;
^
In file included from steady_shellsystem.h:25:0,
from petsc_shell_solver.C:30:
petsc_shell_solver.h:45:55: error: expected template-name before ‘<’ token
class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T> >
^
petsc_shell_solver.h:45:55: error: expected ‘{’ before ‘<’ token
petsc_shell_solver.h:45:55: error: expected unqualified-id before ‘<’ token
petsc_shell_solver.h:143:40: error: ISO C++ forbids declaration of ‘PetscShellSolver’ with no type [-fpermissive]
PetscShellSolver<T>::PetscShellSolver (sys_type& system) :
^
petsc_shell_solver.h:143:40: error: ‘PetscShellSolver<T>::PetscShellSolver’ declared as an ‘inline’ variable
petsc_shell_solver.h:143:40: error: template definition of non-template ‘int PetscShellSolver<T>::PetscShellSolver’
petsc_shell_solver.h:143:40: error: ‘sys_type’ was not declared in this scope
petsc_shell_solver.h:162:41: error: invalid use of incomplete type ‘class PetscShellSolver<T>’
PetscShellSolver<T>::~PetscShellSolver ()
^
petsc_shell_solver.h:45:7: note: declaration of ‘class PetscShellSolver<T>’
class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T> >
^
In file included from petsc_shell_solver.C:30:0:
steady_shellsystem.h:95:2: error: ‘AutoPtr’ does not name a type
AutoPtr<PetscShellSolver<Number> > shell_solver;
^
petsc_shell_solver.C:38:23: error: ‘AutoPtr’ does not name a type
template <typename T> AutoPtr<PetscShellSolver<T> >
^
petsc_shell_solver.C: In function ‘PetscErrorCode __shell_petsc_snes_residual(SNES, Vec, Vec, void*)’:
petsc_shell_solver.C:93:22: error: ‘Number’ was not declared in this scope
PetscShellSolver<Number>* solver =
^
petsc_shell_solver.C:93:22: note: suggested alternatives:
In file included from petsc_shell_solver.C:28:0:
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:191:14: note: ‘libMesh::Number’
typedef Real Number;
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:191:14: note: ‘libMesh::Number’
petsc_shell_solver.C:93:28: error: template argument 1 is invalid
PetscShellSolver<Number>* solver =
^
petsc_shell_solver.C:94:36: error: the value of ‘Number’ is not usable in a constant expression
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:93:22: note: ‘Number’ was not declared ‘constexpr’
PetscShellSolver<Number> solver =
^
petsc_shell_solver.C:94:42: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class PetscShellSolver’
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:94:42: note: expected a type, got ‘Number’
petsc_shell_solver.C:94:43: error: expected ‘>’ before ‘’ token
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:94:43: error: expected ‘(’ before ‘’ token
petsc_shell_solver.C:94:44: error: expected primary-expression before ‘>’ token
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:94:51: error: expected ‘)’ before ‘;’ token
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:96:35: error: request for member ‘system’ in ‘* solver’, which is of non-class type ‘int’
SteadyShellSystem &sys = solver->system();
^
petsc_shell_solver.C:98:2: error: ‘PetscVector’ was not declared in this scope
PetscVector<Number> X_input(x), R_input(r);
^
petsc_shell_solver.C:98:2: note: suggested alternatives:
In file included from petsc_shell_solver.C:28:0:
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:601:23: note: ‘libMesh::PetscVector’
#define libmesh_final final
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/petsc_vector.h:64:19: note: in expansion of macro ‘libmesh_final’
class PetscVector libmesh_final : public NumericVector<T>
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:601:23: note: ‘libMesh::PetscVector’
#define libmesh_final final
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/petsc_vector.h:64:19: note: in expansion of macro ‘libmesh_final’
class PetscVector libmesh_final : public NumericVector<T>
^
petsc_shell_solver.C:98:31: error: ‘X_input’ was not declared in this scope
PetscVector<Number> X_input(x), R_input(r);
^
petsc_shell_solver.C:98:43: error: ‘R_input’ was not declared in this scope
PetscVector<Number> X_input(x), R_input(r);
^
petsc_shell_solver.C:100:23: error: ‘X_system’ was not declared in this scope
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:100:48: error: ‘PetscVector’ does not name a type
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:100:59: error: expected ‘>’ before ‘<’ token
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:100:59: error: expected ‘(’ before ‘<’ token
petsc_shell_solver.C:100:59: error: expected primary-expression before ‘<’ token
petsc_shell_solver.C:100:68: error: expected primary-expression before ‘>’ token
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:100:89: error: expected ‘)’ before ‘;’ token
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:101:23: error: ‘R_system’ was not declared in this scope
PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs);
^
petsc_shell_solver.C:101:48: error: ‘PetscVector’ does not name a type
PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs);
^
petsc_shell_solver.C:101:59: error: expected ‘>’ before ‘<’ token
PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs);
^
petsc_shell_solver.C:101:59: error: expected ‘(’ before ‘<’ token
petsc_shell_solver.C:101:59: error: expected primary-expression before ‘<’ token
petsc_shell_solver.C:101:68: error: expected primary-expression before ‘>’ token
PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs);
^
petsc_shell_solver.C:101:78: error: expected ‘)’ before ‘;’ token
PetscVector<Number>& R_system = dynamic_cast<PetscVector<Number>>(sys.rhs);
^
petsc_shell_solver.C: In function ‘PetscErrorCode __shell_petsc_snes_jacobian(SNES, Vec, _p_Mat**, _p_Mat**, MatStructure*, void*)’:
petsc_shell_solver.C:132:22: error: ‘Number’ was not declared in this scope
PetscShellSolver<Number>* solver =
^
petsc_shell_solver.C:132:22: note: suggested alternatives:
In file included from petsc_shell_solver.C:28:0:
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:191:14: note: ‘libMesh::Number’
typedef Real Number;
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:191:14: note: ‘libMesh::Number’
petsc_shell_solver.C:132:28: error: template argument 1 is invalid
PetscShellSolver<Number>* solver =
^
petsc_shell_solver.C:133:36: error: the value of ‘Number’ is not usable in a constant expression
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:132:22: note: ‘Number’ was not declared ‘constexpr’
PetscShellSolver<Number> solver =
^
petsc_shell_solver.C:133:42: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class PetscShellSolver’
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:133:42: note: expected a type, got ‘Number’
petsc_shell_solver.C:133:43: error: expected ‘>’ before ‘’ token
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:133:43: error: expected ‘(’ before ‘’ token
petsc_shell_solver.C:133:44: error: expected primary-expression before ‘>’ token
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:133:51: error: expected ‘)’ before ‘;’ token
static_cast<PetscShellSolver<Number>> (ctx);
^
petsc_shell_solver.C:135:35: error: request for member ‘system’ in ‘* solver’, which is of non-class type ‘int’
SteadyShellSystem &sys = solver->system();
^
petsc_shell_solver.C:138:2: error: ‘PetscVector’ was not declared in this scope
PetscVector<Number> X_input(x);
^
petsc_shell_solver.C:138:2: note: suggested alternatives:
In file included from petsc_shell_solver.C:28:0:
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:601:23: note: ‘libMesh::PetscVector’
#define libmesh_final final
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/petsc_vector.h:64:19: note: in expansion of macro ‘libmesh_final’
class PetscVector libmesh_final : public NumericVector<T>
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:601:23: note: ‘libMesh::PetscVector’
#define libmesh_final final
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/petsc_vector.h:64:19: note: in expansion of macro ‘libmesh_final’
class PetscVector libmesh_final : public NumericVector<T>
^
petsc_shell_solver.C:138:31: error: ‘X_input’ was not declared in this scope
PetscVector<Number> X_input(x);
^
petsc_shell_solver.C:139:23: error: ‘X_system’ was not declared in this scope
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:139:48: error: ‘PetscVector’ does not name a type
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:139:59: error: expected ‘>’ before ‘<’ token
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:139:59: error: expected ‘(’ before ‘<’ token
petsc_shell_solver.C:139:59: error: expected primary-expression before ‘<’ token
petsc_shell_solver.C:139:68: error: expected primary-expression before ‘>’ token
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:139:89: error: expected ‘)’ before ‘;’ token
PetscVector<Number>& X_system = dynamic_cast<PetscVector<Number>>(sys.solution.get());
^
petsc_shell_solver.C:141:2: error: ‘PetscMatrix’ was not declared in this scope
PetscMatrix<Number> J_input(*pc);
^
petsc_shell_solver.C:141:2: note: suggested alternatives:
In file included from petsc_shell_solver.C:28:0:
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:601:23: note: ‘libMesh::PetscMatrix’
#define libmesh_final final
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/petsc_matrix.h:74:19: note: in expansion of macro ‘libmesh_final’
class PetscMatrix libmesh_final : public SparseMatrix<T>
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/libmesh_common.h:601:23: note: ‘libMesh::PetscMatrix’
#define libmesh_final final
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/petsc_matrix.h:74:19: note: in expansion of macro ‘libmesh_final’
class PetscMatrix libmesh_final : public SparseMatrix<T>
^
petsc_shell_solver.C:141:33: error: ‘J_input’ was not declared in this scope
PetscMatrix<Number> J_input(*pc);
^
petsc_shell_solver.C:142:23: error: ‘J_system’ was not declared in this scope
PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix);
^
petsc_shell_solver.C:142:48: error: ‘PetscMatrix’ does not name a type
PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix);
^
petsc_shell_solver.C:142:59: error: expected ‘>’ before ‘<’ token
PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix);
^
petsc_shell_solver.C:142:59: error: expected ‘(’ before ‘<’ token
petsc_shell_solver.C:142:59: error: expected primary-expression before ‘<’ token
petsc_shell_solver.C:142:68: error: expected primary-expression before ‘>’ token
PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix);
^
petsc_shell_solver.C:142:81: error: expected ‘)’ before ‘;’ token
PetscMatrix<Number>& J_system = dynamic_cast<PetscMatrix<Number>>(sys.matrix);
^
petsc_shell_solver.C: At global scope:
petsc_shell_solver.C:170:34: error: invalid use of incomplete type ‘class PetscShellSolver<T>’
void PetscShellSolver<T>::clear ()
^
In file included from steady_shellsystem.h:25:0,
from petsc_shell_solver.C:30:
petsc_shell_solver.h:45:7: note: declaration of ‘class PetscShellSolver<T>’
class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T> >
^
petsc_shell_solver.C:186:33: error: invalid use of incomplete type ‘class PetscShellSolver<T>’
void PetscShellSolver<T>::init ()
^
In file included from steady_shellsystem.h:25:0,
from petsc_shell_solver.C:30:
petsc_shell_solver.h:45:7: note: declaration of ‘class PetscShellSolver<T>’
class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T> >
^
petsc_shell_solver.C:228:29: error: template definition of non-template ‘std::pair<unsigned int, double> PetscShellSolver<T>::solve’
PetscShellSolver<T>::solve (SparseMatrix<T>& jac_in, // System Jacobian Matrix
^
petsc_shell_solver.C:228:29: error: ‘SparseMatrix’ was not declared in this scope
petsc_shell_solver.C:228:29: note: suggested alternatives:
In file included from /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/explicit_system.h:24:0,
from /home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/implicit_system.h:24,
from shellsystem.h:20,
from steady_shellsystem.h:19,
from petsc_shell_solver.C:30:
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/system.h:59:29: note: ‘libMesh::SparseMatrix’
template <typename T> class SparseMatrix;
^
/home/niloufar/simulation/libmesh-1.3.0/CONF/include/libmesh/system.h:59:29: note: ‘libMesh::SparseMatrix’
petsc_shell_solver.C:228:43: error: expected primary-expression before ‘>’ token
PetscShellSolver<T>::solve (SparseMatrix<T>& jac_in, // System Jacobian Matrix
^
petsc_shell_solver.C:228:47: error: ‘jac_in’ was not declared in this scope
PetscShellSolver<T>::solve (SparseMatrix<T>& jac_in, // System Jacobian Matrix
^
petsc_shell_solver.C:229:21: error: expected primary-expression before ‘&’ token
NumericVector<T>& x_in, // Solution vector
^
petsc_shell_solver.C:229:23: error: ‘x_in’ was not declared in this scope
NumericVector<T>& x_in, // Solution vector
^
petsc_shell_solver.C:230:21: error: expected primary-expression before ‘&’ token
NumericVector<T>& r_in, // Residual vector
^
petsc_shell_solver.C:230:23: error: ‘r_in’ was not declared in this scope
NumericVector<T>& r_in, // Residual vector
^
petsc_shell_solver.C:231:5: error: expected primary-expression before ‘const’
const double, // Stopping tolerance
^
petsc_shell_solver.C:232:5: error: expected primary-expression before ‘const’
const unsigned int)
^
petsc_shell_solver.C:311:16: error: explicit instantiation of ‘class PetscShellSolver
shellsystem.h:85:2: error: ‘AutoPtr’ does not name a type AutoPtr shellelement;
All instances of AutoPtr in your old code should be replaced by std::unique_ptr. Generally, this is just a drop-in replacement.
petsc_shell_solver.h:45:55: error: expected template-name before ‘<’ token
class PetscShellSolver : public ReferenceCountedObject<PetscShellSolver<T>>
^
petsc_shell_solver.h:45:55: error: expected ‘{’ before ‘<’ token
I think this is just another missing include error, this time for
#include "libmesh/reference_counted_object.h"
Please try googling for the generic parts of the error messages you are getting; interactive compilation via GitHub issue is not very efficient.
I realize the question is quite old by now, but I believe we may have worked with the same somewhat deprecated subdivision code. To get that working here is a bash script, that updates the code to current syntax. Note that you will also need to update how dofs are read out.