43 static std::string
npts = LibUtilities::SessionReader::RegisterCmdLineArgument(
44 "NumberOfPoints",
"n",
"Define number of points to dump output");
56 "Reads checkpoint file."),
59 "Reads restart file."),
63 "Reads stability base-flow file.")};
92 if (
m_f->m_comm->TreatAsRankZero())
94 cout <<
"Processing input fld file" << endl;
101 if (
m_f->m_inputfiles.count(
"fld") != 0)
105 else if (
m_f->m_inputfiles.count(
"chk") != 0)
109 else if (
m_f->m_inputfiles.count(
"rst") != 0)
113 else if (
m_f->m_inputfiles.count(
"bse") != 0)
119 ASSERTL0(
false,
"no input file found");
124 if (
m_f->m_data.size() == 0)
130 m_f->m_graph->GetExpansions();
136 if (!expansions.size())
141 m_f->m_exp.resize(1);
144 SpatialDomains::ExpansionMap::const_iterator expIt;
147 for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
149 ElementGIDs[i++] = expIt->second->m_geomShPtr->GetGlobalID();
152 m_f->m_fielddef.clear();
155 m_f->FieldIOForFile(
m_f->m_inputfiles[fldending][0])->Import(
156 m_f->m_inputfiles[fldending][0],
m_f->m_fielddef,
m_f->m_data,
157 m_f->m_fieldMetaDataMap, ElementGIDs);
162 m_f->FieldIOForFile(
m_f->m_inputfiles[fldending][0])->Import(
163 m_f->m_inputfiles[fldending][0],
m_f->m_fielddef,
m_f->m_data,
164 m_f->m_fieldMetaDataMap);
168 if (
m_f->m_exp.size())
170 int nfields, nstrips;
172 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
174 if (vm.count(
"useSessionVariables"))
176 nfields =
m_f->m_session->GetVariables().size();
180 nfields =
m_f->m_fielddef[0]->m_fields.size();
183 m_f->m_exp.resize(nfields * nstrips);
185 vector<string> vars =
m_f->m_session->GetVariables();
188 for (
int s = 0; s < nstrips; ++s)
190 for (i = 0; i < nfields; ++i)
195 if (!
m_f->m_exp[s * nfields + i])
197 m_f->m_exp[s * nfields + i] =
m_f->AppendExpList(
198 m_f->m_fielddef[0]->m_numHomogeneousDir, vars[i]);
205 m_f->m_exp[s * nfields + i] =
m_f->AppendExpList(
206 m_f->m_fielddef[0]->m_numHomogeneousDir, vars[0]);
210 m_f->m_exp[s * nfields + i] =
m_f->AppendExpList(
211 m_f->m_fielddef[0]->m_numHomogeneousDir);
218 for (
int s = 0; s < nstrips; ++s)
220 for (j = 0; j < nfields; ++j)
222 for (i = 0; i <
m_f->m_data.size() / nstrips; ++i)
224 m_f->m_exp[s * nfields + j]->ExtractDataToCoeffs(
225 m_f->m_fielddef[i * nstrips + s],
226 m_f->m_data[i * nstrips + s],
227 m_f->m_fielddef[i * nstrips + s]->m_fields[j],
228 m_f->m_exp[s * nfields + j]->UpdateCoeffs());
230 m_f->m_exp[s * nfields + j]->BwdTrans(
231 m_f->m_exp[s * nfields + j]->GetCoeffs(),
232 m_f->m_exp[s * nfields + j]->UpdatePhys());
238 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
239 m_f->m_exp[0]->GetFieldDefinitions();
240 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
242 for (j = 0; j < nfields; ++j)
244 for (i = 0; i < FieldDef.size(); ++i)
246 FieldDef[i]->m_fields.push_back(
247 m_f->m_fielddef[0]->m_fields[j]);
248 m_f->m_exp[j]->AppendFieldData(FieldDef[i], FieldData[i]);
251 m_f->m_fielddef = FieldDef;
252 m_f->m_data = FieldData;
#define ASSERTL0(condition, msg)
pair< ModuleType, string > ModuleKey
boost::shared_ptr< Field > FieldSharedPtr
std::map< int, ExpansionShPtr > ExpansionMap
ModuleFactory & GetModuleFactory()
FieldSharedPtr m_f
Field object.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.