54 "Computes number of modes in each direction for each element.");
68 cout <<
"ProcessNumModes: Calculating number of modes..." << endl;
72 int expdim =
m_f->m_graph->GetMeshDimension();
73 int nfields =
m_f->m_fielddef[0]->m_fields.size();
74 int addfields = expdim;
75 int npoints =
m_f->m_exp[0]->GetNpoints();
80 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
82 m_f->m_exp.resize(nfields * nstrips);
84 for (i = 0; i < addfields; ++i)
89 vector<MultiRegions::ExpListSharedPtr> Exp(nstrips * addfields);
92 nExp =
m_f->m_exp[0]->GetExpSize();
94 for (
int n = 0; n < nExp; n++)
96 offset =
m_f->m_exp[0]->GetPhys_Offset(n);
97 nq =
m_f->m_exp[0]->GetExp(n)->GetTotPoints();
99 for (i = 0; i < expdim; i++)
101 int P =
m_f->m_exp[0]->GetExp(n)->GetBasis(i)->GetNumModes();
107 for (s = 0; s < nstrips; ++s)
109 for (i = 0; i < addfields; ++i)
111 int n = s * addfields + i;
113 m_f->AppendExpList(
m_f->m_fielddef[0]->m_numHomogeneousDir);
114 Exp[n]->UpdatePhys() = outfield[i];
115 Exp[n]->FwdTrans_IterPerExp(outfield[i], Exp[n]->UpdateCoeffs());
120 for (s = 0; s < nstrips; ++s)
122 for (i = 0; i < addfields; ++i)
124 it =
m_f->m_exp.begin() + s * (nfields + addfields) + nfields + i;
125 m_f->m_exp.insert(it, Exp[s * addfields + i]);
129 vector<string> outname;
130 outname.push_back(
"P1");
133 outname.push_back(
"P2");
138 outname.push_back(
"P3");
141 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
142 m_f->m_exp[0]->GetFieldDefinitions();
143 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
146 for (s = 0; s < nstrips; ++s)
148 for (j = 0; j < nfields + addfields; ++j)
150 for (i = 0; i < FieldDef.size() / nstrips; ++i)
152 int n = s * FieldDef.size() / nstrips + i;
156 FieldDef[n]->m_fields.push_back(outname[j - nfields]);
160 FieldDef[n]->m_fields.push_back(
161 m_f->m_fielddef[0]->m_fields[j]);
164 m_f->m_exp[s * (nfields + addfields) + j]->AppendFieldData(
165 FieldDef[n], FieldData[n]);
170 m_f->m_fielddef = FieldDef;
171 m_f->m_data = FieldData;
pair< ModuleType, string > ModuleKey
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
FieldSharedPtr m_f
Field object.
virtual ~ProcessNumModes()
boost::shared_ptr< Field > FieldSharedPtr
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
ModuleFactory & GetModuleFactory()
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.