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);
96 for (
int i = 0; i <
m_f->m_fielddef[0]->m_homogeneousZIDs.size(); ++i)
98 if (
m_f->m_fielddef[0]->m_homogeneousZIDs[i] == planeid)
106 for (
int s = 0; s < nstrips; ++s)
108 for (
int i = 0; i < nfields; ++i)
110 int n = s * nfields + i;
111 m_f->m_exp[n] =
m_f->m_exp[n]->GetPlane(plane);
113 if (
m_config[
"wavespace"].m_beenSet)
115 m_f->m_exp[n]->BwdTrans(
m_f->m_exp[n]->GetCoeffs(),
116 m_f->m_exp[n]->UpdatePhys());
120 m_f->m_exp[n]->FwdTrans(
m_f->m_exp[n]->GetPhys(),
121 m_f->m_exp[n]->UpdateCoeffs());
125 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
126 m_f->m_exp[0]->GetFieldDefinitions();
127 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
129 for (
int s = 0; s < nstrips; ++s)
131 for (
int j = 0; j < nfields; ++j)
133 for (
int i = 0; i < FieldDef.size() / nstrips; ++i)
135 int n = s * FieldDef.size() / nstrips + i;
137 FieldDef[n]->m_fields.push_back(
138 m_f->m_fielddef[0]->m_fields[j]);
139 m_f->m_exp[s * nfields + j]->AppendFieldData(FieldDef[n],
145 m_f->m_fielddef = FieldDef;
146 m_f->m_data = FieldData;
150 for (
int s = 0; s < nstrips; ++s)
152 for (
int i = 0; i < nfields; ++i)
154 int n = s * nfields + i;
160 std::vector<LibUtilities::FieldDefinitionsSharedPtr>();
161 m_f->m_data = std::vector<std::vector<NekDouble> >();
map< string, ConfigOption > m_config
List of configuration values.
#define ASSERTL0(condition, msg)
virtual void Process(po::variables_map &vm)
Write mesh to output file.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
Represents a command-line configuration option.
pair< ModuleType, string > ModuleKey
boost::shared_ptr< Field > FieldSharedPtr
virtual ~ProcessHomogeneousPlane()
Abstract base class for processing modules.
ModuleFactory & GetModuleFactory()
FieldSharedPtr m_f
Field object.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.