54 ProcessNumModes::create,
55 "Computes number of modes in each direction for each element.");
69 if (
m_f->m_comm->TreatAsRankZero())
71 cout <<
"ProcessNumModes: Calculating number of modes..." << endl;
76 int expdim =
m_f->m_graph->GetMeshDimension();
77 int nfields =
m_f->m_fielddef[0]->m_fields.size();
78 int addfields = expdim;
79 int npoints =
m_f->m_exp[0]->GetNpoints();
84 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
86 m_f->m_exp.resize(nfields * nstrips);
88 for (i = 0; i < addfields; ++i)
93 vector<MultiRegions::ExpListSharedPtr> Exp(nstrips * addfields);
96 nExp =
m_f->m_exp[0]->GetExpSize();
98 for (
int n = 0; n < nExp; n++)
100 offset =
m_f->m_exp[0]->GetPhys_Offset(n);
101 nq =
m_f->m_exp[0]->GetExp(n)->GetTotPoints();
103 for (i = 0; i < expdim; i++)
105 int P =
m_f->m_exp[0]->GetExp(n)->GetBasis(i)->GetNumModes();
111 for (s = 0; s < nstrips; ++s)
113 for (i = 0; i < addfields; ++i)
115 int n = s * addfields + i;
117 m_f->AppendExpList(
m_f->m_fielddef[0]->m_numHomogeneousDir);
118 Vmath::Vcopy(npoints, outfield[i], 1, Exp[n]->UpdatePhys(), 1);
119 Exp[n]->FwdTrans_IterPerExp(outfield[i], Exp[n]->UpdateCoeffs());
124 for (s = 0; s < nstrips; ++s)
126 for (i = 0; i < addfields; ++i)
128 it =
m_f->m_exp.begin() + s * (nfields + addfields) + nfields + i;
129 m_f->m_exp.insert(it, Exp[s * addfields + i]);
133 vector<string> outname;
134 outname.push_back(
"P1");
137 outname.push_back(
"P2");
142 outname.push_back(
"P3");
145 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
146 m_f->m_exp[0]->GetFieldDefinitions();
147 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
150 for (s = 0; s < nstrips; ++s)
152 for (j = 0; j < nfields + addfields; ++j)
154 for (i = 0; i < FieldDef.size() / nstrips; ++i)
156 int n = s * FieldDef.size() / nstrips + i;
160 FieldDef[n]->m_fields.push_back(outname[j - nfields]);
164 FieldDef[n]->m_fields.push_back(
165 m_f->m_fielddef[0]->m_fields[j]);
168 m_f->m_exp[s * (nfields + addfields) + j]->AppendFieldData(
169 FieldDef[n], FieldData[n]);
174 m_f->m_fielddef = FieldDef;
175 m_f->m_data = FieldData;
virtual void Process(po::variables_map &vm)
Write mesh to output file.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
virtual ~ProcessNumModes()
pair< ModuleType, string > ModuleKey
boost::shared_ptr< Field > FieldSharedPtr
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
Abstract base class for processing modules.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
ModuleFactory & GetModuleFactory()
FieldSharedPtr m_f
Field object.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.