LCOV - code coverage report
Current view: top level - src - test.cc (source / functions) Coverage Total Hit
Test: coverage_merged.info Lines: 100.0 % 64 64
Test Date: 2025-04-03 04:02:21 Functions: 100.0 % 1 1

            Line data    Source code
       1              : #include <stdlib.h>
       2              : 
       3              : #include "Util/Util.H"
       4              : 
       5              : #include "Test/Numeric/Stencil.H"
       6              : #include "Test/Set/Matrix4.H"
       7              : 
       8              : #include "Operator/Elastic.H"
       9              : 
      10              : #include "Numeric/Interpolator/Test.H"
      11              : #include "Numeric/Interpolator/Linear.H"
      12              : 
      13              : #include "Model/Solid/Linear/Isotropic.H"
      14              : #include "Model/Solid/Linear/Cubic.H"
      15              : #include "Model/Solid/Linear/Laplacian.H"
      16              : #include "Model/Solid/Affine/Isotropic.H"
      17              : #include "Model/Solid/Affine/Cubic.H"
      18              : #include "Model/Solid/Finite/NeoHookean.H"
      19              : #include "Model/Solid/Finite/NeoHookeanPredeformed.H"
      20              : #include "Model/Solid/Finite/PseudoLinear/Cubic.H"
      21              : #include "Model/Solid/Finite/PseudoAffine/Cubic.H"
      22              : #include "Model/Solid/Linear/Hexagonal.H"
      23              : #include "Model/Solid/Affine/Hexagonal.H"
      24              : 
      25              : #include "Solver/Local/Riemann/Roe.H"
      26              : 
      27            2 : int main (int argc, char* argv[])
      28              : {
      29            2 :     Util::Initialize(argc, argv);
      30              : 
      31            2 :     int failed = 0;
      32              : 
      33            2 :     Util::globalprefix = "  │  ";
      34              : 
      35              : 
      36              :     #define MODELTEST(TYPE) \
      37              :         Util::Test::Message(#TYPE); \
      38              :         { \
      39              :             int subfailed = 0; \
      40              :             subfailed += Util::Test::SubMessage("ArithmeticTest",  TYPE::ArithmeticTest<TYPE>(true)); \
      41              :             subfailed += Util::Test::SubMessage("DerivativeTest1", TYPE::DerivativeTest1<TYPE>(true)); \
      42              :             subfailed += Util::Test::SubMessage("DerivativeTest2", TYPE::DerivativeTest2<TYPE>(true)); \
      43              :             if (TYPE::kinvar == Model::Solid::KinematicVariable::F) \
      44              :             { \
      45              :                 subfailed += Util::Test::SubMessage("MaterialFrameIndifference", TYPE::MaterialFrameIndifference<TYPE>(true)); \
      46              :             } \
      47              :             failed += Util::Test::SubFinalMessage(subfailed); \
      48              :         }
      49           16 :     MODELTEST(Model::Solid::Linear::Isotropic);
      50           16 :     MODELTEST(Model::Solid::Linear::Cubic);
      51           16 :     MODELTEST(Model::Solid::Linear::Laplacian);
      52           16 :     MODELTEST(Model::Solid::Affine::Isotropic);
      53           16 :     MODELTEST(Model::Solid::Affine::Cubic);
      54           16 :     MODELTEST(Model::Solid::Linear::Hexagonal);
      55           16 :     MODELTEST(Model::Solid::Affine::Hexagonal);
      56           20 :     MODELTEST(Model::Solid::Finite::NeoHookean);
      57           20 :     MODELTEST(Model::Solid::Finite::PseudoLinear::Cubic);
      58           20 :     MODELTEST(Model::Solid::Finite::NeoHookeanPredeformed);
      59           20 :     MODELTEST(Model::Solid::Finite::PseudoAffine::Cubic);
      60              :     
      61              : 
      62            2 :     Util::Test::Message("Set::Matrix4");
      63              :     {
      64            2 :         int subfailed = 0;
      65              :         Test::Set::Matrix4<2,Set::Sym::Full> test_2d_full;
      66            4 :         subfailed += Util::Test::SubMessage("2D - Full", test_2d_full.SymmetryTest(0));
      67              :         Test::Set::Matrix4<3,Set::Sym::Full> test_3d_full;
      68            4 :         subfailed += Util::Test::SubMessage("3D - Full", test_3d_full.SymmetryTest(0));
      69              :         Test::Set::Matrix4<3,Set::Sym::MajorMinor> test_3d_majorminor;
      70            4 :         subfailed += Util::Test::SubMessage("3D - MajorMinor", test_3d_majorminor.SymmetryTest(0));
      71            2 :         failed += Util::Test::SubFinalMessage(subfailed);
      72              :     }
      73              : 
      74            2 :     Util::Test::Message("Numeric::Interpolator<Linear>");
      75              :     {
      76            2 :         int subfailed = 0;
      77              :         Numeric::Interpolator::Test<Numeric::Interpolator::Linear<Set::Scalar> > test;
      78            4 :         subfailed += Util::Test::SubMessage("Match",test.Match(0));
      79            2 :         failed += Util::Test::SubFinalMessage(subfailed);
      80              :     }
      81              : 
      82            2 :     Util::Test::Message("Numeric::Stencil test");
      83              :     {
      84            2 :         int subfailed = 0;
      85            2 :         Test::Numeric::Stencil test;
      86            2 :         test.Define(32);
      87              :         // first order
      88           10 :         subfailed += Util::Test::SubMessage("1-0-0",test.Derivative<1,0,0>(0));
      89            8 :         subfailed += Util::Test::SubMessage("0-1-0",test.Derivative<0,1,0>(0));
      90              :         // second order
      91            8 :         subfailed += Util::Test::SubMessage("2-0-0",test.Derivative<2,0,0>(0));
      92            8 :         subfailed += Util::Test::SubMessage("0-2-0",test.Derivative<0,2,0>(0));
      93            8 :         subfailed += Util::Test::SubMessage("0-0-1",test.Derivative<0,2,0>(0));
      94            8 :         subfailed += Util::Test::SubMessage("1-1-0",test.Derivative<1,1,0>(0));
      95              :         // fourth order
      96            8 :         subfailed += Util::Test::SubMessage("3-1-0",test.Derivative<3,1,0>(0));
      97            8 :         subfailed += Util::Test::SubMessage("1-3-0",test.Derivative<1,3,0>(0));
      98            8 :         subfailed += Util::Test::SubMessage("2-2-0",test.Derivative<2,2,0>(0));
      99            8 :         subfailed += Util::Test::SubMessage("4-0-0",test.Derivative<4,0,0>(0));
     100            7 :         subfailed += Util::Test::SubMessage("0-4-0",test.Derivative<0,4,0>(0));
     101              : #if AMREX_SPACEDIM>2
     102              :         // first order
     103            4 :         subfailed += Util::Test::SubMessage("0-0-1",test.Derivative<0,0,1>(0));
     104              :         // second order
     105            4 :         subfailed += Util::Test::SubMessage("0-0-2",test.Derivative<0,0,2>(0));
     106            4 :         subfailed += Util::Test::SubMessage("1-0-1",test.Derivative<1,0,1>(0));
     107            4 :         subfailed += Util::Test::SubMessage("0-1-1",test.Derivative<0,1,1>(0));
     108              :         // fourth order
     109            4 :         subfailed += Util::Test::SubMessage("0-0-4",test.Derivative<0,0,4>(0));
     110            4 :         subfailed += Util::Test::SubMessage("0-1-3",test.Derivative<0,1,3>(0));
     111            4 :         subfailed += Util::Test::SubMessage("0-3-1",test.Derivative<0,3,1>(0));
     112            4 :         subfailed += Util::Test::SubMessage("3-0-1",test.Derivative<3,0,1>(0));
     113            4 :         subfailed += Util::Test::SubMessage("1-0-3",test.Derivative<1,0,3>(0));
     114            4 :         subfailed += Util::Test::SubMessage("0-2-2",test.Derivative<0,2,2>(0));
     115            4 :         subfailed += Util::Test::SubMessage("2-0-2",test.Derivative<2,0,2>(0));
     116            4 :         subfailed += Util::Test::SubMessage("2-1-1",test.Derivative<2,1,1>(0));
     117            4 :         subfailed += Util::Test::SubMessage("1-2-1",test.Derivative<1,2,1>(0));
     118            3 :         subfailed += Util::Test::SubMessage("1-1-2",test.Derivative<1,1,2>(0));
     119              : #endif
     120            2 :         failed += Util::Test::SubFinalMessage(subfailed);
     121            2 :     }
     122              : 
     123            2 :     Util::Test::Message("Solver::Nonlocal::Riemann::Roe test");
     124              :     {
     125            2 :         int subfailed = 0;
     126            4 :         subfailed += Util::Test::SubMessage("Test",Solver::Local::Riemann::Roe::Test());
     127            2 :         failed += Util::Test::SubFinalMessage(subfailed);
     128              :     }
     129              : 
     130            2 :     Util::globalprefix = "";
     131            6 :     Util::Message(INFO,failed," tests failed");
     132              : 
     133            2 :     Util::Finalize();
     134            2 :     return failed;
     135              : }
        

Generated by: LCOV version 2.0-1