Changeset ac6d04 for test/unit_test/library
- Timestamp:
- Apr 10, 2012, 1:55:49 PM (14 years ago)
- Children:
- a40eea
- Parents:
- d24c2f
- Location:
- test/unit_test/library
- Files:
-
- 9 added
- 1 moved
-
dirichlet_cs.cpp (added)
-
dirichlet_cs_mpi.cpp (added)
-
dirichlet_fas.cpp (added)
-
dirichlet_fas_lr.cpp (added)
-
dirichlet_fas_lr_mpi.cpp (added)
-
dirichlet_fas_mpi.cpp (added)
-
periodic_cs.cpp (added)
-
periodic_cs_mpi.cpp (added)
-
periodic_fas.cpp (added)
-
periodic_fas_mpi.cpp (moved) (moved from test/unit_test/periodic_fas_mpi.cpp ) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
test/unit_test/library/periodic_fas_mpi.cpp
rd24c2f rac6d04 10 10 #endif 11 11 12 #include <boost/test/unit_test.hpp> 13 #include <boost/test/floating_point_comparison.hpp> 14 12 15 #ifdef HAVE_MPI 13 16 14 17 #include <mpi.h> 18 #ifdef HAVE_MARMOT 19 #include <enhancempicalls.h> 20 #include <sourceinfompicalls.h> 21 #endif 15 22 16 23 #include "base/factory.hpp" 24 #include "base/math.hpp" 17 25 #include "comm/comm_mpi.hpp" 18 26 #include "comm/domain_decomposition_mpi.hpp" … … 31 39 32 40 #include "interface_sinus.hpp" 33 #include "periodic_fas_mpi.hpp"34 41 35 42 using namespace VMG; 36 using VMGTests::PeriodicFASMPITestSuite;37 43 38 CPPUNIT_TEST_SUITE_REGISTRATION(PeriodicFASMPITestSuite);44 const vmg_float sine_factor = static_cast<vmg_float>(2.0 * Math::pi); 39 45 40 void PeriodicFASMPITestSuite::setUp() 46 struct LibraryPeriodicFASMPIFixture 41 47 { 48 LibraryPeriodicFASMPIFixture() 49 { 42 50 Factory& factory = MG::GetFactory(); 43 51 … … 45 53 comm->Register("COMM"); 46 54 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); 48 56 MG::SetInterface(interface, comm); 49 57 … … 69 77 factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3); 70 78 factory.RegisterObjectStorage("PRECISION", 1e-10); 71 factory.RegisterObjectStorage("MAX_ITERATION", 20);79 factory.RegisterObjectStorage("MAX_ITERATION", 7); 72 80 73 81 MG::IsInitialized(); 74 }75 82 76 void PeriodicFASMPITestSuite::tearDown() 77 { 83 MG::PostInit(); 84 } 85 86 ~LibraryPeriodicFASMPIFixture() 87 { 78 88 MG::Destroy(); 79 } 89 } 90 }; 80 91 81 void PeriodicFASMPITestSuite::PeriodicFASMPITest()92 BOOST_FIXTURE_TEST_CASE(LibraryPeriodicFASMPITest, LibraryPeriodicFASMPIFixture) 82 93 { 83 94 MG::Solve(); … … 86 97 double res = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs()); 87 98 88 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fabs(res/res_init), 1e-10);99 BOOST_CHECK_SMALL(res/res_init, 1e-10); 89 100 } 90 101
Note:
See TracChangeset
for help on using the changeset viewer.
