2010-09-08 05:36:32 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ENGINE_CYLINDERMULTIGRID_H
|
|
|
|
#define ENGINE_CYLINDERMULTIGRID_H
|
|
|
|
|
|
|
|
#include "engine_multithread.h"
|
|
|
|
|
|
|
|
class Operator_CylinderMultiGrid;
|
|
|
|
class Engine_CylinderMultiGrid_Thread;
|
|
|
|
class Engine_Ext_CylinderMultiGrid;
|
|
|
|
|
|
|
|
class Engine_CylinderMultiGrid : public Engine_Multithread
|
|
|
|
{
|
|
|
|
friend class Engine_Ext_CylinderMultiGrid;
|
|
|
|
public:
|
2010-12-06 12:04:37 +00:00
|
|
|
Engine_CylinderMultiGrid();
|
2010-09-08 05:36:32 +00:00
|
|
|
|
|
|
|
static Engine_CylinderMultiGrid* New(const Operator_CylinderMultiGrid* op, unsigned int numThreads = 0);
|
|
|
|
virtual ~Engine_CylinderMultiGrid();
|
|
|
|
|
|
|
|
virtual void InterpolVoltChild2Base(unsigned int rzPlane);
|
|
|
|
virtual void InterpolCurrChild2Base(unsigned int rzPlane);
|
|
|
|
|
|
|
|
virtual void Init();
|
|
|
|
|
|
|
|
//! Iterate \a iterTS number of timesteps
|
|
|
|
virtual bool IterateTS(unsigned int iterTS);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Engine_CylinderMultiGrid(const Operator_CylinderMultiGrid* op);
|
|
|
|
const Operator_CylinderMultiGrid* Op_CMG;
|
|
|
|
|
|
|
|
Engine_Multithread* m_InnerEngine;
|
|
|
|
|
|
|
|
volatile unsigned int m_Thread_NumTS;
|
|
|
|
boost::thread_group m_IteratorThread_Group;
|
|
|
|
boost::barrier *m_startBarrier;
|
|
|
|
boost::barrier *m_stopBarrier;
|
|
|
|
Engine_CylinderMultiGrid_Thread* m_IteratorThread;
|
|
|
|
Engine_CylinderMultiGrid_Thread* m_InnerIteratorThread;
|
2010-12-06 12:04:37 +00:00
|
|
|
|
2010-09-08 05:36:32 +00:00
|
|
|
//extension barrier
|
|
|
|
boost::barrier *m_WaitOnBase;
|
|
|
|
boost::barrier *m_WaitOnChild;
|
|
|
|
boost::barrier *m_WaitOnSync;
|
|
|
|
|
|
|
|
Engine_Ext_CylinderMultiGrid* m_Eng_Ext_MG;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Engine_CylinderMultiGrid_Thread
|
|
|
|
{
|
|
|
|
public:
|
2010-09-08 14:07:28 +00:00
|
|
|
Engine_CylinderMultiGrid_Thread( Engine_Multithread* engine, boost::barrier *start, boost::barrier *stop, volatile unsigned int* numTS, bool isBase);
|
2010-09-08 05:36:32 +00:00
|
|
|
void operator()();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Engine_Multithread *m_Eng;
|
2010-09-08 14:07:28 +00:00
|
|
|
bool m_isBase;
|
2010-09-08 05:36:32 +00:00
|
|
|
boost::barrier *m_startBarrier;
|
|
|
|
boost::barrier *m_stopBarrier;
|
|
|
|
volatile unsigned int *m_numTS;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ENGINE_CYLINDERMULTIGRID_H
|