Commit bb58000f authored by Spencer Sherwin's avatar Spencer Sherwin

Modifications related to OutputInfo.cpp in FieldConvert

parent f82b6885
......@@ -1533,7 +1533,5 @@ namespace Nektar
return datasize;
}
}
}
......@@ -192,6 +192,13 @@ namespace Nektar
const std::vector<FieldDefinitionsSharedPtr> &fielddefs,
std::vector<std::vector<NekDouble> > &fielddata);
LIB_UTILITIES_EXPORT void WriteMultiFldFileIDs(
const std::string &outfile,
const std::vector<std::string> fileNames,
std::vector<std::vector<unsigned int> > &elementList,
const FieldMetaDataMap &fieldinfomap = NullFieldMetaDataMap);
private:
/// Communicator to use when writing parallel format
LibUtilities::CommSharedPtr m_comm;
......@@ -209,12 +216,6 @@ namespace Nektar
const std::vector<FieldDefinitionsSharedPtr> &fielddefs,
const FieldMetaDataMap &fieldmetadatamap);
LIB_UTILITIES_EXPORT void WriteMultiFldFileIDs(
const std::string &outfile,
const std::vector<std::string> fileNames,
std::vector<std::vector<unsigned int> > &elementList,
const FieldMetaDataMap &fieldinfomap = NullFieldMetaDataMap);
LIB_UTILITIES_EXPORT void ImportMultiFldFileIDs(
const std::string &inFile,
std::vector<std::string> &fileNames,
......
......@@ -1296,5 +1296,19 @@ namespace Nektar
}
}
void MeshPartition::GetElementIDs(const int procid, std::vector<unsigned int> &elmtid)
{
BoostVertexIterator vertit, vertit_end;
ASSERTL0(procid < m_localPartition.size(),"procid is less than the number of partitions");
// Populate lists of elements, edges and vertices required.
for ( boost::tie(vertit, vertit_end) = boost::vertices(m_localPartition[procid]);
vertit != vertit_end;
++vertit)
{
elmtid.push_back(m_meshElements[m_localPartition[procid][*vertit].id].id);
}
}
}
}
......@@ -70,6 +70,9 @@ namespace Nektar
LIB_UTILITIES_EXPORT void GetBndRegionOrdering(
BndRegionOrdering &composites);
LIB_UTILITIES_EXPORT void GetElementIDs(const int procid,
std::vector<unsigned int> &tmp);
private:
struct MeshEntity
{
......
......@@ -2285,5 +2285,10 @@ namespace Nektar
}
}
}
void SessionReader::SetUpXmlDoc(void)
{
m_xmlDoc = MergeDoc(m_filenames);
}
}
}
......@@ -118,7 +118,7 @@ namespace Nektar
public boost::enable_shared_from_this<SessionReader>
{
public:
/// Support creation through MemoryManager only.
/// Support creation through MemoryManager.
friend class MemoryManager<SessionReader>;
/**
......@@ -163,6 +163,12 @@ namespace Nektar
return p;
}
LIB_UTILITIES_EXPORT SessionReader(
int argc,
char *argv[],
const std::vector<std::string> &pFilenames,
const CommSharedPtr &pComm);
/// Destructor
LIB_UTILITIES_EXPORT ~SessionReader();
......@@ -391,6 +397,8 @@ namespace Nektar
LIB_UTILITIES_EXPORT CompositeOrdering GetCompositeOrdering() const;
LIB_UTILITIES_EXPORT BndRegionOrdering GetBndRegionOrdering() const;
LIB_UTILITIES_EXPORT void SetUpXmlDoc();
private:
boost::program_options::variables_map m_cmdLineOptions;
......@@ -442,11 +450,7 @@ namespace Nektar
LIB_UTILITIES_EXPORT SessionReader(
int argc,
char *argv[]);
LIB_UTILITIES_EXPORT SessionReader(
int argc,
char *argv[],
const std::vector<std::string> &pFilenames,
const CommSharedPtr &pComm);
LIB_UTILITIES_EXPORT void InitSession();
/// Returns a shared pointer to the current object.
......@@ -470,6 +474,7 @@ namespace Nektar
LIB_UTILITIES_EXPORT void CreateComm(
int &argc,
char* argv[]);
/// Partitions the mesh when running in parallel.
LIB_UTILITIES_EXPORT void PartitionMesh();
/// Partitions the comm object based on session parameters.
......
......@@ -4,6 +4,7 @@ SET(FieldConvertHeaders
InputFld.h
InputXml.h
InputPts.h
OutputInfo.h
OutputTecplot.h
OutputVtk.h
OutputFld.h
......@@ -24,6 +25,7 @@ SET(FieldConvertSources
InputFld.cpp
InputXml.cpp
InputPts.cpp
OutputInfo.cpp
OutputTecplot.cpp
OutputVtk.cpp
OutputFld.cpp
......
......@@ -48,13 +48,15 @@ int main(int argc, char* argv[])
desc.add_options()
("help,h", "Produce this help message.")
("modules-list,l", "Print the list of available modules.")
("output-points,n",po::value<string>(),
("output-points,n",po::value<int>(),
"Output at p equipspaced points (for .dat, .vtk).")
("error,e", "write error of fields for regression checking")
("range,r",po::value<string>(),
"define output range i.e. (-r xmin,xmax,ymin,ymax,zmin,zmax) in which any vertex is contained .")
("singleproc,s",po::value<string>(),
"process as single procid of a partition of size nproc i.e. (-s nproc,procid).")
("nprocs",po::value<int>(),
"used to define nprocs if running serial problem to mimic parallel run.")
("procid",po::value<int>(),
"process as single procid of a partition of size nproc (-nproc must be specified).")
("modules-opt,p", po::value<string>(),
"Print options for a module.")
("module,m", po::value<vector<string> >(),
......@@ -185,20 +187,20 @@ int main(int argc, char* argv[])
FieldSharedPtr f = boost::shared_ptr<Field>(new Field());
if (LibUtilities::GetCommFactory().ModuleExists("ParallelMPI"))
{
if(vm.count("singleproc"))
if(vm.count("procid"))
{
vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector(vm["singleproc"].as<string>().c_str(),values),"Failed to interpret singleproc string");
ASSERTL0(values.size() > 1,
"Need to specify nproc and procid");
ASSERTL0(values[0] > values[1],
"Expected nprocs to be specified before procid");
int nprocs = values[0];
int rank = values[1];
int nprocs;
int rank = vm["procid"].as<int>();
if(vm.count("nprocs"))
{
nprocs = vm["nprocs"].as<int>();
}
else
{
ASSERTL0(false,"Must specify --nprocs when using --procid option");
}
LibUtilities::CommSharedPtr vComm = boost::shared_ptr<FieldConvertComm>(new FieldConvertComm(argc, argv, nprocs,rank));
......
......@@ -39,7 +39,6 @@ using namespace std;
#include "InputXml.h"
static std::string npts = LibUtilities::SessionReader::RegisterCmdLineArgument(
"NumberOfPoints","n","Define number of points to dump output");
......@@ -224,9 +223,7 @@ namespace Nektar
if(vm.count("output-points"))
{
LibUtilities::Equation expession(m_f->m_session,
vm["output-points"].as<string>());
nPointsNew = expession.Evaluate();
nPointsNew = vm["output-points"].as<int>();
}
......
......@@ -74,7 +74,7 @@ namespace Nektar
{
for (int i = 0; i < m_f->m_exp.size(); ++i)
{
m_f->m_exp[i]->FillBndCondFromField();
m_f->m_exp[i]->FillBndCondFromField();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment