54 "Computes number of modes in each direction for each element.");
68 if(
m_f->m_comm->TreatAsRankZero())
70 cout <<
"ProcessNumModes: Calculating number of modes..." << endl;
75 int expdim =
m_f->m_graph->GetMeshDimension();
76 int nfields =
m_f->m_fielddef[0]->m_fields.size();
77 int addfields = expdim;
78 int npoints =
m_f->m_exp[0]->GetNpoints();
83 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
85 m_f->m_exp.resize(nfields * nstrips);
87 for (i = 0; i < addfields; ++i)
92 vector<MultiRegions::ExpListSharedPtr> Exp(nstrips * addfields);
95 nExp =
m_f->m_exp[0]->GetExpSize();
97 for (
int n = 0; n < nExp; n++)
99 offset =
m_f->m_exp[0]->GetPhys_Offset(n);
100 nq =
m_f->m_exp[0]->GetExp(n)->GetTotPoints();
102 for (i = 0; i < expdim; i++)
104 int P =
m_f->m_exp[0]->GetExp(n)->GetBasis(i)->GetNumModes();
110 for (s = 0; s < nstrips; ++s)
112 for (i = 0; i < addfields; ++i)
114 int n = s * addfields + i;
116 m_f->AppendExpList(
m_f->m_fielddef[0]->m_numHomogeneousDir);
117 Exp[n]->UpdatePhys() = outfield[i];
118 Exp[n]->FwdTrans_IterPerExp(outfield[i], Exp[n]->UpdateCoeffs());
123 for (s = 0; s < nstrips; ++s)
125 for (i = 0; i < addfields; ++i)
127 it =
m_f->m_exp.begin() + s * (nfields + addfields) + nfields + i;
128 m_f->m_exp.insert(it, Exp[s * addfields + i]);
132 vector<string> outname;
133 outname.push_back(
"P1");
136 outname.push_back(
"P2");
141 outname.push_back(
"P3");
144 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
145 m_f->m_exp[0]->GetFieldDefinitions();
146 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
149 for (s = 0; s < nstrips; ++s)
151 for (j = 0; j < nfields + addfields; ++j)
153 for (i = 0; i < FieldDef.size() / nstrips; ++i)
155 int n = s * FieldDef.size() / nstrips + i;
159 FieldDef[n]->m_fields.push_back(outname[j - nfields]);
163 FieldDef[n]->m_fields.push_back(
164 m_f->m_fielddef[0]->m_fields[j]);
167 m_f->m_exp[s * (nfields + addfields) + j]->AppendFieldData(
168 FieldDef[n], FieldData[n]);
173 m_f->m_fielddef = FieldDef;
174 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.