From 0cf527d74cbefc3f5b1b073bd56bbb3136a098d6 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 6 Jun 2012 10:25:40 +0200 Subject: [PATCH] introduced new (dummy) cylinder engine This is mainly for completeness, this engine doesn't (yet) have any functionality --- FDTD/engine_cylinder.cpp | 38 +++++++++++++++++++++++++++++++ FDTD/engine_cylinder.h | 36 +++++++++++++++++++++++++++++ FDTD/engine_cylindermultigrid.cpp | 2 +- FDTD/engine_cylindermultigrid.h | 6 ++--- FDTD/operator_cylinder.cpp | 9 ++++++++ FDTD/operator_cylinder.h | 2 ++ openEMS.pro | 4 +++- 7 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 FDTD/engine_cylinder.cpp create mode 100644 FDTD/engine_cylinder.h diff --git a/FDTD/engine_cylinder.cpp b/FDTD/engine_cylinder.cpp new file mode 100644 index 0000000..8d62cb9 --- /dev/null +++ b/FDTD/engine_cylinder.cpp @@ -0,0 +1,38 @@ +/* +* Copyright (C) 2012 Thorsten Liebig (Thorsten.Liebig@gmx.de) +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#include "engine_cylinder.h" + +Engine_Cylinder::Engine_Cylinder(const Operator_Cylinder* op) : Engine_Multithread(op) +{ + m_Op_Cyl = op; +} + +Engine_Cylinder::~Engine_Cylinder() +{ + +} + +Engine_Cylinder* Engine_Cylinder::New(const Operator_Cylinder* op, unsigned int numThreads) +{ + cout << "Create FDTD engine (cylindrical mesh using sse compression + multithreading)" << endl; + Engine_Cylinder* e = new Engine_Cylinder(op); + e->setNumThreads(numThreads); + e->Init(); + return e; +} + diff --git a/FDTD/engine_cylinder.h b/FDTD/engine_cylinder.h new file mode 100644 index 0000000..cbf33c0 --- /dev/null +++ b/FDTD/engine_cylinder.h @@ -0,0 +1,36 @@ +/* +* Copyright (C) 2012 Thorsten Liebig (Thorsten.Liebig@gmx.de) +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#ifndef ENGINE_CYLINDER_H +#define ENGINE_CYLINDER_H + +#include "operator_cylinder.h" +#include "engine_multithread.h" + +class Engine_Cylinder : public Engine_Multithread +{ +public: + static Engine_Cylinder* New(const Operator_Cylinder* op, unsigned int numThreads = 0); + virtual ~Engine_Cylinder(); + +protected: + Engine_Cylinder(const Operator_Cylinder* op); + + const Operator_Cylinder* m_Op_Cyl; +}; + +#endif // ENGINE_CYLINDER_H diff --git a/FDTD/engine_cylindermultigrid.cpp b/FDTD/engine_cylindermultigrid.cpp index 39b6bad..d7011e1 100644 --- a/FDTD/engine_cylindermultigrid.cpp +++ b/FDTD/engine_cylindermultigrid.cpp @@ -28,7 +28,7 @@ Engine_CylinderMultiGrid* Engine_CylinderMultiGrid::New(const Operator_CylinderM return e; } -Engine_CylinderMultiGrid::Engine_CylinderMultiGrid(const Operator_CylinderMultiGrid* op) : Engine_Multithread(op) +Engine_CylinderMultiGrid::Engine_CylinderMultiGrid(const Operator_CylinderMultiGrid* op) : Engine_Cylinder(op) { Op_CMG = op; diff --git a/FDTD/engine_cylindermultigrid.h b/FDTD/engine_cylindermultigrid.h index 9776ba9..6801be0 100644 --- a/FDTD/engine_cylindermultigrid.h +++ b/FDTD/engine_cylindermultigrid.h @@ -18,17 +18,17 @@ #ifndef ENGINE_CYLINDERMULTIGRID_H #define ENGINE_CYLINDERMULTIGRID_H -#include "engine_multithread.h" +#include "engine_cylinder.h" class Operator_CylinderMultiGrid; class Engine_CylinderMultiGrid_Thread; class Engine_Ext_CylinderMultiGrid; -class Engine_CylinderMultiGrid : public Engine_Multithread +class Engine_CylinderMultiGrid : public Engine_Cylinder { friend class Engine_Ext_CylinderMultiGrid; public: - Engine_CylinderMultiGrid(); +// Engine_CylinderMultiGrid(); static Engine_CylinderMultiGrid* New(const Operator_CylinderMultiGrid* op, unsigned int numThreads = 0); virtual ~Engine_CylinderMultiGrid(); diff --git a/FDTD/operator_cylinder.cpp b/FDTD/operator_cylinder.cpp index a13e2f4..af89ece 100644 --- a/FDTD/operator_cylinder.cpp +++ b/FDTD/operator_cylinder.cpp @@ -16,6 +16,7 @@ */ #include "engine.h" +#include "engine_cylinder.h" #include "Common/processfields.h" #include "operator_cylinder.h" #include "extensions/operator_extension.h" @@ -39,6 +40,14 @@ Operator_Cylinder::~Operator_Cylinder() { } + +Engine* Operator_Cylinder::CreateEngine() const +{ + //! create a special cylindrical-engine + Engine_Cylinder* eng = Engine_Cylinder::New(this, m_numThreads); + return eng; +} + void Operator_Cylinder::Init() { CC_closedAlpha = false; diff --git a/FDTD/operator_cylinder.h b/FDTD/operator_cylinder.h index 88005c1..f3c2420 100644 --- a/FDTD/operator_cylinder.h +++ b/FDTD/operator_cylinder.h @@ -73,6 +73,8 @@ public: virtual void AddExtension(Operator_Extension* op_ext); + virtual Engine* CreateEngine() const; + protected: Operator_Cylinder(); virtual void Init(); diff --git a/openEMS.pro b/openEMS.pro index 792475f..59e78f3 100644 --- a/openEMS.pro +++ b/openEMS.pro @@ -82,13 +82,14 @@ DEFINES += H5_USE_16_API #### SOURCES ################################################################ SOURCES += main.cpp \ - openems.cpp + openems.cpp # FDTD SOURCES += FDTD/engine.cpp \ FDTD/operator.cpp \ FDTD/engine_multithread.cpp \ FDTD/operator_cylinder.cpp \ + FDTD/engine_cylinder.cpp \ FDTD/engine_sse.cpp \ FDTD/operator_sse.cpp \ FDTD/operator_sse_compressed.cpp \ @@ -152,6 +153,7 @@ HEADERS += FDTD/engine.h \ FDTD/operator.h \ FDTD/engine_multithread.h \ FDTD/operator_cylinder.h \ + FDTD/engine_cylinder.h \ FDTD/engine_sse.h \ FDTD/operator_sse.h \ FDTD/excitation.h \