From d059d792f579f9e1df15b2b03093e7cb0bb62b0d Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Fri, 17 Feb 2017 13:34:13 +0100 Subject: [PATCH 1/2] Cleaned up driver. --- CMakeLists.txt | 2 +- docker/debug-release/Dockerfile | 14 ----- docker/debug/Dockerfile | 14 ----- docker/release/Dockerfile | 14 ----- include/driver.h | 102 ++++++++------------------------ source/driver.cc | 83 +++----------------------- 6 files changed, 35 insertions(+), 194 deletions(-) delete mode 100644 docker/debug-release/Dockerfile delete mode 100644 docker/debug/Dockerfile delete mode 100644 docker/release/Dockerfile diff --git a/CMakeLists.txt b/CMakeLists.txt index 06e5357..2fdca9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ SET(_main source/main.cc) # Normally you shouldn't need to change anything below. ############################################################ # Declare all source files the target consists of: -file(GLOB _files source/*cc) +file(GLOB _files source/*cc include/*h) # Don't compile the main file into the library IF(NOT "${_main}" STREQUAL "") diff --git a/docker/debug-release/Dockerfile b/docker/debug-release/Dockerfile deleted file mode 100644 index 117f910..0000000 --- a/docker/debug-release/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM heltai/deal2lkit:debug-release - -MAINTAINER luca.heltai@gmail.com - -# pi-BEM master image -RUN git clone https://github.com/mathLab/pi-BEM/ &&\ - mkdir pi-BEM/build && cd pi-BEM/build &&\ - cmake -DCMAKE_BUILD_TYPE=DebugRelease \ - -GNinja \ - ../ && \ - ninja -j4 - -# Need this for Travis! -USER root diff --git a/docker/debug/Dockerfile b/docker/debug/Dockerfile deleted file mode 100644 index d2a92fc..0000000 --- a/docker/debug/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM heltai/deal2lkit:debug - -MAINTAINER luca.heltai@gmail.com - -# pi-BEM master image -RUN git clone https://github.com/mathLab/pi-BEM/ &&\ - mkdir pi-BEM/build && cd pi-BEM/build &&\ - cmake -DCMAKE_BUILD_TYPE=Debug \ - -GNinja \ - ../ && \ - ninja -j4 - -# Need this for Travis! -USER root diff --git a/docker/release/Dockerfile b/docker/release/Dockerfile deleted file mode 100644 index 757f0e5..0000000 --- a/docker/release/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM heltai/deal2lkit:release - -MAINTAINER luca.heltai@gmail.com - -# pi-BEM master image -RUN git clone https://github.com/mathLab/pi-BEM/ &&\ - mkdir pi-BEM/build && cd pi-BEM/build &&\ - cmake -DCMAKE_BUILD_TYPE=Release \ - -GNinja \ - ../ && \ - ninja -j4 - -# Need this for Travis! -USER root diff --git a/include/driver.h b/include/driver.h index bab494b..3933161 100644 --- a/include/driver.h +++ b/include/driver.h @@ -1,117 +1,65 @@ #ifndef driver_h #define driver_h -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -// -//#include -//#include -//#include -//#include -//#include -// -//#include -//#include -//#include -//#include -//#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -// And here are a few C++ standard header -// files that we will need: -#include -#include -#include -#include -#include - #include "bem_problem.h" #include "bem_fma.h" #include "boundary_conditions.h" #include "computational_domain.h" + #include +#include using namespace dealii; -//using namespace TrilinosWrappers::MPI::Vector; -//using namespace TrilinosWrappers::MPI::SparseMatrix; - /** -* This class is in charge of organising the overall BEM simulation. It has interfaces with all the other classes in order to have a complete simulation. -*/ + * This class is in charge of organising the overall BEM simulation, + * while timing the various phases. It has interfaces with all the + * other classes in order to have a complete simulation. + */ template class Driver : public ParameterAcceptor { public: - + /** + * Initialize variables and setup parameters. + */ Driver(); - ~Driver(); - - /// method to declare the parameters - /// to be read from the parameters file - - virtual void declare_parameters(ParameterHandler &prm); - - /// method to parse the needed parameters - /// from the parameters file - - virtual void parse_parameters(ParameterHandler &prm); - - + /** + * Sets up BEMProblem and ComputationalDomain, then solve BEM. + */ void run(); private: + /// Monitor output only on first processor. ConditionalOStream pcout; + /// Mpi communicator object. MPI_Comm mpi_communicator; + /// Domain related object. ComputationalDomain computational_domain; + /// The actual bem solver. BEMProblem bem_problem; + /// Boundary conditions. BoundaryConditions boundary_conditions; - ParameterHandler prm; - + /// Flag to use global refinement. bool global_refinement; + /// Total number of processors const unsigned int n_mpi_processes; + + /// The id of this processor. const unsigned int this_mpi_process; + + /// Time monitor object. + TimeMonitor timer; }; #endif diff --git a/source/driver.cc b/source/driver.cc index 6f353d0..0eddc5f 100644 --- a/source/driver.cc +++ b/source/driver.cc @@ -1,17 +1,4 @@ #include "../include/driver.h" -#include - - -#include "Teuchos_TimeMonitor.hpp" - -using Teuchos::Time; -using Teuchos::TimeMonitor; -using Teuchos::RCP; - -RCP