Changeset 0260d3 for test


Ignore:
Timestamp:
Jul 5, 2012, 11:54:39 AM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
185795
Parents:
ef94e7
Message:

vmg: Removed debug output from test suite.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1901 5161e1c8-67bf-11de-9fd5-51895aff932f

Location:
test/unit_test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/unit_test/library/force_sinus.cpp

    ref94e7 r0260d3  
    131131
    132132      }
    133 
    134   pos.X() = 0.25;
    135   pos.Y() = 0.25;
    136   for (pos.Z() = 0.25; pos.Z()<=0.75; pos.Z() += 0.001) {
    137         p.Pos() = pos;
    138 
    139         const Index index = (p.Pos()-sol.Extent().Begin())/sol.Extent().MeshWidth()-sol.Global().LocalBegin()+sol.Local().Begin();
    140 
    141         ip.ComputeCoefficients(sol, index);
    142         ip.Evaluate(p);
    143 
    144         Vector ref = Vector(std::cos(sine_factor*p.Pos().X())*std::sin(sine_factor*p.Pos().Y())*std::sin(sine_factor*p.Pos().Z()),
    145                             std::sin(sine_factor*p.Pos().X())*std::cos(sine_factor*p.Pos().Y())*std::sin(sine_factor*p.Pos().Z()),
    146                             std::sin(sine_factor*p.Pos().X())*std::sin(sine_factor*p.Pos().Y())*std::cos(sine_factor*p.Pos().Z()));
    147         ref *= -1.0 * sine_factor;
    148         std::cout << pos.Z() << " " << std::abs((ref.Z() - p.Field().Z()) / ref.Z()) << std::endl;
    149   }
    150133}
    151134
  • test/unit_test/unit_test/interpolate_test.cpp

    ref94e7 r0260d3  
    5454  InterpolateFixture()
    5555  {
    56     grid = new TempGrid(64, 9, 0.0, 1.0);
     56    grid = new TempGrid(64, 5, 0.0, 1.0);
    5757
    5858    Index i;
     
    8080{
    8181  Index i;
    82   Particle::Interpolation ip(8);
     82  Particle::Interpolation ip(5);
    8383  Particle::Particle p;
    84 
    85   vmg_float min = 1.0, max = 0.0, diff;
    8684
    8785  for (i.X() = grid->Local().Begin().X(); i.X()<grid->Local().End().X(); ++i.X())
     
    9896
    9997        ip.Evaluate(p);
    100 
    10198        BOOST_CHECK_SMALL(p.Pot() - grid->GetVal(i), 1.0e-12);
    10299
    103         for (p.Pos().X()=pos_begin.X(); p.Pos().X()<pos_end.X(); p.Pos().X()+=grid->Extent().MeshWidth().X()*0.25)
    104           for (p.Pos().Y()=pos_begin.Y(); p.Pos().Y()<pos_end.Y(); p.Pos().Y()+=grid->Extent().MeshWidth().Y()*0.25)
    105             for (p.Pos().Z()=pos_begin.Z(); p.Pos().Z()<pos_end.Z(); p.Pos().Z()+=grid->Extent().MeshWidth().Z()*0.25) {
    106               ip.Evaluate(p);
    107               diff = std::abs(p.Pot() - f(p.Pos()));
    108               min = std::min(min, diff);
    109               max = std::max(max, diff);
    110             }
     100        p.Pos() += 0.5 * grid->Extent().MeshWidth();
     101        ip.Evaluate(p);
     102        BOOST_CHECK_SMALL(p.Pot() - f(p.Pos()), 1.0e-7);
    111103
    112104      }
    113105
    114   BOOST_CHECK_SMALL(max, 1.0e-7);
    115106}
    116107
     108/*
    117109BOOST_AUTO_TEST_CASE(InterpolateFieldTest)
    118110{
     
    123115
    124116  vmg_float max_error = 0.0;
    125   /*
     117
    126118  for(p.Pos().X()=grid->Extent().Begin().X(); p.Pos().X()<grid->Extent().End().X(); p.Pos().X() += 0.01 * (grid->Extent().End().X() - grid->Extent().Begin().X()))
    127119    for(p.Pos().Y()=grid->Extent().Begin().Y(); p.Pos().Y()<grid->Extent().End().Y(); p.Pos().Y() += 0.01 * (grid->Extent().End().Y() - grid->Extent().Begin().Y()))
     
    143135
    144136  std::printf("Max error: %e\n", max_error);
    145   */
    146137
    147138  p.Pos().X() = 0.25;
     
    157148
    158149    ip.Evaluate(p);
    159 
    160     std::printf("%e %e\n", p.Pos().Z(), std::abs((p.Field().Z() - grad_f(p.Pos()).Z())/grad_f(p.Pos()).Z()));
    161     //std::printf("%e %e\n", p.Pos().Z(), std::abs(p.Field().Z() - grad_f(p.Pos()).Z()));
    162     //std::printf("%e %e\n", p.Pos().Z(), p.Field().Z());
    163 
    164150  }
    165151}
     152*/
    166153
    167154BOOST_AUTO_TEST_SUITE_END()
Note: See TracChangeset for help on using the changeset viewer.