46 static std::string
npts = LibUtilities::SessionReader::RegisterCmdLineArgument(
47 "NumberOfPoints",
"n",
"Define number of points to dump output");
95 int expsize =
m_f->m_exp.size();
105 if(
m_f->m_comm->GetRank() == 0)
107 cout <<
"Processing input xml file" << endl;
115 bool fldfilegiven =
true;
118 if(
m_f->m_inputfiles.count(
"fld") != 0)
122 else if(
m_f->m_inputfiles.count(
"chk") != 0)
126 else if (
m_f->m_inputfiles.count(
"rst") != 0)
132 fldfilegiven =
false;
135 string xml_ending =
"xml";
136 string xml_gz_ending =
"xml.gz";
138 std::vector<std::string> files;
140 for (
int i = 0; i <
m_f->m_inputfiles[xml_ending].size(); ++i)
142 files.push_back(
m_f->m_inputfiles[xml_ending][i]);
146 for (
int j =0; j <
m_f->m_inputfiles[xml_gz_ending].size(); ++j)
148 files.push_back(
m_f->m_inputfiles[xml_gz_ending][j]);
156 if(vm.count(
"range"))
158 vector<NekDouble> values;
160 vm[
"range"].as<string>().c_str(), values),
161 "Failed to interpret range string");
164 "Do not have minimum values of xmin,xmax");
166 "Do not have an even number of range values");
168 int nvalues = values.size()/2;
172 rng->m_doZrange =
false;
173 rng->m_doYrange =
false;
174 rng->m_checkShape =
false;
179 rng->m_doZrange =
true;
180 rng->m_zmin = values[4];
181 rng->m_zmax = values[5];
183 rng->m_doYrange =
true;
184 rng->m_ymin = values[2];
185 rng->m_ymax = values[3];
187 rng->m_doXrange =
true;
188 rng->m_xmin = values[0];
189 rng->m_xmax = values[1];
192 ASSERTL0(
false,
"too many values specfied in range");
197 if(vm.count(
"onlyshape"))
203 rng->m_doXrange =
false;
204 rng->m_doYrange =
false;
205 rng->m_doZrange =
false;
208 rng->m_checkShape =
true;
211 boost::to_upper_copy(vm[
"onlyshape"].as<string>());
216 boost::to_upper(shapeval);
217 if(shapematch.compare(shapeval) == 0)
223 ASSERTL0(i != LibUtilities::SIZE_ShapeType,
224 "Failed to find shape type in -onlyshape command line "
229 vector<string> cmdArgs;
230 cmdArgs.push_back(
"FieldConvert");
234 cmdArgs.push_back(
"--verbose");
237 if(vm.count(
"shared-filesystem"))
239 cmdArgs.push_back(
"--shared-filesystem");
242 if(vm.count(
"part-only"))
244 cmdArgs.push_back(
"--part-only");
246 boost::lexical_cast<string>(vm[
"part-only"].as<int>()));
249 if(vm.count(
"part-only-overlapping"))
251 cmdArgs.push_back(
"--part-only-overlapping");
253 boost::lexical_cast<string>(vm[
"part-only-overlapping"].as<int>()));
258 cmdArgs.push_back(
"--npz");
260 boost::lexical_cast<string>(vm[
"npz"].as<int>()));
263 int argc = cmdArgs.size();
264 const char **argv =
new const char*[argc];
265 for (
int i = 0; i < argc; ++i)
267 argv[i] = cmdArgs[i].c_str();
278 if(
m_f->m_comm->GetRank() == 0)
284 ss << cpuTime <<
"s";
285 cout <<
"\t InputXml session reader CPU Time: " << setw(8) << left
297 if(
m_f->m_comm->GetRank() == 0)
303 ss << cpuTime <<
"s";
304 cout <<
"\t InputXml mesh graph setup CPU Time: " << setw(8) << left
317 if(!expansions.size())
322 m_f->m_exp.resize(1);
326 int NumHomogeneousDir = 0;
333 SpatialDomains::ExpansionMap::const_iterator expIt;
336 for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
338 ElementGIDs[i++] = expIt->second->m_geomShPtr->GetGlobalID();
341 m_f->m_fld->Import(
m_f->m_inputfiles[fldending][0],
m_f->m_fielddef,
345 NumHomogeneousDir =
m_f->m_fielddef[0]->m_numHomogeneousDir;
349 m_f->m_graph->SetExpansions(
m_f->m_fielddef);
353 if(
m_f->m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
355 std::string HomoStr =
m_f->m_session->GetSolverInfo(
"HOMOGENEOUS");
357 if((HomoStr ==
"HOMOGENEOUS1D") || (HomoStr ==
"Homogeneous1D")
358 || (HomoStr ==
"1D") || (HomoStr ==
"Homo1D"))
360 NumHomogeneousDir = 1;
362 if((HomoStr ==
"HOMOGENEOUS2D") || (HomoStr ==
"Homogeneous2D")
363 || (HomoStr ==
"2D") || (HomoStr ==
"Homo2D"))
365 NumHomogeneousDir = 2;
375 if(vm.count(
"output-points"))
377 nPointsNew = vm[
"output-points"].as<
int>();
381 m_f->m_graph->SetExpansionsToEvenlySpacedPoints(nPointsNew);
385 if(vm.count(
"output-points"))
387 int nPointsNew = vm[
"output-points"].as<
int>();
388 m_f->m_graph->SetExpansionsToPointOrder(nPointsNew);
394 if(
m_f->m_comm->GetRank() == 0)
400 ss << cpuTime <<
"s";
401 cout <<
"\t InputXml setexpansion CPU Time: " << setw(8) << left
408 if(NumHomogeneousDir == 1 && vm.count(
"output-points-hom-z"))
410 int expdim =
m_f->m_graph->GetMeshDimension();
411 m_f->m_fielddef[0]->m_numModes[expdim] = vm[
"output-points-hom-z"].as<
int>();
414 m_f->m_exp[0] =
m_f->SetUpFirstExpList(NumHomogeneousDir,fldfilegiven);
418 if(
m_f->m_comm->GetRank() == 0)
425 ss1 << cpuTime <<
"s";
426 cout <<
"\t InputXml set first exp CPU Time: " << setw(8) << left
427 << ss1.str() << endl;
#define ASSERTL0(condition, msg)
pair< ModuleType, string > ModuleKey
static boost::shared_ptr< MeshGraph > Read(const LibUtilities::SessionReaderSharedPtr &pSession, DomainRangeShPtr &rng=NullDomainRangeShPtr)
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
FieldSharedPtr m_f
Field object.
const char *const ShapeTypeMap[]
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
static std::vector< std::vector< NekDouble > > NullVectorNekDoubleVector
boost::shared_ptr< DomainRange > DomainRangeShPtr
boost::shared_ptr< Field > FieldSharedPtr
static DomainRangeShPtr NullDomainRangeShPtr
static bool GenerateUnOrderedVector(const char *const str, std::vector< NekDouble > &vec)
NekDouble TimePerTest(unsigned int n)
Returns amount of seconds per iteration in a test with n iterations.
static FieldMetaDataMap NullFieldMetaDataMap
std::map< int, ExpansionShPtr > ExpansionMap
ModuleFactory & GetModuleFactory()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.