39 #include <boost/core/ignore_unused.hpp> 50 ModuleKey ProcessHomogeneousPlane::className =
53 ProcessHomogeneousPlane::create,
54 "Extracts a plane from a 3DH1D expansion, requires planeid to be " 62 ConfigOption(
true,
"0",
"Extract plane in Fourier space");
71 boost::ignore_unused(vm);
74 "ProcessHomogeneousPlane only works for Homogeneous1D.");
75 m_f->m_numHomogeneousDir = 0;
78 if (
m_f->m_exp[0]->GetNumElmts() == 0)
84 "Missing parameter planeid for ProcessHomogeneousPlane");
86 int planeid =
m_config[
"planeid"].as<
int>();
87 int nfields =
m_f->m_variables.size();
90 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
94 for (
int i = 0; i <
m_f->m_exp[0]->GetZIDs().num_elements(); ++i)
96 if (
m_f->m_exp[0]->GetZIDs()[i] == planeid)
104 for (
int s = 0; s < nstrips; ++s)
106 for (
int i = 0; i < nfields; ++i)
108 int n = s * nfields + i;
109 m_f->m_exp[n] =
m_f->m_exp[n]->GetPlane(plane);
111 if (
m_config[
"wavespace"].as<bool>())
113 m_f->m_exp[n]->BwdTrans(
m_f->m_exp[n]->GetCoeffs(),
114 m_f->m_exp[n]->UpdatePhys());
118 m_f->m_exp[n]->FwdTrans_IterPerExp(
m_f->m_exp[n]->GetPhys(),
119 m_f->m_exp[n]->UpdateCoeffs());
131 std::vector<std::string> files;
132 for (
int i = 0; i <
m_f->m_inputfiles[
"xml"].size(); ++i)
134 files.push_back(
m_f->m_inputfiles[
"xml"][i]);
136 for (
int j = 0; j <
m_f->m_inputfiles[
"xml.gz"].size(); ++j)
138 files.push_back(
m_f->m_inputfiles[
"xml.gz"][j]);
140 vector<string> cmdArgs;
141 cmdArgs.push_back(
"FieldConvert");
144 cmdArgs.push_back(
"--verbose");
146 int argc = cmdArgs.size();
147 const char **argv =
new const char *[argc];
148 for (
int i = 0; i < argc; ++i)
150 argv[i] = cmdArgs[i].c_str();
153 argc, (
char **)argv, files,
m_f->m_comm->GetRowComm());
154 m_f->m_session->InitSession();
159 for (
int s = 0; s < nstrips; ++s)
161 for (
int i = 0; i < nfields; ++i)
163 int n = s * nfields + i;
#define ASSERTL0(condition, msg)
virtual void Process(po::variables_map &vm)
Write mesh to output file.
std::map< std::string, ConfigOption > m_config
List of configuration values.
Represents a command-line configuration option.
std::shared_ptr< Field > FieldSharedPtr
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
std::pair< ModuleType, std::string > ModuleKey
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
virtual ~ProcessHomogeneousPlane()
Abstract base class for processing modules.
ModuleFactory & GetModuleFactory()
FieldSharedPtr m_f
Field object.