50 ModuleKey ProcessHomogeneousPlane::className =
53 ProcessHomogeneousPlane::create,
54 "Extracts a plane from a 3DH1D expansion, requires planeid to be "
62 ConfigOption(
true,
"NotSet",
"Extract plane in Fourier space");
73 cout <<
"ProcessHomogeneousPlane: Extracting plane..." << endl;
76 if ((
m_f->m_fielddef[0]->m_numHomogeneousDir) != 1)
79 "ProcessHomogeneousPlane only works for Homogeneous1D.");
83 "Missing parameter planeid for ProcessHomogeneousPlane");
85 int planeid =
m_config[
"planeid"].as<
int>();
86 int nfields =
m_f->m_fielddef[0]->m_fields.size();
89 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
91 for (
int s = 0; s < nstrips; ++s)
93 for (
int i = 0; i < nfields; ++i)
95 int n = s * nfields + i;
96 m_f->m_exp[n] =
m_f->m_exp[n]->GetPlane(planeid);
100 m_f->m_exp[n]->BwdTrans(
m_f->m_exp[n]->GetCoeffs(),
101 m_f->m_exp[n]->UpdatePhys());
105 m_f->m_exp[n]->FwdTrans(
m_f->m_exp[n]->GetPhys(),
106 m_f->m_exp[n]->UpdateCoeffs());
110 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
111 m_f->m_exp[0]->GetFieldDefinitions();
112 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
114 for (
int s = 0; s < nstrips; ++s)
116 for (
int j = 0; j < nfields; ++j)
118 for (
int i = 0; i < FieldDef.size() / nstrips; ++i)
120 int n = s * FieldDef.size() / nstrips + i;
122 FieldDef[n]->m_fields.push_back(
123 m_f->m_fielddef[0]->m_fields[j]);
124 m_f->m_exp[s * nfields + j]->AppendFieldData(FieldDef[n],
130 m_f->m_fielddef = FieldDef;
131 m_f->m_data = FieldData;
#define ASSERTL0(condition, msg)
pair< ModuleType, string > ModuleKey
map< string, ConfigOption > m_config
List of configuration values.
FieldSharedPtr m_f
Field object.
boost::shared_ptr< Field > FieldSharedPtr
virtual ~ProcessHomogeneousPlane()
Represents a command-line configuration option.
ModuleFactory & GetModuleFactory()
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.