Select Git revision
plot_timewave.py
-
Xavier Adriaens authoredXavier Adriaens authored
NearToFarField.cpp 19.60 KiB
// Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
//
// Contributor(s):
// Ruth Sabariego
//
#include <complex>
#include "NearToFarField.h"
#include "OS.h"
StringXNumber NearToFarFieldOptions_Number[] = {
{GMSH_FULLRC, "Wavenumber", NULL, 1.},
{GMSH_FULLRC, "PhiStart", NULL, 0.},
{GMSH_FULLRC, "PhiEnd", NULL, 2. * M_PI},
{GMSH_FULLRC, "NumPointsPhi", NULL, 60},
{GMSH_FULLRC, "ThetaStart", NULL, 0.},
{GMSH_FULLRC, "ThetaEnd", NULL, M_PI},
{GMSH_FULLRC, "NumPointsTheta", NULL, 30},
{GMSH_FULLRC, "EView", NULL, 0},
{GMSH_FULLRC, "HView", NULL, 1},
{GMSH_FULLRC, "Normalize", NULL, 1},
{GMSH_FULLRC, "dB", NULL, 1},
{GMSH_FULLRC, "NegativeTime", NULL, 0.},
{GMSH_FULLRC, "RFar", NULL, 0},
};
StringXString NearToFarFieldOptions_String[] = {
{GMSH_FULLRC, "MatlabOutputFile", NULL, "farfield.m"},
};
extern "C" {
GMSH_Plugin *GMSH_RegisterNearToFarFieldPlugin()
{
return new GMSH_NearToFarFieldPlugin();
}
}
std::string GMSH_NearToFarFieldPlugin::getHelp() const
{
return "Plugin(NearToFarField) computes the far field pattern "
"from the near electric E and magnetic H fields on a surface "
"enclosing the radiating device (antenna).\n\n"
"Parameters: the wavenumber, the "
"angular discretisation (phi in [0, 2*Pi] and theta in [0, Pi]) "
"of the far field sphere and the indices of the views containing the "
"complex-valued E and H fields. If `Normalize' is set, the far field "
"is normalized to 1. If `dB' is set, the far field is computed in dB. "
"If `NegativeTime' is set, E and H are assumed to have exp(-iwt) time "
"dependency; otherwise they are assume to have exp(+iwt) time "
"dependency. If `MatlabOutputFile' is given the raw far field data is "
"also exported in Matlab format.\n\n"
"Plugin(NearToFarField) creates one new view.";
}
int GMSH_NearToFarFieldPlugin::getNbOptions() const
{
return sizeof(NearToFarFieldOptions_Number) / sizeof(StringXNumber);
}
int GMSH_NearToFarFieldPlugin::getNbOptionsStr() const
{
return sizeof(NearToFarFieldOptions_String) / sizeof(StringXString);
}
StringXNumber *GMSH_NearToFarFieldPlugin::getOption(int iopt)
{
return &NearToFarFieldOptions_Number[iopt];