2011-02-11 12:52:48 +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 OPENEMS_FDTD_MPI_H
|
|
|
|
#define OPENEMS_FDTD_MPI_H
|
|
|
|
|
|
|
|
#include "openems.h"
|
|
|
|
|
|
|
|
class ProcessFields;
|
2011-02-22 09:28:15 +00:00
|
|
|
class Operator_MPI;
|
2011-02-25 10:58:23 +00:00
|
|
|
class CSRectGrid;
|
2011-02-11 12:52:48 +00:00
|
|
|
|
|
|
|
class openEMS_FDTD_MPI : public openEMS
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
openEMS_FDTD_MPI();
|
|
|
|
virtual ~openEMS_FDTD_MPI();
|
|
|
|
|
|
|
|
virtual void RunFDTD();
|
|
|
|
|
|
|
|
virtual bool parseCommandLineArgument( const char *argv );
|
|
|
|
|
2011-03-08 13:43:48 +00:00
|
|
|
static string GetExtLibsInfo();
|
|
|
|
|
2011-02-11 12:52:48 +00:00
|
|
|
protected:
|
2011-02-22 09:28:15 +00:00
|
|
|
Operator_MPI* m_MPI_Op;
|
2011-02-25 10:58:23 +00:00
|
|
|
CSRectGrid* m_Original_Grid;
|
2011-02-11 12:52:48 +00:00
|
|
|
int m_MyID;
|
|
|
|
int m_NumProc;
|
2011-02-16 14:17:51 +00:00
|
|
|
bool m_MPI_Enabled;
|
2011-02-11 12:52:48 +00:00
|
|
|
unsigned int m_NumberCells;
|
2011-02-22 09:28:15 +00:00
|
|
|
|
|
|
|
virtual bool SetupMPI(TiXmlElement* FDTD_Opts);
|
2011-02-11 12:52:48 +00:00
|
|
|
virtual bool SetupOperator(TiXmlElement* FDTD_Opts);
|
|
|
|
|
|
|
|
int* m_Gather_Buffer;
|
|
|
|
unsigned int GetNextStep();
|
|
|
|
|
|
|
|
ProcessFields* m_ProcField;
|
|
|
|
double m_MaxEnergy;
|
|
|
|
double m_EnergyDecrement;
|
|
|
|
double* m_Energy_Buffer;
|
|
|
|
//! Check if energy calc is requested...
|
|
|
|
bool CheckEnergyCalc();
|
|
|
|
//! Calc energy in all processes and add up
|
|
|
|
double CalcEnergy();
|
2011-02-16 09:12:41 +00:00
|
|
|
|
|
|
|
virtual bool SetupProcessing();
|
2011-03-08 11:06:47 +00:00
|
|
|
|
|
|
|
//output redirection to file for ranks > 0
|
|
|
|
ofstream* m_Output;
|
2011-02-11 12:52:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OPENEMS_FDTD_MPI_H
|