Ignore:
Timestamp:
Sep 20, 2012, 1:54:01 PM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
c3acbb
Parents:
2d3854
Message:

vmg: Simplified API.

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

Location:
test/unit_test/library
Files:
11 edited

Legend:

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

    r2d3854 rb57b9b  
    3434#include "base/math.hpp"
    3535#include "base/vector.hpp"
     36#include "cycles/cycle_cs_dirichlet.hpp"
    3637#include "comm/comm_serial.hpp"
    3738#include "level/level_operator_cs.hpp"
     
    3940#include "level/stencils.hpp"
    4041#include "samples/discretization_poisson_fd.hpp"
    41 #include "samples/techniques.hpp"
    4242#include "smoother/gsrb.hpp"
    4343#ifdef HAVE_LAPACK
     
    5858  LibraryDirichletCSFixture()
    5959  {
    60     Factory& factory = MG::GetFactory();
     60    const Boundary boundary(Dirichlet, Dirichlet, Dirichlet);
    6161
    62     Comm *comm = new CommSerial(Boundary(Dirichlet, Dirichlet, Dirichlet));
    63     comm->Register("COMM");
     62    new CommSerial(boundary);
     63    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     64    new DiscretizationPoissonFD(2);
     65    new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
     66    new GaussSeidelRB();
     67    new Givens<SolverRegular>();
     68    new CycleCSDirichlet(2);
    6469
    65     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    66     interface->Register("INTERFACE");
    67 
    68     Discretization* discretization = new DiscretizationPoissonFD(2);
    69     discretization->Register("DISCRETIZATION");
    70 
    71     LevelOperator* lop = new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    72     lop->Register("LEVEL_OPERATOR");
    73 
    74     Smoother* smoother = new GaussSeidelRB();
    75     smoother->Register("SMOOTHER");
    76 
    77 #ifdef HAVE_LAPACK
    78     Solver* solver = new DGESV<SolverRegular>();
    79 #else
    80     Solver* solver = new Givens<SolverRegular>();
    81 #endif
    82     solver->Register("SOLVER");
    83 
    84     Techniques::SetCorrectionSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), 2);
    85 
    86     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    87     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    88     factory.RegisterObjectStorage("PRECISION", 1e-10);
    89     factory.RegisterObjectStorage("MAX_ITERATION", 7);
     70    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     71    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     72    new ObjectStorage<int>("MAX_ITERATION", 7);
     73    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    9074
    9175    MG::PostInit();
  • test/unit_test/library/dirichlet_cs_mpi.cpp

    r2d3854 rb57b9b  
    4343#include "comm/comm_mpi.hpp"
    4444#include "comm/domain_decomposition_mpi.hpp"
     45#include "cycles/cycle_cs_dirichlet.hpp"
    4546#include "level/level_operator_cs.hpp"
    4647#include "level/level_operator.hpp"
    4748#include "samples/discretization_poisson_fd.hpp"
    48 #include "samples/techniques.hpp"
    4949#include "smoother/gsrb.hpp"
    50 #ifdef HAVE_LAPACK
    51 #include "solver/dgesv.hpp"
    52 #endif
    5350#include "solver/givens.hpp"
    5451#include "solver/solver_regular.hpp"
     
    6562  LibraryDirichletCSMPIFixture()
    6663  {
    67     Factory& factory = MG::GetFactory();
     64    const Boundary boundary(Dirichlet, Dirichlet, Dirichlet);
    6865
    69     Comm* comm = new CommMPI(Boundary(Dirichlet, Dirichlet, Dirichlet), new DomainDecompositionMPI());
    70     comm->Register("COMM");
     66    new CommMPI(boundary, new DomainDecompositionMPI());
     67    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     68    new DiscretizationPoissonFD(2);
     69    new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
     70    new GaussSeidelRB();
     71    new Givens<SolverRegular>();
     72    new CycleCSDirichlet(2);
    7173
    72     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    73     interface->Register("INTERFACE");
    74 
    75     Discretization* discretization = new DiscretizationPoissonFD(2);
    76     discretization->Register("DISCRETIZATION");
    77 
    78     LevelOperator* lop = new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    79     lop->Register("LEVEL_OPERATOR");
    80 
    81     Smoother* smoother = new GaussSeidelRB();
    82     smoother->Register("SMOOTHER");
    83 
    84 #ifdef HAVE_LAPACK
    85     Solver* solver = new DGESV<SolverRegular>();
    86 #else
    87     Solver* solver = new Givens<SolverRegular>();
    88 #endif
    89     solver->Register("SOLVER");
    90 
    91     Techniques::SetCorrectionSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), 2);
    92 
    93     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    94     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    95     factory.RegisterObjectStorage("PRECISION", 1e-10);
    96     factory.RegisterObjectStorage("MAX_ITERATION", 7);
     74    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     75    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     76    new ObjectStorage<int>("MAX_ITERATION", 7);
     77    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    9778
    9879    MG::PostInit();
  • test/unit_test/library/dirichlet_fas.cpp

    r2d3854 rb57b9b  
    3535#include "base/vector.hpp"
    3636#include "comm/comm_serial.hpp"
     37#include "cycles/cycle_fas_dirichlet.hpp"
    3738#include "level/level_operator_fas.hpp"
    3839#include "level/level_operator.hpp"
    3940#include "samples/discretization_poisson_fd.hpp"
    40 #include "samples/techniques.hpp"
    4141#include "smoother/gsrb.hpp"
    42 #ifdef HAVE_LAPACK
    43 #include "solver/dgesv.hpp"
    44 #endif
    4542#include "solver/givens.hpp"
    4643#include "solver/solver_regular.hpp"
     
    5754  LibraryDirichletFASFixture()
    5855  {
    59     Factory& factory = MG::GetFactory();
     56    const Boundary boundary(Dirichlet, Dirichlet, Dirichlet);
    6057
    61     Comm *comm = new CommSerial(Boundary(Dirichlet, Dirichlet, Dirichlet));
    62     comm->Register("COMM");
     58    new CommSerial(boundary);
     59    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     60    new DiscretizationPoissonFD(2);
     61    new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
     62    new GaussSeidelRB();
     63    new Givens<SolverRegular>();
     64    new CycleFASDirichlet(2);
    6365
    64     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    65     interface->Register("INTERFACE");
    66 
    67     Discretization* discretization = new DiscretizationPoissonFD(2);
    68     discretization->Register("DISCRETIZATION");
    69 
    70     LevelOperator* lop = new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
    71     lop->Register("LEVEL_OPERATOR");
    72 
    73     Smoother* smoother = new GaussSeidelRB();
    74     smoother->Register("SMOOTHER");
    75 
    76 #ifdef HAVE_LAPACK
    77     Solver* solver = new DGESV<SolverRegular>();
    78 #else
    79     Solver* solver = new Givens<SolverRegular>();
    80 #endif
    81 
    82     solver->Register("SOLVER");
    83 
    84     Techniques::SetFullApproximationSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), 2);
    85 
    86     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    87     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    88     factory.RegisterObjectStorage("PRECISION", 1e-10);
    89     factory.RegisterObjectStorage("MAX_ITERATION", 7);
     66    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     67    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     68    new ObjectStorage<int>("MAX_ITERATION", 7);
     69    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    9070
    9171    MG::PostInit();
  • test/unit_test/library/dirichlet_fas_lr.cpp

    r2d3854 rb57b9b  
    3535#include "base/vector.hpp"
    3636#include "comm/comm_serial.hpp"
     37#include "cycles/cycle_fas_dirichlet.hpp"
    3738#include "level/level_operator_fas.hpp"
    3839#include "level/level_operator.hpp"
    3940#include "samples/discretization_poisson_fv.hpp"
    40 #include "samples/techniques.hpp"
    4141#include "smoother/gsrb.hpp"
    42 #ifdef HAVE_LAPACK
    43 #include "solver/dgesv.hpp"
    44 #endif
    4542#include "solver/givens.hpp"
    4643#include "solver/solver_regular.hpp"
     
    5754  LibraryDirichletFASLRFixture()
    5855  {
    59     Factory& factory = MG::GetFactory();
     56    Boundary boundary(Dirichlet, Dirichlet, Dirichlet);
    6057
    61     Comm *comm = new CommSerial(Boundary(Dirichlet, Dirichlet, Dirichlet));
    62     comm->Register("COMM");
     58    new CommSerial(boundary);
     59    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0, 2, 1.6);
     60    new DiscretizationPoissonFV(2);
     61    new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
     62    new GaussSeidelRB();
     63    new Givens<SolverRegular>();
     64    new CycleFASDirichlet(2);
    6365
    64     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0, 2, 1.6);
    65     interface->Register("INTERFACE");
    66 
    67     Discretization* discretization = new DiscretizationPoissonFV(2);
    68     discretization->Register("DISCRETIZATION");
    69 
    70     LevelOperator* lop = new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
    71     lop->Register("LEVEL_OPERATOR");
    72 
    73     Smoother* smoother = new GaussSeidelRB();
    74     smoother->Register("SMOOTHER");
    75 
    76 #ifdef HAVE_LAPACK
    77     Solver* solver = new DGESV<SolverRegular>();
    78 #else
    79     Solver* solver = new Givens<SolverRegular>();
    80 #endif
    81 
    82     solver->Register("SOLVER");
    83 
    84     Techniques::SetFullApproximationSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), 2);
    85 
    86     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    87     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    88     factory.RegisterObjectStorage("PRECISION", 1e-10);
    89     factory.RegisterObjectStorage("MAX_ITERATION", 8);
     66    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     67    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     68    new ObjectStorage<int>("MAX_ITERATION", 8);
     69    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    9070
    9171    MG::PostInit();
  • test/unit_test/library/dirichlet_fas_lr_mpi.cpp

    r2d3854 rb57b9b  
    4444#include "comm/comm_mpi.hpp"
    4545#include "comm/domain_decomposition_mpi.hpp"
     46#include "cycles/cycle_fas_dirichlet.hpp"
    4647#include "level/level_operator_fas.hpp"
    4748#include "level/level_operator.hpp"
    4849#include "samples/discretization_poisson_fv.hpp"
    49 #include "samples/techniques.hpp"
    5050#include "smoother/gsrb.hpp"
    51 #ifdef HAVE_LAPACK
    52 #include "solver/dgesv.hpp"
    53 #endif
    5451#include "solver/givens.hpp"
    5552#include "solver/solver_regular.hpp"
     
    6663  LibraryDirichletFASLRMPIFixture()
    6764  {
    68     Factory& factory = MG::GetFactory();
     65    const Boundary boundary(Dirichlet, Dirichlet, Dirichlet);
    6966
    70     Comm *comm = new CommMPI(Boundary(Dirichlet, Dirichlet, Dirichlet), new DomainDecompositionMPI());
    71     comm->Register("COMM");
     67    new CommMPI(boundary, new DomainDecompositionMPI());
     68    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0, 2, 1.6);
     69    new DiscretizationPoissonFV(2);
     70    new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
     71    new GaussSeidelRB();
     72    new Givens<SolverRegular>();
     73    new CycleFASDirichlet(2);
    7274
    73     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0, 2, 1.6);
    74     interface->Register("INTERFACE");
    75 
    76     Discretization* discretization = new DiscretizationPoissonFV(2);
    77     discretization->Register("DISCRETIZATION");
    78 
    79     LevelOperator* lop = new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
    80     lop->Register("LEVEL_OPERATOR");
    81 
    82     Smoother* smoother = new GaussSeidelRB();
    83     smoother->Register("SMOOTHER");
    84 
    85 #ifdef HAVE_LAPACK
    86     Solver* solver = new DGESV<SolverRegular>();
    87 #else
    88     Solver* solver = new Givens<SolverRegular>();
    89 #endif
    90 
    91     solver->Register("SOLVER");
    92 
    93     Techniques::SetFullApproximationSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), 2);
    94 
    95     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    96     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    97     factory.RegisterObjectStorage("PRECISION", 1e-10);
    98     factory.RegisterObjectStorage("MAX_ITERATION", 8);
     75    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     76    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     77    new ObjectStorage<int>("MAX_ITERATION", 8);
     78    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    9979
    10080    MG::PostInit();
  • test/unit_test/library/dirichlet_fas_mpi.cpp

    r2d3854 rb57b9b  
    4444#include "comm/comm_mpi.hpp"
    4545#include "comm/domain_decomposition_mpi.hpp"
     46#include "cycles/cycle_fas_dirichlet.hpp"
    4647#include "level/level_operator_fas.hpp"
    4748#include "level/level_operator.hpp"
    4849#include "samples/discretization_poisson_fd.hpp"
    49 #include "samples/techniques.hpp"
    5050#include "smoother/gsrb.hpp"
    51 #ifdef HAVE_LAPACK
    52 #include "solver/dgesv.hpp"
    53 #endif
    5451#include "solver/givens.hpp"
    5552#include "solver/solver_regular.hpp"
     
    6663  LibraryDirichletFASMPIFixture()
    6764  {
    68     Factory& factory = MG::GetFactory();
     65    const Boundary boundary(Dirichlet, Dirichlet, Dirichlet);
    6966
    70     Comm *comm = new CommMPI(Boundary(Dirichlet, Dirichlet, Dirichlet), new DomainDecompositionMPI());
    71     comm->Register("COMM");
     67    new CommMPI(boundary, new DomainDecompositionMPI());
     68    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     69    new DiscretizationPoissonFD(2);
     70    new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
     71    new GaussSeidelRB();
     72    new Givens<SolverRegular>();
     73    new CycleFASDirichlet(2);
    7274
    73     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    74     interface->Register("INTERFACE");
    75 
    76     Discretization* discretization = new DiscretizationPoissonFD(2);
    77     discretization->Register("DISCRETIZATION");
    78 
    79     LevelOperator* lop = new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
    80     lop->Register("LEVEL_OPERATOR");
    81 
    82     Smoother* smoother = new GaussSeidelRB();
    83     smoother->Register("SMOOTHER");
    84 
    85 #ifdef HAVE_LAPACK
    86     Solver* solver = new DGESV<SolverRegular>();
    87 #else
    88     Solver* solver = new Givens<SolverRegular>();
    89 #endif
    90 
    91     solver->Register("SOLVER");
    92 
    93     Techniques::SetFullApproximationSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), 2);
    94 
    95     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    96     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    97     factory.RegisterObjectStorage("PRECISION", 1e-10);
    98     factory.RegisterObjectStorage("MAX_ITERATION", 7);
     75    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     76    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     77    new ObjectStorage<int>("MAX_ITERATION", 7);
     78    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    9979
    10080    MG::PostInit();
  • test/unit_test/library/force_sinus.cpp

    r2d3854 rb57b9b  
    4141#include <iostream>
    4242
    43 #include "base/factory.hpp"
    4443#include "base/math.hpp"
    4544#include "base/vector.hpp"
    4645#include "comm/comm_mpi.hpp"
    4746#include "comm/domain_decomposition_mpi.hpp"
     47#include "cycles/cycle_cs_periodic.hpp"
    4848#include "level/level_operator_cs.hpp"
    4949#include "level/level_operator.hpp"
    5050#include "samples/discretization_poisson_fd.hpp"
    51 #include "samples/techniques.hpp"
    5251#include "smoother/gsrb.hpp"
    5352#include "solver/givens.hpp"
     
    6766  LibraryForceSinusFixture()
    6867  {
    69     Factory& factory = MG::GetFactory();
     68    const Boundary boundary(Periodic, Periodic, Periodic);
    7069
    71     Comm* comm = new CommMPI(Boundary(Periodic, Periodic, Periodic), new DomainDecompositionMPI());
    72     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    73     Discretization* discretization = new DiscretizationPoissonFD(2);
    74     LevelOperator* lop = new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    75     Smoother* smoother = new GaussSeidelRB();
    76     Solver* solver = new Givens<SolverSingular>();
     70    new CommMPI(boundary, new DomainDecompositionMPI());
     71    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     72    new DiscretizationPoissonFD(2);
     73    new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
     74    new GaussSeidelRB();
     75    new Givens<SolverSingular>();
     76    new CycleCSPeriodic(2);
    7777
    78     comm->Register("COMM");
    79     interface->Register("INTERFACE");
    80     discretization->Register("DISCRETIZATION");
    81     lop->Register("LEVEL_OPERATOR");
    82     smoother->Register("SMOOTHER");
    83     solver->Register("SOLVER");
    84 
    85     Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), 2);
    86 
    87     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    88     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    89     factory.RegisterObjectStorage("PRECISION", 1e-10);
    90     factory.RegisterObjectStorage("MAX_ITERATION", 7);
     78    new ObjectStorage<vmg_int>("PRESMOOTHSTEPS", 3);
     79    new ObjectStorage<vmg_int>("POSTSMOOTHSTEPS", 3);
     80    new ObjectStorage<vmg_int>("MAX_ITERATION", 7);
     81    new ObjectStorage<vmg_float>("PRECISION", 1e-10);
    9182
    9283    MG::PostInit();
  • test/unit_test/library/periodic_cs.cpp

    r2d3854 rb57b9b  
    3535#include "base/vector.hpp"
    3636#include "comm/comm_serial.hpp"
     37#include "cycles/cycle_cs_periodic.hpp"
    3738#include "level/level_operator_cs.hpp"
    3839#include "samples/discretization_poisson_fd.hpp"
    39 #include "samples/techniques.hpp"
    4040#include "smoother/gs.hpp"
    4141#include "smoother/gsrb.hpp"
    42 #ifdef HAVE_LAPACK
    43 #include "solver/dsysv.hpp"
    44 #endif
    4542#include "solver/givens.hpp"
    4643#include "solver/solver_singular.hpp"
     
    5754  LibraryPeriodicCSFixture()
    5855  {
    59     Factory& factory = MG::GetFactory();
     56    const Boundary boundary(Periodic, Periodic, Periodic);
    6057
    61     Comm *comm = new CommSerial(Boundary(Periodic, Periodic, Periodic));
    62     comm->Register("COMM");
     58    new CommSerial(boundary);
     59    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     60    new DiscretizationPoissonFD(2);
     61    new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
     62    new GaussSeidelRB();
     63    new Givens<SolverSingular>();
     64    new CycleCSPeriodic(2);
    6365
    64     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    65     interface->Register("INTERFACE");
    66 
    67     Discretization* discretization = new DiscretizationPoissonFD(2);
    68     discretization->Register("DISCRETIZATION");
    69 
    70     LevelOperator* lop = new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    71     lop->Register("LEVEL_OPERATOR");
    72 
    73     Smoother* smoother = new GaussSeidelRB();
    74     smoother->Register("SMOOTHER");
    75 
    76 #ifdef HAVE_LAPACK
    77     Solver* solver = new DSYSV<SolverSingular>();
    78 #else
    79     Solver* solver = new Givens<SolverSingular>();
    80 #endif
    81     solver->Register("SOLVER");
    82 
    83     Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), 2);
    84 
    85     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    86     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    87     factory.RegisterObjectStorage("PRECISION", 1e-10);
    88     factory.RegisterObjectStorage("MAX_ITERATION", 7);
     66    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     67    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     68    new ObjectStorage<int>("MAX_ITERATION", 7);
     69    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    8970
    9071    MG::PostInit();
  • test/unit_test/library/periodic_cs_mpi.cpp

    r2d3854 rb57b9b  
    4343#include "comm/comm_mpi.hpp"
    4444#include "comm/domain_decomposition_mpi.hpp"
     45#include "cycles/cycle_cs_periodic.hpp"
    4546#include "level/level_operator_cs.hpp"
    4647#include "samples/discretization_poisson_fd.hpp"
    47 #include "samples/techniques.hpp"
    4848#include "smoother/gs.hpp"
    4949#include "smoother/gsrb.hpp"
    50 #ifdef HAVE_LAPACK
    51 #include "solver/dsysv.hpp"
    52 #endif
    5350#include "solver/givens.hpp"
    5451#include "solver/solver_singular.hpp"
     
    6562  LibraryPeriodicCSMPIFixture()
    6663  {
    67     Factory& factory = MG::GetFactory();
     64    const Boundary boundary(Periodic, Periodic, Periodic);
    6865
    69     Comm *comm = new CommMPI(Boundary(Periodic, Periodic, Periodic), new DomainDecompositionMPI());
    70     comm->Register("COMM");
     66    new CommMPI(boundary, new DomainDecompositionMPI());
     67    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     68    new DiscretizationPoissonFD(2);
     69    new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
     70    new GaussSeidelRB();
     71    new Givens<SolverSingular>();
     72    new CycleCSPeriodic(2);
    7173
    72     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    73     interface->Register("INTERFACE");
    74 
    75     Discretization* discretization = new DiscretizationPoissonFD(2);
    76     discretization->Register("DISCRETIZATION");
    77 
    78     LevelOperator* lop = new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    79     lop->Register("LEVEL_OPERATOR");
    80 
    81     Smoother* smoother = new GaussSeidelRB();
    82     smoother->Register("SMOOTHER");
    83 
    84 #ifdef HAVE_LAPACK
    85     Solver* solver = new DSYSV<SolverSingular>();
    86 #else
    87     Solver* solver = new Givens<SolverSingular>();
    88 #endif
    89     solver->Register("SOLVER");
    90 
    91     Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), 2);
    92 
    93     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    94     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    95     factory.RegisterObjectStorage("PRECISION", 1e-10);
    96     factory.RegisterObjectStorage("MAX_ITERATION", 7);
     74    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     75    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     76    new ObjectStorage<int>("MAX_ITERATION", 7);
     77    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    9778
    9879    MG::PostInit();
  • test/unit_test/library/periodic_fas.cpp

    r2d3854 rb57b9b  
    3434#include "base/math.hpp"
    3535#include "comm/comm_serial.hpp"
     36#include "cycles/cycle_fas_periodic.hpp"
    3637#include "level/level_operator_fas.hpp"
    3738#include "samples/discretization_poisson_fd.hpp"
    38 #include "samples/techniques.hpp"
    39 #include "smoother/gs.hpp"
    4039#include "smoother/gsrb.hpp"
    41 #ifdef HAVE_LAPACK
    42 #include "solver/dsysv.hpp"
    43 #endif
    4440#include "solver/givens.hpp"
    4541#include "solver/solver_singular.hpp"
     
    5652  LibraryPeriodicFASFixture()
    5753  {
    58     Factory& factory = MG::GetFactory();
     54    const Boundary boundary(Periodic, Periodic, Periodic);
    5955
    60     Comm *comm = new CommSerial(Boundary(Periodic, Periodic, Periodic));
    61     comm->Register("COMM");
     56    new CommSerial(boundary);
     57    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     58    new DiscretizationPoissonFD(2);
     59    new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
     60    new GaussSeidelRB();
     61    new Givens<SolverSingular>();
     62    new CycleFASPeriodic(2);
    6263
    63     Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    64     interface->Register("INTERFACE");
    65 
    66     Discretization* discretization = new DiscretizationPoissonFD(2);
    67     discretization->Register("DISCRETIZATION");
    68 
    69     LevelOperator* lop = new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
    70     lop->Register("LEVEL_OPERATOR");
    71 
    72     Smoother* smoother = new GaussSeidelRB();
    73     smoother->Register("SMOOTHER");
    74 
    75 #ifdef HAVE_LAPACK
    76     Solver* solver = new DSYSV<SolverSingular>();
    77 #else
    78     Solver* solver = new Givens<SolverSingular>();
    79 #endif
    80     solver->Register("SOLVER");
    81 
    82     Techniques::SetFullApproximationSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), 2);
    83 
    84     factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    85     factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    86     factory.RegisterObjectStorage("PRECISION", 1e-10);
    87     factory.RegisterObjectStorage("MAX_ITERATION", 7);
     64    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     65    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     66    new ObjectStorage<int>("MAX_ITERATION", 7);
     67    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    8868
    8969    MG::PostInit();
  • test/unit_test/library/periodic_fas_mpi.cpp

    r2d3854 rb57b9b  
    4343#include "comm/comm_mpi.hpp"
    4444#include "comm/domain_decomposition_mpi.hpp"
     45#include "cycles/cycle_fas_periodic.hpp"
    4546#include "level/level_operator_fas.hpp"
    4647#include "samples/discretization_poisson_fd.hpp"
    47 #include "samples/techniques.hpp"
    48 #include "smoother/gs.hpp"
    4948#include "smoother/gsrb.hpp"
    50 #ifdef HAVE_LAPACK
    51 #include "solver/dsysv.hpp"
    52 #endif
    5349#include "solver/givens.hpp"
    5450#include "solver/solver_singular.hpp"
     
    6561  LibraryPeriodicFASMPIFixture()
    6662  {
    67   Factory& factory = MG::GetFactory();
     63    const Boundary boundary(Periodic, Periodic, Periodic);
    6864
    69   Comm* comm = new CommMPI(Boundary(Periodic, Periodic, Periodic), new DomainDecompositionMPI());
    70   comm->Register("COMM");
     65    new CommMPI(boundary, new DomainDecompositionMPI());
     66    new VMGInterfaces::InterfaceSinus(sine_factor, boundary, 2, 6, 0.0, 1.0);
     67    new DiscretizationPoissonFD(2);
     68    new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
     69    new GaussSeidelRB();
     70    new Givens<SolverSingular>();
     71    new CycleFASPeriodic(2);
    7172
    72   Interface* interface = new VMGInterfaces::InterfaceSinus(sine_factor, comm->BoundaryConditions(), 2, 6, 0.0, 1.0);
    73   interface->Register("INTERFACE");
     73    new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     74    new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     75    new ObjectStorage<int>("MAX_ITERATION", 7);
     76    new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
    7477
    75   Discretization* discretization = new DiscretizationPoissonFD(2);
    76   discretization->Register("DISCRETIZATION");
     78    MG::PostInit();
    7779
    78   LevelOperator* lop = new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
    79   lop->Register("LEVEL_OPERATOR");
    80 
    81   Smoother* smoother = new GaussSeidelRB();
    82   smoother->Register("SMOOTHER");
    83 
    84 #ifdef HAVE_LAPACK
    85   Solver* solver = new DSYSV<SolverSingular>();
    86 #else
    87   Solver* solver = new Givens<SolverSingular>();
    88 #endif
    89   solver->Register("SOLVER");
    90 
    91   Techniques::SetFullApproximationSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), 2);
    92 
    93   factory.RegisterObjectStorage("PRESMOOTHSTEPS", 3);
    94   factory.RegisterObjectStorage("POSTSMOOTHSTEPS", 3);
    95   factory.RegisterObjectStorage("PRECISION", 1e-10);
    96   factory.RegisterObjectStorage("MAX_ITERATION", 7);
    97 
    98   MG::PostInit();
    99 
    100   MG::IsInitialized();
     80    MG::IsInitialized();
    10181  }
    10282
    10383  ~LibraryPeriodicFASMPIFixture()
    10484  {
    105   MG::Destroy();
     85    MG::Destroy();
    10686  }
    10787};
Note: See TracChangeset for help on using the changeset viewer.