2011-02-08 13:08:58 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 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 OPERATOR_MPI_H
|
|
|
|
#define OPERATOR_MPI_H
|
|
|
|
|
|
|
|
#include "operator_sse_compressed.h"
|
|
|
|
|
|
|
|
class Operator_MPI : public Operator_SSE_Compressed
|
|
|
|
{
|
2011-02-09 11:55:07 +00:00
|
|
|
friend class Engine_MPI;
|
2011-02-08 13:08:58 +00:00
|
|
|
public:
|
|
|
|
//! Create a new operator
|
|
|
|
static Operator_MPI* New();
|
|
|
|
virtual ~Operator_MPI();
|
|
|
|
|
2011-02-11 13:42:14 +00:00
|
|
|
bool GetMPIEnabled() const {return m_MPI_Enabled;}
|
|
|
|
|
2011-02-09 11:55:07 +00:00
|
|
|
virtual void SetBoundaryCondition(int* BCs);
|
|
|
|
virtual void ApplyElectricBC(bool* dirs);
|
|
|
|
|
2011-02-08 13:08:58 +00:00
|
|
|
virtual Engine* CreateEngine() const;
|
|
|
|
|
2011-02-22 11:11:08 +00:00
|
|
|
virtual void SetTag(int tag) {m_MyTag=tag;}
|
|
|
|
|
|
|
|
virtual void SetNeighborUp(int ny, int id);
|
|
|
|
virtual void SetNeighborDown(int ny, int id);
|
|
|
|
|
2011-03-08 13:03:24 +00:00
|
|
|
virtual void DumpExciationSignals();
|
|
|
|
|
2011-03-14 15:20:33 +00:00
|
|
|
virtual void SetSplitPos(int ny, unsigned int pos) {m_SplitPos[ny]=pos;}
|
|
|
|
virtual void SetOriginalMesh(CSRectGrid* orig_Mesh);
|
|
|
|
|
2011-02-08 13:08:58 +00:00
|
|
|
protected:
|
|
|
|
Operator_MPI();
|
2011-02-11 13:42:14 +00:00
|
|
|
bool m_MPI_Enabled;
|
2011-02-08 13:08:58 +00:00
|
|
|
virtual void Init();
|
|
|
|
void Delete();
|
|
|
|
virtual void Reset();
|
2011-02-09 11:55:07 +00:00
|
|
|
|
2011-02-11 13:42:14 +00:00
|
|
|
virtual double CalcTimestep();
|
|
|
|
|
2011-02-09 11:55:07 +00:00
|
|
|
int m_MyID;
|
|
|
|
int m_NumProc;
|
|
|
|
int m_MyTag;
|
|
|
|
char* m_Processor_Name;
|
|
|
|
|
|
|
|
//the up and down neighbors, -1 if non for the given direction
|
|
|
|
int m_NeighborUp[3];
|
|
|
|
int m_NeighborDown[3];
|
2011-02-21 09:00:11 +00:00
|
|
|
|
2011-03-14 15:20:33 +00:00
|
|
|
double* m_OrigDiscLines[3];
|
|
|
|
unsigned int m_OrigNumLines[3];
|
|
|
|
unsigned int m_SplitPos[3];
|
|
|
|
|
2011-02-21 09:00:11 +00:00
|
|
|
string PrependRank(string name);
|
|
|
|
|
|
|
|
virtual void DumpOperator2File(string filename);
|
|
|
|
virtual void DumpMaterial2File(string filename);
|
|
|
|
virtual void DumpPEC2File( string filename );
|
2011-02-08 13:08:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OPERATOR_MPI_H
|