1 /*
2 *	Copyright (C) 2010 Thorsten Liebig (Thorsten.Liebig@gmx.de)
3 *
4 *	This program is free software: you can redistribute it and/or modify
5 *	it under the terms of the GNU General Public License as published by
6 *	the Free Software Foundation, either version 3 of the License, or
7 *	(at your option) any later version.
8 *
9 *	This program is distributed in the hope that it will be useful,
10 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
11 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 *	GNU General Public License for more details.
13 *
14 *	You should have received a copy of the GNU General Public License
15 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef ENGINE_EXT_CYLINDERMULTIGRID_H
19 #define ENGINE_EXT_CYLINDERMULTIGRID_H
20 
21 #include "FDTD/engine_cylindermultigrid.h"
22 #include "engine_extension.h"
23 #include "FDTD/operator_cylindermultigrid.h"
24 
25 class Operator_Ext_CylinderMultiGrid;
26 
27 class Engine_Ext_CylinderMultiGrid : public Engine_Extension
28 {
29 public:
30 	Engine_Ext_CylinderMultiGrid(Operator_Extension* op_ext, bool isBase);
31 	virtual ~Engine_Ext_CylinderMultiGrid();
32 
33 	void SetBarrier(boost::barrier* waitBase, boost::barrier* waitChild, boost::barrier* waitSync);
34 
35 	virtual void DoPreVoltageUpdates();
36 	virtual void DoPostVoltageUpdates();
37 	virtual void Apply2Voltages();
38 
39 	virtual void DoPreCurrentUpdates();
40 	virtual void DoPostCurrentUpdates();
41 	virtual void Apply2Current();
42 
43 	virtual void SetEngine(Engine* eng);
44 
45 protected:
46 	void SyncVoltages();
47 	void SyncCurrents();
48 
49 	Engine_CylinderMultiGrid* m_Eng_MG;
50 
51 	boost::barrier *m_WaitOnBase;
52 	boost::barrier *m_WaitOnChild;
53 	boost::barrier *m_WaitOnSync;
54 
55 	bool m_IsBase;
56 };
57 
58 #endif // ENGINE_EXT_CYLINDERMULTIGRID_H
59