cb-geo / mpm

CB-Geo High-Performance Material Point Method
https://www.cb-geo.com/research/mpm
Other
245 stars 82 forks source link

Static analysis errors from fbinfer #658

Closed kks32 closed 4 years ago

kks32 commented 4 years ago

Describe the bug Static analysis errors from fbinfer (https://fbinfer.com)

To Reproduce Steps to reproduce the behavior, run static analysis tool fbinfer.

  1. cmake -DCMAKE_BUILD_TYPE=Release -DKAHIP_ROOT=~/workspace/KaHIP/ -DCMAKE_EXPORT_COMPILE_COMMANDS=On ..
  2. infer capture --compilation-database compile_commands.json
  3. infer analyze

Additional context

Found 169 issues

mpm/mpm/tests/elements/triangle_element_test.cc:1275: error: DEAD_STORE
  The value written to &one_by_sqrt3 (type double) is never used.
  1273.   
  1274.         Eigen::Matrix<double, Dim, 1> xi;
  1275. >       const double one_by_sqrt3 = std::fabs(1 / std::sqrt(3));
  1276.         xi << 1.0 / 6, 1.0 / 6;
  1277.         xi_s.emplace_back(xi);

mpm/mpm/tests/elements/hexahedron_quadrature_test.cc:13: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  11.   TEST_CASE("Hexahedron quadratures are checked",
  12.             "[hexquadrature][hex][quadrature][3D]") {
  13. >   const unsigned Dim = 3;
  14.     const double Tolerance = 1.E-7;
  15.   

mpm/mpm/tests/elements/hexahedron_quadrature_test.cc:18: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  16.     //! Check for a single point quadrature function
  17.     SECTION("Hexahedron with a single quadrature") {
  18. >     const unsigned Nquadratures = 1;
  19.   
  20.       auto quad =

mpm/mpm/tests/elements/hexahedron_quadrature_test.cc:47: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  45.     //! Check for eight quadrature points
  46.     SECTION("Hexahedron with eight quadratures") {
  47. >     const unsigned Nquadratures = 8;
  48.   
  49.       auto quad =

mpm/mpm/tests/elements/hexahedron_quadrature_test.cc:111: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  109.     //! Check for twenty seven quadrature points
  110.     SECTION("Hexahedron with twenty seven quadratures") {
  111. >     const unsigned Nquadratures = 27;
  112.   
  113.       auto quad =

mpm/mpm/tests/elements/hexahedron_quadrature_test.cc:299: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  297.     //! Check for sixty four quadrature points
  298.     SECTION("Hexahedron with sixty four quadratures") {
  299. >     const unsigned Nquadratures = 64;
  300.   
  301.       auto quad =

mpm/mpm/tests/elements/quadrilateral_quadrature_test.cc:13: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  11.   TEST_CASE("Quadrilateral quadratures are checked",
  12.             "[quadquadrature][quad][quadrature][2D]") {
  13. >   const unsigned Dim = 2;
  14.     const double Tolerance = 1.E-7;
  15.   

mpm/mpm/tests/elements/quadrilateral_quadrature_test.cc:18: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  16.     //! Check for a single point quadrature function
  17.     SECTION("Quadrilateral with a single quadrature") {
  18. >     const unsigned Nquadratures = 1;
  19.   
  20.       auto quad =

mpm/mpm/tests/elements/quadrilateral_quadrature_test.cc:46: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  44.     //! Check for four quadrature points
  45.     SECTION("Quadrilateral with four quadratures") {
  46. >     const unsigned Nquadratures = 4;
  47.   
  48.       auto quad =

mpm/mpm/tests/elements/quadrilateral_quadrature_test.cc:83: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  81.     //! Check for nine quadrature points
  82.     SECTION("Quadrilateral with nine quadratures") {
  83. >     const unsigned Nquadratures = 9;
  84.   
  85.       auto quad =

mpm/mpm/tests/elements/quadrilateral_quadrature_test.cc:143: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  141.     //! Check for sixteen quadrature points
  142.     SECTION("Quadrilateral with sixteen quadratures") {
  143. >     const unsigned Nquadratures = 16;
  144.   
  145.       auto quad =

mpm/mpm/tests/elements/triangle_quadrature_test.cc:13: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  11.   TEST_CASE("Triangle quadratures are checked",
  12.             "[triquadrature][tri][quadrature][2D]") {
  13. >   const unsigned Dim = 2;
  14.     const double Tolerance = 1.E-7;
  15.   

mpm/mpm/tests/elements/triangle_quadrature_test.cc:18: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  16.     //! Check for a single point quadrature function
  17.     SECTION("Triangle with a single quadrature") {
  18. >     const unsigned Nquadratures = 1;
  19.   
  20.       auto tri = std::make_shared<mpm::TriangleQuadrature<Dim, Nquadratures>>();

mpm/mpm/tests/elements/triangle_quadrature_test.cc:45: error: DEAD_STORE
  The value written to &Nquadratures (type unsigned int const ) is never used.
  43.     //! Check for three quadrature points
  44.     SECTION("Triangle with three quadratures") {
  45. >     const unsigned Nquadratures = 3;
  46.   
  47.       auto tri = std::make_shared<mpm::TriangleQuadrature<Dim, Nquadratures>>();

mpm/mpm/tests/mpm_explicit_usf_test.cc:14: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  12.             "[MPM][2D][Explicit][USF][1Phase]") {
  13.     // Dimension
  14. >   const unsigned Dim = 2;
  15.   
  16.     // Write JSON file

mpm/mpm/tests/mpm_explicit_usf_unitcell_test.cc:14: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  12.             "[MPM][2D][USF][Explicit][1Phase][unitcell]") {
  13.     // Dimension
  14. >   const unsigned Dim = 2;
  15.   
  16.     // Write JSON file

mpm/mpm/tests/mpm_explicit_usl_test.cc:14: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  12.             "[MPM][2D][Explicit][USL][1Phase]") {
  13.     // Dimension
  14. >   const unsigned Dim = 2;
  15.   
  16.     // Write JSON file

mpm/mpm/tests/mpm_explicit_usl_unitcell_test.cc:14: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  12.             "[MPM][2D][USL][Explicit][1Phase][unitcell]") {
  13.     // Dimension
  14. >   const unsigned Dim = 2;
  15.   
  16.     // Write JSON file

mpm/mpm/tests/node_vector_test.cc:14: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  12.   TEST_CASE("Node vector is checked for 2D case", "[nodevector][2D]") {
  13.     // Dimension
  14. >   const unsigned Dim = 2;
  15.     // Degrees of freedom
  16.     const unsigned Dof = 2;

mpm/mpm/tests/node_vector_test.cc:16: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  14.     const unsigned Dim = 2;
  15.     // Degrees of freedom
  16. >   const unsigned Dof = 2;
  17.     // Number of phases
  18.     const unsigned Nphases = 1;

mpm/mpm/tests/node_vector_test.cc:18: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  16.     const unsigned Dof = 2;
  17.     // Number of phases
  18. >   const unsigned Nphases = 1;
  19.     // Tolerance
  20.     const double Tolerance = 1.E-7;

mpm/mpm/tests/particle_vector_test.cc:14: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  12.   TEST_CASE("Particle vector is checked for 2D case", "[particlevector][2D]") {
  13.     // Dimension
  14. >   const unsigned Dim = 2;
  15.     // Tolerance
  16.     const double Tolerance = 1.E-7;

mpm/mpm/tests/materials/linear_elastic_test.cc:17: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  15.     const double Tolerance = 1.E-7;
  16.   
  17. >   const unsigned Dim = 2;
  18.   
  19.     // Add particle

mpm/mpm/tests/node_map_test.cc:15: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  13.   TEST_CASE("Node map is checked for 2D case", "[nodemap][2D]") {
  14.     // Dimension
  15. >   const unsigned Dim = 2;
  16.     // Degrees of freedom
  17.     const unsigned Dof = 2;

mpm/mpm/tests/node_map_test.cc:17: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  15.     const unsigned Dim = 2;
  16.     // Degrees of freedom
  17. >   const unsigned Dof = 2;
  18.     // Number of phases
  19.     const unsigned Nphases = 1;

mpm/mpm/tests/node_map_test.cc:19: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  17.     const unsigned Dof = 2;
  18.     // Number of phases
  19. >   const unsigned Nphases = 1;
  20.     // Tolerance
  21.     const double Tolerance = 1.E-7;

mpm/mpm/tests/node_test.cc:15: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  13.   TEST_CASE("Node is checked for 1D case", "[node][1D]") {
  14.     const unsigned Dim = 1;
  15. >   const unsigned Dof = 1;
  16.     const unsigned Nphases = 1;
  17.     const unsigned Nphase = 0;

mpm/mpm/tests/node_test.cc:16: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  14.     const unsigned Dim = 1;
  15.     const unsigned Dof = 1;
  16. >   const unsigned Nphases = 1;
  17.     const unsigned Nphase = 0;
  18.     Eigen::Matrix<double, 1, 1> coords;

mpm/mpm/tests/node_test.cc:192: error: DEAD_STORE
  The value written to &bad_phase (type unsigned int) is never used.
  190.   
  191.         // Check if exception is handled
  192. >       unsigned bad_phase = 4;
  193.         // Exception handling invalid force dimension
  194.         // TODO Assert:

mpm/mpm/tests/node_test.cc:275: error: DEAD_STORE
  The value written to &bad_phase (type unsigned int) is never used.
  273.   
  274.         // Check if exception is handled
  275. >       unsigned bad_phase = 4;
  276.         // Exception handling invalid force dimension
  277.         // TODO Assert:

mpm/mpm/tests/node_test.cc:422: error: DEAD_STORE
  The value written to &bad_phase (type unsigned int) is never used.
  420.   
  421.         // Check if exception is handled
  422. >       unsigned bad_phase = 1;
  423.         // Exception handling invalid momentum dimension
  424.         // TODO Assert: REQUIRE_NOTHROW(node->update_momentum(true, bad_phase,

mpm/mpm/tests/node_test.cc:464: error: DEAD_STORE
  The value written to &bad_phase (type unsigned int) is never used.
  462.   
  463.         // Check if exception is handled
  464. >       unsigned bad_phase = 1;
  465.         // Exception handling invalid acceleration dimension
  466.         // TODO Assert: REQUIRE_NOTHROW(node->update_acceleration(true, bad_phase,

mpm/mpm/tests/node_test.cc:158: error: DEAD_STORE
  The value written to &pmass (type double) is never used.
  156.         // Try to update pressure to 2000, should throw and keep to 1000.
  157.         pressure = 1000.;
  158. >       const double pmass = 1.5;
  159.         node->assign_pressure(Nphase, pressure);
  160.         REQUIRE(node->pressure(Nphase) == Approx(1000.0).epsilon(Tolerance));

mpm/mpm/tests/materials/modified_cam_clay_test.cc:20: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  18.     const double Tolerance = 1.E-7;
  19.   
  20. >   const unsigned Dim = 3;
  21.   
  22.     // Add particle

mpm/mpm/tests/materials/norsand_test.cc:20: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  18.     const double Tolerance = 1.E-7;
  19.   
  20. >   const unsigned Dim = 3;
  21.   
  22.     // Add particle

mpm/mpm/tests/cell_vector_test.cc:18: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  16.   TEST_CASE("Cell vector is checked for 2D case", "[cellvector][2D]") {
  17.     // Dimension
  18. >   const unsigned Dim = 2;
  19.     // Degrees of freedom
  20.     const unsigned Dof = 2;

mpm/mpm/tests/cell_vector_test.cc:20: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  18.     const unsigned Dim = 2;
  19.     // Degrees of freedom
  20. >   const unsigned Dof = 2;
  21.     // Number of nodes per cell
  22.     const unsigned Nnodes = 4;

mpm/mpm/tests/cell_vector_test.cc:24: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  22.     const unsigned Nnodes = 4;
  23.     // Number of phases
  24. >   const unsigned Nphases = 1;
  25.   
  26.     // Tolerance

mpm/mpm/tests/cell_vector_test.cc:27: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  25.   
  26.     // Tolerance
  27. >   const double Tolerance = 1.E-7;
  28.   
  29.     // Element

mpm/mpm/tests/materials/bingham_test.cc:20: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  18.     const double Tolerance = 1.E-7;
  19.   
  20. >   const unsigned Dim = 2;
  21.   
  22.     // Initialise material

mpm/mpm/tests/materials/bingham_test.cc:105: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  103.       // Coordinates of nodes for the cell
  104.       mpm::Index cell_id = 0;
  105. >     const unsigned Dof = 2;
  106.       const unsigned Nphases = 1;
  107.       const unsigned Nnodes = 4;

mpm/mpm/tests/materials/bingham_test.cc:193: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  191.       mpm::Index cell_id = 0;
  192.       mpm::Index mesh_id = 0;
  193. >     const unsigned Dof = 2;
  194.       const unsigned Nphases = 1;
  195.       const unsigned Nnodes = 4;

mpm/mpm/tests/materials/bingham_test.cc:287: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  285.       mpm::Index cell_id = 0;
  286.       mpm::Index mesh_id = 0;
  287. >     const unsigned Dof = 2;
  288.       const unsigned Nphases = 1;
  289.       const unsigned Nnodes = 4;

mpm/mpm/tests/materials/bingham_test.cc:390: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  388.       mpm::Index cell_id = 0;
  389.       mpm::Index mesh_id = 0;
  390. >     const unsigned Dof = 2;
  391.       const unsigned Nphases = 1;
  392.       const unsigned Nnodes = 4;

mpm/mpm/tests/materials/bingham_test.cc:106: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  104.       mpm::Index cell_id = 0;
  105.       const unsigned Dof = 2;
  106. >     const unsigned Nphases = 1;
  107.       const unsigned Nnodes = 4;
  108.       const unsigned phase = 0;

mpm/mpm/tests/materials/bingham_test.cc:194: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  192.       mpm::Index mesh_id = 0;
  193.       const unsigned Dof = 2;
  194. >     const unsigned Nphases = 1;
  195.       const unsigned Nnodes = 4;
  196.       const unsigned phase = 0;

mpm/mpm/tests/materials/bingham_test.cc:288: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  286.       mpm::Index mesh_id = 0;
  287.       const unsigned Dof = 2;
  288. >     const unsigned Nphases = 1;
  289.       const unsigned Nnodes = 4;
  290.       const unsigned phase = 0;

mpm/mpm/tests/materials/bingham_test.cc:391: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  389.       mpm::Index mesh_id = 0;
  390.       const unsigned Dof = 2;
  391. >     const unsigned Nphases = 1;
  392.       const unsigned Nnodes = 4;
  393.       const unsigned phase = 0;

mpm/mpm/tests/materials/newtonian_test.cc:20: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  18.     const double Tolerance = 1.E-7;
  19.   
  20. >   const unsigned Dim = 2;
  21.   
  22.     // Initialise material

mpm/mpm/tests/materials/newtonian_test.cc:97: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  95.       mpm::Index cell_id = 0;
  96.       mpm::Index mesh_id = 0;
  97. >     const unsigned Dof = 2;
  98.       const unsigned Nphases = 1;
  99.       const unsigned Nnodes = 4;

mpm/mpm/tests/materials/newtonian_test.cc:192: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  190.       mpm::Index cell_id = 0;
  191.       mpm::Index mesh_id = 0;
  192. >     const unsigned Dof = 2;
  193.       const unsigned Nphases = 1;
  194.       const unsigned Nnodes = 4;

mpm/mpm/tests/materials/newtonian_test.cc:98: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  96.       mpm::Index mesh_id = 0;
  97.       const unsigned Dof = 2;
  98. >     const unsigned Nphases = 1;
  99.       const unsigned Nnodes = 4;
  100.       const unsigned phase = 0;

mpm/mpm/tests/materials/newtonian_test.cc:193: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  191.       mpm::Index mesh_id = 0;
  192.       const unsigned Dof = 2;
  193. >     const unsigned Nphases = 1;
  194.       const unsigned Nnodes = 4;
  195.       const unsigned phase = 0;

mpm/mpm/tests/particle_cell_crossing_test.cc:19: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  17.             "[particle][2D][cellcrossing]") {
  18.     // Dimension
  19. >   const unsigned Dim = 2;
  20.     // Degree of freedom
  21.     const unsigned Dof = 2;

mpm/mpm/tests/particle_cell_crossing_test.cc:21: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  19.     const unsigned Dim = 2;
  20.     // Degree of freedom
  21. >   const unsigned Dof = 2;
  22.     // Number of phases
  23.     const unsigned Nphases = 1;

mpm/mpm/tests/particle_cell_crossing_test.cc:23: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  21.     const unsigned Dof = 2;
  22.     // Number of phases
  23. >   const unsigned Nphases = 1;
  24.     // Phase
  25.     const unsigned Phase = 0;

mpm/mpm/tests/particle_cell_crossing_test.cc:29: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  27.     const unsigned Nnodes = 4;
  28.     // Tolerance
  29. >   const double Tolerance = 1.E-7;
  30.     // Time step
  31.     const double dt = 0.0004;

mpm/mpm/tests/point_in_cell_test.cc:18: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  16.   TEST_CASE("Point in cell 2D", "[PointInCell][2D][quad]") {
  17.     // Dimension
  18. >   const unsigned Dim = 2;
  19.     // Degrees of freedom
  20.     const unsigned Dof = 2;

mpm/mpm/tests/point_in_cell_test.cc:20: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  18.     const unsigned Dim = 2;
  19.     // Degrees of freedom
  20. >   const unsigned Dof = 2;
  21.     // Number of phases
  22.     const unsigned Nphases = 1;

mpm/mpm/tests/point_in_cell_test.cc:24: error: DEAD_STORE
  The value written to &Nnodes (type unsigned int const ) is never used.
  22.     const unsigned Nphases = 1;
  23.     // Number of nodes per cell
  24. >   const unsigned Nnodes = 4;
  25.     // Tolerance
  26.     const double Tolerance = 1.E-7;

mpm/mpm/tests/point_in_cell_test.cc:22: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  20.     const unsigned Dof = 2;
  21.     // Number of phases
  22. >   const unsigned Nphases = 1;
  23.     // Number of nodes per cell
  24.     const unsigned Nnodes = 4;

mpm/mpm/tests/cell_test.cc:21: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  19.     const unsigned Dim = 2;
  20.     // Degrees of freedom
  21. >   const unsigned Dof = 2;
  22.     // Number of phases
  23.     const unsigned Nphases = 1;

mpm/mpm/tests/cell_test.cc:23: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  21.     const unsigned Dof = 2;
  22.     // Number of phases
  23. >   const unsigned Nphases = 1;
  24.     // Number of nodes per cell
  25.     const unsigned Nnodes = 4;

mpm/mpm/tests/materials/mohr_coulomb_test.cc:22: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  20.     const double Tolerance = 1.E-7;
  21.   
  22. >   const unsigned Dim = 2;
  23.   
  24.     // Add particle

mpm/mpm/tests/mesh_neighbours_test.cc:19: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  17.   TEST_CASE("Mesh cell neighbours 2D", "[MeshCell][2D][mpi]") {
  18.     // Dimension
  19. >   const unsigned Dim = 2;
  20.     // Degrees of freedom
  21.     const unsigned Dof = 2;

mpm/mpm/tests/mesh_neighbours_test.cc:21: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  19.     const unsigned Dim = 2;
  20.     // Degrees of freedom
  21. >   const unsigned Dof = 2;
  22.     // Number of phases
  23.     const unsigned Nphases = 1;

mpm/mpm/tests/mesh_neighbours_test.cc:25: error: DEAD_STORE
  The value written to &Nnodes (type unsigned int const ) is never used.
  23.     const unsigned Nphases = 1;
  24.     // Number of nodes per cell
  25. >   const unsigned Nnodes = 4;
  26.     // Tolerance
  27.     const double Tolerance = 1.E-7;

mpm/mpm/tests/mesh_neighbours_test.cc:23: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  21.     const unsigned Dof = 2;
  22.     // Number of phases
  23. >   const unsigned Nphases = 1;
  24.     // Number of nodes per cell
  25.     const unsigned Nnodes = 4;

mpm/mpm/tests/mesh_neighbours_test.cc:27: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  25.     const unsigned Nnodes = 4;
  26.     // Tolerance
  27. >   const double Tolerance = 1.E-7;
  28.   
  29.     SECTION("Mesh cell neighbours 2D") {

mpm/mpm/tests/particle_test.cc:21: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  19.     const unsigned Dim = 1;
  20.     // Dimension
  21. >   const unsigned Dof = 1;
  22.     // Number of phases
  23.     const unsigned Nphases = 1;

mpm/mpm/tests/particle_test.cc:23: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  21.     const unsigned Dof = 1;
  22.     // Number of phases
  23. >   const unsigned Nphases = 1;
  24.     // Phase
  25.     const unsigned phase = 0;

mpm/mpm/tests/interface_test.cc:29: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  27.     const unsigned Dim = 2;
  28.     // Degrees of freedom
  29. >   const unsigned Dof = 2;
  30.     // Tolerance
  31.     const double tolerance = 1.E-7;

mpm/mpm/tests/interface_test.cc:25: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  23.     const unsigned Nnodes = 4;
  24.     // Number of phases
  25. >   const unsigned Nphases = 1;
  26.     // Dimension
  27.     const unsigned Dim = 2;

mpm/mpm/tests/mesh_test_2d.cc:29: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  27.     const unsigned Dim = 2;
  28.     // Degrees of freedom
  29. >   const unsigned Dof = 2;
  30.     // Number of phases
  31.     const unsigned Nphases = 1;

mpm/mpm/tests/mesh_test_2d.cc:31: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  29.     const unsigned Dof = 2;
  30.     // Number of phases
  31. >   const unsigned Nphases = 1;
  32.     // Number of nodes per cell
  33.     const unsigned Nnodes = 4;

mpm/mpm/tests/mesh_test_3d.cc:29: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  27.     const unsigned Dim = 3;
  28.     // Degrees of freedom
  29. >   const unsigned Dof = 6;
  30.     // Number of phases
  31.     const unsigned Nphases = 1;

mpm/mpm/tests/mesh_test_3d.cc:31: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  29.     const unsigned Dof = 6;
  30.     // Number of phases
  31. >   const unsigned Nphases = 1;
  32.     // Number of nodes per cell
  33.     const unsigned Nnodes = 8;

mpm/mpm/tests/graph_test.cc:32: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  30.   TEST_CASE("Graph is checked for 2D case", "[graph][2D]") {
  31.     // Dimension
  32. >   const unsigned Dim = 2;
  33.     // Deress of freedom
  34.     const unsigned Dof = 2;

mpm/mpm/tests/graph_test.cc:34: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  32.     const unsigned Dim = 2;
  33.     // Deress of freedom
  34. >   const unsigned Dof = 2;
  35.     // Number of nodes per cell
  36.     const unsigned Nnodes = 4;

mpm/mpm/tests/graph_test.cc:38: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  36.     const unsigned Nnodes = 4;
  37.     // Number of phases
  38. >   const unsigned Nphases = 1;
  39.   
  40.     // Tolerance

mpm/mpm/tests/graph_test.cc:41: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  39.   
  40.     // Tolerance
  41. >   const double Tolerance = 1.E-7;
  42.   
  43.     //! Try to use the graph from the guide to test the graph for 2D

mpm/mpm/tests/mpm_explicit_usf_unitcell_test.cc:71: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  69.             "[MPM][3D][Explicit][USF][1Phase][unitcell]") {
  70.     // Dimension
  71. >   const unsigned Dim = 3;
  72.   
  73.     // Write JSON file

mpm/mpm/tests/mpm_explicit_usl_unitcell_test.cc:71: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  69.             "[MPM][3D][Explicit][USL][1Phase][unitcell]") {
  70.     // Dimension
  71. >   const unsigned Dim = 3;
  72.   
  73.     // Write JSON file

mpm/mpm/tests/mpm_explicit_usf_test.cc:94: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  92.             "[MPM][3D][Explicit][USF][1Phase]") {
  93.     // Dimension
  94. >   const unsigned Dim = 3;
  95.   
  96.     // Write JSON file

mpm/mpm/tests/mpm_explicit_usl_test.cc:94: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  92.             "[MPM][3D][Explicit][USL][1Phase]") {
  93.     // Dimension
  94. >   const unsigned Dim = 3;
  95.   
  96.     // Write JSON file

mpm/mpm/tests/io/write_mesh_particles_unitcell.cc:114: error: DEAD_STORE
  The value written to &dim (type unsigned int const ) is never used.
  112.   bool write_mesh_2d_unitcell() {
  113.     // Dimension
  114. >   const unsigned dim = 2;
  115.   
  116.     // Vector of nodal coordinates

mpm/mpm/tests/io/write_mesh_particles.cc:116: error: DEAD_STORE
  The value written to &dim (type unsigned int const ) is never used.
  114.   bool write_mesh_2d() {
  115.     // Dimension
  116. >   const unsigned dim = 2;
  117.   
  118.     // Vector of nodal coordinates

mpm/mpm/tests/particle_vector_test.cc:118: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  116.   TEST_CASE("Particle vector is checked for 3D case", "[particlevector][3D]") {
  117.     // Dimension
  118. >   const unsigned Dim = 3;
  119.     // Phases
  120.     const unsigned Nphases = 1;

mpm/mpm/tests/particle_vector_test.cc:120: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  118.     const unsigned Dim = 3;
  119.     // Phases
  120. >   const unsigned Nphases = 1;
  121.     // Tolerance
  122.     const double Tolerance = 1.E-7;

mpm/mpm/tests/node_vector_test.cc:120: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  118.   TEST_CASE("Node vector is checked for 3D case", "[nodevector][3D]") {
  119.     // Dimension
  120. >   const unsigned Dim = 3;
  121.     // Degrees of freedom
  122.     const unsigned Dof = 6;

mpm/mpm/tests/node_vector_test.cc:122: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  120.     const unsigned Dim = 3;
  121.     // Degrees of freedom
  122. >   const unsigned Dof = 6;
  123.     // Number of phases
  124.     const unsigned Nphases = 1;

mpm/mpm/tests/node_vector_test.cc:124: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  122.     const unsigned Dof = 6;
  123.     // Number of phases
  124. >   const unsigned Nphases = 1;
  125.     // Tolerance
  126.     const double Tolerance = 1.E-7;

mpm/mpm/tests/node_map_test.cc:140: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  138.   TEST_CASE("Node map is checked for 3D case", "[nodemap][3D]") {
  139.     // Dimension
  140. >   const unsigned Dim = 3;
  141.     // Degrees of freedom
  142.     const unsigned Dof = 6;

mpm/mpm/tests/node_map_test.cc:142: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  140.     const unsigned Dim = 3;
  141.     // Degrees of freedom
  142. >   const unsigned Dof = 6;
  143.     // Number of phases
  144.     const unsigned Nphases = 1;

mpm/mpm/tests/node_map_test.cc:144: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  142.     const unsigned Dof = 6;
  143.     // Number of phases
  144. >   const unsigned Nphases = 1;
  145.     // Tolerance
  146.     const double Tolerance = 1.E-7;

mpm/mpm/tests/cell_vector_test.cc:154: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  152.   TEST_CASE("Cell vector is checked for 3D case", "[cellvector][3D]") {
  153.     // Dimension
  154. >   const unsigned Dim = 3;
  155.     // Degrees of freedom
  156.     const unsigned Dof = 6;

mpm/mpm/tests/cell_vector_test.cc:156: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  154.     const unsigned Dim = 3;
  155.     // Degrees of freedom
  156. >   const unsigned Dof = 6;
  157.     // Number of phases
  158.     const unsigned Nphases = 1;

mpm/mpm/tests/cell_vector_test.cc:158: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  156.     const unsigned Dof = 6;
  157.     // Number of phases
  158. >   const unsigned Nphases = 1;
  159.     // Number of nodes per cell
  160.     const unsigned Nnodes = 8;

mpm/mpm/tests/cell_vector_test.cc:163: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  161.   
  162.     // Tolerance
  163. >   const double Tolerance = 1.E-7;
  164.   
  165.     // Element

mpm/mpm/tests/materials/linear_elastic_test.cc:157: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  155.     const double Tolerance = 1.E-7;
  156.   
  157. >   const unsigned Dim = 3;
  158.   
  159.     // Add particle

mpm/mpm/tests/io/write_mesh_particles_unitcell.cc:182: error: DEAD_STORE
  The value written to &dim (type unsigned int const ) is never used.
  180.   // Write particles file in 2D
  181.   bool write_particles_2d_unitcell() {
  182. >   const unsigned dim = 2;
  183.     // Vector of particle coordinates
  184.     std::vector<Eigen::Matrix<double, dim, 1>> coordinates;

mpm/mpm/tests/io/write_mesh_particles.cc:183: error: DEAD_STORE
  The value written to &dim (type unsigned int const ) is never used.
  181.   // Write particles file in 2D
  182.   bool write_particles_2d() {
  183. >   const unsigned dim = 2;
  184.     // Vector of particle coordinates
  185.     std::vector<Eigen::Matrix<double, dim, 1>> coordinates;

mpm/mpm/tests/particle_cell_crossing_test.cc:223: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  221.             "[particle][3D][cellcrossing]") {
  222.     // Dimension
  223. >   const unsigned Dim = 3;
  224.     // Degree of freedom
  225.     const unsigned Dof = 3;

mpm/mpm/tests/particle_cell_crossing_test.cc:225: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  223.     const unsigned Dim = 3;
  224.     // Degree of freedom
  225. >   const unsigned Dof = 3;
  226.     // Number of phases
  227.     const unsigned Nphases = 1;

mpm/mpm/tests/particle_cell_crossing_test.cc:227: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  225.     const unsigned Dof = 3;
  226.     // Number of phases
  227. >   const unsigned Nphases = 1;
  228.     // Phase
  229.     const unsigned Phase = 0;

mpm/mpm/tests/particle_cell_crossing_test.cc:233: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  231.     const unsigned Nnodes = 8;
  232.     // Tolerance
  233. >   const double Tolerance = 1.E-7;
  234.     // Time step
  235.     const double dt = 0.0004;

mpm/mpm/tests/io/write_mesh_particles.cc:241: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  239.     const unsigned dim = 3;
  240.     // Tolerance
  241. >   const double Tolerance = 1.E-7;
  242.   
  243.     // Vector of nodal coordinates

mpm/mpm/tests/io/write_mesh_particles.cc:239: error: DEAD_STORE
  The value written to &dim (type unsigned int const ) is never used.
  237.   
  238.     // Dimension
  239. >   const unsigned dim = 3;
  240.     // Tolerance
  241.     const double Tolerance = 1.E-7;

mpm/mpm/tests/io/write_mesh_particles_unitcell.cc:245: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  243.     const unsigned dim = 3;
  244.     // Tolerance
  245. >   const double Tolerance = 1.E-7;
  246.   
  247.     // Vector of nodal coordinates

mpm/mpm/tests/io/write_mesh_particles_unitcell.cc:243: error: DEAD_STORE
  The value written to &dim (type unsigned int const ) is never used.
  241.   
  242.     // Dimension
  243. >   const unsigned dim = 3;
  244.     // Tolerance
  245.     const double Tolerance = 1.E-7;

mpm/mpm/tests/materials/newtonian_test.cc:269: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  267.     const double Tolerance = 1.E-7;
  268.   
  269. >   const unsigned Dim = 3;
  270.   
  271.     // Initialise material

mpm/mpm/tests/materials/newtonian_test.cc:346: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  344.       // Coordinates of nodes for the cell
  345.       mpm::Index cell_id = 0;
  346. >     const unsigned Dof = 3;
  347.       const unsigned Nphases = 1;
  348.       const unsigned Nnodes = 8;

mpm/mpm/tests/materials/newtonian_test.cc:458: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  456.       // Coordinates of nodes for the cell
  457.       mpm::Index cell_id = 0;
  458. >     const unsigned Dof = 3;
  459.       const unsigned Nphases = 1;
  460.       const unsigned Nnodes = 8;

mpm/mpm/tests/materials/newtonian_test.cc:347: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  345.       mpm::Index cell_id = 0;
  346.       const unsigned Dof = 3;
  347. >     const unsigned Nphases = 1;
  348.       const unsigned Nnodes = 8;
  349.       const unsigned phase = 0;

mpm/mpm/tests/materials/newtonian_test.cc:459: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  457.       mpm::Index cell_id = 0;
  458.       const unsigned Dof = 3;
  459. >     const unsigned Nphases = 1;
  460.       const unsigned Nnodes = 8;
  461.       const unsigned phase = 0;

mpm/mpm/tests/materials/norsand_test.cc:294: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  292.     const double Tolerance = 1.E-7;
  293.   
  294. >   const unsigned Dim = 3;
  295.   
  296.     // Add particle

mpm/mpm/tests/graph_test.cc:303: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  301.   TEST_CASE("Graph Partitioning in 2D", "[mpi][graph][2D]") {
  302.     // Dimension
  303. >   const unsigned Dim = 2;
  304.     // Degrees of freedom
  305.     const unsigned Dof = 2;

mpm/mpm/tests/graph_test.cc:305: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  303.     const unsigned Dim = 2;
  304.     // Degrees of freedom
  305. >   const unsigned Dof = 2;
  306.     // Number of phases
  307.     const unsigned Nphases = 1;

mpm/mpm/tests/graph_test.cc:307: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  305.     const unsigned Dof = 2;
  306.     // Number of phases
  307. >   const unsigned Nphases = 1;
  308.     // Number of nodes per cell
  309.     const unsigned Nnodes = 4;

mpm/mpm/tests/graph_test.cc:311: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  309.     const unsigned Nnodes = 4;
  310.     // Tolerance
  311. >   const double Tolerance = 1.E-7;
  312.   
  313.     SECTION("Transfer particles in mesh in nonrank MPI cells") {

mpm/mpm/tests/graph_test.cc:320: error: DEAD_STORE
  The value written to &receiver (type int) is never used.
  318.       int mpi_rank;
  319.       MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
  320. >     int receiver = 1;
  321.   
  322.       // Assign material

mpm/mpm/tests/graph_test.cc:520: error: DEAD_STORE
  The value written to &val (type int) is never used.
  518.           // Initialize MPI
  519.           MPI_Comm comm;
  520. >         int val = MPI_Comm_dup(MPI_COMM_WORLD, &comm);
  521.   
  522.           auto graph = std::make_shared<mpm::Graph<Dim>>(mesh->cells());

mpm/mpm/tests/io/write_mesh_particles.cc:327: error: DEAD_STORE
  The value written to &dim (type unsigned int const ) is never used.
  325.   // Write particles file in 3D
  326.   bool write_particles_3d() {
  327. >   const unsigned dim = 3;
  328.     // Vector of particle coordinates
  329.     std::vector<Eigen::Matrix<double, dim, 1>> coordinates;

mpm/mpm/tests/io/write_mesh_particles_unitcell.cc:331: error: DEAD_STORE
  The value written to &dim (type unsigned int const ) is never used.
  329.   // Write particles file in 3D
  330.   bool write_particles_3d_unitcell() {
  331. >   const unsigned dim = 3;
  332.     // Vector of particle coordinates
  333.     std::vector<Eigen::Matrix<double, dim, 1>> coordinates;

mpm/mpm/tests/particle_test.cc:404: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  402.     const unsigned Dim = 2;
  403.     // Degree of freedom
  404. >   const unsigned Dof = 2;
  405.     // Number of nodes per cell
  406.     const unsigned Nnodes = 4;

mpm/mpm/tests/particle_test.cc:863: error: DEAD_STORE
  The value written to &K (type double) is never used.
  861.   
  862.       // Check updated pressure
  863. >     const double K = 8333333.333333333;
  864.       REQUIRE(std::isnan(particle->pressure()) == true);
  865.   

mpm/mpm/tests/particle_test.cc:408: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  406.     const unsigned Nnodes = 4;
  407.     // Number of phases
  408. >   const unsigned Nphases = 1;
  409.     // Phase
  410.     const unsigned phase = 0;

mpm/mpm/tests/materials/bingham_test.cc:467: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  465.     const double Tolerance = 1.E-7;
  466.   
  467. >   const unsigned Dim = 3;
  468.   
  469.     // Initialise material

mpm/mpm/tests/materials/bingham_test.cc:553: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  551.       // Coordinates of nodes for the cell
  552.       mpm::Index cell_id = 0;
  553. >     const unsigned Dim = 3;
  554.       const unsigned Dof = 3;
  555.       const unsigned Nphases = 1;

mpm/mpm/tests/materials/bingham_test.cc:554: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  552.       mpm::Index cell_id = 0;
  553.       const unsigned Dim = 3;
  554. >     const unsigned Dof = 3;
  555.       const unsigned Nphases = 1;
  556.       const unsigned Nnodes = 8;

mpm/mpm/tests/materials/bingham_test.cc:651: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  649.       // Coordinates of nodes for the cell
  650.       mpm::Index cell_id = 0;
  651. >     const unsigned Dof = 3;
  652.       const unsigned Nphases = 1;
  653.       const unsigned Nnodes = 8;

mpm/mpm/tests/materials/bingham_test.cc:761: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  759.       // Coordinates of nodes for the cell
  760.       mpm::Index cell_id = 0;
  761. >     const unsigned Dof = 3;
  762.       const unsigned Nphases = 1;
  763.       const unsigned Nnodes = 8;

mpm/mpm/tests/materials/bingham_test.cc:881: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  879.       // Coordinates of nodes for the cell
  880.       mpm::Index cell_id = 0;
  881. >     const unsigned Dof = 3;
  882.       const unsigned Nphases = 1;
  883.       const unsigned Nnodes = 8;

mpm/mpm/tests/materials/bingham_test.cc:555: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  553.       const unsigned Dim = 3;
  554.       const unsigned Dof = 3;
  555. >     const unsigned Nphases = 1;
  556.       const unsigned Nnodes = 8;
  557.       const unsigned phase = 0;

mpm/mpm/tests/materials/bingham_test.cc:652: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  650.       mpm::Index cell_id = 0;
  651.       const unsigned Dof = 3;
  652. >     const unsigned Nphases = 1;
  653.       const unsigned Nnodes = 8;
  654.       const unsigned phase = 0;

mpm/mpm/tests/materials/bingham_test.cc:762: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  760.       mpm::Index cell_id = 0;
  761.       const unsigned Dof = 3;
  762. >     const unsigned Nphases = 1;
  763.       const unsigned Nnodes = 8;
  764.       const unsigned phase = 0;

mpm/mpm/tests/materials/bingham_test.cc:882: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  880.       mpm::Index cell_id = 0;
  881.       const unsigned Dof = 3;
  882. >     const unsigned Nphases = 1;
  883.       const unsigned Nnodes = 8;
  884.       const unsigned phase = 0;

mpm/mpm/tests/node_test.cc:519: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  517.   TEST_CASE("Node is checked for 2D case", "[node][2D]") {
  518.     const unsigned Dim = 2;
  519. >   const unsigned Dof = 2;
  520.     const unsigned Nphases = 1;
  521.     const unsigned Nphase = 0;

mpm/mpm/tests/node_test.cc:520: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  518.     const unsigned Dim = 2;
  519.     const unsigned Dof = 2;
  520. >   const unsigned Nphases = 1;
  521.     const unsigned Nphase = 0;
  522.     Eigen::Vector2d coords;

mpm/mpm/tests/node_test.cc:798: error: DEAD_STORE
  The value written to &bad_phase (type unsigned int) is never used.
  796.   
  797.         // Check if exception is handled
  798. >       unsigned bad_phase = 1;
  799.         // Exception handling invalid force dimension
  800.         // TODO Assert:

mpm/mpm/tests/node_test.cc:950: error: DEAD_STORE
  The value written to &bad_phase (type unsigned int) is never used.
  948.           acceleration_bad(i) = 10.;
  949.   
  950. >       unsigned bad_phase = 3;
  951.         // Exception handling invalid acceleration dimension
  952.         // TODO Assert:  REQUIRE_NOTHROW(node->update_acceleration(true,

mpm/mpm/tests/node_test.cc:956: error: DEAD_STORE
  The value written to &bad_phase (type unsigned int) is never used.
  954.   
  955.         // Check if exception is handled
  956. >       bad_phase = 1;
  957.         // Exception handling invalid momentum dimension
  958.         // TODO Assert:

mpm/mpm/tests/node_test.cc:662: error: DEAD_STORE
  The value written to &pmass (type double) is never used.
  660.         // Try to update pressure to 2000, should throw and keep to 1000.
  661.         pressure = 1000.;
  662. >       const double pmass = 1.5;
  663.         node->assign_pressure(Nphase, pressure);
  664.         REQUIRE(node->pressure(Nphase) == Approx(1000.0).epsilon(Tolerance));

mpm/mpm/tests/point_in_cell_test.cc:533: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  531.   TEST_CASE("Point in triangular cell 2D", "[PointInCell][2D][tri]") {
  532.     // Dimension
  533. >   const unsigned Dim = 2;
  534.     // Degrees of freedom
  535.     const unsigned Dof = 2;

mpm/mpm/tests/point_in_cell_test.cc:535: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  533.     const unsigned Dim = 2;
  534.     // Degrees of freedom
  535. >   const unsigned Dof = 2;
  536.     // Number of phases
  537.     const unsigned Nphases = 1;

mpm/mpm/tests/point_in_cell_test.cc:539: error: DEAD_STORE
  The value written to &Nnodes (type unsigned int const ) is never used.
  537.     const unsigned Nphases = 1;
  538.     // Number of nodes per cell
  539. >   const unsigned Nnodes = 3;
  540.     // Tolerance
  541.     const double Tolerance = 1.E-7;

mpm/mpm/tests/point_in_cell_test.cc:537: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  535.     const unsigned Dof = 2;
  536.     // Number of phases
  537. >   const unsigned Nphases = 1;
  538.     // Number of nodes per cell
  539.     const unsigned Nnodes = 3;

mpm/mpm/tests/materials/mohr_coulomb_test.cc:569: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  567.     const double Tolerance = 1.E-7;
  568.   
  569. >   const unsigned Dim = 2;
  570.   
  571.     // Add particle

mpm/mpm/tests/mesh_neighbours_test.cc:566: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  564.   TEST_CASE("Mesh cell neighbours 3D", "[MeshCell][3D][mpi]") {
  565.     // Dimension
  566. >   const unsigned Dim = 3;
  567.     // Degrees of freedom
  568.     const unsigned Dof = 6;

mpm/mpm/tests/mesh_neighbours_test.cc:568: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  566.     const unsigned Dim = 3;
  567.     // Degrees of freedom
  568. >   const unsigned Dof = 6;
  569.     // Number of phases
  570.     const unsigned Nphases = 1;

mpm/mpm/tests/mesh_neighbours_test.cc:570: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  568.     const unsigned Dof = 6;
  569.     // Number of phases
  570. >   const unsigned Nphases = 1;
  571.     // Number of nodes per cell
  572.     const unsigned Nnodes = 8;

mpm/mpm/tests/mesh_neighbours_test.cc:574: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  572.     const unsigned Nnodes = 8;
  573.     // Tolerance
  574. >   const double Tolerance = 1.E-9;
  575.   
  576.     // 8-noded hexahedron element

mpm/mpm/tests/graph_test.cc:570: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  568.   TEST_CASE("Graph Partitioning in 3D", "[mpi][graph][3D]") {
  569.     // Dimension
  570. >   const unsigned Dim = 3;
  571.     // Degrees of freedom
  572.     const unsigned Dof = 6;

mpm/mpm/tests/graph_test.cc:572: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  570.     const unsigned Dim = 3;
  571.     // Degrees of freedom
  572. >   const unsigned Dof = 6;
  573.     // Number of phases
  574.     const unsigned Nphases = 1;

mpm/mpm/tests/graph_test.cc:574: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  572.     const unsigned Dof = 6;
  573.     // Number of phases
  574. >   const unsigned Nphases = 1;
  575.     // Number of nodes per cell
  576.     const unsigned Nnodes = 8;

mpm/mpm/tests/graph_test.cc:578: error: DEAD_STORE
  The value written to &Tolerance (type double) is never used.
  576.     const unsigned Nnodes = 8;
  577.     // Tolerance
  578. >   const double Tolerance = 1.E-9;
  579.   
  580.     SECTION("Transfer particles in mesh in nonrank MPI cells") {

mpm/mpm/tests/graph_test.cc:587: error: DEAD_STORE
  The value written to &receiver (type int) is never used.
  585.       int mpi_rank;
  586.       MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
  587. >     int receiver = 1;
  588.   
  589.       // Assign material

mpm/mpm/tests/graph_test.cc:814: error: DEAD_STORE
  The value written to &val (type int) is never used.
  812.           // Initialize MPI
  813.           MPI_Comm comm;
  814. >         int val = MPI_Comm_dup(MPI_COMM_WORLD, &comm);
  815.   
  816.           auto graph = std::make_shared<mpm::Graph<Dim>>(mesh->cells());

mpm/mpm/tests/cell_test.cc:594: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  592.     const unsigned Dim = 3;
  593.     // Degrees of freedom
  594. >   const unsigned Dof = 6;
  595.     // Number of phases
  596.     const unsigned Nphases = 1;

mpm/mpm/tests/cell_test.cc:596: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  594.     const unsigned Dof = 6;
  595.     // Number of phases
  596. >   const unsigned Nphases = 1;
  597.     // Number of nodes per cell
  598.     const unsigned Nnodes = 8;

mpm/mpm/tests/materials/mohr_coulomb_test.cc:1033: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  1031.     const double Tolerance = 1.E-7;
  1032.   
  1033. >   const unsigned Dim = 2;
  1034.   
  1035.     // Add particle

mpm/mpm/tests/node_test.cc:1146: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  1144.   TEST_CASE("Node is checked for 3D case", "[node][3D]") {
  1145.     const unsigned Dim = 3;
  1146. >   const unsigned Dof = 3;
  1147.     const unsigned Nphases = 1;
  1148.     const unsigned Nphase = 0;

mpm/mpm/tests/node_test.cc:1147: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  1145.     const unsigned Dim = 3;
  1146.     const unsigned Dof = 3;
  1147. >   const unsigned Nphases = 1;
  1148.     const unsigned Nphase = 0;
  1149.   

mpm/mpm/tests/node_test.cc:1540: error: DEAD_STORE
  The value written to &bad_phase (type unsigned int) is never used.
  1538.   
  1539.         // Check if exception is handled
  1540. >       unsigned bad_phase = 1;
  1541.         // Exception handling invalid acceleration dimension
  1542.         // TODO assert:

mpm/mpm/tests/node_test.cc:1290: error: DEAD_STORE
  The value written to &pmass (type double) is never used.
  1288.         // Try to update pressure to 2000, should throw and keep to 1000.
  1289.         pressure = 1000.;
  1290. >       const double pmass = 1.5;
  1291.         node->assign_pressure(Nphase, pressure);
  1292.         REQUIRE(node->pressure(Nphase) == Approx(1000.0).epsilon(Tolerance));

mpm/mpm/tests/materials/mohr_coulomb_test.cc:1496: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  1494.     const double Tolerance = 1.E-7;
  1495.   
  1496. >   const unsigned Dim = 2;
  1497.   
  1498.     // Add particle

mpm/mpm/tests/particle_test.cc:1586: error: DEAD_STORE
  The value written to &Dof (type unsigned int const ) is never used.
  1584.     const unsigned Dim = 3;
  1585.     // Dimension
  1586. >   const unsigned Dof = 6;
  1587.     // Number of nodes per cell
  1588.     const unsigned Nnodes = 8;

mpm/mpm/tests/particle_test.cc:1590: error: DEAD_STORE
  The value written to &Nphases (type unsigned int const ) is never used.
  1588.     const unsigned Nnodes = 8;
  1589.     // Number of phases
  1590. >   const unsigned Nphases = 1;
  1591.     // Phase
  1592.     const unsigned phase = 0;

mpm/mpm/tests/materials/mohr_coulomb_test.cc:2486: error: DEAD_STORE
  The value written to &Dim (type unsigned int const ) is never used.
  2484.     const double Tolerance = 1.E-7;
  2485.   
  2486. >   const unsigned Dim = 3;
  2487.   
  2488.     // Add particle

Summary of the reports

  DEAD_STORE: 169
bodhinandach commented 4 years ago

@kks32 I have a similar warning in my compiler. You want me to help you clean this up? We also have one deprecated message from TBB. But I am assuming we are moving to OMP soon, so we'll just keep it?

In file included from /home/bchandra/Data/Program/CB-Geo/mpm/src/main.cc:8:
/usr/include/tbb/task_scheduler_init.h:21:154: note: #pragma message: TBB Warning: tbb/task_scheduler_init.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.
   21 | #pragma message("TBB Warning: tbb/task_scheduler_init.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")
      |                                                                                                                                                          ^
bodhinandach commented 4 years ago

@kks32 I checked this. I am not sure the unused-variables list that they suggested are all appropriate. There are some variables which they note as unused, but actually used. I prefer to add the following flag when you compile: -DCMAKE_CXX_FLAGS="Wunused-variable"

I made some modifications and will make a PR on it soon.