45 static std::string
npts = LibUtilities::SessionReader::RegisterCmdLineArgument(
46 "NumberOfPoints",
"n",
"Define number of points to dump output");
90 Timer timer, timerpart;
94 int expsize =
m_f->m_exp.size();
104 if(
m_f->m_comm->GetRank() == 0)
106 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>()));
256 int argc = cmdArgs.size();
257 const char **argv =
new const char*[argc];
258 for (
int i = 0; i < argc; ++i)
260 argv[i] = cmdArgs[i].c_str();
271 if(
m_f->m_comm->GetRank() == 0)
277 ss << cpuTime <<
"s";
278 cout <<
"\t InputXml session reader CPU Time: " << setw(8) << left
290 if(
m_f->m_comm->GetRank() == 0)
296 ss << cpuTime <<
"s";
297 cout <<
"\t InputXml mesh graph setup CPU Time: " << setw(8) << left
310 if(!expansions.size())
315 m_f->m_exp.resize(1);
319 int NumHomogeneousDir = 0;
326 SpatialDomains::ExpansionMap::const_iterator expIt;
329 for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
331 ElementGIDs[i++] = expIt->second->m_geomShPtr->GetGlobalID();
334 m_f->m_fld->Import(
m_f->m_inputfiles[fldending][0],
m_f->m_fielddef,
338 NumHomogeneousDir =
m_f->m_fielddef[0]->m_numHomogeneousDir;
342 m_f->m_graph->SetExpansions(
m_f->m_fielddef);
346 if(
m_f->m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
348 std::string HomoStr =
m_f->m_session->GetSolverInfo(
"HOMOGENEOUS");
350 if((HomoStr ==
"HOMOGENEOUS1D") || (HomoStr ==
"Homogeneous1D")
351 || (HomoStr ==
"1D") || (HomoStr ==
"Homo1D"))
353 NumHomogeneousDir = 1;
355 if((HomoStr ==
"HOMOGENEOUS2D") || (HomoStr ==
"Homogeneous2D")
356 || (HomoStr ==
"2D") || (HomoStr ==
"Homo2D"))
358 NumHomogeneousDir = 2;
368 if(vm.count(
"output-points"))
370 nPointsNew = vm[
"output-points"].as<
int>();
374 m_f->m_graph->SetExpansionsToEvenlySpacedPoints(nPointsNew);
378 if(vm.count(
"output-points"))
380 int nPointsNew = vm[
"output-points"].as<
int>();
381 m_f->m_graph->SetExpansionsToPointOrder(nPointsNew);
387 if(
m_f->m_comm->GetRank() == 0)
393 ss << cpuTime <<
"s";
394 cout <<
"\t InputXml setexpansion CPU Time: " << setw(8) << left
402 if(
m_f->m_comm->GetRank() == 0)
408 ss << cpuTime <<
"s";
409 cout <<
"\t InputXml setexpansion CPU Time: " << setw(8) << left
416 if(NumHomogeneousDir == 1 && vm.count(
"output-points-hom-z"))
418 int expdim =
m_f->m_graph->GetMeshDimension();
419 m_f->m_fielddef[0]->m_numModes[expdim] = vm[
"output-points-hom-z"].as<
int>();
422 m_f->m_exp[0] =
m_f->SetUpFirstExpList(NumHomogeneousDir,fldfilegiven);
426 if(
m_f->m_comm->GetRank() == 0)
433 ss1 << cpuTime <<
"s";
434 cout <<
"\t InputXml set first exp CPU Time: " << setw(8) << left
435 << ss1.str() << endl;
442 ss << cpuTime <<
"s";
443 cout <<
"InputXml CPU Time: " << setw(8) << left
#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.