Ignore:
Timestamp:
Apr 10, 2012, 1:55:49 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
a40eea
Parents:
d24c2f
Message:

Merge recent changes of the vmg library into ScaFaCos.

Includes a fix for the communication problems on Jugene.

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

Location:
test/unit_test/library
Files:
9 added
1 moved

Legend:

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

    rd24c2f rac6d04  
    1010#endif
    1111
     12#include <boost/test/unit_test.hpp>
     13#include <boost/test/floating_point_comparison.hpp>
     14
    1215#ifdef HAVE_MPI
    1316
    1417#include <mpi.h>
     18#ifdef HAVE_MARMOT
     19#include <enhancempicalls.h>
     20#include <sourceinfompicalls.h>
     21#endif
    1522
    1623#include "base/factory.hpp"
     24#include "base/math.hpp"
    1725#include "comm/comm_mpi.hpp"
    1826#include "comm/domain_decomposition_mpi.hpp"
     
    3139
    3240#include "interface_sinus.hpp"
    33 #include "periodic_fas_mpi.hpp"
    3441
    3542using namespace VMG;
    36 using VMGTests::PeriodicFASMPITestSuite;
    3743
    38 CPPUNIT_TEST_SUITE_REGISTRATION(PeriodicFASMPITestSuite);
     44const vmg_float sine_factor = static_cast<vmg_float>(2.0 * Math::pi);
    3945
    40 void PeriodicFASMPITestSuite::setUp()
     46struct LibraryPeriodicFASMPIFixture
    4147{
     48  LibraryPeriodicFASMPIFixture()
     49  {
    4250  Factory& factory = MG::GetFactory();
    4351
     
    4553  comm->Register("COMM");
    4654
    47   Interface* interface = new VMGInterfaces::InterfaceSinus(comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
     55  Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    4856  MG::SetInterface(interface, comm);
    4957
     
    6977  factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    7078  factory.RegisterObjectStorage("PRECISION", 1e-10);
    71   factory.RegisterObjectStorage("MAX_ITERATION", 20);
     79  factory.RegisterObjectStorage("MAX_ITERATION", 7);
    7280
    7381  MG::IsInitialized();
    74 }
    7582
    76 void PeriodicFASMPITestSuite::tearDown()
    77 {
     83  MG::PostInit();
     84  }
     85
     86  ~LibraryPeriodicFASMPIFixture()
     87  {
    7888  MG::Destroy();
    79 }
     89  }
     90};
    8091
    81 void PeriodicFASMPITestSuite::PeriodicFASMPITest()
     92BOOST_FIXTURE_TEST_CASE(LibraryPeriodicFASMPITest, LibraryPeriodicFASMPIFixture)
    8293{
    8394  MG::Solve();
     
    8697  double res = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs());
    8798
    88   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fabs(res/res_init), 1e-10);
     99  BOOST_CHECK_SMALL(res/res_init, 1e-10);
    89100}
    90101
Note: See TracChangeset for help on using the changeset viewer.