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 if(
m_f->m_comm->TreatAsRankZero())
75 cout <<
"ProcessHomogeneousPlane: Extracting plane..." << endl;
79 if ((
m_f->m_fielddef[0]->m_numHomogeneousDir) != 1)
82 "ProcessHomogeneousPlane only works for Homogeneous1D.");
86 "Missing parameter planeid for ProcessHomogeneousPlane");
88 int planeid =
m_config[
"planeid"].as<
int>();
89 int nfields =
m_f->m_fielddef[0]->m_fields.size();
92 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
94 for (
int s = 0; s < nstrips; ++s)
96 for (
int i = 0; i < nfields; ++i)
98 int n = s * nfields + i;
99 m_f->m_exp[n] =
m_f->m_exp[n]->GetPlane(planeid);
101 if (
m_config[
"wavespace"].m_beenSet)
103 m_f->m_exp[n]->BwdTrans(
m_f->m_exp[n]->GetCoeffs(),
104 m_f->m_exp[n]->UpdatePhys());
108 m_f->m_exp[n]->FwdTrans(
m_f->m_exp[n]->GetPhys(),
109 m_f->m_exp[n]->UpdateCoeffs());
113 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
114 m_f->m_exp[0]->GetFieldDefinitions();
115 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
117 for (
int s = 0; s < nstrips; ++s)
119 for (
int j = 0; j < nfields; ++j)
121 for (
int i = 0; i < FieldDef.size() / nstrips; ++i)
123 int n = s * FieldDef.size() / nstrips + i;
125 FieldDef[n]->m_fields.push_back(
126 m_f->m_fielddef[0]->m_fields[j]);
127 m_f->m_exp[s * nfields + j]->AppendFieldData(FieldDef[n],
133 m_f->m_fielddef = FieldDef;
134 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.