Commit 2d27f961 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed DummyProblem and DummySolver

DummySolver was not used at all.

DummySolver was used only in the SolverConfig when calling the
configSetup method - but using an instance of PDEProblem is much
cleaner.
parent 634962fc
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -213,8 +213,9 @@ configSetup( Config::ConfigDescription& config )

   config.addDelimiter( "ODE solver settings:" );
   Solvers::IterativeSolver< double, int >::configSetup( config );
   Solvers::ODE::Euler<>::configSetup( config );
   Solvers::ODE::Merson<>::configSetup( config );
   using Problem = SimpleProblem< double, Devices::Host, int >;
   Solvers::ODE::Euler< Problem >::configSetup( config );
   Solvers::ODE::Merson< Problem >::configSetup( config );
}

int

src/TNL/Solvers/DummyProblem.h

deleted100644 → 0
+0 −46
Original line number Diff line number Diff line
/***************************************************************************
                          DummyProblem.h  -  description
                             -------------------
    begin                : Jul 10, 2014
    copyright            : (C) 2014 by Tomas Oberhuber
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

/* See Copyright Notice in tnl/Copyright */

#pragma once

#include <TNL/Pointers/SharedPointer.h>
#include <TNL/Devices/Host.h>
#include <TNL/Containers/Vector.h>
#include <TNL/Meshes/Grid.h>
#include <TNL/Communicators/NoDistrCommunicator.h>
#include <TNL/Problems/CommonData.h>

namespace TNL {
namespace Solvers {   

template< typename Real = double,
          typename Device = Devices::Host,
          typename Index = int >
class DummyProblem
{
   public:

      typedef Real RealType;
      typedef Device DeviceType;
      typedef Index IndexType;
      typedef Containers::Vector< Real, Device, Index > DofVectorType;
      typedef Meshes::Grid< 1, Real, Device, Index > MeshType;
      using CommonDataType = Problems::CommonData;
      using CommonDataPointer = Pointers::SharedPointer< CommonDataType, Device >;
      using CommunicatorType = Communicators::NoDistrCommunicator;
      
      static constexpr bool isTimeDependent(){ return true; };      
};

class DummySolver
{};

} // namespace Solvers
} // namespace TNL
+1 −2
Original line number Diff line number Diff line
@@ -12,14 +12,13 @@

#include <TNL/Config/ConfigDescription.h>
#include <TNL/Solvers/ODE/ExplicitSolver.h>
#include <TNL/Solvers/DummyProblem.h>
#include <TNL/Config/ParameterContainer.h>

namespace TNL {
namespace Solvers {
namespace ODE {

template< typename Problem = DummyProblem<>,
template< typename Problem,
          typename SolverMonitor = IterativeSolverMonitor< typename Problem::RealType, typename Problem::IndexType > >
class Euler : public ExplicitSolver< Problem, SolverMonitor >
{
+2 −3
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
#pragma once

#include <math.h>
#include <TNL/Solvers/DummyProblem.h>
#include <TNL/Config/ConfigDescription.h>
#include <TNL/Solvers/ODE/ExplicitSolver.h>

@@ -19,7 +18,7 @@ namespace TNL {
namespace Solvers {
namespace ODE {

template< class Problem = DummyProblem<>,
template< class Problem,
          typename SolverMonitor = IterativeSolverMonitor< typename Problem::RealType, typename Problem::IndexType > >
class Merson : public ExplicitSolver< Problem, SolverMonitor >
{
+7 −9
Original line number Diff line number Diff line
@@ -10,9 +10,9 @@

#pragma once

#include <TNL/Problems/PDEProblem.h>
#include <TNL/Solvers/SolverConfig.h>
#include <TNL/Solvers/BuildConfigTags.h>
#include <TNL/Solvers/DummyProblem.h>
#include <TNL/Solvers/PDE/ExplicitTimeStepper.h>
#include <TNL/Solvers/PDE/TimeDependentPDESolver.h>
#include <TNL/Solvers/LinearSolverTypeResolver.h>
@@ -25,8 +25,6 @@ template< typename ConfigTag,
          typename ProblemConfig >
bool SolverConfig< ConfigTag, ProblemConfig >::configSetup( Config::ConfigDescription& config )
{
   typedef DummyProblem< double, Devices::Host, int > DummyProblemType;

   config.addDelimiter( " === General parameters ==== " );
   config.addEntry< bool >( "catch-exceptions",
                            "Catch C++ exceptions. Disabling it allows the program to drop into the debugger "
@@ -89,9 +87,9 @@ bool SolverConfig< ConfigTag, ProblemConfig >::configSetup( Config::ConfigDescri
    * Time discretisation
    */
   config.addDelimiter( " === Time discretisation parameters ==== " );
   typedef PDE::ExplicitTimeStepper< DummyProblemType, ODE::Euler > ExplicitTimeStepper;
   typedef Solvers::DummySolver DiscreteSolver;
   PDE::TimeDependentPDESolver< DummyProblemType, ExplicitTimeStepper >::configSetup( config );
   using PDEProblem = Problems::PDEProblem< Meshes::Grid<1, double, Devices::Host, int>, Communicators::MpiCommunicator >;
   using ExplicitTimeStepper = PDE::ExplicitTimeStepper< PDEProblem, ODE::Euler >;
   PDE::TimeDependentPDESolver< PDEProblem, ExplicitTimeStepper >::configSetup( config );
   ExplicitTimeStepper::configSetup( config );
   if( ConfigTagTimeDiscretisation< ConfigTag, ExplicitTimeDiscretisationTag >::enabled ||
       ConfigTagTimeDiscretisation< ConfigTag, SemiImplicitTimeDiscretisationTag >::enabled ||
@@ -130,12 +128,12 @@ bool SolverConfig< ConfigTag, ProblemConfig >::configSetup( Config::ConfigDescri
   if( ConfigTagTimeDiscretisation< ConfigTag, ExplicitTimeDiscretisationTag >::enabled )
   {
      config.addDelimiter( " === Explicit solvers parameters === " );
      ODE::ExplicitSolver< DummyProblem< double, Devices::Host, int > >::configSetup( config );
      ODE::ExplicitSolver< PDEProblem >::configSetup( config );
      if( ConfigTagExplicitSolver< ConfigTag, ExplicitEulerSolverTag >::enabled )
         ODE::Euler< DummyProblem< double, Devices::Host, int > >::configSetup( config );
         ODE::Euler< PDEProblem >::configSetup( config );

      if( ConfigTagExplicitSolver< ConfigTag, ExplicitMersonSolverTag >::enabled )
         ODE::Merson< DummyProblem< double, Devices::Host, int > >::configSetup( config );
         ODE::Merson< PDEProblem >::configSetup( config );
   }
   if( ConfigTagTimeDiscretisation< ConfigTag, SemiImplicitTimeDiscretisationTag >::enabled )
   {