Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Hi , can everyone know how to adress these errors in linux c++ ?
Forum Updated to NodeBB v4.3 + New Features

Hi , can everyone know how to adress these errors in linux c++ ?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jiahonggang
    wrote on last edited by
    #1

    1 /usr/include/c++/4.8/bits/alloc_traits.h:142:1: error: no type named ‘difference_type’ in ‘class std::allocatorMu::BoundaryCondition*’
    In file included from /usr/include/c++/4.8/list:63:0,
    from /host/xfem++/physics/damagemodels/../../features/../elements/../geometry/geometry_3D.h:10,
    2 from /host/xfem++/physics/damagemodels/plasticstrain.cpp:57:
    /usr/include/c++/4.8/bits/stl_list.h:130:15: error: ‘ptrdiff_t’ does not name a type
    typedef ptrdiff_t difference_type;
    3 /usr/include/c++/4.8/bits/stl_deque.h:188:18: error: declaration of ‘operator+=’ as non-function
    operator+=(difference_type __n)
    4 /usr/include/c++/4.8/bits/stl_deque.h:188:15: error: expected ‘;’ at end of member declaration
    operator+=(difference_type __n)
    5 /usr/include/c++/4.8/bits/stl_deque.h:188:34: error: expected ‘)’ before ‘__n’
    operator+=(difference_type __n)
    6 /host/xfem++/physics/damagemodels/plasticstrain.cpp:379:1: error: expected ‘}’ at end of input
    }
    7 /usr/include/c++/4.8/bits/stl_deque.h:185:7: error: expected unqualified-id at end of input
    }
    8 /usr/include/c++/4.8/bits/valarray_array.h:79:4: error: no matching function for call to ‘operator new(sizetype, Mu::Function*)’
    new(__b++) _Tp();/usr/include/c++/4.8/bits/valarray_array.h:79:4: note: candidate is:
    <built-in>:0:0: note: void* operator new(long unsigned int)
    .....................................................................

    1 Reply Last reply
    0
    • I Offline
      I Offline
      itsmemax
      wrote on last edited by
      #2

      Well, show us the code snippetes where these errors occur, otherwise we can't help you as we don't know what you did.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jiahonggang
        wrote on last edited by
        #3

        @
        using namespace Mu ;

        int main(int argc, char *argv[])
        {

        Sample squareSample(2, 2, 0., 0.)

        //Then you give it a behaviour.

        double E = 20e9 ;
        double nu = 0.2 ;

        squareSample.setBehaviour(new
        Stiffness(Material::cauchyGreen(std::make_pair(E,nu),
        true,SPACE_TWO_DIMENSIONAL)))

        //Then you put it into a "feature tree"

        FeatureTree ft(&squareSample) ;

            *crack.push_back(newCrack(newPoint(-0.5,0),newPoint(0.5,0)));//my
            F.addFeature(&sample,crack.back());//my
            crack.push_back(newCrack(newPoint(-0.5,-0.5),newPoint(0.5,-0.5)));//my
            F.addFeature(&sample,crack.back());//my
            crack.push_back(newCrack(newPoint(-0.5,0.5),newPoint(0.5,0.5)));//my
            F.addFeature(&sample,crack.back());//my*
        

        //Then you add boundary conditions

        ft.addBoundaryCondition(new BoundingBoxDefinedBoundaryCondition(SET_ALONG_XI,
        RIGHT, 0)) ;
        ft.addBoundaryCondition(new BoundingBoxDefinedBoundaryCondition(SET_ALONG_ETA,
        BOTTOM, 0)) ;
        ft.addBoundaryCondition(new
        BoundingBoxDefinedBoundaryCondition(SET_STRESS_ETA, TOP, -1e6)) ;

        //Then you specify the mesh density:

        ft.setSamplingNumber(32);

        //Then you solve:

        ft.step() ;

        //Then you print the result:

        MultiTriangleWriter writerm( "mechanical_fields",
        "mechanical_fields_layer", nullptr ) ;
        writerm.reset( &Fm ) ;
        writerm.getField( PRINCIPAL_STRAIN_FIELD ) ;
        writerm.getField( PRINCIPAL_REAL_STRESS_FIELD ) ;
        writerm.getField( TWFT_STIFFNESS ) ;
        writerm.append() ;
        writerm.writeSvg(200, true) ;

        Vector def(3) ;
        def[0] = 0.1 ;
        def[1] = 0.1 ;

        /* XMLTree * test = inc0->toXML() ;
        test->print(true) ;
        std::cout << std::endl ;
        Circle c(test->getChild(0)) ;
        c.toXML()->print(true) ;
        std::cout << std::endl ;
        XMLTree * c0 = test->getChild(1) ;
        c0->print(true) ;
        std::cout << std::endl ;
        XMLTree * c1 = c0->getChild(0) ;
        c1->print(true) ;
        std::cout << std::endl ;
        Matrix mtest = c1->buildMatrix().second;
        XMLTree * x = new XMLTree("test",mtest) ;
        x->print(true) ;*/

        /* std::vector<Pore *> pores;

        double totalMass = 0.25;
        double density = 25000;
        double Dmax = 0.005;
        double pmin = 0.999;
        // Generates inclusion geometry
        double radius1 = 0.004; double radius2 = 0.04/5;
        double radius3 = 0.04/5; double radius4 = 0.04/10;
        double radius5 = 0.04/20; double radius6 = 0.04/20;
        Point center1 = Point(0.0,-0.01);
        Point center2 = Point(0.02,0.02);
        Point center3 = Point(-0.02,-0.02);
        Point center4 = (center2 + center1)/2;
        Point center5 = (center1 + Point(0.0,0.01));
        Point center6 = (center5 + Point(0.0,0.005));
        double stress = 55 ;*/

        BoundingBoxDefinedBoundaryCondition(SET_STRESS_ETA, TOP/, -0.025, -0.0175, -10, 10/, -stress)) ;

        F.useMultigrid = false ;

        //my add// F.setSamplingNumber(atoi(argv[1])) ;

        F.setOrder(LINEAR) ;

        triangles = F.getElements2D() ;

        step(1) ;

        glutInit(&argc, argv) ;
        glutInitDisplayMode(GLUT_RGBA) ;
        glutInitWindowSize(600, 600) ;
        glutReshapeFunc(reshape) ;
        glutCreateWindow("coucou !") ;

        int submenu = glutCreateMenu(Menu) ;

        glutAddMenuEntry(" Displacements ", ID_DISP);
        glutAddMenuEntry(" Strain (s) xx ", ID_STRAIN_XX);
        glutAddMenuEntry(" Strain (s) yy ", ID_STRAIN_YY);
        glutAddMenuEntry(" Strain (s) xy ", ID_STRAIN_XY);
        glutAddMenuEntry(" Stress (e) xx ", ID_STRESS_XX);
        glutAddMenuEntry(" Stress (e) yy ", ID_STRESS_YY);
        glutAddMenuEntry(" Stress (e) xy ", ID_STRESS_XY);
        glutAddMenuEntry(" Elements ", ID_ELEM);
        glutAddMenuEntry(" Stiffness ", ID_STIFNESS);
        glutAddMenuEntry(" Von Mises ", ID_VON_MISES);
        glutAddMenuEntry(" Princ. angle ", ID_ANGLE);
        glutAddMenuEntry(" Enrichment ", ID_ENRICHMENT);
        glutAddMenuEntry(" Frac Crit ", ID_FRAC_CRIT);

        glutCreateMenu(Menu) ;

        glutAddMenuEntry(" Step ", ID_NEXT);
        glutAddMenuEntry(" Step time ", ID_NEXT_TIME);
        glutAddMenuEntry(" Zoom in ", ID_ZOOM);
        glutAddMenuEntry(" Zoom out ", ID_UNZOOM);
        glutAddMenuEntry(" Amplify ", ID_AMPLIFY);
        glutAddMenuEntry(" Deamplify ", ID_DEAMPLIFY);
        glutAddSubMenu( " Display ", submenu);
        glutAddMenuEntry(" Quit ", ID_QUIT) ;

        glutAttachMenu(GLUT_RIGHT_BUTTON) ;

        glClearColor(0.0, 0.0, 0.0, 0.0);
        glShadeModel(GL_SMOOTH);

        glutDisplayFunc(Display) ;
        glutMainLoop() ;

        // delete dt ;

        return 0 ;
        }
        @

        1 Reply Last reply
        0
        • I Offline
          I Offline
          itsmemax
          wrote on last edited by
          #4

          Would you please use code tags? The code is unreadable.

          @@Code
          here@@

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jiahonggang
            wrote on last edited by
            #5

            @using namespace Mu ;

            int main(int argc, char *argv[])
            {

            Sample squareSample(2, 2, 0., 0.)

            //Then you give it a behaviour.

            double E = 20e9 ;
            double nu = 0.2 ;

            squareSample.setBehaviour(new
            Stiffness(Material::cauchyGreen(std::make_pair(E,nu),
            true,SPACE_TWO_DIMENSIONAL)))

            //Then you put it into a “feature tree”

            FeatureTree ft(&squareSample) ;

            crack.push_back(newCrack(newPoint(-0.5,0),newPoint(0.5,0)));//my F.addFeature(&sample,crack.back());//my crack.push_back(newCrack(newPoint(-0.5,-0.5),newPoint(0.5,-0.5)));//my F.addFeature(&sample,crack.back());//my crack.push_back(newCrack(newPoint(-0.5,0.5),newPoint(0.5,0.5)));//
            F.addFeature(&sample,crack.back());//my //Then you add boundary conditions

            ft.addBoundaryCondition(new BoundingBoxDefinedBoundaryCondition(SET_ALONG_XI,
            RIGHT, 0)) ;
            ft.addBoundaryCondition(new BoundingBoxDefinedBoundaryCondition(SET_ALONG_ETA,
            BOTTOM, 0)) ;
            ft.addBoundaryCondition(new
            BoundingBoxDefinedBoundaryCondition(SET_STRESS_ETA, TOP, -1e6)) ;

            //Then you specify the mesh density:

            ft.setSamplingNumber(32);

            //Then you solve:

            ft.step() ;

            //Then you print the result:here
            // delete dt ;
            return 0 ; }
            @

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jiahonggang
              wrote on last edited by
              #6

              here is possible error code,
              @FeatureTree ft(&squareSample) ;

                  *crack.push_back(newCrack(newPoint(-0.5,0),newPoint(0.5,0)));//my
                  F.addFeature(&sample,crack.back());//my
                  crack.push_back(newCrack(newPoint(-0.5,-0.5),newPoint(0.5,-0.5)));//my
                  F.addFeature(&sample,crack.back());//my
                  crack.push_back(newCrack(newPoint(-0.5,0.5),newPoint(0.5,0.5)));//my
                  F.addFeature(&sample,crack.back());//my*
              

              //Then you add boundary conditions

              ft.addBoundaryCondition(new BoundingBoxDefinedBoundaryCondition(SET_ALONG_XI,
              RIGHT, 0)) ;
              ft.addBoundaryCondition(new BoundingBoxDefinedBoundaryCondition(SET_ALONG_ETA,
              BOTTOM, 0)) ;
              ft.addBoundaryCondition(new
              BoundingBoxDefinedBoundaryCondition(SET_STRESS_ETA, TOP, -1e6)) ;
              @

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved