49 "Extracts a plane from a 3DH1D expansion, requires planeid to be "
57 ConfigOption(
true,
"0",
"Extract plane in Fourier space");
69 "ProcessHomogeneousPlane only works for Homogeneous1D.");
71 m_f->m_numHomogeneousDir = 0;
74 if (
m_f->m_exp[0]->GetNumElmts() == 0)
80 "Missing parameter planeid for ProcessHomogeneousPlane");
82 int planeid =
m_config[
"planeid"].as<
int>();
83 int nfields =
m_f->m_variables.size();
86 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
90 for (
int i = 0; i <
m_f->m_exp[0]->GetZIDs().size(); ++i)
92 if (
m_f->m_exp[0]->GetZIDs()[i] == planeid)
100 for (
int s = 0; s < nstrips; ++s)
102 for (
int i = 0; i < nfields; ++i)
104 int n = s * nfields + i;
105 m_f->m_exp[n] =
m_f->m_exp[n]->GetPlane(plane);
107 if (
m_config[
"wavespace"].as<bool>())
109 m_f->m_exp[n]->BwdTrans(
m_f->m_exp[n]->GetCoeffs(),
110 m_f->m_exp[n]->UpdatePhys());
114 m_f->m_exp[n]->FwdTransLocalElmt(
115 m_f->m_exp[n]->GetPhys(),
116 m_f->m_exp[n]->UpdateCoeffs());
128 std::vector<std::string> files;
129 for (
int i = 0; i <
m_f->m_inputfiles[
"xml"].size(); ++i)
131 files.push_back(
m_f->m_inputfiles[
"xml"][i]);
133 for (
int j = 0; j <
m_f->m_inputfiles[
"xml.gz"].size(); ++j)
135 files.push_back(
m_f->m_inputfiles[
"xml.gz"][j]);
137 vector<string> cmdArgs;
138 cmdArgs.push_back(
"FieldConvert");
141 cmdArgs.push_back(
"--verbose");
143 int argc = cmdArgs.size();
144 const char **argv =
new const char *[argc];
145 for (
int i = 0; i < argc; ++i)
147 argv[i] = cmdArgs[i].c_str();
150 argc, (
char **)argv, files,
m_f->m_comm->GetRowComm());
151 m_f->m_session->InitSession();
156 for (
int s = 0; s < nstrips; ++s)
158 for (
int i = 0; i < nfields; ++i)
160 int n = s * nfields + i;
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
void v_Process(po::variables_map &vm) override
Write mesh to output file.
static ModuleKey className
ProcessHomogeneousPlane(FieldSharedPtr f)
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
~ProcessHomogeneousPlane() override
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
Represents a command-line configuration option.