Commit d87e71d3 authored by Dave Moxey's avatar Dave Moxey Committed by Spencer Sherwin

Fix formatting

parent 6b321c75
......@@ -50,14 +50,16 @@ namespace Utilities
ModuleKey ProcessHomogeneousPlane::className =
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eProcessModule, "homplane"),
ProcessHomogeneousPlane::create, "Extracts a plane from a 3DH1D expansion, requires planeid to be defined.");
ProcessHomogeneousPlane::create,
"Extracts a plane from a 3DH1D expansion, requires planeid to be "
"defined.");
ProcessHomogeneousPlane::ProcessHomogeneousPlane(FieldSharedPtr f) : ProcessModule(f)
ProcessHomogeneousPlane::ProcessHomogeneousPlane(FieldSharedPtr f)
: ProcessModule(f)
{
m_config["planeid"] = ConfigOption(false, "NotSet",
"plane id to extract");
m_config["wavespace"] = ConfigOption(true, "NotSet",
"Extract plane in Fourier space");
m_config["planeid"] = ConfigOption(false, "NotSet", "plane id to extract");
m_config["wavespace"] =
ConfigOption(true, "NotSet", "Extract plane in Fourier space");
}
ProcessHomogeneousPlane::~ProcessHomogeneousPlane()
......@@ -73,50 +75,54 @@ void ProcessHomogeneousPlane::Process(po::variables_map &vm)
if ((m_f->m_fielddef[0]->m_numHomogeneousDir) != 1)
{
ASSERTL0(false, "ProcessHomogeneousPlane only works for Homogeneous1D.");
ASSERTL0(false,
"ProcessHomogeneousPlane only works for Homogeneous1D.");
}
ASSERTL0(m_config["planeid"].m_beenSet,
"Missing parameter planeid for ProcessHomogeneousPlane");
int planeid = m_config["planeid"].as<int>();
int nfields = m_f->m_fielddef[0]->m_fields.size();
int nstrips;
m_f->m_session->LoadParameter("Strip_Z",nstrips,1);
m_f->m_session->LoadParameter("Strip_Z", nstrips, 1);
for(int s = 0; s < nstrips; ++s)
for (int s = 0; s < nstrips; ++s)
{
for (int i = 0; i < nfields; ++i)
{
int n = s*nfields + i;
int n = s * nfields + i;
m_f->m_exp[n] = m_f->m_exp[n]->GetPlane(planeid);
if( m_config["wavespace"].m_beenSet)
if (m_config["wavespace"].m_beenSet)
{
m_f->m_exp[n]->BwdTrans(m_f->m_exp[n]->GetCoeffs(),
m_f->m_exp[n]->UpdatePhys());
m_f->m_exp[n]->UpdatePhys());
}
else
{
m_f->m_exp[n]->FwdTrans(m_f->m_exp[n]->GetPhys(),
m_f->m_exp[n]->UpdateCoeffs());
m_f->m_exp[n]->UpdateCoeffs());
}
}
}
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
= m_f->m_exp[0]->GetFieldDefinitions();
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
m_f->m_exp[0]->GetFieldDefinitions();
std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
for(int s = 0; s < nstrips; ++s)
for (int s = 0; s < nstrips; ++s)
{
for (int j = 0; j < nfields; ++j)
{
for (int i = 0; i < FieldDef.size()/nstrips; ++i)
for (int i = 0; i < FieldDef.size() / nstrips; ++i)
{
int n = s * FieldDef.size()/nstrips + i;
int n = s * FieldDef.size() / nstrips + i;
FieldDef[n]->m_fields.push_back(m_f->m_fielddef[0]->m_fields[j]);
m_f->m_exp[s*nfields+j]->AppendFieldData(FieldDef[n], FieldData[n]);
FieldDef[n]->m_fields.push_back(
m_f->m_fielddef[0]->m_fields[j]);
m_f->m_exp[s * nfields + j]->AppendFieldData(FieldDef[n],
FieldData[n]);
}
}
}
......@@ -124,6 +130,5 @@ void ProcessHomogeneousPlane::Process(po::variables_map &vm)
m_f->m_fielddef = FieldDef;
m_f->m_data = FieldData;
}
}
}
......@@ -42,26 +42,27 @@ namespace Nektar
{
namespace Utilities
{
/**
* @brief This processing module replaces all expansions by a single plane
* from 3DH1D fields, defined by the parameter planeid
* @brief This processing module replaces all expansions by a single plane from
* 3DH1D fields, defined by the parameter planeid
*/
class ProcessHomogeneousPlane : public ProcessModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f) {
return MemoryManager<ProcessHomogeneousPlane>::AllocateSharedPtr(f);
}
static ModuleKey className;
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<ProcessHomogeneousPlane>::AllocateSharedPtr(f);
}
static ModuleKey className;
ProcessHomogeneousPlane(FieldSharedPtr f);
virtual ~ProcessHomogeneousPlane();
ProcessHomogeneousPlane(FieldSharedPtr f);
virtual ~ProcessHomogeneousPlane();
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
};
}
}
......
......@@ -50,7 +50,8 @@ namespace Utilities
ModuleKey ProcessMeanMode::className =
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eProcessModule, "meanmode"),
ProcessMeanMode::create, "Extract mean mode from 3DH1D.");
ProcessMeanMode::create,
"Extract mean mode from 3DH1D.");
ProcessMeanMode::ProcessMeanMode(FieldSharedPtr f) : ProcessHomogeneousPlane(f)
{
......@@ -66,18 +67,17 @@ void ProcessMeanMode::Process(po::variables_map &vm)
{
cout << "ProcessMeanMode: Extracting mean mode..." << endl;
}
if (m_f->m_fielddef[0]->m_homogeneousZIDs[0] != 0)
{
ASSERTL0(false, "ProcessMeanMode: mean mode not found.");
}
// Set parameters for mean mode
RegisterConfig("planeid" , "0");
RegisterConfig("planeid", "0");
RegisterConfig("wavespace", "1");
ProcessHomogeneousPlane::Process(vm);
}
}
}
......@@ -44,25 +44,25 @@ namespace Nektar
namespace Utilities
{
/**
* @brief This processing module replaces all expansions by the mean mode
* from 3DH1D fields
* @brief This processing module replaces all expansions by the mean mode from
* 3DH1D fields
*/
class ProcessMeanMode : public ProcessHomogeneousPlane
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f) {
return MemoryManager<ProcessMeanMode>::AllocateSharedPtr(f);
}
static ModuleKey className;
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f)
{
return MemoryManager<ProcessMeanMode>::AllocateSharedPtr(f);
}
static ModuleKey className;
ProcessMeanMode(FieldSharedPtr f);
virtual ~ProcessMeanMode();
ProcessMeanMode(FieldSharedPtr f);
virtual ~ProcessMeanMode();
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
};
}
}
......
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