52 "modify a FourierHalfMode into a Fourier expansion so it can be "
53 "processed as a 3D field.");
60 ConfigOption(
false,
"NotSet",
"Take fields as sin mode");
70 if (
m_config[
"realmodetoimag"].as<string>().compare(
"NotSet"))
73 m_f->m_variables, sinmode);
76 for (
int i = 0; i <
m_f->m_data.size(); ++i)
80 m_f->m_fielddef[i]->m_basis[2] ==
82 "This module is only for fourier Half modes");
85 m_f->m_fielddef[i]->m_homogeneousZIDs.resize(2);
86 m_f->m_fielddef[i]->m_homogeneousZIDs[0] = 2;
87 m_f->m_fielddef[i]->m_homogeneousZIDs[1] = 3;
89 int nelemts =
m_f->m_fielddef[i]->m_elementIDs.size();
90 if (
m_f->m_fielddef[i]->m_uniOrder)
92 m_f->m_fielddef[i]->m_numModes[2] = 4;
96 for (
int e = 0; e < nelemts; ++e)
98 m_f->m_fielddef[i]->m_numModes[3 * e + 2] = 4;
106 int ndata =
m_f->m_data[i].size();
107 vector<NekDouble> data =
m_f->m_data[i];
108 m_f->m_data[i].resize(2 * ndata);
109 int offset = 0, count = 0;
110 for (
size_t n = 0; n <
m_f->m_fielddef[i]->m_fields.size(); ++n)
113 m_f->m_fielddef[i]->m_shapeType,
114 m_f->m_fielddef[i]->m_numModes[0],
115 m_f->m_fielddef[i]->m_numModes[1]);
116 for (
int e = 0; e < nelemts; ++e)
118 if (!
m_f->m_fielddef[i]->m_uniOrder)
122 m_f->m_fielddef[i]->m_shapeType,
123 m_f->m_fielddef[i]->m_numModes[3 * e],
124 m_f->m_fielddef[i]->m_numModes[3 * e + 1]);
126 if (sinmode.count(n))
128 for (
int l = 0; l < datalen; ++l)
130 m_f->m_data[i][count++] = 0.;
132 for (
int l = 0; l < datalen; ++l)
134 m_f->m_data[i][count++] = -data[offset + l];
139 for (
int l = 0; l < datalen; ++l)
141 m_f->m_data[i][count++] = data[offset + l];
143 for (
int l = 0; l < datalen; ++l)
145 m_f->m_data[i][count++] = 0.;
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
~ProcessHalfModeToFourier() override
void v_Process(po::variables_map &vm) override
Write mesh to output file.
static ModuleKey className
ModulePriority m_priority
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
ProcessHalfModeToFourier(FieldSharedPtr f)
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static bool GenerateVariableSet(const std::string &str, const std::vector< std::string > &variables, std::set< int > &out)
Generate a set of variable locations.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset=0)
@ eFourierHalfModeIm
Fourier Modified expansions with just the imaginary part of the first mode .
@ eFourierHalfModeRe
Fourier Modified expansions with just the real part of the first mode .
@ eFourier
Fourier Expansion .
Represents a command-line configuration option.