2010-08-16 09:53:43 +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 PROCESSMODEMATCH_H
|
|
|
|
#define PROCESSMODEMATCH_H
|
|
|
|
|
|
|
|
#include "processintegral.h"
|
|
|
|
|
|
|
|
class CSFunctionParser;
|
|
|
|
|
2010-12-06 13:35:12 +00:00
|
|
|
//! Processing class to match a mode to a given analytic function and return the integral value.
|
|
|
|
/*!
|
2022-03-11 21:17:27 +00:00
|
|
|
The analytric function has to be defined in drawing units.
|
2010-12-06 13:35:12 +00:00
|
|
|
It will return the integral value and the mode purity as a secondary value.
|
|
|
|
*/
|
2010-08-16 09:53:43 +00:00
|
|
|
class ProcessModeMatch : public ProcessIntegral
|
|
|
|
{
|
|
|
|
public:
|
2010-12-07 15:47:23 +00:00
|
|
|
ProcessModeMatch(Engine_Interface_Base* eng_if);
|
2010-08-16 09:53:43 +00:00
|
|
|
virtual ~ProcessModeMatch();
|
|
|
|
|
2015-06-18 19:45:22 +00:00
|
|
|
virtual std::string GetProcessingName() const;
|
2011-01-18 09:34:13 +00:00
|
|
|
|
2015-06-18 19:45:22 +00:00
|
|
|
virtual std::string GetIntegralName(int row) const;
|
2011-01-18 09:34:13 +00:00
|
|
|
|
2010-08-16 09:53:43 +00:00
|
|
|
virtual void InitProcess();
|
|
|
|
virtual void Reset();
|
|
|
|
|
2010-12-06 13:35:12 +00:00
|
|
|
//! Set the field type (0 electric field, 1 magnetic field)
|
2010-08-16 09:53:43 +00:00
|
|
|
void SetFieldType(int type);
|
2010-12-06 13:35:12 +00:00
|
|
|
//! Set the mode function in the given direction ny. For example: SetModeFunction(0,"cos(pi/1000*x)*sin(pi/500*y)");
|
2015-06-18 19:45:22 +00:00
|
|
|
void SetModeFunction(int ny, std::string function);
|
2010-09-09 08:02:33 +00:00
|
|
|
|
|
|
|
virtual int GetNumberOfIntegrals() const {return 2;}
|
|
|
|
virtual double* CalcMultipleIntegrals();
|
2010-08-16 09:53:43 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
//normal direction of the mode plane
|
|
|
|
int m_ny;
|
|
|
|
|
|
|
|
int m_ModeFieldType;
|
|
|
|
|
2010-10-26 06:30:35 +00:00
|
|
|
double GetField(int ny, const unsigned int pos[3]);
|
|
|
|
double GetEField(int ny, const unsigned int pos[3]);
|
|
|
|
double GetHField(int ny, const unsigned int pos[3]);
|
2010-08-16 09:53:43 +00:00
|
|
|
|
2015-06-18 19:45:22 +00:00
|
|
|
std::string m_ModeFunction[3];
|
2010-08-16 09:53:43 +00:00
|
|
|
CSFunctionParser* m_ModeParser[2];
|
|
|
|
|
|
|
|
unsigned int m_numLines[2];
|
|
|
|
double** m_ModeDist[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PROCESSMODEMATCH_H
|